index.js 802 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const { requestLog } = __webpack_require__(916);
  48. const {
  49. restEndpointMethods
  50. } = __webpack_require__(842);
  51. const Core = __webpack_require__(529);
  52. const CORE_PLUGINS = [
  53. __webpack_require__(190),
  54. __webpack_require__(19), // deprecated: remove in v17
  55. requestLog,
  56. __webpack_require__(148),
  57. restEndpointMethods,
  58. __webpack_require__(430),
  59. __webpack_require__(850) // deprecated: remove in v17
  60. ];
  61. const OctokitRest = Core.plugin(CORE_PLUGINS);
  62. function DeprecatedOctokit(options) {
  63. const warn =
  64. options && options.log && options.log.warn
  65. ? options.log.warn
  66. : console.warn;
  67. warn(
  68. '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
  69. );
  70. return new OctokitRest(options);
  71. }
  72. const Octokit = Object.assign(DeprecatedOctokit, {
  73. Octokit: OctokitRest
  74. });
  75. Object.keys(OctokitRest).forEach(key => {
  76. /* istanbul ignore else */
  77. if (OctokitRest.hasOwnProperty(key)) {
  78. Octokit[key] = OctokitRest[key];
  79. }
  80. });
  81. module.exports = Octokit;
  82. /***/ }),
  83. /***/ 1:
  84. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  85. "use strict";
  86. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  87. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  88. return new (P || (P = Promise))(function (resolve, reject) {
  89. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  90. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  91. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  92. step((generator = generator.apply(thisArg, _arguments || [])).next());
  93. });
  94. };
  95. Object.defineProperty(exports, "__esModule", { value: true });
  96. const childProcess = __webpack_require__(129);
  97. const path = __webpack_require__(622);
  98. const util_1 = __webpack_require__(669);
  99. const ioUtil = __webpack_require__(672);
  100. const exec = util_1.promisify(childProcess.exec);
  101. /**
  102. * Copies a file or folder.
  103. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  104. *
  105. * @param source source path
  106. * @param dest destination path
  107. * @param options optional. See CopyOptions.
  108. */
  109. function cp(source, dest, options = {}) {
  110. return __awaiter(this, void 0, void 0, function* () {
  111. const { force, recursive } = readCopyOptions(options);
  112. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  113. // Dest is an existing file, but not forcing
  114. if (destStat && destStat.isFile() && !force) {
  115. return;
  116. }
  117. // If dest is an existing directory, should copy inside.
  118. const newDest = destStat && destStat.isDirectory()
  119. ? path.join(dest, path.basename(source))
  120. : dest;
  121. if (!(yield ioUtil.exists(source))) {
  122. throw new Error(`no such file or directory: ${source}`);
  123. }
  124. const sourceStat = yield ioUtil.stat(source);
  125. if (sourceStat.isDirectory()) {
  126. if (!recursive) {
  127. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  128. }
  129. else {
  130. yield cpDirRecursive(source, newDest, 0, force);
  131. }
  132. }
  133. else {
  134. if (path.relative(source, newDest) === '') {
  135. // a file cannot be copied to itself
  136. throw new Error(`'${newDest}' and '${source}' are the same file`);
  137. }
  138. yield copyFile(source, newDest, force);
  139. }
  140. });
  141. }
  142. exports.cp = cp;
  143. /**
  144. * Moves a path.
  145. *
  146. * @param source source path
  147. * @param dest destination path
  148. * @param options optional. See MoveOptions.
  149. */
  150. function mv(source, dest, options = {}) {
  151. return __awaiter(this, void 0, void 0, function* () {
  152. if (yield ioUtil.exists(dest)) {
  153. let destExists = true;
  154. if (yield ioUtil.isDirectory(dest)) {
  155. // If dest is directory copy src into dest
  156. dest = path.join(dest, path.basename(source));
  157. destExists = yield ioUtil.exists(dest);
  158. }
  159. if (destExists) {
  160. if (options.force == null || options.force) {
  161. yield rmRF(dest);
  162. }
  163. else {
  164. throw new Error('Destination already exists');
  165. }
  166. }
  167. }
  168. yield mkdirP(path.dirname(dest));
  169. yield ioUtil.rename(source, dest);
  170. });
  171. }
  172. exports.mv = mv;
  173. /**
  174. * Remove a path recursively with force
  175. *
  176. * @param inputPath path to remove
  177. */
  178. function rmRF(inputPath) {
  179. return __awaiter(this, void 0, void 0, function* () {
  180. if (ioUtil.IS_WINDOWS) {
  181. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  182. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  183. try {
  184. if (yield ioUtil.isDirectory(inputPath, true)) {
  185. yield exec(`rd /s /q "${inputPath}"`);
  186. }
  187. else {
  188. yield exec(`del /f /a "${inputPath}"`);
  189. }
  190. }
  191. catch (err) {
  192. // if you try to delete a file that doesn't exist, desired result is achieved
  193. // other errors are valid
  194. if (err.code !== 'ENOENT')
  195. throw err;
  196. }
  197. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  198. try {
  199. yield ioUtil.unlink(inputPath);
  200. }
  201. catch (err) {
  202. // if you try to delete a file that doesn't exist, desired result is achieved
  203. // other errors are valid
  204. if (err.code !== 'ENOENT')
  205. throw err;
  206. }
  207. }
  208. else {
  209. let isDir = false;
  210. try {
  211. isDir = yield ioUtil.isDirectory(inputPath);
  212. }
  213. catch (err) {
  214. // if you try to delete a file that doesn't exist, desired result is achieved
  215. // other errors are valid
  216. if (err.code !== 'ENOENT')
  217. throw err;
  218. return;
  219. }
  220. if (isDir) {
  221. yield exec(`rm -rf "${inputPath}"`);
  222. }
  223. else {
  224. yield ioUtil.unlink(inputPath);
  225. }
  226. }
  227. });
  228. }
  229. exports.rmRF = rmRF;
  230. /**
  231. * Make a directory. Creates the full path with folders in between
  232. * Will throw if it fails
  233. *
  234. * @param fsPath path to create
  235. * @returns Promise<void>
  236. */
  237. function mkdirP(fsPath) {
  238. return __awaiter(this, void 0, void 0, function* () {
  239. yield ioUtil.mkdirP(fsPath);
  240. });
  241. }
  242. exports.mkdirP = mkdirP;
  243. /**
  244. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  245. * If you check and the tool does not exist, it will throw.
  246. *
  247. * @param tool name of the tool
  248. * @param check whether to check if tool exists
  249. * @returns Promise<string> path to tool
  250. */
  251. function which(tool, check) {
  252. return __awaiter(this, void 0, void 0, function* () {
  253. if (!tool) {
  254. throw new Error("parameter 'tool' is required");
  255. }
  256. // recursive when check=true
  257. if (check) {
  258. const result = yield which(tool, false);
  259. if (!result) {
  260. if (ioUtil.IS_WINDOWS) {
  261. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  262. }
  263. else {
  264. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  265. }
  266. }
  267. }
  268. try {
  269. // build the list of extensions to try
  270. const extensions = [];
  271. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  272. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  273. if (extension) {
  274. extensions.push(extension);
  275. }
  276. }
  277. }
  278. // if it's rooted, return it if exists. otherwise return empty.
  279. if (ioUtil.isRooted(tool)) {
  280. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  281. if (filePath) {
  282. return filePath;
  283. }
  284. return '';
  285. }
  286. // if any path separators, return empty
  287. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  288. return '';
  289. }
  290. // build the list of directories
  291. //
  292. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  293. // it feels like we should not do this. Checking the current directory seems like more of a use
  294. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  295. // across platforms.
  296. const directories = [];
  297. if (process.env.PATH) {
  298. for (const p of process.env.PATH.split(path.delimiter)) {
  299. if (p) {
  300. directories.push(p);
  301. }
  302. }
  303. }
  304. // return the first match
  305. for (const directory of directories) {
  306. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  307. if (filePath) {
  308. return filePath;
  309. }
  310. }
  311. return '';
  312. }
  313. catch (err) {
  314. throw new Error(`which failed with message ${err.message}`);
  315. }
  316. });
  317. }
  318. exports.which = which;
  319. function readCopyOptions(options) {
  320. const force = options.force == null ? true : options.force;
  321. const recursive = Boolean(options.recursive);
  322. return { force, recursive };
  323. }
  324. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  325. return __awaiter(this, void 0, void 0, function* () {
  326. // Ensure there is not a run away recursive copy
  327. if (currentDepth >= 255)
  328. return;
  329. currentDepth++;
  330. yield mkdirP(destDir);
  331. const files = yield ioUtil.readdir(sourceDir);
  332. for (const fileName of files) {
  333. const srcFile = `${sourceDir}/${fileName}`;
  334. const destFile = `${destDir}/${fileName}`;
  335. const srcFileStat = yield ioUtil.lstat(srcFile);
  336. if (srcFileStat.isDirectory()) {
  337. // Recurse
  338. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  339. }
  340. else {
  341. yield copyFile(srcFile, destFile, force);
  342. }
  343. }
  344. // Change the mode for the newly created directory
  345. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  346. });
  347. }
  348. // Buffered file copy
  349. function copyFile(srcFile, destFile, force) {
  350. return __awaiter(this, void 0, void 0, function* () {
  351. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  352. // unlink/re-link it
  353. try {
  354. yield ioUtil.lstat(destFile);
  355. yield ioUtil.unlink(destFile);
  356. }
  357. catch (e) {
  358. // Try to override file permission
  359. if (e.code === 'EPERM') {
  360. yield ioUtil.chmod(destFile, '0666');
  361. yield ioUtil.unlink(destFile);
  362. }
  363. // other errors = it doesn't exist, no work to do
  364. }
  365. // Copy over symlink
  366. const symlinkFull = yield ioUtil.readlink(srcFile);
  367. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  368. }
  369. else if (!(yield ioUtil.exists(destFile)) || force) {
  370. yield ioUtil.copyFile(srcFile, destFile);
  371. }
  372. });
  373. }
  374. //# sourceMappingURL=io.js.map
  375. /***/ }),
  376. /***/ 2:
  377. /***/ (function(module, __unusedexports, __webpack_require__) {
  378. "use strict";
  379. const os = __webpack_require__(87);
  380. const macosRelease = __webpack_require__(118);
  381. const winRelease = __webpack_require__(49);
  382. const osName = (platform, release) => {
  383. if (!platform && release) {
  384. throw new Error('You can\'t specify a `release` without specifying `platform`');
  385. }
  386. platform = platform || os.platform();
  387. let id;
  388. if (platform === 'darwin') {
  389. if (!release && os.platform() === 'darwin') {
  390. release = os.release();
  391. }
  392. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  393. id = release ? macosRelease(release).name : '';
  394. return prefix + (id ? ' ' + id : '');
  395. }
  396. if (platform === 'linux') {
  397. if (!release && os.platform() === 'linux') {
  398. release = os.release();
  399. }
  400. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  401. return 'Linux' + (id ? ' ' + id : '');
  402. }
  403. if (platform === 'win32') {
  404. if (!release && os.platform() === 'win32') {
  405. release = os.release();
  406. }
  407. id = release ? winRelease(release) : '';
  408. return 'Windows' + (id ? ' ' + id : '');
  409. }
  410. return platform;
  411. };
  412. module.exports = osName;
  413. /***/ }),
  414. /***/ 3:
  415. /***/ (function(module, __unusedexports, __webpack_require__) {
  416. var once = __webpack_require__(969);
  417. var noop = function() {};
  418. var isRequest = function(stream) {
  419. return stream.setHeader && typeof stream.abort === 'function';
  420. };
  421. var isChildProcess = function(stream) {
  422. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  423. };
  424. var eos = function(stream, opts, callback) {
  425. if (typeof opts === 'function') return eos(stream, null, opts);
  426. if (!opts) opts = {};
  427. callback = once(callback || noop);
  428. var ws = stream._writableState;
  429. var rs = stream._readableState;
  430. var readable = opts.readable || (opts.readable !== false && stream.readable);
  431. var writable = opts.writable || (opts.writable !== false && stream.writable);
  432. var cancelled = false;
  433. var onlegacyfinish = function() {
  434. if (!stream.writable) onfinish();
  435. };
  436. var onfinish = function() {
  437. writable = false;
  438. if (!readable) callback.call(stream);
  439. };
  440. var onend = function() {
  441. readable = false;
  442. if (!writable) callback.call(stream);
  443. };
  444. var onexit = function(exitCode) {
  445. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  446. };
  447. var onerror = function(err) {
  448. callback.call(stream, err);
  449. };
  450. var onclose = function() {
  451. process.nextTick(onclosenexttick);
  452. };
  453. var onclosenexttick = function() {
  454. if (cancelled) return;
  455. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  456. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  457. };
  458. var onrequest = function() {
  459. stream.req.on('finish', onfinish);
  460. };
  461. if (isRequest(stream)) {
  462. stream.on('complete', onfinish);
  463. stream.on('abort', onclose);
  464. if (stream.req) onrequest();
  465. else stream.on('request', onrequest);
  466. } else if (writable && !ws) { // legacy streams
  467. stream.on('end', onlegacyfinish);
  468. stream.on('close', onlegacyfinish);
  469. }
  470. if (isChildProcess(stream)) stream.on('exit', onexit);
  471. stream.on('end', onend);
  472. stream.on('finish', onfinish);
  473. if (opts.error !== false) stream.on('error', onerror);
  474. stream.on('close', onclose);
  475. return function() {
  476. cancelled = true;
  477. stream.removeListener('complete', onfinish);
  478. stream.removeListener('abort', onclose);
  479. stream.removeListener('request', onrequest);
  480. if (stream.req) stream.req.removeListener('finish', onfinish);
  481. stream.removeListener('end', onlegacyfinish);
  482. stream.removeListener('close', onlegacyfinish);
  483. stream.removeListener('finish', onfinish);
  484. stream.removeListener('exit', onexit);
  485. stream.removeListener('end', onend);
  486. stream.removeListener('error', onerror);
  487. stream.removeListener('close', onclose);
  488. };
  489. };
  490. module.exports = eos;
  491. /***/ }),
  492. /***/ 9:
  493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  494. "use strict";
  495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  497. return new (P || (P = Promise))(function (resolve, reject) {
  498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  502. });
  503. };
  504. Object.defineProperty(exports, "__esModule", { value: true });
  505. const os = __webpack_require__(87);
  506. const events = __webpack_require__(614);
  507. const child = __webpack_require__(129);
  508. /* eslint-disable @typescript-eslint/unbound-method */
  509. const IS_WINDOWS = process.platform === 'win32';
  510. /*
  511. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  512. */
  513. class ToolRunner extends events.EventEmitter {
  514. constructor(toolPath, args, options) {
  515. super();
  516. if (!toolPath) {
  517. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  518. }
  519. this.toolPath = toolPath;
  520. this.args = args || [];
  521. this.options = options || {};
  522. }
  523. _debug(message) {
  524. if (this.options.listeners && this.options.listeners.debug) {
  525. this.options.listeners.debug(message);
  526. }
  527. }
  528. _getCommandString(options, noPrefix) {
  529. const toolPath = this._getSpawnFileName();
  530. const args = this._getSpawnArgs(options);
  531. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  532. if (IS_WINDOWS) {
  533. // Windows + cmd file
  534. if (this._isCmdFile()) {
  535. cmd += toolPath;
  536. for (const a of args) {
  537. cmd += ` ${a}`;
  538. }
  539. }
  540. // Windows + verbatim
  541. else if (options.windowsVerbatimArguments) {
  542. cmd += `"${toolPath}"`;
  543. for (const a of args) {
  544. cmd += ` ${a}`;
  545. }
  546. }
  547. // Windows (regular)
  548. else {
  549. cmd += this._windowsQuoteCmdArg(toolPath);
  550. for (const a of args) {
  551. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  552. }
  553. }
  554. }
  555. else {
  556. // OSX/Linux - this can likely be improved with some form of quoting.
  557. // creating processes on Unix is fundamentally different than Windows.
  558. // on Unix, execvp() takes an arg array.
  559. cmd += toolPath;
  560. for (const a of args) {
  561. cmd += ` ${a}`;
  562. }
  563. }
  564. return cmd;
  565. }
  566. _processLineBuffer(data, strBuffer, onLine) {
  567. try {
  568. let s = strBuffer + data.toString();
  569. let n = s.indexOf(os.EOL);
  570. while (n > -1) {
  571. const line = s.substring(0, n);
  572. onLine(line);
  573. // the rest of the string ...
  574. s = s.substring(n + os.EOL.length);
  575. n = s.indexOf(os.EOL);
  576. }
  577. strBuffer = s;
  578. }
  579. catch (err) {
  580. // streaming lines to console is best effort. Don't fail a build.
  581. this._debug(`error processing line. Failed with error ${err}`);
  582. }
  583. }
  584. _getSpawnFileName() {
  585. if (IS_WINDOWS) {
  586. if (this._isCmdFile()) {
  587. return process.env['COMSPEC'] || 'cmd.exe';
  588. }
  589. }
  590. return this.toolPath;
  591. }
  592. _getSpawnArgs(options) {
  593. if (IS_WINDOWS) {
  594. if (this._isCmdFile()) {
  595. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  596. for (const a of this.args) {
  597. argline += ' ';
  598. argline += options.windowsVerbatimArguments
  599. ? a
  600. : this._windowsQuoteCmdArg(a);
  601. }
  602. argline += '"';
  603. return [argline];
  604. }
  605. }
  606. return this.args;
  607. }
  608. _endsWith(str, end) {
  609. return str.endsWith(end);
  610. }
  611. _isCmdFile() {
  612. const upperToolPath = this.toolPath.toUpperCase();
  613. return (this._endsWith(upperToolPath, '.CMD') ||
  614. this._endsWith(upperToolPath, '.BAT'));
  615. }
  616. _windowsQuoteCmdArg(arg) {
  617. // for .exe, apply the normal quoting rules that libuv applies
  618. if (!this._isCmdFile()) {
  619. return this._uvQuoteCmdArg(arg);
  620. }
  621. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  622. // the libuv rules are generic and are not designed specifically for cmd.exe
  623. // command line parser.
  624. //
  625. // for a detailed description of the cmd.exe command line parser, refer to
  626. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  627. // need quotes for empty arg
  628. if (!arg) {
  629. return '""';
  630. }
  631. // determine whether the arg needs to be quoted
  632. const cmdSpecialChars = [
  633. ' ',
  634. '\t',
  635. '&',
  636. '(',
  637. ')',
  638. '[',
  639. ']',
  640. '{',
  641. '}',
  642. '^',
  643. '=',
  644. ';',
  645. '!',
  646. "'",
  647. '+',
  648. ',',
  649. '`',
  650. '~',
  651. '|',
  652. '<',
  653. '>',
  654. '"'
  655. ];
  656. let needsQuotes = false;
  657. for (const char of arg) {
  658. if (cmdSpecialChars.some(x => x === char)) {
  659. needsQuotes = true;
  660. break;
  661. }
  662. }
  663. // short-circuit if quotes not needed
  664. if (!needsQuotes) {
  665. return arg;
  666. }
  667. // the following quoting rules are very similar to the rules that by libuv applies.
  668. //
  669. // 1) wrap the string in quotes
  670. //
  671. // 2) double-up quotes - i.e. " => ""
  672. //
  673. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  674. // doesn't work well with a cmd.exe command line.
  675. //
  676. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  677. // for example, the command line:
  678. // foo.exe "myarg:""my val"""
  679. // is parsed by a .NET console app into an arg array:
  680. // [ "myarg:\"my val\"" ]
  681. // which is the same end result when applying libuv quoting rules. although the actual
  682. // command line from libuv quoting rules would look like:
  683. // foo.exe "myarg:\"my val\""
  684. //
  685. // 3) double-up slashes that precede a quote,
  686. // e.g. hello \world => "hello \world"
  687. // hello\"world => "hello\\""world"
  688. // hello\\"world => "hello\\\\""world"
  689. // hello world\ => "hello world\\"
  690. //
  691. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  692. // the reasons for including this as a .cmd quoting rule are:
  693. //
  694. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  695. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  696. //
  697. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  698. // haven't heard any complaints about that aspect.
  699. //
  700. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  701. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  702. // by using %%.
  703. //
  704. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  705. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  706. //
  707. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  708. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  709. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  710. // to an external program.
  711. //
  712. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  713. // % can be escaped within a .cmd file.
  714. let reverse = '"';
  715. let quoteHit = true;
  716. for (let i = arg.length; i > 0; i--) {
  717. // walk the string in reverse
  718. reverse += arg[i - 1];
  719. if (quoteHit && arg[i - 1] === '\\') {
  720. reverse += '\\'; // double the slash
  721. }
  722. else if (arg[i - 1] === '"') {
  723. quoteHit = true;
  724. reverse += '"'; // double the quote
  725. }
  726. else {
  727. quoteHit = false;
  728. }
  729. }
  730. reverse += '"';
  731. return reverse
  732. .split('')
  733. .reverse()
  734. .join('');
  735. }
  736. _uvQuoteCmdArg(arg) {
  737. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  738. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  739. // is used.
  740. //
  741. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  742. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  743. // pasting copyright notice from Node within this function:
  744. //
  745. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  746. //
  747. // Permission is hereby granted, free of charge, to any person obtaining a copy
  748. // of this software and associated documentation files (the "Software"), to
  749. // deal in the Software without restriction, including without limitation the
  750. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  751. // sell copies of the Software, and to permit persons to whom the Software is
  752. // furnished to do so, subject to the following conditions:
  753. //
  754. // The above copyright notice and this permission notice shall be included in
  755. // all copies or substantial portions of the Software.
  756. //
  757. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  758. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  759. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  760. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  761. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  762. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  763. // IN THE SOFTWARE.
  764. if (!arg) {
  765. // Need double quotation for empty argument
  766. return '""';
  767. }
  768. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  769. // No quotation needed
  770. return arg;
  771. }
  772. if (!arg.includes('"') && !arg.includes('\\')) {
  773. // No embedded double quotes or backslashes, so I can just wrap
  774. // quote marks around the whole thing.
  775. return `"${arg}"`;
  776. }
  777. // Expected input/output:
  778. // input : hello"world
  779. // output: "hello\"world"
  780. // input : hello""world
  781. // output: "hello\"\"world"
  782. // input : hello\world
  783. // output: hello\world
  784. // input : hello\\world
  785. // output: hello\\world
  786. // input : hello\"world
  787. // output: "hello\\\"world"
  788. // input : hello\\"world
  789. // output: "hello\\\\\"world"
  790. // input : hello world\
  791. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  792. // but it appears the comment is wrong, it should be "hello world\\"
  793. let reverse = '"';
  794. let quoteHit = true;
  795. for (let i = arg.length; i > 0; i--) {
  796. // walk the string in reverse
  797. reverse += arg[i - 1];
  798. if (quoteHit && arg[i - 1] === '\\') {
  799. reverse += '\\';
  800. }
  801. else if (arg[i - 1] === '"') {
  802. quoteHit = true;
  803. reverse += '\\';
  804. }
  805. else {
  806. quoteHit = false;
  807. }
  808. }
  809. reverse += '"';
  810. return reverse
  811. .split('')
  812. .reverse()
  813. .join('');
  814. }
  815. _cloneExecOptions(options) {
  816. options = options || {};
  817. const result = {
  818. cwd: options.cwd || process.cwd(),
  819. env: options.env || process.env,
  820. silent: options.silent || false,
  821. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  822. failOnStdErr: options.failOnStdErr || false,
  823. ignoreReturnCode: options.ignoreReturnCode || false,
  824. delay: options.delay || 10000
  825. };
  826. result.outStream = options.outStream || process.stdout;
  827. result.errStream = options.errStream || process.stderr;
  828. return result;
  829. }
  830. _getSpawnOptions(options, toolPath) {
  831. options = options || {};
  832. const result = {};
  833. result.cwd = options.cwd;
  834. result.env = options.env;
  835. result['windowsVerbatimArguments'] =
  836. options.windowsVerbatimArguments || this._isCmdFile();
  837. if (options.windowsVerbatimArguments) {
  838. result.argv0 = `"${toolPath}"`;
  839. }
  840. return result;
  841. }
  842. /**
  843. * Exec a tool.
  844. * Output will be streamed to the live console.
  845. * Returns promise with return code
  846. *
  847. * @param tool path to tool to exec
  848. * @param options optional exec options. See ExecOptions
  849. * @returns number
  850. */
  851. exec() {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. return new Promise((resolve, reject) => {
  854. this._debug(`exec tool: ${this.toolPath}`);
  855. this._debug('arguments:');
  856. for (const arg of this.args) {
  857. this._debug(` ${arg}`);
  858. }
  859. const optionsNonNull = this._cloneExecOptions(this.options);
  860. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  861. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  862. }
  863. const state = new ExecState(optionsNonNull, this.toolPath);
  864. state.on('debug', (message) => {
  865. this._debug(message);
  866. });
  867. const fileName = this._getSpawnFileName();
  868. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  869. const stdbuffer = '';
  870. if (cp.stdout) {
  871. cp.stdout.on('data', (data) => {
  872. if (this.options.listeners && this.options.listeners.stdout) {
  873. this.options.listeners.stdout(data);
  874. }
  875. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  876. optionsNonNull.outStream.write(data);
  877. }
  878. this._processLineBuffer(data, stdbuffer, (line) => {
  879. if (this.options.listeners && this.options.listeners.stdline) {
  880. this.options.listeners.stdline(line);
  881. }
  882. });
  883. });
  884. }
  885. const errbuffer = '';
  886. if (cp.stderr) {
  887. cp.stderr.on('data', (data) => {
  888. state.processStderr = true;
  889. if (this.options.listeners && this.options.listeners.stderr) {
  890. this.options.listeners.stderr(data);
  891. }
  892. if (!optionsNonNull.silent &&
  893. optionsNonNull.errStream &&
  894. optionsNonNull.outStream) {
  895. const s = optionsNonNull.failOnStdErr
  896. ? optionsNonNull.errStream
  897. : optionsNonNull.outStream;
  898. s.write(data);
  899. }
  900. this._processLineBuffer(data, errbuffer, (line) => {
  901. if (this.options.listeners && this.options.listeners.errline) {
  902. this.options.listeners.errline(line);
  903. }
  904. });
  905. });
  906. }
  907. cp.on('error', (err) => {
  908. state.processError = err.message;
  909. state.processExited = true;
  910. state.processClosed = true;
  911. state.CheckComplete();
  912. });
  913. cp.on('exit', (code) => {
  914. state.processExitCode = code;
  915. state.processExited = true;
  916. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  917. state.CheckComplete();
  918. });
  919. cp.on('close', (code) => {
  920. state.processExitCode = code;
  921. state.processExited = true;
  922. state.processClosed = true;
  923. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  924. state.CheckComplete();
  925. });
  926. state.on('done', (error, exitCode) => {
  927. if (stdbuffer.length > 0) {
  928. this.emit('stdline', stdbuffer);
  929. }
  930. if (errbuffer.length > 0) {
  931. this.emit('errline', errbuffer);
  932. }
  933. cp.removeAllListeners();
  934. if (error) {
  935. reject(error);
  936. }
  937. else {
  938. resolve(exitCode);
  939. }
  940. });
  941. });
  942. });
  943. }
  944. }
  945. exports.ToolRunner = ToolRunner;
  946. /**
  947. * Convert an arg string to an array of args. Handles escaping
  948. *
  949. * @param argString string of arguments
  950. * @returns string[] array of arguments
  951. */
  952. function argStringToArray(argString) {
  953. const args = [];
  954. let inQuotes = false;
  955. let escaped = false;
  956. let arg = '';
  957. function append(c) {
  958. // we only escape double quotes.
  959. if (escaped && c !== '"') {
  960. arg += '\\';
  961. }
  962. arg += c;
  963. escaped = false;
  964. }
  965. for (let i = 0; i < argString.length; i++) {
  966. const c = argString.charAt(i);
  967. if (c === '"') {
  968. if (!escaped) {
  969. inQuotes = !inQuotes;
  970. }
  971. else {
  972. append(c);
  973. }
  974. continue;
  975. }
  976. if (c === '\\' && escaped) {
  977. append(c);
  978. continue;
  979. }
  980. if (c === '\\' && inQuotes) {
  981. escaped = true;
  982. continue;
  983. }
  984. if (c === ' ' && !inQuotes) {
  985. if (arg.length > 0) {
  986. args.push(arg);
  987. arg = '';
  988. }
  989. continue;
  990. }
  991. append(c);
  992. }
  993. if (arg.length > 0) {
  994. args.push(arg.trim());
  995. }
  996. return args;
  997. }
  998. exports.argStringToArray = argStringToArray;
  999. class ExecState extends events.EventEmitter {
  1000. constructor(options, toolPath) {
  1001. super();
  1002. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  1003. this.processError = '';
  1004. this.processExitCode = 0;
  1005. this.processExited = false; // tracks whether the process has exited
  1006. this.processStderr = false; // tracks whether stderr was written to
  1007. this.delay = 10000; // 10 seconds
  1008. this.done = false;
  1009. this.timeout = null;
  1010. if (!toolPath) {
  1011. throw new Error('toolPath must not be empty');
  1012. }
  1013. this.options = options;
  1014. this.toolPath = toolPath;
  1015. if (options.delay) {
  1016. this.delay = options.delay;
  1017. }
  1018. }
  1019. CheckComplete() {
  1020. if (this.done) {
  1021. return;
  1022. }
  1023. if (this.processClosed) {
  1024. this._setResult();
  1025. }
  1026. else if (this.processExited) {
  1027. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  1028. }
  1029. }
  1030. _debug(message) {
  1031. this.emit('debug', message);
  1032. }
  1033. _setResult() {
  1034. // determine whether there is an error
  1035. let error;
  1036. if (this.processExited) {
  1037. if (this.processError) {
  1038. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  1039. }
  1040. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  1041. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  1042. }
  1043. else if (this.processStderr && this.options.failOnStdErr) {
  1044. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  1045. }
  1046. }
  1047. // clear the timeout
  1048. if (this.timeout) {
  1049. clearTimeout(this.timeout);
  1050. this.timeout = null;
  1051. }
  1052. this.done = true;
  1053. this.emit('done', error, this.processExitCode);
  1054. }
  1055. static HandleTimeout(state) {
  1056. if (state.done) {
  1057. return;
  1058. }
  1059. if (!state.processClosed && state.processExited) {
  1060. const message = `The STDIO streams did not close within ${state.delay /
  1061. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  1062. state._debug(message);
  1063. }
  1064. state._setResult();
  1065. }
  1066. }
  1067. //# sourceMappingURL=toolrunner.js.map
  1068. /***/ }),
  1069. /***/ 11:
  1070. /***/ (function(module) {
  1071. // Returns a wrapper function that returns a wrapped callback
  1072. // The wrapper function should do some stuff, and return a
  1073. // presumably different callback function.
  1074. // This makes sure that own properties are retained, so that
  1075. // decorations and such are not lost along the way.
  1076. module.exports = wrappy
  1077. function wrappy (fn, cb) {
  1078. if (fn && cb) return wrappy(fn)(cb)
  1079. if (typeof fn !== 'function')
  1080. throw new TypeError('need wrapper function')
  1081. Object.keys(fn).forEach(function (k) {
  1082. wrapper[k] = fn[k]
  1083. })
  1084. return wrapper
  1085. function wrapper() {
  1086. var args = new Array(arguments.length)
  1087. for (var i = 0; i < args.length; i++) {
  1088. args[i] = arguments[i]
  1089. }
  1090. var ret = fn.apply(this, args)
  1091. var cb = args[args.length-1]
  1092. if (typeof ret === 'function' && ret !== cb) {
  1093. Object.keys(cb).forEach(function (k) {
  1094. ret[k] = cb[k]
  1095. })
  1096. }
  1097. return ret
  1098. }
  1099. }
  1100. /***/ }),
  1101. /***/ 16:
  1102. /***/ (function(module) {
  1103. module.exports = require("tls");
  1104. /***/ }),
  1105. /***/ 18:
  1106. /***/ (function() {
  1107. eval("require")("encoding");
  1108. /***/ }),
  1109. /***/ 19:
  1110. /***/ (function(module, __unusedexports, __webpack_require__) {
  1111. module.exports = authenticationPlugin;
  1112. const { Deprecation } = __webpack_require__(692);
  1113. const once = __webpack_require__(969);
  1114. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1115. const authenticate = __webpack_require__(674);
  1116. const beforeRequest = __webpack_require__(471);
  1117. const requestError = __webpack_require__(349);
  1118. function authenticationPlugin(octokit, options) {
  1119. if (options.auth) {
  1120. octokit.authenticate = () => {
  1121. deprecateAuthenticate(
  1122. octokit.log,
  1123. new Deprecation(
  1124. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1125. )
  1126. );
  1127. };
  1128. return;
  1129. }
  1130. const state = {
  1131. octokit,
  1132. auth: false
  1133. };
  1134. octokit.authenticate = authenticate.bind(null, state);
  1135. octokit.hook.before("request", beforeRequest.bind(null, state));
  1136. octokit.hook.error("request", requestError.bind(null, state));
  1137. }
  1138. /***/ }),
  1139. /***/ 20:
  1140. /***/ (function(module, __unusedexports, __webpack_require__) {
  1141. "use strict";
  1142. const cp = __webpack_require__(129);
  1143. const parse = __webpack_require__(568);
  1144. const enoent = __webpack_require__(881);
  1145. function spawn(command, args, options) {
  1146. // Parse the arguments
  1147. const parsed = parse(command, args, options);
  1148. // Spawn the child process
  1149. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1150. // Hook into child process "exit" event to emit an error if the command
  1151. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1152. enoent.hookChildProcess(spawned, parsed);
  1153. return spawned;
  1154. }
  1155. function spawnSync(command, args, options) {
  1156. // Parse the arguments
  1157. const parsed = parse(command, args, options);
  1158. // Spawn the child process
  1159. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1160. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1161. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1162. return result;
  1163. }
  1164. module.exports = spawn;
  1165. module.exports.spawn = spawn;
  1166. module.exports.sync = spawnSync;
  1167. module.exports._parse = parse;
  1168. module.exports._enoent = enoent;
  1169. /***/ }),
  1170. /***/ 34:
  1171. /***/ (function(module) {
  1172. module.exports = require("https");
  1173. /***/ }),
  1174. /***/ 39:
  1175. /***/ (function(module) {
  1176. "use strict";
  1177. module.exports = opts => {
  1178. opts = opts || {};
  1179. const env = opts.env || process.env;
  1180. const platform = opts.platform || process.platform;
  1181. if (platform !== 'win32') {
  1182. return 'PATH';
  1183. }
  1184. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1185. };
  1186. /***/ }),
  1187. /***/ 47:
  1188. /***/ (function(module, __unusedexports, __webpack_require__) {
  1189. module.exports = factory;
  1190. const Octokit = __webpack_require__(402);
  1191. const registerPlugin = __webpack_require__(855);
  1192. function factory(plugins) {
  1193. const Api = Octokit.bind(null, plugins || []);
  1194. Api.plugin = registerPlugin.bind(null, plugins || []);
  1195. return Api;
  1196. }
  1197. /***/ }),
  1198. /***/ 49:
  1199. /***/ (function(module, __unusedexports, __webpack_require__) {
  1200. "use strict";
  1201. const os = __webpack_require__(87);
  1202. const execa = __webpack_require__(955);
  1203. // Reference: https://www.gaijin.at/en/lstwinver.php
  1204. const names = new Map([
  1205. ['10.0', '10'],
  1206. ['6.3', '8.1'],
  1207. ['6.2', '8'],
  1208. ['6.1', '7'],
  1209. ['6.0', 'Vista'],
  1210. ['5.2', 'Server 2003'],
  1211. ['5.1', 'XP'],
  1212. ['5.0', '2000'],
  1213. ['4.9', 'ME'],
  1214. ['4.1', '98'],
  1215. ['4.0', '95']
  1216. ]);
  1217. const windowsRelease = release => {
  1218. const version = /\d+\.\d/.exec(release || os.release());
  1219. if (release && !version) {
  1220. throw new Error('`release` argument doesn\'t match `n.n`');
  1221. }
  1222. const ver = (version || [])[0];
  1223. // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
  1224. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1225. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1226. // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
  1227. // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
  1228. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1229. let stdout;
  1230. try {
  1231. stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
  1232. } catch (_) {
  1233. stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1234. }
  1235. const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
  1236. if (year) {
  1237. return `Server ${year}`;
  1238. }
  1239. }
  1240. return names.get(ver);
  1241. };
  1242. module.exports = windowsRelease;
  1243. /***/ }),
  1244. /***/ 81:
  1245. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1246. "use strict";
  1247. var __importStar = (this && this.__importStar) || function (mod) {
  1248. if (mod && mod.__esModule) return mod;
  1249. var result = {};
  1250. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1251. result["default"] = mod;
  1252. return result;
  1253. };
  1254. Object.defineProperty(exports, "__esModule", { value: true });
  1255. const assert = __importStar(__webpack_require__(357));
  1256. const url_1 = __webpack_require__(835);
  1257. function getFetchUrl(settings) {
  1258. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1259. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1260. const serviceUrl = getServerUrl();
  1261. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1262. const encodedName = encodeURIComponent(settings.repositoryName);
  1263. if (settings.sshKey) {
  1264. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1265. }
  1266. // "origin" is SCHEME://HOSTNAME[:PORT]
  1267. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1268. }
  1269. exports.getFetchUrl = getFetchUrl;
  1270. function getServerUrl() {
  1271. // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  1272. return new url_1.URL(process.env['GITHUB_SERVER_URL'] ||
  1273. process.env['GITHUB_URL'] ||
  1274. 'https://github.com');
  1275. }
  1276. exports.getServerUrl = getServerUrl;
  1277. /***/ }),
  1278. /***/ 87:
  1279. /***/ (function(module) {
  1280. module.exports = require("os");
  1281. /***/ }),
  1282. /***/ 118:
  1283. /***/ (function(module, __unusedexports, __webpack_require__) {
  1284. "use strict";
  1285. const os = __webpack_require__(87);
  1286. const nameMap = new Map([
  1287. [19, 'Catalina'],
  1288. [18, 'Mojave'],
  1289. [17, 'High Sierra'],
  1290. [16, 'Sierra'],
  1291. [15, 'El Capitan'],
  1292. [14, 'Yosemite'],
  1293. [13, 'Mavericks'],
  1294. [12, 'Mountain Lion'],
  1295. [11, 'Lion'],
  1296. [10, 'Snow Leopard'],
  1297. [9, 'Leopard'],
  1298. [8, 'Tiger'],
  1299. [7, 'Panther'],
  1300. [6, 'Jaguar'],
  1301. [5, 'Puma']
  1302. ]);
  1303. const macosRelease = release => {
  1304. release = Number((release || os.release()).split('.')[0]);
  1305. return {
  1306. name: nameMap.get(release),
  1307. version: '10.' + (release - 4)
  1308. };
  1309. };
  1310. module.exports = macosRelease;
  1311. // TODO: remove this in the next major version
  1312. module.exports.default = macosRelease;
  1313. /***/ }),
  1314. /***/ 126:
  1315. /***/ (function(module) {
  1316. /**
  1317. * lodash (Custom Build) <https://lodash.com/>
  1318. * Build: `lodash modularize exports="npm" -o ./`
  1319. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1320. * Released under MIT license <https://lodash.com/license>
  1321. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1322. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1323. */
  1324. /** Used as the size to enable large array optimizations. */
  1325. var LARGE_ARRAY_SIZE = 200;
  1326. /** Used to stand-in for `undefined` hash values. */
  1327. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1328. /** Used as references for various `Number` constants. */
  1329. var INFINITY = 1 / 0;
  1330. /** `Object#toString` result references. */
  1331. var funcTag = '[object Function]',
  1332. genTag = '[object GeneratorFunction]';
  1333. /**
  1334. * Used to match `RegExp`
  1335. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1336. */
  1337. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1338. /** Used to detect host constructors (Safari). */
  1339. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1340. /** Detect free variable `global` from Node.js. */
  1341. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1342. /** Detect free variable `self`. */
  1343. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1344. /** Used as a reference to the global object. */
  1345. var root = freeGlobal || freeSelf || Function('return this')();
  1346. /**
  1347. * A specialized version of `_.includes` for arrays without support for
  1348. * specifying an index to search from.
  1349. *
  1350. * @private
  1351. * @param {Array} [array] The array to inspect.
  1352. * @param {*} target The value to search for.
  1353. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1354. */
  1355. function arrayIncludes(array, value) {
  1356. var length = array ? array.length : 0;
  1357. return !!length && baseIndexOf(array, value, 0) > -1;
  1358. }
  1359. /**
  1360. * This function is like `arrayIncludes` except that it accepts a comparator.
  1361. *
  1362. * @private
  1363. * @param {Array} [array] The array to inspect.
  1364. * @param {*} target The value to search for.
  1365. * @param {Function} comparator The comparator invoked per element.
  1366. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1367. */
  1368. function arrayIncludesWith(array, value, comparator) {
  1369. var index = -1,
  1370. length = array ? array.length : 0;
  1371. while (++index < length) {
  1372. if (comparator(value, array[index])) {
  1373. return true;
  1374. }
  1375. }
  1376. return false;
  1377. }
  1378. /**
  1379. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1380. * support for iteratee shorthands.
  1381. *
  1382. * @private
  1383. * @param {Array} array The array to inspect.
  1384. * @param {Function} predicate The function invoked per iteration.
  1385. * @param {number} fromIndex The index to search from.
  1386. * @param {boolean} [fromRight] Specify iterating from right to left.
  1387. * @returns {number} Returns the index of the matched value, else `-1`.
  1388. */
  1389. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1390. var length = array.length,
  1391. index = fromIndex + (fromRight ? 1 : -1);
  1392. while ((fromRight ? index-- : ++index < length)) {
  1393. if (predicate(array[index], index, array)) {
  1394. return index;
  1395. }
  1396. }
  1397. return -1;
  1398. }
  1399. /**
  1400. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1401. *
  1402. * @private
  1403. * @param {Array} array The array to inspect.
  1404. * @param {*} value The value to search for.
  1405. * @param {number} fromIndex The index to search from.
  1406. * @returns {number} Returns the index of the matched value, else `-1`.
  1407. */
  1408. function baseIndexOf(array, value, fromIndex) {
  1409. if (value !== value) {
  1410. return baseFindIndex(array, baseIsNaN, fromIndex);
  1411. }
  1412. var index = fromIndex - 1,
  1413. length = array.length;
  1414. while (++index < length) {
  1415. if (array[index] === value) {
  1416. return index;
  1417. }
  1418. }
  1419. return -1;
  1420. }
  1421. /**
  1422. * The base implementation of `_.isNaN` without support for number objects.
  1423. *
  1424. * @private
  1425. * @param {*} value The value to check.
  1426. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1427. */
  1428. function baseIsNaN(value) {
  1429. return value !== value;
  1430. }
  1431. /**
  1432. * Checks if a cache value for `key` exists.
  1433. *
  1434. * @private
  1435. * @param {Object} cache The cache to query.
  1436. * @param {string} key The key of the entry to check.
  1437. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1438. */
  1439. function cacheHas(cache, key) {
  1440. return cache.has(key);
  1441. }
  1442. /**
  1443. * Gets the value at `key` of `object`.
  1444. *
  1445. * @private
  1446. * @param {Object} [object] The object to query.
  1447. * @param {string} key The key of the property to get.
  1448. * @returns {*} Returns the property value.
  1449. */
  1450. function getValue(object, key) {
  1451. return object == null ? undefined : object[key];
  1452. }
  1453. /**
  1454. * Checks if `value` is a host object in IE < 9.
  1455. *
  1456. * @private
  1457. * @param {*} value The value to check.
  1458. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1459. */
  1460. function isHostObject(value) {
  1461. // Many host objects are `Object` objects that can coerce to strings
  1462. // despite having improperly defined `toString` methods.
  1463. var result = false;
  1464. if (value != null && typeof value.toString != 'function') {
  1465. try {
  1466. result = !!(value + '');
  1467. } catch (e) {}
  1468. }
  1469. return result;
  1470. }
  1471. /**
  1472. * Converts `set` to an array of its values.
  1473. *
  1474. * @private
  1475. * @param {Object} set The set to convert.
  1476. * @returns {Array} Returns the values.
  1477. */
  1478. function setToArray(set) {
  1479. var index = -1,
  1480. result = Array(set.size);
  1481. set.forEach(function(value) {
  1482. result[++index] = value;
  1483. });
  1484. return result;
  1485. }
  1486. /** Used for built-in method references. */
  1487. var arrayProto = Array.prototype,
  1488. funcProto = Function.prototype,
  1489. objectProto = Object.prototype;
  1490. /** Used to detect overreaching core-js shims. */
  1491. var coreJsData = root['__core-js_shared__'];
  1492. /** Used to detect methods masquerading as native. */
  1493. var maskSrcKey = (function() {
  1494. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1495. return uid ? ('Symbol(src)_1.' + uid) : '';
  1496. }());
  1497. /** Used to resolve the decompiled source of functions. */
  1498. var funcToString = funcProto.toString;
  1499. /** Used to check objects for own properties. */
  1500. var hasOwnProperty = objectProto.hasOwnProperty;
  1501. /**
  1502. * Used to resolve the
  1503. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1504. * of values.
  1505. */
  1506. var objectToString = objectProto.toString;
  1507. /** Used to detect if a method is native. */
  1508. var reIsNative = RegExp('^' +
  1509. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1510. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1511. );
  1512. /** Built-in value references. */
  1513. var splice = arrayProto.splice;
  1514. /* Built-in method references that are verified to be native. */
  1515. var Map = getNative(root, 'Map'),
  1516. Set = getNative(root, 'Set'),
  1517. nativeCreate = getNative(Object, 'create');
  1518. /**
  1519. * Creates a hash object.
  1520. *
  1521. * @private
  1522. * @constructor
  1523. * @param {Array} [entries] The key-value pairs to cache.
  1524. */
  1525. function Hash(entries) {
  1526. var index = -1,
  1527. length = entries ? entries.length : 0;
  1528. this.clear();
  1529. while (++index < length) {
  1530. var entry = entries[index];
  1531. this.set(entry[0], entry[1]);
  1532. }
  1533. }
  1534. /**
  1535. * Removes all key-value entries from the hash.
  1536. *
  1537. * @private
  1538. * @name clear
  1539. * @memberOf Hash
  1540. */
  1541. function hashClear() {
  1542. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1543. }
  1544. /**
  1545. * Removes `key` and its value from the hash.
  1546. *
  1547. * @private
  1548. * @name delete
  1549. * @memberOf Hash
  1550. * @param {Object} hash The hash to modify.
  1551. * @param {string} key The key of the value to remove.
  1552. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1553. */
  1554. function hashDelete(key) {
  1555. return this.has(key) && delete this.__data__[key];
  1556. }
  1557. /**
  1558. * Gets the hash value for `key`.
  1559. *
  1560. * @private
  1561. * @name get
  1562. * @memberOf Hash
  1563. * @param {string} key The key of the value to get.
  1564. * @returns {*} Returns the entry value.
  1565. */
  1566. function hashGet(key) {
  1567. var data = this.__data__;
  1568. if (nativeCreate) {
  1569. var result = data[key];
  1570. return result === HASH_UNDEFINED ? undefined : result;
  1571. }
  1572. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1573. }
  1574. /**
  1575. * Checks if a hash value for `key` exists.
  1576. *
  1577. * @private
  1578. * @name has
  1579. * @memberOf Hash
  1580. * @param {string} key The key of the entry to check.
  1581. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1582. */
  1583. function hashHas(key) {
  1584. var data = this.__data__;
  1585. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1586. }
  1587. /**
  1588. * Sets the hash `key` to `value`.
  1589. *
  1590. * @private
  1591. * @name set
  1592. * @memberOf Hash
  1593. * @param {string} key The key of the value to set.
  1594. * @param {*} value The value to set.
  1595. * @returns {Object} Returns the hash instance.
  1596. */
  1597. function hashSet(key, value) {
  1598. var data = this.__data__;
  1599. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1600. return this;
  1601. }
  1602. // Add methods to `Hash`.
  1603. Hash.prototype.clear = hashClear;
  1604. Hash.prototype['delete'] = hashDelete;
  1605. Hash.prototype.get = hashGet;
  1606. Hash.prototype.has = hashHas;
  1607. Hash.prototype.set = hashSet;
  1608. /**
  1609. * Creates an list cache object.
  1610. *
  1611. * @private
  1612. * @constructor
  1613. * @param {Array} [entries] The key-value pairs to cache.
  1614. */
  1615. function ListCache(entries) {
  1616. var index = -1,
  1617. length = entries ? entries.length : 0;
  1618. this.clear();
  1619. while (++index < length) {
  1620. var entry = entries[index];
  1621. this.set(entry[0], entry[1]);
  1622. }
  1623. }
  1624. /**
  1625. * Removes all key-value entries from the list cache.
  1626. *
  1627. * @private
  1628. * @name clear
  1629. * @memberOf ListCache
  1630. */
  1631. function listCacheClear() {
  1632. this.__data__ = [];
  1633. }
  1634. /**
  1635. * Removes `key` and its value from the list cache.
  1636. *
  1637. * @private
  1638. * @name delete
  1639. * @memberOf ListCache
  1640. * @param {string} key The key of the value to remove.
  1641. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1642. */
  1643. function listCacheDelete(key) {
  1644. var data = this.__data__,
  1645. index = assocIndexOf(data, key);
  1646. if (index < 0) {
  1647. return false;
  1648. }
  1649. var lastIndex = data.length - 1;
  1650. if (index == lastIndex) {
  1651. data.pop();
  1652. } else {
  1653. splice.call(data, index, 1);
  1654. }
  1655. return true;
  1656. }
  1657. /**
  1658. * Gets the list cache value for `key`.
  1659. *
  1660. * @private
  1661. * @name get
  1662. * @memberOf ListCache
  1663. * @param {string} key The key of the value to get.
  1664. * @returns {*} Returns the entry value.
  1665. */
  1666. function listCacheGet(key) {
  1667. var data = this.__data__,
  1668. index = assocIndexOf(data, key);
  1669. return index < 0 ? undefined : data[index][1];
  1670. }
  1671. /**
  1672. * Checks if a list cache value for `key` exists.
  1673. *
  1674. * @private
  1675. * @name has
  1676. * @memberOf ListCache
  1677. * @param {string} key The key of the entry to check.
  1678. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1679. */
  1680. function listCacheHas(key) {
  1681. return assocIndexOf(this.__data__, key) > -1;
  1682. }
  1683. /**
  1684. * Sets the list cache `key` to `value`.
  1685. *
  1686. * @private
  1687. * @name set
  1688. * @memberOf ListCache
  1689. * @param {string} key The key of the value to set.
  1690. * @param {*} value The value to set.
  1691. * @returns {Object} Returns the list cache instance.
  1692. */
  1693. function listCacheSet(key, value) {
  1694. var data = this.__data__,
  1695. index = assocIndexOf(data, key);
  1696. if (index < 0) {
  1697. data.push([key, value]);
  1698. } else {
  1699. data[index][1] = value;
  1700. }
  1701. return this;
  1702. }
  1703. // Add methods to `ListCache`.
  1704. ListCache.prototype.clear = listCacheClear;
  1705. ListCache.prototype['delete'] = listCacheDelete;
  1706. ListCache.prototype.get = listCacheGet;
  1707. ListCache.prototype.has = listCacheHas;
  1708. ListCache.prototype.set = listCacheSet;
  1709. /**
  1710. * Creates a map cache object to store key-value pairs.
  1711. *
  1712. * @private
  1713. * @constructor
  1714. * @param {Array} [entries] The key-value pairs to cache.
  1715. */
  1716. function MapCache(entries) {
  1717. var index = -1,
  1718. length = entries ? entries.length : 0;
  1719. this.clear();
  1720. while (++index < length) {
  1721. var entry = entries[index];
  1722. this.set(entry[0], entry[1]);
  1723. }
  1724. }
  1725. /**
  1726. * Removes all key-value entries from the map.
  1727. *
  1728. * @private
  1729. * @name clear
  1730. * @memberOf MapCache
  1731. */
  1732. function mapCacheClear() {
  1733. this.__data__ = {
  1734. 'hash': new Hash,
  1735. 'map': new (Map || ListCache),
  1736. 'string': new Hash
  1737. };
  1738. }
  1739. /**
  1740. * Removes `key` and its value from the map.
  1741. *
  1742. * @private
  1743. * @name delete
  1744. * @memberOf MapCache
  1745. * @param {string} key The key of the value to remove.
  1746. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1747. */
  1748. function mapCacheDelete(key) {
  1749. return getMapData(this, key)['delete'](key);
  1750. }
  1751. /**
  1752. * Gets the map value for `key`.
  1753. *
  1754. * @private
  1755. * @name get
  1756. * @memberOf MapCache
  1757. * @param {string} key The key of the value to get.
  1758. * @returns {*} Returns the entry value.
  1759. */
  1760. function mapCacheGet(key) {
  1761. return getMapData(this, key).get(key);
  1762. }
  1763. /**
  1764. * Checks if a map value for `key` exists.
  1765. *
  1766. * @private
  1767. * @name has
  1768. * @memberOf MapCache
  1769. * @param {string} key The key of the entry to check.
  1770. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1771. */
  1772. function mapCacheHas(key) {
  1773. return getMapData(this, key).has(key);
  1774. }
  1775. /**
  1776. * Sets the map `key` to `value`.
  1777. *
  1778. * @private
  1779. * @name set
  1780. * @memberOf MapCache
  1781. * @param {string} key The key of the value to set.
  1782. * @param {*} value The value to set.
  1783. * @returns {Object} Returns the map cache instance.
  1784. */
  1785. function mapCacheSet(key, value) {
  1786. getMapData(this, key).set(key, value);
  1787. return this;
  1788. }
  1789. // Add methods to `MapCache`.
  1790. MapCache.prototype.clear = mapCacheClear;
  1791. MapCache.prototype['delete'] = mapCacheDelete;
  1792. MapCache.prototype.get = mapCacheGet;
  1793. MapCache.prototype.has = mapCacheHas;
  1794. MapCache.prototype.set = mapCacheSet;
  1795. /**
  1796. *
  1797. * Creates an array cache object to store unique values.
  1798. *
  1799. * @private
  1800. * @constructor
  1801. * @param {Array} [values] The values to cache.
  1802. */
  1803. function SetCache(values) {
  1804. var index = -1,
  1805. length = values ? values.length : 0;
  1806. this.__data__ = new MapCache;
  1807. while (++index < length) {
  1808. this.add(values[index]);
  1809. }
  1810. }
  1811. /**
  1812. * Adds `value` to the array cache.
  1813. *
  1814. * @private
  1815. * @name add
  1816. * @memberOf SetCache
  1817. * @alias push
  1818. * @param {*} value The value to cache.
  1819. * @returns {Object} Returns the cache instance.
  1820. */
  1821. function setCacheAdd(value) {
  1822. this.__data__.set(value, HASH_UNDEFINED);
  1823. return this;
  1824. }
  1825. /**
  1826. * Checks if `value` is in the array cache.
  1827. *
  1828. * @private
  1829. * @name has
  1830. * @memberOf SetCache
  1831. * @param {*} value The value to search for.
  1832. * @returns {number} Returns `true` if `value` is found, else `false`.
  1833. */
  1834. function setCacheHas(value) {
  1835. return this.__data__.has(value);
  1836. }
  1837. // Add methods to `SetCache`.
  1838. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1839. SetCache.prototype.has = setCacheHas;
  1840. /**
  1841. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1842. *
  1843. * @private
  1844. * @param {Array} array The array to inspect.
  1845. * @param {*} key The key to search for.
  1846. * @returns {number} Returns the index of the matched value, else `-1`.
  1847. */
  1848. function assocIndexOf(array, key) {
  1849. var length = array.length;
  1850. while (length--) {
  1851. if (eq(array[length][0], key)) {
  1852. return length;
  1853. }
  1854. }
  1855. return -1;
  1856. }
  1857. /**
  1858. * The base implementation of `_.isNative` without bad shim checks.
  1859. *
  1860. * @private
  1861. * @param {*} value The value to check.
  1862. * @returns {boolean} Returns `true` if `value` is a native function,
  1863. * else `false`.
  1864. */
  1865. function baseIsNative(value) {
  1866. if (!isObject(value) || isMasked(value)) {
  1867. return false;
  1868. }
  1869. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1870. return pattern.test(toSource(value));
  1871. }
  1872. /**
  1873. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1874. *
  1875. * @private
  1876. * @param {Array} array The array to inspect.
  1877. * @param {Function} [iteratee] The iteratee invoked per element.
  1878. * @param {Function} [comparator] The comparator invoked per element.
  1879. * @returns {Array} Returns the new duplicate free array.
  1880. */
  1881. function baseUniq(array, iteratee, comparator) {
  1882. var index = -1,
  1883. includes = arrayIncludes,
  1884. length = array.length,
  1885. isCommon = true,
  1886. result = [],
  1887. seen = result;
  1888. if (comparator) {
  1889. isCommon = false;
  1890. includes = arrayIncludesWith;
  1891. }
  1892. else if (length >= LARGE_ARRAY_SIZE) {
  1893. var set = iteratee ? null : createSet(array);
  1894. if (set) {
  1895. return setToArray(set);
  1896. }
  1897. isCommon = false;
  1898. includes = cacheHas;
  1899. seen = new SetCache;
  1900. }
  1901. else {
  1902. seen = iteratee ? [] : result;
  1903. }
  1904. outer:
  1905. while (++index < length) {
  1906. var value = array[index],
  1907. computed = iteratee ? iteratee(value) : value;
  1908. value = (comparator || value !== 0) ? value : 0;
  1909. if (isCommon && computed === computed) {
  1910. var seenIndex = seen.length;
  1911. while (seenIndex--) {
  1912. if (seen[seenIndex] === computed) {
  1913. continue outer;
  1914. }
  1915. }
  1916. if (iteratee) {
  1917. seen.push(computed);
  1918. }
  1919. result.push(value);
  1920. }
  1921. else if (!includes(seen, computed, comparator)) {
  1922. if (seen !== result) {
  1923. seen.push(computed);
  1924. }
  1925. result.push(value);
  1926. }
  1927. }
  1928. return result;
  1929. }
  1930. /**
  1931. * Creates a set object of `values`.
  1932. *
  1933. * @private
  1934. * @param {Array} values The values to add to the set.
  1935. * @returns {Object} Returns the new set.
  1936. */
  1937. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1938. return new Set(values);
  1939. };
  1940. /**
  1941. * Gets the data for `map`.
  1942. *
  1943. * @private
  1944. * @param {Object} map The map to query.
  1945. * @param {string} key The reference key.
  1946. * @returns {*} Returns the map data.
  1947. */
  1948. function getMapData(map, key) {
  1949. var data = map.__data__;
  1950. return isKeyable(key)
  1951. ? data[typeof key == 'string' ? 'string' : 'hash']
  1952. : data.map;
  1953. }
  1954. /**
  1955. * Gets the native function at `key` of `object`.
  1956. *
  1957. * @private
  1958. * @param {Object} object The object to query.
  1959. * @param {string} key The key of the method to get.
  1960. * @returns {*} Returns the function if it's native, else `undefined`.
  1961. */
  1962. function getNative(object, key) {
  1963. var value = getValue(object, key);
  1964. return baseIsNative(value) ? value : undefined;
  1965. }
  1966. /**
  1967. * Checks if `value` is suitable for use as unique object key.
  1968. *
  1969. * @private
  1970. * @param {*} value The value to check.
  1971. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1972. */
  1973. function isKeyable(value) {
  1974. var type = typeof value;
  1975. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1976. ? (value !== '__proto__')
  1977. : (value === null);
  1978. }
  1979. /**
  1980. * Checks if `func` has its source masked.
  1981. *
  1982. * @private
  1983. * @param {Function} func The function to check.
  1984. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1985. */
  1986. function isMasked(func) {
  1987. return !!maskSrcKey && (maskSrcKey in func);
  1988. }
  1989. /**
  1990. * Converts `func` to its source code.
  1991. *
  1992. * @private
  1993. * @param {Function} func The function to process.
  1994. * @returns {string} Returns the source code.
  1995. */
  1996. function toSource(func) {
  1997. if (func != null) {
  1998. try {
  1999. return funcToString.call(func);
  2000. } catch (e) {}
  2001. try {
  2002. return (func + '');
  2003. } catch (e) {}
  2004. }
  2005. return '';
  2006. }
  2007. /**
  2008. * Creates a duplicate-free version of an array, using
  2009. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2010. * for equality comparisons, in which only the first occurrence of each
  2011. * element is kept.
  2012. *
  2013. * @static
  2014. * @memberOf _
  2015. * @since 0.1.0
  2016. * @category Array
  2017. * @param {Array} array The array to inspect.
  2018. * @returns {Array} Returns the new duplicate free array.
  2019. * @example
  2020. *
  2021. * _.uniq([2, 1, 2]);
  2022. * // => [2, 1]
  2023. */
  2024. function uniq(array) {
  2025. return (array && array.length)
  2026. ? baseUniq(array)
  2027. : [];
  2028. }
  2029. /**
  2030. * Performs a
  2031. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2032. * comparison between two values to determine if they are equivalent.
  2033. *
  2034. * @static
  2035. * @memberOf _
  2036. * @since 4.0.0
  2037. * @category Lang
  2038. * @param {*} value The value to compare.
  2039. * @param {*} other The other value to compare.
  2040. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2041. * @example
  2042. *
  2043. * var object = { 'a': 1 };
  2044. * var other = { 'a': 1 };
  2045. *
  2046. * _.eq(object, object);
  2047. * // => true
  2048. *
  2049. * _.eq(object, other);
  2050. * // => false
  2051. *
  2052. * _.eq('a', 'a');
  2053. * // => true
  2054. *
  2055. * _.eq('a', Object('a'));
  2056. * // => false
  2057. *
  2058. * _.eq(NaN, NaN);
  2059. * // => true
  2060. */
  2061. function eq(value, other) {
  2062. return value === other || (value !== value && other !== other);
  2063. }
  2064. /**
  2065. * Checks if `value` is classified as a `Function` object.
  2066. *
  2067. * @static
  2068. * @memberOf _
  2069. * @since 0.1.0
  2070. * @category Lang
  2071. * @param {*} value The value to check.
  2072. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2073. * @example
  2074. *
  2075. * _.isFunction(_);
  2076. * // => true
  2077. *
  2078. * _.isFunction(/abc/);
  2079. * // => false
  2080. */
  2081. function isFunction(value) {
  2082. // The use of `Object#toString` avoids issues with the `typeof` operator
  2083. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2084. var tag = isObject(value) ? objectToString.call(value) : '';
  2085. return tag == funcTag || tag == genTag;
  2086. }
  2087. /**
  2088. * Checks if `value` is the
  2089. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2090. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2091. *
  2092. * @static
  2093. * @memberOf _
  2094. * @since 0.1.0
  2095. * @category Lang
  2096. * @param {*} value The value to check.
  2097. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2098. * @example
  2099. *
  2100. * _.isObject({});
  2101. * // => true
  2102. *
  2103. * _.isObject([1, 2, 3]);
  2104. * // => true
  2105. *
  2106. * _.isObject(_.noop);
  2107. * // => true
  2108. *
  2109. * _.isObject(null);
  2110. * // => false
  2111. */
  2112. function isObject(value) {
  2113. var type = typeof value;
  2114. return !!value && (type == 'object' || type == 'function');
  2115. }
  2116. /**
  2117. * This method returns `undefined`.
  2118. *
  2119. * @static
  2120. * @memberOf _
  2121. * @since 2.3.0
  2122. * @category Util
  2123. * @example
  2124. *
  2125. * _.times(2, _.noop);
  2126. * // => [undefined, undefined]
  2127. */
  2128. function noop() {
  2129. // No operation performed.
  2130. }
  2131. module.exports = uniq;
  2132. /***/ }),
  2133. /***/ 129:
  2134. /***/ (function(module) {
  2135. module.exports = require("child_process");
  2136. /***/ }),
  2137. /***/ 139:
  2138. /***/ (function(module, __unusedexports, __webpack_require__) {
  2139. // Unique ID creation requires a high quality random # generator. In node.js
  2140. // this is pretty straight-forward - we use the crypto API.
  2141. var crypto = __webpack_require__(417);
  2142. module.exports = function nodeRNG() {
  2143. return crypto.randomBytes(16);
  2144. };
  2145. /***/ }),
  2146. /***/ 141:
  2147. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2148. "use strict";
  2149. var net = __webpack_require__(631);
  2150. var tls = __webpack_require__(16);
  2151. var http = __webpack_require__(605);
  2152. var https = __webpack_require__(34);
  2153. var events = __webpack_require__(614);
  2154. var assert = __webpack_require__(357);
  2155. var util = __webpack_require__(669);
  2156. exports.httpOverHttp = httpOverHttp;
  2157. exports.httpsOverHttp = httpsOverHttp;
  2158. exports.httpOverHttps = httpOverHttps;
  2159. exports.httpsOverHttps = httpsOverHttps;
  2160. function httpOverHttp(options) {
  2161. var agent = new TunnelingAgent(options);
  2162. agent.request = http.request;
  2163. return agent;
  2164. }
  2165. function httpsOverHttp(options) {
  2166. var agent = new TunnelingAgent(options);
  2167. agent.request = http.request;
  2168. agent.createSocket = createSecureSocket;
  2169. return agent;
  2170. }
  2171. function httpOverHttps(options) {
  2172. var agent = new TunnelingAgent(options);
  2173. agent.request = https.request;
  2174. return agent;
  2175. }
  2176. function httpsOverHttps(options) {
  2177. var agent = new TunnelingAgent(options);
  2178. agent.request = https.request;
  2179. agent.createSocket = createSecureSocket;
  2180. return agent;
  2181. }
  2182. function TunnelingAgent(options) {
  2183. var self = this;
  2184. self.options = options || {};
  2185. self.proxyOptions = self.options.proxy || {};
  2186. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2187. self.requests = [];
  2188. self.sockets = [];
  2189. self.on('free', function onFree(socket, host, port, localAddress) {
  2190. var options = toOptions(host, port, localAddress);
  2191. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2192. var pending = self.requests[i];
  2193. if (pending.host === options.host && pending.port === options.port) {
  2194. // Detect the request to connect same origin server,
  2195. // reuse the connection.
  2196. self.requests.splice(i, 1);
  2197. pending.request.onSocket(socket);
  2198. return;
  2199. }
  2200. }
  2201. socket.destroy();
  2202. self.removeSocket(socket);
  2203. });
  2204. }
  2205. util.inherits(TunnelingAgent, events.EventEmitter);
  2206. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2207. var self = this;
  2208. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2209. if (self.sockets.length >= this.maxSockets) {
  2210. // We are over limit so we'll add it to the queue.
  2211. self.requests.push(options);
  2212. return;
  2213. }
  2214. // If we are under maxSockets create a new one.
  2215. self.createSocket(options, function(socket) {
  2216. socket.on('free', onFree);
  2217. socket.on('close', onCloseOrRemove);
  2218. socket.on('agentRemove', onCloseOrRemove);
  2219. req.onSocket(socket);
  2220. function onFree() {
  2221. self.emit('free', socket, options);
  2222. }
  2223. function onCloseOrRemove(err) {
  2224. self.removeSocket(socket);
  2225. socket.removeListener('free', onFree);
  2226. socket.removeListener('close', onCloseOrRemove);
  2227. socket.removeListener('agentRemove', onCloseOrRemove);
  2228. }
  2229. });
  2230. };
  2231. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2232. var self = this;
  2233. var placeholder = {};
  2234. self.sockets.push(placeholder);
  2235. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2236. method: 'CONNECT',
  2237. path: options.host + ':' + options.port,
  2238. agent: false
  2239. });
  2240. if (connectOptions.proxyAuth) {
  2241. connectOptions.headers = connectOptions.headers || {};
  2242. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2243. new Buffer(connectOptions.proxyAuth).toString('base64');
  2244. }
  2245. debug('making CONNECT request');
  2246. var connectReq = self.request(connectOptions);
  2247. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2248. connectReq.once('response', onResponse); // for v0.6
  2249. connectReq.once('upgrade', onUpgrade); // for v0.6
  2250. connectReq.once('connect', onConnect); // for v0.7 or later
  2251. connectReq.once('error', onError);
  2252. connectReq.end();
  2253. function onResponse(res) {
  2254. // Very hacky. This is necessary to avoid http-parser leaks.
  2255. res.upgrade = true;
  2256. }
  2257. function onUpgrade(res, socket, head) {
  2258. // Hacky.
  2259. process.nextTick(function() {
  2260. onConnect(res, socket, head);
  2261. });
  2262. }
  2263. function onConnect(res, socket, head) {
  2264. connectReq.removeAllListeners();
  2265. socket.removeAllListeners();
  2266. if (res.statusCode === 200) {
  2267. assert.equal(head.length, 0);
  2268. debug('tunneling connection has established');
  2269. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2270. cb(socket);
  2271. } else {
  2272. debug('tunneling socket could not be established, statusCode=%d',
  2273. res.statusCode);
  2274. var error = new Error('tunneling socket could not be established, ' +
  2275. 'statusCode=' + res.statusCode);
  2276. error.code = 'ECONNRESET';
  2277. options.request.emit('error', error);
  2278. self.removeSocket(placeholder);
  2279. }
  2280. }
  2281. function onError(cause) {
  2282. connectReq.removeAllListeners();
  2283. debug('tunneling socket could not be established, cause=%s\n',
  2284. cause.message, cause.stack);
  2285. var error = new Error('tunneling socket could not be established, ' +
  2286. 'cause=' + cause.message);
  2287. error.code = 'ECONNRESET';
  2288. options.request.emit('error', error);
  2289. self.removeSocket(placeholder);
  2290. }
  2291. };
  2292. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2293. var pos = this.sockets.indexOf(socket)
  2294. if (pos === -1) {
  2295. return;
  2296. }
  2297. this.sockets.splice(pos, 1);
  2298. var pending = this.requests.shift();
  2299. if (pending) {
  2300. // If we have pending requests and a socket gets closed a new one
  2301. // needs to be created to take over in the pool for the one that closed.
  2302. this.createSocket(pending, function(socket) {
  2303. pending.request.onSocket(socket);
  2304. });
  2305. }
  2306. };
  2307. function createSecureSocket(options, cb) {
  2308. var self = this;
  2309. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2310. var hostHeader = options.request.getHeader('host');
  2311. var tlsOptions = mergeOptions({}, self.options, {
  2312. socket: socket,
  2313. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2314. });
  2315. // 0 is dummy port for v0.6
  2316. var secureSocket = tls.connect(0, tlsOptions);
  2317. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2318. cb(secureSocket);
  2319. });
  2320. }
  2321. function toOptions(host, port, localAddress) {
  2322. if (typeof host === 'string') { // since v0.10
  2323. return {
  2324. host: host,
  2325. port: port,
  2326. localAddress: localAddress
  2327. };
  2328. }
  2329. return host; // for v0.11 or later
  2330. }
  2331. function mergeOptions(target) {
  2332. for (var i = 1, len = arguments.length; i < len; ++i) {
  2333. var overrides = arguments[i];
  2334. if (typeof overrides === 'object') {
  2335. var keys = Object.keys(overrides);
  2336. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2337. var k = keys[j];
  2338. if (overrides[k] !== undefined) {
  2339. target[k] = overrides[k];
  2340. }
  2341. }
  2342. }
  2343. }
  2344. return target;
  2345. }
  2346. var debug;
  2347. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2348. debug = function() {
  2349. var args = Array.prototype.slice.call(arguments);
  2350. if (typeof args[0] === 'string') {
  2351. args[0] = 'TUNNEL: ' + args[0];
  2352. } else {
  2353. args.unshift('TUNNEL:');
  2354. }
  2355. console.error.apply(console, args);
  2356. }
  2357. } else {
  2358. debug = function() {};
  2359. }
  2360. exports.debug = debug; // for test
  2361. /***/ }),
  2362. /***/ 143:
  2363. /***/ (function(module, __unusedexports, __webpack_require__) {
  2364. module.exports = withAuthorizationPrefix;
  2365. const atob = __webpack_require__(368);
  2366. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2367. function withAuthorizationPrefix(authorization) {
  2368. if (/^(basic|bearer|token) /i.test(authorization)) {
  2369. return authorization;
  2370. }
  2371. try {
  2372. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2373. return `basic ${authorization}`;
  2374. }
  2375. } catch (error) {}
  2376. if (authorization.split(/\./).length === 3) {
  2377. return `bearer ${authorization}`;
  2378. }
  2379. return `token ${authorization}`;
  2380. }
  2381. /***/ }),
  2382. /***/ 145:
  2383. /***/ (function(module, __unusedexports, __webpack_require__) {
  2384. "use strict";
  2385. const pump = __webpack_require__(453);
  2386. const bufferStream = __webpack_require__(966);
  2387. class MaxBufferError extends Error {
  2388. constructor() {
  2389. super('maxBuffer exceeded');
  2390. this.name = 'MaxBufferError';
  2391. }
  2392. }
  2393. function getStream(inputStream, options) {
  2394. if (!inputStream) {
  2395. return Promise.reject(new Error('Expected a stream'));
  2396. }
  2397. options = Object.assign({maxBuffer: Infinity}, options);
  2398. const {maxBuffer} = options;
  2399. let stream;
  2400. return new Promise((resolve, reject) => {
  2401. const rejectPromise = error => {
  2402. if (error) { // A null check
  2403. error.bufferedData = stream.getBufferedValue();
  2404. }
  2405. reject(error);
  2406. };
  2407. stream = pump(inputStream, bufferStream(options), error => {
  2408. if (error) {
  2409. rejectPromise(error);
  2410. return;
  2411. }
  2412. resolve();
  2413. });
  2414. stream.on('data', () => {
  2415. if (stream.getBufferedLength() > maxBuffer) {
  2416. rejectPromise(new MaxBufferError());
  2417. }
  2418. });
  2419. }).then(() => stream.getBufferedValue());
  2420. }
  2421. module.exports = getStream;
  2422. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2423. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2424. module.exports.MaxBufferError = MaxBufferError;
  2425. /***/ }),
  2426. /***/ 148:
  2427. /***/ (function(module, __unusedexports, __webpack_require__) {
  2428. module.exports = paginatePlugin;
  2429. const { paginateRest } = __webpack_require__(299);
  2430. function paginatePlugin(octokit) {
  2431. Object.assign(octokit, paginateRest(octokit));
  2432. }
  2433. /***/ }),
  2434. /***/ 153:
  2435. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2436. "use strict";
  2437. var __importStar = (this && this.__importStar) || function (mod) {
  2438. if (mod && mod.__esModule) return mod;
  2439. var result = {};
  2440. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2441. result["default"] = mod;
  2442. return result;
  2443. };
  2444. Object.defineProperty(exports, "__esModule", { value: true });
  2445. const coreCommand = __importStar(__webpack_require__(431));
  2446. /**
  2447. * Indicates whether the POST action is running
  2448. */
  2449. exports.IsPost = !!process.env['STATE_isPost'];
  2450. /**
  2451. * The repository path for the POST action. The value is empty during the MAIN action.
  2452. */
  2453. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2454. /**
  2455. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2456. */
  2457. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2458. /**
  2459. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2460. */
  2461. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2462. /**
  2463. * Save the repository path so the POST action can retrieve the value.
  2464. */
  2465. function setRepositoryPath(repositoryPath) {
  2466. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2467. }
  2468. exports.setRepositoryPath = setRepositoryPath;
  2469. /**
  2470. * Save the SSH key path so the POST action can retrieve the value.
  2471. */
  2472. function setSshKeyPath(sshKeyPath) {
  2473. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2474. }
  2475. exports.setSshKeyPath = setSshKeyPath;
  2476. /**
  2477. * Save the SSH known hosts path so the POST action can retrieve the value.
  2478. */
  2479. function setSshKnownHostsPath(sshKnownHostsPath) {
  2480. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2481. }
  2482. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2483. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2484. // This is necessary since we don't have a separate entry point.
  2485. if (!exports.IsPost) {
  2486. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2487. }
  2488. /***/ }),
  2489. /***/ 168:
  2490. /***/ (function(module) {
  2491. "use strict";
  2492. const alias = ['stdin', 'stdout', 'stderr'];
  2493. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2494. module.exports = opts => {
  2495. if (!opts) {
  2496. return null;
  2497. }
  2498. if (opts.stdio && hasAlias(opts)) {
  2499. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2500. }
  2501. if (typeof opts.stdio === 'string') {
  2502. return opts.stdio;
  2503. }
  2504. const stdio = opts.stdio || [];
  2505. if (!Array.isArray(stdio)) {
  2506. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2507. }
  2508. const result = [];
  2509. const len = Math.max(stdio.length, alias.length);
  2510. for (let i = 0; i < len; i++) {
  2511. let value = null;
  2512. if (stdio[i] !== undefined) {
  2513. value = stdio[i];
  2514. } else if (opts[alias[i]] !== undefined) {
  2515. value = opts[alias[i]];
  2516. }
  2517. result[i] = value;
  2518. }
  2519. return result;
  2520. };
  2521. /***/ }),
  2522. /***/ 179:
  2523. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2524. "use strict";
  2525. var net = __webpack_require__(631);
  2526. var tls = __webpack_require__(16);
  2527. var http = __webpack_require__(605);
  2528. var https = __webpack_require__(34);
  2529. var events = __webpack_require__(614);
  2530. var assert = __webpack_require__(357);
  2531. var util = __webpack_require__(669);
  2532. exports.httpOverHttp = httpOverHttp;
  2533. exports.httpsOverHttp = httpsOverHttp;
  2534. exports.httpOverHttps = httpOverHttps;
  2535. exports.httpsOverHttps = httpsOverHttps;
  2536. function httpOverHttp(options) {
  2537. var agent = new TunnelingAgent(options);
  2538. agent.request = http.request;
  2539. return agent;
  2540. }
  2541. function httpsOverHttp(options) {
  2542. var agent = new TunnelingAgent(options);
  2543. agent.request = http.request;
  2544. agent.createSocket = createSecureSocket;
  2545. agent.defaultPort = 443;
  2546. return agent;
  2547. }
  2548. function httpOverHttps(options) {
  2549. var agent = new TunnelingAgent(options);
  2550. agent.request = https.request;
  2551. return agent;
  2552. }
  2553. function httpsOverHttps(options) {
  2554. var agent = new TunnelingAgent(options);
  2555. agent.request = https.request;
  2556. agent.createSocket = createSecureSocket;
  2557. agent.defaultPort = 443;
  2558. return agent;
  2559. }
  2560. function TunnelingAgent(options) {
  2561. var self = this;
  2562. self.options = options || {};
  2563. self.proxyOptions = self.options.proxy || {};
  2564. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2565. self.requests = [];
  2566. self.sockets = [];
  2567. self.on('free', function onFree(socket, host, port, localAddress) {
  2568. var options = toOptions(host, port, localAddress);
  2569. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2570. var pending = self.requests[i];
  2571. if (pending.host === options.host && pending.port === options.port) {
  2572. // Detect the request to connect same origin server,
  2573. // reuse the connection.
  2574. self.requests.splice(i, 1);
  2575. pending.request.onSocket(socket);
  2576. return;
  2577. }
  2578. }
  2579. socket.destroy();
  2580. self.removeSocket(socket);
  2581. });
  2582. }
  2583. util.inherits(TunnelingAgent, events.EventEmitter);
  2584. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2585. var self = this;
  2586. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2587. if (self.sockets.length >= this.maxSockets) {
  2588. // We are over limit so we'll add it to the queue.
  2589. self.requests.push(options);
  2590. return;
  2591. }
  2592. // If we are under maxSockets create a new one.
  2593. self.createSocket(options, function(socket) {
  2594. socket.on('free', onFree);
  2595. socket.on('close', onCloseOrRemove);
  2596. socket.on('agentRemove', onCloseOrRemove);
  2597. req.onSocket(socket);
  2598. function onFree() {
  2599. self.emit('free', socket, options);
  2600. }
  2601. function onCloseOrRemove(err) {
  2602. self.removeSocket(socket);
  2603. socket.removeListener('free', onFree);
  2604. socket.removeListener('close', onCloseOrRemove);
  2605. socket.removeListener('agentRemove', onCloseOrRemove);
  2606. }
  2607. });
  2608. };
  2609. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2610. var self = this;
  2611. var placeholder = {};
  2612. self.sockets.push(placeholder);
  2613. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2614. method: 'CONNECT',
  2615. path: options.host + ':' + options.port,
  2616. agent: false,
  2617. headers: {
  2618. host: options.host + ':' + options.port
  2619. }
  2620. });
  2621. if (options.localAddress) {
  2622. connectOptions.localAddress = options.localAddress;
  2623. }
  2624. if (connectOptions.proxyAuth) {
  2625. connectOptions.headers = connectOptions.headers || {};
  2626. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2627. new Buffer(connectOptions.proxyAuth).toString('base64');
  2628. }
  2629. debug('making CONNECT request');
  2630. var connectReq = self.request(connectOptions);
  2631. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2632. connectReq.once('response', onResponse); // for v0.6
  2633. connectReq.once('upgrade', onUpgrade); // for v0.6
  2634. connectReq.once('connect', onConnect); // for v0.7 or later
  2635. connectReq.once('error', onError);
  2636. connectReq.end();
  2637. function onResponse(res) {
  2638. // Very hacky. This is necessary to avoid http-parser leaks.
  2639. res.upgrade = true;
  2640. }
  2641. function onUpgrade(res, socket, head) {
  2642. // Hacky.
  2643. process.nextTick(function() {
  2644. onConnect(res, socket, head);
  2645. });
  2646. }
  2647. function onConnect(res, socket, head) {
  2648. connectReq.removeAllListeners();
  2649. socket.removeAllListeners();
  2650. if (res.statusCode !== 200) {
  2651. debug('tunneling socket could not be established, statusCode=%d',
  2652. res.statusCode);
  2653. socket.destroy();
  2654. var error = new Error('tunneling socket could not be established, ' +
  2655. 'statusCode=' + res.statusCode);
  2656. error.code = 'ECONNRESET';
  2657. options.request.emit('error', error);
  2658. self.removeSocket(placeholder);
  2659. return;
  2660. }
  2661. if (head.length > 0) {
  2662. debug('got illegal response body from proxy');
  2663. socket.destroy();
  2664. var error = new Error('got illegal response body from proxy');
  2665. error.code = 'ECONNRESET';
  2666. options.request.emit('error', error);
  2667. self.removeSocket(placeholder);
  2668. return;
  2669. }
  2670. debug('tunneling connection has established');
  2671. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2672. return cb(socket);
  2673. }
  2674. function onError(cause) {
  2675. connectReq.removeAllListeners();
  2676. debug('tunneling socket could not be established, cause=%s\n',
  2677. cause.message, cause.stack);
  2678. var error = new Error('tunneling socket could not be established, ' +
  2679. 'cause=' + cause.message);
  2680. error.code = 'ECONNRESET';
  2681. options.request.emit('error', error);
  2682. self.removeSocket(placeholder);
  2683. }
  2684. };
  2685. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2686. var pos = this.sockets.indexOf(socket)
  2687. if (pos === -1) {
  2688. return;
  2689. }
  2690. this.sockets.splice(pos, 1);
  2691. var pending = this.requests.shift();
  2692. if (pending) {
  2693. // If we have pending requests and a socket gets closed a new one
  2694. // needs to be created to take over in the pool for the one that closed.
  2695. this.createSocket(pending, function(socket) {
  2696. pending.request.onSocket(socket);
  2697. });
  2698. }
  2699. };
  2700. function createSecureSocket(options, cb) {
  2701. var self = this;
  2702. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2703. var hostHeader = options.request.getHeader('host');
  2704. var tlsOptions = mergeOptions({}, self.options, {
  2705. socket: socket,
  2706. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2707. });
  2708. // 0 is dummy port for v0.6
  2709. var secureSocket = tls.connect(0, tlsOptions);
  2710. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2711. cb(secureSocket);
  2712. });
  2713. }
  2714. function toOptions(host, port, localAddress) {
  2715. if (typeof host === 'string') { // since v0.10
  2716. return {
  2717. host: host,
  2718. port: port,
  2719. localAddress: localAddress
  2720. };
  2721. }
  2722. return host; // for v0.11 or later
  2723. }
  2724. function mergeOptions(target) {
  2725. for (var i = 1, len = arguments.length; i < len; ++i) {
  2726. var overrides = arguments[i];
  2727. if (typeof overrides === 'object') {
  2728. var keys = Object.keys(overrides);
  2729. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2730. var k = keys[j];
  2731. if (overrides[k] !== undefined) {
  2732. target[k] = overrides[k];
  2733. }
  2734. }
  2735. }
  2736. }
  2737. return target;
  2738. }
  2739. var debug;
  2740. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2741. debug = function() {
  2742. var args = Array.prototype.slice.call(arguments);
  2743. if (typeof args[0] === 'string') {
  2744. args[0] = 'TUNNEL: ' + args[0];
  2745. } else {
  2746. args.unshift('TUNNEL:');
  2747. }
  2748. console.error.apply(console, args);
  2749. }
  2750. } else {
  2751. debug = function() {};
  2752. }
  2753. exports.debug = debug; // for test
  2754. /***/ }),
  2755. /***/ 190:
  2756. /***/ (function(module, __unusedexports, __webpack_require__) {
  2757. module.exports = authenticationPlugin;
  2758. const { createTokenAuth } = __webpack_require__(813);
  2759. const { Deprecation } = __webpack_require__(692);
  2760. const once = __webpack_require__(969);
  2761. const beforeRequest = __webpack_require__(863);
  2762. const requestError = __webpack_require__(991);
  2763. const validate = __webpack_require__(954);
  2764. const withAuthorizationPrefix = __webpack_require__(143);
  2765. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2766. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2767. function authenticationPlugin(octokit, options) {
  2768. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2769. if (options.authStrategy) {
  2770. const auth = options.authStrategy(options.auth);
  2771. octokit.hook.wrap("request", auth.hook);
  2772. octokit.auth = auth;
  2773. return;
  2774. }
  2775. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2776. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2777. if (!options.auth) {
  2778. octokit.auth = () =>
  2779. Promise.resolve({
  2780. type: "unauthenticated"
  2781. });
  2782. return;
  2783. }
  2784. const isBasicAuthString =
  2785. typeof options.auth === "string" &&
  2786. /^basic/.test(withAuthorizationPrefix(options.auth));
  2787. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2788. if (typeof options.auth === "string" && !isBasicAuthString) {
  2789. const auth = createTokenAuth(options.auth);
  2790. octokit.hook.wrap("request", auth.hook);
  2791. octokit.auth = auth;
  2792. return;
  2793. }
  2794. // Otherwise log a deprecation message
  2795. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2796. ? [
  2797. deprecateAuthBasic,
  2798. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2799. ]
  2800. : [
  2801. deprecateAuthObject,
  2802. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2803. ];
  2804. deprecationMethod(
  2805. octokit.log,
  2806. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2807. );
  2808. octokit.auth = () =>
  2809. Promise.resolve({
  2810. type: "deprecated",
  2811. message: deprecationMessapge
  2812. });
  2813. validate(options.auth);
  2814. const state = {
  2815. octokit,
  2816. auth: options.auth
  2817. };
  2818. octokit.hook.before("request", beforeRequest.bind(null, state));
  2819. octokit.hook.error("request", requestError.bind(null, state));
  2820. }
  2821. /***/ }),
  2822. /***/ 197:
  2823. /***/ (function(module, __unusedexports, __webpack_require__) {
  2824. module.exports = isexe
  2825. isexe.sync = sync
  2826. var fs = __webpack_require__(747)
  2827. function isexe (path, options, cb) {
  2828. fs.stat(path, function (er, stat) {
  2829. cb(er, er ? false : checkStat(stat, options))
  2830. })
  2831. }
  2832. function sync (path, options) {
  2833. return checkStat(fs.statSync(path), options)
  2834. }
  2835. function checkStat (stat, options) {
  2836. return stat.isFile() && checkMode(stat, options)
  2837. }
  2838. function checkMode (stat, options) {
  2839. var mod = stat.mode
  2840. var uid = stat.uid
  2841. var gid = stat.gid
  2842. var myUid = options.uid !== undefined ?
  2843. options.uid : process.getuid && process.getuid()
  2844. var myGid = options.gid !== undefined ?
  2845. options.gid : process.getgid && process.getgid()
  2846. var u = parseInt('100', 8)
  2847. var g = parseInt('010', 8)
  2848. var o = parseInt('001', 8)
  2849. var ug = u | g
  2850. var ret = (mod & o) ||
  2851. (mod & g) && gid === myGid ||
  2852. (mod & u) && uid === myUid ||
  2853. (mod & ug) && myUid === 0
  2854. return ret
  2855. }
  2856. /***/ }),
  2857. /***/ 198:
  2858. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2859. "use strict";
  2860. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2861. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2862. return new (P || (P = Promise))(function (resolve, reject) {
  2863. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2864. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2865. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2866. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2867. });
  2868. };
  2869. var __importStar = (this && this.__importStar) || function (mod) {
  2870. if (mod && mod.__esModule) return mod;
  2871. var result = {};
  2872. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2873. result["default"] = mod;
  2874. return result;
  2875. };
  2876. Object.defineProperty(exports, "__esModule", { value: true });
  2877. const core = __importStar(__webpack_require__(470));
  2878. const coreCommand = __importStar(__webpack_require__(431));
  2879. const gitSourceProvider = __importStar(__webpack_require__(293));
  2880. const inputHelper = __importStar(__webpack_require__(821));
  2881. const path = __importStar(__webpack_require__(622));
  2882. const stateHelper = __importStar(__webpack_require__(153));
  2883. function run() {
  2884. return __awaiter(this, void 0, void 0, function* () {
  2885. try {
  2886. const sourceSettings = inputHelper.getInputs();
  2887. try {
  2888. // Register problem matcher
  2889. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2890. // Get sources
  2891. yield gitSourceProvider.getSource(sourceSettings);
  2892. }
  2893. finally {
  2894. // Unregister problem matcher
  2895. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2896. }
  2897. }
  2898. catch (error) {
  2899. core.setFailed(error.message);
  2900. }
  2901. });
  2902. }
  2903. function cleanup() {
  2904. return __awaiter(this, void 0, void 0, function* () {
  2905. try {
  2906. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2907. }
  2908. catch (error) {
  2909. core.warning(error.message);
  2910. }
  2911. });
  2912. }
  2913. // Main
  2914. if (!stateHelper.IsPost) {
  2915. run();
  2916. }
  2917. // Post
  2918. else {
  2919. cleanup();
  2920. }
  2921. /***/ }),
  2922. /***/ 211:
  2923. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2924. "use strict";
  2925. Object.defineProperty(exports, '__esModule', { value: true });
  2926. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2927. var osName = _interopDefault(__webpack_require__(2));
  2928. function getUserAgent() {
  2929. try {
  2930. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2931. } catch (error) {
  2932. if (/wmic os get Caption/.test(error.message)) {
  2933. return "Windows <version undetectable>";
  2934. }
  2935. return "<environment undetectable>";
  2936. }
  2937. }
  2938. exports.getUserAgent = getUserAgent;
  2939. //# sourceMappingURL=index.js.map
  2940. /***/ }),
  2941. /***/ 215:
  2942. /***/ (function(module) {
  2943. module.exports = {"name":"@octokit/rest","version":"16.43.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_from":"@octokit/rest@16.43.1"};
  2944. /***/ }),
  2945. /***/ 227:
  2946. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2947. "use strict";
  2948. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2949. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2950. return new (P || (P = Promise))(function (resolve, reject) {
  2951. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2952. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2953. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2954. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2955. });
  2956. };
  2957. var __importStar = (this && this.__importStar) || function (mod) {
  2958. if (mod && mod.__esModule) return mod;
  2959. var result = {};
  2960. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2961. result["default"] = mod;
  2962. return result;
  2963. };
  2964. Object.defineProperty(exports, "__esModule", { value: true });
  2965. const url_1 = __webpack_require__(835);
  2966. const core = __importStar(__webpack_require__(470));
  2967. const github = __importStar(__webpack_require__(469));
  2968. function getCheckoutInfo(git, ref, commit) {
  2969. return __awaiter(this, void 0, void 0, function* () {
  2970. if (!git) {
  2971. throw new Error('Arg git cannot be empty');
  2972. }
  2973. if (!ref && !commit) {
  2974. throw new Error('Args ref and commit cannot both be empty');
  2975. }
  2976. const result = {};
  2977. const upperRef = (ref || '').toUpperCase();
  2978. // SHA only
  2979. if (!ref) {
  2980. result.ref = commit;
  2981. }
  2982. // refs/heads/
  2983. else if (upperRef.startsWith('REFS/HEADS/')) {
  2984. const branch = ref.substring('refs/heads/'.length);
  2985. result.ref = branch;
  2986. result.startPoint = `refs/remotes/origin/${branch}`;
  2987. }
  2988. // refs/pull/
  2989. else if (upperRef.startsWith('REFS/PULL/')) {
  2990. const branch = ref.substring('refs/pull/'.length);
  2991. result.ref = `refs/remotes/pull/${branch}`;
  2992. }
  2993. // refs/tags/
  2994. else if (upperRef.startsWith('REFS/')) {
  2995. result.ref = ref;
  2996. }
  2997. // Unqualified ref, check for a matching branch or tag
  2998. else {
  2999. if (yield git.branchExists(true, `origin/${ref}`)) {
  3000. result.ref = ref;
  3001. result.startPoint = `refs/remotes/origin/${ref}`;
  3002. }
  3003. else if (yield git.tagExists(`${ref}`)) {
  3004. result.ref = `refs/tags/${ref}`;
  3005. }
  3006. else {
  3007. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3008. }
  3009. }
  3010. return result;
  3011. });
  3012. }
  3013. exports.getCheckoutInfo = getCheckoutInfo;
  3014. function getRefSpec(ref, commit) {
  3015. if (!ref && !commit) {
  3016. throw new Error('Args ref and commit cannot both be empty');
  3017. }
  3018. const upperRef = (ref || '').toUpperCase();
  3019. // SHA
  3020. if (commit) {
  3021. // refs/heads
  3022. if (upperRef.startsWith('REFS/HEADS/')) {
  3023. const branch = ref.substring('refs/heads/'.length);
  3024. return [`+${commit}:refs/remotes/origin/${branch}`];
  3025. }
  3026. // refs/pull/
  3027. else if (upperRef.startsWith('REFS/PULL/')) {
  3028. const branch = ref.substring('refs/pull/'.length);
  3029. return [`+${commit}:refs/remotes/pull/${branch}`];
  3030. }
  3031. // refs/tags/
  3032. else if (upperRef.startsWith('REFS/TAGS/')) {
  3033. return [`+${commit}:${ref}`];
  3034. }
  3035. // Otherwise no destination ref
  3036. else {
  3037. return [commit];
  3038. }
  3039. }
  3040. // Unqualified ref, check for a matching branch or tag
  3041. else if (!upperRef.startsWith('REFS/')) {
  3042. return [
  3043. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3044. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3045. ];
  3046. }
  3047. // refs/heads/
  3048. else if (upperRef.startsWith('REFS/HEADS/')) {
  3049. const branch = ref.substring('refs/heads/'.length);
  3050. return [`+${ref}:refs/remotes/origin/${branch}`];
  3051. }
  3052. // refs/pull/
  3053. else if (upperRef.startsWith('REFS/PULL/')) {
  3054. const branch = ref.substring('refs/pull/'.length);
  3055. return [`+${ref}:refs/remotes/pull/${branch}`];
  3056. }
  3057. // refs/tags/
  3058. else {
  3059. return [`+${ref}:${ref}`];
  3060. }
  3061. }
  3062. exports.getRefSpec = getRefSpec;
  3063. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3064. return __awaiter(this, void 0, void 0, function* () {
  3065. try {
  3066. // GHES?
  3067. if (isGhes()) {
  3068. return;
  3069. }
  3070. // Auth token?
  3071. if (!token) {
  3072. return;
  3073. }
  3074. // Public PR synchronize, for workflow repo?
  3075. if (fromPayload('repository.private') !== false ||
  3076. github.context.eventName !== 'pull_request' ||
  3077. fromPayload('action') !== 'synchronize' ||
  3078. repositoryOwner !== github.context.repo.owner ||
  3079. repositoryName !== github.context.repo.repo ||
  3080. ref !== github.context.ref ||
  3081. !ref.startsWith('refs/pull/') ||
  3082. commit !== github.context.sha) {
  3083. return;
  3084. }
  3085. // Head SHA
  3086. const expectedHeadSha = fromPayload('after');
  3087. if (!expectedHeadSha) {
  3088. core.debug('Unable to determine head sha');
  3089. return;
  3090. }
  3091. // Base SHA
  3092. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3093. if (!expectedBaseSha) {
  3094. core.debug('Unable to determine base sha');
  3095. return;
  3096. }
  3097. // Expected message?
  3098. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3099. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3100. return;
  3101. }
  3102. // Extract details from message
  3103. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3104. if (!match) {
  3105. core.debug('Unexpected message format');
  3106. return;
  3107. }
  3108. // Post telemetry
  3109. const actualHeadSha = match[1];
  3110. if (actualHeadSha !== expectedHeadSha) {
  3111. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3112. const octokit = new github.GitHub(token, {
  3113. 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})`
  3114. });
  3115. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3116. }
  3117. }
  3118. catch (err) {
  3119. core.debug(`Error when validating commit info: ${err.stack}`);
  3120. }
  3121. });
  3122. }
  3123. exports.checkCommitInfo = checkCommitInfo;
  3124. function fromPayload(path) {
  3125. return select(github.context.payload, path);
  3126. }
  3127. function select(obj, path) {
  3128. if (!obj) {
  3129. return undefined;
  3130. }
  3131. const i = path.indexOf('.');
  3132. if (i < 0) {
  3133. return obj[path];
  3134. }
  3135. const key = path.substr(0, i);
  3136. return select(obj[key], path.substr(i + 1));
  3137. }
  3138. function isGhes() {
  3139. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3140. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3141. }
  3142. /***/ }),
  3143. /***/ 260:
  3144. /***/ (function(module, __unusedexports, __webpack_require__) {
  3145. // Note: since nyc uses this module to output coverage, any lines
  3146. // that are in the direct sync flow of nyc's outputCoverage are
  3147. // ignored, since we can never get coverage for them.
  3148. var assert = __webpack_require__(357)
  3149. var signals = __webpack_require__(654)
  3150. var EE = __webpack_require__(614)
  3151. /* istanbul ignore if */
  3152. if (typeof EE !== 'function') {
  3153. EE = EE.EventEmitter
  3154. }
  3155. var emitter
  3156. if (process.__signal_exit_emitter__) {
  3157. emitter = process.__signal_exit_emitter__
  3158. } else {
  3159. emitter = process.__signal_exit_emitter__ = new EE()
  3160. emitter.count = 0
  3161. emitter.emitted = {}
  3162. }
  3163. // Because this emitter is a global, we have to check to see if a
  3164. // previous version of this library failed to enable infinite listeners.
  3165. // I know what you're about to say. But literally everything about
  3166. // signal-exit is a compromise with evil. Get used to it.
  3167. if (!emitter.infinite) {
  3168. emitter.setMaxListeners(Infinity)
  3169. emitter.infinite = true
  3170. }
  3171. module.exports = function (cb, opts) {
  3172. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3173. if (loaded === false) {
  3174. load()
  3175. }
  3176. var ev = 'exit'
  3177. if (opts && opts.alwaysLast) {
  3178. ev = 'afterexit'
  3179. }
  3180. var remove = function () {
  3181. emitter.removeListener(ev, cb)
  3182. if (emitter.listeners('exit').length === 0 &&
  3183. emitter.listeners('afterexit').length === 0) {
  3184. unload()
  3185. }
  3186. }
  3187. emitter.on(ev, cb)
  3188. return remove
  3189. }
  3190. module.exports.unload = unload
  3191. function unload () {
  3192. if (!loaded) {
  3193. return
  3194. }
  3195. loaded = false
  3196. signals.forEach(function (sig) {
  3197. try {
  3198. process.removeListener(sig, sigListeners[sig])
  3199. } catch (er) {}
  3200. })
  3201. process.emit = originalProcessEmit
  3202. process.reallyExit = originalProcessReallyExit
  3203. emitter.count -= 1
  3204. }
  3205. function emit (event, code, signal) {
  3206. if (emitter.emitted[event]) {
  3207. return
  3208. }
  3209. emitter.emitted[event] = true
  3210. emitter.emit(event, code, signal)
  3211. }
  3212. // { <signal>: <listener fn>, ... }
  3213. var sigListeners = {}
  3214. signals.forEach(function (sig) {
  3215. sigListeners[sig] = function listener () {
  3216. // If there are no other listeners, an exit is coming!
  3217. // Simplest way: remove us and then re-send the signal.
  3218. // We know that this will kill the process, so we can
  3219. // safely emit now.
  3220. var listeners = process.listeners(sig)
  3221. if (listeners.length === emitter.count) {
  3222. unload()
  3223. emit('exit', null, sig)
  3224. /* istanbul ignore next */
  3225. emit('afterexit', null, sig)
  3226. /* istanbul ignore next */
  3227. process.kill(process.pid, sig)
  3228. }
  3229. }
  3230. })
  3231. module.exports.signals = function () {
  3232. return signals
  3233. }
  3234. module.exports.load = load
  3235. var loaded = false
  3236. function load () {
  3237. if (loaded) {
  3238. return
  3239. }
  3240. loaded = true
  3241. // This is the number of onSignalExit's that are in play.
  3242. // It's important so that we can count the correct number of
  3243. // listeners on signals, and don't wait for the other one to
  3244. // handle it instead of us.
  3245. emitter.count += 1
  3246. signals = signals.filter(function (sig) {
  3247. try {
  3248. process.on(sig, sigListeners[sig])
  3249. return true
  3250. } catch (er) {
  3251. return false
  3252. }
  3253. })
  3254. process.emit = processEmit
  3255. process.reallyExit = processReallyExit
  3256. }
  3257. var originalProcessReallyExit = process.reallyExit
  3258. function processReallyExit (code) {
  3259. process.exitCode = code || 0
  3260. emit('exit', process.exitCode, null)
  3261. /* istanbul ignore next */
  3262. emit('afterexit', process.exitCode, null)
  3263. /* istanbul ignore next */
  3264. originalProcessReallyExit.call(process, process.exitCode)
  3265. }
  3266. var originalProcessEmit = process.emit
  3267. function processEmit (ev, arg) {
  3268. if (ev === 'exit') {
  3269. if (arg !== undefined) {
  3270. process.exitCode = arg
  3271. }
  3272. var ret = originalProcessEmit.apply(this, arguments)
  3273. emit('exit', process.exitCode, null)
  3274. /* istanbul ignore next */
  3275. emit('afterexit', process.exitCode, null)
  3276. return ret
  3277. } else {
  3278. return originalProcessEmit.apply(this, arguments)
  3279. }
  3280. }
  3281. /***/ }),
  3282. /***/ 262:
  3283. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3284. "use strict";
  3285. Object.defineProperty(exports, "__esModule", { value: true });
  3286. const fs_1 = __webpack_require__(747);
  3287. const os_1 = __webpack_require__(87);
  3288. class Context {
  3289. /**
  3290. * Hydrate the context from the environment
  3291. */
  3292. constructor() {
  3293. this.payload = {};
  3294. if (process.env.GITHUB_EVENT_PATH) {
  3295. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3296. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3297. }
  3298. else {
  3299. const path = process.env.GITHUB_EVENT_PATH;
  3300. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3301. }
  3302. }
  3303. this.eventName = process.env.GITHUB_EVENT_NAME;
  3304. this.sha = process.env.GITHUB_SHA;
  3305. this.ref = process.env.GITHUB_REF;
  3306. this.workflow = process.env.GITHUB_WORKFLOW;
  3307. this.action = process.env.GITHUB_ACTION;
  3308. this.actor = process.env.GITHUB_ACTOR;
  3309. }
  3310. get issue() {
  3311. const payload = this.payload;
  3312. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3313. }
  3314. get repo() {
  3315. if (process.env.GITHUB_REPOSITORY) {
  3316. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3317. return { owner, repo };
  3318. }
  3319. if (this.payload.repository) {
  3320. return {
  3321. owner: this.payload.repository.owner.login,
  3322. repo: this.payload.repository.name
  3323. };
  3324. }
  3325. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3326. }
  3327. }
  3328. exports.Context = Context;
  3329. //# sourceMappingURL=context.js.map
  3330. /***/ }),
  3331. /***/ 265:
  3332. /***/ (function(module, __unusedexports, __webpack_require__) {
  3333. module.exports = getPage
  3334. const deprecate = __webpack_require__(370)
  3335. const getPageLinks = __webpack_require__(577)
  3336. const HttpError = __webpack_require__(297)
  3337. function getPage (octokit, link, which, headers) {
  3338. 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.`)
  3339. const url = getPageLinks(link)[which]
  3340. if (!url) {
  3341. const urlError = new HttpError(`No ${which} page found`, 404)
  3342. return Promise.reject(urlError)
  3343. }
  3344. const requestOptions = {
  3345. url,
  3346. headers: applyAcceptHeader(link, headers)
  3347. }
  3348. const promise = octokit.request(requestOptions)
  3349. return promise
  3350. }
  3351. function applyAcceptHeader (res, headers) {
  3352. const previous = res.headers && res.headers['x-github-media-type']
  3353. if (!previous || (headers && headers.accept)) {
  3354. return headers
  3355. }
  3356. headers = headers || {}
  3357. headers.accept = 'application/vnd.' + previous
  3358. .replace('; param=', '.')
  3359. .replace('; format=', '+')
  3360. return headers
  3361. }
  3362. /***/ }),
  3363. /***/ 280:
  3364. /***/ (function(module, exports) {
  3365. exports = module.exports = SemVer
  3366. var debug
  3367. /* istanbul ignore next */
  3368. if (typeof process === 'object' &&
  3369. process.env &&
  3370. process.env.NODE_DEBUG &&
  3371. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3372. debug = function () {
  3373. var args = Array.prototype.slice.call(arguments, 0)
  3374. args.unshift('SEMVER')
  3375. console.log.apply(console, args)
  3376. }
  3377. } else {
  3378. debug = function () {}
  3379. }
  3380. // Note: this is the semver.org version of the spec that it implements
  3381. // Not necessarily the package version of this code.
  3382. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3383. var MAX_LENGTH = 256
  3384. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3385. /* istanbul ignore next */ 9007199254740991
  3386. // Max safe segment length for coercion.
  3387. var MAX_SAFE_COMPONENT_LENGTH = 16
  3388. // The actual regexps go on exports.re
  3389. var re = exports.re = []
  3390. var src = exports.src = []
  3391. var R = 0
  3392. // The following Regular Expressions can be used for tokenizing,
  3393. // validating, and parsing SemVer version strings.
  3394. // ## Numeric Identifier
  3395. // A single `0`, or a non-zero digit followed by zero or more digits.
  3396. var NUMERICIDENTIFIER = R++
  3397. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3398. var NUMERICIDENTIFIERLOOSE = R++
  3399. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3400. // ## Non-numeric Identifier
  3401. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3402. // more letters, digits, or hyphens.
  3403. var NONNUMERICIDENTIFIER = R++
  3404. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3405. // ## Main Version
  3406. // Three dot-separated numeric identifiers.
  3407. var MAINVERSION = R++
  3408. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3409. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3410. '(' + src[NUMERICIDENTIFIER] + ')'
  3411. var MAINVERSIONLOOSE = R++
  3412. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3413. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3414. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3415. // ## Pre-release Version Identifier
  3416. // A numeric identifier, or a non-numeric identifier.
  3417. var PRERELEASEIDENTIFIER = R++
  3418. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3419. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3420. var PRERELEASEIDENTIFIERLOOSE = R++
  3421. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3422. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3423. // ## Pre-release Version
  3424. // Hyphen, followed by one or more dot-separated pre-release version
  3425. // identifiers.
  3426. var PRERELEASE = R++
  3427. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3428. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3429. var PRERELEASELOOSE = R++
  3430. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3431. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3432. // ## Build Metadata Identifier
  3433. // Any combination of digits, letters, or hyphens.
  3434. var BUILDIDENTIFIER = R++
  3435. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3436. // ## Build Metadata
  3437. // Plus sign, followed by one or more period-separated build metadata
  3438. // identifiers.
  3439. var BUILD = R++
  3440. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3441. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3442. // ## Full Version String
  3443. // A main version, followed optionally by a pre-release version and
  3444. // build metadata.
  3445. // Note that the only major, minor, patch, and pre-release sections of
  3446. // the version string are capturing groups. The build metadata is not a
  3447. // capturing group, because it should not ever be used in version
  3448. // comparison.
  3449. var FULL = R++
  3450. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3451. src[PRERELEASE] + '?' +
  3452. src[BUILD] + '?'
  3453. src[FULL] = '^' + FULLPLAIN + '$'
  3454. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3455. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3456. // common in the npm registry.
  3457. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3458. src[PRERELEASELOOSE] + '?' +
  3459. src[BUILD] + '?'
  3460. var LOOSE = R++
  3461. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3462. var GTLT = R++
  3463. src[GTLT] = '((?:<|>)?=?)'
  3464. // Something like "2.*" or "1.2.x".
  3465. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3466. // Only the first item is strictly required.
  3467. var XRANGEIDENTIFIERLOOSE = R++
  3468. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3469. var XRANGEIDENTIFIER = R++
  3470. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3471. var XRANGEPLAIN = R++
  3472. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3473. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3474. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3475. '(?:' + src[PRERELEASE] + ')?' +
  3476. src[BUILD] + '?' +
  3477. ')?)?'
  3478. var XRANGEPLAINLOOSE = R++
  3479. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3480. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3481. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3482. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3483. src[BUILD] + '?' +
  3484. ')?)?'
  3485. var XRANGE = R++
  3486. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3487. var XRANGELOOSE = R++
  3488. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3489. // Coercion.
  3490. // Extract anything that could conceivably be a part of a valid semver
  3491. var COERCE = R++
  3492. src[COERCE] = '(?:^|[^\\d])' +
  3493. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3494. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3495. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3496. '(?:$|[^\\d])'
  3497. // Tilde ranges.
  3498. // Meaning is "reasonably at or greater than"
  3499. var LONETILDE = R++
  3500. src[LONETILDE] = '(?:~>?)'
  3501. var TILDETRIM = R++
  3502. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3503. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3504. var tildeTrimReplace = '$1~'
  3505. var TILDE = R++
  3506. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3507. var TILDELOOSE = R++
  3508. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3509. // Caret ranges.
  3510. // Meaning is "at least and backwards compatible with"
  3511. var LONECARET = R++
  3512. src[LONECARET] = '(?:\\^)'
  3513. var CARETTRIM = R++
  3514. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3515. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3516. var caretTrimReplace = '$1^'
  3517. var CARET = R++
  3518. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3519. var CARETLOOSE = R++
  3520. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3521. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3522. var COMPARATORLOOSE = R++
  3523. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3524. var COMPARATOR = R++
  3525. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3526. // An expression to strip any whitespace between the gtlt and the thing
  3527. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3528. var COMPARATORTRIM = R++
  3529. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3530. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3531. // this one has to use the /g flag
  3532. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3533. var comparatorTrimReplace = '$1$2$3'
  3534. // Something like `1.2.3 - 1.2.4`
  3535. // Note that these all use the loose form, because they'll be
  3536. // checked against either the strict or loose comparator form
  3537. // later.
  3538. var HYPHENRANGE = R++
  3539. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3540. '\\s+-\\s+' +
  3541. '(' + src[XRANGEPLAIN] + ')' +
  3542. '\\s*$'
  3543. var HYPHENRANGELOOSE = R++
  3544. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3545. '\\s+-\\s+' +
  3546. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3547. '\\s*$'
  3548. // Star ranges basically just allow anything at all.
  3549. var STAR = R++
  3550. src[STAR] = '(<|>)?=?\\s*\\*'
  3551. // Compile to actual regexp objects.
  3552. // All are flag-free, unless they were created above with a flag.
  3553. for (var i = 0; i < R; i++) {
  3554. debug(i, src[i])
  3555. if (!re[i]) {
  3556. re[i] = new RegExp(src[i])
  3557. }
  3558. }
  3559. exports.parse = parse
  3560. function parse (version, options) {
  3561. if (!options || typeof options !== 'object') {
  3562. options = {
  3563. loose: !!options,
  3564. includePrerelease: false
  3565. }
  3566. }
  3567. if (version instanceof SemVer) {
  3568. return version
  3569. }
  3570. if (typeof version !== 'string') {
  3571. return null
  3572. }
  3573. if (version.length > MAX_LENGTH) {
  3574. return null
  3575. }
  3576. var r = options.loose ? re[LOOSE] : re[FULL]
  3577. if (!r.test(version)) {
  3578. return null
  3579. }
  3580. try {
  3581. return new SemVer(version, options)
  3582. } catch (er) {
  3583. return null
  3584. }
  3585. }
  3586. exports.valid = valid
  3587. function valid (version, options) {
  3588. var v = parse(version, options)
  3589. return v ? v.version : null
  3590. }
  3591. exports.clean = clean
  3592. function clean (version, options) {
  3593. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3594. return s ? s.version : null
  3595. }
  3596. exports.SemVer = SemVer
  3597. function SemVer (version, options) {
  3598. if (!options || typeof options !== 'object') {
  3599. options = {
  3600. loose: !!options,
  3601. includePrerelease: false
  3602. }
  3603. }
  3604. if (version instanceof SemVer) {
  3605. if (version.loose === options.loose) {
  3606. return version
  3607. } else {
  3608. version = version.version
  3609. }
  3610. } else if (typeof version !== 'string') {
  3611. throw new TypeError('Invalid Version: ' + version)
  3612. }
  3613. if (version.length > MAX_LENGTH) {
  3614. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3615. }
  3616. if (!(this instanceof SemVer)) {
  3617. return new SemVer(version, options)
  3618. }
  3619. debug('SemVer', version, options)
  3620. this.options = options
  3621. this.loose = !!options.loose
  3622. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3623. if (!m) {
  3624. throw new TypeError('Invalid Version: ' + version)
  3625. }
  3626. this.raw = version
  3627. // these are actually numbers
  3628. this.major = +m[1]
  3629. this.minor = +m[2]
  3630. this.patch = +m[3]
  3631. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3632. throw new TypeError('Invalid major version')
  3633. }
  3634. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3635. throw new TypeError('Invalid minor version')
  3636. }
  3637. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3638. throw new TypeError('Invalid patch version')
  3639. }
  3640. // numberify any prerelease numeric ids
  3641. if (!m[4]) {
  3642. this.prerelease = []
  3643. } else {
  3644. this.prerelease = m[4].split('.').map(function (id) {
  3645. if (/^[0-9]+$/.test(id)) {
  3646. var num = +id
  3647. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3648. return num
  3649. }
  3650. }
  3651. return id
  3652. })
  3653. }
  3654. this.build = m[5] ? m[5].split('.') : []
  3655. this.format()
  3656. }
  3657. SemVer.prototype.format = function () {
  3658. this.version = this.major + '.' + this.minor + '.' + this.patch
  3659. if (this.prerelease.length) {
  3660. this.version += '-' + this.prerelease.join('.')
  3661. }
  3662. return this.version
  3663. }
  3664. SemVer.prototype.toString = function () {
  3665. return this.version
  3666. }
  3667. SemVer.prototype.compare = function (other) {
  3668. debug('SemVer.compare', this.version, this.options, other)
  3669. if (!(other instanceof SemVer)) {
  3670. other = new SemVer(other, this.options)
  3671. }
  3672. return this.compareMain(other) || this.comparePre(other)
  3673. }
  3674. SemVer.prototype.compareMain = function (other) {
  3675. if (!(other instanceof SemVer)) {
  3676. other = new SemVer(other, this.options)
  3677. }
  3678. return compareIdentifiers(this.major, other.major) ||
  3679. compareIdentifiers(this.minor, other.minor) ||
  3680. compareIdentifiers(this.patch, other.patch)
  3681. }
  3682. SemVer.prototype.comparePre = function (other) {
  3683. if (!(other instanceof SemVer)) {
  3684. other = new SemVer(other, this.options)
  3685. }
  3686. // NOT having a prerelease is > having one
  3687. if (this.prerelease.length && !other.prerelease.length) {
  3688. return -1
  3689. } else if (!this.prerelease.length && other.prerelease.length) {
  3690. return 1
  3691. } else if (!this.prerelease.length && !other.prerelease.length) {
  3692. return 0
  3693. }
  3694. var i = 0
  3695. do {
  3696. var a = this.prerelease[i]
  3697. var b = other.prerelease[i]
  3698. debug('prerelease compare', i, a, b)
  3699. if (a === undefined && b === undefined) {
  3700. return 0
  3701. } else if (b === undefined) {
  3702. return 1
  3703. } else if (a === undefined) {
  3704. return -1
  3705. } else if (a === b) {
  3706. continue
  3707. } else {
  3708. return compareIdentifiers(a, b)
  3709. }
  3710. } while (++i)
  3711. }
  3712. // preminor will bump the version up to the next minor release, and immediately
  3713. // down to pre-release. premajor and prepatch work the same way.
  3714. SemVer.prototype.inc = function (release, identifier) {
  3715. switch (release) {
  3716. case 'premajor':
  3717. this.prerelease.length = 0
  3718. this.patch = 0
  3719. this.minor = 0
  3720. this.major++
  3721. this.inc('pre', identifier)
  3722. break
  3723. case 'preminor':
  3724. this.prerelease.length = 0
  3725. this.patch = 0
  3726. this.minor++
  3727. this.inc('pre', identifier)
  3728. break
  3729. case 'prepatch':
  3730. // If this is already a prerelease, it will bump to the next version
  3731. // drop any prereleases that might already exist, since they are not
  3732. // relevant at this point.
  3733. this.prerelease.length = 0
  3734. this.inc('patch', identifier)
  3735. this.inc('pre', identifier)
  3736. break
  3737. // If the input is a non-prerelease version, this acts the same as
  3738. // prepatch.
  3739. case 'prerelease':
  3740. if (this.prerelease.length === 0) {
  3741. this.inc('patch', identifier)
  3742. }
  3743. this.inc('pre', identifier)
  3744. break
  3745. case 'major':
  3746. // If this is a pre-major version, bump up to the same major version.
  3747. // Otherwise increment major.
  3748. // 1.0.0-5 bumps to 1.0.0
  3749. // 1.1.0 bumps to 2.0.0
  3750. if (this.minor !== 0 ||
  3751. this.patch !== 0 ||
  3752. this.prerelease.length === 0) {
  3753. this.major++
  3754. }
  3755. this.minor = 0
  3756. this.patch = 0
  3757. this.prerelease = []
  3758. break
  3759. case 'minor':
  3760. // If this is a pre-minor version, bump up to the same minor version.
  3761. // Otherwise increment minor.
  3762. // 1.2.0-5 bumps to 1.2.0
  3763. // 1.2.1 bumps to 1.3.0
  3764. if (this.patch !== 0 || this.prerelease.length === 0) {
  3765. this.minor++
  3766. }
  3767. this.patch = 0
  3768. this.prerelease = []
  3769. break
  3770. case 'patch':
  3771. // If this is not a pre-release version, it will increment the patch.
  3772. // If it is a pre-release it will bump up to the same patch version.
  3773. // 1.2.0-5 patches to 1.2.0
  3774. // 1.2.0 patches to 1.2.1
  3775. if (this.prerelease.length === 0) {
  3776. this.patch++
  3777. }
  3778. this.prerelease = []
  3779. break
  3780. // This probably shouldn't be used publicly.
  3781. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3782. case 'pre':
  3783. if (this.prerelease.length === 0) {
  3784. this.prerelease = [0]
  3785. } else {
  3786. var i = this.prerelease.length
  3787. while (--i >= 0) {
  3788. if (typeof this.prerelease[i] === 'number') {
  3789. this.prerelease[i]++
  3790. i = -2
  3791. }
  3792. }
  3793. if (i === -1) {
  3794. // didn't increment anything
  3795. this.prerelease.push(0)
  3796. }
  3797. }
  3798. if (identifier) {
  3799. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3800. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3801. if (this.prerelease[0] === identifier) {
  3802. if (isNaN(this.prerelease[1])) {
  3803. this.prerelease = [identifier, 0]
  3804. }
  3805. } else {
  3806. this.prerelease = [identifier, 0]
  3807. }
  3808. }
  3809. break
  3810. default:
  3811. throw new Error('invalid increment argument: ' + release)
  3812. }
  3813. this.format()
  3814. this.raw = this.version
  3815. return this
  3816. }
  3817. exports.inc = inc
  3818. function inc (version, release, loose, identifier) {
  3819. if (typeof (loose) === 'string') {
  3820. identifier = loose
  3821. loose = undefined
  3822. }
  3823. try {
  3824. return new SemVer(version, loose).inc(release, identifier).version
  3825. } catch (er) {
  3826. return null
  3827. }
  3828. }
  3829. exports.diff = diff
  3830. function diff (version1, version2) {
  3831. if (eq(version1, version2)) {
  3832. return null
  3833. } else {
  3834. var v1 = parse(version1)
  3835. var v2 = parse(version2)
  3836. var prefix = ''
  3837. if (v1.prerelease.length || v2.prerelease.length) {
  3838. prefix = 'pre'
  3839. var defaultResult = 'prerelease'
  3840. }
  3841. for (var key in v1) {
  3842. if (key === 'major' || key === 'minor' || key === 'patch') {
  3843. if (v1[key] !== v2[key]) {
  3844. return prefix + key
  3845. }
  3846. }
  3847. }
  3848. return defaultResult // may be undefined
  3849. }
  3850. }
  3851. exports.compareIdentifiers = compareIdentifiers
  3852. var numeric = /^[0-9]+$/
  3853. function compareIdentifiers (a, b) {
  3854. var anum = numeric.test(a)
  3855. var bnum = numeric.test(b)
  3856. if (anum && bnum) {
  3857. a = +a
  3858. b = +b
  3859. }
  3860. return a === b ? 0
  3861. : (anum && !bnum) ? -1
  3862. : (bnum && !anum) ? 1
  3863. : a < b ? -1
  3864. : 1
  3865. }
  3866. exports.rcompareIdentifiers = rcompareIdentifiers
  3867. function rcompareIdentifiers (a, b) {
  3868. return compareIdentifiers(b, a)
  3869. }
  3870. exports.major = major
  3871. function major (a, loose) {
  3872. return new SemVer(a, loose).major
  3873. }
  3874. exports.minor = minor
  3875. function minor (a, loose) {
  3876. return new SemVer(a, loose).minor
  3877. }
  3878. exports.patch = patch
  3879. function patch (a, loose) {
  3880. return new SemVer(a, loose).patch
  3881. }
  3882. exports.compare = compare
  3883. function compare (a, b, loose) {
  3884. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3885. }
  3886. exports.compareLoose = compareLoose
  3887. function compareLoose (a, b) {
  3888. return compare(a, b, true)
  3889. }
  3890. exports.rcompare = rcompare
  3891. function rcompare (a, b, loose) {
  3892. return compare(b, a, loose)
  3893. }
  3894. exports.sort = sort
  3895. function sort (list, loose) {
  3896. return list.sort(function (a, b) {
  3897. return exports.compare(a, b, loose)
  3898. })
  3899. }
  3900. exports.rsort = rsort
  3901. function rsort (list, loose) {
  3902. return list.sort(function (a, b) {
  3903. return exports.rcompare(a, b, loose)
  3904. })
  3905. }
  3906. exports.gt = gt
  3907. function gt (a, b, loose) {
  3908. return compare(a, b, loose) > 0
  3909. }
  3910. exports.lt = lt
  3911. function lt (a, b, loose) {
  3912. return compare(a, b, loose) < 0
  3913. }
  3914. exports.eq = eq
  3915. function eq (a, b, loose) {
  3916. return compare(a, b, loose) === 0
  3917. }
  3918. exports.neq = neq
  3919. function neq (a, b, loose) {
  3920. return compare(a, b, loose) !== 0
  3921. }
  3922. exports.gte = gte
  3923. function gte (a, b, loose) {
  3924. return compare(a, b, loose) >= 0
  3925. }
  3926. exports.lte = lte
  3927. function lte (a, b, loose) {
  3928. return compare(a, b, loose) <= 0
  3929. }
  3930. exports.cmp = cmp
  3931. function cmp (a, op, b, loose) {
  3932. switch (op) {
  3933. case '===':
  3934. if (typeof a === 'object')
  3935. a = a.version
  3936. if (typeof b === 'object')
  3937. b = b.version
  3938. return a === b
  3939. case '!==':
  3940. if (typeof a === 'object')
  3941. a = a.version
  3942. if (typeof b === 'object')
  3943. b = b.version
  3944. return a !== b
  3945. case '':
  3946. case '=':
  3947. case '==':
  3948. return eq(a, b, loose)
  3949. case '!=':
  3950. return neq(a, b, loose)
  3951. case '>':
  3952. return gt(a, b, loose)
  3953. case '>=':
  3954. return gte(a, b, loose)
  3955. case '<':
  3956. return lt(a, b, loose)
  3957. case '<=':
  3958. return lte(a, b, loose)
  3959. default:
  3960. throw new TypeError('Invalid operator: ' + op)
  3961. }
  3962. }
  3963. exports.Comparator = Comparator
  3964. function Comparator (comp, options) {
  3965. if (!options || typeof options !== 'object') {
  3966. options = {
  3967. loose: !!options,
  3968. includePrerelease: false
  3969. }
  3970. }
  3971. if (comp instanceof Comparator) {
  3972. if (comp.loose === !!options.loose) {
  3973. return comp
  3974. } else {
  3975. comp = comp.value
  3976. }
  3977. }
  3978. if (!(this instanceof Comparator)) {
  3979. return new Comparator(comp, options)
  3980. }
  3981. debug('comparator', comp, options)
  3982. this.options = options
  3983. this.loose = !!options.loose
  3984. this.parse(comp)
  3985. if (this.semver === ANY) {
  3986. this.value = ''
  3987. } else {
  3988. this.value = this.operator + this.semver.version
  3989. }
  3990. debug('comp', this)
  3991. }
  3992. var ANY = {}
  3993. Comparator.prototype.parse = function (comp) {
  3994. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3995. var m = comp.match(r)
  3996. if (!m) {
  3997. throw new TypeError('Invalid comparator: ' + comp)
  3998. }
  3999. this.operator = m[1]
  4000. if (this.operator === '=') {
  4001. this.operator = ''
  4002. }
  4003. // if it literally is just '>' or '' then allow anything.
  4004. if (!m[2]) {
  4005. this.semver = ANY
  4006. } else {
  4007. this.semver = new SemVer(m[2], this.options.loose)
  4008. }
  4009. }
  4010. Comparator.prototype.toString = function () {
  4011. return this.value
  4012. }
  4013. Comparator.prototype.test = function (version) {
  4014. debug('Comparator.test', version, this.options.loose)
  4015. if (this.semver === ANY) {
  4016. return true
  4017. }
  4018. if (typeof version === 'string') {
  4019. version = new SemVer(version, this.options)
  4020. }
  4021. return cmp(version, this.operator, this.semver, this.options)
  4022. }
  4023. Comparator.prototype.intersects = function (comp, options) {
  4024. if (!(comp instanceof Comparator)) {
  4025. throw new TypeError('a Comparator is required')
  4026. }
  4027. if (!options || typeof options !== 'object') {
  4028. options = {
  4029. loose: !!options,
  4030. includePrerelease: false
  4031. }
  4032. }
  4033. var rangeTmp
  4034. if (this.operator === '') {
  4035. rangeTmp = new Range(comp.value, options)
  4036. return satisfies(this.value, rangeTmp, options)
  4037. } else if (comp.operator === '') {
  4038. rangeTmp = new Range(this.value, options)
  4039. return satisfies(comp.semver, rangeTmp, options)
  4040. }
  4041. var sameDirectionIncreasing =
  4042. (this.operator === '>=' || this.operator === '>') &&
  4043. (comp.operator === '>=' || comp.operator === '>')
  4044. var sameDirectionDecreasing =
  4045. (this.operator === '<=' || this.operator === '<') &&
  4046. (comp.operator === '<=' || comp.operator === '<')
  4047. var sameSemVer = this.semver.version === comp.semver.version
  4048. var differentDirectionsInclusive =
  4049. (this.operator === '>=' || this.operator === '<=') &&
  4050. (comp.operator === '>=' || comp.operator === '<=')
  4051. var oppositeDirectionsLessThan =
  4052. cmp(this.semver, '<', comp.semver, options) &&
  4053. ((this.operator === '>=' || this.operator === '>') &&
  4054. (comp.operator === '<=' || comp.operator === '<'))
  4055. var oppositeDirectionsGreaterThan =
  4056. cmp(this.semver, '>', comp.semver, options) &&
  4057. ((this.operator === '<=' || this.operator === '<') &&
  4058. (comp.operator === '>=' || comp.operator === '>'))
  4059. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4060. (sameSemVer && differentDirectionsInclusive) ||
  4061. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4062. }
  4063. exports.Range = Range
  4064. function Range (range, options) {
  4065. if (!options || typeof options !== 'object') {
  4066. options = {
  4067. loose: !!options,
  4068. includePrerelease: false
  4069. }
  4070. }
  4071. if (range instanceof Range) {
  4072. if (range.loose === !!options.loose &&
  4073. range.includePrerelease === !!options.includePrerelease) {
  4074. return range
  4075. } else {
  4076. return new Range(range.raw, options)
  4077. }
  4078. }
  4079. if (range instanceof Comparator) {
  4080. return new Range(range.value, options)
  4081. }
  4082. if (!(this instanceof Range)) {
  4083. return new Range(range, options)
  4084. }
  4085. this.options = options
  4086. this.loose = !!options.loose
  4087. this.includePrerelease = !!options.includePrerelease
  4088. // First, split based on boolean or ||
  4089. this.raw = range
  4090. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4091. return this.parseRange(range.trim())
  4092. }, this).filter(function (c) {
  4093. // throw out any that are not relevant for whatever reason
  4094. return c.length
  4095. })
  4096. if (!this.set.length) {
  4097. throw new TypeError('Invalid SemVer Range: ' + range)
  4098. }
  4099. this.format()
  4100. }
  4101. Range.prototype.format = function () {
  4102. this.range = this.set.map(function (comps) {
  4103. return comps.join(' ').trim()
  4104. }).join('||').trim()
  4105. return this.range
  4106. }
  4107. Range.prototype.toString = function () {
  4108. return this.range
  4109. }
  4110. Range.prototype.parseRange = function (range) {
  4111. var loose = this.options.loose
  4112. range = range.trim()
  4113. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4114. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4115. range = range.replace(hr, hyphenReplace)
  4116. debug('hyphen replace', range)
  4117. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4118. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4119. debug('comparator trim', range, re[COMPARATORTRIM])
  4120. // `~ 1.2.3` => `~1.2.3`
  4121. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4122. // `^ 1.2.3` => `^1.2.3`
  4123. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4124. // normalize spaces
  4125. range = range.split(/\s+/).join(' ')
  4126. // At this point, the range is completely trimmed and
  4127. // ready to be split into comparators.
  4128. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4129. var set = range.split(' ').map(function (comp) {
  4130. return parseComparator(comp, this.options)
  4131. }, this).join(' ').split(/\s+/)
  4132. if (this.options.loose) {
  4133. // in loose mode, throw out any that are not valid comparators
  4134. set = set.filter(function (comp) {
  4135. return !!comp.match(compRe)
  4136. })
  4137. }
  4138. set = set.map(function (comp) {
  4139. return new Comparator(comp, this.options)
  4140. }, this)
  4141. return set
  4142. }
  4143. Range.prototype.intersects = function (range, options) {
  4144. if (!(range instanceof Range)) {
  4145. throw new TypeError('a Range is required')
  4146. }
  4147. return this.set.some(function (thisComparators) {
  4148. return thisComparators.every(function (thisComparator) {
  4149. return range.set.some(function (rangeComparators) {
  4150. return rangeComparators.every(function (rangeComparator) {
  4151. return thisComparator.intersects(rangeComparator, options)
  4152. })
  4153. })
  4154. })
  4155. })
  4156. }
  4157. // Mostly just for testing and legacy API reasons
  4158. exports.toComparators = toComparators
  4159. function toComparators (range, options) {
  4160. return new Range(range, options).set.map(function (comp) {
  4161. return comp.map(function (c) {
  4162. return c.value
  4163. }).join(' ').trim().split(' ')
  4164. })
  4165. }
  4166. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4167. // already replaced the hyphen ranges
  4168. // turn into a set of JUST comparators.
  4169. function parseComparator (comp, options) {
  4170. debug('comp', comp, options)
  4171. comp = replaceCarets(comp, options)
  4172. debug('caret', comp)
  4173. comp = replaceTildes(comp, options)
  4174. debug('tildes', comp)
  4175. comp = replaceXRanges(comp, options)
  4176. debug('xrange', comp)
  4177. comp = replaceStars(comp, options)
  4178. debug('stars', comp)
  4179. return comp
  4180. }
  4181. function isX (id) {
  4182. return !id || id.toLowerCase() === 'x' || id === '*'
  4183. }
  4184. // ~, ~> --> * (any, kinda silly)
  4185. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4186. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4187. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4188. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4189. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4190. function replaceTildes (comp, options) {
  4191. return comp.trim().split(/\s+/).map(function (comp) {
  4192. return replaceTilde(comp, options)
  4193. }).join(' ')
  4194. }
  4195. function replaceTilde (comp, options) {
  4196. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4197. return comp.replace(r, function (_, M, m, p, pr) {
  4198. debug('tilde', comp, _, M, m, p, pr)
  4199. var ret
  4200. if (isX(M)) {
  4201. ret = ''
  4202. } else if (isX(m)) {
  4203. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4204. } else if (isX(p)) {
  4205. // ~1.2 == >=1.2.0 <1.3.0
  4206. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4207. } else if (pr) {
  4208. debug('replaceTilde pr', pr)
  4209. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4210. ' <' + M + '.' + (+m + 1) + '.0'
  4211. } else {
  4212. // ~1.2.3 == >=1.2.3 <1.3.0
  4213. ret = '>=' + M + '.' + m + '.' + p +
  4214. ' <' + M + '.' + (+m + 1) + '.0'
  4215. }
  4216. debug('tilde return', ret)
  4217. return ret
  4218. })
  4219. }
  4220. // ^ --> * (any, kinda silly)
  4221. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4222. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4223. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4224. // ^1.2.3 --> >=1.2.3 <2.0.0
  4225. // ^1.2.0 --> >=1.2.0 <2.0.0
  4226. function replaceCarets (comp, options) {
  4227. return comp.trim().split(/\s+/).map(function (comp) {
  4228. return replaceCaret(comp, options)
  4229. }).join(' ')
  4230. }
  4231. function replaceCaret (comp, options) {
  4232. debug('caret', comp, options)
  4233. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4234. return comp.replace(r, function (_, M, m, p, pr) {
  4235. debug('caret', comp, _, M, m, p, pr)
  4236. var ret
  4237. if (isX(M)) {
  4238. ret = ''
  4239. } else if (isX(m)) {
  4240. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4241. } else if (isX(p)) {
  4242. if (M === '0') {
  4243. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4244. } else {
  4245. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4246. }
  4247. } else if (pr) {
  4248. debug('replaceCaret pr', pr)
  4249. if (M === '0') {
  4250. if (m === '0') {
  4251. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4252. ' <' + M + '.' + m + '.' + (+p + 1)
  4253. } else {
  4254. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4255. ' <' + M + '.' + (+m + 1) + '.0'
  4256. }
  4257. } else {
  4258. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4259. ' <' + (+M + 1) + '.0.0'
  4260. }
  4261. } else {
  4262. debug('no pr')
  4263. if (M === '0') {
  4264. if (m === '0') {
  4265. ret = '>=' + M + '.' + m + '.' + p +
  4266. ' <' + M + '.' + m + '.' + (+p + 1)
  4267. } else {
  4268. ret = '>=' + M + '.' + m + '.' + p +
  4269. ' <' + M + '.' + (+m + 1) + '.0'
  4270. }
  4271. } else {
  4272. ret = '>=' + M + '.' + m + '.' + p +
  4273. ' <' + (+M + 1) + '.0.0'
  4274. }
  4275. }
  4276. debug('caret return', ret)
  4277. return ret
  4278. })
  4279. }
  4280. function replaceXRanges (comp, options) {
  4281. debug('replaceXRanges', comp, options)
  4282. return comp.split(/\s+/).map(function (comp) {
  4283. return replaceXRange(comp, options)
  4284. }).join(' ')
  4285. }
  4286. function replaceXRange (comp, options) {
  4287. comp = comp.trim()
  4288. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4289. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4290. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4291. var xM = isX(M)
  4292. var xm = xM || isX(m)
  4293. var xp = xm || isX(p)
  4294. var anyX = xp
  4295. if (gtlt === '=' && anyX) {
  4296. gtlt = ''
  4297. }
  4298. if (xM) {
  4299. if (gtlt === '>' || gtlt === '<') {
  4300. // nothing is allowed
  4301. ret = '<0.0.0'
  4302. } else {
  4303. // nothing is forbidden
  4304. ret = '*'
  4305. }
  4306. } else if (gtlt && anyX) {
  4307. // we know patch is an x, because we have any x at all.
  4308. // replace X with 0
  4309. if (xm) {
  4310. m = 0
  4311. }
  4312. p = 0
  4313. if (gtlt === '>') {
  4314. // >1 => >=2.0.0
  4315. // >1.2 => >=1.3.0
  4316. // >1.2.3 => >= 1.2.4
  4317. gtlt = '>='
  4318. if (xm) {
  4319. M = +M + 1
  4320. m = 0
  4321. p = 0
  4322. } else {
  4323. m = +m + 1
  4324. p = 0
  4325. }
  4326. } else if (gtlt === '<=') {
  4327. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4328. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4329. gtlt = '<'
  4330. if (xm) {
  4331. M = +M + 1
  4332. } else {
  4333. m = +m + 1
  4334. }
  4335. }
  4336. ret = gtlt + M + '.' + m + '.' + p
  4337. } else if (xm) {
  4338. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4339. } else if (xp) {
  4340. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4341. }
  4342. debug('xRange return', ret)
  4343. return ret
  4344. })
  4345. }
  4346. // Because * is AND-ed with everything else in the comparator,
  4347. // and '' means "any version", just remove the *s entirely.
  4348. function replaceStars (comp, options) {
  4349. debug('replaceStars', comp, options)
  4350. // Looseness is ignored here. star is always as loose as it gets!
  4351. return comp.trim().replace(re[STAR], '')
  4352. }
  4353. // This function is passed to string.replace(re[HYPHENRANGE])
  4354. // M, m, patch, prerelease, build
  4355. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4356. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4357. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4358. function hyphenReplace ($0,
  4359. from, fM, fm, fp, fpr, fb,
  4360. to, tM, tm, tp, tpr, tb) {
  4361. if (isX(fM)) {
  4362. from = ''
  4363. } else if (isX(fm)) {
  4364. from = '>=' + fM + '.0.0'
  4365. } else if (isX(fp)) {
  4366. from = '>=' + fM + '.' + fm + '.0'
  4367. } else {
  4368. from = '>=' + from
  4369. }
  4370. if (isX(tM)) {
  4371. to = ''
  4372. } else if (isX(tm)) {
  4373. to = '<' + (+tM + 1) + '.0.0'
  4374. } else if (isX(tp)) {
  4375. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4376. } else if (tpr) {
  4377. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4378. } else {
  4379. to = '<=' + to
  4380. }
  4381. return (from + ' ' + to).trim()
  4382. }
  4383. // if ANY of the sets match ALL of its comparators, then pass
  4384. Range.prototype.test = function (version) {
  4385. if (!version) {
  4386. return false
  4387. }
  4388. if (typeof version === 'string') {
  4389. version = new SemVer(version, this.options)
  4390. }
  4391. for (var i = 0; i < this.set.length; i++) {
  4392. if (testSet(this.set[i], version, this.options)) {
  4393. return true
  4394. }
  4395. }
  4396. return false
  4397. }
  4398. function testSet (set, version, options) {
  4399. for (var i = 0; i < set.length; i++) {
  4400. if (!set[i].test(version)) {
  4401. return false
  4402. }
  4403. }
  4404. if (version.prerelease.length && !options.includePrerelease) {
  4405. // Find the set of versions that are allowed to have prereleases
  4406. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4407. // That should allow `1.2.3-pr.2` to pass.
  4408. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4409. // even though it's within the range set by the comparators.
  4410. for (i = 0; i < set.length; i++) {
  4411. debug(set[i].semver)
  4412. if (set[i].semver === ANY) {
  4413. continue
  4414. }
  4415. if (set[i].semver.prerelease.length > 0) {
  4416. var allowed = set[i].semver
  4417. if (allowed.major === version.major &&
  4418. allowed.minor === version.minor &&
  4419. allowed.patch === version.patch) {
  4420. return true
  4421. }
  4422. }
  4423. }
  4424. // Version has a -pre, but it's not one of the ones we like.
  4425. return false
  4426. }
  4427. return true
  4428. }
  4429. exports.satisfies = satisfies
  4430. function satisfies (version, range, options) {
  4431. try {
  4432. range = new Range(range, options)
  4433. } catch (er) {
  4434. return false
  4435. }
  4436. return range.test(version)
  4437. }
  4438. exports.maxSatisfying = maxSatisfying
  4439. function maxSatisfying (versions, range, options) {
  4440. var max = null
  4441. var maxSV = null
  4442. try {
  4443. var rangeObj = new Range(range, options)
  4444. } catch (er) {
  4445. return null
  4446. }
  4447. versions.forEach(function (v) {
  4448. if (rangeObj.test(v)) {
  4449. // satisfies(v, range, options)
  4450. if (!max || maxSV.compare(v) === -1) {
  4451. // compare(max, v, true)
  4452. max = v
  4453. maxSV = new SemVer(max, options)
  4454. }
  4455. }
  4456. })
  4457. return max
  4458. }
  4459. exports.minSatisfying = minSatisfying
  4460. function minSatisfying (versions, range, options) {
  4461. var min = null
  4462. var minSV = null
  4463. try {
  4464. var rangeObj = new Range(range, options)
  4465. } catch (er) {
  4466. return null
  4467. }
  4468. versions.forEach(function (v) {
  4469. if (rangeObj.test(v)) {
  4470. // satisfies(v, range, options)
  4471. if (!min || minSV.compare(v) === 1) {
  4472. // compare(min, v, true)
  4473. min = v
  4474. minSV = new SemVer(min, options)
  4475. }
  4476. }
  4477. })
  4478. return min
  4479. }
  4480. exports.minVersion = minVersion
  4481. function minVersion (range, loose) {
  4482. range = new Range(range, loose)
  4483. var minver = new SemVer('0.0.0')
  4484. if (range.test(minver)) {
  4485. return minver
  4486. }
  4487. minver = new SemVer('0.0.0-0')
  4488. if (range.test(minver)) {
  4489. return minver
  4490. }
  4491. minver = null
  4492. for (var i = 0; i < range.set.length; ++i) {
  4493. var comparators = range.set[i]
  4494. comparators.forEach(function (comparator) {
  4495. // Clone to avoid manipulating the comparator's semver object.
  4496. var compver = new SemVer(comparator.semver.version)
  4497. switch (comparator.operator) {
  4498. case '>':
  4499. if (compver.prerelease.length === 0) {
  4500. compver.patch++
  4501. } else {
  4502. compver.prerelease.push(0)
  4503. }
  4504. compver.raw = compver.format()
  4505. /* fallthrough */
  4506. case '':
  4507. case '>=':
  4508. if (!minver || gt(minver, compver)) {
  4509. minver = compver
  4510. }
  4511. break
  4512. case '<':
  4513. case '<=':
  4514. /* Ignore maximum versions */
  4515. break
  4516. /* istanbul ignore next */
  4517. default:
  4518. throw new Error('Unexpected operation: ' + comparator.operator)
  4519. }
  4520. })
  4521. }
  4522. if (minver && range.test(minver)) {
  4523. return minver
  4524. }
  4525. return null
  4526. }
  4527. exports.validRange = validRange
  4528. function validRange (range, options) {
  4529. try {
  4530. // Return '*' instead of '' so that truthiness works.
  4531. // This will throw if it's invalid anyway
  4532. return new Range(range, options).range || '*'
  4533. } catch (er) {
  4534. return null
  4535. }
  4536. }
  4537. // Determine if version is less than all the versions possible in the range
  4538. exports.ltr = ltr
  4539. function ltr (version, range, options) {
  4540. return outside(version, range, '<', options)
  4541. }
  4542. // Determine if version is greater than all the versions possible in the range.
  4543. exports.gtr = gtr
  4544. function gtr (version, range, options) {
  4545. return outside(version, range, '>', options)
  4546. }
  4547. exports.outside = outside
  4548. function outside (version, range, hilo, options) {
  4549. version = new SemVer(version, options)
  4550. range = new Range(range, options)
  4551. var gtfn, ltefn, ltfn, comp, ecomp
  4552. switch (hilo) {
  4553. case '>':
  4554. gtfn = gt
  4555. ltefn = lte
  4556. ltfn = lt
  4557. comp = '>'
  4558. ecomp = '>='
  4559. break
  4560. case '<':
  4561. gtfn = lt
  4562. ltefn = gte
  4563. ltfn = gt
  4564. comp = '<'
  4565. ecomp = '<='
  4566. break
  4567. default:
  4568. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4569. }
  4570. // If it satisifes the range it is not outside
  4571. if (satisfies(version, range, options)) {
  4572. return false
  4573. }
  4574. // From now on, variable terms are as if we're in "gtr" mode.
  4575. // but note that everything is flipped for the "ltr" function.
  4576. for (var i = 0; i < range.set.length; ++i) {
  4577. var comparators = range.set[i]
  4578. var high = null
  4579. var low = null
  4580. comparators.forEach(function (comparator) {
  4581. if (comparator.semver === ANY) {
  4582. comparator = new Comparator('>=0.0.0')
  4583. }
  4584. high = high || comparator
  4585. low = low || comparator
  4586. if (gtfn(comparator.semver, high.semver, options)) {
  4587. high = comparator
  4588. } else if (ltfn(comparator.semver, low.semver, options)) {
  4589. low = comparator
  4590. }
  4591. })
  4592. // If the edge version comparator has a operator then our version
  4593. // isn't outside it
  4594. if (high.operator === comp || high.operator === ecomp) {
  4595. return false
  4596. }
  4597. // If the lowest version comparator has an operator and our version
  4598. // is less than it then it isn't higher than the range
  4599. if ((!low.operator || low.operator === comp) &&
  4600. ltefn(version, low.semver)) {
  4601. return false
  4602. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4603. return false
  4604. }
  4605. }
  4606. return true
  4607. }
  4608. exports.prerelease = prerelease
  4609. function prerelease (version, options) {
  4610. var parsed = parse(version, options)
  4611. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4612. }
  4613. exports.intersects = intersects
  4614. function intersects (r1, r2, options) {
  4615. r1 = new Range(r1, options)
  4616. r2 = new Range(r2, options)
  4617. return r1.intersects(r2)
  4618. }
  4619. exports.coerce = coerce
  4620. function coerce (version) {
  4621. if (version instanceof SemVer) {
  4622. return version
  4623. }
  4624. if (typeof version !== 'string') {
  4625. return null
  4626. }
  4627. var match = version.match(re[COERCE])
  4628. if (match == null) {
  4629. return null
  4630. }
  4631. return parse(match[1] +
  4632. '.' + (match[2] || '0') +
  4633. '.' + (match[3] || '0'))
  4634. }
  4635. /***/ }),
  4636. /***/ 287:
  4637. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4638. "use strict";
  4639. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4640. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4641. return new (P || (P = Promise))(function (resolve, reject) {
  4642. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4643. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4644. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4645. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4646. });
  4647. };
  4648. var __importStar = (this && this.__importStar) || function (mod) {
  4649. if (mod && mod.__esModule) return mod;
  4650. var result = {};
  4651. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4652. result["default"] = mod;
  4653. return result;
  4654. };
  4655. var __importDefault = (this && this.__importDefault) || function (mod) {
  4656. return (mod && mod.__esModule) ? mod : { "default": mod };
  4657. };
  4658. Object.defineProperty(exports, "__esModule", { value: true });
  4659. const assert = __importStar(__webpack_require__(357));
  4660. const core = __importStar(__webpack_require__(470));
  4661. const exec = __importStar(__webpack_require__(986));
  4662. const fs = __importStar(__webpack_require__(747));
  4663. const io = __importStar(__webpack_require__(1));
  4664. const os = __importStar(__webpack_require__(87));
  4665. const path = __importStar(__webpack_require__(622));
  4666. const regexpHelper = __importStar(__webpack_require__(528));
  4667. const stateHelper = __importStar(__webpack_require__(153));
  4668. const urlHelper = __importStar(__webpack_require__(81));
  4669. const v4_1 = __importDefault(__webpack_require__(826));
  4670. const IS_WINDOWS = process.platform === 'win32';
  4671. const SSH_COMMAND_KEY = 'core.sshCommand';
  4672. function createAuthHelper(git, settings) {
  4673. return new GitAuthHelper(git, settings);
  4674. }
  4675. exports.createAuthHelper = createAuthHelper;
  4676. class GitAuthHelper {
  4677. constructor(gitCommandManager, gitSourceSettings) {
  4678. this.sshCommand = '';
  4679. this.sshKeyPath = '';
  4680. this.sshKnownHostsPath = '';
  4681. this.temporaryHomePath = '';
  4682. this.git = gitCommandManager;
  4683. this.settings = gitSourceSettings || {};
  4684. // Token auth header
  4685. const serverUrl = urlHelper.getServerUrl();
  4686. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4687. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4688. core.setSecret(basicCredential);
  4689. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4690. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4691. // Instead of SSH URL
  4692. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4693. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4694. }
  4695. configureAuth() {
  4696. return __awaiter(this, void 0, void 0, function* () {
  4697. // Remove possible previous values
  4698. yield this.removeAuth();
  4699. // Configure new values
  4700. yield this.configureSsh();
  4701. yield this.configureToken();
  4702. });
  4703. }
  4704. configureGlobalAuth() {
  4705. return __awaiter(this, void 0, void 0, function* () {
  4706. // Create a temp home directory
  4707. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4708. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4709. const uniqueId = v4_1.default();
  4710. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4711. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4712. // Copy the global git config
  4713. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4714. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4715. let configExists = false;
  4716. try {
  4717. yield fs.promises.stat(gitConfigPath);
  4718. configExists = true;
  4719. }
  4720. catch (err) {
  4721. if (err.code !== 'ENOENT') {
  4722. throw err;
  4723. }
  4724. }
  4725. if (configExists) {
  4726. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4727. yield io.cp(gitConfigPath, newGitConfigPath);
  4728. }
  4729. else {
  4730. yield fs.promises.writeFile(newGitConfigPath, '');
  4731. }
  4732. try {
  4733. // Override HOME
  4734. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4735. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4736. // Configure the token
  4737. yield this.configureToken(newGitConfigPath, true);
  4738. // Configure HTTPS instead of SSH
  4739. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4740. if (!this.settings.sshKey) {
  4741. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4742. }
  4743. }
  4744. catch (err) {
  4745. // Unset in case somehow written to the real global config
  4746. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4747. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4748. throw err;
  4749. }
  4750. });
  4751. }
  4752. configureSubmoduleAuth() {
  4753. return __awaiter(this, void 0, void 0, function* () {
  4754. // Remove possible previous HTTPS instead of SSH
  4755. yield this.removeGitConfig(this.insteadOfKey, true);
  4756. if (this.settings.persistCredentials) {
  4757. // Configure a placeholder value. This approach avoids the credential being captured
  4758. // by process creation audit events, which are commonly logged. For more information,
  4759. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4760. 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);
  4761. // Replace the placeholder
  4762. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4763. for (const configPath of configPaths) {
  4764. core.debug(`Replacing token placeholder in '${configPath}'`);
  4765. this.replaceTokenPlaceholder(configPath);
  4766. }
  4767. if (this.settings.sshKey) {
  4768. // Configure core.sshCommand
  4769. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4770. }
  4771. else {
  4772. // Configure HTTPS instead of SSH
  4773. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4774. }
  4775. }
  4776. });
  4777. }
  4778. removeAuth() {
  4779. return __awaiter(this, void 0, void 0, function* () {
  4780. yield this.removeSsh();
  4781. yield this.removeToken();
  4782. });
  4783. }
  4784. removeGlobalAuth() {
  4785. return __awaiter(this, void 0, void 0, function* () {
  4786. core.debug(`Unsetting HOME override`);
  4787. this.git.removeEnvironmentVariable('HOME');
  4788. yield io.rmRF(this.temporaryHomePath);
  4789. });
  4790. }
  4791. configureSsh() {
  4792. return __awaiter(this, void 0, void 0, function* () {
  4793. if (!this.settings.sshKey) {
  4794. return;
  4795. }
  4796. // Write key
  4797. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4798. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4799. const uniqueId = v4_1.default();
  4800. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4801. stateHelper.setSshKeyPath(this.sshKeyPath);
  4802. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4803. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4804. // Remove inherited permissions on Windows
  4805. if (IS_WINDOWS) {
  4806. const icacls = yield io.which('icacls.exe');
  4807. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4808. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4809. }
  4810. // Write known hosts
  4811. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4812. let userKnownHosts = '';
  4813. try {
  4814. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4815. }
  4816. catch (err) {
  4817. if (err.code !== 'ENOENT') {
  4818. throw err;
  4819. }
  4820. }
  4821. let knownHosts = '';
  4822. if (userKnownHosts) {
  4823. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4824. }
  4825. if (this.settings.sshKnownHosts) {
  4826. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4827. }
  4828. 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`;
  4829. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4830. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4831. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4832. // Configure GIT_SSH_COMMAND
  4833. const sshPath = yield io.which('ssh', true);
  4834. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4835. if (this.settings.sshStrict) {
  4836. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4837. }
  4838. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4839. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4840. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4841. // Configure core.sshCommand
  4842. if (this.settings.persistCredentials) {
  4843. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4844. }
  4845. });
  4846. }
  4847. configureToken(configPath, globalConfig) {
  4848. return __awaiter(this, void 0, void 0, function* () {
  4849. // Validate args
  4850. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4851. // Default config path
  4852. if (!configPath && !globalConfig) {
  4853. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4854. }
  4855. // Configure a placeholder value. This approach avoids the credential being captured
  4856. // by process creation audit events, which are commonly logged. For more information,
  4857. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4858. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4859. // Replace the placeholder
  4860. yield this.replaceTokenPlaceholder(configPath || '');
  4861. });
  4862. }
  4863. replaceTokenPlaceholder(configPath) {
  4864. return __awaiter(this, void 0, void 0, function* () {
  4865. assert.ok(configPath, 'configPath is not defined');
  4866. let content = (yield fs.promises.readFile(configPath)).toString();
  4867. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4868. if (placeholderIndex < 0 ||
  4869. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4870. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4871. }
  4872. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4873. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4874. yield fs.promises.writeFile(configPath, content);
  4875. });
  4876. }
  4877. removeSsh() {
  4878. return __awaiter(this, void 0, void 0, function* () {
  4879. // SSH key
  4880. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4881. if (keyPath) {
  4882. try {
  4883. yield io.rmRF(keyPath);
  4884. }
  4885. catch (err) {
  4886. core.debug(err.message);
  4887. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4888. }
  4889. }
  4890. // SSH known hosts
  4891. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4892. if (knownHostsPath) {
  4893. try {
  4894. yield io.rmRF(knownHostsPath);
  4895. }
  4896. catch (_a) {
  4897. // Intentionally empty
  4898. }
  4899. }
  4900. // SSH command
  4901. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4902. });
  4903. }
  4904. removeToken() {
  4905. return __awaiter(this, void 0, void 0, function* () {
  4906. // HTTP extra header
  4907. yield this.removeGitConfig(this.tokenConfigKey);
  4908. });
  4909. }
  4910. removeGitConfig(configKey, submoduleOnly = false) {
  4911. return __awaiter(this, void 0, void 0, function* () {
  4912. if (!submoduleOnly) {
  4913. if ((yield this.git.configExists(configKey)) &&
  4914. !(yield this.git.tryConfigUnset(configKey))) {
  4915. // Load the config contents
  4916. core.warning(`Failed to remove '${configKey}' from the git config`);
  4917. }
  4918. }
  4919. const pattern = regexpHelper.escape(configKey);
  4920. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4921. });
  4922. }
  4923. }
  4924. /***/ }),
  4925. /***/ 289:
  4926. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4927. "use strict";
  4928. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4929. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4930. return new (P || (P = Promise))(function (resolve, reject) {
  4931. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4932. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4933. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4934. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4935. });
  4936. };
  4937. var __importStar = (this && this.__importStar) || function (mod) {
  4938. if (mod && mod.__esModule) return mod;
  4939. var result = {};
  4940. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4941. result["default"] = mod;
  4942. return result;
  4943. };
  4944. Object.defineProperty(exports, "__esModule", { value: true });
  4945. const core = __importStar(__webpack_require__(470));
  4946. const exec = __importStar(__webpack_require__(986));
  4947. const fshelper = __importStar(__webpack_require__(618));
  4948. const io = __importStar(__webpack_require__(1));
  4949. const path = __importStar(__webpack_require__(622));
  4950. const regexpHelper = __importStar(__webpack_require__(528));
  4951. const retryHelper = __importStar(__webpack_require__(587));
  4952. const git_version_1 = __webpack_require__(559);
  4953. // Auth header not supported before 2.9
  4954. // Wire protocol v2 not supported before 2.18
  4955. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4956. function createCommandManager(workingDirectory, lfs) {
  4957. return __awaiter(this, void 0, void 0, function* () {
  4958. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4959. });
  4960. }
  4961. exports.createCommandManager = createCommandManager;
  4962. class GitCommandManager {
  4963. // Private constructor; use createCommandManager()
  4964. constructor() {
  4965. this.gitEnv = {
  4966. GIT_TERMINAL_PROMPT: '0',
  4967. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4968. };
  4969. this.gitPath = '';
  4970. this.lfs = false;
  4971. this.workingDirectory = '';
  4972. }
  4973. branchDelete(remote, branch) {
  4974. return __awaiter(this, void 0, void 0, function* () {
  4975. const args = ['branch', '--delete', '--force'];
  4976. if (remote) {
  4977. args.push('--remote');
  4978. }
  4979. args.push(branch);
  4980. yield this.execGit(args);
  4981. });
  4982. }
  4983. branchExists(remote, pattern) {
  4984. return __awaiter(this, void 0, void 0, function* () {
  4985. const args = ['branch', '--list'];
  4986. if (remote) {
  4987. args.push('--remote');
  4988. }
  4989. args.push(pattern);
  4990. const output = yield this.execGit(args);
  4991. return !!output.stdout.trim();
  4992. });
  4993. }
  4994. branchList(remote) {
  4995. return __awaiter(this, void 0, void 0, function* () {
  4996. const result = [];
  4997. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4998. // "branch --list" is more difficult when in a detached HEAD state.
  4999. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5000. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5001. const args = ['rev-parse', '--symbolic-full-name'];
  5002. if (remote) {
  5003. args.push('--remotes=origin');
  5004. }
  5005. else {
  5006. args.push('--branches');
  5007. }
  5008. const output = yield this.execGit(args);
  5009. for (let branch of output.stdout.trim().split('\n')) {
  5010. branch = branch.trim();
  5011. if (branch) {
  5012. if (branch.startsWith('refs/heads/')) {
  5013. branch = branch.substr('refs/heads/'.length);
  5014. }
  5015. else if (branch.startsWith('refs/remotes/')) {
  5016. branch = branch.substr('refs/remotes/'.length);
  5017. }
  5018. result.push(branch);
  5019. }
  5020. }
  5021. return result;
  5022. });
  5023. }
  5024. checkout(ref, startPoint) {
  5025. return __awaiter(this, void 0, void 0, function* () {
  5026. const args = ['checkout', '--progress', '--force'];
  5027. if (startPoint) {
  5028. args.push('-B', ref, startPoint);
  5029. }
  5030. else {
  5031. args.push(ref);
  5032. }
  5033. yield this.execGit(args);
  5034. });
  5035. }
  5036. checkoutDetach() {
  5037. return __awaiter(this, void 0, void 0, function* () {
  5038. const args = ['checkout', '--detach'];
  5039. yield this.execGit(args);
  5040. });
  5041. }
  5042. config(configKey, configValue, globalConfig) {
  5043. return __awaiter(this, void 0, void 0, function* () {
  5044. yield this.execGit([
  5045. 'config',
  5046. globalConfig ? '--global' : '--local',
  5047. configKey,
  5048. configValue
  5049. ]);
  5050. });
  5051. }
  5052. configExists(configKey, globalConfig) {
  5053. return __awaiter(this, void 0, void 0, function* () {
  5054. const pattern = regexpHelper.escape(configKey);
  5055. const output = yield this.execGit([
  5056. 'config',
  5057. globalConfig ? '--global' : '--local',
  5058. '--name-only',
  5059. '--get-regexp',
  5060. pattern
  5061. ], true);
  5062. return output.exitCode === 0;
  5063. });
  5064. }
  5065. fetch(fetchDepth, refSpec) {
  5066. return __awaiter(this, void 0, void 0, function* () {
  5067. const args = [
  5068. '-c',
  5069. 'protocol.version=2',
  5070. 'fetch',
  5071. '--no-tags',
  5072. '--prune',
  5073. '--progress',
  5074. '--no-recurse-submodules'
  5075. ];
  5076. if (fetchDepth > 0) {
  5077. args.push(`--depth=${fetchDepth}`);
  5078. }
  5079. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5080. args.push('--unshallow');
  5081. }
  5082. args.push('origin');
  5083. for (const arg of refSpec) {
  5084. args.push(arg);
  5085. }
  5086. const that = this;
  5087. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5088. yield that.execGit(args);
  5089. }));
  5090. });
  5091. }
  5092. getWorkingDirectory() {
  5093. return this.workingDirectory;
  5094. }
  5095. init() {
  5096. return __awaiter(this, void 0, void 0, function* () {
  5097. yield this.execGit(['init', this.workingDirectory]);
  5098. });
  5099. }
  5100. isDetached() {
  5101. return __awaiter(this, void 0, void 0, function* () {
  5102. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5103. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5104. return !output.stdout.trim().startsWith('refs/heads/');
  5105. });
  5106. }
  5107. lfsFetch(ref) {
  5108. return __awaiter(this, void 0, void 0, function* () {
  5109. const args = ['lfs', 'fetch', 'origin', ref];
  5110. const that = this;
  5111. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5112. yield that.execGit(args);
  5113. }));
  5114. });
  5115. }
  5116. lfsInstall() {
  5117. return __awaiter(this, void 0, void 0, function* () {
  5118. yield this.execGit(['lfs', 'install', '--local']);
  5119. });
  5120. }
  5121. log1() {
  5122. return __awaiter(this, void 0, void 0, function* () {
  5123. const output = yield this.execGit(['log', '-1']);
  5124. return output.stdout;
  5125. });
  5126. }
  5127. remoteAdd(remoteName, remoteUrl) {
  5128. return __awaiter(this, void 0, void 0, function* () {
  5129. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5130. });
  5131. }
  5132. removeEnvironmentVariable(name) {
  5133. delete this.gitEnv[name];
  5134. }
  5135. setEnvironmentVariable(name, value) {
  5136. this.gitEnv[name] = value;
  5137. }
  5138. submoduleForeach(command, recursive) {
  5139. return __awaiter(this, void 0, void 0, function* () {
  5140. const args = ['submodule', 'foreach'];
  5141. if (recursive) {
  5142. args.push('--recursive');
  5143. }
  5144. args.push(command);
  5145. const output = yield this.execGit(args);
  5146. return output.stdout;
  5147. });
  5148. }
  5149. submoduleSync(recursive) {
  5150. return __awaiter(this, void 0, void 0, function* () {
  5151. const args = ['submodule', 'sync'];
  5152. if (recursive) {
  5153. args.push('--recursive');
  5154. }
  5155. yield this.execGit(args);
  5156. });
  5157. }
  5158. submoduleUpdate(fetchDepth, recursive) {
  5159. return __awaiter(this, void 0, void 0, function* () {
  5160. const args = ['-c', 'protocol.version=2'];
  5161. args.push('submodule', 'update', '--init', '--force');
  5162. if (fetchDepth > 0) {
  5163. args.push(`--depth=${fetchDepth}`);
  5164. }
  5165. if (recursive) {
  5166. args.push('--recursive');
  5167. }
  5168. yield this.execGit(args);
  5169. });
  5170. }
  5171. tagExists(pattern) {
  5172. return __awaiter(this, void 0, void 0, function* () {
  5173. const output = yield this.execGit(['tag', '--list', pattern]);
  5174. return !!output.stdout.trim();
  5175. });
  5176. }
  5177. tryClean() {
  5178. return __awaiter(this, void 0, void 0, function* () {
  5179. const output = yield this.execGit(['clean', '-ffdx'], true);
  5180. return output.exitCode === 0;
  5181. });
  5182. }
  5183. tryConfigUnset(configKey, globalConfig) {
  5184. return __awaiter(this, void 0, void 0, function* () {
  5185. const output = yield this.execGit([
  5186. 'config',
  5187. globalConfig ? '--global' : '--local',
  5188. '--unset-all',
  5189. configKey
  5190. ], true);
  5191. return output.exitCode === 0;
  5192. });
  5193. }
  5194. tryDisableAutomaticGarbageCollection() {
  5195. return __awaiter(this, void 0, void 0, function* () {
  5196. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5197. return output.exitCode === 0;
  5198. });
  5199. }
  5200. tryGetFetchUrl() {
  5201. return __awaiter(this, void 0, void 0, function* () {
  5202. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5203. if (output.exitCode !== 0) {
  5204. return '';
  5205. }
  5206. const stdout = output.stdout.trim();
  5207. if (stdout.includes('\n')) {
  5208. return '';
  5209. }
  5210. return stdout;
  5211. });
  5212. }
  5213. tryReset() {
  5214. return __awaiter(this, void 0, void 0, function* () {
  5215. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5216. return output.exitCode === 0;
  5217. });
  5218. }
  5219. static createCommandManager(workingDirectory, lfs) {
  5220. return __awaiter(this, void 0, void 0, function* () {
  5221. const result = new GitCommandManager();
  5222. yield result.initializeCommandManager(workingDirectory, lfs);
  5223. return result;
  5224. });
  5225. }
  5226. execGit(args, allowAllExitCodes = false) {
  5227. return __awaiter(this, void 0, void 0, function* () {
  5228. fshelper.directoryExistsSync(this.workingDirectory, true);
  5229. const result = new GitOutput();
  5230. const env = {};
  5231. for (const key of Object.keys(process.env)) {
  5232. env[key] = process.env[key];
  5233. }
  5234. for (const key of Object.keys(this.gitEnv)) {
  5235. env[key] = this.gitEnv[key];
  5236. }
  5237. const stdout = [];
  5238. const options = {
  5239. cwd: this.workingDirectory,
  5240. env,
  5241. ignoreReturnCode: allowAllExitCodes,
  5242. listeners: {
  5243. stdout: (data) => {
  5244. stdout.push(data.toString());
  5245. }
  5246. }
  5247. };
  5248. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5249. result.stdout = stdout.join('');
  5250. return result;
  5251. });
  5252. }
  5253. initializeCommandManager(workingDirectory, lfs) {
  5254. return __awaiter(this, void 0, void 0, function* () {
  5255. this.workingDirectory = workingDirectory;
  5256. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5257. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5258. this.lfs = lfs;
  5259. if (!this.lfs) {
  5260. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5261. }
  5262. this.gitPath = yield io.which('git', true);
  5263. // Git version
  5264. core.debug('Getting git version');
  5265. let gitVersion = new git_version_1.GitVersion();
  5266. let gitOutput = yield this.execGit(['version']);
  5267. let stdout = gitOutput.stdout.trim();
  5268. if (!stdout.includes('\n')) {
  5269. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5270. if (match) {
  5271. gitVersion = new git_version_1.GitVersion(match[0]);
  5272. }
  5273. }
  5274. if (!gitVersion.isValid()) {
  5275. throw new Error('Unable to determine git version');
  5276. }
  5277. // Minimum git version
  5278. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5279. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5280. }
  5281. if (this.lfs) {
  5282. // Git-lfs version
  5283. core.debug('Getting git-lfs version');
  5284. let gitLfsVersion = new git_version_1.GitVersion();
  5285. const gitLfsPath = yield io.which('git-lfs', true);
  5286. gitOutput = yield this.execGit(['lfs', 'version']);
  5287. stdout = gitOutput.stdout.trim();
  5288. if (!stdout.includes('\n')) {
  5289. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5290. if (match) {
  5291. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5292. }
  5293. }
  5294. if (!gitLfsVersion.isValid()) {
  5295. throw new Error('Unable to determine git-lfs version');
  5296. }
  5297. // Minimum git-lfs version
  5298. // Note:
  5299. // - Auth header not supported before 2.1
  5300. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5301. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5302. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5303. }
  5304. }
  5305. // Set the user agent
  5306. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5307. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5308. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5309. });
  5310. }
  5311. }
  5312. class GitOutput {
  5313. constructor() {
  5314. this.stdout = '';
  5315. this.exitCode = 0;
  5316. }
  5317. }
  5318. /***/ }),
  5319. /***/ 293:
  5320. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5321. "use strict";
  5322. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5323. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5324. return new (P || (P = Promise))(function (resolve, reject) {
  5325. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5326. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5327. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5328. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5329. });
  5330. };
  5331. var __importStar = (this && this.__importStar) || function (mod) {
  5332. if (mod && mod.__esModule) return mod;
  5333. var result = {};
  5334. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5335. result["default"] = mod;
  5336. return result;
  5337. };
  5338. Object.defineProperty(exports, "__esModule", { value: true });
  5339. const core = __importStar(__webpack_require__(470));
  5340. const fsHelper = __importStar(__webpack_require__(618));
  5341. const gitAuthHelper = __importStar(__webpack_require__(287));
  5342. const gitCommandManager = __importStar(__webpack_require__(289));
  5343. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5344. const githubApiHelper = __importStar(__webpack_require__(464));
  5345. const io = __importStar(__webpack_require__(1));
  5346. const path = __importStar(__webpack_require__(622));
  5347. const refHelper = __importStar(__webpack_require__(227));
  5348. const stateHelper = __importStar(__webpack_require__(153));
  5349. const urlHelper = __importStar(__webpack_require__(81));
  5350. function getSource(settings) {
  5351. return __awaiter(this, void 0, void 0, function* () {
  5352. // Repository URL
  5353. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5354. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5355. // Remove conflicting file path
  5356. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5357. yield io.rmRF(settings.repositoryPath);
  5358. }
  5359. // Create directory
  5360. let isExisting = true;
  5361. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5362. isExisting = false;
  5363. yield io.mkdirP(settings.repositoryPath);
  5364. }
  5365. // Git command manager
  5366. core.startGroup('Getting Git version info');
  5367. const git = yield getGitCommandManager(settings);
  5368. core.endGroup();
  5369. // Prepare existing directory, otherwise recreate
  5370. if (isExisting) {
  5371. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5372. }
  5373. if (!git) {
  5374. // Downloading using REST API
  5375. core.info(`The repository will be downloaded using the GitHub REST API`);
  5376. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5377. if (settings.submodules) {
  5378. 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.`);
  5379. }
  5380. else if (settings.sshKey) {
  5381. 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.`);
  5382. }
  5383. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5384. return;
  5385. }
  5386. // Save state for POST action
  5387. stateHelper.setRepositoryPath(settings.repositoryPath);
  5388. // Initialize the repository
  5389. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5390. core.startGroup('Initializing the repository');
  5391. yield git.init();
  5392. yield git.remoteAdd('origin', repositoryUrl);
  5393. core.endGroup();
  5394. }
  5395. // Disable automatic garbage collection
  5396. core.startGroup('Disabling automatic garbage collection');
  5397. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5398. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5399. }
  5400. core.endGroup();
  5401. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5402. try {
  5403. // Configure auth
  5404. core.startGroup('Setting up auth');
  5405. yield authHelper.configureAuth();
  5406. core.endGroup();
  5407. // LFS install
  5408. if (settings.lfs) {
  5409. yield git.lfsInstall();
  5410. }
  5411. // Fetch
  5412. core.startGroup('Fetching the repository');
  5413. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5414. yield git.fetch(settings.fetchDepth, refSpec);
  5415. core.endGroup();
  5416. // Checkout info
  5417. core.startGroup('Determining the checkout info');
  5418. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5419. core.endGroup();
  5420. // LFS fetch
  5421. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5422. // Explicit lfs fetch will fetch lfs objects in parallel.
  5423. if (settings.lfs) {
  5424. core.startGroup('Fetching LFS objects');
  5425. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5426. core.endGroup();
  5427. }
  5428. // Checkout
  5429. core.startGroup('Checking out the ref');
  5430. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5431. core.endGroup();
  5432. // Submodules
  5433. if (settings.submodules) {
  5434. try {
  5435. // Temporarily override global config
  5436. core.startGroup('Setting up auth for fetching submodules');
  5437. yield authHelper.configureGlobalAuth();
  5438. core.endGroup();
  5439. // Checkout submodules
  5440. core.startGroup('Fetching submodules');
  5441. yield git.submoduleSync(settings.nestedSubmodules);
  5442. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5443. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5444. core.endGroup();
  5445. // Persist credentials
  5446. if (settings.persistCredentials) {
  5447. core.startGroup('Persisting credentials for submodules');
  5448. yield authHelper.configureSubmoduleAuth();
  5449. core.endGroup();
  5450. }
  5451. }
  5452. finally {
  5453. // Remove temporary global config override
  5454. yield authHelper.removeGlobalAuth();
  5455. }
  5456. }
  5457. // Dump some info about the checked out commit
  5458. const commitInfo = yield git.log1();
  5459. // Check for incorrect pull request merge commit
  5460. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5461. }
  5462. finally {
  5463. // Remove auth
  5464. if (!settings.persistCredentials) {
  5465. core.startGroup('Removing auth');
  5466. yield authHelper.removeAuth();
  5467. core.endGroup();
  5468. }
  5469. }
  5470. });
  5471. }
  5472. exports.getSource = getSource;
  5473. function cleanup(repositoryPath) {
  5474. return __awaiter(this, void 0, void 0, function* () {
  5475. // Repo exists?
  5476. if (!repositoryPath ||
  5477. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5478. return;
  5479. }
  5480. let git;
  5481. try {
  5482. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5483. }
  5484. catch (_a) {
  5485. return;
  5486. }
  5487. // Remove auth
  5488. const authHelper = gitAuthHelper.createAuthHelper(git);
  5489. yield authHelper.removeAuth();
  5490. });
  5491. }
  5492. exports.cleanup = cleanup;
  5493. function getGitCommandManager(settings) {
  5494. return __awaiter(this, void 0, void 0, function* () {
  5495. core.info(`Working directory is '${settings.repositoryPath}'`);
  5496. try {
  5497. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5498. }
  5499. catch (err) {
  5500. // Git is required for LFS
  5501. if (settings.lfs) {
  5502. throw err;
  5503. }
  5504. // Otherwise fallback to REST API
  5505. return undefined;
  5506. }
  5507. });
  5508. }
  5509. /***/ }),
  5510. /***/ 294:
  5511. /***/ (function(module, __unusedexports, __webpack_require__) {
  5512. module.exports = parseOptions;
  5513. const { Deprecation } = __webpack_require__(692);
  5514. const { getUserAgent } = __webpack_require__(796);
  5515. const once = __webpack_require__(969);
  5516. const pkg = __webpack_require__(215);
  5517. const deprecateOptionsTimeout = once((log, deprecation) =>
  5518. log.warn(deprecation)
  5519. );
  5520. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5521. const deprecateOptionsHeaders = once((log, deprecation) =>
  5522. log.warn(deprecation)
  5523. );
  5524. function parseOptions(options, log, hook) {
  5525. if (options.headers) {
  5526. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5527. newObj[key.toLowerCase()] = options.headers[key];
  5528. return newObj;
  5529. }, {});
  5530. }
  5531. const clientDefaults = {
  5532. headers: options.headers || {},
  5533. request: options.request || {},
  5534. mediaType: {
  5535. previews: [],
  5536. format: ""
  5537. }
  5538. };
  5539. if (options.baseUrl) {
  5540. clientDefaults.baseUrl = options.baseUrl;
  5541. }
  5542. if (options.userAgent) {
  5543. clientDefaults.headers["user-agent"] = options.userAgent;
  5544. }
  5545. if (options.previews) {
  5546. clientDefaults.mediaType.previews = options.previews;
  5547. }
  5548. if (options.timeZone) {
  5549. clientDefaults.headers["time-zone"] = options.timeZone;
  5550. }
  5551. if (options.timeout) {
  5552. deprecateOptionsTimeout(
  5553. log,
  5554. new Deprecation(
  5555. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5556. )
  5557. );
  5558. clientDefaults.request.timeout = options.timeout;
  5559. }
  5560. if (options.agent) {
  5561. deprecateOptionsAgent(
  5562. log,
  5563. new Deprecation(
  5564. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5565. )
  5566. );
  5567. clientDefaults.request.agent = options.agent;
  5568. }
  5569. if (options.headers) {
  5570. deprecateOptionsHeaders(
  5571. log,
  5572. new Deprecation(
  5573. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5574. )
  5575. );
  5576. }
  5577. const userAgentOption = clientDefaults.headers["user-agent"];
  5578. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5579. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5580. .filter(Boolean)
  5581. .join(" ");
  5582. clientDefaults.request.hook = hook.bind(null, "request");
  5583. return clientDefaults;
  5584. }
  5585. /***/ }),
  5586. /***/ 297:
  5587. /***/ (function(module) {
  5588. module.exports = class HttpError extends Error {
  5589. constructor (message, code, headers) {
  5590. super(message)
  5591. // Maintains proper stack trace (only available on V8)
  5592. /* istanbul ignore next */
  5593. if (Error.captureStackTrace) {
  5594. Error.captureStackTrace(this, this.constructor)
  5595. }
  5596. this.name = 'HttpError'
  5597. this.code = code
  5598. this.headers = headers
  5599. }
  5600. }
  5601. /***/ }),
  5602. /***/ 299:
  5603. /***/ (function(__unusedmodule, exports) {
  5604. "use strict";
  5605. Object.defineProperty(exports, '__esModule', { value: true });
  5606. const VERSION = "1.1.2";
  5607. /**
  5608. * Some “list” response that can be paginated have a different response structure
  5609. *
  5610. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5611. * /installation/repositories also has `repository_selection`), as well as a key with
  5612. * the list of the items which name varies from endpoint to endpoint:
  5613. *
  5614. * - https://developer.github.com/v3/search/#example (key `items`)
  5615. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5616. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5617. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5618. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5619. *
  5620. * Octokit normalizes these responses so that paginated results are always returned following
  5621. * the same structure. One challenge is that if the list response has only one page, no Link
  5622. * header is provided, so this header alone is not sufficient to check wether a response is
  5623. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5624. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5625. * property because it also exists in the response of Get the combined status for a specific ref.
  5626. */
  5627. 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))?([^/]|$)/];
  5628. function normalizePaginatedListResponse(octokit, url, response) {
  5629. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5630. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5631. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5632. // to retrieve the same information.
  5633. const incompleteResults = response.data.incomplete_results;
  5634. const repositorySelection = response.data.repository_selection;
  5635. const totalCount = response.data.total_count;
  5636. delete response.data.incomplete_results;
  5637. delete response.data.repository_selection;
  5638. delete response.data.total_count;
  5639. const namespaceKey = Object.keys(response.data)[0];
  5640. const data = response.data[namespaceKey];
  5641. response.data = data;
  5642. if (typeof incompleteResults !== "undefined") {
  5643. response.data.incomplete_results = incompleteResults;
  5644. }
  5645. if (typeof repositorySelection !== "undefined") {
  5646. response.data.repository_selection = repositorySelection;
  5647. }
  5648. response.data.total_count = totalCount;
  5649. Object.defineProperty(response.data, namespaceKey, {
  5650. get() {
  5651. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5652. return Array.from(data);
  5653. }
  5654. });
  5655. }
  5656. function iterator(octokit, route, parameters) {
  5657. const options = octokit.request.endpoint(route, parameters);
  5658. const method = options.method;
  5659. const headers = options.headers;
  5660. let url = options.url;
  5661. return {
  5662. [Symbol.asyncIterator]: () => ({
  5663. next() {
  5664. if (!url) {
  5665. return Promise.resolve({
  5666. done: true
  5667. });
  5668. }
  5669. return octokit.request({
  5670. method,
  5671. url,
  5672. headers
  5673. }).then(response => {
  5674. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5675. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5676. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5677. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5678. return {
  5679. value: response
  5680. };
  5681. });
  5682. }
  5683. })
  5684. };
  5685. }
  5686. function paginate(octokit, route, parameters, mapFn) {
  5687. if (typeof parameters === "function") {
  5688. mapFn = parameters;
  5689. parameters = undefined;
  5690. }
  5691. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5692. }
  5693. function gather(octokit, results, iterator, mapFn) {
  5694. return iterator.next().then(result => {
  5695. if (result.done) {
  5696. return results;
  5697. }
  5698. let earlyExit = false;
  5699. function done() {
  5700. earlyExit = true;
  5701. }
  5702. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5703. if (earlyExit) {
  5704. return results;
  5705. }
  5706. return gather(octokit, results, iterator, mapFn);
  5707. });
  5708. }
  5709. /**
  5710. * @param octokit Octokit instance
  5711. * @param options Options passed to Octokit constructor
  5712. */
  5713. function paginateRest(octokit) {
  5714. return {
  5715. paginate: Object.assign(paginate.bind(null, octokit), {
  5716. iterator: iterator.bind(null, octokit)
  5717. })
  5718. };
  5719. }
  5720. paginateRest.VERSION = VERSION;
  5721. exports.paginateRest = paginateRest;
  5722. //# sourceMappingURL=index.js.map
  5723. /***/ }),
  5724. /***/ 323:
  5725. /***/ (function(module) {
  5726. "use strict";
  5727. var isStream = module.exports = function (stream) {
  5728. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5729. };
  5730. isStream.writable = function (stream) {
  5731. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5732. };
  5733. isStream.readable = function (stream) {
  5734. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5735. };
  5736. isStream.duplex = function (stream) {
  5737. return isStream.writable(stream) && isStream.readable(stream);
  5738. };
  5739. isStream.transform = function (stream) {
  5740. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5741. };
  5742. /***/ }),
  5743. /***/ 335:
  5744. /***/ (function(module, __unusedexports, __webpack_require__) {
  5745. module.exports = __webpack_require__(179);
  5746. /***/ }),
  5747. /***/ 336:
  5748. /***/ (function(module, __unusedexports, __webpack_require__) {
  5749. module.exports = hasLastPage
  5750. const deprecate = __webpack_require__(370)
  5751. const getPageLinks = __webpack_require__(577)
  5752. function hasLastPage (link) {
  5753. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5754. return getPageLinks(link).last
  5755. }
  5756. /***/ }),
  5757. /***/ 348:
  5758. /***/ (function(module, __unusedexports, __webpack_require__) {
  5759. "use strict";
  5760. module.exports = validate;
  5761. const { RequestError } = __webpack_require__(497);
  5762. const get = __webpack_require__(854);
  5763. const set = __webpack_require__(883);
  5764. function validate(octokit, options) {
  5765. if (!options.request.validate) {
  5766. return;
  5767. }
  5768. const { validate: params } = options.request;
  5769. Object.keys(params).forEach(parameterName => {
  5770. const parameter = get(params, parameterName);
  5771. const expectedType = parameter.type;
  5772. let parentParameterName;
  5773. let parentValue;
  5774. let parentParamIsPresent = true;
  5775. let parentParameterIsArray = false;
  5776. if (/\./.test(parameterName)) {
  5777. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5778. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5779. if (parentParameterIsArray) {
  5780. parentParameterName = parentParameterName.slice(0, -2);
  5781. }
  5782. parentValue = get(options, parentParameterName);
  5783. parentParamIsPresent =
  5784. parentParameterName === "headers" ||
  5785. (typeof parentValue === "object" && parentValue !== null);
  5786. }
  5787. const values = parentParameterIsArray
  5788. ? (get(options, parentParameterName) || []).map(
  5789. value => value[parameterName.split(/\./).pop()]
  5790. )
  5791. : [get(options, parameterName)];
  5792. values.forEach((value, i) => {
  5793. const valueIsPresent = typeof value !== "undefined";
  5794. const valueIsNull = value === null;
  5795. const currentParameterName = parentParameterIsArray
  5796. ? parameterName.replace(/\[\]/, `[${i}]`)
  5797. : parameterName;
  5798. if (!parameter.required && !valueIsPresent) {
  5799. return;
  5800. }
  5801. // if the parent parameter is of type object but allows null
  5802. // then the child parameters can be ignored
  5803. if (!parentParamIsPresent) {
  5804. return;
  5805. }
  5806. if (parameter.allowNull && valueIsNull) {
  5807. return;
  5808. }
  5809. if (!parameter.allowNull && valueIsNull) {
  5810. throw new RequestError(
  5811. `'${currentParameterName}' cannot be null`,
  5812. 400,
  5813. {
  5814. request: options
  5815. }
  5816. );
  5817. }
  5818. if (parameter.required && !valueIsPresent) {
  5819. throw new RequestError(
  5820. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5821. value
  5822. )}`,
  5823. 400,
  5824. {
  5825. request: options
  5826. }
  5827. );
  5828. }
  5829. // parse to integer before checking for enum
  5830. // so that string "1" will match enum with number 1
  5831. if (expectedType === "integer") {
  5832. const unparsedValue = value;
  5833. value = parseInt(value, 10);
  5834. if (isNaN(value)) {
  5835. throw new RequestError(
  5836. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5837. unparsedValue
  5838. )} is NaN`,
  5839. 400,
  5840. {
  5841. request: options
  5842. }
  5843. );
  5844. }
  5845. }
  5846. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5847. throw new RequestError(
  5848. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5849. value
  5850. )}`,
  5851. 400,
  5852. {
  5853. request: options
  5854. }
  5855. );
  5856. }
  5857. if (parameter.validation) {
  5858. const regex = new RegExp(parameter.validation);
  5859. if (!regex.test(value)) {
  5860. throw new RequestError(
  5861. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5862. value
  5863. )}`,
  5864. 400,
  5865. {
  5866. request: options
  5867. }
  5868. );
  5869. }
  5870. }
  5871. if (expectedType === "object" && typeof value === "string") {
  5872. try {
  5873. value = JSON.parse(value);
  5874. } catch (exception) {
  5875. throw new RequestError(
  5876. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5877. value
  5878. )}`,
  5879. 400,
  5880. {
  5881. request: options
  5882. }
  5883. );
  5884. }
  5885. }
  5886. set(options, parameter.mapTo || currentParameterName, value);
  5887. });
  5888. });
  5889. return options;
  5890. }
  5891. /***/ }),
  5892. /***/ 349:
  5893. /***/ (function(module, __unusedexports, __webpack_require__) {
  5894. module.exports = authenticationRequestError;
  5895. const { RequestError } = __webpack_require__(497);
  5896. function authenticationRequestError(state, error, options) {
  5897. /* istanbul ignore next */
  5898. if (!error.headers) throw error;
  5899. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5900. // handle "2FA required" error only
  5901. if (error.status !== 401 || !otpRequired) {
  5902. throw error;
  5903. }
  5904. if (
  5905. error.status === 401 &&
  5906. otpRequired &&
  5907. error.request &&
  5908. error.request.headers["x-github-otp"]
  5909. ) {
  5910. throw new RequestError(
  5911. "Invalid one-time password for two-factor authentication",
  5912. 401,
  5913. {
  5914. headers: error.headers,
  5915. request: options
  5916. }
  5917. );
  5918. }
  5919. if (typeof state.auth.on2fa !== "function") {
  5920. throw new RequestError(
  5921. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5922. 401,
  5923. {
  5924. headers: error.headers,
  5925. request: options
  5926. }
  5927. );
  5928. }
  5929. return Promise.resolve()
  5930. .then(() => {
  5931. return state.auth.on2fa();
  5932. })
  5933. .then(oneTimePassword => {
  5934. const newOptions = Object.assign(options, {
  5935. headers: Object.assign(
  5936. { "x-github-otp": oneTimePassword },
  5937. options.headers
  5938. )
  5939. });
  5940. return state.octokit.request(newOptions);
  5941. });
  5942. }
  5943. /***/ }),
  5944. /***/ 357:
  5945. /***/ (function(module) {
  5946. module.exports = require("assert");
  5947. /***/ }),
  5948. /***/ 363:
  5949. /***/ (function(module) {
  5950. module.exports = register
  5951. function register (state, name, method, options) {
  5952. if (typeof method !== 'function') {
  5953. throw new Error('method for before hook must be a function')
  5954. }
  5955. if (!options) {
  5956. options = {}
  5957. }
  5958. if (Array.isArray(name)) {
  5959. return name.reverse().reduce(function (callback, name) {
  5960. return register.bind(null, state, name, callback, options)
  5961. }, method)()
  5962. }
  5963. return Promise.resolve()
  5964. .then(function () {
  5965. if (!state.registry[name]) {
  5966. return method(options)
  5967. }
  5968. return (state.registry[name]).reduce(function (method, registered) {
  5969. return registered.hook.bind(null, method, options)
  5970. }, method)()
  5971. })
  5972. }
  5973. /***/ }),
  5974. /***/ 368:
  5975. /***/ (function(module) {
  5976. module.exports = function atob(str) {
  5977. return Buffer.from(str, 'base64').toString('binary')
  5978. }
  5979. /***/ }),
  5980. /***/ 370:
  5981. /***/ (function(module) {
  5982. module.exports = deprecate
  5983. const loggedMessages = {}
  5984. function deprecate (message) {
  5985. if (loggedMessages[message]) {
  5986. return
  5987. }
  5988. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5989. loggedMessages[message] = 1
  5990. }
  5991. /***/ }),
  5992. /***/ 385:
  5993. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5994. "use strict";
  5995. Object.defineProperty(exports, '__esModule', { value: true });
  5996. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5997. var isPlainObject = _interopDefault(__webpack_require__(696));
  5998. var universalUserAgent = __webpack_require__(562);
  5999. function lowercaseKeys(object) {
  6000. if (!object) {
  6001. return {};
  6002. }
  6003. return Object.keys(object).reduce((newObj, key) => {
  6004. newObj[key.toLowerCase()] = object[key];
  6005. return newObj;
  6006. }, {});
  6007. }
  6008. function mergeDeep(defaults, options) {
  6009. const result = Object.assign({}, defaults);
  6010. Object.keys(options).forEach(key => {
  6011. if (isPlainObject(options[key])) {
  6012. if (!(key in defaults)) Object.assign(result, {
  6013. [key]: options[key]
  6014. });else result[key] = mergeDeep(defaults[key], options[key]);
  6015. } else {
  6016. Object.assign(result, {
  6017. [key]: options[key]
  6018. });
  6019. }
  6020. });
  6021. return result;
  6022. }
  6023. function merge(defaults, route, options) {
  6024. if (typeof route === "string") {
  6025. let [method, url] = route.split(" ");
  6026. options = Object.assign(url ? {
  6027. method,
  6028. url
  6029. } : {
  6030. url: method
  6031. }, options);
  6032. } else {
  6033. options = Object.assign({}, route);
  6034. } // lowercase header names before merging with defaults to avoid duplicates
  6035. options.headers = lowercaseKeys(options.headers);
  6036. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6037. if (defaults && defaults.mediaType.previews.length) {
  6038. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6039. }
  6040. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6041. return mergedOptions;
  6042. }
  6043. function addQueryParameters(url, parameters) {
  6044. const separator = /\?/.test(url) ? "&" : "?";
  6045. const names = Object.keys(parameters);
  6046. if (names.length === 0) {
  6047. return url;
  6048. }
  6049. return url + separator + names.map(name => {
  6050. if (name === "q") {
  6051. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6052. }
  6053. return `${name}=${encodeURIComponent(parameters[name])}`;
  6054. }).join("&");
  6055. }
  6056. const urlVariableRegex = /\{[^}]+\}/g;
  6057. function removeNonChars(variableName) {
  6058. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6059. }
  6060. function extractUrlVariableNames(url) {
  6061. const matches = url.match(urlVariableRegex);
  6062. if (!matches) {
  6063. return [];
  6064. }
  6065. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6066. }
  6067. function omit(object, keysToOmit) {
  6068. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6069. obj[key] = object[key];
  6070. return obj;
  6071. }, {});
  6072. }
  6073. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6074. // TODO: create separate package.
  6075. //
  6076. // Copyright (c) 2012-2014, Bram Stein
  6077. // All rights reserved.
  6078. // Redistribution and use in source and binary forms, with or without
  6079. // modification, are permitted provided that the following conditions
  6080. // are met:
  6081. // 1. Redistributions of source code must retain the above copyright
  6082. // notice, this list of conditions and the following disclaimer.
  6083. // 2. Redistributions in binary form must reproduce the above copyright
  6084. // notice, this list of conditions and the following disclaimer in the
  6085. // documentation and/or other materials provided with the distribution.
  6086. // 3. The name of the author may not be used to endorse or promote products
  6087. // derived from this software without specific prior written permission.
  6088. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6089. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6090. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6091. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6092. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6093. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6094. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6095. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6096. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6097. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6098. /* istanbul ignore file */
  6099. function encodeReserved(str) {
  6100. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6101. if (!/%[0-9A-Fa-f]/.test(part)) {
  6102. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6103. }
  6104. return part;
  6105. }).join("");
  6106. }
  6107. function encodeUnreserved(str) {
  6108. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6109. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6110. });
  6111. }
  6112. function encodeValue(operator, value, key) {
  6113. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6114. if (key) {
  6115. return encodeUnreserved(key) + "=" + value;
  6116. } else {
  6117. return value;
  6118. }
  6119. }
  6120. function isDefined(value) {
  6121. return value !== undefined && value !== null;
  6122. }
  6123. function isKeyOperator(operator) {
  6124. return operator === ";" || operator === "&" || operator === "?";
  6125. }
  6126. function getValues(context, operator, key, modifier) {
  6127. var value = context[key],
  6128. result = [];
  6129. if (isDefined(value) && value !== "") {
  6130. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6131. value = value.toString();
  6132. if (modifier && modifier !== "*") {
  6133. value = value.substring(0, parseInt(modifier, 10));
  6134. }
  6135. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6136. } else {
  6137. if (modifier === "*") {
  6138. if (Array.isArray(value)) {
  6139. value.filter(isDefined).forEach(function (value) {
  6140. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6141. });
  6142. } else {
  6143. Object.keys(value).forEach(function (k) {
  6144. if (isDefined(value[k])) {
  6145. result.push(encodeValue(operator, value[k], k));
  6146. }
  6147. });
  6148. }
  6149. } else {
  6150. const tmp = [];
  6151. if (Array.isArray(value)) {
  6152. value.filter(isDefined).forEach(function (value) {
  6153. tmp.push(encodeValue(operator, value));
  6154. });
  6155. } else {
  6156. Object.keys(value).forEach(function (k) {
  6157. if (isDefined(value[k])) {
  6158. tmp.push(encodeUnreserved(k));
  6159. tmp.push(encodeValue(operator, value[k].toString()));
  6160. }
  6161. });
  6162. }
  6163. if (isKeyOperator(operator)) {
  6164. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6165. } else if (tmp.length !== 0) {
  6166. result.push(tmp.join(","));
  6167. }
  6168. }
  6169. }
  6170. } else {
  6171. if (operator === ";") {
  6172. if (isDefined(value)) {
  6173. result.push(encodeUnreserved(key));
  6174. }
  6175. } else if (value === "" && (operator === "&" || operator === "?")) {
  6176. result.push(encodeUnreserved(key) + "=");
  6177. } else if (value === "") {
  6178. result.push("");
  6179. }
  6180. }
  6181. return result;
  6182. }
  6183. function parseUrl(template) {
  6184. return {
  6185. expand: expand.bind(null, template)
  6186. };
  6187. }
  6188. function expand(template, context) {
  6189. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6190. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6191. if (expression) {
  6192. let operator = "";
  6193. const values = [];
  6194. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6195. operator = expression.charAt(0);
  6196. expression = expression.substr(1);
  6197. }
  6198. expression.split(/,/g).forEach(function (variable) {
  6199. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6200. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6201. });
  6202. if (operator && operator !== "+") {
  6203. var separator = ",";
  6204. if (operator === "?") {
  6205. separator = "&";
  6206. } else if (operator !== "#") {
  6207. separator = operator;
  6208. }
  6209. return (values.length !== 0 ? operator : "") + values.join(separator);
  6210. } else {
  6211. return values.join(",");
  6212. }
  6213. } else {
  6214. return encodeReserved(literal);
  6215. }
  6216. });
  6217. }
  6218. function parse(options) {
  6219. // https://fetch.spec.whatwg.org/#methods
  6220. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6221. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6222. let headers = Object.assign({}, options.headers);
  6223. let body;
  6224. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6225. const urlVariableNames = extractUrlVariableNames(url);
  6226. url = parseUrl(url).expand(parameters);
  6227. if (!/^http/.test(url)) {
  6228. url = options.baseUrl + url;
  6229. }
  6230. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6231. const remainingParameters = omit(parameters, omittedParameters);
  6232. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6233. if (!isBinaryRequset) {
  6234. if (options.mediaType.format) {
  6235. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6236. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6237. }
  6238. if (options.mediaType.previews.length) {
  6239. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6240. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6241. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6242. return `application/vnd.github.${preview}-preview${format}`;
  6243. }).join(",");
  6244. }
  6245. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6246. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6247. if (["GET", "HEAD"].includes(method)) {
  6248. url = addQueryParameters(url, remainingParameters);
  6249. } else {
  6250. if ("data" in remainingParameters) {
  6251. body = remainingParameters.data;
  6252. } else {
  6253. if (Object.keys(remainingParameters).length) {
  6254. body = remainingParameters;
  6255. } else {
  6256. headers["content-length"] = 0;
  6257. }
  6258. }
  6259. } // default content-type for JSON if body is set
  6260. if (!headers["content-type"] && typeof body !== "undefined") {
  6261. headers["content-type"] = "application/json; charset=utf-8";
  6262. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6263. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6264. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6265. body = "";
  6266. } // Only return body/request keys if present
  6267. return Object.assign({
  6268. method,
  6269. url,
  6270. headers
  6271. }, typeof body !== "undefined" ? {
  6272. body
  6273. } : null, options.request ? {
  6274. request: options.request
  6275. } : null);
  6276. }
  6277. function endpointWithDefaults(defaults, route, options) {
  6278. return parse(merge(defaults, route, options));
  6279. }
  6280. function withDefaults(oldDefaults, newDefaults) {
  6281. const DEFAULTS = merge(oldDefaults, newDefaults);
  6282. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6283. return Object.assign(endpoint, {
  6284. DEFAULTS,
  6285. defaults: withDefaults.bind(null, DEFAULTS),
  6286. merge: merge.bind(null, DEFAULTS),
  6287. parse
  6288. });
  6289. }
  6290. const VERSION = "6.0.1";
  6291. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6292. // So we use RequestParameters and add method as additional required property.
  6293. const DEFAULTS = {
  6294. method: "GET",
  6295. baseUrl: "https://api.github.com",
  6296. headers: {
  6297. accept: "application/vnd.github.v3+json",
  6298. "user-agent": userAgent
  6299. },
  6300. mediaType: {
  6301. format: "",
  6302. previews: []
  6303. }
  6304. };
  6305. const endpoint = withDefaults(null, DEFAULTS);
  6306. exports.endpoint = endpoint;
  6307. //# sourceMappingURL=index.js.map
  6308. /***/ }),
  6309. /***/ 389:
  6310. /***/ (function(module, __unusedexports, __webpack_require__) {
  6311. "use strict";
  6312. const fs = __webpack_require__(747);
  6313. const shebangCommand = __webpack_require__(866);
  6314. function readShebang(command) {
  6315. // Read the first 150 bytes from the file
  6316. const size = 150;
  6317. let buffer;
  6318. if (Buffer.alloc) {
  6319. // Node.js v4.5+ / v5.10+
  6320. buffer = Buffer.alloc(size);
  6321. } else {
  6322. // Old Node.js API
  6323. buffer = new Buffer(size);
  6324. buffer.fill(0); // zero-fill
  6325. }
  6326. let fd;
  6327. try {
  6328. fd = fs.openSync(command, 'r');
  6329. fs.readSync(fd, buffer, 0, size, 0);
  6330. fs.closeSync(fd);
  6331. } catch (e) { /* Empty */ }
  6332. // Attempt to extract shebang (null is returned if not a shebang)
  6333. return shebangCommand(buffer.toString());
  6334. }
  6335. module.exports = readShebang;
  6336. /***/ }),
  6337. /***/ 402:
  6338. /***/ (function(module, __unusedexports, __webpack_require__) {
  6339. module.exports = Octokit;
  6340. const { request } = __webpack_require__(753);
  6341. const Hook = __webpack_require__(523);
  6342. const parseClientOptions = __webpack_require__(294);
  6343. function Octokit(plugins, options) {
  6344. options = options || {};
  6345. const hook = new Hook.Collection();
  6346. const log = Object.assign(
  6347. {
  6348. debug: () => {},
  6349. info: () => {},
  6350. warn: console.warn,
  6351. error: console.error
  6352. },
  6353. options && options.log
  6354. );
  6355. const api = {
  6356. hook,
  6357. log,
  6358. request: request.defaults(parseClientOptions(options, log, hook))
  6359. };
  6360. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6361. return api;
  6362. }
  6363. /***/ }),
  6364. /***/ 413:
  6365. /***/ (function(module) {
  6366. module.exports = require("stream");
  6367. /***/ }),
  6368. /***/ 417:
  6369. /***/ (function(module) {
  6370. module.exports = require("crypto");
  6371. /***/ }),
  6372. /***/ 427:
  6373. /***/ (function(module, __unusedexports, __webpack_require__) {
  6374. "use strict";
  6375. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6376. // In that case, fall back to a deprecated internal.
  6377. const util = __webpack_require__(669);
  6378. let uv;
  6379. if (typeof util.getSystemErrorName === 'function') {
  6380. module.exports = util.getSystemErrorName;
  6381. } else {
  6382. try {
  6383. uv = process.binding('uv');
  6384. if (typeof uv.errname !== 'function') {
  6385. throw new TypeError('uv.errname is not a function');
  6386. }
  6387. } catch (err) {
  6388. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6389. uv = null;
  6390. }
  6391. module.exports = code => errname(uv, code);
  6392. }
  6393. // Used for testing the fallback behavior
  6394. module.exports.__test__ = errname;
  6395. function errname(uv, code) {
  6396. if (uv) {
  6397. return uv.errname(code);
  6398. }
  6399. if (!(code < 0)) {
  6400. throw new Error('err >= 0');
  6401. }
  6402. return `Unknown system error ${code}`;
  6403. }
  6404. /***/ }),
  6405. /***/ 430:
  6406. /***/ (function(module, __unusedexports, __webpack_require__) {
  6407. module.exports = octokitValidate;
  6408. const validate = __webpack_require__(348);
  6409. function octokitValidate(octokit) {
  6410. octokit.hook.before("request", validate.bind(null, octokit));
  6411. }
  6412. /***/ }),
  6413. /***/ 431:
  6414. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6415. "use strict";
  6416. Object.defineProperty(exports, "__esModule", { value: true });
  6417. const os = __webpack_require__(87);
  6418. /**
  6419. * Commands
  6420. *
  6421. * Command Format:
  6422. * ##[name key=value;key=value]message
  6423. *
  6424. * Examples:
  6425. * ##[warning]This is the user warning message
  6426. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6427. */
  6428. function issueCommand(command, properties, message) {
  6429. const cmd = new Command(command, properties, message);
  6430. process.stdout.write(cmd.toString() + os.EOL);
  6431. }
  6432. exports.issueCommand = issueCommand;
  6433. function issue(name, message = '') {
  6434. issueCommand(name, {}, message);
  6435. }
  6436. exports.issue = issue;
  6437. const CMD_STRING = '::';
  6438. class Command {
  6439. constructor(command, properties, message) {
  6440. if (!command) {
  6441. command = 'missing.command';
  6442. }
  6443. this.command = command;
  6444. this.properties = properties;
  6445. this.message = message;
  6446. }
  6447. toString() {
  6448. let cmdStr = CMD_STRING + this.command;
  6449. if (this.properties && Object.keys(this.properties).length > 0) {
  6450. cmdStr += ' ';
  6451. for (const key in this.properties) {
  6452. if (this.properties.hasOwnProperty(key)) {
  6453. const val = this.properties[key];
  6454. if (val) {
  6455. // safely append the val - avoid blowing up when attempting to
  6456. // call .replace() if message is not a string for some reason
  6457. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6458. }
  6459. }
  6460. }
  6461. }
  6462. cmdStr += CMD_STRING;
  6463. // safely append the message - avoid blowing up when attempting to
  6464. // call .replace() if message is not a string for some reason
  6465. const message = `${this.message || ''}`;
  6466. cmdStr += escapeData(message);
  6467. return cmdStr;
  6468. }
  6469. }
  6470. function escapeData(s) {
  6471. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6472. }
  6473. function escape(s) {
  6474. return s
  6475. .replace(/\r/g, '%0D')
  6476. .replace(/\n/g, '%0A')
  6477. .replace(/]/g, '%5D')
  6478. .replace(/;/g, '%3B');
  6479. }
  6480. //# sourceMappingURL=command.js.map
  6481. /***/ }),
  6482. /***/ 438:
  6483. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6484. "use strict";
  6485. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6486. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6487. return new (P || (P = Promise))(function (resolve, reject) {
  6488. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6489. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6490. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6491. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6492. });
  6493. };
  6494. var __importStar = (this && this.__importStar) || function (mod) {
  6495. if (mod && mod.__esModule) return mod;
  6496. var result = {};
  6497. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6498. result["default"] = mod;
  6499. return result;
  6500. };
  6501. Object.defineProperty(exports, "__esModule", { value: true });
  6502. const assert = __importStar(__webpack_require__(357));
  6503. const core = __importStar(__webpack_require__(470));
  6504. const fs = __importStar(__webpack_require__(747));
  6505. const fsHelper = __importStar(__webpack_require__(618));
  6506. const io = __importStar(__webpack_require__(1));
  6507. const path = __importStar(__webpack_require__(622));
  6508. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6509. return __awaiter(this, void 0, void 0, function* () {
  6510. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6511. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6512. // Indicates whether to delete the directory contents
  6513. let remove = false;
  6514. // Check whether using git or REST API
  6515. if (!git) {
  6516. remove = true;
  6517. }
  6518. // Fetch URL does not match
  6519. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6520. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6521. remove = true;
  6522. }
  6523. else {
  6524. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6525. const lockPaths = [
  6526. path.join(repositoryPath, '.git', 'index.lock'),
  6527. path.join(repositoryPath, '.git', 'shallow.lock')
  6528. ];
  6529. for (const lockPath of lockPaths) {
  6530. try {
  6531. yield io.rmRF(lockPath);
  6532. }
  6533. catch (error) {
  6534. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6535. }
  6536. }
  6537. try {
  6538. core.startGroup('Removing previously created refs, to avoid conflicts');
  6539. // Checkout detached HEAD
  6540. if (!(yield git.isDetached())) {
  6541. yield git.checkoutDetach();
  6542. }
  6543. // Remove all refs/heads/*
  6544. let branches = yield git.branchList(false);
  6545. for (const branch of branches) {
  6546. yield git.branchDelete(false, branch);
  6547. }
  6548. // Remove all refs/remotes/origin/* to avoid conflicts
  6549. branches = yield git.branchList(true);
  6550. for (const branch of branches) {
  6551. yield git.branchDelete(true, branch);
  6552. }
  6553. core.endGroup();
  6554. // Clean
  6555. if (clean) {
  6556. core.startGroup('Cleaning the repository');
  6557. if (!(yield git.tryClean())) {
  6558. 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}'.`);
  6559. remove = true;
  6560. }
  6561. else if (!(yield git.tryReset())) {
  6562. remove = true;
  6563. }
  6564. core.endGroup();
  6565. if (remove) {
  6566. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6567. }
  6568. }
  6569. }
  6570. catch (error) {
  6571. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6572. remove = true;
  6573. }
  6574. }
  6575. if (remove) {
  6576. // Delete the contents of the directory. Don't delete the directory itself
  6577. // since it might be the current working directory.
  6578. core.info(`Deleting the contents of '${repositoryPath}'`);
  6579. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6580. yield io.rmRF(path.join(repositoryPath, file));
  6581. }
  6582. }
  6583. });
  6584. }
  6585. exports.prepareExistingDirectory = prepareExistingDirectory;
  6586. /***/ }),
  6587. /***/ 453:
  6588. /***/ (function(module, __unusedexports, __webpack_require__) {
  6589. var once = __webpack_require__(969)
  6590. var eos = __webpack_require__(3)
  6591. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6592. var noop = function () {}
  6593. var ancient = /^v?\.0/.test(process.version)
  6594. var isFn = function (fn) {
  6595. return typeof fn === 'function'
  6596. }
  6597. var isFS = function (stream) {
  6598. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6599. if (!fs) return false // browser
  6600. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6601. }
  6602. var isRequest = function (stream) {
  6603. return stream.setHeader && isFn(stream.abort)
  6604. }
  6605. var destroyer = function (stream, reading, writing, callback) {
  6606. callback = once(callback)
  6607. var closed = false
  6608. stream.on('close', function () {
  6609. closed = true
  6610. })
  6611. eos(stream, {readable: reading, writable: writing}, function (err) {
  6612. if (err) return callback(err)
  6613. closed = true
  6614. callback()
  6615. })
  6616. var destroyed = false
  6617. return function (err) {
  6618. if (closed) return
  6619. if (destroyed) return
  6620. destroyed = true
  6621. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6622. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6623. if (isFn(stream.destroy)) return stream.destroy()
  6624. callback(err || new Error('stream was destroyed'))
  6625. }
  6626. }
  6627. var call = function (fn) {
  6628. fn()
  6629. }
  6630. var pipe = function (from, to) {
  6631. return from.pipe(to)
  6632. }
  6633. var pump = function () {
  6634. var streams = Array.prototype.slice.call(arguments)
  6635. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6636. if (Array.isArray(streams[0])) streams = streams[0]
  6637. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6638. var error
  6639. var destroys = streams.map(function (stream, i) {
  6640. var reading = i < streams.length - 1
  6641. var writing = i > 0
  6642. return destroyer(stream, reading, writing, function (err) {
  6643. if (!error) error = err
  6644. if (err) destroys.forEach(call)
  6645. if (reading) return
  6646. destroys.forEach(call)
  6647. callback(error)
  6648. })
  6649. })
  6650. return streams.reduce(pipe)
  6651. }
  6652. module.exports = pump
  6653. /***/ }),
  6654. /***/ 454:
  6655. /***/ (function(module, exports, __webpack_require__) {
  6656. "use strict";
  6657. Object.defineProperty(exports, '__esModule', { value: true });
  6658. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6659. var Stream = _interopDefault(__webpack_require__(413));
  6660. var http = _interopDefault(__webpack_require__(605));
  6661. var Url = _interopDefault(__webpack_require__(835));
  6662. var https = _interopDefault(__webpack_require__(34));
  6663. var zlib = _interopDefault(__webpack_require__(761));
  6664. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6665. // fix for "Readable" isn't a named export issue
  6666. const Readable = Stream.Readable;
  6667. const BUFFER = Symbol('buffer');
  6668. const TYPE = Symbol('type');
  6669. class Blob {
  6670. constructor() {
  6671. this[TYPE] = '';
  6672. const blobParts = arguments[0];
  6673. const options = arguments[1];
  6674. const buffers = [];
  6675. let size = 0;
  6676. if (blobParts) {
  6677. const a = blobParts;
  6678. const length = Number(a.length);
  6679. for (let i = 0; i < length; i++) {
  6680. const element = a[i];
  6681. let buffer;
  6682. if (element instanceof Buffer) {
  6683. buffer = element;
  6684. } else if (ArrayBuffer.isView(element)) {
  6685. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6686. } else if (element instanceof ArrayBuffer) {
  6687. buffer = Buffer.from(element);
  6688. } else if (element instanceof Blob) {
  6689. buffer = element[BUFFER];
  6690. } else {
  6691. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6692. }
  6693. size += buffer.length;
  6694. buffers.push(buffer);
  6695. }
  6696. }
  6697. this[BUFFER] = Buffer.concat(buffers);
  6698. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6699. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6700. this[TYPE] = type;
  6701. }
  6702. }
  6703. get size() {
  6704. return this[BUFFER].length;
  6705. }
  6706. get type() {
  6707. return this[TYPE];
  6708. }
  6709. text() {
  6710. return Promise.resolve(this[BUFFER].toString());
  6711. }
  6712. arrayBuffer() {
  6713. const buf = this[BUFFER];
  6714. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6715. return Promise.resolve(ab);
  6716. }
  6717. stream() {
  6718. const readable = new Readable();
  6719. readable._read = function () {};
  6720. readable.push(this[BUFFER]);
  6721. readable.push(null);
  6722. return readable;
  6723. }
  6724. toString() {
  6725. return '[object Blob]';
  6726. }
  6727. slice() {
  6728. const size = this.size;
  6729. const start = arguments[0];
  6730. const end = arguments[1];
  6731. let relativeStart, relativeEnd;
  6732. if (start === undefined) {
  6733. relativeStart = 0;
  6734. } else if (start < 0) {
  6735. relativeStart = Math.max(size + start, 0);
  6736. } else {
  6737. relativeStart = Math.min(start, size);
  6738. }
  6739. if (end === undefined) {
  6740. relativeEnd = size;
  6741. } else if (end < 0) {
  6742. relativeEnd = Math.max(size + end, 0);
  6743. } else {
  6744. relativeEnd = Math.min(end, size);
  6745. }
  6746. const span = Math.max(relativeEnd - relativeStart, 0);
  6747. const buffer = this[BUFFER];
  6748. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6749. const blob = new Blob([], { type: arguments[2] });
  6750. blob[BUFFER] = slicedBuffer;
  6751. return blob;
  6752. }
  6753. }
  6754. Object.defineProperties(Blob.prototype, {
  6755. size: { enumerable: true },
  6756. type: { enumerable: true },
  6757. slice: { enumerable: true }
  6758. });
  6759. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6760. value: 'Blob',
  6761. writable: false,
  6762. enumerable: false,
  6763. configurable: true
  6764. });
  6765. /**
  6766. * fetch-error.js
  6767. *
  6768. * FetchError interface for operational errors
  6769. */
  6770. /**
  6771. * Create FetchError instance
  6772. *
  6773. * @param String message Error message for human
  6774. * @param String type Error type for machine
  6775. * @param String systemError For Node.js system error
  6776. * @return FetchError
  6777. */
  6778. function FetchError(message, type, systemError) {
  6779. Error.call(this, message);
  6780. this.message = message;
  6781. this.type = type;
  6782. // when err.type is `system`, err.code contains system error code
  6783. if (systemError) {
  6784. this.code = this.errno = systemError.code;
  6785. }
  6786. // hide custom error implementation details from end-users
  6787. Error.captureStackTrace(this, this.constructor);
  6788. }
  6789. FetchError.prototype = Object.create(Error.prototype);
  6790. FetchError.prototype.constructor = FetchError;
  6791. FetchError.prototype.name = 'FetchError';
  6792. let convert;
  6793. try {
  6794. convert = __webpack_require__(18).convert;
  6795. } catch (e) {}
  6796. const INTERNALS = Symbol('Body internals');
  6797. // fix an issue where "PassThrough" isn't a named export for node <10
  6798. const PassThrough = Stream.PassThrough;
  6799. /**
  6800. * Body mixin
  6801. *
  6802. * Ref: https://fetch.spec.whatwg.org/#body
  6803. *
  6804. * @param Stream body Readable stream
  6805. * @param Object opts Response options
  6806. * @return Void
  6807. */
  6808. function Body(body) {
  6809. var _this = this;
  6810. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6811. _ref$size = _ref.size;
  6812. let size = _ref$size === undefined ? 0 : _ref$size;
  6813. var _ref$timeout = _ref.timeout;
  6814. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6815. if (body == null) {
  6816. // body is undefined or null
  6817. body = null;
  6818. } else if (isURLSearchParams(body)) {
  6819. // body is a URLSearchParams
  6820. body = Buffer.from(body.toString());
  6821. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6822. // body is ArrayBuffer
  6823. body = Buffer.from(body);
  6824. } else if (ArrayBuffer.isView(body)) {
  6825. // body is ArrayBufferView
  6826. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6827. } else if (body instanceof Stream) ; else {
  6828. // none of the above
  6829. // coerce to string then buffer
  6830. body = Buffer.from(String(body));
  6831. }
  6832. this[INTERNALS] = {
  6833. body,
  6834. disturbed: false,
  6835. error: null
  6836. };
  6837. this.size = size;
  6838. this.timeout = timeout;
  6839. if (body instanceof Stream) {
  6840. body.on('error', function (err) {
  6841. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6842. _this[INTERNALS].error = error;
  6843. });
  6844. }
  6845. }
  6846. Body.prototype = {
  6847. get body() {
  6848. return this[INTERNALS].body;
  6849. },
  6850. get bodyUsed() {
  6851. return this[INTERNALS].disturbed;
  6852. },
  6853. /**
  6854. * Decode response as ArrayBuffer
  6855. *
  6856. * @return Promise
  6857. */
  6858. arrayBuffer() {
  6859. return consumeBody.call(this).then(function (buf) {
  6860. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6861. });
  6862. },
  6863. /**
  6864. * Return raw response as Blob
  6865. *
  6866. * @return Promise
  6867. */
  6868. blob() {
  6869. let ct = this.headers && this.headers.get('content-type') || '';
  6870. return consumeBody.call(this).then(function (buf) {
  6871. return Object.assign(
  6872. // Prevent copying
  6873. new Blob([], {
  6874. type: ct.toLowerCase()
  6875. }), {
  6876. [BUFFER]: buf
  6877. });
  6878. });
  6879. },
  6880. /**
  6881. * Decode response as json
  6882. *
  6883. * @return Promise
  6884. */
  6885. json() {
  6886. var _this2 = this;
  6887. return consumeBody.call(this).then(function (buffer) {
  6888. try {
  6889. return JSON.parse(buffer.toString());
  6890. } catch (err) {
  6891. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6892. }
  6893. });
  6894. },
  6895. /**
  6896. * Decode response as text
  6897. *
  6898. * @return Promise
  6899. */
  6900. text() {
  6901. return consumeBody.call(this).then(function (buffer) {
  6902. return buffer.toString();
  6903. });
  6904. },
  6905. /**
  6906. * Decode response as buffer (non-spec api)
  6907. *
  6908. * @return Promise
  6909. */
  6910. buffer() {
  6911. return consumeBody.call(this);
  6912. },
  6913. /**
  6914. * Decode response as text, while automatically detecting the encoding and
  6915. * trying to decode to UTF-8 (non-spec api)
  6916. *
  6917. * @return Promise
  6918. */
  6919. textConverted() {
  6920. var _this3 = this;
  6921. return consumeBody.call(this).then(function (buffer) {
  6922. return convertBody(buffer, _this3.headers);
  6923. });
  6924. }
  6925. };
  6926. // In browsers, all properties are enumerable.
  6927. Object.defineProperties(Body.prototype, {
  6928. body: { enumerable: true },
  6929. bodyUsed: { enumerable: true },
  6930. arrayBuffer: { enumerable: true },
  6931. blob: { enumerable: true },
  6932. json: { enumerable: true },
  6933. text: { enumerable: true }
  6934. });
  6935. Body.mixIn = function (proto) {
  6936. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6937. // istanbul ignore else: future proof
  6938. if (!(name in proto)) {
  6939. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6940. Object.defineProperty(proto, name, desc);
  6941. }
  6942. }
  6943. };
  6944. /**
  6945. * Consume and convert an entire Body to a Buffer.
  6946. *
  6947. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6948. *
  6949. * @return Promise
  6950. */
  6951. function consumeBody() {
  6952. var _this4 = this;
  6953. if (this[INTERNALS].disturbed) {
  6954. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6955. }
  6956. this[INTERNALS].disturbed = true;
  6957. if (this[INTERNALS].error) {
  6958. return Body.Promise.reject(this[INTERNALS].error);
  6959. }
  6960. let body = this.body;
  6961. // body is null
  6962. if (body === null) {
  6963. return Body.Promise.resolve(Buffer.alloc(0));
  6964. }
  6965. // body is blob
  6966. if (isBlob(body)) {
  6967. body = body.stream();
  6968. }
  6969. // body is buffer
  6970. if (Buffer.isBuffer(body)) {
  6971. return Body.Promise.resolve(body);
  6972. }
  6973. // istanbul ignore if: should never happen
  6974. if (!(body instanceof Stream)) {
  6975. return Body.Promise.resolve(Buffer.alloc(0));
  6976. }
  6977. // body is stream
  6978. // get ready to actually consume the body
  6979. let accum = [];
  6980. let accumBytes = 0;
  6981. let abort = false;
  6982. return new Body.Promise(function (resolve, reject) {
  6983. let resTimeout;
  6984. // allow timeout on slow response body
  6985. if (_this4.timeout) {
  6986. resTimeout = setTimeout(function () {
  6987. abort = true;
  6988. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6989. }, _this4.timeout);
  6990. }
  6991. // handle stream errors
  6992. body.on('error', function (err) {
  6993. if (err.name === 'AbortError') {
  6994. // if the request was aborted, reject with this Error
  6995. abort = true;
  6996. reject(err);
  6997. } else {
  6998. // other errors, such as incorrect content-encoding
  6999. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7000. }
  7001. });
  7002. body.on('data', function (chunk) {
  7003. if (abort || chunk === null) {
  7004. return;
  7005. }
  7006. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7007. abort = true;
  7008. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7009. return;
  7010. }
  7011. accumBytes += chunk.length;
  7012. accum.push(chunk);
  7013. });
  7014. body.on('end', function () {
  7015. if (abort) {
  7016. return;
  7017. }
  7018. clearTimeout(resTimeout);
  7019. try {
  7020. resolve(Buffer.concat(accum, accumBytes));
  7021. } catch (err) {
  7022. // handle streams that have accumulated too much data (issue #414)
  7023. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7024. }
  7025. });
  7026. });
  7027. }
  7028. /**
  7029. * Detect buffer encoding and convert to target encoding
  7030. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7031. *
  7032. * @param Buffer buffer Incoming buffer
  7033. * @param String encoding Target encoding
  7034. * @return String
  7035. */
  7036. function convertBody(buffer, headers) {
  7037. if (typeof convert !== 'function') {
  7038. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7039. }
  7040. const ct = headers.get('content-type');
  7041. let charset = 'utf-8';
  7042. let res, str;
  7043. // header
  7044. if (ct) {
  7045. res = /charset=([^;]*)/i.exec(ct);
  7046. }
  7047. // no charset in content type, peek at response body for at most 1024 bytes
  7048. str = buffer.slice(0, 1024).toString();
  7049. // html5
  7050. if (!res && str) {
  7051. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7052. }
  7053. // html4
  7054. if (!res && str) {
  7055. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7056. if (res) {
  7057. res = /charset=(.*)/i.exec(res.pop());
  7058. }
  7059. }
  7060. // xml
  7061. if (!res && str) {
  7062. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7063. }
  7064. // found charset
  7065. if (res) {
  7066. charset = res.pop();
  7067. // prevent decode issues when sites use incorrect encoding
  7068. // ref: https://hsivonen.fi/encoding-menu/
  7069. if (charset === 'gb2312' || charset === 'gbk') {
  7070. charset = 'gb18030';
  7071. }
  7072. }
  7073. // turn raw buffers into a single utf-8 buffer
  7074. return convert(buffer, 'UTF-8', charset).toString();
  7075. }
  7076. /**
  7077. * Detect a URLSearchParams object
  7078. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7079. *
  7080. * @param Object obj Object to detect by type or brand
  7081. * @return String
  7082. */
  7083. function isURLSearchParams(obj) {
  7084. // Duck-typing as a necessary condition.
  7085. 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') {
  7086. return false;
  7087. }
  7088. // Brand-checking and more duck-typing as optional condition.
  7089. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7090. }
  7091. /**
  7092. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7093. * @param {*} obj
  7094. * @return {boolean}
  7095. */
  7096. function isBlob(obj) {
  7097. 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]);
  7098. }
  7099. /**
  7100. * Clone body given Res/Req instance
  7101. *
  7102. * @param Mixed instance Response or Request instance
  7103. * @return Mixed
  7104. */
  7105. function clone(instance) {
  7106. let p1, p2;
  7107. let body = instance.body;
  7108. // don't allow cloning a used body
  7109. if (instance.bodyUsed) {
  7110. throw new Error('cannot clone body after it is used');
  7111. }
  7112. // check that body is a stream and not form-data object
  7113. // note: we can't clone the form-data object without having it as a dependency
  7114. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7115. // tee instance body
  7116. p1 = new PassThrough();
  7117. p2 = new PassThrough();
  7118. body.pipe(p1);
  7119. body.pipe(p2);
  7120. // set instance body to teed body and return the other teed body
  7121. instance[INTERNALS].body = p1;
  7122. body = p2;
  7123. }
  7124. return body;
  7125. }
  7126. /**
  7127. * Performs the operation "extract a `Content-Type` value from |object|" as
  7128. * specified in the specification:
  7129. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7130. *
  7131. * This function assumes that instance.body is present.
  7132. *
  7133. * @param Mixed instance Any options.body input
  7134. */
  7135. function extractContentType(body) {
  7136. if (body === null) {
  7137. // body is null
  7138. return null;
  7139. } else if (typeof body === 'string') {
  7140. // body is string
  7141. return 'text/plain;charset=UTF-8';
  7142. } else if (isURLSearchParams(body)) {
  7143. // body is a URLSearchParams
  7144. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7145. } else if (isBlob(body)) {
  7146. // body is blob
  7147. return body.type || null;
  7148. } else if (Buffer.isBuffer(body)) {
  7149. // body is buffer
  7150. return null;
  7151. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7152. // body is ArrayBuffer
  7153. return null;
  7154. } else if (ArrayBuffer.isView(body)) {
  7155. // body is ArrayBufferView
  7156. return null;
  7157. } else if (typeof body.getBoundary === 'function') {
  7158. // detect form data input from form-data module
  7159. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7160. } else if (body instanceof Stream) {
  7161. // body is stream
  7162. // can't really do much about this
  7163. return null;
  7164. } else {
  7165. // Body constructor defaults other things to string
  7166. return 'text/plain;charset=UTF-8';
  7167. }
  7168. }
  7169. /**
  7170. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7171. * For us, we have to explicitly get it with a function.
  7172. *
  7173. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7174. *
  7175. * @param Body instance Instance of Body
  7176. * @return Number? Number of bytes, or null if not possible
  7177. */
  7178. function getTotalBytes(instance) {
  7179. const body = instance.body;
  7180. if (body === null) {
  7181. // body is null
  7182. return 0;
  7183. } else if (isBlob(body)) {
  7184. return body.size;
  7185. } else if (Buffer.isBuffer(body)) {
  7186. // body is buffer
  7187. return body.length;
  7188. } else if (body && typeof body.getLengthSync === 'function') {
  7189. // detect form data input from form-data module
  7190. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7191. body.hasKnownLength && body.hasKnownLength()) {
  7192. // 2.x
  7193. return body.getLengthSync();
  7194. }
  7195. return null;
  7196. } else {
  7197. // body is stream
  7198. return null;
  7199. }
  7200. }
  7201. /**
  7202. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7203. *
  7204. * @param Body instance Instance of Body
  7205. * @return Void
  7206. */
  7207. function writeToStream(dest, instance) {
  7208. const body = instance.body;
  7209. if (body === null) {
  7210. // body is null
  7211. dest.end();
  7212. } else if (isBlob(body)) {
  7213. body.stream().pipe(dest);
  7214. } else if (Buffer.isBuffer(body)) {
  7215. // body is buffer
  7216. dest.write(body);
  7217. dest.end();
  7218. } else {
  7219. // body is stream
  7220. body.pipe(dest);
  7221. }
  7222. }
  7223. // expose Promise
  7224. Body.Promise = global.Promise;
  7225. /**
  7226. * headers.js
  7227. *
  7228. * Headers class offers convenient helpers
  7229. */
  7230. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7231. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7232. function validateName(name) {
  7233. name = `${name}`;
  7234. if (invalidTokenRegex.test(name) || name === '') {
  7235. throw new TypeError(`${name} is not a legal HTTP header name`);
  7236. }
  7237. }
  7238. function validateValue(value) {
  7239. value = `${value}`;
  7240. if (invalidHeaderCharRegex.test(value)) {
  7241. throw new TypeError(`${value} is not a legal HTTP header value`);
  7242. }
  7243. }
  7244. /**
  7245. * Find the key in the map object given a header name.
  7246. *
  7247. * Returns undefined if not found.
  7248. *
  7249. * @param String name Header name
  7250. * @return String|Undefined
  7251. */
  7252. function find(map, name) {
  7253. name = name.toLowerCase();
  7254. for (const key in map) {
  7255. if (key.toLowerCase() === name) {
  7256. return key;
  7257. }
  7258. }
  7259. return undefined;
  7260. }
  7261. const MAP = Symbol('map');
  7262. class Headers {
  7263. /**
  7264. * Headers class
  7265. *
  7266. * @param Object headers Response headers
  7267. * @return Void
  7268. */
  7269. constructor() {
  7270. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7271. this[MAP] = Object.create(null);
  7272. if (init instanceof Headers) {
  7273. const rawHeaders = init.raw();
  7274. const headerNames = Object.keys(rawHeaders);
  7275. for (const headerName of headerNames) {
  7276. for (const value of rawHeaders[headerName]) {
  7277. this.append(headerName, value);
  7278. }
  7279. }
  7280. return;
  7281. }
  7282. // We don't worry about converting prop to ByteString here as append()
  7283. // will handle it.
  7284. if (init == null) ; else if (typeof init === 'object') {
  7285. const method = init[Symbol.iterator];
  7286. if (method != null) {
  7287. if (typeof method !== 'function') {
  7288. throw new TypeError('Header pairs must be iterable');
  7289. }
  7290. // sequence<sequence<ByteString>>
  7291. // Note: per spec we have to first exhaust the lists then process them
  7292. const pairs = [];
  7293. for (const pair of init) {
  7294. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7295. throw new TypeError('Each header pair must be iterable');
  7296. }
  7297. pairs.push(Array.from(pair));
  7298. }
  7299. for (const pair of pairs) {
  7300. if (pair.length !== 2) {
  7301. throw new TypeError('Each header pair must be a name/value tuple');
  7302. }
  7303. this.append(pair[0], pair[1]);
  7304. }
  7305. } else {
  7306. // record<ByteString, ByteString>
  7307. for (const key of Object.keys(init)) {
  7308. const value = init[key];
  7309. this.append(key, value);
  7310. }
  7311. }
  7312. } else {
  7313. throw new TypeError('Provided initializer must be an object');
  7314. }
  7315. }
  7316. /**
  7317. * Return combined header value given name
  7318. *
  7319. * @param String name Header name
  7320. * @return Mixed
  7321. */
  7322. get(name) {
  7323. name = `${name}`;
  7324. validateName(name);
  7325. const key = find(this[MAP], name);
  7326. if (key === undefined) {
  7327. return null;
  7328. }
  7329. return this[MAP][key].join(', ');
  7330. }
  7331. /**
  7332. * Iterate over all headers
  7333. *
  7334. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7335. * @param Boolean thisArg `this` context for callback function
  7336. * @return Void
  7337. */
  7338. forEach(callback) {
  7339. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7340. let pairs = getHeaders(this);
  7341. let i = 0;
  7342. while (i < pairs.length) {
  7343. var _pairs$i = pairs[i];
  7344. const name = _pairs$i[0],
  7345. value = _pairs$i[1];
  7346. callback.call(thisArg, value, name, this);
  7347. pairs = getHeaders(this);
  7348. i++;
  7349. }
  7350. }
  7351. /**
  7352. * Overwrite header values given name
  7353. *
  7354. * @param String name Header name
  7355. * @param String value Header value
  7356. * @return Void
  7357. */
  7358. set(name, value) {
  7359. name = `${name}`;
  7360. value = `${value}`;
  7361. validateName(name);
  7362. validateValue(value);
  7363. const key = find(this[MAP], name);
  7364. this[MAP][key !== undefined ? key : name] = [value];
  7365. }
  7366. /**
  7367. * Append a value onto existing header
  7368. *
  7369. * @param String name Header name
  7370. * @param String value Header value
  7371. * @return Void
  7372. */
  7373. append(name, value) {
  7374. name = `${name}`;
  7375. value = `${value}`;
  7376. validateName(name);
  7377. validateValue(value);
  7378. const key = find(this[MAP], name);
  7379. if (key !== undefined) {
  7380. this[MAP][key].push(value);
  7381. } else {
  7382. this[MAP][name] = [value];
  7383. }
  7384. }
  7385. /**
  7386. * Check for header name existence
  7387. *
  7388. * @param String name Header name
  7389. * @return Boolean
  7390. */
  7391. has(name) {
  7392. name = `${name}`;
  7393. validateName(name);
  7394. return find(this[MAP], name) !== undefined;
  7395. }
  7396. /**
  7397. * Delete all header values given name
  7398. *
  7399. * @param String name Header name
  7400. * @return Void
  7401. */
  7402. delete(name) {
  7403. name = `${name}`;
  7404. validateName(name);
  7405. const key = find(this[MAP], name);
  7406. if (key !== undefined) {
  7407. delete this[MAP][key];
  7408. }
  7409. }
  7410. /**
  7411. * Return raw headers (non-spec api)
  7412. *
  7413. * @return Object
  7414. */
  7415. raw() {
  7416. return this[MAP];
  7417. }
  7418. /**
  7419. * Get an iterator on keys.
  7420. *
  7421. * @return Iterator
  7422. */
  7423. keys() {
  7424. return createHeadersIterator(this, 'key');
  7425. }
  7426. /**
  7427. * Get an iterator on values.
  7428. *
  7429. * @return Iterator
  7430. */
  7431. values() {
  7432. return createHeadersIterator(this, 'value');
  7433. }
  7434. /**
  7435. * Get an iterator on entries.
  7436. *
  7437. * This is the default iterator of the Headers object.
  7438. *
  7439. * @return Iterator
  7440. */
  7441. [Symbol.iterator]() {
  7442. return createHeadersIterator(this, 'key+value');
  7443. }
  7444. }
  7445. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7446. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7447. value: 'Headers',
  7448. writable: false,
  7449. enumerable: false,
  7450. configurable: true
  7451. });
  7452. Object.defineProperties(Headers.prototype, {
  7453. get: { enumerable: true },
  7454. forEach: { enumerable: true },
  7455. set: { enumerable: true },
  7456. append: { enumerable: true },
  7457. has: { enumerable: true },
  7458. delete: { enumerable: true },
  7459. keys: { enumerable: true },
  7460. values: { enumerable: true },
  7461. entries: { enumerable: true }
  7462. });
  7463. function getHeaders(headers) {
  7464. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7465. const keys = Object.keys(headers[MAP]).sort();
  7466. return keys.map(kind === 'key' ? function (k) {
  7467. return k.toLowerCase();
  7468. } : kind === 'value' ? function (k) {
  7469. return headers[MAP][k].join(', ');
  7470. } : function (k) {
  7471. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7472. });
  7473. }
  7474. const INTERNAL = Symbol('internal');
  7475. function createHeadersIterator(target, kind) {
  7476. const iterator = Object.create(HeadersIteratorPrototype);
  7477. iterator[INTERNAL] = {
  7478. target,
  7479. kind,
  7480. index: 0
  7481. };
  7482. return iterator;
  7483. }
  7484. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7485. next() {
  7486. // istanbul ignore if
  7487. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7488. throw new TypeError('Value of `this` is not a HeadersIterator');
  7489. }
  7490. var _INTERNAL = this[INTERNAL];
  7491. const target = _INTERNAL.target,
  7492. kind = _INTERNAL.kind,
  7493. index = _INTERNAL.index;
  7494. const values = getHeaders(target, kind);
  7495. const len = values.length;
  7496. if (index >= len) {
  7497. return {
  7498. value: undefined,
  7499. done: true
  7500. };
  7501. }
  7502. this[INTERNAL].index = index + 1;
  7503. return {
  7504. value: values[index],
  7505. done: false
  7506. };
  7507. }
  7508. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7509. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7510. value: 'HeadersIterator',
  7511. writable: false,
  7512. enumerable: false,
  7513. configurable: true
  7514. });
  7515. /**
  7516. * Export the Headers object in a form that Node.js can consume.
  7517. *
  7518. * @param Headers headers
  7519. * @return Object
  7520. */
  7521. function exportNodeCompatibleHeaders(headers) {
  7522. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7523. // http.request() only supports string as Host header. This hack makes
  7524. // specifying custom Host header possible.
  7525. const hostHeaderKey = find(headers[MAP], 'Host');
  7526. if (hostHeaderKey !== undefined) {
  7527. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7528. }
  7529. return obj;
  7530. }
  7531. /**
  7532. * Create a Headers object from an object of headers, ignoring those that do
  7533. * not conform to HTTP grammar productions.
  7534. *
  7535. * @param Object obj Object of headers
  7536. * @return Headers
  7537. */
  7538. function createHeadersLenient(obj) {
  7539. const headers = new Headers();
  7540. for (const name of Object.keys(obj)) {
  7541. if (invalidTokenRegex.test(name)) {
  7542. continue;
  7543. }
  7544. if (Array.isArray(obj[name])) {
  7545. for (const val of obj[name]) {
  7546. if (invalidHeaderCharRegex.test(val)) {
  7547. continue;
  7548. }
  7549. if (headers[MAP][name] === undefined) {
  7550. headers[MAP][name] = [val];
  7551. } else {
  7552. headers[MAP][name].push(val);
  7553. }
  7554. }
  7555. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7556. headers[MAP][name] = [obj[name]];
  7557. }
  7558. }
  7559. return headers;
  7560. }
  7561. const INTERNALS$1 = Symbol('Response internals');
  7562. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7563. const STATUS_CODES = http.STATUS_CODES;
  7564. /**
  7565. * Response class
  7566. *
  7567. * @param Stream body Readable stream
  7568. * @param Object opts Response options
  7569. * @return Void
  7570. */
  7571. class Response {
  7572. constructor() {
  7573. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7574. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7575. Body.call(this, body, opts);
  7576. const status = opts.status || 200;
  7577. const headers = new Headers(opts.headers);
  7578. if (body != null && !headers.has('Content-Type')) {
  7579. const contentType = extractContentType(body);
  7580. if (contentType) {
  7581. headers.append('Content-Type', contentType);
  7582. }
  7583. }
  7584. this[INTERNALS$1] = {
  7585. url: opts.url,
  7586. status,
  7587. statusText: opts.statusText || STATUS_CODES[status],
  7588. headers,
  7589. counter: opts.counter
  7590. };
  7591. }
  7592. get url() {
  7593. return this[INTERNALS$1].url || '';
  7594. }
  7595. get status() {
  7596. return this[INTERNALS$1].status;
  7597. }
  7598. /**
  7599. * Convenience property representing if the request ended normally
  7600. */
  7601. get ok() {
  7602. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7603. }
  7604. get redirected() {
  7605. return this[INTERNALS$1].counter > 0;
  7606. }
  7607. get statusText() {
  7608. return this[INTERNALS$1].statusText;
  7609. }
  7610. get headers() {
  7611. return this[INTERNALS$1].headers;
  7612. }
  7613. /**
  7614. * Clone this response
  7615. *
  7616. * @return Response
  7617. */
  7618. clone() {
  7619. return new Response(clone(this), {
  7620. url: this.url,
  7621. status: this.status,
  7622. statusText: this.statusText,
  7623. headers: this.headers,
  7624. ok: this.ok,
  7625. redirected: this.redirected
  7626. });
  7627. }
  7628. }
  7629. Body.mixIn(Response.prototype);
  7630. Object.defineProperties(Response.prototype, {
  7631. url: { enumerable: true },
  7632. status: { enumerable: true },
  7633. ok: { enumerable: true },
  7634. redirected: { enumerable: true },
  7635. statusText: { enumerable: true },
  7636. headers: { enumerable: true },
  7637. clone: { enumerable: true }
  7638. });
  7639. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7640. value: 'Response',
  7641. writable: false,
  7642. enumerable: false,
  7643. configurable: true
  7644. });
  7645. const INTERNALS$2 = Symbol('Request internals');
  7646. // fix an issue where "format", "parse" aren't a named export for node <10
  7647. const parse_url = Url.parse;
  7648. const format_url = Url.format;
  7649. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7650. /**
  7651. * Check if a value is an instance of Request.
  7652. *
  7653. * @param Mixed input
  7654. * @return Boolean
  7655. */
  7656. function isRequest(input) {
  7657. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7658. }
  7659. function isAbortSignal(signal) {
  7660. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7661. return !!(proto && proto.constructor.name === 'AbortSignal');
  7662. }
  7663. /**
  7664. * Request class
  7665. *
  7666. * @param Mixed input Url or Request instance
  7667. * @param Object init Custom options
  7668. * @return Void
  7669. */
  7670. class Request {
  7671. constructor(input) {
  7672. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7673. let parsedURL;
  7674. // normalize input
  7675. if (!isRequest(input)) {
  7676. if (input && input.href) {
  7677. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7678. // will fall into this branch also (since their `toString()` will return
  7679. // `href` property anyway)
  7680. parsedURL = parse_url(input.href);
  7681. } else {
  7682. // coerce input to a string before attempting to parse
  7683. parsedURL = parse_url(`${input}`);
  7684. }
  7685. input = {};
  7686. } else {
  7687. parsedURL = parse_url(input.url);
  7688. }
  7689. let method = init.method || input.method || 'GET';
  7690. method = method.toUpperCase();
  7691. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7692. throw new TypeError('Request with GET/HEAD method cannot have body');
  7693. }
  7694. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7695. Body.call(this, inputBody, {
  7696. timeout: init.timeout || input.timeout || 0,
  7697. size: init.size || input.size || 0
  7698. });
  7699. const headers = new Headers(init.headers || input.headers || {});
  7700. if (inputBody != null && !headers.has('Content-Type')) {
  7701. const contentType = extractContentType(inputBody);
  7702. if (contentType) {
  7703. headers.append('Content-Type', contentType);
  7704. }
  7705. }
  7706. let signal = isRequest(input) ? input.signal : null;
  7707. if ('signal' in init) signal = init.signal;
  7708. if (signal != null && !isAbortSignal(signal)) {
  7709. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7710. }
  7711. this[INTERNALS$2] = {
  7712. method,
  7713. redirect: init.redirect || input.redirect || 'follow',
  7714. headers,
  7715. parsedURL,
  7716. signal
  7717. };
  7718. // node-fetch-only options
  7719. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7720. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7721. this.counter = init.counter || input.counter || 0;
  7722. this.agent = init.agent || input.agent;
  7723. }
  7724. get method() {
  7725. return this[INTERNALS$2].method;
  7726. }
  7727. get url() {
  7728. return format_url(this[INTERNALS$2].parsedURL);
  7729. }
  7730. get headers() {
  7731. return this[INTERNALS$2].headers;
  7732. }
  7733. get redirect() {
  7734. return this[INTERNALS$2].redirect;
  7735. }
  7736. get signal() {
  7737. return this[INTERNALS$2].signal;
  7738. }
  7739. /**
  7740. * Clone this request
  7741. *
  7742. * @return Request
  7743. */
  7744. clone() {
  7745. return new Request(this);
  7746. }
  7747. }
  7748. Body.mixIn(Request.prototype);
  7749. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7750. value: 'Request',
  7751. writable: false,
  7752. enumerable: false,
  7753. configurable: true
  7754. });
  7755. Object.defineProperties(Request.prototype, {
  7756. method: { enumerable: true },
  7757. url: { enumerable: true },
  7758. headers: { enumerable: true },
  7759. redirect: { enumerable: true },
  7760. clone: { enumerable: true },
  7761. signal: { enumerable: true }
  7762. });
  7763. /**
  7764. * Convert a Request to Node.js http request options.
  7765. *
  7766. * @param Request A Request instance
  7767. * @return Object The options object to be passed to http.request
  7768. */
  7769. function getNodeRequestOptions(request) {
  7770. const parsedURL = request[INTERNALS$2].parsedURL;
  7771. const headers = new Headers(request[INTERNALS$2].headers);
  7772. // fetch step 1.3
  7773. if (!headers.has('Accept')) {
  7774. headers.set('Accept', '*/*');
  7775. }
  7776. // Basic fetch
  7777. if (!parsedURL.protocol || !parsedURL.hostname) {
  7778. throw new TypeError('Only absolute URLs are supported');
  7779. }
  7780. if (!/^https?:$/.test(parsedURL.protocol)) {
  7781. throw new TypeError('Only HTTP(S) protocols are supported');
  7782. }
  7783. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7784. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7785. }
  7786. // HTTP-network-or-cache fetch steps 2.4-2.7
  7787. let contentLengthValue = null;
  7788. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7789. contentLengthValue = '0';
  7790. }
  7791. if (request.body != null) {
  7792. const totalBytes = getTotalBytes(request);
  7793. if (typeof totalBytes === 'number') {
  7794. contentLengthValue = String(totalBytes);
  7795. }
  7796. }
  7797. if (contentLengthValue) {
  7798. headers.set('Content-Length', contentLengthValue);
  7799. }
  7800. // HTTP-network-or-cache fetch step 2.11
  7801. if (!headers.has('User-Agent')) {
  7802. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7803. }
  7804. // HTTP-network-or-cache fetch step 2.15
  7805. if (request.compress && !headers.has('Accept-Encoding')) {
  7806. headers.set('Accept-Encoding', 'gzip,deflate');
  7807. }
  7808. let agent = request.agent;
  7809. if (typeof agent === 'function') {
  7810. agent = agent(parsedURL);
  7811. }
  7812. if (!headers.has('Connection') && !agent) {
  7813. headers.set('Connection', 'close');
  7814. }
  7815. // HTTP-network fetch step 4.2
  7816. // chunked encoding is handled by Node.js
  7817. return Object.assign({}, parsedURL, {
  7818. method: request.method,
  7819. headers: exportNodeCompatibleHeaders(headers),
  7820. agent
  7821. });
  7822. }
  7823. /**
  7824. * abort-error.js
  7825. *
  7826. * AbortError interface for cancelled requests
  7827. */
  7828. /**
  7829. * Create AbortError instance
  7830. *
  7831. * @param String message Error message for human
  7832. * @return AbortError
  7833. */
  7834. function AbortError(message) {
  7835. Error.call(this, message);
  7836. this.type = 'aborted';
  7837. this.message = message;
  7838. // hide custom error implementation details from end-users
  7839. Error.captureStackTrace(this, this.constructor);
  7840. }
  7841. AbortError.prototype = Object.create(Error.prototype);
  7842. AbortError.prototype.constructor = AbortError;
  7843. AbortError.prototype.name = 'AbortError';
  7844. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7845. const PassThrough$1 = Stream.PassThrough;
  7846. const resolve_url = Url.resolve;
  7847. /**
  7848. * Fetch function
  7849. *
  7850. * @param Mixed url Absolute url or Request instance
  7851. * @param Object opts Fetch options
  7852. * @return Promise
  7853. */
  7854. function fetch(url, opts) {
  7855. // allow custom promise
  7856. if (!fetch.Promise) {
  7857. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7858. }
  7859. Body.Promise = fetch.Promise;
  7860. // wrap http.request into fetch
  7861. return new fetch.Promise(function (resolve, reject) {
  7862. // build request object
  7863. const request = new Request(url, opts);
  7864. const options = getNodeRequestOptions(request);
  7865. const send = (options.protocol === 'https:' ? https : http).request;
  7866. const signal = request.signal;
  7867. let response = null;
  7868. const abort = function abort() {
  7869. let error = new AbortError('The user aborted a request.');
  7870. reject(error);
  7871. if (request.body && request.body instanceof Stream.Readable) {
  7872. request.body.destroy(error);
  7873. }
  7874. if (!response || !response.body) return;
  7875. response.body.emit('error', error);
  7876. };
  7877. if (signal && signal.aborted) {
  7878. abort();
  7879. return;
  7880. }
  7881. const abortAndFinalize = function abortAndFinalize() {
  7882. abort();
  7883. finalize();
  7884. };
  7885. // send request
  7886. const req = send(options);
  7887. let reqTimeout;
  7888. if (signal) {
  7889. signal.addEventListener('abort', abortAndFinalize);
  7890. }
  7891. function finalize() {
  7892. req.abort();
  7893. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7894. clearTimeout(reqTimeout);
  7895. }
  7896. if (request.timeout) {
  7897. req.once('socket', function (socket) {
  7898. reqTimeout = setTimeout(function () {
  7899. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7900. finalize();
  7901. }, request.timeout);
  7902. });
  7903. }
  7904. req.on('error', function (err) {
  7905. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7906. finalize();
  7907. });
  7908. req.on('response', function (res) {
  7909. clearTimeout(reqTimeout);
  7910. const headers = createHeadersLenient(res.headers);
  7911. // HTTP fetch step 5
  7912. if (fetch.isRedirect(res.statusCode)) {
  7913. // HTTP fetch step 5.2
  7914. const location = headers.get('Location');
  7915. // HTTP fetch step 5.3
  7916. const locationURL = location === null ? null : resolve_url(request.url, location);
  7917. // HTTP fetch step 5.5
  7918. switch (request.redirect) {
  7919. case 'error':
  7920. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7921. finalize();
  7922. return;
  7923. case 'manual':
  7924. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7925. if (locationURL !== null) {
  7926. // handle corrupted header
  7927. try {
  7928. headers.set('Location', locationURL);
  7929. } catch (err) {
  7930. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7931. reject(err);
  7932. }
  7933. }
  7934. break;
  7935. case 'follow':
  7936. // HTTP-redirect fetch step 2
  7937. if (locationURL === null) {
  7938. break;
  7939. }
  7940. // HTTP-redirect fetch step 5
  7941. if (request.counter >= request.follow) {
  7942. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7943. finalize();
  7944. return;
  7945. }
  7946. // HTTP-redirect fetch step 6 (counter increment)
  7947. // Create a new Request object.
  7948. const requestOpts = {
  7949. headers: new Headers(request.headers),
  7950. follow: request.follow,
  7951. counter: request.counter + 1,
  7952. agent: request.agent,
  7953. compress: request.compress,
  7954. method: request.method,
  7955. body: request.body,
  7956. signal: request.signal,
  7957. timeout: request.timeout
  7958. };
  7959. // HTTP-redirect fetch step 9
  7960. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7961. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7962. finalize();
  7963. return;
  7964. }
  7965. // HTTP-redirect fetch step 11
  7966. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7967. requestOpts.method = 'GET';
  7968. requestOpts.body = undefined;
  7969. requestOpts.headers.delete('content-length');
  7970. }
  7971. // HTTP-redirect fetch step 15
  7972. resolve(fetch(new Request(locationURL, requestOpts)));
  7973. finalize();
  7974. return;
  7975. }
  7976. }
  7977. // prepare response
  7978. res.once('end', function () {
  7979. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7980. });
  7981. let body = res.pipe(new PassThrough$1());
  7982. const response_options = {
  7983. url: request.url,
  7984. status: res.statusCode,
  7985. statusText: res.statusMessage,
  7986. headers: headers,
  7987. size: request.size,
  7988. timeout: request.timeout,
  7989. counter: request.counter
  7990. };
  7991. // HTTP-network fetch step 12.1.1.3
  7992. const codings = headers.get('Content-Encoding');
  7993. // HTTP-network fetch step 12.1.1.4: handle content codings
  7994. // in following scenarios we ignore compression support
  7995. // 1. compression support is disabled
  7996. // 2. HEAD request
  7997. // 3. no Content-Encoding header
  7998. // 4. no content response (204)
  7999. // 5. content not modified response (304)
  8000. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8001. response = new Response(body, response_options);
  8002. resolve(response);
  8003. return;
  8004. }
  8005. // For Node v6+
  8006. // Be less strict when decoding compressed responses, since sometimes
  8007. // servers send slightly invalid responses that are still accepted
  8008. // by common browsers.
  8009. // Always using Z_SYNC_FLUSH is what cURL does.
  8010. const zlibOptions = {
  8011. flush: zlib.Z_SYNC_FLUSH,
  8012. finishFlush: zlib.Z_SYNC_FLUSH
  8013. };
  8014. // for gzip
  8015. if (codings == 'gzip' || codings == 'x-gzip') {
  8016. body = body.pipe(zlib.createGunzip(zlibOptions));
  8017. response = new Response(body, response_options);
  8018. resolve(response);
  8019. return;
  8020. }
  8021. // for deflate
  8022. if (codings == 'deflate' || codings == 'x-deflate') {
  8023. // handle the infamous raw deflate response from old servers
  8024. // a hack for old IIS and Apache servers
  8025. const raw = res.pipe(new PassThrough$1());
  8026. raw.once('data', function (chunk) {
  8027. // see http://stackoverflow.com/questions/37519828
  8028. if ((chunk[0] & 0x0F) === 0x08) {
  8029. body = body.pipe(zlib.createInflate());
  8030. } else {
  8031. body = body.pipe(zlib.createInflateRaw());
  8032. }
  8033. response = new Response(body, response_options);
  8034. resolve(response);
  8035. });
  8036. return;
  8037. }
  8038. // for br
  8039. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8040. body = body.pipe(zlib.createBrotliDecompress());
  8041. response = new Response(body, response_options);
  8042. resolve(response);
  8043. return;
  8044. }
  8045. // otherwise, use response as-is
  8046. response = new Response(body, response_options);
  8047. resolve(response);
  8048. });
  8049. writeToStream(req, request);
  8050. });
  8051. }
  8052. /**
  8053. * Redirect code matching
  8054. *
  8055. * @param Number code Status code
  8056. * @return Boolean
  8057. */
  8058. fetch.isRedirect = function (code) {
  8059. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8060. };
  8061. // expose Promise
  8062. fetch.Promise = global.Promise;
  8063. module.exports = exports = fetch;
  8064. Object.defineProperty(exports, "__esModule", { value: true });
  8065. exports.default = exports;
  8066. exports.Headers = Headers;
  8067. exports.Request = Request;
  8068. exports.Response = Response;
  8069. exports.FetchError = FetchError;
  8070. /***/ }),
  8071. /***/ 462:
  8072. /***/ (function(module) {
  8073. "use strict";
  8074. // See http://www.robvanderwoude.com/escapechars.php
  8075. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8076. function escapeCommand(arg) {
  8077. // Escape meta chars
  8078. arg = arg.replace(metaCharsRegExp, '^$1');
  8079. return arg;
  8080. }
  8081. function escapeArgument(arg, doubleEscapeMetaChars) {
  8082. // Convert to string
  8083. arg = `${arg}`;
  8084. // Algorithm below is based on https://qntm.org/cmd
  8085. // Sequence of backslashes followed by a double quote:
  8086. // double up all the backslashes and escape the double quote
  8087. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8088. // Sequence of backslashes followed by the end of the string
  8089. // (which will become a double quote later):
  8090. // double up all the backslashes
  8091. arg = arg.replace(/(\\*)$/, '$1$1');
  8092. // All other backslashes occur literally
  8093. // Quote the whole thing:
  8094. arg = `"${arg}"`;
  8095. // Escape meta chars
  8096. arg = arg.replace(metaCharsRegExp, '^$1');
  8097. // Double escape meta chars if necessary
  8098. if (doubleEscapeMetaChars) {
  8099. arg = arg.replace(metaCharsRegExp, '^$1');
  8100. }
  8101. return arg;
  8102. }
  8103. module.exports.command = escapeCommand;
  8104. module.exports.argument = escapeArgument;
  8105. /***/ }),
  8106. /***/ 463:
  8107. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8108. "use strict";
  8109. Object.defineProperty(exports, '__esModule', { value: true });
  8110. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8111. var deprecation = __webpack_require__(692);
  8112. var once = _interopDefault(__webpack_require__(969));
  8113. const logOnce = once(deprecation => console.warn(deprecation));
  8114. /**
  8115. * Error with extra properties to help with debugging
  8116. */
  8117. class RequestError extends Error {
  8118. constructor(message, statusCode, options) {
  8119. super(message); // Maintains proper stack trace (only available on V8)
  8120. /* istanbul ignore next */
  8121. if (Error.captureStackTrace) {
  8122. Error.captureStackTrace(this, this.constructor);
  8123. }
  8124. this.name = "HttpError";
  8125. this.status = statusCode;
  8126. Object.defineProperty(this, "code", {
  8127. get() {
  8128. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8129. return statusCode;
  8130. }
  8131. });
  8132. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8133. const requestCopy = Object.assign({}, options.request);
  8134. if (options.request.headers.authorization) {
  8135. requestCopy.headers = Object.assign({}, options.request.headers, {
  8136. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8137. });
  8138. }
  8139. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8140. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8141. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8142. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8143. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8144. this.request = requestCopy;
  8145. }
  8146. }
  8147. exports.RequestError = RequestError;
  8148. //# sourceMappingURL=index.js.map
  8149. /***/ }),
  8150. /***/ 464:
  8151. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8152. "use strict";
  8153. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8154. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8155. return new (P || (P = Promise))(function (resolve, reject) {
  8156. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8157. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8158. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8159. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8160. });
  8161. };
  8162. var __importStar = (this && this.__importStar) || function (mod) {
  8163. if (mod && mod.__esModule) return mod;
  8164. var result = {};
  8165. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8166. result["default"] = mod;
  8167. return result;
  8168. };
  8169. var __importDefault = (this && this.__importDefault) || function (mod) {
  8170. return (mod && mod.__esModule) ? mod : { "default": mod };
  8171. };
  8172. Object.defineProperty(exports, "__esModule", { value: true });
  8173. const assert = __importStar(__webpack_require__(357));
  8174. const core = __importStar(__webpack_require__(470));
  8175. const fs = __importStar(__webpack_require__(747));
  8176. const github = __importStar(__webpack_require__(469));
  8177. const io = __importStar(__webpack_require__(1));
  8178. const path = __importStar(__webpack_require__(622));
  8179. const retryHelper = __importStar(__webpack_require__(587));
  8180. const toolCache = __importStar(__webpack_require__(533));
  8181. const v4_1 = __importDefault(__webpack_require__(826));
  8182. const IS_WINDOWS = process.platform === 'win32';
  8183. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8184. return __awaiter(this, void 0, void 0, function* () {
  8185. // Download the archive
  8186. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8187. core.info('Downloading the archive');
  8188. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8189. }));
  8190. // Write archive to disk
  8191. core.info('Writing archive to disk');
  8192. const uniqueId = v4_1.default();
  8193. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8194. yield fs.promises.writeFile(archivePath, archiveData);
  8195. archiveData = Buffer.from(''); // Free memory
  8196. // Extract archive
  8197. core.info('Extracting the archive');
  8198. const extractPath = path.join(repositoryPath, uniqueId);
  8199. yield io.mkdirP(extractPath);
  8200. if (IS_WINDOWS) {
  8201. yield toolCache.extractZip(archivePath, extractPath);
  8202. }
  8203. else {
  8204. yield toolCache.extractTar(archivePath, extractPath);
  8205. }
  8206. io.rmRF(archivePath);
  8207. // Determine the path of the repository content. The archive contains
  8208. // a top-level folder and the repository content is inside.
  8209. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8210. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8211. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8212. core.info(`Resolved version ${archiveVersion}`);
  8213. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8214. // Move the files
  8215. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8216. const sourcePath = path.join(tempRepositoryPath, fileName);
  8217. const targetPath = path.join(repositoryPath, fileName);
  8218. if (IS_WINDOWS) {
  8219. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8220. }
  8221. else {
  8222. yield io.mv(sourcePath, targetPath);
  8223. }
  8224. }
  8225. io.rmRF(extractPath);
  8226. });
  8227. }
  8228. exports.downloadRepository = downloadRepository;
  8229. function downloadArchive(authToken, owner, repo, ref, commit) {
  8230. return __awaiter(this, void 0, void 0, function* () {
  8231. const octokit = new github.GitHub(authToken);
  8232. const params = {
  8233. owner: owner,
  8234. repo: repo,
  8235. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8236. ref: commit || ref
  8237. };
  8238. const response = yield octokit.repos.getArchiveLink(params);
  8239. if (response.status != 200) {
  8240. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8241. }
  8242. return Buffer.from(response.data); // response.data is ArrayBuffer
  8243. });
  8244. }
  8245. /***/ }),
  8246. /***/ 469:
  8247. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8248. "use strict";
  8249. var __importStar = (this && this.__importStar) || function (mod) {
  8250. if (mod && mod.__esModule) return mod;
  8251. var result = {};
  8252. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8253. result["default"] = mod;
  8254. return result;
  8255. };
  8256. Object.defineProperty(exports, "__esModule", { value: true });
  8257. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8258. const graphql_1 = __webpack_require__(898);
  8259. const rest_1 = __webpack_require__(0);
  8260. const Context = __importStar(__webpack_require__(262));
  8261. const httpClient = __importStar(__webpack_require__(539));
  8262. // We need this in order to extend Octokit
  8263. rest_1.Octokit.prototype = new rest_1.Octokit();
  8264. exports.context = new Context.Context();
  8265. class GitHub extends rest_1.Octokit {
  8266. constructor(token, opts) {
  8267. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8268. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8269. }
  8270. /**
  8271. * Disambiguates the constructor overload parameters
  8272. */
  8273. static disambiguate(token, opts) {
  8274. return [
  8275. typeof token === 'string' ? token : '',
  8276. typeof token === 'object' ? token : opts || {}
  8277. ];
  8278. }
  8279. static getOctokitOptions(args) {
  8280. const token = args[0];
  8281. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8282. // Base URL - GHES or Dotcom
  8283. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8284. // Auth
  8285. const auth = GitHub.getAuthString(token, options);
  8286. if (auth) {
  8287. options.auth = auth;
  8288. }
  8289. // Proxy
  8290. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8291. if (agent) {
  8292. // Shallow clone - don't mutate the object provided by the caller
  8293. options.request = options.request ? Object.assign({}, options.request) : {};
  8294. // Set the agent
  8295. options.request.agent = agent;
  8296. }
  8297. return options;
  8298. }
  8299. static getGraphQL(args) {
  8300. const defaults = {};
  8301. defaults.baseUrl = this.getGraphQLBaseUrl();
  8302. const token = args[0];
  8303. const options = args[1];
  8304. // Authorization
  8305. const auth = this.getAuthString(token, options);
  8306. if (auth) {
  8307. defaults.headers = {
  8308. authorization: auth
  8309. };
  8310. }
  8311. // Proxy
  8312. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8313. if (agent) {
  8314. defaults.request = { agent };
  8315. }
  8316. return graphql_1.graphql.defaults(defaults);
  8317. }
  8318. static getAuthString(token, options) {
  8319. // Validate args
  8320. if (!token && !options.auth) {
  8321. throw new Error('Parameter token or opts.auth is required');
  8322. }
  8323. else if (token && options.auth) {
  8324. throw new Error('Parameters token and opts.auth may not both be specified');
  8325. }
  8326. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8327. }
  8328. static getProxyAgent(destinationUrl, options) {
  8329. var _a;
  8330. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8331. if (httpClient.getProxyUrl(destinationUrl)) {
  8332. const hc = new httpClient.HttpClient();
  8333. return hc.getAgent(destinationUrl);
  8334. }
  8335. }
  8336. return undefined;
  8337. }
  8338. static getApiBaseUrl() {
  8339. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8340. }
  8341. static getGraphQLBaseUrl() {
  8342. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8343. // Shouldn't be a trailing slash, but remove if so
  8344. if (url.endsWith('/')) {
  8345. url = url.substr(0, url.length - 1);
  8346. }
  8347. // Remove trailing "/graphql"
  8348. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8349. url = url.substr(0, url.length - '/graphql'.length);
  8350. }
  8351. return url;
  8352. }
  8353. }
  8354. exports.GitHub = GitHub;
  8355. //# sourceMappingURL=github.js.map
  8356. /***/ }),
  8357. /***/ 470:
  8358. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8359. "use strict";
  8360. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8361. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8362. return new (P || (P = Promise))(function (resolve, reject) {
  8363. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8364. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8365. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8366. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8367. });
  8368. };
  8369. Object.defineProperty(exports, "__esModule", { value: true });
  8370. const command_1 = __webpack_require__(431);
  8371. const os = __webpack_require__(87);
  8372. const path = __webpack_require__(622);
  8373. /**
  8374. * The code to exit an action
  8375. */
  8376. var ExitCode;
  8377. (function (ExitCode) {
  8378. /**
  8379. * A code indicating that the action was successful
  8380. */
  8381. ExitCode[ExitCode["Success"] = 0] = "Success";
  8382. /**
  8383. * A code indicating that the action was a failure
  8384. */
  8385. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8386. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8387. //-----------------------------------------------------------------------
  8388. // Variables
  8389. //-----------------------------------------------------------------------
  8390. /**
  8391. * Sets env variable for this action and future actions in the job
  8392. * @param name the name of the variable to set
  8393. * @param val the value of the variable
  8394. */
  8395. function exportVariable(name, val) {
  8396. process.env[name] = val;
  8397. command_1.issueCommand('set-env', { name }, val);
  8398. }
  8399. exports.exportVariable = exportVariable;
  8400. /**
  8401. * Registers a secret which will get masked from logs
  8402. * @param secret value of the secret
  8403. */
  8404. function setSecret(secret) {
  8405. command_1.issueCommand('add-mask', {}, secret);
  8406. }
  8407. exports.setSecret = setSecret;
  8408. /**
  8409. * Prepends inputPath to the PATH (for this action and future actions)
  8410. * @param inputPath
  8411. */
  8412. function addPath(inputPath) {
  8413. command_1.issueCommand('add-path', {}, inputPath);
  8414. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8415. }
  8416. exports.addPath = addPath;
  8417. /**
  8418. * Gets the value of an input. The value is also trimmed.
  8419. *
  8420. * @param name name of the input to get
  8421. * @param options optional. See InputOptions.
  8422. * @returns string
  8423. */
  8424. function getInput(name, options) {
  8425. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8426. if (options && options.required && !val) {
  8427. throw new Error(`Input required and not supplied: ${name}`);
  8428. }
  8429. return val.trim();
  8430. }
  8431. exports.getInput = getInput;
  8432. /**
  8433. * Sets the value of an output.
  8434. *
  8435. * @param name name of the output to set
  8436. * @param value value to store
  8437. */
  8438. function setOutput(name, value) {
  8439. command_1.issueCommand('set-output', { name }, value);
  8440. }
  8441. exports.setOutput = setOutput;
  8442. //-----------------------------------------------------------------------
  8443. // Results
  8444. //-----------------------------------------------------------------------
  8445. /**
  8446. * Sets the action status to failed.
  8447. * When the action exits it will be with an exit code of 1
  8448. * @param message add error issue message
  8449. */
  8450. function setFailed(message) {
  8451. process.exitCode = ExitCode.Failure;
  8452. error(message);
  8453. }
  8454. exports.setFailed = setFailed;
  8455. //-----------------------------------------------------------------------
  8456. // Logging Commands
  8457. //-----------------------------------------------------------------------
  8458. /**
  8459. * Writes debug message to user log
  8460. * @param message debug message
  8461. */
  8462. function debug(message) {
  8463. command_1.issueCommand('debug', {}, message);
  8464. }
  8465. exports.debug = debug;
  8466. /**
  8467. * Adds an error issue
  8468. * @param message error issue message
  8469. */
  8470. function error(message) {
  8471. command_1.issue('error', message);
  8472. }
  8473. exports.error = error;
  8474. /**
  8475. * Adds an warning issue
  8476. * @param message warning issue message
  8477. */
  8478. function warning(message) {
  8479. command_1.issue('warning', message);
  8480. }
  8481. exports.warning = warning;
  8482. /**
  8483. * Writes info to log with console.log.
  8484. * @param message info message
  8485. */
  8486. function info(message) {
  8487. process.stdout.write(message + os.EOL);
  8488. }
  8489. exports.info = info;
  8490. /**
  8491. * Begin an output group.
  8492. *
  8493. * Output until the next `groupEnd` will be foldable in this group
  8494. *
  8495. * @param name The name of the output group
  8496. */
  8497. function startGroup(name) {
  8498. command_1.issue('group', name);
  8499. }
  8500. exports.startGroup = startGroup;
  8501. /**
  8502. * End an output group.
  8503. */
  8504. function endGroup() {
  8505. command_1.issue('endgroup');
  8506. }
  8507. exports.endGroup = endGroup;
  8508. /**
  8509. * Wrap an asynchronous function call in a group.
  8510. *
  8511. * Returns the same type as the function itself.
  8512. *
  8513. * @param name The name of the group
  8514. * @param fn The function to wrap in the group
  8515. */
  8516. function group(name, fn) {
  8517. return __awaiter(this, void 0, void 0, function* () {
  8518. startGroup(name);
  8519. let result;
  8520. try {
  8521. result = yield fn();
  8522. }
  8523. finally {
  8524. endGroup();
  8525. }
  8526. return result;
  8527. });
  8528. }
  8529. exports.group = group;
  8530. //# sourceMappingURL=core.js.map
  8531. /***/ }),
  8532. /***/ 471:
  8533. /***/ (function(module, __unusedexports, __webpack_require__) {
  8534. module.exports = authenticationBeforeRequest;
  8535. const btoa = __webpack_require__(675);
  8536. const uniq = __webpack_require__(126);
  8537. function authenticationBeforeRequest(state, options) {
  8538. if (!state.auth.type) {
  8539. return;
  8540. }
  8541. if (state.auth.type === "basic") {
  8542. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8543. options.headers.authorization = `Basic ${hash}`;
  8544. return;
  8545. }
  8546. if (state.auth.type === "token") {
  8547. options.headers.authorization = `token ${state.auth.token}`;
  8548. return;
  8549. }
  8550. if (state.auth.type === "app") {
  8551. options.headers.authorization = `Bearer ${state.auth.token}`;
  8552. const acceptHeaders = options.headers.accept
  8553. .split(",")
  8554. .concat("application/vnd.github.machine-man-preview+json");
  8555. options.headers.accept = uniq(acceptHeaders)
  8556. .filter(Boolean)
  8557. .join(",");
  8558. return;
  8559. }
  8560. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8561. if (state.auth.token) {
  8562. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8563. return;
  8564. }
  8565. const key = encodeURIComponent(state.auth.key);
  8566. const secret = encodeURIComponent(state.auth.secret);
  8567. options.url += `client_id=${key}&client_secret=${secret}`;
  8568. }
  8569. /***/ }),
  8570. /***/ 489:
  8571. /***/ (function(module, __unusedexports, __webpack_require__) {
  8572. "use strict";
  8573. const path = __webpack_require__(622);
  8574. const which = __webpack_require__(814);
  8575. const pathKey = __webpack_require__(39)();
  8576. function resolveCommandAttempt(parsed, withoutPathExt) {
  8577. const cwd = process.cwd();
  8578. const hasCustomCwd = parsed.options.cwd != null;
  8579. // If a custom `cwd` was specified, we need to change the process cwd
  8580. // because `which` will do stat calls but does not support a custom cwd
  8581. if (hasCustomCwd) {
  8582. try {
  8583. process.chdir(parsed.options.cwd);
  8584. } catch (err) {
  8585. /* Empty */
  8586. }
  8587. }
  8588. let resolved;
  8589. try {
  8590. resolved = which.sync(parsed.command, {
  8591. path: (parsed.options.env || process.env)[pathKey],
  8592. pathExt: withoutPathExt ? path.delimiter : undefined,
  8593. });
  8594. } catch (e) {
  8595. /* Empty */
  8596. } finally {
  8597. process.chdir(cwd);
  8598. }
  8599. // If we successfully resolved, ensure that an absolute path is returned
  8600. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8601. if (resolved) {
  8602. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8603. }
  8604. return resolved;
  8605. }
  8606. function resolveCommand(parsed) {
  8607. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8608. }
  8609. module.exports = resolveCommand;
  8610. /***/ }),
  8611. /***/ 497:
  8612. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8613. "use strict";
  8614. Object.defineProperty(exports, '__esModule', { value: true });
  8615. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8616. var deprecation = __webpack_require__(692);
  8617. var once = _interopDefault(__webpack_require__(969));
  8618. const logOnce = once(deprecation => console.warn(deprecation));
  8619. /**
  8620. * Error with extra properties to help with debugging
  8621. */
  8622. class RequestError extends Error {
  8623. constructor(message, statusCode, options) {
  8624. super(message); // Maintains proper stack trace (only available on V8)
  8625. /* istanbul ignore next */
  8626. if (Error.captureStackTrace) {
  8627. Error.captureStackTrace(this, this.constructor);
  8628. }
  8629. this.name = "HttpError";
  8630. this.status = statusCode;
  8631. Object.defineProperty(this, "code", {
  8632. get() {
  8633. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8634. return statusCode;
  8635. }
  8636. });
  8637. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8638. const requestCopy = Object.assign({}, options.request);
  8639. if (options.request.headers.authorization) {
  8640. requestCopy.headers = Object.assign({}, options.request.headers, {
  8641. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8642. });
  8643. }
  8644. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8645. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8646. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8647. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8648. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8649. this.request = requestCopy;
  8650. }
  8651. }
  8652. exports.RequestError = RequestError;
  8653. //# sourceMappingURL=index.js.map
  8654. /***/ }),
  8655. /***/ 510:
  8656. /***/ (function(module) {
  8657. module.exports = addHook
  8658. function addHook (state, kind, name, hook) {
  8659. var orig = hook
  8660. if (!state.registry[name]) {
  8661. state.registry[name] = []
  8662. }
  8663. if (kind === 'before') {
  8664. hook = function (method, options) {
  8665. return Promise.resolve()
  8666. .then(orig.bind(null, options))
  8667. .then(method.bind(null, options))
  8668. }
  8669. }
  8670. if (kind === 'after') {
  8671. hook = function (method, options) {
  8672. var result
  8673. return Promise.resolve()
  8674. .then(method.bind(null, options))
  8675. .then(function (result_) {
  8676. result = result_
  8677. return orig(result, options)
  8678. })
  8679. .then(function () {
  8680. return result
  8681. })
  8682. }
  8683. }
  8684. if (kind === 'error') {
  8685. hook = function (method, options) {
  8686. return Promise.resolve()
  8687. .then(method.bind(null, options))
  8688. .catch(function (error) {
  8689. return orig(error, options)
  8690. })
  8691. }
  8692. }
  8693. state.registry[name].push({
  8694. hook: hook,
  8695. orig: orig
  8696. })
  8697. }
  8698. /***/ }),
  8699. /***/ 523:
  8700. /***/ (function(module, __unusedexports, __webpack_require__) {
  8701. var register = __webpack_require__(363)
  8702. var addHook = __webpack_require__(510)
  8703. var removeHook = __webpack_require__(763)
  8704. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8705. var bind = Function.bind
  8706. var bindable = bind.bind(bind)
  8707. function bindApi (hook, state, name) {
  8708. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8709. hook.api = { remove: removeHookRef }
  8710. hook.remove = removeHookRef
  8711. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8712. var args = name ? [state, kind, name] : [state, kind]
  8713. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8714. })
  8715. }
  8716. function HookSingular () {
  8717. var singularHookName = 'h'
  8718. var singularHookState = {
  8719. registry: {}
  8720. }
  8721. var singularHook = register.bind(null, singularHookState, singularHookName)
  8722. bindApi(singularHook, singularHookState, singularHookName)
  8723. return singularHook
  8724. }
  8725. function HookCollection () {
  8726. var state = {
  8727. registry: {}
  8728. }
  8729. var hook = register.bind(null, state)
  8730. bindApi(hook, state)
  8731. return hook
  8732. }
  8733. var collectionHookDeprecationMessageDisplayed = false
  8734. function Hook () {
  8735. if (!collectionHookDeprecationMessageDisplayed) {
  8736. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8737. collectionHookDeprecationMessageDisplayed = true
  8738. }
  8739. return HookCollection()
  8740. }
  8741. Hook.Singular = HookSingular.bind()
  8742. Hook.Collection = HookCollection.bind()
  8743. module.exports = Hook
  8744. // expose constructors as a named property for TypeScript
  8745. module.exports.Hook = Hook
  8746. module.exports.Singular = Hook.Singular
  8747. module.exports.Collection = Hook.Collection
  8748. /***/ }),
  8749. /***/ 528:
  8750. /***/ (function(__unusedmodule, exports) {
  8751. "use strict";
  8752. Object.defineProperty(exports, "__esModule", { value: true });
  8753. function escape(value) {
  8754. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8755. return `\\${x}`;
  8756. });
  8757. }
  8758. exports.escape = escape;
  8759. /***/ }),
  8760. /***/ 529:
  8761. /***/ (function(module, __unusedexports, __webpack_require__) {
  8762. const factory = __webpack_require__(47);
  8763. module.exports = factory();
  8764. /***/ }),
  8765. /***/ 533:
  8766. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8767. "use strict";
  8768. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8769. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8770. return new (P || (P = Promise))(function (resolve, reject) {
  8771. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8772. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8773. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8774. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8775. });
  8776. };
  8777. Object.defineProperty(exports, "__esModule", { value: true });
  8778. const core = __webpack_require__(470);
  8779. const io = __webpack_require__(1);
  8780. const fs = __webpack_require__(747);
  8781. const os = __webpack_require__(87);
  8782. const path = __webpack_require__(622);
  8783. const httpm = __webpack_require__(874);
  8784. const semver = __webpack_require__(656);
  8785. const uuidV4 = __webpack_require__(826);
  8786. const exec_1 = __webpack_require__(986);
  8787. const assert_1 = __webpack_require__(357);
  8788. class HTTPError extends Error {
  8789. constructor(httpStatusCode) {
  8790. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8791. this.httpStatusCode = httpStatusCode;
  8792. Object.setPrototypeOf(this, new.target.prototype);
  8793. }
  8794. }
  8795. exports.HTTPError = HTTPError;
  8796. const IS_WINDOWS = process.platform === 'win32';
  8797. const userAgent = 'actions/tool-cache';
  8798. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8799. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8800. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8801. // If directories not found, place them in common temp locations
  8802. if (!tempDirectory || !cacheRoot) {
  8803. let baseLocation;
  8804. if (IS_WINDOWS) {
  8805. // On windows use the USERPROFILE env variable
  8806. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8807. }
  8808. else {
  8809. if (process.platform === 'darwin') {
  8810. baseLocation = '/Users';
  8811. }
  8812. else {
  8813. baseLocation = '/home';
  8814. }
  8815. }
  8816. if (!tempDirectory) {
  8817. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8818. }
  8819. if (!cacheRoot) {
  8820. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8821. }
  8822. }
  8823. /**
  8824. * Download a tool from an url and stream it into a file
  8825. *
  8826. * @param url url of tool to download
  8827. * @returns path to downloaded tool
  8828. */
  8829. function downloadTool(url) {
  8830. return __awaiter(this, void 0, void 0, function* () {
  8831. // Wrap in a promise so that we can resolve from within stream callbacks
  8832. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8833. try {
  8834. const http = new httpm.HttpClient(userAgent, [], {
  8835. allowRetries: true,
  8836. maxRetries: 3
  8837. });
  8838. const destPath = path.join(tempDirectory, uuidV4());
  8839. yield io.mkdirP(tempDirectory);
  8840. core.debug(`Downloading ${url}`);
  8841. core.debug(`Downloading ${destPath}`);
  8842. if (fs.existsSync(destPath)) {
  8843. throw new Error(`Destination file path ${destPath} already exists`);
  8844. }
  8845. const response = yield http.get(url);
  8846. if (response.message.statusCode !== 200) {
  8847. const err = new HTTPError(response.message.statusCode);
  8848. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8849. throw err;
  8850. }
  8851. const file = fs.createWriteStream(destPath);
  8852. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8853. try {
  8854. const stream = response.message.pipe(file);
  8855. stream.on('close', () => {
  8856. core.debug('download complete');
  8857. resolve(destPath);
  8858. });
  8859. }
  8860. catch (err) {
  8861. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8862. reject(err);
  8863. }
  8864. }));
  8865. file.on('error', err => {
  8866. file.end();
  8867. reject(err);
  8868. });
  8869. }
  8870. catch (err) {
  8871. reject(err);
  8872. }
  8873. }));
  8874. });
  8875. }
  8876. exports.downloadTool = downloadTool;
  8877. /**
  8878. * Extract a .7z file
  8879. *
  8880. * @param file path to the .7z file
  8881. * @param dest destination directory. Optional.
  8882. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8883. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8884. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8885. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8886. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8887. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8888. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8889. * to 7zr.exe can be pass to this function.
  8890. * @returns path to the destination directory
  8891. */
  8892. function extract7z(file, dest, _7zPath) {
  8893. return __awaiter(this, void 0, void 0, function* () {
  8894. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8895. assert_1.ok(file, 'parameter "file" is required');
  8896. dest = dest || (yield _createExtractFolder(dest));
  8897. const originalCwd = process.cwd();
  8898. process.chdir(dest);
  8899. if (_7zPath) {
  8900. try {
  8901. const args = [
  8902. 'x',
  8903. '-bb1',
  8904. '-bd',
  8905. '-sccUTF-8',
  8906. file
  8907. ];
  8908. const options = {
  8909. silent: true
  8910. };
  8911. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8912. }
  8913. finally {
  8914. process.chdir(originalCwd);
  8915. }
  8916. }
  8917. else {
  8918. const escapedScript = path
  8919. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8920. .replace(/'/g, "''")
  8921. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8922. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8923. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8924. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8925. const args = [
  8926. '-NoLogo',
  8927. '-Sta',
  8928. '-NoProfile',
  8929. '-NonInteractive',
  8930. '-ExecutionPolicy',
  8931. 'Unrestricted',
  8932. '-Command',
  8933. command
  8934. ];
  8935. const options = {
  8936. silent: true
  8937. };
  8938. try {
  8939. const powershellPath = yield io.which('powershell', true);
  8940. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8941. }
  8942. finally {
  8943. process.chdir(originalCwd);
  8944. }
  8945. }
  8946. return dest;
  8947. });
  8948. }
  8949. exports.extract7z = extract7z;
  8950. /**
  8951. * Extract a tar
  8952. *
  8953. * @param file path to the tar
  8954. * @param dest destination directory. Optional.
  8955. * @param flags flags for the tar. Optional.
  8956. * @returns path to the destination directory
  8957. */
  8958. function extractTar(file, dest, flags = 'xz') {
  8959. return __awaiter(this, void 0, void 0, function* () {
  8960. if (!file) {
  8961. throw new Error("parameter 'file' is required");
  8962. }
  8963. dest = dest || (yield _createExtractFolder(dest));
  8964. const tarPath = yield io.which('tar', true);
  8965. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8966. return dest;
  8967. });
  8968. }
  8969. exports.extractTar = extractTar;
  8970. /**
  8971. * Extract a zip
  8972. *
  8973. * @param file path to the zip
  8974. * @param dest destination directory. Optional.
  8975. * @returns path to the destination directory
  8976. */
  8977. function extractZip(file, dest) {
  8978. return __awaiter(this, void 0, void 0, function* () {
  8979. if (!file) {
  8980. throw new Error("parameter 'file' is required");
  8981. }
  8982. dest = dest || (yield _createExtractFolder(dest));
  8983. if (IS_WINDOWS) {
  8984. yield extractZipWin(file, dest);
  8985. }
  8986. else {
  8987. yield extractZipNix(file, dest);
  8988. }
  8989. return dest;
  8990. });
  8991. }
  8992. exports.extractZip = extractZip;
  8993. function extractZipWin(file, dest) {
  8994. return __awaiter(this, void 0, void 0, function* () {
  8995. // build the powershell command
  8996. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8997. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8998. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8999. // run powershell
  9000. const powershellPath = yield io.which('powershell');
  9001. const args = [
  9002. '-NoLogo',
  9003. '-Sta',
  9004. '-NoProfile',
  9005. '-NonInteractive',
  9006. '-ExecutionPolicy',
  9007. 'Unrestricted',
  9008. '-Command',
  9009. command
  9010. ];
  9011. yield exec_1.exec(`"${powershellPath}"`, args);
  9012. });
  9013. }
  9014. function extractZipNix(file, dest) {
  9015. return __awaiter(this, void 0, void 0, function* () {
  9016. const unzipPath = yield io.which('unzip');
  9017. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9018. });
  9019. }
  9020. /**
  9021. * Caches a directory and installs it into the tool cacheDir
  9022. *
  9023. * @param sourceDir the directory to cache into tools
  9024. * @param tool tool name
  9025. * @param version version of the tool. semver format
  9026. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9027. */
  9028. function cacheDir(sourceDir, tool, version, arch) {
  9029. return __awaiter(this, void 0, void 0, function* () {
  9030. version = semver.clean(version) || version;
  9031. arch = arch || os.arch();
  9032. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9033. core.debug(`source dir: ${sourceDir}`);
  9034. if (!fs.statSync(sourceDir).isDirectory()) {
  9035. throw new Error('sourceDir is not a directory');
  9036. }
  9037. // Create the tool dir
  9038. const destPath = yield _createToolPath(tool, version, arch);
  9039. // copy each child item. do not move. move can fail on Windows
  9040. // due to anti-virus software having an open handle on a file.
  9041. for (const itemName of fs.readdirSync(sourceDir)) {
  9042. const s = path.join(sourceDir, itemName);
  9043. yield io.cp(s, destPath, { recursive: true });
  9044. }
  9045. // write .complete
  9046. _completeToolPath(tool, version, arch);
  9047. return destPath;
  9048. });
  9049. }
  9050. exports.cacheDir = cacheDir;
  9051. /**
  9052. * Caches a downloaded file (GUID) and installs it
  9053. * into the tool cache with a given targetName
  9054. *
  9055. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9056. * @param targetFile the name of the file name in the tools directory
  9057. * @param tool tool name
  9058. * @param version version of the tool. semver format
  9059. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9060. */
  9061. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9062. return __awaiter(this, void 0, void 0, function* () {
  9063. version = semver.clean(version) || version;
  9064. arch = arch || os.arch();
  9065. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9066. core.debug(`source file: ${sourceFile}`);
  9067. if (!fs.statSync(sourceFile).isFile()) {
  9068. throw new Error('sourceFile is not a file');
  9069. }
  9070. // create the tool dir
  9071. const destFolder = yield _createToolPath(tool, version, arch);
  9072. // copy instead of move. move can fail on Windows due to
  9073. // anti-virus software having an open handle on a file.
  9074. const destPath = path.join(destFolder, targetFile);
  9075. core.debug(`destination file ${destPath}`);
  9076. yield io.cp(sourceFile, destPath);
  9077. // write .complete
  9078. _completeToolPath(tool, version, arch);
  9079. return destFolder;
  9080. });
  9081. }
  9082. exports.cacheFile = cacheFile;
  9083. /**
  9084. * Finds the path to a tool version in the local installed tool cache
  9085. *
  9086. * @param toolName name of the tool
  9087. * @param versionSpec version of the tool
  9088. * @param arch optional arch. defaults to arch of computer
  9089. */
  9090. function find(toolName, versionSpec, arch) {
  9091. if (!toolName) {
  9092. throw new Error('toolName parameter is required');
  9093. }
  9094. if (!versionSpec) {
  9095. throw new Error('versionSpec parameter is required');
  9096. }
  9097. arch = arch || os.arch();
  9098. // attempt to resolve an explicit version
  9099. if (!_isExplicitVersion(versionSpec)) {
  9100. const localVersions = findAllVersions(toolName, arch);
  9101. const match = _evaluateVersions(localVersions, versionSpec);
  9102. versionSpec = match;
  9103. }
  9104. // check for the explicit version in the cache
  9105. let toolPath = '';
  9106. if (versionSpec) {
  9107. versionSpec = semver.clean(versionSpec) || '';
  9108. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9109. core.debug(`checking cache: ${cachePath}`);
  9110. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9111. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9112. toolPath = cachePath;
  9113. }
  9114. else {
  9115. core.debug('not found');
  9116. }
  9117. }
  9118. return toolPath;
  9119. }
  9120. exports.find = find;
  9121. /**
  9122. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9123. *
  9124. * @param toolName name of the tool
  9125. * @param arch optional arch. defaults to arch of computer
  9126. */
  9127. function findAllVersions(toolName, arch) {
  9128. const versions = [];
  9129. arch = arch || os.arch();
  9130. const toolPath = path.join(cacheRoot, toolName);
  9131. if (fs.existsSync(toolPath)) {
  9132. const children = fs.readdirSync(toolPath);
  9133. for (const child of children) {
  9134. if (_isExplicitVersion(child)) {
  9135. const fullPath = path.join(toolPath, child, arch || '');
  9136. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9137. versions.push(child);
  9138. }
  9139. }
  9140. }
  9141. }
  9142. return versions;
  9143. }
  9144. exports.findAllVersions = findAllVersions;
  9145. function _createExtractFolder(dest) {
  9146. return __awaiter(this, void 0, void 0, function* () {
  9147. if (!dest) {
  9148. // create a temp dir
  9149. dest = path.join(tempDirectory, uuidV4());
  9150. }
  9151. yield io.mkdirP(dest);
  9152. return dest;
  9153. });
  9154. }
  9155. function _createToolPath(tool, version, arch) {
  9156. return __awaiter(this, void 0, void 0, function* () {
  9157. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9158. core.debug(`destination ${folderPath}`);
  9159. const markerPath = `${folderPath}.complete`;
  9160. yield io.rmRF(folderPath);
  9161. yield io.rmRF(markerPath);
  9162. yield io.mkdirP(folderPath);
  9163. return folderPath;
  9164. });
  9165. }
  9166. function _completeToolPath(tool, version, arch) {
  9167. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9168. const markerPath = `${folderPath}.complete`;
  9169. fs.writeFileSync(markerPath, '');
  9170. core.debug('finished caching tool');
  9171. }
  9172. function _isExplicitVersion(versionSpec) {
  9173. const c = semver.clean(versionSpec) || '';
  9174. core.debug(`isExplicit: ${c}`);
  9175. const valid = semver.valid(c) != null;
  9176. core.debug(`explicit? ${valid}`);
  9177. return valid;
  9178. }
  9179. function _evaluateVersions(versions, versionSpec) {
  9180. let version = '';
  9181. core.debug(`evaluating ${versions.length} versions`);
  9182. versions = versions.sort((a, b) => {
  9183. if (semver.gt(a, b)) {
  9184. return 1;
  9185. }
  9186. return -1;
  9187. });
  9188. for (let i = versions.length - 1; i >= 0; i--) {
  9189. const potential = versions[i];
  9190. const satisfied = semver.satisfies(potential, versionSpec);
  9191. if (satisfied) {
  9192. version = potential;
  9193. break;
  9194. }
  9195. }
  9196. if (version) {
  9197. core.debug(`matched: ${version}`);
  9198. }
  9199. else {
  9200. core.debug('match not found');
  9201. }
  9202. return version;
  9203. }
  9204. //# sourceMappingURL=tool-cache.js.map
  9205. /***/ }),
  9206. /***/ 536:
  9207. /***/ (function(module, __unusedexports, __webpack_require__) {
  9208. module.exports = hasFirstPage
  9209. const deprecate = __webpack_require__(370)
  9210. const getPageLinks = __webpack_require__(577)
  9211. function hasFirstPage (link) {
  9212. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9213. return getPageLinks(link).first
  9214. }
  9215. /***/ }),
  9216. /***/ 539:
  9217. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9218. "use strict";
  9219. Object.defineProperty(exports, "__esModule", { value: true });
  9220. const url = __webpack_require__(835);
  9221. const http = __webpack_require__(605);
  9222. const https = __webpack_require__(34);
  9223. const pm = __webpack_require__(950);
  9224. let tunnel;
  9225. var HttpCodes;
  9226. (function (HttpCodes) {
  9227. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9228. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9229. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9230. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9231. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9232. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9233. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9234. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9235. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9236. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9237. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9238. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9239. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9240. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9241. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9242. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9243. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9244. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9245. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9246. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9247. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9248. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9249. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9250. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9251. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9252. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9253. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9254. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9255. var Headers;
  9256. (function (Headers) {
  9257. Headers["Accept"] = "accept";
  9258. Headers["ContentType"] = "content-type";
  9259. })(Headers = exports.Headers || (exports.Headers = {}));
  9260. var MediaTypes;
  9261. (function (MediaTypes) {
  9262. MediaTypes["ApplicationJson"] = "application/json";
  9263. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9264. /**
  9265. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9266. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9267. */
  9268. function getProxyUrl(serverUrl) {
  9269. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9270. return proxyUrl ? proxyUrl.href : '';
  9271. }
  9272. exports.getProxyUrl = getProxyUrl;
  9273. const HttpRedirectCodes = [
  9274. HttpCodes.MovedPermanently,
  9275. HttpCodes.ResourceMoved,
  9276. HttpCodes.SeeOther,
  9277. HttpCodes.TemporaryRedirect,
  9278. HttpCodes.PermanentRedirect
  9279. ];
  9280. const HttpResponseRetryCodes = [
  9281. HttpCodes.BadGateway,
  9282. HttpCodes.ServiceUnavailable,
  9283. HttpCodes.GatewayTimeout
  9284. ];
  9285. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9286. const ExponentialBackoffCeiling = 10;
  9287. const ExponentialBackoffTimeSlice = 5;
  9288. class HttpClientResponse {
  9289. constructor(message) {
  9290. this.message = message;
  9291. }
  9292. readBody() {
  9293. return new Promise(async (resolve, reject) => {
  9294. let output = Buffer.alloc(0);
  9295. this.message.on('data', (chunk) => {
  9296. output = Buffer.concat([output, chunk]);
  9297. });
  9298. this.message.on('end', () => {
  9299. resolve(output.toString());
  9300. });
  9301. });
  9302. }
  9303. }
  9304. exports.HttpClientResponse = HttpClientResponse;
  9305. function isHttps(requestUrl) {
  9306. let parsedUrl = url.parse(requestUrl);
  9307. return parsedUrl.protocol === 'https:';
  9308. }
  9309. exports.isHttps = isHttps;
  9310. class HttpClient {
  9311. constructor(userAgent, handlers, requestOptions) {
  9312. this._ignoreSslError = false;
  9313. this._allowRedirects = true;
  9314. this._allowRedirectDowngrade = false;
  9315. this._maxRedirects = 50;
  9316. this._allowRetries = false;
  9317. this._maxRetries = 1;
  9318. this._keepAlive = false;
  9319. this._disposed = false;
  9320. this.userAgent = userAgent;
  9321. this.handlers = handlers || [];
  9322. this.requestOptions = requestOptions;
  9323. if (requestOptions) {
  9324. if (requestOptions.ignoreSslError != null) {
  9325. this._ignoreSslError = requestOptions.ignoreSslError;
  9326. }
  9327. this._socketTimeout = requestOptions.socketTimeout;
  9328. if (requestOptions.allowRedirects != null) {
  9329. this._allowRedirects = requestOptions.allowRedirects;
  9330. }
  9331. if (requestOptions.allowRedirectDowngrade != null) {
  9332. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9333. }
  9334. if (requestOptions.maxRedirects != null) {
  9335. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9336. }
  9337. if (requestOptions.keepAlive != null) {
  9338. this._keepAlive = requestOptions.keepAlive;
  9339. }
  9340. if (requestOptions.allowRetries != null) {
  9341. this._allowRetries = requestOptions.allowRetries;
  9342. }
  9343. if (requestOptions.maxRetries != null) {
  9344. this._maxRetries = requestOptions.maxRetries;
  9345. }
  9346. }
  9347. }
  9348. options(requestUrl, additionalHeaders) {
  9349. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9350. }
  9351. get(requestUrl, additionalHeaders) {
  9352. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9353. }
  9354. del(requestUrl, additionalHeaders) {
  9355. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9356. }
  9357. post(requestUrl, data, additionalHeaders) {
  9358. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9359. }
  9360. patch(requestUrl, data, additionalHeaders) {
  9361. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9362. }
  9363. put(requestUrl, data, additionalHeaders) {
  9364. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9365. }
  9366. head(requestUrl, additionalHeaders) {
  9367. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9368. }
  9369. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9370. return this.request(verb, requestUrl, stream, additionalHeaders);
  9371. }
  9372. /**
  9373. * Gets a typed object from an endpoint
  9374. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9375. */
  9376. async getJson(requestUrl, additionalHeaders = {}) {
  9377. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9378. let res = await this.get(requestUrl, additionalHeaders);
  9379. return this._processResponse(res, this.requestOptions);
  9380. }
  9381. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9382. let data = JSON.stringify(obj, null, 2);
  9383. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9384. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9385. let res = await this.post(requestUrl, data, additionalHeaders);
  9386. return this._processResponse(res, this.requestOptions);
  9387. }
  9388. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9389. let data = JSON.stringify(obj, null, 2);
  9390. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9391. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9392. let res = await this.put(requestUrl, data, additionalHeaders);
  9393. return this._processResponse(res, this.requestOptions);
  9394. }
  9395. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9396. let data = JSON.stringify(obj, null, 2);
  9397. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9398. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9399. let res = await this.patch(requestUrl, data, additionalHeaders);
  9400. return this._processResponse(res, this.requestOptions);
  9401. }
  9402. /**
  9403. * Makes a raw http request.
  9404. * All other methods such as get, post, patch, and request ultimately call this.
  9405. * Prefer get, del, post and patch
  9406. */
  9407. async request(verb, requestUrl, data, headers) {
  9408. if (this._disposed) {
  9409. throw new Error('Client has already been disposed.');
  9410. }
  9411. let parsedUrl = url.parse(requestUrl);
  9412. let info = this._prepareRequest(verb, parsedUrl, headers);
  9413. // Only perform retries on reads since writes may not be idempotent.
  9414. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9415. ? this._maxRetries + 1
  9416. : 1;
  9417. let numTries = 0;
  9418. let response;
  9419. while (numTries < maxTries) {
  9420. response = await this.requestRaw(info, data);
  9421. // Check if it's an authentication challenge
  9422. if (response &&
  9423. response.message &&
  9424. response.message.statusCode === HttpCodes.Unauthorized) {
  9425. let authenticationHandler;
  9426. for (let i = 0; i < this.handlers.length; i++) {
  9427. if (this.handlers[i].canHandleAuthentication(response)) {
  9428. authenticationHandler = this.handlers[i];
  9429. break;
  9430. }
  9431. }
  9432. if (authenticationHandler) {
  9433. return authenticationHandler.handleAuthentication(this, info, data);
  9434. }
  9435. else {
  9436. // We have received an unauthorized response but have no handlers to handle it.
  9437. // Let the response return to the caller.
  9438. return response;
  9439. }
  9440. }
  9441. let redirectsRemaining = this._maxRedirects;
  9442. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9443. this._allowRedirects &&
  9444. redirectsRemaining > 0) {
  9445. const redirectUrl = response.message.headers['location'];
  9446. if (!redirectUrl) {
  9447. // if there's no location to redirect to, we won't
  9448. break;
  9449. }
  9450. let parsedRedirectUrl = url.parse(redirectUrl);
  9451. if (parsedUrl.protocol == 'https:' &&
  9452. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9453. !this._allowRedirectDowngrade) {
  9454. 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.');
  9455. }
  9456. // we need to finish reading the response before reassigning response
  9457. // which will leak the open socket.
  9458. await response.readBody();
  9459. // strip authorization header if redirected to a different hostname
  9460. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9461. for (let header in headers) {
  9462. // header names are case insensitive
  9463. if (header.toLowerCase() === 'authorization') {
  9464. delete headers[header];
  9465. }
  9466. }
  9467. }
  9468. // let's make the request with the new redirectUrl
  9469. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9470. response = await this.requestRaw(info, data);
  9471. redirectsRemaining--;
  9472. }
  9473. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9474. // If not a retry code, return immediately instead of retrying
  9475. return response;
  9476. }
  9477. numTries += 1;
  9478. if (numTries < maxTries) {
  9479. await response.readBody();
  9480. await this._performExponentialBackoff(numTries);
  9481. }
  9482. }
  9483. return response;
  9484. }
  9485. /**
  9486. * Needs to be called if keepAlive is set to true in request options.
  9487. */
  9488. dispose() {
  9489. if (this._agent) {
  9490. this._agent.destroy();
  9491. }
  9492. this._disposed = true;
  9493. }
  9494. /**
  9495. * Raw request.
  9496. * @param info
  9497. * @param data
  9498. */
  9499. requestRaw(info, data) {
  9500. return new Promise((resolve, reject) => {
  9501. let callbackForResult = function (err, res) {
  9502. if (err) {
  9503. reject(err);
  9504. }
  9505. resolve(res);
  9506. };
  9507. this.requestRawWithCallback(info, data, callbackForResult);
  9508. });
  9509. }
  9510. /**
  9511. * Raw request with callback.
  9512. * @param info
  9513. * @param data
  9514. * @param onResult
  9515. */
  9516. requestRawWithCallback(info, data, onResult) {
  9517. let socket;
  9518. if (typeof data === 'string') {
  9519. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9520. }
  9521. let callbackCalled = false;
  9522. let handleResult = (err, res) => {
  9523. if (!callbackCalled) {
  9524. callbackCalled = true;
  9525. onResult(err, res);
  9526. }
  9527. };
  9528. let req = info.httpModule.request(info.options, (msg) => {
  9529. let res = new HttpClientResponse(msg);
  9530. handleResult(null, res);
  9531. });
  9532. req.on('socket', sock => {
  9533. socket = sock;
  9534. });
  9535. // If we ever get disconnected, we want the socket to timeout eventually
  9536. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9537. if (socket) {
  9538. socket.end();
  9539. }
  9540. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9541. });
  9542. req.on('error', function (err) {
  9543. // err has statusCode property
  9544. // res should have headers
  9545. handleResult(err, null);
  9546. });
  9547. if (data && typeof data === 'string') {
  9548. req.write(data, 'utf8');
  9549. }
  9550. if (data && typeof data !== 'string') {
  9551. data.on('close', function () {
  9552. req.end();
  9553. });
  9554. data.pipe(req);
  9555. }
  9556. else {
  9557. req.end();
  9558. }
  9559. }
  9560. /**
  9561. * Gets an http agent. This function is useful when you need an http agent that handles
  9562. * routing through a proxy server - depending upon the url and proxy environment variables.
  9563. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9564. */
  9565. getAgent(serverUrl) {
  9566. let parsedUrl = url.parse(serverUrl);
  9567. return this._getAgent(parsedUrl);
  9568. }
  9569. _prepareRequest(method, requestUrl, headers) {
  9570. const info = {};
  9571. info.parsedUrl = requestUrl;
  9572. const usingSsl = info.parsedUrl.protocol === 'https:';
  9573. info.httpModule = usingSsl ? https : http;
  9574. const defaultPort = usingSsl ? 443 : 80;
  9575. info.options = {};
  9576. info.options.host = info.parsedUrl.hostname;
  9577. info.options.port = info.parsedUrl.port
  9578. ? parseInt(info.parsedUrl.port)
  9579. : defaultPort;
  9580. info.options.path =
  9581. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9582. info.options.method = method;
  9583. info.options.headers = this._mergeHeaders(headers);
  9584. if (this.userAgent != null) {
  9585. info.options.headers['user-agent'] = this.userAgent;
  9586. }
  9587. info.options.agent = this._getAgent(info.parsedUrl);
  9588. // gives handlers an opportunity to participate
  9589. if (this.handlers) {
  9590. this.handlers.forEach(handler => {
  9591. handler.prepareRequest(info.options);
  9592. });
  9593. }
  9594. return info;
  9595. }
  9596. _mergeHeaders(headers) {
  9597. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9598. if (this.requestOptions && this.requestOptions.headers) {
  9599. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9600. }
  9601. return lowercaseKeys(headers || {});
  9602. }
  9603. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9604. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9605. let clientHeader;
  9606. if (this.requestOptions && this.requestOptions.headers) {
  9607. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9608. }
  9609. return additionalHeaders[header] || clientHeader || _default;
  9610. }
  9611. _getAgent(parsedUrl) {
  9612. let agent;
  9613. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9614. let useProxy = proxyUrl && proxyUrl.hostname;
  9615. if (this._keepAlive && useProxy) {
  9616. agent = this._proxyAgent;
  9617. }
  9618. if (this._keepAlive && !useProxy) {
  9619. agent = this._agent;
  9620. }
  9621. // if agent is already assigned use that agent.
  9622. if (!!agent) {
  9623. return agent;
  9624. }
  9625. const usingSsl = parsedUrl.protocol === 'https:';
  9626. let maxSockets = 100;
  9627. if (!!this.requestOptions) {
  9628. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9629. }
  9630. if (useProxy) {
  9631. // If using proxy, need tunnel
  9632. if (!tunnel) {
  9633. tunnel = __webpack_require__(335);
  9634. }
  9635. const agentOptions = {
  9636. maxSockets: maxSockets,
  9637. keepAlive: this._keepAlive,
  9638. proxy: {
  9639. proxyAuth: proxyUrl.auth,
  9640. host: proxyUrl.hostname,
  9641. port: proxyUrl.port
  9642. }
  9643. };
  9644. let tunnelAgent;
  9645. const overHttps = proxyUrl.protocol === 'https:';
  9646. if (usingSsl) {
  9647. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9648. }
  9649. else {
  9650. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9651. }
  9652. agent = tunnelAgent(agentOptions);
  9653. this._proxyAgent = agent;
  9654. }
  9655. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9656. if (this._keepAlive && !agent) {
  9657. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9658. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9659. this._agent = agent;
  9660. }
  9661. // if not using private agent and tunnel agent isn't setup then use global agent
  9662. if (!agent) {
  9663. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9664. }
  9665. if (usingSsl && this._ignoreSslError) {
  9666. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9667. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9668. // we have to cast it to any and change it directly
  9669. agent.options = Object.assign(agent.options || {}, {
  9670. rejectUnauthorized: false
  9671. });
  9672. }
  9673. return agent;
  9674. }
  9675. _performExponentialBackoff(retryNumber) {
  9676. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9677. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9678. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9679. }
  9680. static dateTimeDeserializer(key, value) {
  9681. if (typeof value === 'string') {
  9682. let a = new Date(value);
  9683. if (!isNaN(a.valueOf())) {
  9684. return a;
  9685. }
  9686. }
  9687. return value;
  9688. }
  9689. async _processResponse(res, options) {
  9690. return new Promise(async (resolve, reject) => {
  9691. const statusCode = res.message.statusCode;
  9692. const response = {
  9693. statusCode: statusCode,
  9694. result: null,
  9695. headers: {}
  9696. };
  9697. // not found leads to null obj returned
  9698. if (statusCode == HttpCodes.NotFound) {
  9699. resolve(response);
  9700. }
  9701. let obj;
  9702. let contents;
  9703. // get the result from the body
  9704. try {
  9705. contents = await res.readBody();
  9706. if (contents && contents.length > 0) {
  9707. if (options && options.deserializeDates) {
  9708. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9709. }
  9710. else {
  9711. obj = JSON.parse(contents);
  9712. }
  9713. response.result = obj;
  9714. }
  9715. response.headers = res.message.headers;
  9716. }
  9717. catch (err) {
  9718. // Invalid resource (contents not json); leaving result obj null
  9719. }
  9720. // note that 3xx redirects are handled by the http layer.
  9721. if (statusCode > 299) {
  9722. let msg;
  9723. // if exception/error in body, attempt to get better error
  9724. if (obj && obj.message) {
  9725. msg = obj.message;
  9726. }
  9727. else if (contents && contents.length > 0) {
  9728. // it may be the case that the exception is in the body message as string
  9729. msg = contents;
  9730. }
  9731. else {
  9732. msg = 'Failed request: (' + statusCode + ')';
  9733. }
  9734. let err = new Error(msg);
  9735. // attach statusCode and body obj (if available) to the error object
  9736. err['statusCode'] = statusCode;
  9737. if (response.result) {
  9738. err['result'] = response.result;
  9739. }
  9740. reject(err);
  9741. }
  9742. else {
  9743. resolve(response);
  9744. }
  9745. });
  9746. }
  9747. }
  9748. exports.HttpClient = HttpClient;
  9749. /***/ }),
  9750. /***/ 550:
  9751. /***/ (function(module, __unusedexports, __webpack_require__) {
  9752. module.exports = getNextPage
  9753. const getPage = __webpack_require__(265)
  9754. function getNextPage (octokit, link, headers) {
  9755. return getPage(octokit, link, 'next', headers)
  9756. }
  9757. /***/ }),
  9758. /***/ 558:
  9759. /***/ (function(module, __unusedexports, __webpack_require__) {
  9760. module.exports = hasPreviousPage
  9761. const deprecate = __webpack_require__(370)
  9762. const getPageLinks = __webpack_require__(577)
  9763. function hasPreviousPage (link) {
  9764. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9765. return getPageLinks(link).prev
  9766. }
  9767. /***/ }),
  9768. /***/ 559:
  9769. /***/ (function(__unusedmodule, exports) {
  9770. "use strict";
  9771. Object.defineProperty(exports, "__esModule", { value: true });
  9772. class GitVersion {
  9773. /**
  9774. * Used for comparing the version of git and git-lfs against the minimum required version
  9775. * @param version the version string, e.g. 1.2 or 1.2.3
  9776. */
  9777. constructor(version) {
  9778. this.major = NaN;
  9779. this.minor = NaN;
  9780. this.patch = NaN;
  9781. if (version) {
  9782. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9783. if (match) {
  9784. this.major = Number(match[1]);
  9785. this.minor = Number(match[2]);
  9786. if (match[4]) {
  9787. this.patch = Number(match[4]);
  9788. }
  9789. }
  9790. }
  9791. }
  9792. /**
  9793. * Compares the instance against a minimum required version
  9794. * @param minimum Minimum version
  9795. */
  9796. checkMinimum(minimum) {
  9797. if (!minimum.isValid()) {
  9798. throw new Error('Arg minimum is not a valid version');
  9799. }
  9800. // Major is insufficient
  9801. if (this.major < minimum.major) {
  9802. return false;
  9803. }
  9804. // Major is equal
  9805. if (this.major === minimum.major) {
  9806. // Minor is insufficient
  9807. if (this.minor < minimum.minor) {
  9808. return false;
  9809. }
  9810. // Minor is equal
  9811. if (this.minor === minimum.minor) {
  9812. // Patch is insufficient
  9813. if (this.patch && this.patch < (minimum.patch || 0)) {
  9814. return false;
  9815. }
  9816. }
  9817. }
  9818. return true;
  9819. }
  9820. /**
  9821. * Indicates whether the instance was constructed from a valid version string
  9822. */
  9823. isValid() {
  9824. return !isNaN(this.major);
  9825. }
  9826. /**
  9827. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9828. */
  9829. toString() {
  9830. let result = '';
  9831. if (this.isValid()) {
  9832. result = `${this.major}.${this.minor}`;
  9833. if (!isNaN(this.patch)) {
  9834. result += `.${this.patch}`;
  9835. }
  9836. }
  9837. return result;
  9838. }
  9839. }
  9840. exports.GitVersion = GitVersion;
  9841. /***/ }),
  9842. /***/ 562:
  9843. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9844. "use strict";
  9845. Object.defineProperty(exports, '__esModule', { value: true });
  9846. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  9847. var osName = _interopDefault(__webpack_require__(2));
  9848. function getUserAgent() {
  9849. try {
  9850. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  9851. } catch (error) {
  9852. if (/wmic os get Caption/.test(error.message)) {
  9853. return "Windows <version undetectable>";
  9854. }
  9855. return "<environment undetectable>";
  9856. }
  9857. }
  9858. exports.getUserAgent = getUserAgent;
  9859. //# sourceMappingURL=index.js.map
  9860. /***/ }),
  9861. /***/ 563:
  9862. /***/ (function(module, __unusedexports, __webpack_require__) {
  9863. module.exports = getPreviousPage
  9864. const getPage = __webpack_require__(265)
  9865. function getPreviousPage (octokit, link, headers) {
  9866. return getPage(octokit, link, 'prev', headers)
  9867. }
  9868. /***/ }),
  9869. /***/ 568:
  9870. /***/ (function(module, __unusedexports, __webpack_require__) {
  9871. "use strict";
  9872. const path = __webpack_require__(622);
  9873. const niceTry = __webpack_require__(948);
  9874. const resolveCommand = __webpack_require__(489);
  9875. const escape = __webpack_require__(462);
  9876. const readShebang = __webpack_require__(389);
  9877. const semver = __webpack_require__(280);
  9878. const isWin = process.platform === 'win32';
  9879. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9880. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9881. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9882. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9883. function detectShebang(parsed) {
  9884. parsed.file = resolveCommand(parsed);
  9885. const shebang = parsed.file && readShebang(parsed.file);
  9886. if (shebang) {
  9887. parsed.args.unshift(parsed.file);
  9888. parsed.command = shebang;
  9889. return resolveCommand(parsed);
  9890. }
  9891. return parsed.file;
  9892. }
  9893. function parseNonShell(parsed) {
  9894. if (!isWin) {
  9895. return parsed;
  9896. }
  9897. // Detect & add support for shebangs
  9898. const commandFile = detectShebang(parsed);
  9899. // We don't need a shell if the command filename is an executable
  9900. const needsShell = !isExecutableRegExp.test(commandFile);
  9901. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9902. // Note that `forceShell` is an hidden option used only in tests
  9903. if (parsed.options.forceShell || needsShell) {
  9904. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9905. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9906. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9907. // we need to double escape them
  9908. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9909. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9910. // This is necessary otherwise it will always fail with ENOENT in those cases
  9911. parsed.command = path.normalize(parsed.command);
  9912. // Escape command & arguments
  9913. parsed.command = escape.command(parsed.command);
  9914. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9915. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9916. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9917. parsed.command = process.env.comspec || 'cmd.exe';
  9918. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9919. }
  9920. return parsed;
  9921. }
  9922. function parseShell(parsed) {
  9923. // If node supports the shell option, there's no need to mimic its behavior
  9924. if (supportsShellOption) {
  9925. return parsed;
  9926. }
  9927. // Mimic node shell option
  9928. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9929. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9930. if (isWin) {
  9931. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9932. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9933. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9934. } else {
  9935. if (typeof parsed.options.shell === 'string') {
  9936. parsed.command = parsed.options.shell;
  9937. } else if (process.platform === 'android') {
  9938. parsed.command = '/system/bin/sh';
  9939. } else {
  9940. parsed.command = '/bin/sh';
  9941. }
  9942. parsed.args = ['-c', shellCommand];
  9943. }
  9944. return parsed;
  9945. }
  9946. function parse(command, args, options) {
  9947. // Normalize arguments, similar to nodejs
  9948. if (args && !Array.isArray(args)) {
  9949. options = args;
  9950. args = null;
  9951. }
  9952. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9953. options = Object.assign({}, options); // Clone object to avoid changing the original
  9954. // Build our parsed object
  9955. const parsed = {
  9956. command,
  9957. args,
  9958. options,
  9959. file: undefined,
  9960. original: {
  9961. command,
  9962. args,
  9963. },
  9964. };
  9965. // Delegate further parsing to shell or non-shell
  9966. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9967. }
  9968. module.exports = parse;
  9969. /***/ }),
  9970. /***/ 577:
  9971. /***/ (function(module) {
  9972. module.exports = getPageLinks
  9973. function getPageLinks (link) {
  9974. link = link.link || link.headers.link || ''
  9975. const links = {}
  9976. // link format:
  9977. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9978. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9979. links[type] = uri
  9980. })
  9981. return links
  9982. }
  9983. /***/ }),
  9984. /***/ 587:
  9985. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9986. "use strict";
  9987. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9988. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9989. return new (P || (P = Promise))(function (resolve, reject) {
  9990. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9991. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9992. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9993. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9994. });
  9995. };
  9996. var __importStar = (this && this.__importStar) || function (mod) {
  9997. if (mod && mod.__esModule) return mod;
  9998. var result = {};
  9999. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10000. result["default"] = mod;
  10001. return result;
  10002. };
  10003. Object.defineProperty(exports, "__esModule", { value: true });
  10004. const core = __importStar(__webpack_require__(470));
  10005. const defaultMaxAttempts = 3;
  10006. const defaultMinSeconds = 10;
  10007. const defaultMaxSeconds = 20;
  10008. class RetryHelper {
  10009. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10010. this.maxAttempts = maxAttempts;
  10011. this.minSeconds = Math.floor(minSeconds);
  10012. this.maxSeconds = Math.floor(maxSeconds);
  10013. if (this.minSeconds > this.maxSeconds) {
  10014. throw new Error('min seconds should be less than or equal to max seconds');
  10015. }
  10016. }
  10017. execute(action) {
  10018. return __awaiter(this, void 0, void 0, function* () {
  10019. let attempt = 1;
  10020. while (attempt < this.maxAttempts) {
  10021. // Try
  10022. try {
  10023. return yield action();
  10024. }
  10025. catch (err) {
  10026. core.info(err.message);
  10027. }
  10028. // Sleep
  10029. const seconds = this.getSleepAmount();
  10030. core.info(`Waiting ${seconds} seconds before trying again`);
  10031. yield this.sleep(seconds);
  10032. attempt++;
  10033. }
  10034. // Last attempt
  10035. return yield action();
  10036. });
  10037. }
  10038. getSleepAmount() {
  10039. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10040. this.minSeconds);
  10041. }
  10042. sleep(seconds) {
  10043. return __awaiter(this, void 0, void 0, function* () {
  10044. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10045. });
  10046. }
  10047. }
  10048. exports.RetryHelper = RetryHelper;
  10049. function execute(action) {
  10050. return __awaiter(this, void 0, void 0, function* () {
  10051. const retryHelper = new RetryHelper();
  10052. return yield retryHelper.execute(action);
  10053. });
  10054. }
  10055. exports.execute = execute;
  10056. /***/ }),
  10057. /***/ 605:
  10058. /***/ (function(module) {
  10059. module.exports = require("http");
  10060. /***/ }),
  10061. /***/ 614:
  10062. /***/ (function(module) {
  10063. module.exports = require("events");
  10064. /***/ }),
  10065. /***/ 618:
  10066. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10067. "use strict";
  10068. var __importStar = (this && this.__importStar) || function (mod) {
  10069. if (mod && mod.__esModule) return mod;
  10070. var result = {};
  10071. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10072. result["default"] = mod;
  10073. return result;
  10074. };
  10075. Object.defineProperty(exports, "__esModule", { value: true });
  10076. const fs = __importStar(__webpack_require__(747));
  10077. function directoryExistsSync(path, required) {
  10078. if (!path) {
  10079. throw new Error("Arg 'path' must not be empty");
  10080. }
  10081. let stats;
  10082. try {
  10083. stats = fs.statSync(path);
  10084. }
  10085. catch (error) {
  10086. if (error.code === 'ENOENT') {
  10087. if (!required) {
  10088. return false;
  10089. }
  10090. throw new Error(`Directory '${path}' does not exist`);
  10091. }
  10092. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10093. }
  10094. if (stats.isDirectory()) {
  10095. return true;
  10096. }
  10097. else if (!required) {
  10098. return false;
  10099. }
  10100. throw new Error(`Directory '${path}' does not exist`);
  10101. }
  10102. exports.directoryExistsSync = directoryExistsSync;
  10103. function existsSync(path) {
  10104. if (!path) {
  10105. throw new Error("Arg 'path' must not be empty");
  10106. }
  10107. try {
  10108. fs.statSync(path);
  10109. }
  10110. catch (error) {
  10111. if (error.code === 'ENOENT') {
  10112. return false;
  10113. }
  10114. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10115. }
  10116. return true;
  10117. }
  10118. exports.existsSync = existsSync;
  10119. function fileExistsSync(path) {
  10120. if (!path) {
  10121. throw new Error("Arg 'path' must not be empty");
  10122. }
  10123. let stats;
  10124. try {
  10125. stats = fs.statSync(path);
  10126. }
  10127. catch (error) {
  10128. if (error.code === 'ENOENT') {
  10129. return false;
  10130. }
  10131. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10132. }
  10133. if (!stats.isDirectory()) {
  10134. return true;
  10135. }
  10136. return false;
  10137. }
  10138. exports.fileExistsSync = fileExistsSync;
  10139. /***/ }),
  10140. /***/ 621:
  10141. /***/ (function(module, __unusedexports, __webpack_require__) {
  10142. "use strict";
  10143. const path = __webpack_require__(622);
  10144. const pathKey = __webpack_require__(39);
  10145. module.exports = opts => {
  10146. opts = Object.assign({
  10147. cwd: process.cwd(),
  10148. path: process.env[pathKey()]
  10149. }, opts);
  10150. let prev;
  10151. let pth = path.resolve(opts.cwd);
  10152. const ret = [];
  10153. while (prev !== pth) {
  10154. ret.push(path.join(pth, 'node_modules/.bin'));
  10155. prev = pth;
  10156. pth = path.resolve(pth, '..');
  10157. }
  10158. // ensure the running `node` binary is used
  10159. ret.push(path.dirname(process.execPath));
  10160. return ret.concat(opts.path).join(path.delimiter);
  10161. };
  10162. module.exports.env = opts => {
  10163. opts = Object.assign({
  10164. env: process.env
  10165. }, opts);
  10166. const env = Object.assign({}, opts.env);
  10167. const path = pathKey({env});
  10168. opts.path = env[path];
  10169. env[path] = module.exports(opts);
  10170. return env;
  10171. };
  10172. /***/ }),
  10173. /***/ 622:
  10174. /***/ (function(module) {
  10175. module.exports = require("path");
  10176. /***/ }),
  10177. /***/ 631:
  10178. /***/ (function(module) {
  10179. module.exports = require("net");
  10180. /***/ }),
  10181. /***/ 649:
  10182. /***/ (function(module, __unusedexports, __webpack_require__) {
  10183. module.exports = getLastPage
  10184. const getPage = __webpack_require__(265)
  10185. function getLastPage (octokit, link, headers) {
  10186. return getPage(octokit, link, 'last', headers)
  10187. }
  10188. /***/ }),
  10189. /***/ 654:
  10190. /***/ (function(module) {
  10191. // This is not the set of all possible signals.
  10192. //
  10193. // It IS, however, the set of all signals that trigger
  10194. // an exit on either Linux or BSD systems. Linux is a
  10195. // superset of the signal names supported on BSD, and
  10196. // the unknown signals just fail to register, so we can
  10197. // catch that easily enough.
  10198. //
  10199. // Don't bother with SIGKILL. It's uncatchable, which
  10200. // means that we can't fire any callbacks anyway.
  10201. //
  10202. // If a user does happen to register a handler on a non-
  10203. // fatal signal like SIGWINCH or something, and then
  10204. // exit, it'll end up firing `process.emit('exit')`, so
  10205. // the handler will be fired anyway.
  10206. //
  10207. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10208. // artificially, inherently leave the process in a
  10209. // state from which it is not safe to try and enter JS
  10210. // listeners.
  10211. module.exports = [
  10212. 'SIGABRT',
  10213. 'SIGALRM',
  10214. 'SIGHUP',
  10215. 'SIGINT',
  10216. 'SIGTERM'
  10217. ]
  10218. if (process.platform !== 'win32') {
  10219. module.exports.push(
  10220. 'SIGVTALRM',
  10221. 'SIGXCPU',
  10222. 'SIGXFSZ',
  10223. 'SIGUSR2',
  10224. 'SIGTRAP',
  10225. 'SIGSYS',
  10226. 'SIGQUIT',
  10227. 'SIGIOT'
  10228. // should detect profiler and enable/disable accordingly.
  10229. // see #21
  10230. // 'SIGPROF'
  10231. )
  10232. }
  10233. if (process.platform === 'linux') {
  10234. module.exports.push(
  10235. 'SIGIO',
  10236. 'SIGPOLL',
  10237. 'SIGPWR',
  10238. 'SIGSTKFLT',
  10239. 'SIGUNUSED'
  10240. )
  10241. }
  10242. /***/ }),
  10243. /***/ 656:
  10244. /***/ (function(module, exports) {
  10245. exports = module.exports = SemVer
  10246. var debug
  10247. /* istanbul ignore next */
  10248. if (typeof process === 'object' &&
  10249. process.env &&
  10250. process.env.NODE_DEBUG &&
  10251. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10252. debug = function () {
  10253. var args = Array.prototype.slice.call(arguments, 0)
  10254. args.unshift('SEMVER')
  10255. console.log.apply(console, args)
  10256. }
  10257. } else {
  10258. debug = function () {}
  10259. }
  10260. // Note: this is the semver.org version of the spec that it implements
  10261. // Not necessarily the package version of this code.
  10262. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10263. var MAX_LENGTH = 256
  10264. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10265. /* istanbul ignore next */ 9007199254740991
  10266. // Max safe segment length for coercion.
  10267. var MAX_SAFE_COMPONENT_LENGTH = 16
  10268. // The actual regexps go on exports.re
  10269. var re = exports.re = []
  10270. var src = exports.src = []
  10271. var t = exports.tokens = {}
  10272. var R = 0
  10273. function tok (n) {
  10274. t[n] = R++
  10275. }
  10276. // The following Regular Expressions can be used for tokenizing,
  10277. // validating, and parsing SemVer version strings.
  10278. // ## Numeric Identifier
  10279. // A single `0`, or a non-zero digit followed by zero or more digits.
  10280. tok('NUMERICIDENTIFIER')
  10281. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10282. tok('NUMERICIDENTIFIERLOOSE')
  10283. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10284. // ## Non-numeric Identifier
  10285. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10286. // more letters, digits, or hyphens.
  10287. tok('NONNUMERICIDENTIFIER')
  10288. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10289. // ## Main Version
  10290. // Three dot-separated numeric identifiers.
  10291. tok('MAINVERSION')
  10292. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10293. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10294. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10295. tok('MAINVERSIONLOOSE')
  10296. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10297. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10298. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10299. // ## Pre-release Version Identifier
  10300. // A numeric identifier, or a non-numeric identifier.
  10301. tok('PRERELEASEIDENTIFIER')
  10302. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10303. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10304. tok('PRERELEASEIDENTIFIERLOOSE')
  10305. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10306. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10307. // ## Pre-release Version
  10308. // Hyphen, followed by one or more dot-separated pre-release version
  10309. // identifiers.
  10310. tok('PRERELEASE')
  10311. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10312. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10313. tok('PRERELEASELOOSE')
  10314. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10315. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10316. // ## Build Metadata Identifier
  10317. // Any combination of digits, letters, or hyphens.
  10318. tok('BUILDIDENTIFIER')
  10319. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10320. // ## Build Metadata
  10321. // Plus sign, followed by one or more period-separated build metadata
  10322. // identifiers.
  10323. tok('BUILD')
  10324. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10325. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10326. // ## Full Version String
  10327. // A main version, followed optionally by a pre-release version and
  10328. // build metadata.
  10329. // Note that the only major, minor, patch, and pre-release sections of
  10330. // the version string are capturing groups. The build metadata is not a
  10331. // capturing group, because it should not ever be used in version
  10332. // comparison.
  10333. tok('FULL')
  10334. tok('FULLPLAIN')
  10335. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10336. src[t.PRERELEASE] + '?' +
  10337. src[t.BUILD] + '?'
  10338. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10339. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10340. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10341. // common in the npm registry.
  10342. tok('LOOSEPLAIN')
  10343. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10344. src[t.PRERELEASELOOSE] + '?' +
  10345. src[t.BUILD] + '?'
  10346. tok('LOOSE')
  10347. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10348. tok('GTLT')
  10349. src[t.GTLT] = '((?:<|>)?=?)'
  10350. // Something like "2.*" or "1.2.x".
  10351. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10352. // Only the first item is strictly required.
  10353. tok('XRANGEIDENTIFIERLOOSE')
  10354. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10355. tok('XRANGEIDENTIFIER')
  10356. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10357. tok('XRANGEPLAIN')
  10358. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10359. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10360. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10361. '(?:' + src[t.PRERELEASE] + ')?' +
  10362. src[t.BUILD] + '?' +
  10363. ')?)?'
  10364. tok('XRANGEPLAINLOOSE')
  10365. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10366. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10367. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10368. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10369. src[t.BUILD] + '?' +
  10370. ')?)?'
  10371. tok('XRANGE')
  10372. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10373. tok('XRANGELOOSE')
  10374. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10375. // Coercion.
  10376. // Extract anything that could conceivably be a part of a valid semver
  10377. tok('COERCE')
  10378. src[t.COERCE] = '(^|[^\\d])' +
  10379. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10380. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10381. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10382. '(?:$|[^\\d])'
  10383. tok('COERCERTL')
  10384. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10385. // Tilde ranges.
  10386. // Meaning is "reasonably at or greater than"
  10387. tok('LONETILDE')
  10388. src[t.LONETILDE] = '(?:~>?)'
  10389. tok('TILDETRIM')
  10390. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10391. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10392. var tildeTrimReplace = '$1~'
  10393. tok('TILDE')
  10394. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10395. tok('TILDELOOSE')
  10396. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10397. // Caret ranges.
  10398. // Meaning is "at least and backwards compatible with"
  10399. tok('LONECARET')
  10400. src[t.LONECARET] = '(?:\\^)'
  10401. tok('CARETTRIM')
  10402. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10403. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10404. var caretTrimReplace = '$1^'
  10405. tok('CARET')
  10406. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10407. tok('CARETLOOSE')
  10408. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10409. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10410. tok('COMPARATORLOOSE')
  10411. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10412. tok('COMPARATOR')
  10413. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10414. // An expression to strip any whitespace between the gtlt and the thing
  10415. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10416. tok('COMPARATORTRIM')
  10417. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10418. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10419. // this one has to use the /g flag
  10420. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10421. var comparatorTrimReplace = '$1$2$3'
  10422. // Something like `1.2.3 - 1.2.4`
  10423. // Note that these all use the loose form, because they'll be
  10424. // checked against either the strict or loose comparator form
  10425. // later.
  10426. tok('HYPHENRANGE')
  10427. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10428. '\\s+-\\s+' +
  10429. '(' + src[t.XRANGEPLAIN] + ')' +
  10430. '\\s*$'
  10431. tok('HYPHENRANGELOOSE')
  10432. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10433. '\\s+-\\s+' +
  10434. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10435. '\\s*$'
  10436. // Star ranges basically just allow anything at all.
  10437. tok('STAR')
  10438. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10439. // Compile to actual regexp objects.
  10440. // All are flag-free, unless they were created above with a flag.
  10441. for (var i = 0; i < R; i++) {
  10442. debug(i, src[i])
  10443. if (!re[i]) {
  10444. re[i] = new RegExp(src[i])
  10445. }
  10446. }
  10447. exports.parse = parse
  10448. function parse (version, options) {
  10449. if (!options || typeof options !== 'object') {
  10450. options = {
  10451. loose: !!options,
  10452. includePrerelease: false
  10453. }
  10454. }
  10455. if (version instanceof SemVer) {
  10456. return version
  10457. }
  10458. if (typeof version !== 'string') {
  10459. return null
  10460. }
  10461. if (version.length > MAX_LENGTH) {
  10462. return null
  10463. }
  10464. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10465. if (!r.test(version)) {
  10466. return null
  10467. }
  10468. try {
  10469. return new SemVer(version, options)
  10470. } catch (er) {
  10471. return null
  10472. }
  10473. }
  10474. exports.valid = valid
  10475. function valid (version, options) {
  10476. var v = parse(version, options)
  10477. return v ? v.version : null
  10478. }
  10479. exports.clean = clean
  10480. function clean (version, options) {
  10481. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10482. return s ? s.version : null
  10483. }
  10484. exports.SemVer = SemVer
  10485. function SemVer (version, options) {
  10486. if (!options || typeof options !== 'object') {
  10487. options = {
  10488. loose: !!options,
  10489. includePrerelease: false
  10490. }
  10491. }
  10492. if (version instanceof SemVer) {
  10493. if (version.loose === options.loose) {
  10494. return version
  10495. } else {
  10496. version = version.version
  10497. }
  10498. } else if (typeof version !== 'string') {
  10499. throw new TypeError('Invalid Version: ' + version)
  10500. }
  10501. if (version.length > MAX_LENGTH) {
  10502. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10503. }
  10504. if (!(this instanceof SemVer)) {
  10505. return new SemVer(version, options)
  10506. }
  10507. debug('SemVer', version, options)
  10508. this.options = options
  10509. this.loose = !!options.loose
  10510. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10511. if (!m) {
  10512. throw new TypeError('Invalid Version: ' + version)
  10513. }
  10514. this.raw = version
  10515. // these are actually numbers
  10516. this.major = +m[1]
  10517. this.minor = +m[2]
  10518. this.patch = +m[3]
  10519. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10520. throw new TypeError('Invalid major version')
  10521. }
  10522. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10523. throw new TypeError('Invalid minor version')
  10524. }
  10525. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10526. throw new TypeError('Invalid patch version')
  10527. }
  10528. // numberify any prerelease numeric ids
  10529. if (!m[4]) {
  10530. this.prerelease = []
  10531. } else {
  10532. this.prerelease = m[4].split('.').map(function (id) {
  10533. if (/^[0-9]+$/.test(id)) {
  10534. var num = +id
  10535. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10536. return num
  10537. }
  10538. }
  10539. return id
  10540. })
  10541. }
  10542. this.build = m[5] ? m[5].split('.') : []
  10543. this.format()
  10544. }
  10545. SemVer.prototype.format = function () {
  10546. this.version = this.major + '.' + this.minor + '.' + this.patch
  10547. if (this.prerelease.length) {
  10548. this.version += '-' + this.prerelease.join('.')
  10549. }
  10550. return this.version
  10551. }
  10552. SemVer.prototype.toString = function () {
  10553. return this.version
  10554. }
  10555. SemVer.prototype.compare = function (other) {
  10556. debug('SemVer.compare', this.version, this.options, other)
  10557. if (!(other instanceof SemVer)) {
  10558. other = new SemVer(other, this.options)
  10559. }
  10560. return this.compareMain(other) || this.comparePre(other)
  10561. }
  10562. SemVer.prototype.compareMain = function (other) {
  10563. if (!(other instanceof SemVer)) {
  10564. other = new SemVer(other, this.options)
  10565. }
  10566. return compareIdentifiers(this.major, other.major) ||
  10567. compareIdentifiers(this.minor, other.minor) ||
  10568. compareIdentifiers(this.patch, other.patch)
  10569. }
  10570. SemVer.prototype.comparePre = function (other) {
  10571. if (!(other instanceof SemVer)) {
  10572. other = new SemVer(other, this.options)
  10573. }
  10574. // NOT having a prerelease is > having one
  10575. if (this.prerelease.length && !other.prerelease.length) {
  10576. return -1
  10577. } else if (!this.prerelease.length && other.prerelease.length) {
  10578. return 1
  10579. } else if (!this.prerelease.length && !other.prerelease.length) {
  10580. return 0
  10581. }
  10582. var i = 0
  10583. do {
  10584. var a = this.prerelease[i]
  10585. var b = other.prerelease[i]
  10586. debug('prerelease compare', i, a, b)
  10587. if (a === undefined && b === undefined) {
  10588. return 0
  10589. } else if (b === undefined) {
  10590. return 1
  10591. } else if (a === undefined) {
  10592. return -1
  10593. } else if (a === b) {
  10594. continue
  10595. } else {
  10596. return compareIdentifiers(a, b)
  10597. }
  10598. } while (++i)
  10599. }
  10600. SemVer.prototype.compareBuild = function (other) {
  10601. if (!(other instanceof SemVer)) {
  10602. other = new SemVer(other, this.options)
  10603. }
  10604. var i = 0
  10605. do {
  10606. var a = this.build[i]
  10607. var b = other.build[i]
  10608. debug('prerelease compare', i, a, b)
  10609. if (a === undefined && b === undefined) {
  10610. return 0
  10611. } else if (b === undefined) {
  10612. return 1
  10613. } else if (a === undefined) {
  10614. return -1
  10615. } else if (a === b) {
  10616. continue
  10617. } else {
  10618. return compareIdentifiers(a, b)
  10619. }
  10620. } while (++i)
  10621. }
  10622. // preminor will bump the version up to the next minor release, and immediately
  10623. // down to pre-release. premajor and prepatch work the same way.
  10624. SemVer.prototype.inc = function (release, identifier) {
  10625. switch (release) {
  10626. case 'premajor':
  10627. this.prerelease.length = 0
  10628. this.patch = 0
  10629. this.minor = 0
  10630. this.major++
  10631. this.inc('pre', identifier)
  10632. break
  10633. case 'preminor':
  10634. this.prerelease.length = 0
  10635. this.patch = 0
  10636. this.minor++
  10637. this.inc('pre', identifier)
  10638. break
  10639. case 'prepatch':
  10640. // If this is already a prerelease, it will bump to the next version
  10641. // drop any prereleases that might already exist, since they are not
  10642. // relevant at this point.
  10643. this.prerelease.length = 0
  10644. this.inc('patch', identifier)
  10645. this.inc('pre', identifier)
  10646. break
  10647. // If the input is a non-prerelease version, this acts the same as
  10648. // prepatch.
  10649. case 'prerelease':
  10650. if (this.prerelease.length === 0) {
  10651. this.inc('patch', identifier)
  10652. }
  10653. this.inc('pre', identifier)
  10654. break
  10655. case 'major':
  10656. // If this is a pre-major version, bump up to the same major version.
  10657. // Otherwise increment major.
  10658. // 1.0.0-5 bumps to 1.0.0
  10659. // 1.1.0 bumps to 2.0.0
  10660. if (this.minor !== 0 ||
  10661. this.patch !== 0 ||
  10662. this.prerelease.length === 0) {
  10663. this.major++
  10664. }
  10665. this.minor = 0
  10666. this.patch = 0
  10667. this.prerelease = []
  10668. break
  10669. case 'minor':
  10670. // If this is a pre-minor version, bump up to the same minor version.
  10671. // Otherwise increment minor.
  10672. // 1.2.0-5 bumps to 1.2.0
  10673. // 1.2.1 bumps to 1.3.0
  10674. if (this.patch !== 0 || this.prerelease.length === 0) {
  10675. this.minor++
  10676. }
  10677. this.patch = 0
  10678. this.prerelease = []
  10679. break
  10680. case 'patch':
  10681. // If this is not a pre-release version, it will increment the patch.
  10682. // If it is a pre-release it will bump up to the same patch version.
  10683. // 1.2.0-5 patches to 1.2.0
  10684. // 1.2.0 patches to 1.2.1
  10685. if (this.prerelease.length === 0) {
  10686. this.patch++
  10687. }
  10688. this.prerelease = []
  10689. break
  10690. // This probably shouldn't be used publicly.
  10691. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10692. case 'pre':
  10693. if (this.prerelease.length === 0) {
  10694. this.prerelease = [0]
  10695. } else {
  10696. var i = this.prerelease.length
  10697. while (--i >= 0) {
  10698. if (typeof this.prerelease[i] === 'number') {
  10699. this.prerelease[i]++
  10700. i = -2
  10701. }
  10702. }
  10703. if (i === -1) {
  10704. // didn't increment anything
  10705. this.prerelease.push(0)
  10706. }
  10707. }
  10708. if (identifier) {
  10709. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10710. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10711. if (this.prerelease[0] === identifier) {
  10712. if (isNaN(this.prerelease[1])) {
  10713. this.prerelease = [identifier, 0]
  10714. }
  10715. } else {
  10716. this.prerelease = [identifier, 0]
  10717. }
  10718. }
  10719. break
  10720. default:
  10721. throw new Error('invalid increment argument: ' + release)
  10722. }
  10723. this.format()
  10724. this.raw = this.version
  10725. return this
  10726. }
  10727. exports.inc = inc
  10728. function inc (version, release, loose, identifier) {
  10729. if (typeof (loose) === 'string') {
  10730. identifier = loose
  10731. loose = undefined
  10732. }
  10733. try {
  10734. return new SemVer(version, loose).inc(release, identifier).version
  10735. } catch (er) {
  10736. return null
  10737. }
  10738. }
  10739. exports.diff = diff
  10740. function diff (version1, version2) {
  10741. if (eq(version1, version2)) {
  10742. return null
  10743. } else {
  10744. var v1 = parse(version1)
  10745. var v2 = parse(version2)
  10746. var prefix = ''
  10747. if (v1.prerelease.length || v2.prerelease.length) {
  10748. prefix = 'pre'
  10749. var defaultResult = 'prerelease'
  10750. }
  10751. for (var key in v1) {
  10752. if (key === 'major' || key === 'minor' || key === 'patch') {
  10753. if (v1[key] !== v2[key]) {
  10754. return prefix + key
  10755. }
  10756. }
  10757. }
  10758. return defaultResult // may be undefined
  10759. }
  10760. }
  10761. exports.compareIdentifiers = compareIdentifiers
  10762. var numeric = /^[0-9]+$/
  10763. function compareIdentifiers (a, b) {
  10764. var anum = numeric.test(a)
  10765. var bnum = numeric.test(b)
  10766. if (anum && bnum) {
  10767. a = +a
  10768. b = +b
  10769. }
  10770. return a === b ? 0
  10771. : (anum && !bnum) ? -1
  10772. : (bnum && !anum) ? 1
  10773. : a < b ? -1
  10774. : 1
  10775. }
  10776. exports.rcompareIdentifiers = rcompareIdentifiers
  10777. function rcompareIdentifiers (a, b) {
  10778. return compareIdentifiers(b, a)
  10779. }
  10780. exports.major = major
  10781. function major (a, loose) {
  10782. return new SemVer(a, loose).major
  10783. }
  10784. exports.minor = minor
  10785. function minor (a, loose) {
  10786. return new SemVer(a, loose).minor
  10787. }
  10788. exports.patch = patch
  10789. function patch (a, loose) {
  10790. return new SemVer(a, loose).patch
  10791. }
  10792. exports.compare = compare
  10793. function compare (a, b, loose) {
  10794. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10795. }
  10796. exports.compareLoose = compareLoose
  10797. function compareLoose (a, b) {
  10798. return compare(a, b, true)
  10799. }
  10800. exports.compareBuild = compareBuild
  10801. function compareBuild (a, b, loose) {
  10802. var versionA = new SemVer(a, loose)
  10803. var versionB = new SemVer(b, loose)
  10804. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10805. }
  10806. exports.rcompare = rcompare
  10807. function rcompare (a, b, loose) {
  10808. return compare(b, a, loose)
  10809. }
  10810. exports.sort = sort
  10811. function sort (list, loose) {
  10812. return list.sort(function (a, b) {
  10813. return exports.compareBuild(a, b, loose)
  10814. })
  10815. }
  10816. exports.rsort = rsort
  10817. function rsort (list, loose) {
  10818. return list.sort(function (a, b) {
  10819. return exports.compareBuild(b, a, loose)
  10820. })
  10821. }
  10822. exports.gt = gt
  10823. function gt (a, b, loose) {
  10824. return compare(a, b, loose) > 0
  10825. }
  10826. exports.lt = lt
  10827. function lt (a, b, loose) {
  10828. return compare(a, b, loose) < 0
  10829. }
  10830. exports.eq = eq
  10831. function eq (a, b, loose) {
  10832. return compare(a, b, loose) === 0
  10833. }
  10834. exports.neq = neq
  10835. function neq (a, b, loose) {
  10836. return compare(a, b, loose) !== 0
  10837. }
  10838. exports.gte = gte
  10839. function gte (a, b, loose) {
  10840. return compare(a, b, loose) >= 0
  10841. }
  10842. exports.lte = lte
  10843. function lte (a, b, loose) {
  10844. return compare(a, b, loose) <= 0
  10845. }
  10846. exports.cmp = cmp
  10847. function cmp (a, op, b, loose) {
  10848. switch (op) {
  10849. case '===':
  10850. if (typeof a === 'object')
  10851. a = a.version
  10852. if (typeof b === 'object')
  10853. b = b.version
  10854. return a === b
  10855. case '!==':
  10856. if (typeof a === 'object')
  10857. a = a.version
  10858. if (typeof b === 'object')
  10859. b = b.version
  10860. return a !== b
  10861. case '':
  10862. case '=':
  10863. case '==':
  10864. return eq(a, b, loose)
  10865. case '!=':
  10866. return neq(a, b, loose)
  10867. case '>':
  10868. return gt(a, b, loose)
  10869. case '>=':
  10870. return gte(a, b, loose)
  10871. case '<':
  10872. return lt(a, b, loose)
  10873. case '<=':
  10874. return lte(a, b, loose)
  10875. default:
  10876. throw new TypeError('Invalid operator: ' + op)
  10877. }
  10878. }
  10879. exports.Comparator = Comparator
  10880. function Comparator (comp, options) {
  10881. if (!options || typeof options !== 'object') {
  10882. options = {
  10883. loose: !!options,
  10884. includePrerelease: false
  10885. }
  10886. }
  10887. if (comp instanceof Comparator) {
  10888. if (comp.loose === !!options.loose) {
  10889. return comp
  10890. } else {
  10891. comp = comp.value
  10892. }
  10893. }
  10894. if (!(this instanceof Comparator)) {
  10895. return new Comparator(comp, options)
  10896. }
  10897. debug('comparator', comp, options)
  10898. this.options = options
  10899. this.loose = !!options.loose
  10900. this.parse(comp)
  10901. if (this.semver === ANY) {
  10902. this.value = ''
  10903. } else {
  10904. this.value = this.operator + this.semver.version
  10905. }
  10906. debug('comp', this)
  10907. }
  10908. var ANY = {}
  10909. Comparator.prototype.parse = function (comp) {
  10910. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10911. var m = comp.match(r)
  10912. if (!m) {
  10913. throw new TypeError('Invalid comparator: ' + comp)
  10914. }
  10915. this.operator = m[1] !== undefined ? m[1] : ''
  10916. if (this.operator === '=') {
  10917. this.operator = ''
  10918. }
  10919. // if it literally is just '>' or '' then allow anything.
  10920. if (!m[2]) {
  10921. this.semver = ANY
  10922. } else {
  10923. this.semver = new SemVer(m[2], this.options.loose)
  10924. }
  10925. }
  10926. Comparator.prototype.toString = function () {
  10927. return this.value
  10928. }
  10929. Comparator.prototype.test = function (version) {
  10930. debug('Comparator.test', version, this.options.loose)
  10931. if (this.semver === ANY || version === ANY) {
  10932. return true
  10933. }
  10934. if (typeof version === 'string') {
  10935. try {
  10936. version = new SemVer(version, this.options)
  10937. } catch (er) {
  10938. return false
  10939. }
  10940. }
  10941. return cmp(version, this.operator, this.semver, this.options)
  10942. }
  10943. Comparator.prototype.intersects = function (comp, options) {
  10944. if (!(comp instanceof Comparator)) {
  10945. throw new TypeError('a Comparator is required')
  10946. }
  10947. if (!options || typeof options !== 'object') {
  10948. options = {
  10949. loose: !!options,
  10950. includePrerelease: false
  10951. }
  10952. }
  10953. var rangeTmp
  10954. if (this.operator === '') {
  10955. if (this.value === '') {
  10956. return true
  10957. }
  10958. rangeTmp = new Range(comp.value, options)
  10959. return satisfies(this.value, rangeTmp, options)
  10960. } else if (comp.operator === '') {
  10961. if (comp.value === '') {
  10962. return true
  10963. }
  10964. rangeTmp = new Range(this.value, options)
  10965. return satisfies(comp.semver, rangeTmp, options)
  10966. }
  10967. var sameDirectionIncreasing =
  10968. (this.operator === '>=' || this.operator === '>') &&
  10969. (comp.operator === '>=' || comp.operator === '>')
  10970. var sameDirectionDecreasing =
  10971. (this.operator === '<=' || this.operator === '<') &&
  10972. (comp.operator === '<=' || comp.operator === '<')
  10973. var sameSemVer = this.semver.version === comp.semver.version
  10974. var differentDirectionsInclusive =
  10975. (this.operator === '>=' || this.operator === '<=') &&
  10976. (comp.operator === '>=' || comp.operator === '<=')
  10977. var oppositeDirectionsLessThan =
  10978. cmp(this.semver, '<', comp.semver, options) &&
  10979. ((this.operator === '>=' || this.operator === '>') &&
  10980. (comp.operator === '<=' || comp.operator === '<'))
  10981. var oppositeDirectionsGreaterThan =
  10982. cmp(this.semver, '>', comp.semver, options) &&
  10983. ((this.operator === '<=' || this.operator === '<') &&
  10984. (comp.operator === '>=' || comp.operator === '>'))
  10985. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10986. (sameSemVer && differentDirectionsInclusive) ||
  10987. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10988. }
  10989. exports.Range = Range
  10990. function Range (range, options) {
  10991. if (!options || typeof options !== 'object') {
  10992. options = {
  10993. loose: !!options,
  10994. includePrerelease: false
  10995. }
  10996. }
  10997. if (range instanceof Range) {
  10998. if (range.loose === !!options.loose &&
  10999. range.includePrerelease === !!options.includePrerelease) {
  11000. return range
  11001. } else {
  11002. return new Range(range.raw, options)
  11003. }
  11004. }
  11005. if (range instanceof Comparator) {
  11006. return new Range(range.value, options)
  11007. }
  11008. if (!(this instanceof Range)) {
  11009. return new Range(range, options)
  11010. }
  11011. this.options = options
  11012. this.loose = !!options.loose
  11013. this.includePrerelease = !!options.includePrerelease
  11014. // First, split based on boolean or ||
  11015. this.raw = range
  11016. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11017. return this.parseRange(range.trim())
  11018. }, this).filter(function (c) {
  11019. // throw out any that are not relevant for whatever reason
  11020. return c.length
  11021. })
  11022. if (!this.set.length) {
  11023. throw new TypeError('Invalid SemVer Range: ' + range)
  11024. }
  11025. this.format()
  11026. }
  11027. Range.prototype.format = function () {
  11028. this.range = this.set.map(function (comps) {
  11029. return comps.join(' ').trim()
  11030. }).join('||').trim()
  11031. return this.range
  11032. }
  11033. Range.prototype.toString = function () {
  11034. return this.range
  11035. }
  11036. Range.prototype.parseRange = function (range) {
  11037. var loose = this.options.loose
  11038. range = range.trim()
  11039. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11040. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11041. range = range.replace(hr, hyphenReplace)
  11042. debug('hyphen replace', range)
  11043. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11044. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11045. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11046. // `~ 1.2.3` => `~1.2.3`
  11047. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11048. // `^ 1.2.3` => `^1.2.3`
  11049. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11050. // normalize spaces
  11051. range = range.split(/\s+/).join(' ')
  11052. // At this point, the range is completely trimmed and
  11053. // ready to be split into comparators.
  11054. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11055. var set = range.split(' ').map(function (comp) {
  11056. return parseComparator(comp, this.options)
  11057. }, this).join(' ').split(/\s+/)
  11058. if (this.options.loose) {
  11059. // in loose mode, throw out any that are not valid comparators
  11060. set = set.filter(function (comp) {
  11061. return !!comp.match(compRe)
  11062. })
  11063. }
  11064. set = set.map(function (comp) {
  11065. return new Comparator(comp, this.options)
  11066. }, this)
  11067. return set
  11068. }
  11069. Range.prototype.intersects = function (range, options) {
  11070. if (!(range instanceof Range)) {
  11071. throw new TypeError('a Range is required')
  11072. }
  11073. return this.set.some(function (thisComparators) {
  11074. return (
  11075. isSatisfiable(thisComparators, options) &&
  11076. range.set.some(function (rangeComparators) {
  11077. return (
  11078. isSatisfiable(rangeComparators, options) &&
  11079. thisComparators.every(function (thisComparator) {
  11080. return rangeComparators.every(function (rangeComparator) {
  11081. return thisComparator.intersects(rangeComparator, options)
  11082. })
  11083. })
  11084. )
  11085. })
  11086. )
  11087. })
  11088. }
  11089. // take a set of comparators and determine whether there
  11090. // exists a version which can satisfy it
  11091. function isSatisfiable (comparators, options) {
  11092. var result = true
  11093. var remainingComparators = comparators.slice()
  11094. var testComparator = remainingComparators.pop()
  11095. while (result && remainingComparators.length) {
  11096. result = remainingComparators.every(function (otherComparator) {
  11097. return testComparator.intersects(otherComparator, options)
  11098. })
  11099. testComparator = remainingComparators.pop()
  11100. }
  11101. return result
  11102. }
  11103. // Mostly just for testing and legacy API reasons
  11104. exports.toComparators = toComparators
  11105. function toComparators (range, options) {
  11106. return new Range(range, options).set.map(function (comp) {
  11107. return comp.map(function (c) {
  11108. return c.value
  11109. }).join(' ').trim().split(' ')
  11110. })
  11111. }
  11112. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11113. // already replaced the hyphen ranges
  11114. // turn into a set of JUST comparators.
  11115. function parseComparator (comp, options) {
  11116. debug('comp', comp, options)
  11117. comp = replaceCarets(comp, options)
  11118. debug('caret', comp)
  11119. comp = replaceTildes(comp, options)
  11120. debug('tildes', comp)
  11121. comp = replaceXRanges(comp, options)
  11122. debug('xrange', comp)
  11123. comp = replaceStars(comp, options)
  11124. debug('stars', comp)
  11125. return comp
  11126. }
  11127. function isX (id) {
  11128. return !id || id.toLowerCase() === 'x' || id === '*'
  11129. }
  11130. // ~, ~> --> * (any, kinda silly)
  11131. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11132. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11133. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11134. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11135. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11136. function replaceTildes (comp, options) {
  11137. return comp.trim().split(/\s+/).map(function (comp) {
  11138. return replaceTilde(comp, options)
  11139. }).join(' ')
  11140. }
  11141. function replaceTilde (comp, options) {
  11142. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11143. return comp.replace(r, function (_, M, m, p, pr) {
  11144. debug('tilde', comp, _, M, m, p, pr)
  11145. var ret
  11146. if (isX(M)) {
  11147. ret = ''
  11148. } else if (isX(m)) {
  11149. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11150. } else if (isX(p)) {
  11151. // ~1.2 == >=1.2.0 <1.3.0
  11152. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11153. } else if (pr) {
  11154. debug('replaceTilde pr', pr)
  11155. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11156. ' <' + M + '.' + (+m + 1) + '.0'
  11157. } else {
  11158. // ~1.2.3 == >=1.2.3 <1.3.0
  11159. ret = '>=' + M + '.' + m + '.' + p +
  11160. ' <' + M + '.' + (+m + 1) + '.0'
  11161. }
  11162. debug('tilde return', ret)
  11163. return ret
  11164. })
  11165. }
  11166. // ^ --> * (any, kinda silly)
  11167. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11168. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11169. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11170. // ^1.2.3 --> >=1.2.3 <2.0.0
  11171. // ^1.2.0 --> >=1.2.0 <2.0.0
  11172. function replaceCarets (comp, options) {
  11173. return comp.trim().split(/\s+/).map(function (comp) {
  11174. return replaceCaret(comp, options)
  11175. }).join(' ')
  11176. }
  11177. function replaceCaret (comp, options) {
  11178. debug('caret', comp, options)
  11179. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11180. return comp.replace(r, function (_, M, m, p, pr) {
  11181. debug('caret', comp, _, M, m, p, pr)
  11182. var ret
  11183. if (isX(M)) {
  11184. ret = ''
  11185. } else if (isX(m)) {
  11186. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11187. } else if (isX(p)) {
  11188. if (M === '0') {
  11189. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11190. } else {
  11191. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11192. }
  11193. } else if (pr) {
  11194. debug('replaceCaret pr', pr)
  11195. if (M === '0') {
  11196. if (m === '0') {
  11197. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11198. ' <' + M + '.' + m + '.' + (+p + 1)
  11199. } else {
  11200. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11201. ' <' + M + '.' + (+m + 1) + '.0'
  11202. }
  11203. } else {
  11204. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11205. ' <' + (+M + 1) + '.0.0'
  11206. }
  11207. } else {
  11208. debug('no pr')
  11209. if (M === '0') {
  11210. if (m === '0') {
  11211. ret = '>=' + M + '.' + m + '.' + p +
  11212. ' <' + M + '.' + m + '.' + (+p + 1)
  11213. } else {
  11214. ret = '>=' + M + '.' + m + '.' + p +
  11215. ' <' + M + '.' + (+m + 1) + '.0'
  11216. }
  11217. } else {
  11218. ret = '>=' + M + '.' + m + '.' + p +
  11219. ' <' + (+M + 1) + '.0.0'
  11220. }
  11221. }
  11222. debug('caret return', ret)
  11223. return ret
  11224. })
  11225. }
  11226. function replaceXRanges (comp, options) {
  11227. debug('replaceXRanges', comp, options)
  11228. return comp.split(/\s+/).map(function (comp) {
  11229. return replaceXRange(comp, options)
  11230. }).join(' ')
  11231. }
  11232. function replaceXRange (comp, options) {
  11233. comp = comp.trim()
  11234. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11235. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11236. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11237. var xM = isX(M)
  11238. var xm = xM || isX(m)
  11239. var xp = xm || isX(p)
  11240. var anyX = xp
  11241. if (gtlt === '=' && anyX) {
  11242. gtlt = ''
  11243. }
  11244. // if we're including prereleases in the match, then we need
  11245. // to fix this to -0, the lowest possible prerelease value
  11246. pr = options.includePrerelease ? '-0' : ''
  11247. if (xM) {
  11248. if (gtlt === '>' || gtlt === '<') {
  11249. // nothing is allowed
  11250. ret = '<0.0.0-0'
  11251. } else {
  11252. // nothing is forbidden
  11253. ret = '*'
  11254. }
  11255. } else if (gtlt && anyX) {
  11256. // we know patch is an x, because we have any x at all.
  11257. // replace X with 0
  11258. if (xm) {
  11259. m = 0
  11260. }
  11261. p = 0
  11262. if (gtlt === '>') {
  11263. // >1 => >=2.0.0
  11264. // >1.2 => >=1.3.0
  11265. // >1.2.3 => >= 1.2.4
  11266. gtlt = '>='
  11267. if (xm) {
  11268. M = +M + 1
  11269. m = 0
  11270. p = 0
  11271. } else {
  11272. m = +m + 1
  11273. p = 0
  11274. }
  11275. } else if (gtlt === '<=') {
  11276. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11277. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11278. gtlt = '<'
  11279. if (xm) {
  11280. M = +M + 1
  11281. } else {
  11282. m = +m + 1
  11283. }
  11284. }
  11285. ret = gtlt + M + '.' + m + '.' + p + pr
  11286. } else if (xm) {
  11287. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11288. } else if (xp) {
  11289. ret = '>=' + M + '.' + m + '.0' + pr +
  11290. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11291. }
  11292. debug('xRange return', ret)
  11293. return ret
  11294. })
  11295. }
  11296. // Because * is AND-ed with everything else in the comparator,
  11297. // and '' means "any version", just remove the *s entirely.
  11298. function replaceStars (comp, options) {
  11299. debug('replaceStars', comp, options)
  11300. // Looseness is ignored here. star is always as loose as it gets!
  11301. return comp.trim().replace(re[t.STAR], '')
  11302. }
  11303. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11304. // M, m, patch, prerelease, build
  11305. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11306. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11307. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11308. function hyphenReplace ($0,
  11309. from, fM, fm, fp, fpr, fb,
  11310. to, tM, tm, tp, tpr, tb) {
  11311. if (isX(fM)) {
  11312. from = ''
  11313. } else if (isX(fm)) {
  11314. from = '>=' + fM + '.0.0'
  11315. } else if (isX(fp)) {
  11316. from = '>=' + fM + '.' + fm + '.0'
  11317. } else {
  11318. from = '>=' + from
  11319. }
  11320. if (isX(tM)) {
  11321. to = ''
  11322. } else if (isX(tm)) {
  11323. to = '<' + (+tM + 1) + '.0.0'
  11324. } else if (isX(tp)) {
  11325. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11326. } else if (tpr) {
  11327. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11328. } else {
  11329. to = '<=' + to
  11330. }
  11331. return (from + ' ' + to).trim()
  11332. }
  11333. // if ANY of the sets match ALL of its comparators, then pass
  11334. Range.prototype.test = function (version) {
  11335. if (!version) {
  11336. return false
  11337. }
  11338. if (typeof version === 'string') {
  11339. try {
  11340. version = new SemVer(version, this.options)
  11341. } catch (er) {
  11342. return false
  11343. }
  11344. }
  11345. for (var i = 0; i < this.set.length; i++) {
  11346. if (testSet(this.set[i], version, this.options)) {
  11347. return true
  11348. }
  11349. }
  11350. return false
  11351. }
  11352. function testSet (set, version, options) {
  11353. for (var i = 0; i < set.length; i++) {
  11354. if (!set[i].test(version)) {
  11355. return false
  11356. }
  11357. }
  11358. if (version.prerelease.length && !options.includePrerelease) {
  11359. // Find the set of versions that are allowed to have prereleases
  11360. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11361. // That should allow `1.2.3-pr.2` to pass.
  11362. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11363. // even though it's within the range set by the comparators.
  11364. for (i = 0; i < set.length; i++) {
  11365. debug(set[i].semver)
  11366. if (set[i].semver === ANY) {
  11367. continue
  11368. }
  11369. if (set[i].semver.prerelease.length > 0) {
  11370. var allowed = set[i].semver
  11371. if (allowed.major === version.major &&
  11372. allowed.minor === version.minor &&
  11373. allowed.patch === version.patch) {
  11374. return true
  11375. }
  11376. }
  11377. }
  11378. // Version has a -pre, but it's not one of the ones we like.
  11379. return false
  11380. }
  11381. return true
  11382. }
  11383. exports.satisfies = satisfies
  11384. function satisfies (version, range, options) {
  11385. try {
  11386. range = new Range(range, options)
  11387. } catch (er) {
  11388. return false
  11389. }
  11390. return range.test(version)
  11391. }
  11392. exports.maxSatisfying = maxSatisfying
  11393. function maxSatisfying (versions, range, options) {
  11394. var max = null
  11395. var maxSV = null
  11396. try {
  11397. var rangeObj = new Range(range, options)
  11398. } catch (er) {
  11399. return null
  11400. }
  11401. versions.forEach(function (v) {
  11402. if (rangeObj.test(v)) {
  11403. // satisfies(v, range, options)
  11404. if (!max || maxSV.compare(v) === -1) {
  11405. // compare(max, v, true)
  11406. max = v
  11407. maxSV = new SemVer(max, options)
  11408. }
  11409. }
  11410. })
  11411. return max
  11412. }
  11413. exports.minSatisfying = minSatisfying
  11414. function minSatisfying (versions, range, options) {
  11415. var min = null
  11416. var minSV = null
  11417. try {
  11418. var rangeObj = new Range(range, options)
  11419. } catch (er) {
  11420. return null
  11421. }
  11422. versions.forEach(function (v) {
  11423. if (rangeObj.test(v)) {
  11424. // satisfies(v, range, options)
  11425. if (!min || minSV.compare(v) === 1) {
  11426. // compare(min, v, true)
  11427. min = v
  11428. minSV = new SemVer(min, options)
  11429. }
  11430. }
  11431. })
  11432. return min
  11433. }
  11434. exports.minVersion = minVersion
  11435. function minVersion (range, loose) {
  11436. range = new Range(range, loose)
  11437. var minver = new SemVer('0.0.0')
  11438. if (range.test(minver)) {
  11439. return minver
  11440. }
  11441. minver = new SemVer('0.0.0-0')
  11442. if (range.test(minver)) {
  11443. return minver
  11444. }
  11445. minver = null
  11446. for (var i = 0; i < range.set.length; ++i) {
  11447. var comparators = range.set[i]
  11448. comparators.forEach(function (comparator) {
  11449. // Clone to avoid manipulating the comparator's semver object.
  11450. var compver = new SemVer(comparator.semver.version)
  11451. switch (comparator.operator) {
  11452. case '>':
  11453. if (compver.prerelease.length === 0) {
  11454. compver.patch++
  11455. } else {
  11456. compver.prerelease.push(0)
  11457. }
  11458. compver.raw = compver.format()
  11459. /* fallthrough */
  11460. case '':
  11461. case '>=':
  11462. if (!minver || gt(minver, compver)) {
  11463. minver = compver
  11464. }
  11465. break
  11466. case '<':
  11467. case '<=':
  11468. /* Ignore maximum versions */
  11469. break
  11470. /* istanbul ignore next */
  11471. default:
  11472. throw new Error('Unexpected operation: ' + comparator.operator)
  11473. }
  11474. })
  11475. }
  11476. if (minver && range.test(minver)) {
  11477. return minver
  11478. }
  11479. return null
  11480. }
  11481. exports.validRange = validRange
  11482. function validRange (range, options) {
  11483. try {
  11484. // Return '*' instead of '' so that truthiness works.
  11485. // This will throw if it's invalid anyway
  11486. return new Range(range, options).range || '*'
  11487. } catch (er) {
  11488. return null
  11489. }
  11490. }
  11491. // Determine if version is less than all the versions possible in the range
  11492. exports.ltr = ltr
  11493. function ltr (version, range, options) {
  11494. return outside(version, range, '<', options)
  11495. }
  11496. // Determine if version is greater than all the versions possible in the range.
  11497. exports.gtr = gtr
  11498. function gtr (version, range, options) {
  11499. return outside(version, range, '>', options)
  11500. }
  11501. exports.outside = outside
  11502. function outside (version, range, hilo, options) {
  11503. version = new SemVer(version, options)
  11504. range = new Range(range, options)
  11505. var gtfn, ltefn, ltfn, comp, ecomp
  11506. switch (hilo) {
  11507. case '>':
  11508. gtfn = gt
  11509. ltefn = lte
  11510. ltfn = lt
  11511. comp = '>'
  11512. ecomp = '>='
  11513. break
  11514. case '<':
  11515. gtfn = lt
  11516. ltefn = gte
  11517. ltfn = gt
  11518. comp = '<'
  11519. ecomp = '<='
  11520. break
  11521. default:
  11522. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11523. }
  11524. // If it satisifes the range it is not outside
  11525. if (satisfies(version, range, options)) {
  11526. return false
  11527. }
  11528. // From now on, variable terms are as if we're in "gtr" mode.
  11529. // but note that everything is flipped for the "ltr" function.
  11530. for (var i = 0; i < range.set.length; ++i) {
  11531. var comparators = range.set[i]
  11532. var high = null
  11533. var low = null
  11534. comparators.forEach(function (comparator) {
  11535. if (comparator.semver === ANY) {
  11536. comparator = new Comparator('>=0.0.0')
  11537. }
  11538. high = high || comparator
  11539. low = low || comparator
  11540. if (gtfn(comparator.semver, high.semver, options)) {
  11541. high = comparator
  11542. } else if (ltfn(comparator.semver, low.semver, options)) {
  11543. low = comparator
  11544. }
  11545. })
  11546. // If the edge version comparator has a operator then our version
  11547. // isn't outside it
  11548. if (high.operator === comp || high.operator === ecomp) {
  11549. return false
  11550. }
  11551. // If the lowest version comparator has an operator and our version
  11552. // is less than it then it isn't higher than the range
  11553. if ((!low.operator || low.operator === comp) &&
  11554. ltefn(version, low.semver)) {
  11555. return false
  11556. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11557. return false
  11558. }
  11559. }
  11560. return true
  11561. }
  11562. exports.prerelease = prerelease
  11563. function prerelease (version, options) {
  11564. var parsed = parse(version, options)
  11565. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11566. }
  11567. exports.intersects = intersects
  11568. function intersects (r1, r2, options) {
  11569. r1 = new Range(r1, options)
  11570. r2 = new Range(r2, options)
  11571. return r1.intersects(r2)
  11572. }
  11573. exports.coerce = coerce
  11574. function coerce (version, options) {
  11575. if (version instanceof SemVer) {
  11576. return version
  11577. }
  11578. if (typeof version === 'number') {
  11579. version = String(version)
  11580. }
  11581. if (typeof version !== 'string') {
  11582. return null
  11583. }
  11584. options = options || {}
  11585. var match = null
  11586. if (!options.rtl) {
  11587. match = version.match(re[t.COERCE])
  11588. } else {
  11589. // Find the right-most coercible string that does not share
  11590. // a terminus with a more left-ward coercible string.
  11591. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11592. //
  11593. // Walk through the string checking with a /g regexp
  11594. // Manually set the index so as to pick up overlapping matches.
  11595. // Stop when we get a match that ends at the string end, since no
  11596. // coercible string can be more right-ward without the same terminus.
  11597. var next
  11598. while ((next = re[t.COERCERTL].exec(version)) &&
  11599. (!match || match.index + match[0].length !== version.length)
  11600. ) {
  11601. if (!match ||
  11602. next.index + next[0].length !== match.index + match[0].length) {
  11603. match = next
  11604. }
  11605. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11606. }
  11607. // leave it in a clean state
  11608. re[t.COERCERTL].lastIndex = -1
  11609. }
  11610. if (match === null) {
  11611. return null
  11612. }
  11613. return parse(match[2] +
  11614. '.' + (match[3] || '0') +
  11615. '.' + (match[4] || '0'), options)
  11616. }
  11617. /***/ }),
  11618. /***/ 669:
  11619. /***/ (function(module) {
  11620. module.exports = require("util");
  11621. /***/ }),
  11622. /***/ 672:
  11623. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11624. "use strict";
  11625. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11626. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11627. return new (P || (P = Promise))(function (resolve, reject) {
  11628. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11629. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11630. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11631. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11632. });
  11633. };
  11634. var _a;
  11635. Object.defineProperty(exports, "__esModule", { value: true });
  11636. const assert_1 = __webpack_require__(357);
  11637. const fs = __webpack_require__(747);
  11638. const path = __webpack_require__(622);
  11639. _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;
  11640. exports.IS_WINDOWS = process.platform === 'win32';
  11641. function exists(fsPath) {
  11642. return __awaiter(this, void 0, void 0, function* () {
  11643. try {
  11644. yield exports.stat(fsPath);
  11645. }
  11646. catch (err) {
  11647. if (err.code === 'ENOENT') {
  11648. return false;
  11649. }
  11650. throw err;
  11651. }
  11652. return true;
  11653. });
  11654. }
  11655. exports.exists = exists;
  11656. function isDirectory(fsPath, useStat = false) {
  11657. return __awaiter(this, void 0, void 0, function* () {
  11658. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11659. return stats.isDirectory();
  11660. });
  11661. }
  11662. exports.isDirectory = isDirectory;
  11663. /**
  11664. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11665. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11666. */
  11667. function isRooted(p) {
  11668. p = normalizeSeparators(p);
  11669. if (!p) {
  11670. throw new Error('isRooted() parameter "p" cannot be empty');
  11671. }
  11672. if (exports.IS_WINDOWS) {
  11673. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11674. ); // e.g. C: or C:\hello
  11675. }
  11676. return p.startsWith('/');
  11677. }
  11678. exports.isRooted = isRooted;
  11679. /**
  11680. * Recursively create a directory at `fsPath`.
  11681. *
  11682. * This implementation is optimistic, meaning it attempts to create the full
  11683. * path first, and backs up the path stack from there.
  11684. *
  11685. * @param fsPath The path to create
  11686. * @param maxDepth The maximum recursion depth
  11687. * @param depth The current recursion depth
  11688. */
  11689. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11690. return __awaiter(this, void 0, void 0, function* () {
  11691. assert_1.ok(fsPath, 'a path argument must be provided');
  11692. fsPath = path.resolve(fsPath);
  11693. if (depth >= maxDepth)
  11694. return exports.mkdir(fsPath);
  11695. try {
  11696. yield exports.mkdir(fsPath);
  11697. return;
  11698. }
  11699. catch (err) {
  11700. switch (err.code) {
  11701. case 'ENOENT': {
  11702. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11703. yield exports.mkdir(fsPath);
  11704. return;
  11705. }
  11706. default: {
  11707. let stats;
  11708. try {
  11709. stats = yield exports.stat(fsPath);
  11710. }
  11711. catch (err2) {
  11712. throw err;
  11713. }
  11714. if (!stats.isDirectory())
  11715. throw err;
  11716. }
  11717. }
  11718. }
  11719. });
  11720. }
  11721. exports.mkdirP = mkdirP;
  11722. /**
  11723. * Best effort attempt to determine whether a file exists and is executable.
  11724. * @param filePath file path to check
  11725. * @param extensions additional file extensions to try
  11726. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11727. */
  11728. function tryGetExecutablePath(filePath, extensions) {
  11729. return __awaiter(this, void 0, void 0, function* () {
  11730. let stats = undefined;
  11731. try {
  11732. // test file exists
  11733. stats = yield exports.stat(filePath);
  11734. }
  11735. catch (err) {
  11736. if (err.code !== 'ENOENT') {
  11737. // eslint-disable-next-line no-console
  11738. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11739. }
  11740. }
  11741. if (stats && stats.isFile()) {
  11742. if (exports.IS_WINDOWS) {
  11743. // on Windows, test for valid extension
  11744. const upperExt = path.extname(filePath).toUpperCase();
  11745. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11746. return filePath;
  11747. }
  11748. }
  11749. else {
  11750. if (isUnixExecutable(stats)) {
  11751. return filePath;
  11752. }
  11753. }
  11754. }
  11755. // try each extension
  11756. const originalFilePath = filePath;
  11757. for (const extension of extensions) {
  11758. filePath = originalFilePath + extension;
  11759. stats = undefined;
  11760. try {
  11761. stats = yield exports.stat(filePath);
  11762. }
  11763. catch (err) {
  11764. if (err.code !== 'ENOENT') {
  11765. // eslint-disable-next-line no-console
  11766. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11767. }
  11768. }
  11769. if (stats && stats.isFile()) {
  11770. if (exports.IS_WINDOWS) {
  11771. // preserve the case of the actual file (since an extension was appended)
  11772. try {
  11773. const directory = path.dirname(filePath);
  11774. const upperName = path.basename(filePath).toUpperCase();
  11775. for (const actualName of yield exports.readdir(directory)) {
  11776. if (upperName === actualName.toUpperCase()) {
  11777. filePath = path.join(directory, actualName);
  11778. break;
  11779. }
  11780. }
  11781. }
  11782. catch (err) {
  11783. // eslint-disable-next-line no-console
  11784. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11785. }
  11786. return filePath;
  11787. }
  11788. else {
  11789. if (isUnixExecutable(stats)) {
  11790. return filePath;
  11791. }
  11792. }
  11793. }
  11794. }
  11795. return '';
  11796. });
  11797. }
  11798. exports.tryGetExecutablePath = tryGetExecutablePath;
  11799. function normalizeSeparators(p) {
  11800. p = p || '';
  11801. if (exports.IS_WINDOWS) {
  11802. // convert slashes on Windows
  11803. p = p.replace(/\//g, '\\');
  11804. // remove redundant slashes
  11805. return p.replace(/\\\\+/g, '\\');
  11806. }
  11807. // remove redundant slashes
  11808. return p.replace(/\/\/+/g, '/');
  11809. }
  11810. // on Mac/Linux, test the execute bit
  11811. // R W X R W X R W X
  11812. // 256 128 64 32 16 8 4 2 1
  11813. function isUnixExecutable(stats) {
  11814. return ((stats.mode & 1) > 0 ||
  11815. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11816. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11817. }
  11818. //# sourceMappingURL=io-util.js.map
  11819. /***/ }),
  11820. /***/ 674:
  11821. /***/ (function(module, __unusedexports, __webpack_require__) {
  11822. module.exports = authenticate;
  11823. const { Deprecation } = __webpack_require__(692);
  11824. const once = __webpack_require__(969);
  11825. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11826. function authenticate(state, options) {
  11827. deprecateAuthenticate(
  11828. state.octokit.log,
  11829. new Deprecation(
  11830. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11831. )
  11832. );
  11833. if (!options) {
  11834. state.auth = false;
  11835. return;
  11836. }
  11837. switch (options.type) {
  11838. case "basic":
  11839. if (!options.username || !options.password) {
  11840. throw new Error(
  11841. "Basic authentication requires both a username and password to be set"
  11842. );
  11843. }
  11844. break;
  11845. case "oauth":
  11846. if (!options.token && !(options.key && options.secret)) {
  11847. throw new Error(
  11848. "OAuth2 authentication requires a token or key & secret to be set"
  11849. );
  11850. }
  11851. break;
  11852. case "token":
  11853. case "app":
  11854. if (!options.token) {
  11855. throw new Error("Token authentication requires a token to be set");
  11856. }
  11857. break;
  11858. default:
  11859. throw new Error(
  11860. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11861. );
  11862. }
  11863. state.auth = options;
  11864. }
  11865. /***/ }),
  11866. /***/ 675:
  11867. /***/ (function(module) {
  11868. module.exports = function btoa(str) {
  11869. return new Buffer(str).toString('base64')
  11870. }
  11871. /***/ }),
  11872. /***/ 692:
  11873. /***/ (function(__unusedmodule, exports) {
  11874. "use strict";
  11875. Object.defineProperty(exports, '__esModule', { value: true });
  11876. class Deprecation extends Error {
  11877. constructor(message) {
  11878. super(message); // Maintains proper stack trace (only available on V8)
  11879. /* istanbul ignore next */
  11880. if (Error.captureStackTrace) {
  11881. Error.captureStackTrace(this, this.constructor);
  11882. }
  11883. this.name = 'Deprecation';
  11884. }
  11885. }
  11886. exports.Deprecation = Deprecation;
  11887. /***/ }),
  11888. /***/ 696:
  11889. /***/ (function(module) {
  11890. "use strict";
  11891. /*!
  11892. * isobject <https://github.com/jonschlinkert/isobject>
  11893. *
  11894. * Copyright (c) 2014-2017, Jon Schlinkert.
  11895. * Released under the MIT License.
  11896. */
  11897. function isObject(val) {
  11898. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11899. }
  11900. /*!
  11901. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11902. *
  11903. * Copyright (c) 2014-2017, Jon Schlinkert.
  11904. * Released under the MIT License.
  11905. */
  11906. function isObjectObject(o) {
  11907. return isObject(o) === true
  11908. && Object.prototype.toString.call(o) === '[object Object]';
  11909. }
  11910. function isPlainObject(o) {
  11911. var ctor,prot;
  11912. if (isObjectObject(o) === false) return false;
  11913. // If has modified constructor
  11914. ctor = o.constructor;
  11915. if (typeof ctor !== 'function') return false;
  11916. // If has modified prototype
  11917. prot = ctor.prototype;
  11918. if (isObjectObject(prot) === false) return false;
  11919. // If constructor does not have an Object-specific method
  11920. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11921. return false;
  11922. }
  11923. // Most likely a plain Object
  11924. return true;
  11925. }
  11926. module.exports = isPlainObject;
  11927. /***/ }),
  11928. /***/ 697:
  11929. /***/ (function(module) {
  11930. "use strict";
  11931. module.exports = (promise, onFinally) => {
  11932. onFinally = onFinally || (() => {});
  11933. return promise.then(
  11934. val => new Promise(resolve => {
  11935. resolve(onFinally());
  11936. }).then(() => val),
  11937. err => new Promise(resolve => {
  11938. resolve(onFinally());
  11939. }).then(() => {
  11940. throw err;
  11941. })
  11942. );
  11943. };
  11944. /***/ }),
  11945. /***/ 722:
  11946. /***/ (function(module) {
  11947. /**
  11948. * Convert array of 16 byte values to UUID string format of the form:
  11949. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11950. */
  11951. var byteToHex = [];
  11952. for (var i = 0; i < 256; ++i) {
  11953. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11954. }
  11955. function bytesToUuid(buf, offset) {
  11956. var i = offset || 0;
  11957. var bth = byteToHex;
  11958. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11959. return ([bth[buf[i++]], bth[buf[i++]],
  11960. bth[buf[i++]], bth[buf[i++]], '-',
  11961. bth[buf[i++]], bth[buf[i++]], '-',
  11962. bth[buf[i++]], bth[buf[i++]], '-',
  11963. bth[buf[i++]], bth[buf[i++]], '-',
  11964. bth[buf[i++]], bth[buf[i++]],
  11965. bth[buf[i++]], bth[buf[i++]],
  11966. bth[buf[i++]], bth[buf[i++]]]).join('');
  11967. }
  11968. module.exports = bytesToUuid;
  11969. /***/ }),
  11970. /***/ 742:
  11971. /***/ (function(module, __unusedexports, __webpack_require__) {
  11972. var fs = __webpack_require__(747)
  11973. var core
  11974. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11975. core = __webpack_require__(818)
  11976. } else {
  11977. core = __webpack_require__(197)
  11978. }
  11979. module.exports = isexe
  11980. isexe.sync = sync
  11981. function isexe (path, options, cb) {
  11982. if (typeof options === 'function') {
  11983. cb = options
  11984. options = {}
  11985. }
  11986. if (!cb) {
  11987. if (typeof Promise !== 'function') {
  11988. throw new TypeError('callback not provided')
  11989. }
  11990. return new Promise(function (resolve, reject) {
  11991. isexe(path, options || {}, function (er, is) {
  11992. if (er) {
  11993. reject(er)
  11994. } else {
  11995. resolve(is)
  11996. }
  11997. })
  11998. })
  11999. }
  12000. core(path, options || {}, function (er, is) {
  12001. // ignore EACCES because that just means we aren't allowed to run it
  12002. if (er) {
  12003. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12004. er = null
  12005. is = false
  12006. }
  12007. }
  12008. cb(er, is)
  12009. })
  12010. }
  12011. function sync (path, options) {
  12012. // my kingdom for a filtered catch
  12013. try {
  12014. return core.sync(path, options || {})
  12015. } catch (er) {
  12016. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12017. return false
  12018. } else {
  12019. throw er
  12020. }
  12021. }
  12022. }
  12023. /***/ }),
  12024. /***/ 747:
  12025. /***/ (function(module) {
  12026. module.exports = require("fs");
  12027. /***/ }),
  12028. /***/ 753:
  12029. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12030. "use strict";
  12031. Object.defineProperty(exports, '__esModule', { value: true });
  12032. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12033. var endpoint = __webpack_require__(385);
  12034. var universalUserAgent = __webpack_require__(211);
  12035. var isPlainObject = _interopDefault(__webpack_require__(696));
  12036. var nodeFetch = _interopDefault(__webpack_require__(454));
  12037. var requestError = __webpack_require__(463);
  12038. const VERSION = "5.4.2";
  12039. function getBufferResponse(response) {
  12040. return response.arrayBuffer();
  12041. }
  12042. function fetchWrapper(requestOptions) {
  12043. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12044. requestOptions.body = JSON.stringify(requestOptions.body);
  12045. }
  12046. let headers = {};
  12047. let status;
  12048. let url;
  12049. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12050. return fetch(requestOptions.url, Object.assign({
  12051. method: requestOptions.method,
  12052. body: requestOptions.body,
  12053. headers: requestOptions.headers,
  12054. redirect: requestOptions.redirect
  12055. }, requestOptions.request)).then(response => {
  12056. url = response.url;
  12057. status = response.status;
  12058. for (const keyAndValue of response.headers) {
  12059. headers[keyAndValue[0]] = keyAndValue[1];
  12060. }
  12061. if (status === 204 || status === 205) {
  12062. return;
  12063. } // GitHub API returns 200 for HEAD requests
  12064. if (requestOptions.method === "HEAD") {
  12065. if (status < 400) {
  12066. return;
  12067. }
  12068. throw new requestError.RequestError(response.statusText, status, {
  12069. headers,
  12070. request: requestOptions
  12071. });
  12072. }
  12073. if (status === 304) {
  12074. throw new requestError.RequestError("Not modified", status, {
  12075. headers,
  12076. request: requestOptions
  12077. });
  12078. }
  12079. if (status >= 400) {
  12080. return response.text().then(message => {
  12081. const error = new requestError.RequestError(message, status, {
  12082. headers,
  12083. request: requestOptions
  12084. });
  12085. try {
  12086. let responseBody = JSON.parse(error.message);
  12087. Object.assign(error, responseBody);
  12088. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12089. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12090. } catch (e) {// ignore, see octokit/rest.js#684
  12091. }
  12092. throw error;
  12093. });
  12094. }
  12095. const contentType = response.headers.get("content-type");
  12096. if (/application\/json/.test(contentType)) {
  12097. return response.json();
  12098. }
  12099. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12100. return response.text();
  12101. }
  12102. return getBufferResponse(response);
  12103. }).then(data => {
  12104. return {
  12105. status,
  12106. url,
  12107. headers,
  12108. data
  12109. };
  12110. }).catch(error => {
  12111. if (error instanceof requestError.RequestError) {
  12112. throw error;
  12113. }
  12114. throw new requestError.RequestError(error.message, 500, {
  12115. headers,
  12116. request: requestOptions
  12117. });
  12118. });
  12119. }
  12120. function withDefaults(oldEndpoint, newDefaults) {
  12121. const endpoint = oldEndpoint.defaults(newDefaults);
  12122. const newApi = function (route, parameters) {
  12123. const endpointOptions = endpoint.merge(route, parameters);
  12124. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12125. return fetchWrapper(endpoint.parse(endpointOptions));
  12126. }
  12127. const request = (route, parameters) => {
  12128. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12129. };
  12130. Object.assign(request, {
  12131. endpoint,
  12132. defaults: withDefaults.bind(null, endpoint)
  12133. });
  12134. return endpointOptions.request.hook(request, endpointOptions);
  12135. };
  12136. return Object.assign(newApi, {
  12137. endpoint,
  12138. defaults: withDefaults.bind(null, endpoint)
  12139. });
  12140. }
  12141. const request = withDefaults(endpoint.endpoint, {
  12142. headers: {
  12143. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12144. }
  12145. });
  12146. exports.request = request;
  12147. //# sourceMappingURL=index.js.map
  12148. /***/ }),
  12149. /***/ 761:
  12150. /***/ (function(module) {
  12151. module.exports = require("zlib");
  12152. /***/ }),
  12153. /***/ 763:
  12154. /***/ (function(module) {
  12155. module.exports = removeHook
  12156. function removeHook (state, name, method) {
  12157. if (!state.registry[name]) {
  12158. return
  12159. }
  12160. var index = state.registry[name]
  12161. .map(function (registered) { return registered.orig })
  12162. .indexOf(method)
  12163. if (index === -1) {
  12164. return
  12165. }
  12166. state.registry[name].splice(index, 1)
  12167. }
  12168. /***/ }),
  12169. /***/ 768:
  12170. /***/ (function(module) {
  12171. "use strict";
  12172. module.exports = function (x) {
  12173. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12174. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12175. if (x[x.length - 1] === lf) {
  12176. x = x.slice(0, x.length - 1);
  12177. }
  12178. if (x[x.length - 1] === cr) {
  12179. x = x.slice(0, x.length - 1);
  12180. }
  12181. return x;
  12182. };
  12183. /***/ }),
  12184. /***/ 777:
  12185. /***/ (function(module, __unusedexports, __webpack_require__) {
  12186. module.exports = getFirstPage
  12187. const getPage = __webpack_require__(265)
  12188. function getFirstPage (octokit, link, headers) {
  12189. return getPage(octokit, link, 'first', headers)
  12190. }
  12191. /***/ }),
  12192. /***/ 796:
  12193. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12194. "use strict";
  12195. Object.defineProperty(exports, '__esModule', { value: true });
  12196. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12197. var osName = _interopDefault(__webpack_require__(2));
  12198. function getUserAgent() {
  12199. try {
  12200. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12201. } catch (error) {
  12202. if (/wmic os get Caption/.test(error.message)) {
  12203. return "Windows <version undetectable>";
  12204. }
  12205. throw error;
  12206. }
  12207. }
  12208. exports.getUserAgent = getUserAgent;
  12209. //# sourceMappingURL=index.js.map
  12210. /***/ }),
  12211. /***/ 813:
  12212. /***/ (function(__unusedmodule, exports) {
  12213. "use strict";
  12214. Object.defineProperty(exports, '__esModule', { value: true });
  12215. async function auth(token) {
  12216. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12217. return {
  12218. type: "token",
  12219. token: token,
  12220. tokenType
  12221. };
  12222. }
  12223. /**
  12224. * Prefix token for usage in the Authorization header
  12225. *
  12226. * @param token OAuth token or JSON Web Token
  12227. */
  12228. function withAuthorizationPrefix(token) {
  12229. if (token.split(/\./).length === 3) {
  12230. return `bearer ${token}`;
  12231. }
  12232. return `token ${token}`;
  12233. }
  12234. async function hook(token, request, route, parameters) {
  12235. const endpoint = request.endpoint.merge(route, parameters);
  12236. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12237. return request(endpoint);
  12238. }
  12239. const createTokenAuth = function createTokenAuth(token) {
  12240. if (!token) {
  12241. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12242. }
  12243. if (typeof token !== "string") {
  12244. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12245. }
  12246. token = token.replace(/^(token|bearer) +/i, "");
  12247. return Object.assign(auth.bind(null, token), {
  12248. hook: hook.bind(null, token)
  12249. });
  12250. };
  12251. exports.createTokenAuth = createTokenAuth;
  12252. //# sourceMappingURL=index.js.map
  12253. /***/ }),
  12254. /***/ 814:
  12255. /***/ (function(module, __unusedexports, __webpack_require__) {
  12256. module.exports = which
  12257. which.sync = whichSync
  12258. var isWindows = process.platform === 'win32' ||
  12259. process.env.OSTYPE === 'cygwin' ||
  12260. process.env.OSTYPE === 'msys'
  12261. var path = __webpack_require__(622)
  12262. var COLON = isWindows ? ';' : ':'
  12263. var isexe = __webpack_require__(742)
  12264. function getNotFoundError (cmd) {
  12265. var er = new Error('not found: ' + cmd)
  12266. er.code = 'ENOENT'
  12267. return er
  12268. }
  12269. function getPathInfo (cmd, opt) {
  12270. var colon = opt.colon || COLON
  12271. var pathEnv = opt.path || process.env.PATH || ''
  12272. var pathExt = ['']
  12273. pathEnv = pathEnv.split(colon)
  12274. var pathExtExe = ''
  12275. if (isWindows) {
  12276. pathEnv.unshift(process.cwd())
  12277. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12278. pathExt = pathExtExe.split(colon)
  12279. // Always test the cmd itself first. isexe will check to make sure
  12280. // it's found in the pathExt set.
  12281. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12282. pathExt.unshift('')
  12283. }
  12284. // If it has a slash, then we don't bother searching the pathenv.
  12285. // just check the file itself, and that's it.
  12286. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12287. pathEnv = ['']
  12288. return {
  12289. env: pathEnv,
  12290. ext: pathExt,
  12291. extExe: pathExtExe
  12292. }
  12293. }
  12294. function which (cmd, opt, cb) {
  12295. if (typeof opt === 'function') {
  12296. cb = opt
  12297. opt = {}
  12298. }
  12299. var info = getPathInfo(cmd, opt)
  12300. var pathEnv = info.env
  12301. var pathExt = info.ext
  12302. var pathExtExe = info.extExe
  12303. var found = []
  12304. ;(function F (i, l) {
  12305. if (i === l) {
  12306. if (opt.all && found.length)
  12307. return cb(null, found)
  12308. else
  12309. return cb(getNotFoundError(cmd))
  12310. }
  12311. var pathPart = pathEnv[i]
  12312. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12313. pathPart = pathPart.slice(1, -1)
  12314. var p = path.join(pathPart, cmd)
  12315. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12316. p = cmd.slice(0, 2) + p
  12317. }
  12318. ;(function E (ii, ll) {
  12319. if (ii === ll) return F(i + 1, l)
  12320. var ext = pathExt[ii]
  12321. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12322. if (!er && is) {
  12323. if (opt.all)
  12324. found.push(p + ext)
  12325. else
  12326. return cb(null, p + ext)
  12327. }
  12328. return E(ii + 1, ll)
  12329. })
  12330. })(0, pathExt.length)
  12331. })(0, pathEnv.length)
  12332. }
  12333. function whichSync (cmd, opt) {
  12334. opt = opt || {}
  12335. var info = getPathInfo(cmd, opt)
  12336. var pathEnv = info.env
  12337. var pathExt = info.ext
  12338. var pathExtExe = info.extExe
  12339. var found = []
  12340. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12341. var pathPart = pathEnv[i]
  12342. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12343. pathPart = pathPart.slice(1, -1)
  12344. var p = path.join(pathPart, cmd)
  12345. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12346. p = cmd.slice(0, 2) + p
  12347. }
  12348. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12349. var cur = p + pathExt[j]
  12350. var is
  12351. try {
  12352. is = isexe.sync(cur, { pathExt: pathExtExe })
  12353. if (is) {
  12354. if (opt.all)
  12355. found.push(cur)
  12356. else
  12357. return cur
  12358. }
  12359. } catch (ex) {}
  12360. }
  12361. }
  12362. if (opt.all && found.length)
  12363. return found
  12364. if (opt.nothrow)
  12365. return null
  12366. throw getNotFoundError(cmd)
  12367. }
  12368. /***/ }),
  12369. /***/ 816:
  12370. /***/ (function(module) {
  12371. "use strict";
  12372. module.exports = /^#!.*/;
  12373. /***/ }),
  12374. /***/ 818:
  12375. /***/ (function(module, __unusedexports, __webpack_require__) {
  12376. module.exports = isexe
  12377. isexe.sync = sync
  12378. var fs = __webpack_require__(747)
  12379. function checkPathExt (path, options) {
  12380. var pathext = options.pathExt !== undefined ?
  12381. options.pathExt : process.env.PATHEXT
  12382. if (!pathext) {
  12383. return true
  12384. }
  12385. pathext = pathext.split(';')
  12386. if (pathext.indexOf('') !== -1) {
  12387. return true
  12388. }
  12389. for (var i = 0; i < pathext.length; i++) {
  12390. var p = pathext[i].toLowerCase()
  12391. if (p && path.substr(-p.length).toLowerCase() === p) {
  12392. return true
  12393. }
  12394. }
  12395. return false
  12396. }
  12397. function checkStat (stat, path, options) {
  12398. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12399. return false
  12400. }
  12401. return checkPathExt(path, options)
  12402. }
  12403. function isexe (path, options, cb) {
  12404. fs.stat(path, function (er, stat) {
  12405. cb(er, er ? false : checkStat(stat, path, options))
  12406. })
  12407. }
  12408. function sync (path, options) {
  12409. return checkStat(fs.statSync(path), path, options)
  12410. }
  12411. /***/ }),
  12412. /***/ 821:
  12413. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12414. "use strict";
  12415. var __importStar = (this && this.__importStar) || function (mod) {
  12416. if (mod && mod.__esModule) return mod;
  12417. var result = {};
  12418. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12419. result["default"] = mod;
  12420. return result;
  12421. };
  12422. Object.defineProperty(exports, "__esModule", { value: true });
  12423. const core = __importStar(__webpack_require__(470));
  12424. const fsHelper = __importStar(__webpack_require__(618));
  12425. const github = __importStar(__webpack_require__(469));
  12426. const path = __importStar(__webpack_require__(622));
  12427. function getInputs() {
  12428. const result = {};
  12429. // GitHub workspace
  12430. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12431. if (!githubWorkspacePath) {
  12432. throw new Error('GITHUB_WORKSPACE not defined');
  12433. }
  12434. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12435. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12436. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12437. // Qualified repository
  12438. const qualifiedRepository = core.getInput('repository') ||
  12439. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12440. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12441. const splitRepository = qualifiedRepository.split('/');
  12442. if (splitRepository.length !== 2 ||
  12443. !splitRepository[0] ||
  12444. !splitRepository[1]) {
  12445. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12446. }
  12447. result.repositoryOwner = splitRepository[0];
  12448. result.repositoryName = splitRepository[1];
  12449. // Repository path
  12450. result.repositoryPath = core.getInput('path') || '.';
  12451. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12452. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12453. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12454. }
  12455. // Workflow repository?
  12456. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12457. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12458. // Source branch, source version
  12459. result.ref = core.getInput('ref');
  12460. if (!result.ref) {
  12461. if (isWorkflowRepository) {
  12462. result.ref = github.context.ref;
  12463. result.commit = github.context.sha;
  12464. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12465. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12466. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12467. result.ref = `refs/heads/${result.ref}`;
  12468. }
  12469. }
  12470. if (!result.ref && !result.commit) {
  12471. result.ref = 'refs/heads/master';
  12472. }
  12473. }
  12474. // SHA?
  12475. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12476. result.commit = result.ref;
  12477. result.ref = '';
  12478. }
  12479. core.debug(`ref = '${result.ref}'`);
  12480. core.debug(`commit = '${result.commit}'`);
  12481. // Clean
  12482. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12483. core.debug(`clean = ${result.clean}`);
  12484. // Fetch depth
  12485. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12486. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12487. result.fetchDepth = 0;
  12488. }
  12489. core.debug(`fetch depth = ${result.fetchDepth}`);
  12490. // LFS
  12491. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12492. core.debug(`lfs = ${result.lfs}`);
  12493. // Submodules
  12494. result.submodules = false;
  12495. result.nestedSubmodules = false;
  12496. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12497. if (submodulesString == 'RECURSIVE') {
  12498. result.submodules = true;
  12499. result.nestedSubmodules = true;
  12500. }
  12501. else if (submodulesString == 'TRUE') {
  12502. result.submodules = true;
  12503. }
  12504. core.debug(`submodules = ${result.submodules}`);
  12505. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12506. // Auth token
  12507. result.authToken = core.getInput('token');
  12508. // SSH
  12509. result.sshKey = core.getInput('ssh-key');
  12510. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12511. result.sshStrict =
  12512. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12513. // Persist credentials
  12514. result.persistCredentials =
  12515. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12516. return result;
  12517. }
  12518. exports.getInputs = getInputs;
  12519. /***/ }),
  12520. /***/ 826:
  12521. /***/ (function(module, __unusedexports, __webpack_require__) {
  12522. var rng = __webpack_require__(139);
  12523. var bytesToUuid = __webpack_require__(722);
  12524. function v4(options, buf, offset) {
  12525. var i = buf && offset || 0;
  12526. if (typeof(options) == 'string') {
  12527. buf = options === 'binary' ? new Array(16) : null;
  12528. options = null;
  12529. }
  12530. options = options || {};
  12531. var rnds = options.random || (options.rng || rng)();
  12532. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12533. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12534. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12535. // Copy bytes to buffer, if provided
  12536. if (buf) {
  12537. for (var ii = 0; ii < 16; ++ii) {
  12538. buf[i + ii] = rnds[ii];
  12539. }
  12540. }
  12541. return buf || bytesToUuid(rnds);
  12542. }
  12543. module.exports = v4;
  12544. /***/ }),
  12545. /***/ 835:
  12546. /***/ (function(module) {
  12547. module.exports = require("url");
  12548. /***/ }),
  12549. /***/ 842:
  12550. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12551. "use strict";
  12552. Object.defineProperty(exports, '__esModule', { value: true });
  12553. var deprecation = __webpack_require__(692);
  12554. var endpointsByScope = {
  12555. actions: {
  12556. cancelWorkflowRun: {
  12557. method: "POST",
  12558. params: {
  12559. owner: {
  12560. required: true,
  12561. type: "string"
  12562. },
  12563. repo: {
  12564. required: true,
  12565. type: "string"
  12566. },
  12567. run_id: {
  12568. required: true,
  12569. type: "integer"
  12570. }
  12571. },
  12572. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12573. },
  12574. createOrUpdateSecretForRepo: {
  12575. method: "PUT",
  12576. params: {
  12577. encrypted_value: {
  12578. type: "string"
  12579. },
  12580. key_id: {
  12581. type: "string"
  12582. },
  12583. name: {
  12584. required: true,
  12585. type: "string"
  12586. },
  12587. owner: {
  12588. required: true,
  12589. type: "string"
  12590. },
  12591. repo: {
  12592. required: true,
  12593. type: "string"
  12594. }
  12595. },
  12596. url: "/repos/:owner/:repo/actions/secrets/:name"
  12597. },
  12598. createRegistrationToken: {
  12599. method: "POST",
  12600. params: {
  12601. owner: {
  12602. required: true,
  12603. type: "string"
  12604. },
  12605. repo: {
  12606. required: true,
  12607. type: "string"
  12608. }
  12609. },
  12610. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12611. },
  12612. createRemoveToken: {
  12613. method: "POST",
  12614. params: {
  12615. owner: {
  12616. required: true,
  12617. type: "string"
  12618. },
  12619. repo: {
  12620. required: true,
  12621. type: "string"
  12622. }
  12623. },
  12624. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12625. },
  12626. deleteArtifact: {
  12627. method: "DELETE",
  12628. params: {
  12629. artifact_id: {
  12630. required: true,
  12631. type: "integer"
  12632. },
  12633. owner: {
  12634. required: true,
  12635. type: "string"
  12636. },
  12637. repo: {
  12638. required: true,
  12639. type: "string"
  12640. }
  12641. },
  12642. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12643. },
  12644. deleteSecretFromRepo: {
  12645. method: "DELETE",
  12646. params: {
  12647. name: {
  12648. required: true,
  12649. type: "string"
  12650. },
  12651. owner: {
  12652. required: true,
  12653. type: "string"
  12654. },
  12655. repo: {
  12656. required: true,
  12657. type: "string"
  12658. }
  12659. },
  12660. url: "/repos/:owner/:repo/actions/secrets/:name"
  12661. },
  12662. downloadArtifact: {
  12663. method: "GET",
  12664. params: {
  12665. archive_format: {
  12666. required: true,
  12667. type: "string"
  12668. },
  12669. artifact_id: {
  12670. required: true,
  12671. type: "integer"
  12672. },
  12673. owner: {
  12674. required: true,
  12675. type: "string"
  12676. },
  12677. repo: {
  12678. required: true,
  12679. type: "string"
  12680. }
  12681. },
  12682. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12683. },
  12684. getArtifact: {
  12685. method: "GET",
  12686. params: {
  12687. artifact_id: {
  12688. required: true,
  12689. type: "integer"
  12690. },
  12691. owner: {
  12692. required: true,
  12693. type: "string"
  12694. },
  12695. repo: {
  12696. required: true,
  12697. type: "string"
  12698. }
  12699. },
  12700. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12701. },
  12702. getPublicKey: {
  12703. method: "GET",
  12704. params: {
  12705. owner: {
  12706. required: true,
  12707. type: "string"
  12708. },
  12709. repo: {
  12710. required: true,
  12711. type: "string"
  12712. }
  12713. },
  12714. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12715. },
  12716. getSecret: {
  12717. method: "GET",
  12718. params: {
  12719. name: {
  12720. required: true,
  12721. type: "string"
  12722. },
  12723. owner: {
  12724. required: true,
  12725. type: "string"
  12726. },
  12727. page: {
  12728. type: "integer"
  12729. },
  12730. per_page: {
  12731. type: "integer"
  12732. },
  12733. repo: {
  12734. required: true,
  12735. type: "string"
  12736. }
  12737. },
  12738. url: "/repos/:owner/:repo/actions/secrets/:name"
  12739. },
  12740. getSelfHostedRunner: {
  12741. method: "GET",
  12742. params: {
  12743. owner: {
  12744. required: true,
  12745. type: "string"
  12746. },
  12747. repo: {
  12748. required: true,
  12749. type: "string"
  12750. },
  12751. runner_id: {
  12752. required: true,
  12753. type: "integer"
  12754. }
  12755. },
  12756. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12757. },
  12758. getWorkflow: {
  12759. method: "GET",
  12760. params: {
  12761. owner: {
  12762. required: true,
  12763. type: "string"
  12764. },
  12765. repo: {
  12766. required: true,
  12767. type: "string"
  12768. },
  12769. workflow_id: {
  12770. required: true,
  12771. type: "integer"
  12772. }
  12773. },
  12774. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12775. },
  12776. getWorkflowJob: {
  12777. method: "GET",
  12778. params: {
  12779. job_id: {
  12780. required: true,
  12781. type: "integer"
  12782. },
  12783. owner: {
  12784. required: true,
  12785. type: "string"
  12786. },
  12787. repo: {
  12788. required: true,
  12789. type: "string"
  12790. }
  12791. },
  12792. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12793. },
  12794. getWorkflowRun: {
  12795. method: "GET",
  12796. params: {
  12797. owner: {
  12798. required: true,
  12799. type: "string"
  12800. },
  12801. repo: {
  12802. required: true,
  12803. type: "string"
  12804. },
  12805. run_id: {
  12806. required: true,
  12807. type: "integer"
  12808. }
  12809. },
  12810. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12811. },
  12812. listDownloadsForSelfHostedRunnerApplication: {
  12813. method: "GET",
  12814. params: {
  12815. owner: {
  12816. required: true,
  12817. type: "string"
  12818. },
  12819. repo: {
  12820. required: true,
  12821. type: "string"
  12822. }
  12823. },
  12824. url: "/repos/:owner/:repo/actions/runners/downloads"
  12825. },
  12826. listJobsForWorkflowRun: {
  12827. method: "GET",
  12828. params: {
  12829. owner: {
  12830. required: true,
  12831. type: "string"
  12832. },
  12833. page: {
  12834. type: "integer"
  12835. },
  12836. per_page: {
  12837. type: "integer"
  12838. },
  12839. repo: {
  12840. required: true,
  12841. type: "string"
  12842. },
  12843. run_id: {
  12844. required: true,
  12845. type: "integer"
  12846. }
  12847. },
  12848. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  12849. },
  12850. listRepoWorkflowRuns: {
  12851. method: "GET",
  12852. params: {
  12853. actor: {
  12854. type: "string"
  12855. },
  12856. branch: {
  12857. type: "string"
  12858. },
  12859. event: {
  12860. type: "string"
  12861. },
  12862. owner: {
  12863. required: true,
  12864. type: "string"
  12865. },
  12866. page: {
  12867. type: "integer"
  12868. },
  12869. per_page: {
  12870. type: "integer"
  12871. },
  12872. repo: {
  12873. required: true,
  12874. type: "string"
  12875. },
  12876. status: {
  12877. enum: ["completed", "status", "conclusion"],
  12878. type: "string"
  12879. }
  12880. },
  12881. url: "/repos/:owner/:repo/actions/runs"
  12882. },
  12883. listRepoWorkflows: {
  12884. method: "GET",
  12885. params: {
  12886. owner: {
  12887. required: true,
  12888. type: "string"
  12889. },
  12890. page: {
  12891. type: "integer"
  12892. },
  12893. per_page: {
  12894. type: "integer"
  12895. },
  12896. repo: {
  12897. required: true,
  12898. type: "string"
  12899. }
  12900. },
  12901. url: "/repos/:owner/:repo/actions/workflows"
  12902. },
  12903. listSecretsForRepo: {
  12904. method: "GET",
  12905. params: {
  12906. owner: {
  12907. required: true,
  12908. type: "string"
  12909. },
  12910. page: {
  12911. type: "integer"
  12912. },
  12913. per_page: {
  12914. type: "integer"
  12915. },
  12916. repo: {
  12917. required: true,
  12918. type: "string"
  12919. }
  12920. },
  12921. url: "/repos/:owner/:repo/actions/secrets"
  12922. },
  12923. listSelfHostedRunnersForRepo: {
  12924. method: "GET",
  12925. params: {
  12926. owner: {
  12927. required: true,
  12928. type: "string"
  12929. },
  12930. page: {
  12931. type: "integer"
  12932. },
  12933. per_page: {
  12934. type: "integer"
  12935. },
  12936. repo: {
  12937. required: true,
  12938. type: "string"
  12939. }
  12940. },
  12941. url: "/repos/:owner/:repo/actions/runners"
  12942. },
  12943. listWorkflowJobLogs: {
  12944. method: "GET",
  12945. params: {
  12946. job_id: {
  12947. required: true,
  12948. type: "integer"
  12949. },
  12950. owner: {
  12951. required: true,
  12952. type: "string"
  12953. },
  12954. page: {
  12955. type: "integer"
  12956. },
  12957. per_page: {
  12958. type: "integer"
  12959. },
  12960. repo: {
  12961. required: true,
  12962. type: "string"
  12963. }
  12964. },
  12965. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  12966. },
  12967. listWorkflowRunArtifacts: {
  12968. method: "GET",
  12969. params: {
  12970. owner: {
  12971. required: true,
  12972. type: "string"
  12973. },
  12974. page: {
  12975. type: "integer"
  12976. },
  12977. per_page: {
  12978. type: "integer"
  12979. },
  12980. repo: {
  12981. required: true,
  12982. type: "string"
  12983. },
  12984. run_id: {
  12985. required: true,
  12986. type: "integer"
  12987. }
  12988. },
  12989. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  12990. },
  12991. listWorkflowRunLogs: {
  12992. method: "GET",
  12993. params: {
  12994. owner: {
  12995. required: true,
  12996. type: "string"
  12997. },
  12998. page: {
  12999. type: "integer"
  13000. },
  13001. per_page: {
  13002. type: "integer"
  13003. },
  13004. repo: {
  13005. required: true,
  13006. type: "string"
  13007. },
  13008. run_id: {
  13009. required: true,
  13010. type: "integer"
  13011. }
  13012. },
  13013. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13014. },
  13015. listWorkflowRuns: {
  13016. method: "GET",
  13017. params: {
  13018. actor: {
  13019. type: "string"
  13020. },
  13021. branch: {
  13022. type: "string"
  13023. },
  13024. event: {
  13025. type: "string"
  13026. },
  13027. owner: {
  13028. required: true,
  13029. type: "string"
  13030. },
  13031. page: {
  13032. type: "integer"
  13033. },
  13034. per_page: {
  13035. type: "integer"
  13036. },
  13037. repo: {
  13038. required: true,
  13039. type: "string"
  13040. },
  13041. status: {
  13042. enum: ["completed", "status", "conclusion"],
  13043. type: "string"
  13044. },
  13045. workflow_id: {
  13046. required: true,
  13047. type: "integer"
  13048. }
  13049. },
  13050. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13051. },
  13052. reRunWorkflow: {
  13053. method: "POST",
  13054. params: {
  13055. owner: {
  13056. required: true,
  13057. type: "string"
  13058. },
  13059. repo: {
  13060. required: true,
  13061. type: "string"
  13062. },
  13063. run_id: {
  13064. required: true,
  13065. type: "integer"
  13066. }
  13067. },
  13068. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13069. },
  13070. removeSelfHostedRunner: {
  13071. method: "DELETE",
  13072. params: {
  13073. owner: {
  13074. required: true,
  13075. type: "string"
  13076. },
  13077. repo: {
  13078. required: true,
  13079. type: "string"
  13080. },
  13081. runner_id: {
  13082. required: true,
  13083. type: "integer"
  13084. }
  13085. },
  13086. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13087. }
  13088. },
  13089. activity: {
  13090. checkStarringRepo: {
  13091. method: "GET",
  13092. params: {
  13093. owner: {
  13094. required: true,
  13095. type: "string"
  13096. },
  13097. repo: {
  13098. required: true,
  13099. type: "string"
  13100. }
  13101. },
  13102. url: "/user/starred/:owner/:repo"
  13103. },
  13104. deleteRepoSubscription: {
  13105. method: "DELETE",
  13106. params: {
  13107. owner: {
  13108. required: true,
  13109. type: "string"
  13110. },
  13111. repo: {
  13112. required: true,
  13113. type: "string"
  13114. }
  13115. },
  13116. url: "/repos/:owner/:repo/subscription"
  13117. },
  13118. deleteThreadSubscription: {
  13119. method: "DELETE",
  13120. params: {
  13121. thread_id: {
  13122. required: true,
  13123. type: "integer"
  13124. }
  13125. },
  13126. url: "/notifications/threads/:thread_id/subscription"
  13127. },
  13128. getRepoSubscription: {
  13129. method: "GET",
  13130. params: {
  13131. owner: {
  13132. required: true,
  13133. type: "string"
  13134. },
  13135. repo: {
  13136. required: true,
  13137. type: "string"
  13138. }
  13139. },
  13140. url: "/repos/:owner/:repo/subscription"
  13141. },
  13142. getThread: {
  13143. method: "GET",
  13144. params: {
  13145. thread_id: {
  13146. required: true,
  13147. type: "integer"
  13148. }
  13149. },
  13150. url: "/notifications/threads/:thread_id"
  13151. },
  13152. getThreadSubscription: {
  13153. method: "GET",
  13154. params: {
  13155. thread_id: {
  13156. required: true,
  13157. type: "integer"
  13158. }
  13159. },
  13160. url: "/notifications/threads/:thread_id/subscription"
  13161. },
  13162. listEventsForOrg: {
  13163. method: "GET",
  13164. params: {
  13165. org: {
  13166. required: true,
  13167. type: "string"
  13168. },
  13169. page: {
  13170. type: "integer"
  13171. },
  13172. per_page: {
  13173. type: "integer"
  13174. },
  13175. username: {
  13176. required: true,
  13177. type: "string"
  13178. }
  13179. },
  13180. url: "/users/:username/events/orgs/:org"
  13181. },
  13182. listEventsForUser: {
  13183. method: "GET",
  13184. params: {
  13185. page: {
  13186. type: "integer"
  13187. },
  13188. per_page: {
  13189. type: "integer"
  13190. },
  13191. username: {
  13192. required: true,
  13193. type: "string"
  13194. }
  13195. },
  13196. url: "/users/:username/events"
  13197. },
  13198. listFeeds: {
  13199. method: "GET",
  13200. params: {},
  13201. url: "/feeds"
  13202. },
  13203. listNotifications: {
  13204. method: "GET",
  13205. params: {
  13206. all: {
  13207. type: "boolean"
  13208. },
  13209. before: {
  13210. type: "string"
  13211. },
  13212. page: {
  13213. type: "integer"
  13214. },
  13215. participating: {
  13216. type: "boolean"
  13217. },
  13218. per_page: {
  13219. type: "integer"
  13220. },
  13221. since: {
  13222. type: "string"
  13223. }
  13224. },
  13225. url: "/notifications"
  13226. },
  13227. listNotificationsForRepo: {
  13228. method: "GET",
  13229. params: {
  13230. all: {
  13231. type: "boolean"
  13232. },
  13233. before: {
  13234. type: "string"
  13235. },
  13236. owner: {
  13237. required: true,
  13238. type: "string"
  13239. },
  13240. page: {
  13241. type: "integer"
  13242. },
  13243. participating: {
  13244. type: "boolean"
  13245. },
  13246. per_page: {
  13247. type: "integer"
  13248. },
  13249. repo: {
  13250. required: true,
  13251. type: "string"
  13252. },
  13253. since: {
  13254. type: "string"
  13255. }
  13256. },
  13257. url: "/repos/:owner/:repo/notifications"
  13258. },
  13259. listPublicEvents: {
  13260. method: "GET",
  13261. params: {
  13262. page: {
  13263. type: "integer"
  13264. },
  13265. per_page: {
  13266. type: "integer"
  13267. }
  13268. },
  13269. url: "/events"
  13270. },
  13271. listPublicEventsForOrg: {
  13272. method: "GET",
  13273. params: {
  13274. org: {
  13275. required: true,
  13276. type: "string"
  13277. },
  13278. page: {
  13279. type: "integer"
  13280. },
  13281. per_page: {
  13282. type: "integer"
  13283. }
  13284. },
  13285. url: "/orgs/:org/events"
  13286. },
  13287. listPublicEventsForRepoNetwork: {
  13288. method: "GET",
  13289. params: {
  13290. owner: {
  13291. required: true,
  13292. type: "string"
  13293. },
  13294. page: {
  13295. type: "integer"
  13296. },
  13297. per_page: {
  13298. type: "integer"
  13299. },
  13300. repo: {
  13301. required: true,
  13302. type: "string"
  13303. }
  13304. },
  13305. url: "/networks/:owner/:repo/events"
  13306. },
  13307. listPublicEventsForUser: {
  13308. method: "GET",
  13309. params: {
  13310. page: {
  13311. type: "integer"
  13312. },
  13313. per_page: {
  13314. type: "integer"
  13315. },
  13316. username: {
  13317. required: true,
  13318. type: "string"
  13319. }
  13320. },
  13321. url: "/users/:username/events/public"
  13322. },
  13323. listReceivedEventsForUser: {
  13324. method: "GET",
  13325. params: {
  13326. page: {
  13327. type: "integer"
  13328. },
  13329. per_page: {
  13330. type: "integer"
  13331. },
  13332. username: {
  13333. required: true,
  13334. type: "string"
  13335. }
  13336. },
  13337. url: "/users/:username/received_events"
  13338. },
  13339. listReceivedPublicEventsForUser: {
  13340. method: "GET",
  13341. params: {
  13342. page: {
  13343. type: "integer"
  13344. },
  13345. per_page: {
  13346. type: "integer"
  13347. },
  13348. username: {
  13349. required: true,
  13350. type: "string"
  13351. }
  13352. },
  13353. url: "/users/:username/received_events/public"
  13354. },
  13355. listRepoEvents: {
  13356. method: "GET",
  13357. params: {
  13358. owner: {
  13359. required: true,
  13360. type: "string"
  13361. },
  13362. page: {
  13363. type: "integer"
  13364. },
  13365. per_page: {
  13366. type: "integer"
  13367. },
  13368. repo: {
  13369. required: true,
  13370. type: "string"
  13371. }
  13372. },
  13373. url: "/repos/:owner/:repo/events"
  13374. },
  13375. listReposStarredByAuthenticatedUser: {
  13376. method: "GET",
  13377. params: {
  13378. direction: {
  13379. enum: ["asc", "desc"],
  13380. type: "string"
  13381. },
  13382. page: {
  13383. type: "integer"
  13384. },
  13385. per_page: {
  13386. type: "integer"
  13387. },
  13388. sort: {
  13389. enum: ["created", "updated"],
  13390. type: "string"
  13391. }
  13392. },
  13393. url: "/user/starred"
  13394. },
  13395. listReposStarredByUser: {
  13396. method: "GET",
  13397. params: {
  13398. direction: {
  13399. enum: ["asc", "desc"],
  13400. type: "string"
  13401. },
  13402. page: {
  13403. type: "integer"
  13404. },
  13405. per_page: {
  13406. type: "integer"
  13407. },
  13408. sort: {
  13409. enum: ["created", "updated"],
  13410. type: "string"
  13411. },
  13412. username: {
  13413. required: true,
  13414. type: "string"
  13415. }
  13416. },
  13417. url: "/users/:username/starred"
  13418. },
  13419. listReposWatchedByUser: {
  13420. method: "GET",
  13421. params: {
  13422. page: {
  13423. type: "integer"
  13424. },
  13425. per_page: {
  13426. type: "integer"
  13427. },
  13428. username: {
  13429. required: true,
  13430. type: "string"
  13431. }
  13432. },
  13433. url: "/users/:username/subscriptions"
  13434. },
  13435. listStargazersForRepo: {
  13436. method: "GET",
  13437. params: {
  13438. owner: {
  13439. required: true,
  13440. type: "string"
  13441. },
  13442. page: {
  13443. type: "integer"
  13444. },
  13445. per_page: {
  13446. type: "integer"
  13447. },
  13448. repo: {
  13449. required: true,
  13450. type: "string"
  13451. }
  13452. },
  13453. url: "/repos/:owner/:repo/stargazers"
  13454. },
  13455. listWatchedReposForAuthenticatedUser: {
  13456. method: "GET",
  13457. params: {
  13458. page: {
  13459. type: "integer"
  13460. },
  13461. per_page: {
  13462. type: "integer"
  13463. }
  13464. },
  13465. url: "/user/subscriptions"
  13466. },
  13467. listWatchersForRepo: {
  13468. method: "GET",
  13469. params: {
  13470. owner: {
  13471. required: true,
  13472. type: "string"
  13473. },
  13474. page: {
  13475. type: "integer"
  13476. },
  13477. per_page: {
  13478. type: "integer"
  13479. },
  13480. repo: {
  13481. required: true,
  13482. type: "string"
  13483. }
  13484. },
  13485. url: "/repos/:owner/:repo/subscribers"
  13486. },
  13487. markAsRead: {
  13488. method: "PUT",
  13489. params: {
  13490. last_read_at: {
  13491. type: "string"
  13492. }
  13493. },
  13494. url: "/notifications"
  13495. },
  13496. markNotificationsAsReadForRepo: {
  13497. method: "PUT",
  13498. params: {
  13499. last_read_at: {
  13500. type: "string"
  13501. },
  13502. owner: {
  13503. required: true,
  13504. type: "string"
  13505. },
  13506. repo: {
  13507. required: true,
  13508. type: "string"
  13509. }
  13510. },
  13511. url: "/repos/:owner/:repo/notifications"
  13512. },
  13513. markThreadAsRead: {
  13514. method: "PATCH",
  13515. params: {
  13516. thread_id: {
  13517. required: true,
  13518. type: "integer"
  13519. }
  13520. },
  13521. url: "/notifications/threads/:thread_id"
  13522. },
  13523. setRepoSubscription: {
  13524. method: "PUT",
  13525. params: {
  13526. ignored: {
  13527. type: "boolean"
  13528. },
  13529. owner: {
  13530. required: true,
  13531. type: "string"
  13532. },
  13533. repo: {
  13534. required: true,
  13535. type: "string"
  13536. },
  13537. subscribed: {
  13538. type: "boolean"
  13539. }
  13540. },
  13541. url: "/repos/:owner/:repo/subscription"
  13542. },
  13543. setThreadSubscription: {
  13544. method: "PUT",
  13545. params: {
  13546. ignored: {
  13547. type: "boolean"
  13548. },
  13549. thread_id: {
  13550. required: true,
  13551. type: "integer"
  13552. }
  13553. },
  13554. url: "/notifications/threads/:thread_id/subscription"
  13555. },
  13556. starRepo: {
  13557. method: "PUT",
  13558. params: {
  13559. owner: {
  13560. required: true,
  13561. type: "string"
  13562. },
  13563. repo: {
  13564. required: true,
  13565. type: "string"
  13566. }
  13567. },
  13568. url: "/user/starred/:owner/:repo"
  13569. },
  13570. unstarRepo: {
  13571. method: "DELETE",
  13572. params: {
  13573. owner: {
  13574. required: true,
  13575. type: "string"
  13576. },
  13577. repo: {
  13578. required: true,
  13579. type: "string"
  13580. }
  13581. },
  13582. url: "/user/starred/:owner/:repo"
  13583. }
  13584. },
  13585. apps: {
  13586. addRepoToInstallation: {
  13587. headers: {
  13588. accept: "application/vnd.github.machine-man-preview+json"
  13589. },
  13590. method: "PUT",
  13591. params: {
  13592. installation_id: {
  13593. required: true,
  13594. type: "integer"
  13595. },
  13596. repository_id: {
  13597. required: true,
  13598. type: "integer"
  13599. }
  13600. },
  13601. url: "/user/installations/:installation_id/repositories/:repository_id"
  13602. },
  13603. checkAccountIsAssociatedWithAny: {
  13604. method: "GET",
  13605. params: {
  13606. account_id: {
  13607. required: true,
  13608. type: "integer"
  13609. }
  13610. },
  13611. url: "/marketplace_listing/accounts/:account_id"
  13612. },
  13613. checkAccountIsAssociatedWithAnyStubbed: {
  13614. method: "GET",
  13615. params: {
  13616. account_id: {
  13617. required: true,
  13618. type: "integer"
  13619. }
  13620. },
  13621. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13622. },
  13623. checkAuthorization: {
  13624. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13625. method: "GET",
  13626. params: {
  13627. access_token: {
  13628. required: true,
  13629. type: "string"
  13630. },
  13631. client_id: {
  13632. required: true,
  13633. type: "string"
  13634. }
  13635. },
  13636. url: "/applications/:client_id/tokens/:access_token"
  13637. },
  13638. checkToken: {
  13639. headers: {
  13640. accept: "application/vnd.github.doctor-strange-preview+json"
  13641. },
  13642. method: "POST",
  13643. params: {
  13644. access_token: {
  13645. type: "string"
  13646. },
  13647. client_id: {
  13648. required: true,
  13649. type: "string"
  13650. }
  13651. },
  13652. url: "/applications/:client_id/token"
  13653. },
  13654. createContentAttachment: {
  13655. headers: {
  13656. accept: "application/vnd.github.corsair-preview+json"
  13657. },
  13658. method: "POST",
  13659. params: {
  13660. body: {
  13661. required: true,
  13662. type: "string"
  13663. },
  13664. content_reference_id: {
  13665. required: true,
  13666. type: "integer"
  13667. },
  13668. title: {
  13669. required: true,
  13670. type: "string"
  13671. }
  13672. },
  13673. url: "/content_references/:content_reference_id/attachments"
  13674. },
  13675. createFromManifest: {
  13676. headers: {
  13677. accept: "application/vnd.github.fury-preview+json"
  13678. },
  13679. method: "POST",
  13680. params: {
  13681. code: {
  13682. required: true,
  13683. type: "string"
  13684. }
  13685. },
  13686. url: "/app-manifests/:code/conversions"
  13687. },
  13688. createInstallationToken: {
  13689. headers: {
  13690. accept: "application/vnd.github.machine-man-preview+json"
  13691. },
  13692. method: "POST",
  13693. params: {
  13694. installation_id: {
  13695. required: true,
  13696. type: "integer"
  13697. },
  13698. permissions: {
  13699. type: "object"
  13700. },
  13701. repository_ids: {
  13702. type: "integer[]"
  13703. }
  13704. },
  13705. url: "/app/installations/:installation_id/access_tokens"
  13706. },
  13707. deleteAuthorization: {
  13708. headers: {
  13709. accept: "application/vnd.github.doctor-strange-preview+json"
  13710. },
  13711. method: "DELETE",
  13712. params: {
  13713. access_token: {
  13714. type: "string"
  13715. },
  13716. client_id: {
  13717. required: true,
  13718. type: "string"
  13719. }
  13720. },
  13721. url: "/applications/:client_id/grant"
  13722. },
  13723. deleteInstallation: {
  13724. headers: {
  13725. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13726. },
  13727. method: "DELETE",
  13728. params: {
  13729. installation_id: {
  13730. required: true,
  13731. type: "integer"
  13732. }
  13733. },
  13734. url: "/app/installations/:installation_id"
  13735. },
  13736. deleteToken: {
  13737. headers: {
  13738. accept: "application/vnd.github.doctor-strange-preview+json"
  13739. },
  13740. method: "DELETE",
  13741. params: {
  13742. access_token: {
  13743. type: "string"
  13744. },
  13745. client_id: {
  13746. required: true,
  13747. type: "string"
  13748. }
  13749. },
  13750. url: "/applications/:client_id/token"
  13751. },
  13752. findOrgInstallation: {
  13753. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13754. headers: {
  13755. accept: "application/vnd.github.machine-man-preview+json"
  13756. },
  13757. method: "GET",
  13758. params: {
  13759. org: {
  13760. required: true,
  13761. type: "string"
  13762. }
  13763. },
  13764. url: "/orgs/:org/installation"
  13765. },
  13766. findRepoInstallation: {
  13767. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13768. headers: {
  13769. accept: "application/vnd.github.machine-man-preview+json"
  13770. },
  13771. method: "GET",
  13772. params: {
  13773. owner: {
  13774. required: true,
  13775. type: "string"
  13776. },
  13777. repo: {
  13778. required: true,
  13779. type: "string"
  13780. }
  13781. },
  13782. url: "/repos/:owner/:repo/installation"
  13783. },
  13784. findUserInstallation: {
  13785. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13786. headers: {
  13787. accept: "application/vnd.github.machine-man-preview+json"
  13788. },
  13789. method: "GET",
  13790. params: {
  13791. username: {
  13792. required: true,
  13793. type: "string"
  13794. }
  13795. },
  13796. url: "/users/:username/installation"
  13797. },
  13798. getAuthenticated: {
  13799. headers: {
  13800. accept: "application/vnd.github.machine-man-preview+json"
  13801. },
  13802. method: "GET",
  13803. params: {},
  13804. url: "/app"
  13805. },
  13806. getBySlug: {
  13807. headers: {
  13808. accept: "application/vnd.github.machine-man-preview+json"
  13809. },
  13810. method: "GET",
  13811. params: {
  13812. app_slug: {
  13813. required: true,
  13814. type: "string"
  13815. }
  13816. },
  13817. url: "/apps/:app_slug"
  13818. },
  13819. getInstallation: {
  13820. headers: {
  13821. accept: "application/vnd.github.machine-man-preview+json"
  13822. },
  13823. method: "GET",
  13824. params: {
  13825. installation_id: {
  13826. required: true,
  13827. type: "integer"
  13828. }
  13829. },
  13830. url: "/app/installations/:installation_id"
  13831. },
  13832. getOrgInstallation: {
  13833. headers: {
  13834. accept: "application/vnd.github.machine-man-preview+json"
  13835. },
  13836. method: "GET",
  13837. params: {
  13838. org: {
  13839. required: true,
  13840. type: "string"
  13841. }
  13842. },
  13843. url: "/orgs/:org/installation"
  13844. },
  13845. getRepoInstallation: {
  13846. headers: {
  13847. accept: "application/vnd.github.machine-man-preview+json"
  13848. },
  13849. method: "GET",
  13850. params: {
  13851. owner: {
  13852. required: true,
  13853. type: "string"
  13854. },
  13855. repo: {
  13856. required: true,
  13857. type: "string"
  13858. }
  13859. },
  13860. url: "/repos/:owner/:repo/installation"
  13861. },
  13862. getUserInstallation: {
  13863. headers: {
  13864. accept: "application/vnd.github.machine-man-preview+json"
  13865. },
  13866. method: "GET",
  13867. params: {
  13868. username: {
  13869. required: true,
  13870. type: "string"
  13871. }
  13872. },
  13873. url: "/users/:username/installation"
  13874. },
  13875. listAccountsUserOrOrgOnPlan: {
  13876. method: "GET",
  13877. params: {
  13878. direction: {
  13879. enum: ["asc", "desc"],
  13880. type: "string"
  13881. },
  13882. page: {
  13883. type: "integer"
  13884. },
  13885. per_page: {
  13886. type: "integer"
  13887. },
  13888. plan_id: {
  13889. required: true,
  13890. type: "integer"
  13891. },
  13892. sort: {
  13893. enum: ["created", "updated"],
  13894. type: "string"
  13895. }
  13896. },
  13897. url: "/marketplace_listing/plans/:plan_id/accounts"
  13898. },
  13899. listAccountsUserOrOrgOnPlanStubbed: {
  13900. method: "GET",
  13901. params: {
  13902. direction: {
  13903. enum: ["asc", "desc"],
  13904. type: "string"
  13905. },
  13906. page: {
  13907. type: "integer"
  13908. },
  13909. per_page: {
  13910. type: "integer"
  13911. },
  13912. plan_id: {
  13913. required: true,
  13914. type: "integer"
  13915. },
  13916. sort: {
  13917. enum: ["created", "updated"],
  13918. type: "string"
  13919. }
  13920. },
  13921. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  13922. },
  13923. listInstallationReposForAuthenticatedUser: {
  13924. headers: {
  13925. accept: "application/vnd.github.machine-man-preview+json"
  13926. },
  13927. method: "GET",
  13928. params: {
  13929. installation_id: {
  13930. required: true,
  13931. type: "integer"
  13932. },
  13933. page: {
  13934. type: "integer"
  13935. },
  13936. per_page: {
  13937. type: "integer"
  13938. }
  13939. },
  13940. url: "/user/installations/:installation_id/repositories"
  13941. },
  13942. listInstallations: {
  13943. headers: {
  13944. accept: "application/vnd.github.machine-man-preview+json"
  13945. },
  13946. method: "GET",
  13947. params: {
  13948. page: {
  13949. type: "integer"
  13950. },
  13951. per_page: {
  13952. type: "integer"
  13953. }
  13954. },
  13955. url: "/app/installations"
  13956. },
  13957. listInstallationsForAuthenticatedUser: {
  13958. headers: {
  13959. accept: "application/vnd.github.machine-man-preview+json"
  13960. },
  13961. method: "GET",
  13962. params: {
  13963. page: {
  13964. type: "integer"
  13965. },
  13966. per_page: {
  13967. type: "integer"
  13968. }
  13969. },
  13970. url: "/user/installations"
  13971. },
  13972. listMarketplacePurchasesForAuthenticatedUser: {
  13973. method: "GET",
  13974. params: {
  13975. page: {
  13976. type: "integer"
  13977. },
  13978. per_page: {
  13979. type: "integer"
  13980. }
  13981. },
  13982. url: "/user/marketplace_purchases"
  13983. },
  13984. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  13985. method: "GET",
  13986. params: {
  13987. page: {
  13988. type: "integer"
  13989. },
  13990. per_page: {
  13991. type: "integer"
  13992. }
  13993. },
  13994. url: "/user/marketplace_purchases/stubbed"
  13995. },
  13996. listPlans: {
  13997. method: "GET",
  13998. params: {
  13999. page: {
  14000. type: "integer"
  14001. },
  14002. per_page: {
  14003. type: "integer"
  14004. }
  14005. },
  14006. url: "/marketplace_listing/plans"
  14007. },
  14008. listPlansStubbed: {
  14009. method: "GET",
  14010. params: {
  14011. page: {
  14012. type: "integer"
  14013. },
  14014. per_page: {
  14015. type: "integer"
  14016. }
  14017. },
  14018. url: "/marketplace_listing/stubbed/plans"
  14019. },
  14020. listRepos: {
  14021. headers: {
  14022. accept: "application/vnd.github.machine-man-preview+json"
  14023. },
  14024. method: "GET",
  14025. params: {
  14026. page: {
  14027. type: "integer"
  14028. },
  14029. per_page: {
  14030. type: "integer"
  14031. }
  14032. },
  14033. url: "/installation/repositories"
  14034. },
  14035. removeRepoFromInstallation: {
  14036. headers: {
  14037. accept: "application/vnd.github.machine-man-preview+json"
  14038. },
  14039. method: "DELETE",
  14040. params: {
  14041. installation_id: {
  14042. required: true,
  14043. type: "integer"
  14044. },
  14045. repository_id: {
  14046. required: true,
  14047. type: "integer"
  14048. }
  14049. },
  14050. url: "/user/installations/:installation_id/repositories/:repository_id"
  14051. },
  14052. resetAuthorization: {
  14053. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14054. method: "POST",
  14055. params: {
  14056. access_token: {
  14057. required: true,
  14058. type: "string"
  14059. },
  14060. client_id: {
  14061. required: true,
  14062. type: "string"
  14063. }
  14064. },
  14065. url: "/applications/:client_id/tokens/:access_token"
  14066. },
  14067. resetToken: {
  14068. headers: {
  14069. accept: "application/vnd.github.doctor-strange-preview+json"
  14070. },
  14071. method: "PATCH",
  14072. params: {
  14073. access_token: {
  14074. type: "string"
  14075. },
  14076. client_id: {
  14077. required: true,
  14078. type: "string"
  14079. }
  14080. },
  14081. url: "/applications/:client_id/token"
  14082. },
  14083. revokeAuthorizationForApplication: {
  14084. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14085. method: "DELETE",
  14086. params: {
  14087. access_token: {
  14088. required: true,
  14089. type: "string"
  14090. },
  14091. client_id: {
  14092. required: true,
  14093. type: "string"
  14094. }
  14095. },
  14096. url: "/applications/:client_id/tokens/:access_token"
  14097. },
  14098. revokeGrantForApplication: {
  14099. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14100. method: "DELETE",
  14101. params: {
  14102. access_token: {
  14103. required: true,
  14104. type: "string"
  14105. },
  14106. client_id: {
  14107. required: true,
  14108. type: "string"
  14109. }
  14110. },
  14111. url: "/applications/:client_id/grants/:access_token"
  14112. },
  14113. revokeInstallationToken: {
  14114. headers: {
  14115. accept: "application/vnd.github.gambit-preview+json"
  14116. },
  14117. method: "DELETE",
  14118. params: {},
  14119. url: "/installation/token"
  14120. }
  14121. },
  14122. checks: {
  14123. create: {
  14124. headers: {
  14125. accept: "application/vnd.github.antiope-preview+json"
  14126. },
  14127. method: "POST",
  14128. params: {
  14129. actions: {
  14130. type: "object[]"
  14131. },
  14132. "actions[].description": {
  14133. required: true,
  14134. type: "string"
  14135. },
  14136. "actions[].identifier": {
  14137. required: true,
  14138. type: "string"
  14139. },
  14140. "actions[].label": {
  14141. required: true,
  14142. type: "string"
  14143. },
  14144. completed_at: {
  14145. type: "string"
  14146. },
  14147. conclusion: {
  14148. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14149. type: "string"
  14150. },
  14151. details_url: {
  14152. type: "string"
  14153. },
  14154. external_id: {
  14155. type: "string"
  14156. },
  14157. head_sha: {
  14158. required: true,
  14159. type: "string"
  14160. },
  14161. name: {
  14162. required: true,
  14163. type: "string"
  14164. },
  14165. output: {
  14166. type: "object"
  14167. },
  14168. "output.annotations": {
  14169. type: "object[]"
  14170. },
  14171. "output.annotations[].annotation_level": {
  14172. enum: ["notice", "warning", "failure"],
  14173. required: true,
  14174. type: "string"
  14175. },
  14176. "output.annotations[].end_column": {
  14177. type: "integer"
  14178. },
  14179. "output.annotations[].end_line": {
  14180. required: true,
  14181. type: "integer"
  14182. },
  14183. "output.annotations[].message": {
  14184. required: true,
  14185. type: "string"
  14186. },
  14187. "output.annotations[].path": {
  14188. required: true,
  14189. type: "string"
  14190. },
  14191. "output.annotations[].raw_details": {
  14192. type: "string"
  14193. },
  14194. "output.annotations[].start_column": {
  14195. type: "integer"
  14196. },
  14197. "output.annotations[].start_line": {
  14198. required: true,
  14199. type: "integer"
  14200. },
  14201. "output.annotations[].title": {
  14202. type: "string"
  14203. },
  14204. "output.images": {
  14205. type: "object[]"
  14206. },
  14207. "output.images[].alt": {
  14208. required: true,
  14209. type: "string"
  14210. },
  14211. "output.images[].caption": {
  14212. type: "string"
  14213. },
  14214. "output.images[].image_url": {
  14215. required: true,
  14216. type: "string"
  14217. },
  14218. "output.summary": {
  14219. required: true,
  14220. type: "string"
  14221. },
  14222. "output.text": {
  14223. type: "string"
  14224. },
  14225. "output.title": {
  14226. required: true,
  14227. type: "string"
  14228. },
  14229. owner: {
  14230. required: true,
  14231. type: "string"
  14232. },
  14233. repo: {
  14234. required: true,
  14235. type: "string"
  14236. },
  14237. started_at: {
  14238. type: "string"
  14239. },
  14240. status: {
  14241. enum: ["queued", "in_progress", "completed"],
  14242. type: "string"
  14243. }
  14244. },
  14245. url: "/repos/:owner/:repo/check-runs"
  14246. },
  14247. createSuite: {
  14248. headers: {
  14249. accept: "application/vnd.github.antiope-preview+json"
  14250. },
  14251. method: "POST",
  14252. params: {
  14253. head_sha: {
  14254. required: true,
  14255. type: "string"
  14256. },
  14257. owner: {
  14258. required: true,
  14259. type: "string"
  14260. },
  14261. repo: {
  14262. required: true,
  14263. type: "string"
  14264. }
  14265. },
  14266. url: "/repos/:owner/:repo/check-suites"
  14267. },
  14268. get: {
  14269. headers: {
  14270. accept: "application/vnd.github.antiope-preview+json"
  14271. },
  14272. method: "GET",
  14273. params: {
  14274. check_run_id: {
  14275. required: true,
  14276. type: "integer"
  14277. },
  14278. owner: {
  14279. required: true,
  14280. type: "string"
  14281. },
  14282. repo: {
  14283. required: true,
  14284. type: "string"
  14285. }
  14286. },
  14287. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14288. },
  14289. getSuite: {
  14290. headers: {
  14291. accept: "application/vnd.github.antiope-preview+json"
  14292. },
  14293. method: "GET",
  14294. params: {
  14295. check_suite_id: {
  14296. required: true,
  14297. type: "integer"
  14298. },
  14299. owner: {
  14300. required: true,
  14301. type: "string"
  14302. },
  14303. repo: {
  14304. required: true,
  14305. type: "string"
  14306. }
  14307. },
  14308. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14309. },
  14310. listAnnotations: {
  14311. headers: {
  14312. accept: "application/vnd.github.antiope-preview+json"
  14313. },
  14314. method: "GET",
  14315. params: {
  14316. check_run_id: {
  14317. required: true,
  14318. type: "integer"
  14319. },
  14320. owner: {
  14321. required: true,
  14322. type: "string"
  14323. },
  14324. page: {
  14325. type: "integer"
  14326. },
  14327. per_page: {
  14328. type: "integer"
  14329. },
  14330. repo: {
  14331. required: true,
  14332. type: "string"
  14333. }
  14334. },
  14335. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14336. },
  14337. listForRef: {
  14338. headers: {
  14339. accept: "application/vnd.github.antiope-preview+json"
  14340. },
  14341. method: "GET",
  14342. params: {
  14343. check_name: {
  14344. type: "string"
  14345. },
  14346. filter: {
  14347. enum: ["latest", "all"],
  14348. type: "string"
  14349. },
  14350. owner: {
  14351. required: true,
  14352. type: "string"
  14353. },
  14354. page: {
  14355. type: "integer"
  14356. },
  14357. per_page: {
  14358. type: "integer"
  14359. },
  14360. ref: {
  14361. required: true,
  14362. type: "string"
  14363. },
  14364. repo: {
  14365. required: true,
  14366. type: "string"
  14367. },
  14368. status: {
  14369. enum: ["queued", "in_progress", "completed"],
  14370. type: "string"
  14371. }
  14372. },
  14373. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14374. },
  14375. listForSuite: {
  14376. headers: {
  14377. accept: "application/vnd.github.antiope-preview+json"
  14378. },
  14379. method: "GET",
  14380. params: {
  14381. check_name: {
  14382. type: "string"
  14383. },
  14384. check_suite_id: {
  14385. required: true,
  14386. type: "integer"
  14387. },
  14388. filter: {
  14389. enum: ["latest", "all"],
  14390. type: "string"
  14391. },
  14392. owner: {
  14393. required: true,
  14394. type: "string"
  14395. },
  14396. page: {
  14397. type: "integer"
  14398. },
  14399. per_page: {
  14400. type: "integer"
  14401. },
  14402. repo: {
  14403. required: true,
  14404. type: "string"
  14405. },
  14406. status: {
  14407. enum: ["queued", "in_progress", "completed"],
  14408. type: "string"
  14409. }
  14410. },
  14411. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14412. },
  14413. listSuitesForRef: {
  14414. headers: {
  14415. accept: "application/vnd.github.antiope-preview+json"
  14416. },
  14417. method: "GET",
  14418. params: {
  14419. app_id: {
  14420. type: "integer"
  14421. },
  14422. check_name: {
  14423. type: "string"
  14424. },
  14425. owner: {
  14426. required: true,
  14427. type: "string"
  14428. },
  14429. page: {
  14430. type: "integer"
  14431. },
  14432. per_page: {
  14433. type: "integer"
  14434. },
  14435. ref: {
  14436. required: true,
  14437. type: "string"
  14438. },
  14439. repo: {
  14440. required: true,
  14441. type: "string"
  14442. }
  14443. },
  14444. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14445. },
  14446. rerequestSuite: {
  14447. headers: {
  14448. accept: "application/vnd.github.antiope-preview+json"
  14449. },
  14450. method: "POST",
  14451. params: {
  14452. check_suite_id: {
  14453. required: true,
  14454. type: "integer"
  14455. },
  14456. owner: {
  14457. required: true,
  14458. type: "string"
  14459. },
  14460. repo: {
  14461. required: true,
  14462. type: "string"
  14463. }
  14464. },
  14465. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14466. },
  14467. setSuitesPreferences: {
  14468. headers: {
  14469. accept: "application/vnd.github.antiope-preview+json"
  14470. },
  14471. method: "PATCH",
  14472. params: {
  14473. auto_trigger_checks: {
  14474. type: "object[]"
  14475. },
  14476. "auto_trigger_checks[].app_id": {
  14477. required: true,
  14478. type: "integer"
  14479. },
  14480. "auto_trigger_checks[].setting": {
  14481. required: true,
  14482. type: "boolean"
  14483. },
  14484. owner: {
  14485. required: true,
  14486. type: "string"
  14487. },
  14488. repo: {
  14489. required: true,
  14490. type: "string"
  14491. }
  14492. },
  14493. url: "/repos/:owner/:repo/check-suites/preferences"
  14494. },
  14495. update: {
  14496. headers: {
  14497. accept: "application/vnd.github.antiope-preview+json"
  14498. },
  14499. method: "PATCH",
  14500. params: {
  14501. actions: {
  14502. type: "object[]"
  14503. },
  14504. "actions[].description": {
  14505. required: true,
  14506. type: "string"
  14507. },
  14508. "actions[].identifier": {
  14509. required: true,
  14510. type: "string"
  14511. },
  14512. "actions[].label": {
  14513. required: true,
  14514. type: "string"
  14515. },
  14516. check_run_id: {
  14517. required: true,
  14518. type: "integer"
  14519. },
  14520. completed_at: {
  14521. type: "string"
  14522. },
  14523. conclusion: {
  14524. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14525. type: "string"
  14526. },
  14527. details_url: {
  14528. type: "string"
  14529. },
  14530. external_id: {
  14531. type: "string"
  14532. },
  14533. name: {
  14534. type: "string"
  14535. },
  14536. output: {
  14537. type: "object"
  14538. },
  14539. "output.annotations": {
  14540. type: "object[]"
  14541. },
  14542. "output.annotations[].annotation_level": {
  14543. enum: ["notice", "warning", "failure"],
  14544. required: true,
  14545. type: "string"
  14546. },
  14547. "output.annotations[].end_column": {
  14548. type: "integer"
  14549. },
  14550. "output.annotations[].end_line": {
  14551. required: true,
  14552. type: "integer"
  14553. },
  14554. "output.annotations[].message": {
  14555. required: true,
  14556. type: "string"
  14557. },
  14558. "output.annotations[].path": {
  14559. required: true,
  14560. type: "string"
  14561. },
  14562. "output.annotations[].raw_details": {
  14563. type: "string"
  14564. },
  14565. "output.annotations[].start_column": {
  14566. type: "integer"
  14567. },
  14568. "output.annotations[].start_line": {
  14569. required: true,
  14570. type: "integer"
  14571. },
  14572. "output.annotations[].title": {
  14573. type: "string"
  14574. },
  14575. "output.images": {
  14576. type: "object[]"
  14577. },
  14578. "output.images[].alt": {
  14579. required: true,
  14580. type: "string"
  14581. },
  14582. "output.images[].caption": {
  14583. type: "string"
  14584. },
  14585. "output.images[].image_url": {
  14586. required: true,
  14587. type: "string"
  14588. },
  14589. "output.summary": {
  14590. required: true,
  14591. type: "string"
  14592. },
  14593. "output.text": {
  14594. type: "string"
  14595. },
  14596. "output.title": {
  14597. type: "string"
  14598. },
  14599. owner: {
  14600. required: true,
  14601. type: "string"
  14602. },
  14603. repo: {
  14604. required: true,
  14605. type: "string"
  14606. },
  14607. started_at: {
  14608. type: "string"
  14609. },
  14610. status: {
  14611. enum: ["queued", "in_progress", "completed"],
  14612. type: "string"
  14613. }
  14614. },
  14615. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14616. }
  14617. },
  14618. codesOfConduct: {
  14619. getConductCode: {
  14620. headers: {
  14621. accept: "application/vnd.github.scarlet-witch-preview+json"
  14622. },
  14623. method: "GET",
  14624. params: {
  14625. key: {
  14626. required: true,
  14627. type: "string"
  14628. }
  14629. },
  14630. url: "/codes_of_conduct/:key"
  14631. },
  14632. getForRepo: {
  14633. headers: {
  14634. accept: "application/vnd.github.scarlet-witch-preview+json"
  14635. },
  14636. method: "GET",
  14637. params: {
  14638. owner: {
  14639. required: true,
  14640. type: "string"
  14641. },
  14642. repo: {
  14643. required: true,
  14644. type: "string"
  14645. }
  14646. },
  14647. url: "/repos/:owner/:repo/community/code_of_conduct"
  14648. },
  14649. listConductCodes: {
  14650. headers: {
  14651. accept: "application/vnd.github.scarlet-witch-preview+json"
  14652. },
  14653. method: "GET",
  14654. params: {},
  14655. url: "/codes_of_conduct"
  14656. }
  14657. },
  14658. emojis: {
  14659. get: {
  14660. method: "GET",
  14661. params: {},
  14662. url: "/emojis"
  14663. }
  14664. },
  14665. gists: {
  14666. checkIsStarred: {
  14667. method: "GET",
  14668. params: {
  14669. gist_id: {
  14670. required: true,
  14671. type: "string"
  14672. }
  14673. },
  14674. url: "/gists/:gist_id/star"
  14675. },
  14676. create: {
  14677. method: "POST",
  14678. params: {
  14679. description: {
  14680. type: "string"
  14681. },
  14682. files: {
  14683. required: true,
  14684. type: "object"
  14685. },
  14686. "files.content": {
  14687. type: "string"
  14688. },
  14689. public: {
  14690. type: "boolean"
  14691. }
  14692. },
  14693. url: "/gists"
  14694. },
  14695. createComment: {
  14696. method: "POST",
  14697. params: {
  14698. body: {
  14699. required: true,
  14700. type: "string"
  14701. },
  14702. gist_id: {
  14703. required: true,
  14704. type: "string"
  14705. }
  14706. },
  14707. url: "/gists/:gist_id/comments"
  14708. },
  14709. delete: {
  14710. method: "DELETE",
  14711. params: {
  14712. gist_id: {
  14713. required: true,
  14714. type: "string"
  14715. }
  14716. },
  14717. url: "/gists/:gist_id"
  14718. },
  14719. deleteComment: {
  14720. method: "DELETE",
  14721. params: {
  14722. comment_id: {
  14723. required: true,
  14724. type: "integer"
  14725. },
  14726. gist_id: {
  14727. required: true,
  14728. type: "string"
  14729. }
  14730. },
  14731. url: "/gists/:gist_id/comments/:comment_id"
  14732. },
  14733. fork: {
  14734. method: "POST",
  14735. params: {
  14736. gist_id: {
  14737. required: true,
  14738. type: "string"
  14739. }
  14740. },
  14741. url: "/gists/:gist_id/forks"
  14742. },
  14743. get: {
  14744. method: "GET",
  14745. params: {
  14746. gist_id: {
  14747. required: true,
  14748. type: "string"
  14749. }
  14750. },
  14751. url: "/gists/:gist_id"
  14752. },
  14753. getComment: {
  14754. method: "GET",
  14755. params: {
  14756. comment_id: {
  14757. required: true,
  14758. type: "integer"
  14759. },
  14760. gist_id: {
  14761. required: true,
  14762. type: "string"
  14763. }
  14764. },
  14765. url: "/gists/:gist_id/comments/:comment_id"
  14766. },
  14767. getRevision: {
  14768. method: "GET",
  14769. params: {
  14770. gist_id: {
  14771. required: true,
  14772. type: "string"
  14773. },
  14774. sha: {
  14775. required: true,
  14776. type: "string"
  14777. }
  14778. },
  14779. url: "/gists/:gist_id/:sha"
  14780. },
  14781. list: {
  14782. method: "GET",
  14783. params: {
  14784. page: {
  14785. type: "integer"
  14786. },
  14787. per_page: {
  14788. type: "integer"
  14789. },
  14790. since: {
  14791. type: "string"
  14792. }
  14793. },
  14794. url: "/gists"
  14795. },
  14796. listComments: {
  14797. method: "GET",
  14798. params: {
  14799. gist_id: {
  14800. required: true,
  14801. type: "string"
  14802. },
  14803. page: {
  14804. type: "integer"
  14805. },
  14806. per_page: {
  14807. type: "integer"
  14808. }
  14809. },
  14810. url: "/gists/:gist_id/comments"
  14811. },
  14812. listCommits: {
  14813. method: "GET",
  14814. params: {
  14815. gist_id: {
  14816. required: true,
  14817. type: "string"
  14818. },
  14819. page: {
  14820. type: "integer"
  14821. },
  14822. per_page: {
  14823. type: "integer"
  14824. }
  14825. },
  14826. url: "/gists/:gist_id/commits"
  14827. },
  14828. listForks: {
  14829. method: "GET",
  14830. params: {
  14831. gist_id: {
  14832. required: true,
  14833. type: "string"
  14834. },
  14835. page: {
  14836. type: "integer"
  14837. },
  14838. per_page: {
  14839. type: "integer"
  14840. }
  14841. },
  14842. url: "/gists/:gist_id/forks"
  14843. },
  14844. listPublic: {
  14845. method: "GET",
  14846. params: {
  14847. page: {
  14848. type: "integer"
  14849. },
  14850. per_page: {
  14851. type: "integer"
  14852. },
  14853. since: {
  14854. type: "string"
  14855. }
  14856. },
  14857. url: "/gists/public"
  14858. },
  14859. listPublicForUser: {
  14860. method: "GET",
  14861. params: {
  14862. page: {
  14863. type: "integer"
  14864. },
  14865. per_page: {
  14866. type: "integer"
  14867. },
  14868. since: {
  14869. type: "string"
  14870. },
  14871. username: {
  14872. required: true,
  14873. type: "string"
  14874. }
  14875. },
  14876. url: "/users/:username/gists"
  14877. },
  14878. listStarred: {
  14879. method: "GET",
  14880. params: {
  14881. page: {
  14882. type: "integer"
  14883. },
  14884. per_page: {
  14885. type: "integer"
  14886. },
  14887. since: {
  14888. type: "string"
  14889. }
  14890. },
  14891. url: "/gists/starred"
  14892. },
  14893. star: {
  14894. method: "PUT",
  14895. params: {
  14896. gist_id: {
  14897. required: true,
  14898. type: "string"
  14899. }
  14900. },
  14901. url: "/gists/:gist_id/star"
  14902. },
  14903. unstar: {
  14904. method: "DELETE",
  14905. params: {
  14906. gist_id: {
  14907. required: true,
  14908. type: "string"
  14909. }
  14910. },
  14911. url: "/gists/:gist_id/star"
  14912. },
  14913. update: {
  14914. method: "PATCH",
  14915. params: {
  14916. description: {
  14917. type: "string"
  14918. },
  14919. files: {
  14920. type: "object"
  14921. },
  14922. "files.content": {
  14923. type: "string"
  14924. },
  14925. "files.filename": {
  14926. type: "string"
  14927. },
  14928. gist_id: {
  14929. required: true,
  14930. type: "string"
  14931. }
  14932. },
  14933. url: "/gists/:gist_id"
  14934. },
  14935. updateComment: {
  14936. method: "PATCH",
  14937. params: {
  14938. body: {
  14939. required: true,
  14940. type: "string"
  14941. },
  14942. comment_id: {
  14943. required: true,
  14944. type: "integer"
  14945. },
  14946. gist_id: {
  14947. required: true,
  14948. type: "string"
  14949. }
  14950. },
  14951. url: "/gists/:gist_id/comments/:comment_id"
  14952. }
  14953. },
  14954. git: {
  14955. createBlob: {
  14956. method: "POST",
  14957. params: {
  14958. content: {
  14959. required: true,
  14960. type: "string"
  14961. },
  14962. encoding: {
  14963. type: "string"
  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/git/blobs"
  14975. },
  14976. createCommit: {
  14977. method: "POST",
  14978. params: {
  14979. author: {
  14980. type: "object"
  14981. },
  14982. "author.date": {
  14983. type: "string"
  14984. },
  14985. "author.email": {
  14986. type: "string"
  14987. },
  14988. "author.name": {
  14989. type: "string"
  14990. },
  14991. committer: {
  14992. type: "object"
  14993. },
  14994. "committer.date": {
  14995. type: "string"
  14996. },
  14997. "committer.email": {
  14998. type: "string"
  14999. },
  15000. "committer.name": {
  15001. type: "string"
  15002. },
  15003. message: {
  15004. required: true,
  15005. type: "string"
  15006. },
  15007. owner: {
  15008. required: true,
  15009. type: "string"
  15010. },
  15011. parents: {
  15012. required: true,
  15013. type: "string[]"
  15014. },
  15015. repo: {
  15016. required: true,
  15017. type: "string"
  15018. },
  15019. signature: {
  15020. type: "string"
  15021. },
  15022. tree: {
  15023. required: true,
  15024. type: "string"
  15025. }
  15026. },
  15027. url: "/repos/:owner/:repo/git/commits"
  15028. },
  15029. createRef: {
  15030. method: "POST",
  15031. params: {
  15032. owner: {
  15033. required: true,
  15034. type: "string"
  15035. },
  15036. ref: {
  15037. required: true,
  15038. type: "string"
  15039. },
  15040. repo: {
  15041. required: true,
  15042. type: "string"
  15043. },
  15044. sha: {
  15045. required: true,
  15046. type: "string"
  15047. }
  15048. },
  15049. url: "/repos/:owner/:repo/git/refs"
  15050. },
  15051. createTag: {
  15052. method: "POST",
  15053. params: {
  15054. message: {
  15055. required: true,
  15056. type: "string"
  15057. },
  15058. object: {
  15059. required: true,
  15060. type: "string"
  15061. },
  15062. owner: {
  15063. required: true,
  15064. type: "string"
  15065. },
  15066. repo: {
  15067. required: true,
  15068. type: "string"
  15069. },
  15070. tag: {
  15071. required: true,
  15072. type: "string"
  15073. },
  15074. tagger: {
  15075. type: "object"
  15076. },
  15077. "tagger.date": {
  15078. type: "string"
  15079. },
  15080. "tagger.email": {
  15081. type: "string"
  15082. },
  15083. "tagger.name": {
  15084. type: "string"
  15085. },
  15086. type: {
  15087. enum: ["commit", "tree", "blob"],
  15088. required: true,
  15089. type: "string"
  15090. }
  15091. },
  15092. url: "/repos/:owner/:repo/git/tags"
  15093. },
  15094. createTree: {
  15095. method: "POST",
  15096. params: {
  15097. base_tree: {
  15098. type: "string"
  15099. },
  15100. owner: {
  15101. required: true,
  15102. type: "string"
  15103. },
  15104. repo: {
  15105. required: true,
  15106. type: "string"
  15107. },
  15108. tree: {
  15109. required: true,
  15110. type: "object[]"
  15111. },
  15112. "tree[].content": {
  15113. type: "string"
  15114. },
  15115. "tree[].mode": {
  15116. enum: ["100644", "100755", "040000", "160000", "120000"],
  15117. type: "string"
  15118. },
  15119. "tree[].path": {
  15120. type: "string"
  15121. },
  15122. "tree[].sha": {
  15123. allowNull: true,
  15124. type: "string"
  15125. },
  15126. "tree[].type": {
  15127. enum: ["blob", "tree", "commit"],
  15128. type: "string"
  15129. }
  15130. },
  15131. url: "/repos/:owner/:repo/git/trees"
  15132. },
  15133. deleteRef: {
  15134. method: "DELETE",
  15135. params: {
  15136. owner: {
  15137. required: true,
  15138. type: "string"
  15139. },
  15140. ref: {
  15141. required: true,
  15142. type: "string"
  15143. },
  15144. repo: {
  15145. required: true,
  15146. type: "string"
  15147. }
  15148. },
  15149. url: "/repos/:owner/:repo/git/refs/:ref"
  15150. },
  15151. getBlob: {
  15152. method: "GET",
  15153. params: {
  15154. file_sha: {
  15155. required: true,
  15156. type: "string"
  15157. },
  15158. owner: {
  15159. required: true,
  15160. type: "string"
  15161. },
  15162. repo: {
  15163. required: true,
  15164. type: "string"
  15165. }
  15166. },
  15167. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15168. },
  15169. getCommit: {
  15170. method: "GET",
  15171. params: {
  15172. commit_sha: {
  15173. required: true,
  15174. type: "string"
  15175. },
  15176. owner: {
  15177. required: true,
  15178. type: "string"
  15179. },
  15180. repo: {
  15181. required: true,
  15182. type: "string"
  15183. }
  15184. },
  15185. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15186. },
  15187. getRef: {
  15188. method: "GET",
  15189. params: {
  15190. owner: {
  15191. required: true,
  15192. type: "string"
  15193. },
  15194. ref: {
  15195. required: true,
  15196. type: "string"
  15197. },
  15198. repo: {
  15199. required: true,
  15200. type: "string"
  15201. }
  15202. },
  15203. url: "/repos/:owner/:repo/git/ref/:ref"
  15204. },
  15205. getTag: {
  15206. method: "GET",
  15207. params: {
  15208. owner: {
  15209. required: true,
  15210. type: "string"
  15211. },
  15212. repo: {
  15213. required: true,
  15214. type: "string"
  15215. },
  15216. tag_sha: {
  15217. required: true,
  15218. type: "string"
  15219. }
  15220. },
  15221. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15222. },
  15223. getTree: {
  15224. method: "GET",
  15225. params: {
  15226. owner: {
  15227. required: true,
  15228. type: "string"
  15229. },
  15230. recursive: {
  15231. enum: ["1"],
  15232. type: "integer"
  15233. },
  15234. repo: {
  15235. required: true,
  15236. type: "string"
  15237. },
  15238. tree_sha: {
  15239. required: true,
  15240. type: "string"
  15241. }
  15242. },
  15243. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15244. },
  15245. listMatchingRefs: {
  15246. method: "GET",
  15247. params: {
  15248. owner: {
  15249. required: true,
  15250. type: "string"
  15251. },
  15252. page: {
  15253. type: "integer"
  15254. },
  15255. per_page: {
  15256. type: "integer"
  15257. },
  15258. ref: {
  15259. required: true,
  15260. type: "string"
  15261. },
  15262. repo: {
  15263. required: true,
  15264. type: "string"
  15265. }
  15266. },
  15267. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15268. },
  15269. listRefs: {
  15270. method: "GET",
  15271. params: {
  15272. namespace: {
  15273. type: "string"
  15274. },
  15275. owner: {
  15276. required: true,
  15277. type: "string"
  15278. },
  15279. page: {
  15280. type: "integer"
  15281. },
  15282. per_page: {
  15283. type: "integer"
  15284. },
  15285. repo: {
  15286. required: true,
  15287. type: "string"
  15288. }
  15289. },
  15290. url: "/repos/:owner/:repo/git/refs/:namespace"
  15291. },
  15292. updateRef: {
  15293. method: "PATCH",
  15294. params: {
  15295. force: {
  15296. type: "boolean"
  15297. },
  15298. owner: {
  15299. required: true,
  15300. type: "string"
  15301. },
  15302. ref: {
  15303. required: true,
  15304. type: "string"
  15305. },
  15306. repo: {
  15307. required: true,
  15308. type: "string"
  15309. },
  15310. sha: {
  15311. required: true,
  15312. type: "string"
  15313. }
  15314. },
  15315. url: "/repos/:owner/:repo/git/refs/:ref"
  15316. }
  15317. },
  15318. gitignore: {
  15319. getTemplate: {
  15320. method: "GET",
  15321. params: {
  15322. name: {
  15323. required: true,
  15324. type: "string"
  15325. }
  15326. },
  15327. url: "/gitignore/templates/:name"
  15328. },
  15329. listTemplates: {
  15330. method: "GET",
  15331. params: {},
  15332. url: "/gitignore/templates"
  15333. }
  15334. },
  15335. interactions: {
  15336. addOrUpdateRestrictionsForOrg: {
  15337. headers: {
  15338. accept: "application/vnd.github.sombra-preview+json"
  15339. },
  15340. method: "PUT",
  15341. params: {
  15342. limit: {
  15343. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15344. required: true,
  15345. type: "string"
  15346. },
  15347. org: {
  15348. required: true,
  15349. type: "string"
  15350. }
  15351. },
  15352. url: "/orgs/:org/interaction-limits"
  15353. },
  15354. addOrUpdateRestrictionsForRepo: {
  15355. headers: {
  15356. accept: "application/vnd.github.sombra-preview+json"
  15357. },
  15358. method: "PUT",
  15359. params: {
  15360. limit: {
  15361. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15362. required: true,
  15363. type: "string"
  15364. },
  15365. owner: {
  15366. required: true,
  15367. type: "string"
  15368. },
  15369. repo: {
  15370. required: true,
  15371. type: "string"
  15372. }
  15373. },
  15374. url: "/repos/:owner/:repo/interaction-limits"
  15375. },
  15376. getRestrictionsForOrg: {
  15377. headers: {
  15378. accept: "application/vnd.github.sombra-preview+json"
  15379. },
  15380. method: "GET",
  15381. params: {
  15382. org: {
  15383. required: true,
  15384. type: "string"
  15385. }
  15386. },
  15387. url: "/orgs/:org/interaction-limits"
  15388. },
  15389. getRestrictionsForRepo: {
  15390. headers: {
  15391. accept: "application/vnd.github.sombra-preview+json"
  15392. },
  15393. method: "GET",
  15394. params: {
  15395. owner: {
  15396. required: true,
  15397. type: "string"
  15398. },
  15399. repo: {
  15400. required: true,
  15401. type: "string"
  15402. }
  15403. },
  15404. url: "/repos/:owner/:repo/interaction-limits"
  15405. },
  15406. removeRestrictionsForOrg: {
  15407. headers: {
  15408. accept: "application/vnd.github.sombra-preview+json"
  15409. },
  15410. method: "DELETE",
  15411. params: {
  15412. org: {
  15413. required: true,
  15414. type: "string"
  15415. }
  15416. },
  15417. url: "/orgs/:org/interaction-limits"
  15418. },
  15419. removeRestrictionsForRepo: {
  15420. headers: {
  15421. accept: "application/vnd.github.sombra-preview+json"
  15422. },
  15423. method: "DELETE",
  15424. params: {
  15425. owner: {
  15426. required: true,
  15427. type: "string"
  15428. },
  15429. repo: {
  15430. required: true,
  15431. type: "string"
  15432. }
  15433. },
  15434. url: "/repos/:owner/:repo/interaction-limits"
  15435. }
  15436. },
  15437. issues: {
  15438. addAssignees: {
  15439. method: "POST",
  15440. params: {
  15441. assignees: {
  15442. type: "string[]"
  15443. },
  15444. issue_number: {
  15445. required: true,
  15446. type: "integer"
  15447. },
  15448. number: {
  15449. alias: "issue_number",
  15450. deprecated: true,
  15451. type: "integer"
  15452. },
  15453. owner: {
  15454. required: true,
  15455. type: "string"
  15456. },
  15457. repo: {
  15458. required: true,
  15459. type: "string"
  15460. }
  15461. },
  15462. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15463. },
  15464. addLabels: {
  15465. method: "POST",
  15466. params: {
  15467. issue_number: {
  15468. required: true,
  15469. type: "integer"
  15470. },
  15471. labels: {
  15472. required: true,
  15473. type: "string[]"
  15474. },
  15475. number: {
  15476. alias: "issue_number",
  15477. deprecated: true,
  15478. type: "integer"
  15479. },
  15480. owner: {
  15481. required: true,
  15482. type: "string"
  15483. },
  15484. repo: {
  15485. required: true,
  15486. type: "string"
  15487. }
  15488. },
  15489. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15490. },
  15491. checkAssignee: {
  15492. method: "GET",
  15493. params: {
  15494. assignee: {
  15495. required: true,
  15496. type: "string"
  15497. },
  15498. owner: {
  15499. required: true,
  15500. type: "string"
  15501. },
  15502. repo: {
  15503. required: true,
  15504. type: "string"
  15505. }
  15506. },
  15507. url: "/repos/:owner/:repo/assignees/:assignee"
  15508. },
  15509. create: {
  15510. method: "POST",
  15511. params: {
  15512. assignee: {
  15513. type: "string"
  15514. },
  15515. assignees: {
  15516. type: "string[]"
  15517. },
  15518. body: {
  15519. type: "string"
  15520. },
  15521. labels: {
  15522. type: "string[]"
  15523. },
  15524. milestone: {
  15525. type: "integer"
  15526. },
  15527. owner: {
  15528. required: true,
  15529. type: "string"
  15530. },
  15531. repo: {
  15532. required: true,
  15533. type: "string"
  15534. },
  15535. title: {
  15536. required: true,
  15537. type: "string"
  15538. }
  15539. },
  15540. url: "/repos/:owner/:repo/issues"
  15541. },
  15542. createComment: {
  15543. method: "POST",
  15544. params: {
  15545. body: {
  15546. required: true,
  15547. type: "string"
  15548. },
  15549. issue_number: {
  15550. required: true,
  15551. type: "integer"
  15552. },
  15553. number: {
  15554. alias: "issue_number",
  15555. deprecated: true,
  15556. type: "integer"
  15557. },
  15558. owner: {
  15559. required: true,
  15560. type: "string"
  15561. },
  15562. repo: {
  15563. required: true,
  15564. type: "string"
  15565. }
  15566. },
  15567. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15568. },
  15569. createLabel: {
  15570. method: "POST",
  15571. params: {
  15572. color: {
  15573. required: true,
  15574. type: "string"
  15575. },
  15576. description: {
  15577. type: "string"
  15578. },
  15579. name: {
  15580. required: true,
  15581. type: "string"
  15582. },
  15583. owner: {
  15584. required: true,
  15585. type: "string"
  15586. },
  15587. repo: {
  15588. required: true,
  15589. type: "string"
  15590. }
  15591. },
  15592. url: "/repos/:owner/:repo/labels"
  15593. },
  15594. createMilestone: {
  15595. method: "POST",
  15596. params: {
  15597. description: {
  15598. type: "string"
  15599. },
  15600. due_on: {
  15601. type: "string"
  15602. },
  15603. owner: {
  15604. required: true,
  15605. type: "string"
  15606. },
  15607. repo: {
  15608. required: true,
  15609. type: "string"
  15610. },
  15611. state: {
  15612. enum: ["open", "closed"],
  15613. type: "string"
  15614. },
  15615. title: {
  15616. required: true,
  15617. type: "string"
  15618. }
  15619. },
  15620. url: "/repos/:owner/:repo/milestones"
  15621. },
  15622. deleteComment: {
  15623. method: "DELETE",
  15624. params: {
  15625. comment_id: {
  15626. required: true,
  15627. type: "integer"
  15628. },
  15629. owner: {
  15630. required: true,
  15631. type: "string"
  15632. },
  15633. repo: {
  15634. required: true,
  15635. type: "string"
  15636. }
  15637. },
  15638. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15639. },
  15640. deleteLabel: {
  15641. method: "DELETE",
  15642. params: {
  15643. name: {
  15644. required: true,
  15645. type: "string"
  15646. },
  15647. owner: {
  15648. required: true,
  15649. type: "string"
  15650. },
  15651. repo: {
  15652. required: true,
  15653. type: "string"
  15654. }
  15655. },
  15656. url: "/repos/:owner/:repo/labels/:name"
  15657. },
  15658. deleteMilestone: {
  15659. method: "DELETE",
  15660. params: {
  15661. milestone_number: {
  15662. required: true,
  15663. type: "integer"
  15664. },
  15665. number: {
  15666. alias: "milestone_number",
  15667. deprecated: true,
  15668. type: "integer"
  15669. },
  15670. owner: {
  15671. required: true,
  15672. type: "string"
  15673. },
  15674. repo: {
  15675. required: true,
  15676. type: "string"
  15677. }
  15678. },
  15679. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15680. },
  15681. get: {
  15682. method: "GET",
  15683. params: {
  15684. issue_number: {
  15685. required: true,
  15686. type: "integer"
  15687. },
  15688. number: {
  15689. alias: "issue_number",
  15690. deprecated: true,
  15691. type: "integer"
  15692. },
  15693. owner: {
  15694. required: true,
  15695. type: "string"
  15696. },
  15697. repo: {
  15698. required: true,
  15699. type: "string"
  15700. }
  15701. },
  15702. url: "/repos/:owner/:repo/issues/:issue_number"
  15703. },
  15704. getComment: {
  15705. method: "GET",
  15706. params: {
  15707. comment_id: {
  15708. required: true,
  15709. type: "integer"
  15710. },
  15711. owner: {
  15712. required: true,
  15713. type: "string"
  15714. },
  15715. repo: {
  15716. required: true,
  15717. type: "string"
  15718. }
  15719. },
  15720. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15721. },
  15722. getEvent: {
  15723. method: "GET",
  15724. params: {
  15725. event_id: {
  15726. required: true,
  15727. type: "integer"
  15728. },
  15729. owner: {
  15730. required: true,
  15731. type: "string"
  15732. },
  15733. repo: {
  15734. required: true,
  15735. type: "string"
  15736. }
  15737. },
  15738. url: "/repos/:owner/:repo/issues/events/:event_id"
  15739. },
  15740. getLabel: {
  15741. method: "GET",
  15742. params: {
  15743. name: {
  15744. required: true,
  15745. type: "string"
  15746. },
  15747. owner: {
  15748. required: true,
  15749. type: "string"
  15750. },
  15751. repo: {
  15752. required: true,
  15753. type: "string"
  15754. }
  15755. },
  15756. url: "/repos/:owner/:repo/labels/:name"
  15757. },
  15758. getMilestone: {
  15759. method: "GET",
  15760. params: {
  15761. milestone_number: {
  15762. required: true,
  15763. type: "integer"
  15764. },
  15765. number: {
  15766. alias: "milestone_number",
  15767. deprecated: true,
  15768. type: "integer"
  15769. },
  15770. owner: {
  15771. required: true,
  15772. type: "string"
  15773. },
  15774. repo: {
  15775. required: true,
  15776. type: "string"
  15777. }
  15778. },
  15779. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15780. },
  15781. list: {
  15782. method: "GET",
  15783. params: {
  15784. direction: {
  15785. enum: ["asc", "desc"],
  15786. type: "string"
  15787. },
  15788. filter: {
  15789. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15790. type: "string"
  15791. },
  15792. labels: {
  15793. type: "string"
  15794. },
  15795. page: {
  15796. type: "integer"
  15797. },
  15798. per_page: {
  15799. type: "integer"
  15800. },
  15801. since: {
  15802. type: "string"
  15803. },
  15804. sort: {
  15805. enum: ["created", "updated", "comments"],
  15806. type: "string"
  15807. },
  15808. state: {
  15809. enum: ["open", "closed", "all"],
  15810. type: "string"
  15811. }
  15812. },
  15813. url: "/issues"
  15814. },
  15815. listAssignees: {
  15816. method: "GET",
  15817. params: {
  15818. owner: {
  15819. required: true,
  15820. type: "string"
  15821. },
  15822. page: {
  15823. type: "integer"
  15824. },
  15825. per_page: {
  15826. type: "integer"
  15827. },
  15828. repo: {
  15829. required: true,
  15830. type: "string"
  15831. }
  15832. },
  15833. url: "/repos/:owner/:repo/assignees"
  15834. },
  15835. listComments: {
  15836. method: "GET",
  15837. params: {
  15838. issue_number: {
  15839. required: true,
  15840. type: "integer"
  15841. },
  15842. number: {
  15843. alias: "issue_number",
  15844. deprecated: true,
  15845. type: "integer"
  15846. },
  15847. owner: {
  15848. required: true,
  15849. type: "string"
  15850. },
  15851. page: {
  15852. type: "integer"
  15853. },
  15854. per_page: {
  15855. type: "integer"
  15856. },
  15857. repo: {
  15858. required: true,
  15859. type: "string"
  15860. },
  15861. since: {
  15862. type: "string"
  15863. }
  15864. },
  15865. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15866. },
  15867. listCommentsForRepo: {
  15868. method: "GET",
  15869. params: {
  15870. direction: {
  15871. enum: ["asc", "desc"],
  15872. type: "string"
  15873. },
  15874. owner: {
  15875. required: true,
  15876. type: "string"
  15877. },
  15878. repo: {
  15879. required: true,
  15880. type: "string"
  15881. },
  15882. since: {
  15883. type: "string"
  15884. },
  15885. sort: {
  15886. enum: ["created", "updated"],
  15887. type: "string"
  15888. }
  15889. },
  15890. url: "/repos/:owner/:repo/issues/comments"
  15891. },
  15892. listEvents: {
  15893. method: "GET",
  15894. params: {
  15895. issue_number: {
  15896. required: true,
  15897. type: "integer"
  15898. },
  15899. number: {
  15900. alias: "issue_number",
  15901. deprecated: true,
  15902. type: "integer"
  15903. },
  15904. owner: {
  15905. required: true,
  15906. type: "string"
  15907. },
  15908. page: {
  15909. type: "integer"
  15910. },
  15911. per_page: {
  15912. type: "integer"
  15913. },
  15914. repo: {
  15915. required: true,
  15916. type: "string"
  15917. }
  15918. },
  15919. url: "/repos/:owner/:repo/issues/:issue_number/events"
  15920. },
  15921. listEventsForRepo: {
  15922. method: "GET",
  15923. params: {
  15924. owner: {
  15925. required: true,
  15926. type: "string"
  15927. },
  15928. page: {
  15929. type: "integer"
  15930. },
  15931. per_page: {
  15932. type: "integer"
  15933. },
  15934. repo: {
  15935. required: true,
  15936. type: "string"
  15937. }
  15938. },
  15939. url: "/repos/:owner/:repo/issues/events"
  15940. },
  15941. listEventsForTimeline: {
  15942. headers: {
  15943. accept: "application/vnd.github.mockingbird-preview+json"
  15944. },
  15945. method: "GET",
  15946. params: {
  15947. issue_number: {
  15948. required: true,
  15949. type: "integer"
  15950. },
  15951. number: {
  15952. alias: "issue_number",
  15953. deprecated: true,
  15954. type: "integer"
  15955. },
  15956. owner: {
  15957. required: true,
  15958. type: "string"
  15959. },
  15960. page: {
  15961. type: "integer"
  15962. },
  15963. per_page: {
  15964. type: "integer"
  15965. },
  15966. repo: {
  15967. required: true,
  15968. type: "string"
  15969. }
  15970. },
  15971. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  15972. },
  15973. listForAuthenticatedUser: {
  15974. method: "GET",
  15975. params: {
  15976. direction: {
  15977. enum: ["asc", "desc"],
  15978. type: "string"
  15979. },
  15980. filter: {
  15981. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15982. type: "string"
  15983. },
  15984. labels: {
  15985. type: "string"
  15986. },
  15987. page: {
  15988. type: "integer"
  15989. },
  15990. per_page: {
  15991. type: "integer"
  15992. },
  15993. since: {
  15994. type: "string"
  15995. },
  15996. sort: {
  15997. enum: ["created", "updated", "comments"],
  15998. type: "string"
  15999. },
  16000. state: {
  16001. enum: ["open", "closed", "all"],
  16002. type: "string"
  16003. }
  16004. },
  16005. url: "/user/issues"
  16006. },
  16007. listForOrg: {
  16008. method: "GET",
  16009. params: {
  16010. direction: {
  16011. enum: ["asc", "desc"],
  16012. type: "string"
  16013. },
  16014. filter: {
  16015. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16016. type: "string"
  16017. },
  16018. labels: {
  16019. type: "string"
  16020. },
  16021. org: {
  16022. required: true,
  16023. type: "string"
  16024. },
  16025. page: {
  16026. type: "integer"
  16027. },
  16028. per_page: {
  16029. type: "integer"
  16030. },
  16031. since: {
  16032. type: "string"
  16033. },
  16034. sort: {
  16035. enum: ["created", "updated", "comments"],
  16036. type: "string"
  16037. },
  16038. state: {
  16039. enum: ["open", "closed", "all"],
  16040. type: "string"
  16041. }
  16042. },
  16043. url: "/orgs/:org/issues"
  16044. },
  16045. listForRepo: {
  16046. method: "GET",
  16047. params: {
  16048. assignee: {
  16049. type: "string"
  16050. },
  16051. creator: {
  16052. type: "string"
  16053. },
  16054. direction: {
  16055. enum: ["asc", "desc"],
  16056. type: "string"
  16057. },
  16058. labels: {
  16059. type: "string"
  16060. },
  16061. mentioned: {
  16062. type: "string"
  16063. },
  16064. milestone: {
  16065. type: "string"
  16066. },
  16067. owner: {
  16068. required: true,
  16069. type: "string"
  16070. },
  16071. page: {
  16072. type: "integer"
  16073. },
  16074. per_page: {
  16075. type: "integer"
  16076. },
  16077. repo: {
  16078. required: true,
  16079. type: "string"
  16080. },
  16081. since: {
  16082. type: "string"
  16083. },
  16084. sort: {
  16085. enum: ["created", "updated", "comments"],
  16086. type: "string"
  16087. },
  16088. state: {
  16089. enum: ["open", "closed", "all"],
  16090. type: "string"
  16091. }
  16092. },
  16093. url: "/repos/:owner/:repo/issues"
  16094. },
  16095. listLabelsForMilestone: {
  16096. method: "GET",
  16097. params: {
  16098. milestone_number: {
  16099. required: true,
  16100. type: "integer"
  16101. },
  16102. number: {
  16103. alias: "milestone_number",
  16104. deprecated: true,
  16105. type: "integer"
  16106. },
  16107. owner: {
  16108. required: true,
  16109. type: "string"
  16110. },
  16111. page: {
  16112. type: "integer"
  16113. },
  16114. per_page: {
  16115. type: "integer"
  16116. },
  16117. repo: {
  16118. required: true,
  16119. type: "string"
  16120. }
  16121. },
  16122. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16123. },
  16124. listLabelsForRepo: {
  16125. method: "GET",
  16126. params: {
  16127. owner: {
  16128. required: true,
  16129. type: "string"
  16130. },
  16131. page: {
  16132. type: "integer"
  16133. },
  16134. per_page: {
  16135. type: "integer"
  16136. },
  16137. repo: {
  16138. required: true,
  16139. type: "string"
  16140. }
  16141. },
  16142. url: "/repos/:owner/:repo/labels"
  16143. },
  16144. listLabelsOnIssue: {
  16145. method: "GET",
  16146. params: {
  16147. issue_number: {
  16148. required: true,
  16149. type: "integer"
  16150. },
  16151. number: {
  16152. alias: "issue_number",
  16153. deprecated: true,
  16154. type: "integer"
  16155. },
  16156. owner: {
  16157. required: true,
  16158. type: "string"
  16159. },
  16160. page: {
  16161. type: "integer"
  16162. },
  16163. per_page: {
  16164. type: "integer"
  16165. },
  16166. repo: {
  16167. required: true,
  16168. type: "string"
  16169. }
  16170. },
  16171. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16172. },
  16173. listMilestonesForRepo: {
  16174. method: "GET",
  16175. params: {
  16176. direction: {
  16177. enum: ["asc", "desc"],
  16178. type: "string"
  16179. },
  16180. owner: {
  16181. required: true,
  16182. type: "string"
  16183. },
  16184. page: {
  16185. type: "integer"
  16186. },
  16187. per_page: {
  16188. type: "integer"
  16189. },
  16190. repo: {
  16191. required: true,
  16192. type: "string"
  16193. },
  16194. sort: {
  16195. enum: ["due_on", "completeness"],
  16196. type: "string"
  16197. },
  16198. state: {
  16199. enum: ["open", "closed", "all"],
  16200. type: "string"
  16201. }
  16202. },
  16203. url: "/repos/:owner/:repo/milestones"
  16204. },
  16205. lock: {
  16206. method: "PUT",
  16207. params: {
  16208. issue_number: {
  16209. required: true,
  16210. type: "integer"
  16211. },
  16212. lock_reason: {
  16213. enum: ["off-topic", "too heated", "resolved", "spam"],
  16214. type: "string"
  16215. },
  16216. number: {
  16217. alias: "issue_number",
  16218. deprecated: true,
  16219. type: "integer"
  16220. },
  16221. owner: {
  16222. required: true,
  16223. type: "string"
  16224. },
  16225. repo: {
  16226. required: true,
  16227. type: "string"
  16228. }
  16229. },
  16230. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16231. },
  16232. removeAssignees: {
  16233. method: "DELETE",
  16234. params: {
  16235. assignees: {
  16236. type: "string[]"
  16237. },
  16238. issue_number: {
  16239. required: true,
  16240. type: "integer"
  16241. },
  16242. number: {
  16243. alias: "issue_number",
  16244. deprecated: true,
  16245. type: "integer"
  16246. },
  16247. owner: {
  16248. required: true,
  16249. type: "string"
  16250. },
  16251. repo: {
  16252. required: true,
  16253. type: "string"
  16254. }
  16255. },
  16256. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16257. },
  16258. removeLabel: {
  16259. method: "DELETE",
  16260. params: {
  16261. issue_number: {
  16262. required: true,
  16263. type: "integer"
  16264. },
  16265. name: {
  16266. required: true,
  16267. type: "string"
  16268. },
  16269. number: {
  16270. alias: "issue_number",
  16271. deprecated: true,
  16272. type: "integer"
  16273. },
  16274. owner: {
  16275. required: true,
  16276. type: "string"
  16277. },
  16278. repo: {
  16279. required: true,
  16280. type: "string"
  16281. }
  16282. },
  16283. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16284. },
  16285. removeLabels: {
  16286. method: "DELETE",
  16287. params: {
  16288. issue_number: {
  16289. required: true,
  16290. type: "integer"
  16291. },
  16292. number: {
  16293. alias: "issue_number",
  16294. deprecated: true,
  16295. type: "integer"
  16296. },
  16297. owner: {
  16298. required: true,
  16299. type: "string"
  16300. },
  16301. repo: {
  16302. required: true,
  16303. type: "string"
  16304. }
  16305. },
  16306. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16307. },
  16308. replaceLabels: {
  16309. method: "PUT",
  16310. params: {
  16311. issue_number: {
  16312. required: true,
  16313. type: "integer"
  16314. },
  16315. labels: {
  16316. type: "string[]"
  16317. },
  16318. number: {
  16319. alias: "issue_number",
  16320. deprecated: true,
  16321. type: "integer"
  16322. },
  16323. owner: {
  16324. required: true,
  16325. type: "string"
  16326. },
  16327. repo: {
  16328. required: true,
  16329. type: "string"
  16330. }
  16331. },
  16332. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16333. },
  16334. unlock: {
  16335. method: "DELETE",
  16336. params: {
  16337. issue_number: {
  16338. required: true,
  16339. type: "integer"
  16340. },
  16341. number: {
  16342. alias: "issue_number",
  16343. deprecated: true,
  16344. type: "integer"
  16345. },
  16346. owner: {
  16347. required: true,
  16348. type: "string"
  16349. },
  16350. repo: {
  16351. required: true,
  16352. type: "string"
  16353. }
  16354. },
  16355. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16356. },
  16357. update: {
  16358. method: "PATCH",
  16359. params: {
  16360. assignee: {
  16361. type: "string"
  16362. },
  16363. assignees: {
  16364. type: "string[]"
  16365. },
  16366. body: {
  16367. type: "string"
  16368. },
  16369. issue_number: {
  16370. required: true,
  16371. type: "integer"
  16372. },
  16373. labels: {
  16374. type: "string[]"
  16375. },
  16376. milestone: {
  16377. allowNull: 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. repo: {
  16390. required: true,
  16391. type: "string"
  16392. },
  16393. state: {
  16394. enum: ["open", "closed"],
  16395. type: "string"
  16396. },
  16397. title: {
  16398. type: "string"
  16399. }
  16400. },
  16401. url: "/repos/:owner/:repo/issues/:issue_number"
  16402. },
  16403. updateComment: {
  16404. method: "PATCH",
  16405. params: {
  16406. body: {
  16407. required: true,
  16408. type: "string"
  16409. },
  16410. comment_id: {
  16411. required: true,
  16412. type: "integer"
  16413. },
  16414. owner: {
  16415. required: true,
  16416. type: "string"
  16417. },
  16418. repo: {
  16419. required: true,
  16420. type: "string"
  16421. }
  16422. },
  16423. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16424. },
  16425. updateLabel: {
  16426. method: "PATCH",
  16427. params: {
  16428. color: {
  16429. type: "string"
  16430. },
  16431. current_name: {
  16432. required: true,
  16433. type: "string"
  16434. },
  16435. description: {
  16436. type: "string"
  16437. },
  16438. name: {
  16439. type: "string"
  16440. },
  16441. owner: {
  16442. required: true,
  16443. type: "string"
  16444. },
  16445. repo: {
  16446. required: true,
  16447. type: "string"
  16448. }
  16449. },
  16450. url: "/repos/:owner/:repo/labels/:current_name"
  16451. },
  16452. updateMilestone: {
  16453. method: "PATCH",
  16454. params: {
  16455. description: {
  16456. type: "string"
  16457. },
  16458. due_on: {
  16459. type: "string"
  16460. },
  16461. milestone_number: {
  16462. required: true,
  16463. type: "integer"
  16464. },
  16465. number: {
  16466. alias: "milestone_number",
  16467. deprecated: true,
  16468. type: "integer"
  16469. },
  16470. owner: {
  16471. required: true,
  16472. type: "string"
  16473. },
  16474. repo: {
  16475. required: true,
  16476. type: "string"
  16477. },
  16478. state: {
  16479. enum: ["open", "closed"],
  16480. type: "string"
  16481. },
  16482. title: {
  16483. type: "string"
  16484. }
  16485. },
  16486. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16487. }
  16488. },
  16489. licenses: {
  16490. get: {
  16491. method: "GET",
  16492. params: {
  16493. license: {
  16494. required: true,
  16495. type: "string"
  16496. }
  16497. },
  16498. url: "/licenses/:license"
  16499. },
  16500. getForRepo: {
  16501. method: "GET",
  16502. params: {
  16503. owner: {
  16504. required: true,
  16505. type: "string"
  16506. },
  16507. repo: {
  16508. required: true,
  16509. type: "string"
  16510. }
  16511. },
  16512. url: "/repos/:owner/:repo/license"
  16513. },
  16514. list: {
  16515. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16516. method: "GET",
  16517. params: {},
  16518. url: "/licenses"
  16519. },
  16520. listCommonlyUsed: {
  16521. method: "GET",
  16522. params: {},
  16523. url: "/licenses"
  16524. }
  16525. },
  16526. markdown: {
  16527. render: {
  16528. method: "POST",
  16529. params: {
  16530. context: {
  16531. type: "string"
  16532. },
  16533. mode: {
  16534. enum: ["markdown", "gfm"],
  16535. type: "string"
  16536. },
  16537. text: {
  16538. required: true,
  16539. type: "string"
  16540. }
  16541. },
  16542. url: "/markdown"
  16543. },
  16544. renderRaw: {
  16545. headers: {
  16546. "content-type": "text/plain; charset=utf-8"
  16547. },
  16548. method: "POST",
  16549. params: {
  16550. data: {
  16551. mapTo: "data",
  16552. required: true,
  16553. type: "string"
  16554. }
  16555. },
  16556. url: "/markdown/raw"
  16557. }
  16558. },
  16559. meta: {
  16560. get: {
  16561. method: "GET",
  16562. params: {},
  16563. url: "/meta"
  16564. }
  16565. },
  16566. migrations: {
  16567. cancelImport: {
  16568. method: "DELETE",
  16569. params: {
  16570. owner: {
  16571. required: true,
  16572. type: "string"
  16573. },
  16574. repo: {
  16575. required: true,
  16576. type: "string"
  16577. }
  16578. },
  16579. url: "/repos/:owner/:repo/import"
  16580. },
  16581. deleteArchiveForAuthenticatedUser: {
  16582. headers: {
  16583. accept: "application/vnd.github.wyandotte-preview+json"
  16584. },
  16585. method: "DELETE",
  16586. params: {
  16587. migration_id: {
  16588. required: true,
  16589. type: "integer"
  16590. }
  16591. },
  16592. url: "/user/migrations/:migration_id/archive"
  16593. },
  16594. deleteArchiveForOrg: {
  16595. headers: {
  16596. accept: "application/vnd.github.wyandotte-preview+json"
  16597. },
  16598. method: "DELETE",
  16599. params: {
  16600. migration_id: {
  16601. required: true,
  16602. type: "integer"
  16603. },
  16604. org: {
  16605. required: true,
  16606. type: "string"
  16607. }
  16608. },
  16609. url: "/orgs/:org/migrations/:migration_id/archive"
  16610. },
  16611. downloadArchiveForOrg: {
  16612. headers: {
  16613. accept: "application/vnd.github.wyandotte-preview+json"
  16614. },
  16615. method: "GET",
  16616. params: {
  16617. migration_id: {
  16618. required: true,
  16619. type: "integer"
  16620. },
  16621. org: {
  16622. required: true,
  16623. type: "string"
  16624. }
  16625. },
  16626. url: "/orgs/:org/migrations/:migration_id/archive"
  16627. },
  16628. getArchiveForAuthenticatedUser: {
  16629. headers: {
  16630. accept: "application/vnd.github.wyandotte-preview+json"
  16631. },
  16632. method: "GET",
  16633. params: {
  16634. migration_id: {
  16635. required: true,
  16636. type: "integer"
  16637. }
  16638. },
  16639. url: "/user/migrations/:migration_id/archive"
  16640. },
  16641. getArchiveForOrg: {
  16642. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16643. headers: {
  16644. accept: "application/vnd.github.wyandotte-preview+json"
  16645. },
  16646. method: "GET",
  16647. params: {
  16648. migration_id: {
  16649. required: true,
  16650. type: "integer"
  16651. },
  16652. org: {
  16653. required: true,
  16654. type: "string"
  16655. }
  16656. },
  16657. url: "/orgs/:org/migrations/:migration_id/archive"
  16658. },
  16659. getCommitAuthors: {
  16660. method: "GET",
  16661. params: {
  16662. owner: {
  16663. required: true,
  16664. type: "string"
  16665. },
  16666. repo: {
  16667. required: true,
  16668. type: "string"
  16669. },
  16670. since: {
  16671. type: "string"
  16672. }
  16673. },
  16674. url: "/repos/:owner/:repo/import/authors"
  16675. },
  16676. getImportProgress: {
  16677. method: "GET",
  16678. params: {
  16679. owner: {
  16680. required: true,
  16681. type: "string"
  16682. },
  16683. repo: {
  16684. required: true,
  16685. type: "string"
  16686. }
  16687. },
  16688. url: "/repos/:owner/:repo/import"
  16689. },
  16690. getLargeFiles: {
  16691. method: "GET",
  16692. params: {
  16693. owner: {
  16694. required: true,
  16695. type: "string"
  16696. },
  16697. repo: {
  16698. required: true,
  16699. type: "string"
  16700. }
  16701. },
  16702. url: "/repos/:owner/:repo/import/large_files"
  16703. },
  16704. getStatusForAuthenticatedUser: {
  16705. headers: {
  16706. accept: "application/vnd.github.wyandotte-preview+json"
  16707. },
  16708. method: "GET",
  16709. params: {
  16710. migration_id: {
  16711. required: true,
  16712. type: "integer"
  16713. }
  16714. },
  16715. url: "/user/migrations/:migration_id"
  16716. },
  16717. getStatusForOrg: {
  16718. headers: {
  16719. accept: "application/vnd.github.wyandotte-preview+json"
  16720. },
  16721. method: "GET",
  16722. params: {
  16723. migration_id: {
  16724. required: true,
  16725. type: "integer"
  16726. },
  16727. org: {
  16728. required: true,
  16729. type: "string"
  16730. }
  16731. },
  16732. url: "/orgs/:org/migrations/:migration_id"
  16733. },
  16734. listForAuthenticatedUser: {
  16735. headers: {
  16736. accept: "application/vnd.github.wyandotte-preview+json"
  16737. },
  16738. method: "GET",
  16739. params: {
  16740. page: {
  16741. type: "integer"
  16742. },
  16743. per_page: {
  16744. type: "integer"
  16745. }
  16746. },
  16747. url: "/user/migrations"
  16748. },
  16749. listForOrg: {
  16750. headers: {
  16751. accept: "application/vnd.github.wyandotte-preview+json"
  16752. },
  16753. method: "GET",
  16754. params: {
  16755. org: {
  16756. required: true,
  16757. type: "string"
  16758. },
  16759. page: {
  16760. type: "integer"
  16761. },
  16762. per_page: {
  16763. type: "integer"
  16764. }
  16765. },
  16766. url: "/orgs/:org/migrations"
  16767. },
  16768. listReposForOrg: {
  16769. headers: {
  16770. accept: "application/vnd.github.wyandotte-preview+json"
  16771. },
  16772. method: "GET",
  16773. params: {
  16774. migration_id: {
  16775. required: true,
  16776. type: "integer"
  16777. },
  16778. org: {
  16779. required: true,
  16780. type: "string"
  16781. },
  16782. page: {
  16783. type: "integer"
  16784. },
  16785. per_page: {
  16786. type: "integer"
  16787. }
  16788. },
  16789. url: "/orgs/:org/migrations/:migration_id/repositories"
  16790. },
  16791. listReposForUser: {
  16792. headers: {
  16793. accept: "application/vnd.github.wyandotte-preview+json"
  16794. },
  16795. method: "GET",
  16796. params: {
  16797. migration_id: {
  16798. required: true,
  16799. type: "integer"
  16800. },
  16801. page: {
  16802. type: "integer"
  16803. },
  16804. per_page: {
  16805. type: "integer"
  16806. }
  16807. },
  16808. url: "/user/:migration_id/repositories"
  16809. },
  16810. mapCommitAuthor: {
  16811. method: "PATCH",
  16812. params: {
  16813. author_id: {
  16814. required: true,
  16815. type: "integer"
  16816. },
  16817. email: {
  16818. type: "string"
  16819. },
  16820. name: {
  16821. type: "string"
  16822. },
  16823. owner: {
  16824. required: true,
  16825. type: "string"
  16826. },
  16827. repo: {
  16828. required: true,
  16829. type: "string"
  16830. }
  16831. },
  16832. url: "/repos/:owner/:repo/import/authors/:author_id"
  16833. },
  16834. setLfsPreference: {
  16835. method: "PATCH",
  16836. params: {
  16837. owner: {
  16838. required: true,
  16839. type: "string"
  16840. },
  16841. repo: {
  16842. required: true,
  16843. type: "string"
  16844. },
  16845. use_lfs: {
  16846. enum: ["opt_in", "opt_out"],
  16847. required: true,
  16848. type: "string"
  16849. }
  16850. },
  16851. url: "/repos/:owner/:repo/import/lfs"
  16852. },
  16853. startForAuthenticatedUser: {
  16854. method: "POST",
  16855. params: {
  16856. exclude_attachments: {
  16857. type: "boolean"
  16858. },
  16859. lock_repositories: {
  16860. type: "boolean"
  16861. },
  16862. repositories: {
  16863. required: true,
  16864. type: "string[]"
  16865. }
  16866. },
  16867. url: "/user/migrations"
  16868. },
  16869. startForOrg: {
  16870. method: "POST",
  16871. params: {
  16872. exclude_attachments: {
  16873. type: "boolean"
  16874. },
  16875. lock_repositories: {
  16876. type: "boolean"
  16877. },
  16878. org: {
  16879. required: true,
  16880. type: "string"
  16881. },
  16882. repositories: {
  16883. required: true,
  16884. type: "string[]"
  16885. }
  16886. },
  16887. url: "/orgs/:org/migrations"
  16888. },
  16889. startImport: {
  16890. method: "PUT",
  16891. params: {
  16892. owner: {
  16893. required: true,
  16894. type: "string"
  16895. },
  16896. repo: {
  16897. required: true,
  16898. type: "string"
  16899. },
  16900. tfvc_project: {
  16901. type: "string"
  16902. },
  16903. vcs: {
  16904. enum: ["subversion", "git", "mercurial", "tfvc"],
  16905. type: "string"
  16906. },
  16907. vcs_password: {
  16908. type: "string"
  16909. },
  16910. vcs_url: {
  16911. required: true,
  16912. type: "string"
  16913. },
  16914. vcs_username: {
  16915. type: "string"
  16916. }
  16917. },
  16918. url: "/repos/:owner/:repo/import"
  16919. },
  16920. unlockRepoForAuthenticatedUser: {
  16921. headers: {
  16922. accept: "application/vnd.github.wyandotte-preview+json"
  16923. },
  16924. method: "DELETE",
  16925. params: {
  16926. migration_id: {
  16927. required: true,
  16928. type: "integer"
  16929. },
  16930. repo_name: {
  16931. required: true,
  16932. type: "string"
  16933. }
  16934. },
  16935. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  16936. },
  16937. unlockRepoForOrg: {
  16938. headers: {
  16939. accept: "application/vnd.github.wyandotte-preview+json"
  16940. },
  16941. method: "DELETE",
  16942. params: {
  16943. migration_id: {
  16944. required: true,
  16945. type: "integer"
  16946. },
  16947. org: {
  16948. required: true,
  16949. type: "string"
  16950. },
  16951. repo_name: {
  16952. required: true,
  16953. type: "string"
  16954. }
  16955. },
  16956. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  16957. },
  16958. updateImport: {
  16959. method: "PATCH",
  16960. params: {
  16961. owner: {
  16962. required: true,
  16963. type: "string"
  16964. },
  16965. repo: {
  16966. required: true,
  16967. type: "string"
  16968. },
  16969. vcs_password: {
  16970. type: "string"
  16971. },
  16972. vcs_username: {
  16973. type: "string"
  16974. }
  16975. },
  16976. url: "/repos/:owner/:repo/import"
  16977. }
  16978. },
  16979. oauthAuthorizations: {
  16980. checkAuthorization: {
  16981. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  16982. method: "GET",
  16983. params: {
  16984. access_token: {
  16985. required: true,
  16986. type: "string"
  16987. },
  16988. client_id: {
  16989. required: true,
  16990. type: "string"
  16991. }
  16992. },
  16993. url: "/applications/:client_id/tokens/:access_token"
  16994. },
  16995. createAuthorization: {
  16996. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  16997. method: "POST",
  16998. params: {
  16999. client_id: {
  17000. type: "string"
  17001. },
  17002. client_secret: {
  17003. type: "string"
  17004. },
  17005. fingerprint: {
  17006. type: "string"
  17007. },
  17008. note: {
  17009. required: true,
  17010. type: "string"
  17011. },
  17012. note_url: {
  17013. type: "string"
  17014. },
  17015. scopes: {
  17016. type: "string[]"
  17017. }
  17018. },
  17019. url: "/authorizations"
  17020. },
  17021. deleteAuthorization: {
  17022. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17023. method: "DELETE",
  17024. params: {
  17025. authorization_id: {
  17026. required: true,
  17027. type: "integer"
  17028. }
  17029. },
  17030. url: "/authorizations/:authorization_id"
  17031. },
  17032. deleteGrant: {
  17033. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17034. method: "DELETE",
  17035. params: {
  17036. grant_id: {
  17037. required: true,
  17038. type: "integer"
  17039. }
  17040. },
  17041. url: "/applications/grants/:grant_id"
  17042. },
  17043. getAuthorization: {
  17044. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17045. method: "GET",
  17046. params: {
  17047. authorization_id: {
  17048. required: true,
  17049. type: "integer"
  17050. }
  17051. },
  17052. url: "/authorizations/:authorization_id"
  17053. },
  17054. getGrant: {
  17055. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17056. method: "GET",
  17057. params: {
  17058. grant_id: {
  17059. required: true,
  17060. type: "integer"
  17061. }
  17062. },
  17063. url: "/applications/grants/:grant_id"
  17064. },
  17065. getOrCreateAuthorizationForApp: {
  17066. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17067. method: "PUT",
  17068. params: {
  17069. client_id: {
  17070. required: true,
  17071. type: "string"
  17072. },
  17073. client_secret: {
  17074. required: true,
  17075. type: "string"
  17076. },
  17077. fingerprint: {
  17078. type: "string"
  17079. },
  17080. note: {
  17081. type: "string"
  17082. },
  17083. note_url: {
  17084. type: "string"
  17085. },
  17086. scopes: {
  17087. type: "string[]"
  17088. }
  17089. },
  17090. url: "/authorizations/clients/:client_id"
  17091. },
  17092. getOrCreateAuthorizationForAppAndFingerprint: {
  17093. 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",
  17094. method: "PUT",
  17095. params: {
  17096. client_id: {
  17097. required: true,
  17098. type: "string"
  17099. },
  17100. client_secret: {
  17101. required: true,
  17102. type: "string"
  17103. },
  17104. fingerprint: {
  17105. required: true,
  17106. type: "string"
  17107. },
  17108. note: {
  17109. type: "string"
  17110. },
  17111. note_url: {
  17112. type: "string"
  17113. },
  17114. scopes: {
  17115. type: "string[]"
  17116. }
  17117. },
  17118. url: "/authorizations/clients/:client_id/:fingerprint"
  17119. },
  17120. getOrCreateAuthorizationForAppFingerprint: {
  17121. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17122. method: "PUT",
  17123. params: {
  17124. client_id: {
  17125. required: true,
  17126. type: "string"
  17127. },
  17128. client_secret: {
  17129. required: true,
  17130. type: "string"
  17131. },
  17132. fingerprint: {
  17133. required: true,
  17134. type: "string"
  17135. },
  17136. note: {
  17137. type: "string"
  17138. },
  17139. note_url: {
  17140. type: "string"
  17141. },
  17142. scopes: {
  17143. type: "string[]"
  17144. }
  17145. },
  17146. url: "/authorizations/clients/:client_id/:fingerprint"
  17147. },
  17148. listAuthorizations: {
  17149. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17150. method: "GET",
  17151. params: {
  17152. page: {
  17153. type: "integer"
  17154. },
  17155. per_page: {
  17156. type: "integer"
  17157. }
  17158. },
  17159. url: "/authorizations"
  17160. },
  17161. listGrants: {
  17162. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17163. method: "GET",
  17164. params: {
  17165. page: {
  17166. type: "integer"
  17167. },
  17168. per_page: {
  17169. type: "integer"
  17170. }
  17171. },
  17172. url: "/applications/grants"
  17173. },
  17174. resetAuthorization: {
  17175. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17176. method: "POST",
  17177. params: {
  17178. access_token: {
  17179. required: true,
  17180. type: "string"
  17181. },
  17182. client_id: {
  17183. required: true,
  17184. type: "string"
  17185. }
  17186. },
  17187. url: "/applications/:client_id/tokens/:access_token"
  17188. },
  17189. revokeAuthorizationForApplication: {
  17190. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17191. method: "DELETE",
  17192. params: {
  17193. access_token: {
  17194. required: true,
  17195. type: "string"
  17196. },
  17197. client_id: {
  17198. required: true,
  17199. type: "string"
  17200. }
  17201. },
  17202. url: "/applications/:client_id/tokens/:access_token"
  17203. },
  17204. revokeGrantForApplication: {
  17205. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17206. method: "DELETE",
  17207. params: {
  17208. access_token: {
  17209. required: true,
  17210. type: "string"
  17211. },
  17212. client_id: {
  17213. required: true,
  17214. type: "string"
  17215. }
  17216. },
  17217. url: "/applications/:client_id/grants/:access_token"
  17218. },
  17219. updateAuthorization: {
  17220. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17221. method: "PATCH",
  17222. params: {
  17223. add_scopes: {
  17224. type: "string[]"
  17225. },
  17226. authorization_id: {
  17227. required: true,
  17228. type: "integer"
  17229. },
  17230. fingerprint: {
  17231. type: "string"
  17232. },
  17233. note: {
  17234. type: "string"
  17235. },
  17236. note_url: {
  17237. type: "string"
  17238. },
  17239. remove_scopes: {
  17240. type: "string[]"
  17241. },
  17242. scopes: {
  17243. type: "string[]"
  17244. }
  17245. },
  17246. url: "/authorizations/:authorization_id"
  17247. }
  17248. },
  17249. orgs: {
  17250. addOrUpdateMembership: {
  17251. method: "PUT",
  17252. params: {
  17253. org: {
  17254. required: true,
  17255. type: "string"
  17256. },
  17257. role: {
  17258. enum: ["admin", "member"],
  17259. type: "string"
  17260. },
  17261. username: {
  17262. required: true,
  17263. type: "string"
  17264. }
  17265. },
  17266. url: "/orgs/:org/memberships/:username"
  17267. },
  17268. blockUser: {
  17269. method: "PUT",
  17270. params: {
  17271. org: {
  17272. required: true,
  17273. type: "string"
  17274. },
  17275. username: {
  17276. required: true,
  17277. type: "string"
  17278. }
  17279. },
  17280. url: "/orgs/:org/blocks/:username"
  17281. },
  17282. checkBlockedUser: {
  17283. method: "GET",
  17284. params: {
  17285. org: {
  17286. required: true,
  17287. type: "string"
  17288. },
  17289. username: {
  17290. required: true,
  17291. type: "string"
  17292. }
  17293. },
  17294. url: "/orgs/:org/blocks/:username"
  17295. },
  17296. checkMembership: {
  17297. method: "GET",
  17298. params: {
  17299. org: {
  17300. required: true,
  17301. type: "string"
  17302. },
  17303. username: {
  17304. required: true,
  17305. type: "string"
  17306. }
  17307. },
  17308. url: "/orgs/:org/members/:username"
  17309. },
  17310. checkPublicMembership: {
  17311. method: "GET",
  17312. params: {
  17313. org: {
  17314. required: true,
  17315. type: "string"
  17316. },
  17317. username: {
  17318. required: true,
  17319. type: "string"
  17320. }
  17321. },
  17322. url: "/orgs/:org/public_members/:username"
  17323. },
  17324. concealMembership: {
  17325. method: "DELETE",
  17326. params: {
  17327. org: {
  17328. required: true,
  17329. type: "string"
  17330. },
  17331. username: {
  17332. required: true,
  17333. type: "string"
  17334. }
  17335. },
  17336. url: "/orgs/:org/public_members/:username"
  17337. },
  17338. convertMemberToOutsideCollaborator: {
  17339. method: "PUT",
  17340. params: {
  17341. org: {
  17342. required: true,
  17343. type: "string"
  17344. },
  17345. username: {
  17346. required: true,
  17347. type: "string"
  17348. }
  17349. },
  17350. url: "/orgs/:org/outside_collaborators/:username"
  17351. },
  17352. createHook: {
  17353. method: "POST",
  17354. params: {
  17355. active: {
  17356. type: "boolean"
  17357. },
  17358. config: {
  17359. required: true,
  17360. type: "object"
  17361. },
  17362. "config.content_type": {
  17363. type: "string"
  17364. },
  17365. "config.insecure_ssl": {
  17366. type: "string"
  17367. },
  17368. "config.secret": {
  17369. type: "string"
  17370. },
  17371. "config.url": {
  17372. required: true,
  17373. type: "string"
  17374. },
  17375. events: {
  17376. type: "string[]"
  17377. },
  17378. name: {
  17379. required: true,
  17380. type: "string"
  17381. },
  17382. org: {
  17383. required: true,
  17384. type: "string"
  17385. }
  17386. },
  17387. url: "/orgs/:org/hooks"
  17388. },
  17389. createInvitation: {
  17390. method: "POST",
  17391. params: {
  17392. email: {
  17393. type: "string"
  17394. },
  17395. invitee_id: {
  17396. type: "integer"
  17397. },
  17398. org: {
  17399. required: true,
  17400. type: "string"
  17401. },
  17402. role: {
  17403. enum: ["admin", "direct_member", "billing_manager"],
  17404. type: "string"
  17405. },
  17406. team_ids: {
  17407. type: "integer[]"
  17408. }
  17409. },
  17410. url: "/orgs/:org/invitations"
  17411. },
  17412. deleteHook: {
  17413. method: "DELETE",
  17414. params: {
  17415. hook_id: {
  17416. required: true,
  17417. type: "integer"
  17418. },
  17419. org: {
  17420. required: true,
  17421. type: "string"
  17422. }
  17423. },
  17424. url: "/orgs/:org/hooks/:hook_id"
  17425. },
  17426. get: {
  17427. method: "GET",
  17428. params: {
  17429. org: {
  17430. required: true,
  17431. type: "string"
  17432. }
  17433. },
  17434. url: "/orgs/:org"
  17435. },
  17436. getHook: {
  17437. method: "GET",
  17438. params: {
  17439. hook_id: {
  17440. required: true,
  17441. type: "integer"
  17442. },
  17443. org: {
  17444. required: true,
  17445. type: "string"
  17446. }
  17447. },
  17448. url: "/orgs/:org/hooks/:hook_id"
  17449. },
  17450. getMembership: {
  17451. method: "GET",
  17452. params: {
  17453. org: {
  17454. required: true,
  17455. type: "string"
  17456. },
  17457. username: {
  17458. required: true,
  17459. type: "string"
  17460. }
  17461. },
  17462. url: "/orgs/:org/memberships/:username"
  17463. },
  17464. getMembershipForAuthenticatedUser: {
  17465. method: "GET",
  17466. params: {
  17467. org: {
  17468. required: true,
  17469. type: "string"
  17470. }
  17471. },
  17472. url: "/user/memberships/orgs/:org"
  17473. },
  17474. list: {
  17475. method: "GET",
  17476. params: {
  17477. page: {
  17478. type: "integer"
  17479. },
  17480. per_page: {
  17481. type: "integer"
  17482. },
  17483. since: {
  17484. type: "integer"
  17485. }
  17486. },
  17487. url: "/organizations"
  17488. },
  17489. listBlockedUsers: {
  17490. method: "GET",
  17491. params: {
  17492. org: {
  17493. required: true,
  17494. type: "string"
  17495. }
  17496. },
  17497. url: "/orgs/:org/blocks"
  17498. },
  17499. listForAuthenticatedUser: {
  17500. method: "GET",
  17501. params: {
  17502. page: {
  17503. type: "integer"
  17504. },
  17505. per_page: {
  17506. type: "integer"
  17507. }
  17508. },
  17509. url: "/user/orgs"
  17510. },
  17511. listForUser: {
  17512. method: "GET",
  17513. params: {
  17514. page: {
  17515. type: "integer"
  17516. },
  17517. per_page: {
  17518. type: "integer"
  17519. },
  17520. username: {
  17521. required: true,
  17522. type: "string"
  17523. }
  17524. },
  17525. url: "/users/:username/orgs"
  17526. },
  17527. listHooks: {
  17528. method: "GET",
  17529. params: {
  17530. org: {
  17531. required: true,
  17532. type: "string"
  17533. },
  17534. page: {
  17535. type: "integer"
  17536. },
  17537. per_page: {
  17538. type: "integer"
  17539. }
  17540. },
  17541. url: "/orgs/:org/hooks"
  17542. },
  17543. listInstallations: {
  17544. headers: {
  17545. accept: "application/vnd.github.machine-man-preview+json"
  17546. },
  17547. method: "GET",
  17548. params: {
  17549. org: {
  17550. required: true,
  17551. type: "string"
  17552. },
  17553. page: {
  17554. type: "integer"
  17555. },
  17556. per_page: {
  17557. type: "integer"
  17558. }
  17559. },
  17560. url: "/orgs/:org/installations"
  17561. },
  17562. listInvitationTeams: {
  17563. method: "GET",
  17564. params: {
  17565. invitation_id: {
  17566. required: true,
  17567. type: "integer"
  17568. },
  17569. org: {
  17570. required: true,
  17571. type: "string"
  17572. },
  17573. page: {
  17574. type: "integer"
  17575. },
  17576. per_page: {
  17577. type: "integer"
  17578. }
  17579. },
  17580. url: "/orgs/:org/invitations/:invitation_id/teams"
  17581. },
  17582. listMembers: {
  17583. method: "GET",
  17584. params: {
  17585. filter: {
  17586. enum: ["2fa_disabled", "all"],
  17587. type: "string"
  17588. },
  17589. org: {
  17590. required: true,
  17591. type: "string"
  17592. },
  17593. page: {
  17594. type: "integer"
  17595. },
  17596. per_page: {
  17597. type: "integer"
  17598. },
  17599. role: {
  17600. enum: ["all", "admin", "member"],
  17601. type: "string"
  17602. }
  17603. },
  17604. url: "/orgs/:org/members"
  17605. },
  17606. listMemberships: {
  17607. method: "GET",
  17608. params: {
  17609. page: {
  17610. type: "integer"
  17611. },
  17612. per_page: {
  17613. type: "integer"
  17614. },
  17615. state: {
  17616. enum: ["active", "pending"],
  17617. type: "string"
  17618. }
  17619. },
  17620. url: "/user/memberships/orgs"
  17621. },
  17622. listOutsideCollaborators: {
  17623. method: "GET",
  17624. params: {
  17625. filter: {
  17626. enum: ["2fa_disabled", "all"],
  17627. type: "string"
  17628. },
  17629. org: {
  17630. required: true,
  17631. type: "string"
  17632. },
  17633. page: {
  17634. type: "integer"
  17635. },
  17636. per_page: {
  17637. type: "integer"
  17638. }
  17639. },
  17640. url: "/orgs/:org/outside_collaborators"
  17641. },
  17642. listPendingInvitations: {
  17643. method: "GET",
  17644. params: {
  17645. org: {
  17646. required: true,
  17647. type: "string"
  17648. },
  17649. page: {
  17650. type: "integer"
  17651. },
  17652. per_page: {
  17653. type: "integer"
  17654. }
  17655. },
  17656. url: "/orgs/:org/invitations"
  17657. },
  17658. listPublicMembers: {
  17659. method: "GET",
  17660. params: {
  17661. org: {
  17662. required: true,
  17663. type: "string"
  17664. },
  17665. page: {
  17666. type: "integer"
  17667. },
  17668. per_page: {
  17669. type: "integer"
  17670. }
  17671. },
  17672. url: "/orgs/:org/public_members"
  17673. },
  17674. pingHook: {
  17675. method: "POST",
  17676. params: {
  17677. hook_id: {
  17678. required: true,
  17679. type: "integer"
  17680. },
  17681. org: {
  17682. required: true,
  17683. type: "string"
  17684. }
  17685. },
  17686. url: "/orgs/:org/hooks/:hook_id/pings"
  17687. },
  17688. publicizeMembership: {
  17689. method: "PUT",
  17690. params: {
  17691. org: {
  17692. required: true,
  17693. type: "string"
  17694. },
  17695. username: {
  17696. required: true,
  17697. type: "string"
  17698. }
  17699. },
  17700. url: "/orgs/:org/public_members/:username"
  17701. },
  17702. removeMember: {
  17703. method: "DELETE",
  17704. params: {
  17705. org: {
  17706. required: true,
  17707. type: "string"
  17708. },
  17709. username: {
  17710. required: true,
  17711. type: "string"
  17712. }
  17713. },
  17714. url: "/orgs/:org/members/:username"
  17715. },
  17716. removeMembership: {
  17717. method: "DELETE",
  17718. params: {
  17719. org: {
  17720. required: true,
  17721. type: "string"
  17722. },
  17723. username: {
  17724. required: true,
  17725. type: "string"
  17726. }
  17727. },
  17728. url: "/orgs/:org/memberships/:username"
  17729. },
  17730. removeOutsideCollaborator: {
  17731. method: "DELETE",
  17732. params: {
  17733. org: {
  17734. required: true,
  17735. type: "string"
  17736. },
  17737. username: {
  17738. required: true,
  17739. type: "string"
  17740. }
  17741. },
  17742. url: "/orgs/:org/outside_collaborators/:username"
  17743. },
  17744. unblockUser: {
  17745. method: "DELETE",
  17746. params: {
  17747. org: {
  17748. required: true,
  17749. type: "string"
  17750. },
  17751. username: {
  17752. required: true,
  17753. type: "string"
  17754. }
  17755. },
  17756. url: "/orgs/:org/blocks/:username"
  17757. },
  17758. update: {
  17759. method: "PATCH",
  17760. params: {
  17761. billing_email: {
  17762. type: "string"
  17763. },
  17764. company: {
  17765. type: "string"
  17766. },
  17767. default_repository_permission: {
  17768. enum: ["read", "write", "admin", "none"],
  17769. type: "string"
  17770. },
  17771. description: {
  17772. type: "string"
  17773. },
  17774. email: {
  17775. type: "string"
  17776. },
  17777. has_organization_projects: {
  17778. type: "boolean"
  17779. },
  17780. has_repository_projects: {
  17781. type: "boolean"
  17782. },
  17783. location: {
  17784. type: "string"
  17785. },
  17786. members_allowed_repository_creation_type: {
  17787. enum: ["all", "private", "none"],
  17788. type: "string"
  17789. },
  17790. members_can_create_internal_repositories: {
  17791. type: "boolean"
  17792. },
  17793. members_can_create_private_repositories: {
  17794. type: "boolean"
  17795. },
  17796. members_can_create_public_repositories: {
  17797. type: "boolean"
  17798. },
  17799. members_can_create_repositories: {
  17800. type: "boolean"
  17801. },
  17802. name: {
  17803. type: "string"
  17804. },
  17805. org: {
  17806. required: true,
  17807. type: "string"
  17808. }
  17809. },
  17810. url: "/orgs/:org"
  17811. },
  17812. updateHook: {
  17813. method: "PATCH",
  17814. params: {
  17815. active: {
  17816. type: "boolean"
  17817. },
  17818. config: {
  17819. type: "object"
  17820. },
  17821. "config.content_type": {
  17822. type: "string"
  17823. },
  17824. "config.insecure_ssl": {
  17825. type: "string"
  17826. },
  17827. "config.secret": {
  17828. type: "string"
  17829. },
  17830. "config.url": {
  17831. required: true,
  17832. type: "string"
  17833. },
  17834. events: {
  17835. type: "string[]"
  17836. },
  17837. hook_id: {
  17838. required: true,
  17839. type: "integer"
  17840. },
  17841. org: {
  17842. required: true,
  17843. type: "string"
  17844. }
  17845. },
  17846. url: "/orgs/:org/hooks/:hook_id"
  17847. },
  17848. updateMembership: {
  17849. method: "PATCH",
  17850. params: {
  17851. org: {
  17852. required: true,
  17853. type: "string"
  17854. },
  17855. state: {
  17856. enum: ["active"],
  17857. required: true,
  17858. type: "string"
  17859. }
  17860. },
  17861. url: "/user/memberships/orgs/:org"
  17862. }
  17863. },
  17864. projects: {
  17865. addCollaborator: {
  17866. headers: {
  17867. accept: "application/vnd.github.inertia-preview+json"
  17868. },
  17869. method: "PUT",
  17870. params: {
  17871. permission: {
  17872. enum: ["read", "write", "admin"],
  17873. type: "string"
  17874. },
  17875. project_id: {
  17876. required: true,
  17877. type: "integer"
  17878. },
  17879. username: {
  17880. required: true,
  17881. type: "string"
  17882. }
  17883. },
  17884. url: "/projects/:project_id/collaborators/:username"
  17885. },
  17886. createCard: {
  17887. headers: {
  17888. accept: "application/vnd.github.inertia-preview+json"
  17889. },
  17890. method: "POST",
  17891. params: {
  17892. column_id: {
  17893. required: true,
  17894. type: "integer"
  17895. },
  17896. content_id: {
  17897. type: "integer"
  17898. },
  17899. content_type: {
  17900. type: "string"
  17901. },
  17902. note: {
  17903. type: "string"
  17904. }
  17905. },
  17906. url: "/projects/columns/:column_id/cards"
  17907. },
  17908. createColumn: {
  17909. headers: {
  17910. accept: "application/vnd.github.inertia-preview+json"
  17911. },
  17912. method: "POST",
  17913. params: {
  17914. name: {
  17915. required: true,
  17916. type: "string"
  17917. },
  17918. project_id: {
  17919. required: true,
  17920. type: "integer"
  17921. }
  17922. },
  17923. url: "/projects/:project_id/columns"
  17924. },
  17925. createForAuthenticatedUser: {
  17926. headers: {
  17927. accept: "application/vnd.github.inertia-preview+json"
  17928. },
  17929. method: "POST",
  17930. params: {
  17931. body: {
  17932. type: "string"
  17933. },
  17934. name: {
  17935. required: true,
  17936. type: "string"
  17937. }
  17938. },
  17939. url: "/user/projects"
  17940. },
  17941. createForOrg: {
  17942. headers: {
  17943. accept: "application/vnd.github.inertia-preview+json"
  17944. },
  17945. method: "POST",
  17946. params: {
  17947. body: {
  17948. type: "string"
  17949. },
  17950. name: {
  17951. required: true,
  17952. type: "string"
  17953. },
  17954. org: {
  17955. required: true,
  17956. type: "string"
  17957. }
  17958. },
  17959. url: "/orgs/:org/projects"
  17960. },
  17961. createForRepo: {
  17962. headers: {
  17963. accept: "application/vnd.github.inertia-preview+json"
  17964. },
  17965. method: "POST",
  17966. params: {
  17967. body: {
  17968. type: "string"
  17969. },
  17970. name: {
  17971. required: true,
  17972. type: "string"
  17973. },
  17974. owner: {
  17975. required: true,
  17976. type: "string"
  17977. },
  17978. repo: {
  17979. required: true,
  17980. type: "string"
  17981. }
  17982. },
  17983. url: "/repos/:owner/:repo/projects"
  17984. },
  17985. delete: {
  17986. headers: {
  17987. accept: "application/vnd.github.inertia-preview+json"
  17988. },
  17989. method: "DELETE",
  17990. params: {
  17991. project_id: {
  17992. required: true,
  17993. type: "integer"
  17994. }
  17995. },
  17996. url: "/projects/:project_id"
  17997. },
  17998. deleteCard: {
  17999. headers: {
  18000. accept: "application/vnd.github.inertia-preview+json"
  18001. },
  18002. method: "DELETE",
  18003. params: {
  18004. card_id: {
  18005. required: true,
  18006. type: "integer"
  18007. }
  18008. },
  18009. url: "/projects/columns/cards/:card_id"
  18010. },
  18011. deleteColumn: {
  18012. headers: {
  18013. accept: "application/vnd.github.inertia-preview+json"
  18014. },
  18015. method: "DELETE",
  18016. params: {
  18017. column_id: {
  18018. required: true,
  18019. type: "integer"
  18020. }
  18021. },
  18022. url: "/projects/columns/:column_id"
  18023. },
  18024. get: {
  18025. headers: {
  18026. accept: "application/vnd.github.inertia-preview+json"
  18027. },
  18028. method: "GET",
  18029. params: {
  18030. project_id: {
  18031. required: true,
  18032. type: "integer"
  18033. }
  18034. },
  18035. url: "/projects/:project_id"
  18036. },
  18037. getCard: {
  18038. headers: {
  18039. accept: "application/vnd.github.inertia-preview+json"
  18040. },
  18041. method: "GET",
  18042. params: {
  18043. card_id: {
  18044. required: true,
  18045. type: "integer"
  18046. }
  18047. },
  18048. url: "/projects/columns/cards/:card_id"
  18049. },
  18050. getColumn: {
  18051. headers: {
  18052. accept: "application/vnd.github.inertia-preview+json"
  18053. },
  18054. method: "GET",
  18055. params: {
  18056. column_id: {
  18057. required: true,
  18058. type: "integer"
  18059. }
  18060. },
  18061. url: "/projects/columns/:column_id"
  18062. },
  18063. listCards: {
  18064. headers: {
  18065. accept: "application/vnd.github.inertia-preview+json"
  18066. },
  18067. method: "GET",
  18068. params: {
  18069. archived_state: {
  18070. enum: ["all", "archived", "not_archived"],
  18071. type: "string"
  18072. },
  18073. column_id: {
  18074. required: true,
  18075. type: "integer"
  18076. },
  18077. page: {
  18078. type: "integer"
  18079. },
  18080. per_page: {
  18081. type: "integer"
  18082. }
  18083. },
  18084. url: "/projects/columns/:column_id/cards"
  18085. },
  18086. listCollaborators: {
  18087. headers: {
  18088. accept: "application/vnd.github.inertia-preview+json"
  18089. },
  18090. method: "GET",
  18091. params: {
  18092. affiliation: {
  18093. enum: ["outside", "direct", "all"],
  18094. type: "string"
  18095. },
  18096. page: {
  18097. type: "integer"
  18098. },
  18099. per_page: {
  18100. type: "integer"
  18101. },
  18102. project_id: {
  18103. required: true,
  18104. type: "integer"
  18105. }
  18106. },
  18107. url: "/projects/:project_id/collaborators"
  18108. },
  18109. listColumns: {
  18110. headers: {
  18111. accept: "application/vnd.github.inertia-preview+json"
  18112. },
  18113. method: "GET",
  18114. params: {
  18115. page: {
  18116. type: "integer"
  18117. },
  18118. per_page: {
  18119. type: "integer"
  18120. },
  18121. project_id: {
  18122. required: true,
  18123. type: "integer"
  18124. }
  18125. },
  18126. url: "/projects/:project_id/columns"
  18127. },
  18128. listForOrg: {
  18129. headers: {
  18130. accept: "application/vnd.github.inertia-preview+json"
  18131. },
  18132. method: "GET",
  18133. params: {
  18134. org: {
  18135. required: true,
  18136. type: "string"
  18137. },
  18138. page: {
  18139. type: "integer"
  18140. },
  18141. per_page: {
  18142. type: "integer"
  18143. },
  18144. state: {
  18145. enum: ["open", "closed", "all"],
  18146. type: "string"
  18147. }
  18148. },
  18149. url: "/orgs/:org/projects"
  18150. },
  18151. listForRepo: {
  18152. headers: {
  18153. accept: "application/vnd.github.inertia-preview+json"
  18154. },
  18155. method: "GET",
  18156. params: {
  18157. owner: {
  18158. required: true,
  18159. type: "string"
  18160. },
  18161. page: {
  18162. type: "integer"
  18163. },
  18164. per_page: {
  18165. type: "integer"
  18166. },
  18167. repo: {
  18168. required: true,
  18169. type: "string"
  18170. },
  18171. state: {
  18172. enum: ["open", "closed", "all"],
  18173. type: "string"
  18174. }
  18175. },
  18176. url: "/repos/:owner/:repo/projects"
  18177. },
  18178. listForUser: {
  18179. headers: {
  18180. accept: "application/vnd.github.inertia-preview+json"
  18181. },
  18182. method: "GET",
  18183. params: {
  18184. page: {
  18185. type: "integer"
  18186. },
  18187. per_page: {
  18188. type: "integer"
  18189. },
  18190. state: {
  18191. enum: ["open", "closed", "all"],
  18192. type: "string"
  18193. },
  18194. username: {
  18195. required: true,
  18196. type: "string"
  18197. }
  18198. },
  18199. url: "/users/:username/projects"
  18200. },
  18201. moveCard: {
  18202. headers: {
  18203. accept: "application/vnd.github.inertia-preview+json"
  18204. },
  18205. method: "POST",
  18206. params: {
  18207. card_id: {
  18208. required: true,
  18209. type: "integer"
  18210. },
  18211. column_id: {
  18212. type: "integer"
  18213. },
  18214. position: {
  18215. required: true,
  18216. type: "string",
  18217. validation: "^(top|bottom|after:\\d+)$"
  18218. }
  18219. },
  18220. url: "/projects/columns/cards/:card_id/moves"
  18221. },
  18222. moveColumn: {
  18223. headers: {
  18224. accept: "application/vnd.github.inertia-preview+json"
  18225. },
  18226. method: "POST",
  18227. params: {
  18228. column_id: {
  18229. required: true,
  18230. type: "integer"
  18231. },
  18232. position: {
  18233. required: true,
  18234. type: "string",
  18235. validation: "^(first|last|after:\\d+)$"
  18236. }
  18237. },
  18238. url: "/projects/columns/:column_id/moves"
  18239. },
  18240. removeCollaborator: {
  18241. headers: {
  18242. accept: "application/vnd.github.inertia-preview+json"
  18243. },
  18244. method: "DELETE",
  18245. params: {
  18246. project_id: {
  18247. required: true,
  18248. type: "integer"
  18249. },
  18250. username: {
  18251. required: true,
  18252. type: "string"
  18253. }
  18254. },
  18255. url: "/projects/:project_id/collaborators/:username"
  18256. },
  18257. reviewUserPermissionLevel: {
  18258. headers: {
  18259. accept: "application/vnd.github.inertia-preview+json"
  18260. },
  18261. method: "GET",
  18262. params: {
  18263. project_id: {
  18264. required: true,
  18265. type: "integer"
  18266. },
  18267. username: {
  18268. required: true,
  18269. type: "string"
  18270. }
  18271. },
  18272. url: "/projects/:project_id/collaborators/:username/permission"
  18273. },
  18274. update: {
  18275. headers: {
  18276. accept: "application/vnd.github.inertia-preview+json"
  18277. },
  18278. method: "PATCH",
  18279. params: {
  18280. body: {
  18281. type: "string"
  18282. },
  18283. name: {
  18284. type: "string"
  18285. },
  18286. organization_permission: {
  18287. type: "string"
  18288. },
  18289. private: {
  18290. type: "boolean"
  18291. },
  18292. project_id: {
  18293. required: true,
  18294. type: "integer"
  18295. },
  18296. state: {
  18297. enum: ["open", "closed"],
  18298. type: "string"
  18299. }
  18300. },
  18301. url: "/projects/:project_id"
  18302. },
  18303. updateCard: {
  18304. headers: {
  18305. accept: "application/vnd.github.inertia-preview+json"
  18306. },
  18307. method: "PATCH",
  18308. params: {
  18309. archived: {
  18310. type: "boolean"
  18311. },
  18312. card_id: {
  18313. required: true,
  18314. type: "integer"
  18315. },
  18316. note: {
  18317. type: "string"
  18318. }
  18319. },
  18320. url: "/projects/columns/cards/:card_id"
  18321. },
  18322. updateColumn: {
  18323. headers: {
  18324. accept: "application/vnd.github.inertia-preview+json"
  18325. },
  18326. method: "PATCH",
  18327. params: {
  18328. column_id: {
  18329. required: true,
  18330. type: "integer"
  18331. },
  18332. name: {
  18333. required: true,
  18334. type: "string"
  18335. }
  18336. },
  18337. url: "/projects/columns/:column_id"
  18338. }
  18339. },
  18340. pulls: {
  18341. checkIfMerged: {
  18342. method: "GET",
  18343. params: {
  18344. number: {
  18345. alias: "pull_number",
  18346. deprecated: true,
  18347. type: "integer"
  18348. },
  18349. owner: {
  18350. required: true,
  18351. type: "string"
  18352. },
  18353. pull_number: {
  18354. required: true,
  18355. type: "integer"
  18356. },
  18357. repo: {
  18358. required: true,
  18359. type: "string"
  18360. }
  18361. },
  18362. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18363. },
  18364. create: {
  18365. method: "POST",
  18366. params: {
  18367. base: {
  18368. required: true,
  18369. type: "string"
  18370. },
  18371. body: {
  18372. type: "string"
  18373. },
  18374. draft: {
  18375. type: "boolean"
  18376. },
  18377. head: {
  18378. required: true,
  18379. type: "string"
  18380. },
  18381. maintainer_can_modify: {
  18382. type: "boolean"
  18383. },
  18384. owner: {
  18385. required: true,
  18386. type: "string"
  18387. },
  18388. repo: {
  18389. required: true,
  18390. type: "string"
  18391. },
  18392. title: {
  18393. required: true,
  18394. type: "string"
  18395. }
  18396. },
  18397. url: "/repos/:owner/:repo/pulls"
  18398. },
  18399. createComment: {
  18400. method: "POST",
  18401. params: {
  18402. body: {
  18403. required: true,
  18404. type: "string"
  18405. },
  18406. commit_id: {
  18407. required: true,
  18408. type: "string"
  18409. },
  18410. in_reply_to: {
  18411. deprecated: true,
  18412. 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.",
  18413. type: "integer"
  18414. },
  18415. line: {
  18416. type: "integer"
  18417. },
  18418. number: {
  18419. alias: "pull_number",
  18420. deprecated: true,
  18421. type: "integer"
  18422. },
  18423. owner: {
  18424. required: true,
  18425. type: "string"
  18426. },
  18427. path: {
  18428. required: true,
  18429. type: "string"
  18430. },
  18431. position: {
  18432. type: "integer"
  18433. },
  18434. pull_number: {
  18435. required: true,
  18436. type: "integer"
  18437. },
  18438. repo: {
  18439. required: true,
  18440. type: "string"
  18441. },
  18442. side: {
  18443. enum: ["LEFT", "RIGHT"],
  18444. type: "string"
  18445. },
  18446. start_line: {
  18447. type: "integer"
  18448. },
  18449. start_side: {
  18450. enum: ["LEFT", "RIGHT", "side"],
  18451. type: "string"
  18452. }
  18453. },
  18454. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18455. },
  18456. createCommentReply: {
  18457. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18458. method: "POST",
  18459. params: {
  18460. body: {
  18461. required: true,
  18462. type: "string"
  18463. },
  18464. commit_id: {
  18465. required: true,
  18466. type: "string"
  18467. },
  18468. in_reply_to: {
  18469. deprecated: true,
  18470. 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.",
  18471. type: "integer"
  18472. },
  18473. line: {
  18474. type: "integer"
  18475. },
  18476. number: {
  18477. alias: "pull_number",
  18478. deprecated: true,
  18479. type: "integer"
  18480. },
  18481. owner: {
  18482. required: true,
  18483. type: "string"
  18484. },
  18485. path: {
  18486. required: true,
  18487. type: "string"
  18488. },
  18489. position: {
  18490. type: "integer"
  18491. },
  18492. pull_number: {
  18493. required: true,
  18494. type: "integer"
  18495. },
  18496. repo: {
  18497. required: true,
  18498. type: "string"
  18499. },
  18500. side: {
  18501. enum: ["LEFT", "RIGHT"],
  18502. type: "string"
  18503. },
  18504. start_line: {
  18505. type: "integer"
  18506. },
  18507. start_side: {
  18508. enum: ["LEFT", "RIGHT", "side"],
  18509. type: "string"
  18510. }
  18511. },
  18512. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18513. },
  18514. createFromIssue: {
  18515. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18516. method: "POST",
  18517. params: {
  18518. base: {
  18519. required: true,
  18520. type: "string"
  18521. },
  18522. draft: {
  18523. type: "boolean"
  18524. },
  18525. head: {
  18526. required: true,
  18527. type: "string"
  18528. },
  18529. issue: {
  18530. required: true,
  18531. type: "integer"
  18532. },
  18533. maintainer_can_modify: {
  18534. type: "boolean"
  18535. },
  18536. owner: {
  18537. required: true,
  18538. type: "string"
  18539. },
  18540. repo: {
  18541. required: true,
  18542. type: "string"
  18543. }
  18544. },
  18545. url: "/repos/:owner/:repo/pulls"
  18546. },
  18547. createReview: {
  18548. method: "POST",
  18549. params: {
  18550. body: {
  18551. type: "string"
  18552. },
  18553. comments: {
  18554. type: "object[]"
  18555. },
  18556. "comments[].body": {
  18557. required: true,
  18558. type: "string"
  18559. },
  18560. "comments[].path": {
  18561. required: true,
  18562. type: "string"
  18563. },
  18564. "comments[].position": {
  18565. required: true,
  18566. type: "integer"
  18567. },
  18568. commit_id: {
  18569. type: "string"
  18570. },
  18571. event: {
  18572. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18573. type: "string"
  18574. },
  18575. number: {
  18576. alias: "pull_number",
  18577. deprecated: true,
  18578. type: "integer"
  18579. },
  18580. owner: {
  18581. required: true,
  18582. type: "string"
  18583. },
  18584. pull_number: {
  18585. required: true,
  18586. type: "integer"
  18587. },
  18588. repo: {
  18589. required: true,
  18590. type: "string"
  18591. }
  18592. },
  18593. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18594. },
  18595. createReviewCommentReply: {
  18596. method: "POST",
  18597. params: {
  18598. body: {
  18599. required: true,
  18600. type: "string"
  18601. },
  18602. comment_id: {
  18603. required: true,
  18604. type: "integer"
  18605. },
  18606. owner: {
  18607. required: true,
  18608. type: "string"
  18609. },
  18610. pull_number: {
  18611. required: true,
  18612. type: "integer"
  18613. },
  18614. repo: {
  18615. required: true,
  18616. type: "string"
  18617. }
  18618. },
  18619. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18620. },
  18621. createReviewRequest: {
  18622. method: "POST",
  18623. params: {
  18624. number: {
  18625. alias: "pull_number",
  18626. deprecated: true,
  18627. type: "integer"
  18628. },
  18629. owner: {
  18630. required: true,
  18631. type: "string"
  18632. },
  18633. pull_number: {
  18634. required: true,
  18635. type: "integer"
  18636. },
  18637. repo: {
  18638. required: true,
  18639. type: "string"
  18640. },
  18641. reviewers: {
  18642. type: "string[]"
  18643. },
  18644. team_reviewers: {
  18645. type: "string[]"
  18646. }
  18647. },
  18648. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18649. },
  18650. deleteComment: {
  18651. method: "DELETE",
  18652. params: {
  18653. comment_id: {
  18654. required: true,
  18655. type: "integer"
  18656. },
  18657. owner: {
  18658. required: true,
  18659. type: "string"
  18660. },
  18661. repo: {
  18662. required: true,
  18663. type: "string"
  18664. }
  18665. },
  18666. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18667. },
  18668. deletePendingReview: {
  18669. method: "DELETE",
  18670. params: {
  18671. number: {
  18672. alias: "pull_number",
  18673. deprecated: true,
  18674. type: "integer"
  18675. },
  18676. owner: {
  18677. required: true,
  18678. type: "string"
  18679. },
  18680. pull_number: {
  18681. required: true,
  18682. type: "integer"
  18683. },
  18684. repo: {
  18685. required: true,
  18686. type: "string"
  18687. },
  18688. review_id: {
  18689. required: true,
  18690. type: "integer"
  18691. }
  18692. },
  18693. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18694. },
  18695. deleteReviewRequest: {
  18696. method: "DELETE",
  18697. params: {
  18698. number: {
  18699. alias: "pull_number",
  18700. deprecated: true,
  18701. type: "integer"
  18702. },
  18703. owner: {
  18704. required: true,
  18705. type: "string"
  18706. },
  18707. pull_number: {
  18708. required: true,
  18709. type: "integer"
  18710. },
  18711. repo: {
  18712. required: true,
  18713. type: "string"
  18714. },
  18715. reviewers: {
  18716. type: "string[]"
  18717. },
  18718. team_reviewers: {
  18719. type: "string[]"
  18720. }
  18721. },
  18722. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18723. },
  18724. dismissReview: {
  18725. method: "PUT",
  18726. params: {
  18727. message: {
  18728. required: true,
  18729. type: "string"
  18730. },
  18731. number: {
  18732. alias: "pull_number",
  18733. deprecated: true,
  18734. type: "integer"
  18735. },
  18736. owner: {
  18737. required: true,
  18738. type: "string"
  18739. },
  18740. pull_number: {
  18741. required: true,
  18742. type: "integer"
  18743. },
  18744. repo: {
  18745. required: true,
  18746. type: "string"
  18747. },
  18748. review_id: {
  18749. required: true,
  18750. type: "integer"
  18751. }
  18752. },
  18753. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18754. },
  18755. get: {
  18756. method: "GET",
  18757. params: {
  18758. number: {
  18759. alias: "pull_number",
  18760. deprecated: true,
  18761. type: "integer"
  18762. },
  18763. owner: {
  18764. required: true,
  18765. type: "string"
  18766. },
  18767. pull_number: {
  18768. required: true,
  18769. type: "integer"
  18770. },
  18771. repo: {
  18772. required: true,
  18773. type: "string"
  18774. }
  18775. },
  18776. url: "/repos/:owner/:repo/pulls/:pull_number"
  18777. },
  18778. getComment: {
  18779. method: "GET",
  18780. params: {
  18781. comment_id: {
  18782. required: true,
  18783. type: "integer"
  18784. },
  18785. owner: {
  18786. required: true,
  18787. type: "string"
  18788. },
  18789. repo: {
  18790. required: true,
  18791. type: "string"
  18792. }
  18793. },
  18794. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18795. },
  18796. getCommentsForReview: {
  18797. method: "GET",
  18798. params: {
  18799. number: {
  18800. alias: "pull_number",
  18801. deprecated: true,
  18802. type: "integer"
  18803. },
  18804. owner: {
  18805. required: true,
  18806. type: "string"
  18807. },
  18808. page: {
  18809. type: "integer"
  18810. },
  18811. per_page: {
  18812. type: "integer"
  18813. },
  18814. pull_number: {
  18815. required: true,
  18816. type: "integer"
  18817. },
  18818. repo: {
  18819. required: true,
  18820. type: "string"
  18821. },
  18822. review_id: {
  18823. required: true,
  18824. type: "integer"
  18825. }
  18826. },
  18827. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  18828. },
  18829. getReview: {
  18830. method: "GET",
  18831. params: {
  18832. number: {
  18833. alias: "pull_number",
  18834. deprecated: true,
  18835. type: "integer"
  18836. },
  18837. owner: {
  18838. required: true,
  18839. type: "string"
  18840. },
  18841. pull_number: {
  18842. required: true,
  18843. type: "integer"
  18844. },
  18845. repo: {
  18846. required: true,
  18847. type: "string"
  18848. },
  18849. review_id: {
  18850. required: true,
  18851. type: "integer"
  18852. }
  18853. },
  18854. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18855. },
  18856. list: {
  18857. method: "GET",
  18858. params: {
  18859. base: {
  18860. type: "string"
  18861. },
  18862. direction: {
  18863. enum: ["asc", "desc"],
  18864. type: "string"
  18865. },
  18866. head: {
  18867. type: "string"
  18868. },
  18869. owner: {
  18870. required: true,
  18871. type: "string"
  18872. },
  18873. page: {
  18874. type: "integer"
  18875. },
  18876. per_page: {
  18877. type: "integer"
  18878. },
  18879. repo: {
  18880. required: true,
  18881. type: "string"
  18882. },
  18883. sort: {
  18884. enum: ["created", "updated", "popularity", "long-running"],
  18885. type: "string"
  18886. },
  18887. state: {
  18888. enum: ["open", "closed", "all"],
  18889. type: "string"
  18890. }
  18891. },
  18892. url: "/repos/:owner/:repo/pulls"
  18893. },
  18894. listComments: {
  18895. method: "GET",
  18896. params: {
  18897. direction: {
  18898. enum: ["asc", "desc"],
  18899. type: "string"
  18900. },
  18901. number: {
  18902. alias: "pull_number",
  18903. deprecated: true,
  18904. type: "integer"
  18905. },
  18906. owner: {
  18907. required: true,
  18908. type: "string"
  18909. },
  18910. page: {
  18911. type: "integer"
  18912. },
  18913. per_page: {
  18914. type: "integer"
  18915. },
  18916. pull_number: {
  18917. required: true,
  18918. type: "integer"
  18919. },
  18920. repo: {
  18921. required: true,
  18922. type: "string"
  18923. },
  18924. since: {
  18925. type: "string"
  18926. },
  18927. sort: {
  18928. enum: ["created", "updated"],
  18929. type: "string"
  18930. }
  18931. },
  18932. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18933. },
  18934. listCommentsForRepo: {
  18935. method: "GET",
  18936. params: {
  18937. direction: {
  18938. enum: ["asc", "desc"],
  18939. type: "string"
  18940. },
  18941. owner: {
  18942. required: true,
  18943. type: "string"
  18944. },
  18945. page: {
  18946. type: "integer"
  18947. },
  18948. per_page: {
  18949. type: "integer"
  18950. },
  18951. repo: {
  18952. required: true,
  18953. type: "string"
  18954. },
  18955. since: {
  18956. type: "string"
  18957. },
  18958. sort: {
  18959. enum: ["created", "updated"],
  18960. type: "string"
  18961. }
  18962. },
  18963. url: "/repos/:owner/:repo/pulls/comments"
  18964. },
  18965. listCommits: {
  18966. method: "GET",
  18967. params: {
  18968. number: {
  18969. alias: "pull_number",
  18970. deprecated: true,
  18971. type: "integer"
  18972. },
  18973. owner: {
  18974. required: true,
  18975. type: "string"
  18976. },
  18977. page: {
  18978. type: "integer"
  18979. },
  18980. per_page: {
  18981. type: "integer"
  18982. },
  18983. pull_number: {
  18984. required: true,
  18985. type: "integer"
  18986. },
  18987. repo: {
  18988. required: true,
  18989. type: "string"
  18990. }
  18991. },
  18992. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  18993. },
  18994. listFiles: {
  18995. method: "GET",
  18996. params: {
  18997. number: {
  18998. alias: "pull_number",
  18999. deprecated: true,
  19000. type: "integer"
  19001. },
  19002. owner: {
  19003. required: true,
  19004. type: "string"
  19005. },
  19006. page: {
  19007. type: "integer"
  19008. },
  19009. per_page: {
  19010. type: "integer"
  19011. },
  19012. pull_number: {
  19013. required: true,
  19014. type: "integer"
  19015. },
  19016. repo: {
  19017. required: true,
  19018. type: "string"
  19019. }
  19020. },
  19021. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19022. },
  19023. listReviewRequests: {
  19024. method: "GET",
  19025. params: {
  19026. number: {
  19027. alias: "pull_number",
  19028. deprecated: true,
  19029. type: "integer"
  19030. },
  19031. owner: {
  19032. required: true,
  19033. type: "string"
  19034. },
  19035. page: {
  19036. type: "integer"
  19037. },
  19038. per_page: {
  19039. type: "integer"
  19040. },
  19041. pull_number: {
  19042. required: true,
  19043. type: "integer"
  19044. },
  19045. repo: {
  19046. required: true,
  19047. type: "string"
  19048. }
  19049. },
  19050. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19051. },
  19052. listReviews: {
  19053. method: "GET",
  19054. params: {
  19055. number: {
  19056. alias: "pull_number",
  19057. deprecated: true,
  19058. type: "integer"
  19059. },
  19060. owner: {
  19061. required: true,
  19062. type: "string"
  19063. },
  19064. page: {
  19065. type: "integer"
  19066. },
  19067. per_page: {
  19068. type: "integer"
  19069. },
  19070. pull_number: {
  19071. required: true,
  19072. type: "integer"
  19073. },
  19074. repo: {
  19075. required: true,
  19076. type: "string"
  19077. }
  19078. },
  19079. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19080. },
  19081. merge: {
  19082. method: "PUT",
  19083. params: {
  19084. commit_message: {
  19085. type: "string"
  19086. },
  19087. commit_title: {
  19088. type: "string"
  19089. },
  19090. merge_method: {
  19091. enum: ["merge", "squash", "rebase"],
  19092. type: "string"
  19093. },
  19094. number: {
  19095. alias: "pull_number",
  19096. deprecated: true,
  19097. type: "integer"
  19098. },
  19099. owner: {
  19100. required: true,
  19101. type: "string"
  19102. },
  19103. pull_number: {
  19104. required: true,
  19105. type: "integer"
  19106. },
  19107. repo: {
  19108. required: true,
  19109. type: "string"
  19110. },
  19111. sha: {
  19112. type: "string"
  19113. }
  19114. },
  19115. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19116. },
  19117. submitReview: {
  19118. method: "POST",
  19119. params: {
  19120. body: {
  19121. type: "string"
  19122. },
  19123. event: {
  19124. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19125. required: true,
  19126. type: "string"
  19127. },
  19128. number: {
  19129. alias: "pull_number",
  19130. deprecated: true,
  19131. type: "integer"
  19132. },
  19133. owner: {
  19134. required: true,
  19135. type: "string"
  19136. },
  19137. pull_number: {
  19138. required: true,
  19139. type: "integer"
  19140. },
  19141. repo: {
  19142. required: true,
  19143. type: "string"
  19144. },
  19145. review_id: {
  19146. required: true,
  19147. type: "integer"
  19148. }
  19149. },
  19150. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19151. },
  19152. update: {
  19153. method: "PATCH",
  19154. params: {
  19155. base: {
  19156. type: "string"
  19157. },
  19158. body: {
  19159. type: "string"
  19160. },
  19161. maintainer_can_modify: {
  19162. type: "boolean"
  19163. },
  19164. number: {
  19165. alias: "pull_number",
  19166. deprecated: true,
  19167. type: "integer"
  19168. },
  19169. owner: {
  19170. required: true,
  19171. type: "string"
  19172. },
  19173. pull_number: {
  19174. required: true,
  19175. type: "integer"
  19176. },
  19177. repo: {
  19178. required: true,
  19179. type: "string"
  19180. },
  19181. state: {
  19182. enum: ["open", "closed"],
  19183. type: "string"
  19184. },
  19185. title: {
  19186. type: "string"
  19187. }
  19188. },
  19189. url: "/repos/:owner/:repo/pulls/:pull_number"
  19190. },
  19191. updateBranch: {
  19192. headers: {
  19193. accept: "application/vnd.github.lydian-preview+json"
  19194. },
  19195. method: "PUT",
  19196. params: {
  19197. expected_head_sha: {
  19198. type: "string"
  19199. },
  19200. owner: {
  19201. required: true,
  19202. type: "string"
  19203. },
  19204. pull_number: {
  19205. required: true,
  19206. type: "integer"
  19207. },
  19208. repo: {
  19209. required: true,
  19210. type: "string"
  19211. }
  19212. },
  19213. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19214. },
  19215. updateComment: {
  19216. method: "PATCH",
  19217. params: {
  19218. body: {
  19219. required: true,
  19220. type: "string"
  19221. },
  19222. comment_id: {
  19223. required: true,
  19224. type: "integer"
  19225. },
  19226. owner: {
  19227. required: true,
  19228. type: "string"
  19229. },
  19230. repo: {
  19231. required: true,
  19232. type: "string"
  19233. }
  19234. },
  19235. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19236. },
  19237. updateReview: {
  19238. method: "PUT",
  19239. params: {
  19240. body: {
  19241. required: true,
  19242. type: "string"
  19243. },
  19244. number: {
  19245. alias: "pull_number",
  19246. deprecated: true,
  19247. type: "integer"
  19248. },
  19249. owner: {
  19250. required: true,
  19251. type: "string"
  19252. },
  19253. pull_number: {
  19254. required: true,
  19255. type: "integer"
  19256. },
  19257. repo: {
  19258. required: true,
  19259. type: "string"
  19260. },
  19261. review_id: {
  19262. required: true,
  19263. type: "integer"
  19264. }
  19265. },
  19266. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19267. }
  19268. },
  19269. rateLimit: {
  19270. get: {
  19271. method: "GET",
  19272. params: {},
  19273. url: "/rate_limit"
  19274. }
  19275. },
  19276. reactions: {
  19277. createForCommitComment: {
  19278. headers: {
  19279. accept: "application/vnd.github.squirrel-girl-preview+json"
  19280. },
  19281. method: "POST",
  19282. params: {
  19283. comment_id: {
  19284. required: true,
  19285. type: "integer"
  19286. },
  19287. content: {
  19288. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19289. required: true,
  19290. type: "string"
  19291. },
  19292. owner: {
  19293. required: true,
  19294. type: "string"
  19295. },
  19296. repo: {
  19297. required: true,
  19298. type: "string"
  19299. }
  19300. },
  19301. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19302. },
  19303. createForIssue: {
  19304. headers: {
  19305. accept: "application/vnd.github.squirrel-girl-preview+json"
  19306. },
  19307. method: "POST",
  19308. params: {
  19309. content: {
  19310. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19311. required: true,
  19312. type: "string"
  19313. },
  19314. issue_number: {
  19315. required: true,
  19316. type: "integer"
  19317. },
  19318. number: {
  19319. alias: "issue_number",
  19320. deprecated: true,
  19321. type: "integer"
  19322. },
  19323. owner: {
  19324. required: true,
  19325. type: "string"
  19326. },
  19327. repo: {
  19328. required: true,
  19329. type: "string"
  19330. }
  19331. },
  19332. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19333. },
  19334. createForIssueComment: {
  19335. headers: {
  19336. accept: "application/vnd.github.squirrel-girl-preview+json"
  19337. },
  19338. method: "POST",
  19339. params: {
  19340. comment_id: {
  19341. required: true,
  19342. type: "integer"
  19343. },
  19344. content: {
  19345. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19346. required: true,
  19347. type: "string"
  19348. },
  19349. owner: {
  19350. required: true,
  19351. type: "string"
  19352. },
  19353. repo: {
  19354. required: true,
  19355. type: "string"
  19356. }
  19357. },
  19358. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19359. },
  19360. createForPullRequestReviewComment: {
  19361. headers: {
  19362. accept: "application/vnd.github.squirrel-girl-preview+json"
  19363. },
  19364. method: "POST",
  19365. params: {
  19366. comment_id: {
  19367. required: true,
  19368. type: "integer"
  19369. },
  19370. content: {
  19371. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19372. required: true,
  19373. type: "string"
  19374. },
  19375. owner: {
  19376. required: true,
  19377. type: "string"
  19378. },
  19379. repo: {
  19380. required: true,
  19381. type: "string"
  19382. }
  19383. },
  19384. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19385. },
  19386. createForTeamDiscussion: {
  19387. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19388. headers: {
  19389. accept: "application/vnd.github.squirrel-girl-preview+json"
  19390. },
  19391. method: "POST",
  19392. params: {
  19393. content: {
  19394. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19395. required: true,
  19396. type: "string"
  19397. },
  19398. discussion_number: {
  19399. required: true,
  19400. type: "integer"
  19401. },
  19402. team_id: {
  19403. required: true,
  19404. type: "integer"
  19405. }
  19406. },
  19407. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19408. },
  19409. createForTeamDiscussionComment: {
  19410. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19411. headers: {
  19412. accept: "application/vnd.github.squirrel-girl-preview+json"
  19413. },
  19414. method: "POST",
  19415. params: {
  19416. comment_number: {
  19417. required: true,
  19418. type: "integer"
  19419. },
  19420. content: {
  19421. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19422. required: true,
  19423. type: "string"
  19424. },
  19425. discussion_number: {
  19426. required: true,
  19427. type: "integer"
  19428. },
  19429. team_id: {
  19430. required: true,
  19431. type: "integer"
  19432. }
  19433. },
  19434. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19435. },
  19436. createForTeamDiscussionCommentInOrg: {
  19437. headers: {
  19438. accept: "application/vnd.github.squirrel-girl-preview+json"
  19439. },
  19440. method: "POST",
  19441. params: {
  19442. comment_number: {
  19443. required: true,
  19444. type: "integer"
  19445. },
  19446. content: {
  19447. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19448. required: true,
  19449. type: "string"
  19450. },
  19451. discussion_number: {
  19452. required: true,
  19453. type: "integer"
  19454. },
  19455. org: {
  19456. required: true,
  19457. type: "string"
  19458. },
  19459. team_slug: {
  19460. required: true,
  19461. type: "string"
  19462. }
  19463. },
  19464. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19465. },
  19466. createForTeamDiscussionCommentLegacy: {
  19467. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19468. headers: {
  19469. accept: "application/vnd.github.squirrel-girl-preview+json"
  19470. },
  19471. method: "POST",
  19472. params: {
  19473. comment_number: {
  19474. required: true,
  19475. type: "integer"
  19476. },
  19477. content: {
  19478. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19479. required: true,
  19480. type: "string"
  19481. },
  19482. discussion_number: {
  19483. required: true,
  19484. type: "integer"
  19485. },
  19486. team_id: {
  19487. required: true,
  19488. type: "integer"
  19489. }
  19490. },
  19491. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19492. },
  19493. createForTeamDiscussionInOrg: {
  19494. headers: {
  19495. accept: "application/vnd.github.squirrel-girl-preview+json"
  19496. },
  19497. method: "POST",
  19498. params: {
  19499. content: {
  19500. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19501. required: true,
  19502. type: "string"
  19503. },
  19504. discussion_number: {
  19505. required: true,
  19506. type: "integer"
  19507. },
  19508. org: {
  19509. required: true,
  19510. type: "string"
  19511. },
  19512. team_slug: {
  19513. required: true,
  19514. type: "string"
  19515. }
  19516. },
  19517. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19518. },
  19519. createForTeamDiscussionLegacy: {
  19520. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19521. headers: {
  19522. accept: "application/vnd.github.squirrel-girl-preview+json"
  19523. },
  19524. method: "POST",
  19525. params: {
  19526. content: {
  19527. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19528. required: true,
  19529. type: "string"
  19530. },
  19531. discussion_number: {
  19532. required: true,
  19533. type: "integer"
  19534. },
  19535. team_id: {
  19536. required: true,
  19537. type: "integer"
  19538. }
  19539. },
  19540. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19541. },
  19542. delete: {
  19543. headers: {
  19544. accept: "application/vnd.github.squirrel-girl-preview+json"
  19545. },
  19546. method: "DELETE",
  19547. params: {
  19548. reaction_id: {
  19549. required: true,
  19550. type: "integer"
  19551. }
  19552. },
  19553. url: "/reactions/:reaction_id"
  19554. },
  19555. listForCommitComment: {
  19556. headers: {
  19557. accept: "application/vnd.github.squirrel-girl-preview+json"
  19558. },
  19559. method: "GET",
  19560. params: {
  19561. comment_id: {
  19562. required: true,
  19563. type: "integer"
  19564. },
  19565. content: {
  19566. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19567. type: "string"
  19568. },
  19569. owner: {
  19570. required: true,
  19571. type: "string"
  19572. },
  19573. page: {
  19574. type: "integer"
  19575. },
  19576. per_page: {
  19577. type: "integer"
  19578. },
  19579. repo: {
  19580. required: true,
  19581. type: "string"
  19582. }
  19583. },
  19584. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19585. },
  19586. listForIssue: {
  19587. headers: {
  19588. accept: "application/vnd.github.squirrel-girl-preview+json"
  19589. },
  19590. method: "GET",
  19591. params: {
  19592. content: {
  19593. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19594. type: "string"
  19595. },
  19596. issue_number: {
  19597. required: true,
  19598. type: "integer"
  19599. },
  19600. number: {
  19601. alias: "issue_number",
  19602. deprecated: true,
  19603. type: "integer"
  19604. },
  19605. owner: {
  19606. required: true,
  19607. type: "string"
  19608. },
  19609. page: {
  19610. type: "integer"
  19611. },
  19612. per_page: {
  19613. type: "integer"
  19614. },
  19615. repo: {
  19616. required: true,
  19617. type: "string"
  19618. }
  19619. },
  19620. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19621. },
  19622. listForIssueComment: {
  19623. headers: {
  19624. accept: "application/vnd.github.squirrel-girl-preview+json"
  19625. },
  19626. method: "GET",
  19627. params: {
  19628. comment_id: {
  19629. required: true,
  19630. type: "integer"
  19631. },
  19632. content: {
  19633. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19634. type: "string"
  19635. },
  19636. owner: {
  19637. required: true,
  19638. type: "string"
  19639. },
  19640. page: {
  19641. type: "integer"
  19642. },
  19643. per_page: {
  19644. type: "integer"
  19645. },
  19646. repo: {
  19647. required: true,
  19648. type: "string"
  19649. }
  19650. },
  19651. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19652. },
  19653. listForPullRequestReviewComment: {
  19654. headers: {
  19655. accept: "application/vnd.github.squirrel-girl-preview+json"
  19656. },
  19657. method: "GET",
  19658. params: {
  19659. comment_id: {
  19660. required: true,
  19661. type: "integer"
  19662. },
  19663. content: {
  19664. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19665. type: "string"
  19666. },
  19667. owner: {
  19668. required: true,
  19669. type: "string"
  19670. },
  19671. page: {
  19672. type: "integer"
  19673. },
  19674. per_page: {
  19675. type: "integer"
  19676. },
  19677. repo: {
  19678. required: true,
  19679. type: "string"
  19680. }
  19681. },
  19682. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19683. },
  19684. listForTeamDiscussion: {
  19685. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19686. headers: {
  19687. accept: "application/vnd.github.squirrel-girl-preview+json"
  19688. },
  19689. method: "GET",
  19690. params: {
  19691. content: {
  19692. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19693. type: "string"
  19694. },
  19695. discussion_number: {
  19696. required: true,
  19697. type: "integer"
  19698. },
  19699. page: {
  19700. type: "integer"
  19701. },
  19702. per_page: {
  19703. type: "integer"
  19704. },
  19705. team_id: {
  19706. required: true,
  19707. type: "integer"
  19708. }
  19709. },
  19710. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19711. },
  19712. listForTeamDiscussionComment: {
  19713. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19714. headers: {
  19715. accept: "application/vnd.github.squirrel-girl-preview+json"
  19716. },
  19717. method: "GET",
  19718. params: {
  19719. comment_number: {
  19720. required: true,
  19721. type: "integer"
  19722. },
  19723. content: {
  19724. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19725. type: "string"
  19726. },
  19727. discussion_number: {
  19728. required: true,
  19729. type: "integer"
  19730. },
  19731. page: {
  19732. type: "integer"
  19733. },
  19734. per_page: {
  19735. type: "integer"
  19736. },
  19737. team_id: {
  19738. required: true,
  19739. type: "integer"
  19740. }
  19741. },
  19742. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19743. },
  19744. listForTeamDiscussionCommentInOrg: {
  19745. headers: {
  19746. accept: "application/vnd.github.squirrel-girl-preview+json"
  19747. },
  19748. method: "GET",
  19749. params: {
  19750. comment_number: {
  19751. required: true,
  19752. type: "integer"
  19753. },
  19754. content: {
  19755. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19756. type: "string"
  19757. },
  19758. discussion_number: {
  19759. required: true,
  19760. type: "integer"
  19761. },
  19762. org: {
  19763. required: true,
  19764. type: "string"
  19765. },
  19766. page: {
  19767. type: "integer"
  19768. },
  19769. per_page: {
  19770. type: "integer"
  19771. },
  19772. team_slug: {
  19773. required: true,
  19774. type: "string"
  19775. }
  19776. },
  19777. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19778. },
  19779. listForTeamDiscussionCommentLegacy: {
  19780. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19781. headers: {
  19782. accept: "application/vnd.github.squirrel-girl-preview+json"
  19783. },
  19784. method: "GET",
  19785. params: {
  19786. comment_number: {
  19787. required: true,
  19788. type: "integer"
  19789. },
  19790. content: {
  19791. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19792. type: "string"
  19793. },
  19794. discussion_number: {
  19795. required: true,
  19796. type: "integer"
  19797. },
  19798. page: {
  19799. type: "integer"
  19800. },
  19801. per_page: {
  19802. type: "integer"
  19803. },
  19804. team_id: {
  19805. required: true,
  19806. type: "integer"
  19807. }
  19808. },
  19809. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19810. },
  19811. listForTeamDiscussionInOrg: {
  19812. headers: {
  19813. accept: "application/vnd.github.squirrel-girl-preview+json"
  19814. },
  19815. method: "GET",
  19816. params: {
  19817. content: {
  19818. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19819. type: "string"
  19820. },
  19821. discussion_number: {
  19822. required: true,
  19823. type: "integer"
  19824. },
  19825. org: {
  19826. required: true,
  19827. type: "string"
  19828. },
  19829. page: {
  19830. type: "integer"
  19831. },
  19832. per_page: {
  19833. type: "integer"
  19834. },
  19835. team_slug: {
  19836. required: true,
  19837. type: "string"
  19838. }
  19839. },
  19840. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19841. },
  19842. listForTeamDiscussionLegacy: {
  19843. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  19844. headers: {
  19845. accept: "application/vnd.github.squirrel-girl-preview+json"
  19846. },
  19847. method: "GET",
  19848. params: {
  19849. content: {
  19850. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19851. type: "string"
  19852. },
  19853. discussion_number: {
  19854. required: true,
  19855. type: "integer"
  19856. },
  19857. page: {
  19858. type: "integer"
  19859. },
  19860. per_page: {
  19861. type: "integer"
  19862. },
  19863. team_id: {
  19864. required: true,
  19865. type: "integer"
  19866. }
  19867. },
  19868. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19869. }
  19870. },
  19871. repos: {
  19872. acceptInvitation: {
  19873. method: "PATCH",
  19874. params: {
  19875. invitation_id: {
  19876. required: true,
  19877. type: "integer"
  19878. }
  19879. },
  19880. url: "/user/repository_invitations/:invitation_id"
  19881. },
  19882. addCollaborator: {
  19883. method: "PUT",
  19884. params: {
  19885. owner: {
  19886. required: true,
  19887. type: "string"
  19888. },
  19889. permission: {
  19890. enum: ["pull", "push", "admin"],
  19891. type: "string"
  19892. },
  19893. repo: {
  19894. required: true,
  19895. type: "string"
  19896. },
  19897. username: {
  19898. required: true,
  19899. type: "string"
  19900. }
  19901. },
  19902. url: "/repos/:owner/:repo/collaborators/:username"
  19903. },
  19904. addDeployKey: {
  19905. method: "POST",
  19906. params: {
  19907. key: {
  19908. required: true,
  19909. type: "string"
  19910. },
  19911. owner: {
  19912. required: true,
  19913. type: "string"
  19914. },
  19915. read_only: {
  19916. type: "boolean"
  19917. },
  19918. repo: {
  19919. required: true,
  19920. type: "string"
  19921. },
  19922. title: {
  19923. type: "string"
  19924. }
  19925. },
  19926. url: "/repos/:owner/:repo/keys"
  19927. },
  19928. addProtectedBranchAdminEnforcement: {
  19929. method: "POST",
  19930. params: {
  19931. branch: {
  19932. required: true,
  19933. type: "string"
  19934. },
  19935. owner: {
  19936. required: true,
  19937. type: "string"
  19938. },
  19939. repo: {
  19940. required: true,
  19941. type: "string"
  19942. }
  19943. },
  19944. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  19945. },
  19946. addProtectedBranchAppRestrictions: {
  19947. method: "POST",
  19948. params: {
  19949. apps: {
  19950. mapTo: "data",
  19951. required: true,
  19952. type: "string[]"
  19953. },
  19954. branch: {
  19955. required: true,
  19956. type: "string"
  19957. },
  19958. owner: {
  19959. required: true,
  19960. type: "string"
  19961. },
  19962. repo: {
  19963. required: true,
  19964. type: "string"
  19965. }
  19966. },
  19967. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  19968. },
  19969. addProtectedBranchRequiredSignatures: {
  19970. headers: {
  19971. accept: "application/vnd.github.zzzax-preview+json"
  19972. },
  19973. method: "POST",
  19974. params: {
  19975. branch: {
  19976. required: true,
  19977. type: "string"
  19978. },
  19979. owner: {
  19980. required: true,
  19981. type: "string"
  19982. },
  19983. repo: {
  19984. required: true,
  19985. type: "string"
  19986. }
  19987. },
  19988. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  19989. },
  19990. addProtectedBranchRequiredStatusChecksContexts: {
  19991. method: "POST",
  19992. params: {
  19993. branch: {
  19994. required: true,
  19995. type: "string"
  19996. },
  19997. contexts: {
  19998. mapTo: "data",
  19999. required: true,
  20000. type: "string[]"
  20001. },
  20002. owner: {
  20003. required: true,
  20004. type: "string"
  20005. },
  20006. repo: {
  20007. required: true,
  20008. type: "string"
  20009. }
  20010. },
  20011. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20012. },
  20013. addProtectedBranchTeamRestrictions: {
  20014. method: "POST",
  20015. params: {
  20016. branch: {
  20017. required: true,
  20018. type: "string"
  20019. },
  20020. owner: {
  20021. required: true,
  20022. type: "string"
  20023. },
  20024. repo: {
  20025. required: true,
  20026. type: "string"
  20027. },
  20028. teams: {
  20029. mapTo: "data",
  20030. required: true,
  20031. type: "string[]"
  20032. }
  20033. },
  20034. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20035. },
  20036. addProtectedBranchUserRestrictions: {
  20037. method: "POST",
  20038. params: {
  20039. branch: {
  20040. required: true,
  20041. type: "string"
  20042. },
  20043. owner: {
  20044. required: true,
  20045. type: "string"
  20046. },
  20047. repo: {
  20048. required: true,
  20049. type: "string"
  20050. },
  20051. users: {
  20052. mapTo: "data",
  20053. required: true,
  20054. type: "string[]"
  20055. }
  20056. },
  20057. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20058. },
  20059. checkCollaborator: {
  20060. method: "GET",
  20061. params: {
  20062. owner: {
  20063. required: true,
  20064. type: "string"
  20065. },
  20066. repo: {
  20067. required: true,
  20068. type: "string"
  20069. },
  20070. username: {
  20071. required: true,
  20072. type: "string"
  20073. }
  20074. },
  20075. url: "/repos/:owner/:repo/collaborators/:username"
  20076. },
  20077. checkVulnerabilityAlerts: {
  20078. headers: {
  20079. accept: "application/vnd.github.dorian-preview+json"
  20080. },
  20081. method: "GET",
  20082. params: {
  20083. owner: {
  20084. required: true,
  20085. type: "string"
  20086. },
  20087. repo: {
  20088. required: true,
  20089. type: "string"
  20090. }
  20091. },
  20092. url: "/repos/:owner/:repo/vulnerability-alerts"
  20093. },
  20094. compareCommits: {
  20095. method: "GET",
  20096. params: {
  20097. base: {
  20098. required: true,
  20099. type: "string"
  20100. },
  20101. head: {
  20102. required: true,
  20103. type: "string"
  20104. },
  20105. owner: {
  20106. required: true,
  20107. type: "string"
  20108. },
  20109. repo: {
  20110. required: true,
  20111. type: "string"
  20112. }
  20113. },
  20114. url: "/repos/:owner/:repo/compare/:base...:head"
  20115. },
  20116. createCommitComment: {
  20117. method: "POST",
  20118. params: {
  20119. body: {
  20120. required: true,
  20121. type: "string"
  20122. },
  20123. commit_sha: {
  20124. required: true,
  20125. type: "string"
  20126. },
  20127. line: {
  20128. type: "integer"
  20129. },
  20130. owner: {
  20131. required: true,
  20132. type: "string"
  20133. },
  20134. path: {
  20135. type: "string"
  20136. },
  20137. position: {
  20138. type: "integer"
  20139. },
  20140. repo: {
  20141. required: true,
  20142. type: "string"
  20143. },
  20144. sha: {
  20145. alias: "commit_sha",
  20146. deprecated: true,
  20147. type: "string"
  20148. }
  20149. },
  20150. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20151. },
  20152. createDeployment: {
  20153. method: "POST",
  20154. params: {
  20155. auto_merge: {
  20156. type: "boolean"
  20157. },
  20158. description: {
  20159. type: "string"
  20160. },
  20161. environment: {
  20162. type: "string"
  20163. },
  20164. owner: {
  20165. required: true,
  20166. type: "string"
  20167. },
  20168. payload: {
  20169. type: "string"
  20170. },
  20171. production_environment: {
  20172. type: "boolean"
  20173. },
  20174. ref: {
  20175. required: true,
  20176. type: "string"
  20177. },
  20178. repo: {
  20179. required: true,
  20180. type: "string"
  20181. },
  20182. required_contexts: {
  20183. type: "string[]"
  20184. },
  20185. task: {
  20186. type: "string"
  20187. },
  20188. transient_environment: {
  20189. type: "boolean"
  20190. }
  20191. },
  20192. url: "/repos/:owner/:repo/deployments"
  20193. },
  20194. createDeploymentStatus: {
  20195. method: "POST",
  20196. params: {
  20197. auto_inactive: {
  20198. type: "boolean"
  20199. },
  20200. deployment_id: {
  20201. required: true,
  20202. type: "integer"
  20203. },
  20204. description: {
  20205. type: "string"
  20206. },
  20207. environment: {
  20208. enum: ["production", "staging", "qa"],
  20209. type: "string"
  20210. },
  20211. environment_url: {
  20212. type: "string"
  20213. },
  20214. log_url: {
  20215. type: "string"
  20216. },
  20217. owner: {
  20218. required: true,
  20219. type: "string"
  20220. },
  20221. repo: {
  20222. required: true,
  20223. type: "string"
  20224. },
  20225. state: {
  20226. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20227. required: true,
  20228. type: "string"
  20229. },
  20230. target_url: {
  20231. type: "string"
  20232. }
  20233. },
  20234. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20235. },
  20236. createDispatchEvent: {
  20237. method: "POST",
  20238. params: {
  20239. client_payload: {
  20240. type: "object"
  20241. },
  20242. event_type: {
  20243. type: "string"
  20244. },
  20245. owner: {
  20246. required: true,
  20247. type: "string"
  20248. },
  20249. repo: {
  20250. required: true,
  20251. type: "string"
  20252. }
  20253. },
  20254. url: "/repos/:owner/:repo/dispatches"
  20255. },
  20256. createFile: {
  20257. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20258. method: "PUT",
  20259. params: {
  20260. author: {
  20261. type: "object"
  20262. },
  20263. "author.email": {
  20264. required: true,
  20265. type: "string"
  20266. },
  20267. "author.name": {
  20268. required: true,
  20269. type: "string"
  20270. },
  20271. branch: {
  20272. type: "string"
  20273. },
  20274. committer: {
  20275. type: "object"
  20276. },
  20277. "committer.email": {
  20278. required: true,
  20279. type: "string"
  20280. },
  20281. "committer.name": {
  20282. required: true,
  20283. type: "string"
  20284. },
  20285. content: {
  20286. required: true,
  20287. type: "string"
  20288. },
  20289. message: {
  20290. required: true,
  20291. type: "string"
  20292. },
  20293. owner: {
  20294. required: true,
  20295. type: "string"
  20296. },
  20297. path: {
  20298. required: true,
  20299. type: "string"
  20300. },
  20301. repo: {
  20302. required: true,
  20303. type: "string"
  20304. },
  20305. sha: {
  20306. type: "string"
  20307. }
  20308. },
  20309. url: "/repos/:owner/:repo/contents/:path"
  20310. },
  20311. createForAuthenticatedUser: {
  20312. method: "POST",
  20313. params: {
  20314. allow_merge_commit: {
  20315. type: "boolean"
  20316. },
  20317. allow_rebase_merge: {
  20318. type: "boolean"
  20319. },
  20320. allow_squash_merge: {
  20321. type: "boolean"
  20322. },
  20323. auto_init: {
  20324. type: "boolean"
  20325. },
  20326. delete_branch_on_merge: {
  20327. type: "boolean"
  20328. },
  20329. description: {
  20330. type: "string"
  20331. },
  20332. gitignore_template: {
  20333. type: "string"
  20334. },
  20335. has_issues: {
  20336. type: "boolean"
  20337. },
  20338. has_projects: {
  20339. type: "boolean"
  20340. },
  20341. has_wiki: {
  20342. type: "boolean"
  20343. },
  20344. homepage: {
  20345. type: "string"
  20346. },
  20347. is_template: {
  20348. type: "boolean"
  20349. },
  20350. license_template: {
  20351. type: "string"
  20352. },
  20353. name: {
  20354. required: true,
  20355. type: "string"
  20356. },
  20357. private: {
  20358. type: "boolean"
  20359. },
  20360. team_id: {
  20361. type: "integer"
  20362. },
  20363. visibility: {
  20364. enum: ["public", "private", "visibility", "internal"],
  20365. type: "string"
  20366. }
  20367. },
  20368. url: "/user/repos"
  20369. },
  20370. createFork: {
  20371. method: "POST",
  20372. params: {
  20373. organization: {
  20374. type: "string"
  20375. },
  20376. owner: {
  20377. required: true,
  20378. type: "string"
  20379. },
  20380. repo: {
  20381. required: true,
  20382. type: "string"
  20383. }
  20384. },
  20385. url: "/repos/:owner/:repo/forks"
  20386. },
  20387. createHook: {
  20388. method: "POST",
  20389. params: {
  20390. active: {
  20391. type: "boolean"
  20392. },
  20393. config: {
  20394. required: true,
  20395. type: "object"
  20396. },
  20397. "config.content_type": {
  20398. type: "string"
  20399. },
  20400. "config.insecure_ssl": {
  20401. type: "string"
  20402. },
  20403. "config.secret": {
  20404. type: "string"
  20405. },
  20406. "config.url": {
  20407. required: true,
  20408. type: "string"
  20409. },
  20410. events: {
  20411. type: "string[]"
  20412. },
  20413. name: {
  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/hooks"
  20426. },
  20427. createInOrg: {
  20428. method: "POST",
  20429. params: {
  20430. allow_merge_commit: {
  20431. type: "boolean"
  20432. },
  20433. allow_rebase_merge: {
  20434. type: "boolean"
  20435. },
  20436. allow_squash_merge: {
  20437. type: "boolean"
  20438. },
  20439. auto_init: {
  20440. type: "boolean"
  20441. },
  20442. delete_branch_on_merge: {
  20443. type: "boolean"
  20444. },
  20445. description: {
  20446. type: "string"
  20447. },
  20448. gitignore_template: {
  20449. type: "string"
  20450. },
  20451. has_issues: {
  20452. type: "boolean"
  20453. },
  20454. has_projects: {
  20455. type: "boolean"
  20456. },
  20457. has_wiki: {
  20458. type: "boolean"
  20459. },
  20460. homepage: {
  20461. type: "string"
  20462. },
  20463. is_template: {
  20464. type: "boolean"
  20465. },
  20466. license_template: {
  20467. type: "string"
  20468. },
  20469. name: {
  20470. required: true,
  20471. type: "string"
  20472. },
  20473. org: {
  20474. required: true,
  20475. type: "string"
  20476. },
  20477. private: {
  20478. type: "boolean"
  20479. },
  20480. team_id: {
  20481. type: "integer"
  20482. },
  20483. visibility: {
  20484. enum: ["public", "private", "visibility", "internal"],
  20485. type: "string"
  20486. }
  20487. },
  20488. url: "/orgs/:org/repos"
  20489. },
  20490. createOrUpdateFile: {
  20491. method: "PUT",
  20492. params: {
  20493. author: {
  20494. type: "object"
  20495. },
  20496. "author.email": {
  20497. required: true,
  20498. type: "string"
  20499. },
  20500. "author.name": {
  20501. required: true,
  20502. type: "string"
  20503. },
  20504. branch: {
  20505. type: "string"
  20506. },
  20507. committer: {
  20508. type: "object"
  20509. },
  20510. "committer.email": {
  20511. required: true,
  20512. type: "string"
  20513. },
  20514. "committer.name": {
  20515. required: true,
  20516. type: "string"
  20517. },
  20518. content: {
  20519. required: true,
  20520. type: "string"
  20521. },
  20522. message: {
  20523. required: true,
  20524. type: "string"
  20525. },
  20526. owner: {
  20527. required: true,
  20528. type: "string"
  20529. },
  20530. path: {
  20531. required: true,
  20532. type: "string"
  20533. },
  20534. repo: {
  20535. required: true,
  20536. type: "string"
  20537. },
  20538. sha: {
  20539. type: "string"
  20540. }
  20541. },
  20542. url: "/repos/:owner/:repo/contents/:path"
  20543. },
  20544. createRelease: {
  20545. method: "POST",
  20546. params: {
  20547. body: {
  20548. type: "string"
  20549. },
  20550. draft: {
  20551. type: "boolean"
  20552. },
  20553. name: {
  20554. type: "string"
  20555. },
  20556. owner: {
  20557. required: true,
  20558. type: "string"
  20559. },
  20560. prerelease: {
  20561. type: "boolean"
  20562. },
  20563. repo: {
  20564. required: true,
  20565. type: "string"
  20566. },
  20567. tag_name: {
  20568. required: true,
  20569. type: "string"
  20570. },
  20571. target_commitish: {
  20572. type: "string"
  20573. }
  20574. },
  20575. url: "/repos/:owner/:repo/releases"
  20576. },
  20577. createStatus: {
  20578. method: "POST",
  20579. params: {
  20580. context: {
  20581. type: "string"
  20582. },
  20583. description: {
  20584. type: "string"
  20585. },
  20586. owner: {
  20587. required: true,
  20588. type: "string"
  20589. },
  20590. repo: {
  20591. required: true,
  20592. type: "string"
  20593. },
  20594. sha: {
  20595. required: true,
  20596. type: "string"
  20597. },
  20598. state: {
  20599. enum: ["error", "failure", "pending", "success"],
  20600. required: true,
  20601. type: "string"
  20602. },
  20603. target_url: {
  20604. type: "string"
  20605. }
  20606. },
  20607. url: "/repos/:owner/:repo/statuses/:sha"
  20608. },
  20609. createUsingTemplate: {
  20610. headers: {
  20611. accept: "application/vnd.github.baptiste-preview+json"
  20612. },
  20613. method: "POST",
  20614. params: {
  20615. description: {
  20616. type: "string"
  20617. },
  20618. name: {
  20619. required: true,
  20620. type: "string"
  20621. },
  20622. owner: {
  20623. type: "string"
  20624. },
  20625. private: {
  20626. type: "boolean"
  20627. },
  20628. template_owner: {
  20629. required: true,
  20630. type: "string"
  20631. },
  20632. template_repo: {
  20633. required: true,
  20634. type: "string"
  20635. }
  20636. },
  20637. url: "/repos/:template_owner/:template_repo/generate"
  20638. },
  20639. declineInvitation: {
  20640. method: "DELETE",
  20641. params: {
  20642. invitation_id: {
  20643. required: true,
  20644. type: "integer"
  20645. }
  20646. },
  20647. url: "/user/repository_invitations/:invitation_id"
  20648. },
  20649. delete: {
  20650. method: "DELETE",
  20651. params: {
  20652. owner: {
  20653. required: true,
  20654. type: "string"
  20655. },
  20656. repo: {
  20657. required: true,
  20658. type: "string"
  20659. }
  20660. },
  20661. url: "/repos/:owner/:repo"
  20662. },
  20663. deleteCommitComment: {
  20664. method: "DELETE",
  20665. params: {
  20666. comment_id: {
  20667. required: true,
  20668. type: "integer"
  20669. },
  20670. owner: {
  20671. required: true,
  20672. type: "string"
  20673. },
  20674. repo: {
  20675. required: true,
  20676. type: "string"
  20677. }
  20678. },
  20679. url: "/repos/:owner/:repo/comments/:comment_id"
  20680. },
  20681. deleteDownload: {
  20682. method: "DELETE",
  20683. params: {
  20684. download_id: {
  20685. required: true,
  20686. type: "integer"
  20687. },
  20688. owner: {
  20689. required: true,
  20690. type: "string"
  20691. },
  20692. repo: {
  20693. required: true,
  20694. type: "string"
  20695. }
  20696. },
  20697. url: "/repos/:owner/:repo/downloads/:download_id"
  20698. },
  20699. deleteFile: {
  20700. method: "DELETE",
  20701. params: {
  20702. author: {
  20703. type: "object"
  20704. },
  20705. "author.email": {
  20706. type: "string"
  20707. },
  20708. "author.name": {
  20709. type: "string"
  20710. },
  20711. branch: {
  20712. type: "string"
  20713. },
  20714. committer: {
  20715. type: "object"
  20716. },
  20717. "committer.email": {
  20718. type: "string"
  20719. },
  20720. "committer.name": {
  20721. type: "string"
  20722. },
  20723. message: {
  20724. required: true,
  20725. type: "string"
  20726. },
  20727. owner: {
  20728. required: true,
  20729. type: "string"
  20730. },
  20731. path: {
  20732. required: true,
  20733. type: "string"
  20734. },
  20735. repo: {
  20736. required: true,
  20737. type: "string"
  20738. },
  20739. sha: {
  20740. required: true,
  20741. type: "string"
  20742. }
  20743. },
  20744. url: "/repos/:owner/:repo/contents/:path"
  20745. },
  20746. deleteHook: {
  20747. method: "DELETE",
  20748. params: {
  20749. hook_id: {
  20750. required: true,
  20751. type: "integer"
  20752. },
  20753. owner: {
  20754. required: true,
  20755. type: "string"
  20756. },
  20757. repo: {
  20758. required: true,
  20759. type: "string"
  20760. }
  20761. },
  20762. url: "/repos/:owner/:repo/hooks/:hook_id"
  20763. },
  20764. deleteInvitation: {
  20765. method: "DELETE",
  20766. params: {
  20767. invitation_id: {
  20768. required: true,
  20769. type: "integer"
  20770. },
  20771. owner: {
  20772. required: true,
  20773. type: "string"
  20774. },
  20775. repo: {
  20776. required: true,
  20777. type: "string"
  20778. }
  20779. },
  20780. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20781. },
  20782. deleteRelease: {
  20783. method: "DELETE",
  20784. params: {
  20785. owner: {
  20786. required: true,
  20787. type: "string"
  20788. },
  20789. release_id: {
  20790. required: true,
  20791. type: "integer"
  20792. },
  20793. repo: {
  20794. required: true,
  20795. type: "string"
  20796. }
  20797. },
  20798. url: "/repos/:owner/:repo/releases/:release_id"
  20799. },
  20800. deleteReleaseAsset: {
  20801. method: "DELETE",
  20802. params: {
  20803. asset_id: {
  20804. required: true,
  20805. type: "integer"
  20806. },
  20807. owner: {
  20808. required: true,
  20809. type: "string"
  20810. },
  20811. repo: {
  20812. required: true,
  20813. type: "string"
  20814. }
  20815. },
  20816. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20817. },
  20818. disableAutomatedSecurityFixes: {
  20819. headers: {
  20820. accept: "application/vnd.github.london-preview+json"
  20821. },
  20822. method: "DELETE",
  20823. params: {
  20824. owner: {
  20825. required: true,
  20826. type: "string"
  20827. },
  20828. repo: {
  20829. required: true,
  20830. type: "string"
  20831. }
  20832. },
  20833. url: "/repos/:owner/:repo/automated-security-fixes"
  20834. },
  20835. disablePagesSite: {
  20836. headers: {
  20837. accept: "application/vnd.github.switcheroo-preview+json"
  20838. },
  20839. method: "DELETE",
  20840. params: {
  20841. owner: {
  20842. required: true,
  20843. type: "string"
  20844. },
  20845. repo: {
  20846. required: true,
  20847. type: "string"
  20848. }
  20849. },
  20850. url: "/repos/:owner/:repo/pages"
  20851. },
  20852. disableVulnerabilityAlerts: {
  20853. headers: {
  20854. accept: "application/vnd.github.dorian-preview+json"
  20855. },
  20856. method: "DELETE",
  20857. params: {
  20858. owner: {
  20859. required: true,
  20860. type: "string"
  20861. },
  20862. repo: {
  20863. required: true,
  20864. type: "string"
  20865. }
  20866. },
  20867. url: "/repos/:owner/:repo/vulnerability-alerts"
  20868. },
  20869. enableAutomatedSecurityFixes: {
  20870. headers: {
  20871. accept: "application/vnd.github.london-preview+json"
  20872. },
  20873. method: "PUT",
  20874. params: {
  20875. owner: {
  20876. required: true,
  20877. type: "string"
  20878. },
  20879. repo: {
  20880. required: true,
  20881. type: "string"
  20882. }
  20883. },
  20884. url: "/repos/:owner/:repo/automated-security-fixes"
  20885. },
  20886. enablePagesSite: {
  20887. headers: {
  20888. accept: "application/vnd.github.switcheroo-preview+json"
  20889. },
  20890. method: "POST",
  20891. params: {
  20892. owner: {
  20893. required: true,
  20894. type: "string"
  20895. },
  20896. repo: {
  20897. required: true,
  20898. type: "string"
  20899. },
  20900. source: {
  20901. type: "object"
  20902. },
  20903. "source.branch": {
  20904. enum: ["master", "gh-pages"],
  20905. type: "string"
  20906. },
  20907. "source.path": {
  20908. type: "string"
  20909. }
  20910. },
  20911. url: "/repos/:owner/:repo/pages"
  20912. },
  20913. enableVulnerabilityAlerts: {
  20914. headers: {
  20915. accept: "application/vnd.github.dorian-preview+json"
  20916. },
  20917. method: "PUT",
  20918. params: {
  20919. owner: {
  20920. required: true,
  20921. type: "string"
  20922. },
  20923. repo: {
  20924. required: true,
  20925. type: "string"
  20926. }
  20927. },
  20928. url: "/repos/:owner/:repo/vulnerability-alerts"
  20929. },
  20930. get: {
  20931. method: "GET",
  20932. params: {
  20933. owner: {
  20934. required: true,
  20935. type: "string"
  20936. },
  20937. repo: {
  20938. required: true,
  20939. type: "string"
  20940. }
  20941. },
  20942. url: "/repos/:owner/:repo"
  20943. },
  20944. getAppsWithAccessToProtectedBranch: {
  20945. method: "GET",
  20946. params: {
  20947. branch: {
  20948. required: true,
  20949. type: "string"
  20950. },
  20951. owner: {
  20952. required: true,
  20953. type: "string"
  20954. },
  20955. repo: {
  20956. required: true,
  20957. type: "string"
  20958. }
  20959. },
  20960. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20961. },
  20962. getArchiveLink: {
  20963. method: "GET",
  20964. params: {
  20965. archive_format: {
  20966. required: true,
  20967. type: "string"
  20968. },
  20969. owner: {
  20970. required: true,
  20971. type: "string"
  20972. },
  20973. ref: {
  20974. required: true,
  20975. type: "string"
  20976. },
  20977. repo: {
  20978. required: true,
  20979. type: "string"
  20980. }
  20981. },
  20982. url: "/repos/:owner/:repo/:archive_format/:ref"
  20983. },
  20984. getBranch: {
  20985. method: "GET",
  20986. params: {
  20987. branch: {
  20988. required: true,
  20989. type: "string"
  20990. },
  20991. owner: {
  20992. required: true,
  20993. type: "string"
  20994. },
  20995. repo: {
  20996. required: true,
  20997. type: "string"
  20998. }
  20999. },
  21000. url: "/repos/:owner/:repo/branches/:branch"
  21001. },
  21002. getBranchProtection: {
  21003. method: "GET",
  21004. params: {
  21005. branch: {
  21006. required: true,
  21007. type: "string"
  21008. },
  21009. owner: {
  21010. required: true,
  21011. type: "string"
  21012. },
  21013. repo: {
  21014. required: true,
  21015. type: "string"
  21016. }
  21017. },
  21018. url: "/repos/:owner/:repo/branches/:branch/protection"
  21019. },
  21020. getClones: {
  21021. method: "GET",
  21022. params: {
  21023. owner: {
  21024. required: true,
  21025. type: "string"
  21026. },
  21027. per: {
  21028. enum: ["day", "week"],
  21029. type: "string"
  21030. },
  21031. repo: {
  21032. required: true,
  21033. type: "string"
  21034. }
  21035. },
  21036. url: "/repos/:owner/:repo/traffic/clones"
  21037. },
  21038. getCodeFrequencyStats: {
  21039. method: "GET",
  21040. params: {
  21041. owner: {
  21042. required: true,
  21043. type: "string"
  21044. },
  21045. repo: {
  21046. required: true,
  21047. type: "string"
  21048. }
  21049. },
  21050. url: "/repos/:owner/:repo/stats/code_frequency"
  21051. },
  21052. getCollaboratorPermissionLevel: {
  21053. method: "GET",
  21054. params: {
  21055. owner: {
  21056. required: true,
  21057. type: "string"
  21058. },
  21059. repo: {
  21060. required: true,
  21061. type: "string"
  21062. },
  21063. username: {
  21064. required: true,
  21065. type: "string"
  21066. }
  21067. },
  21068. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21069. },
  21070. getCombinedStatusForRef: {
  21071. method: "GET",
  21072. params: {
  21073. owner: {
  21074. required: true,
  21075. type: "string"
  21076. },
  21077. ref: {
  21078. required: true,
  21079. type: "string"
  21080. },
  21081. repo: {
  21082. required: true,
  21083. type: "string"
  21084. }
  21085. },
  21086. url: "/repos/:owner/:repo/commits/:ref/status"
  21087. },
  21088. getCommit: {
  21089. method: "GET",
  21090. params: {
  21091. commit_sha: {
  21092. alias: "ref",
  21093. deprecated: true,
  21094. type: "string"
  21095. },
  21096. owner: {
  21097. required: true,
  21098. type: "string"
  21099. },
  21100. ref: {
  21101. required: true,
  21102. type: "string"
  21103. },
  21104. repo: {
  21105. required: true,
  21106. type: "string"
  21107. },
  21108. sha: {
  21109. alias: "ref",
  21110. deprecated: true,
  21111. type: "string"
  21112. }
  21113. },
  21114. url: "/repos/:owner/:repo/commits/:ref"
  21115. },
  21116. getCommitActivityStats: {
  21117. method: "GET",
  21118. params: {
  21119. owner: {
  21120. required: true,
  21121. type: "string"
  21122. },
  21123. repo: {
  21124. required: true,
  21125. type: "string"
  21126. }
  21127. },
  21128. url: "/repos/:owner/:repo/stats/commit_activity"
  21129. },
  21130. getCommitComment: {
  21131. method: "GET",
  21132. params: {
  21133. comment_id: {
  21134. required: true,
  21135. type: "integer"
  21136. },
  21137. owner: {
  21138. required: true,
  21139. type: "string"
  21140. },
  21141. repo: {
  21142. required: true,
  21143. type: "string"
  21144. }
  21145. },
  21146. url: "/repos/:owner/:repo/comments/:comment_id"
  21147. },
  21148. getCommitRefSha: {
  21149. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21150. headers: {
  21151. accept: "application/vnd.github.v3.sha"
  21152. },
  21153. method: "GET",
  21154. params: {
  21155. owner: {
  21156. required: true,
  21157. type: "string"
  21158. },
  21159. ref: {
  21160. required: true,
  21161. type: "string"
  21162. },
  21163. repo: {
  21164. required: true,
  21165. type: "string"
  21166. }
  21167. },
  21168. url: "/repos/:owner/:repo/commits/:ref"
  21169. },
  21170. getContents: {
  21171. method: "GET",
  21172. params: {
  21173. owner: {
  21174. required: true,
  21175. type: "string"
  21176. },
  21177. path: {
  21178. required: true,
  21179. type: "string"
  21180. },
  21181. ref: {
  21182. type: "string"
  21183. },
  21184. repo: {
  21185. required: true,
  21186. type: "string"
  21187. }
  21188. },
  21189. url: "/repos/:owner/:repo/contents/:path"
  21190. },
  21191. getContributorsStats: {
  21192. method: "GET",
  21193. params: {
  21194. owner: {
  21195. required: true,
  21196. type: "string"
  21197. },
  21198. repo: {
  21199. required: true,
  21200. type: "string"
  21201. }
  21202. },
  21203. url: "/repos/:owner/:repo/stats/contributors"
  21204. },
  21205. getDeployKey: {
  21206. method: "GET",
  21207. params: {
  21208. key_id: {
  21209. required: true,
  21210. type: "integer"
  21211. },
  21212. owner: {
  21213. required: true,
  21214. type: "string"
  21215. },
  21216. repo: {
  21217. required: true,
  21218. type: "string"
  21219. }
  21220. },
  21221. url: "/repos/:owner/:repo/keys/:key_id"
  21222. },
  21223. getDeployment: {
  21224. method: "GET",
  21225. params: {
  21226. deployment_id: {
  21227. required: true,
  21228. type: "integer"
  21229. },
  21230. owner: {
  21231. required: true,
  21232. type: "string"
  21233. },
  21234. repo: {
  21235. required: true,
  21236. type: "string"
  21237. }
  21238. },
  21239. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21240. },
  21241. getDeploymentStatus: {
  21242. method: "GET",
  21243. params: {
  21244. deployment_id: {
  21245. required: true,
  21246. type: "integer"
  21247. },
  21248. owner: {
  21249. required: true,
  21250. type: "string"
  21251. },
  21252. repo: {
  21253. required: true,
  21254. type: "string"
  21255. },
  21256. status_id: {
  21257. required: true,
  21258. type: "integer"
  21259. }
  21260. },
  21261. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21262. },
  21263. getDownload: {
  21264. method: "GET",
  21265. params: {
  21266. download_id: {
  21267. required: true,
  21268. type: "integer"
  21269. },
  21270. owner: {
  21271. required: true,
  21272. type: "string"
  21273. },
  21274. repo: {
  21275. required: true,
  21276. type: "string"
  21277. }
  21278. },
  21279. url: "/repos/:owner/:repo/downloads/:download_id"
  21280. },
  21281. getHook: {
  21282. method: "GET",
  21283. params: {
  21284. hook_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/hooks/:hook_id"
  21298. },
  21299. getLatestPagesBuild: {
  21300. method: "GET",
  21301. params: {
  21302. owner: {
  21303. required: true,
  21304. type: "string"
  21305. },
  21306. repo: {
  21307. required: true,
  21308. type: "string"
  21309. }
  21310. },
  21311. url: "/repos/:owner/:repo/pages/builds/latest"
  21312. },
  21313. getLatestRelease: {
  21314. method: "GET",
  21315. params: {
  21316. owner: {
  21317. required: true,
  21318. type: "string"
  21319. },
  21320. repo: {
  21321. required: true,
  21322. type: "string"
  21323. }
  21324. },
  21325. url: "/repos/:owner/:repo/releases/latest"
  21326. },
  21327. getPages: {
  21328. method: "GET",
  21329. params: {
  21330. owner: {
  21331. required: true,
  21332. type: "string"
  21333. },
  21334. repo: {
  21335. required: true,
  21336. type: "string"
  21337. }
  21338. },
  21339. url: "/repos/:owner/:repo/pages"
  21340. },
  21341. getPagesBuild: {
  21342. method: "GET",
  21343. params: {
  21344. build_id: {
  21345. required: true,
  21346. type: "integer"
  21347. },
  21348. owner: {
  21349. required: true,
  21350. type: "string"
  21351. },
  21352. repo: {
  21353. required: true,
  21354. type: "string"
  21355. }
  21356. },
  21357. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21358. },
  21359. getParticipationStats: {
  21360. method: "GET",
  21361. params: {
  21362. owner: {
  21363. required: true,
  21364. type: "string"
  21365. },
  21366. repo: {
  21367. required: true,
  21368. type: "string"
  21369. }
  21370. },
  21371. url: "/repos/:owner/:repo/stats/participation"
  21372. },
  21373. getProtectedBranchAdminEnforcement: {
  21374. method: "GET",
  21375. params: {
  21376. branch: {
  21377. required: true,
  21378. type: "string"
  21379. },
  21380. owner: {
  21381. required: true,
  21382. type: "string"
  21383. },
  21384. repo: {
  21385. required: true,
  21386. type: "string"
  21387. }
  21388. },
  21389. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21390. },
  21391. getProtectedBranchPullRequestReviewEnforcement: {
  21392. method: "GET",
  21393. params: {
  21394. branch: {
  21395. required: true,
  21396. type: "string"
  21397. },
  21398. owner: {
  21399. required: true,
  21400. type: "string"
  21401. },
  21402. repo: {
  21403. required: true,
  21404. type: "string"
  21405. }
  21406. },
  21407. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21408. },
  21409. getProtectedBranchRequiredSignatures: {
  21410. headers: {
  21411. accept: "application/vnd.github.zzzax-preview+json"
  21412. },
  21413. method: "GET",
  21414. params: {
  21415. branch: {
  21416. required: true,
  21417. type: "string"
  21418. },
  21419. owner: {
  21420. required: true,
  21421. type: "string"
  21422. },
  21423. repo: {
  21424. required: true,
  21425. type: "string"
  21426. }
  21427. },
  21428. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21429. },
  21430. getProtectedBranchRequiredStatusChecks: {
  21431. method: "GET",
  21432. params: {
  21433. branch: {
  21434. required: true,
  21435. type: "string"
  21436. },
  21437. owner: {
  21438. required: true,
  21439. type: "string"
  21440. },
  21441. repo: {
  21442. required: true,
  21443. type: "string"
  21444. }
  21445. },
  21446. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21447. },
  21448. getProtectedBranchRestrictions: {
  21449. method: "GET",
  21450. params: {
  21451. branch: {
  21452. required: true,
  21453. type: "string"
  21454. },
  21455. owner: {
  21456. required: true,
  21457. type: "string"
  21458. },
  21459. repo: {
  21460. required: true,
  21461. type: "string"
  21462. }
  21463. },
  21464. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21465. },
  21466. getPunchCardStats: {
  21467. method: "GET",
  21468. params: {
  21469. owner: {
  21470. required: true,
  21471. type: "string"
  21472. },
  21473. repo: {
  21474. required: true,
  21475. type: "string"
  21476. }
  21477. },
  21478. url: "/repos/:owner/:repo/stats/punch_card"
  21479. },
  21480. getReadme: {
  21481. method: "GET",
  21482. params: {
  21483. owner: {
  21484. required: true,
  21485. type: "string"
  21486. },
  21487. ref: {
  21488. type: "string"
  21489. },
  21490. repo: {
  21491. required: true,
  21492. type: "string"
  21493. }
  21494. },
  21495. url: "/repos/:owner/:repo/readme"
  21496. },
  21497. getRelease: {
  21498. method: "GET",
  21499. params: {
  21500. owner: {
  21501. required: true,
  21502. type: "string"
  21503. },
  21504. release_id: {
  21505. required: true,
  21506. type: "integer"
  21507. },
  21508. repo: {
  21509. required: true,
  21510. type: "string"
  21511. }
  21512. },
  21513. url: "/repos/:owner/:repo/releases/:release_id"
  21514. },
  21515. getReleaseAsset: {
  21516. method: "GET",
  21517. params: {
  21518. asset_id: {
  21519. required: true,
  21520. type: "integer"
  21521. },
  21522. owner: {
  21523. required: true,
  21524. type: "string"
  21525. },
  21526. repo: {
  21527. required: true,
  21528. type: "string"
  21529. }
  21530. },
  21531. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21532. },
  21533. getReleaseByTag: {
  21534. method: "GET",
  21535. params: {
  21536. owner: {
  21537. required: true,
  21538. type: "string"
  21539. },
  21540. repo: {
  21541. required: true,
  21542. type: "string"
  21543. },
  21544. tag: {
  21545. required: true,
  21546. type: "string"
  21547. }
  21548. },
  21549. url: "/repos/:owner/:repo/releases/tags/:tag"
  21550. },
  21551. getTeamsWithAccessToProtectedBranch: {
  21552. method: "GET",
  21553. params: {
  21554. branch: {
  21555. required: true,
  21556. type: "string"
  21557. },
  21558. owner: {
  21559. required: true,
  21560. type: "string"
  21561. },
  21562. repo: {
  21563. required: true,
  21564. type: "string"
  21565. }
  21566. },
  21567. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21568. },
  21569. getTopPaths: {
  21570. method: "GET",
  21571. params: {
  21572. owner: {
  21573. required: true,
  21574. type: "string"
  21575. },
  21576. repo: {
  21577. required: true,
  21578. type: "string"
  21579. }
  21580. },
  21581. url: "/repos/:owner/:repo/traffic/popular/paths"
  21582. },
  21583. getTopReferrers: {
  21584. method: "GET",
  21585. params: {
  21586. owner: {
  21587. required: true,
  21588. type: "string"
  21589. },
  21590. repo: {
  21591. required: true,
  21592. type: "string"
  21593. }
  21594. },
  21595. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21596. },
  21597. getUsersWithAccessToProtectedBranch: {
  21598. method: "GET",
  21599. params: {
  21600. branch: {
  21601. required: true,
  21602. type: "string"
  21603. },
  21604. owner: {
  21605. required: true,
  21606. type: "string"
  21607. },
  21608. repo: {
  21609. required: true,
  21610. type: "string"
  21611. }
  21612. },
  21613. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21614. },
  21615. getViews: {
  21616. method: "GET",
  21617. params: {
  21618. owner: {
  21619. required: true,
  21620. type: "string"
  21621. },
  21622. per: {
  21623. enum: ["day", "week"],
  21624. type: "string"
  21625. },
  21626. repo: {
  21627. required: true,
  21628. type: "string"
  21629. }
  21630. },
  21631. url: "/repos/:owner/:repo/traffic/views"
  21632. },
  21633. list: {
  21634. method: "GET",
  21635. params: {
  21636. affiliation: {
  21637. type: "string"
  21638. },
  21639. direction: {
  21640. enum: ["asc", "desc"],
  21641. type: "string"
  21642. },
  21643. page: {
  21644. type: "integer"
  21645. },
  21646. per_page: {
  21647. type: "integer"
  21648. },
  21649. sort: {
  21650. enum: ["created", "updated", "pushed", "full_name"],
  21651. type: "string"
  21652. },
  21653. type: {
  21654. enum: ["all", "owner", "public", "private", "member"],
  21655. type: "string"
  21656. },
  21657. visibility: {
  21658. enum: ["all", "public", "private"],
  21659. type: "string"
  21660. }
  21661. },
  21662. url: "/user/repos"
  21663. },
  21664. listAppsWithAccessToProtectedBranch: {
  21665. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21666. method: "GET",
  21667. params: {
  21668. branch: {
  21669. required: true,
  21670. type: "string"
  21671. },
  21672. owner: {
  21673. required: true,
  21674. type: "string"
  21675. },
  21676. repo: {
  21677. required: true,
  21678. type: "string"
  21679. }
  21680. },
  21681. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21682. },
  21683. listAssetsForRelease: {
  21684. method: "GET",
  21685. params: {
  21686. owner: {
  21687. required: true,
  21688. type: "string"
  21689. },
  21690. page: {
  21691. type: "integer"
  21692. },
  21693. per_page: {
  21694. type: "integer"
  21695. },
  21696. release_id: {
  21697. required: true,
  21698. type: "integer"
  21699. },
  21700. repo: {
  21701. required: true,
  21702. type: "string"
  21703. }
  21704. },
  21705. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21706. },
  21707. listBranches: {
  21708. method: "GET",
  21709. params: {
  21710. owner: {
  21711. required: true,
  21712. type: "string"
  21713. },
  21714. page: {
  21715. type: "integer"
  21716. },
  21717. per_page: {
  21718. type: "integer"
  21719. },
  21720. protected: {
  21721. type: "boolean"
  21722. },
  21723. repo: {
  21724. required: true,
  21725. type: "string"
  21726. }
  21727. },
  21728. url: "/repos/:owner/:repo/branches"
  21729. },
  21730. listBranchesForHeadCommit: {
  21731. headers: {
  21732. accept: "application/vnd.github.groot-preview+json"
  21733. },
  21734. method: "GET",
  21735. params: {
  21736. commit_sha: {
  21737. required: true,
  21738. type: "string"
  21739. },
  21740. owner: {
  21741. required: true,
  21742. type: "string"
  21743. },
  21744. repo: {
  21745. required: true,
  21746. type: "string"
  21747. }
  21748. },
  21749. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21750. },
  21751. listCollaborators: {
  21752. method: "GET",
  21753. params: {
  21754. affiliation: {
  21755. enum: ["outside", "direct", "all"],
  21756. type: "string"
  21757. },
  21758. owner: {
  21759. required: true,
  21760. type: "string"
  21761. },
  21762. page: {
  21763. type: "integer"
  21764. },
  21765. per_page: {
  21766. type: "integer"
  21767. },
  21768. repo: {
  21769. required: true,
  21770. type: "string"
  21771. }
  21772. },
  21773. url: "/repos/:owner/:repo/collaborators"
  21774. },
  21775. listCommentsForCommit: {
  21776. method: "GET",
  21777. params: {
  21778. commit_sha: {
  21779. required: true,
  21780. type: "string"
  21781. },
  21782. owner: {
  21783. required: true,
  21784. type: "string"
  21785. },
  21786. page: {
  21787. type: "integer"
  21788. },
  21789. per_page: {
  21790. type: "integer"
  21791. },
  21792. ref: {
  21793. alias: "commit_sha",
  21794. deprecated: true,
  21795. type: "string"
  21796. },
  21797. repo: {
  21798. required: true,
  21799. type: "string"
  21800. }
  21801. },
  21802. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21803. },
  21804. listCommitComments: {
  21805. method: "GET",
  21806. params: {
  21807. owner: {
  21808. required: true,
  21809. type: "string"
  21810. },
  21811. page: {
  21812. type: "integer"
  21813. },
  21814. per_page: {
  21815. type: "integer"
  21816. },
  21817. repo: {
  21818. required: true,
  21819. type: "string"
  21820. }
  21821. },
  21822. url: "/repos/:owner/:repo/comments"
  21823. },
  21824. listCommits: {
  21825. method: "GET",
  21826. params: {
  21827. author: {
  21828. type: "string"
  21829. },
  21830. owner: {
  21831. required: true,
  21832. type: "string"
  21833. },
  21834. page: {
  21835. type: "integer"
  21836. },
  21837. path: {
  21838. type: "string"
  21839. },
  21840. per_page: {
  21841. type: "integer"
  21842. },
  21843. repo: {
  21844. required: true,
  21845. type: "string"
  21846. },
  21847. sha: {
  21848. type: "string"
  21849. },
  21850. since: {
  21851. type: "string"
  21852. },
  21853. until: {
  21854. type: "string"
  21855. }
  21856. },
  21857. url: "/repos/:owner/:repo/commits"
  21858. },
  21859. listContributors: {
  21860. method: "GET",
  21861. params: {
  21862. anon: {
  21863. type: "string"
  21864. },
  21865. owner: {
  21866. required: true,
  21867. type: "string"
  21868. },
  21869. page: {
  21870. type: "integer"
  21871. },
  21872. per_page: {
  21873. type: "integer"
  21874. },
  21875. repo: {
  21876. required: true,
  21877. type: "string"
  21878. }
  21879. },
  21880. url: "/repos/:owner/:repo/contributors"
  21881. },
  21882. listDeployKeys: {
  21883. method: "GET",
  21884. params: {
  21885. owner: {
  21886. required: true,
  21887. type: "string"
  21888. },
  21889. page: {
  21890. type: "integer"
  21891. },
  21892. per_page: {
  21893. type: "integer"
  21894. },
  21895. repo: {
  21896. required: true,
  21897. type: "string"
  21898. }
  21899. },
  21900. url: "/repos/:owner/:repo/keys"
  21901. },
  21902. listDeploymentStatuses: {
  21903. method: "GET",
  21904. params: {
  21905. deployment_id: {
  21906. required: true,
  21907. type: "integer"
  21908. },
  21909. owner: {
  21910. required: true,
  21911. type: "string"
  21912. },
  21913. page: {
  21914. type: "integer"
  21915. },
  21916. per_page: {
  21917. type: "integer"
  21918. },
  21919. repo: {
  21920. required: true,
  21921. type: "string"
  21922. }
  21923. },
  21924. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  21925. },
  21926. listDeployments: {
  21927. method: "GET",
  21928. params: {
  21929. environment: {
  21930. type: "string"
  21931. },
  21932. owner: {
  21933. required: true,
  21934. type: "string"
  21935. },
  21936. page: {
  21937. type: "integer"
  21938. },
  21939. per_page: {
  21940. type: "integer"
  21941. },
  21942. ref: {
  21943. type: "string"
  21944. },
  21945. repo: {
  21946. required: true,
  21947. type: "string"
  21948. },
  21949. sha: {
  21950. type: "string"
  21951. },
  21952. task: {
  21953. type: "string"
  21954. }
  21955. },
  21956. url: "/repos/:owner/:repo/deployments"
  21957. },
  21958. listDownloads: {
  21959. method: "GET",
  21960. params: {
  21961. owner: {
  21962. required: true,
  21963. type: "string"
  21964. },
  21965. page: {
  21966. type: "integer"
  21967. },
  21968. per_page: {
  21969. type: "integer"
  21970. },
  21971. repo: {
  21972. required: true,
  21973. type: "string"
  21974. }
  21975. },
  21976. url: "/repos/:owner/:repo/downloads"
  21977. },
  21978. listForOrg: {
  21979. method: "GET",
  21980. params: {
  21981. direction: {
  21982. enum: ["asc", "desc"],
  21983. type: "string"
  21984. },
  21985. org: {
  21986. required: true,
  21987. type: "string"
  21988. },
  21989. page: {
  21990. type: "integer"
  21991. },
  21992. per_page: {
  21993. type: "integer"
  21994. },
  21995. sort: {
  21996. enum: ["created", "updated", "pushed", "full_name"],
  21997. type: "string"
  21998. },
  21999. type: {
  22000. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22001. type: "string"
  22002. }
  22003. },
  22004. url: "/orgs/:org/repos"
  22005. },
  22006. listForUser: {
  22007. method: "GET",
  22008. params: {
  22009. direction: {
  22010. enum: ["asc", "desc"],
  22011. type: "string"
  22012. },
  22013. page: {
  22014. type: "integer"
  22015. },
  22016. per_page: {
  22017. type: "integer"
  22018. },
  22019. sort: {
  22020. enum: ["created", "updated", "pushed", "full_name"],
  22021. type: "string"
  22022. },
  22023. type: {
  22024. enum: ["all", "owner", "member"],
  22025. type: "string"
  22026. },
  22027. username: {
  22028. required: true,
  22029. type: "string"
  22030. }
  22031. },
  22032. url: "/users/:username/repos"
  22033. },
  22034. listForks: {
  22035. method: "GET",
  22036. params: {
  22037. owner: {
  22038. required: true,
  22039. type: "string"
  22040. },
  22041. page: {
  22042. type: "integer"
  22043. },
  22044. per_page: {
  22045. type: "integer"
  22046. },
  22047. repo: {
  22048. required: true,
  22049. type: "string"
  22050. },
  22051. sort: {
  22052. enum: ["newest", "oldest", "stargazers"],
  22053. type: "string"
  22054. }
  22055. },
  22056. url: "/repos/:owner/:repo/forks"
  22057. },
  22058. listHooks: {
  22059. method: "GET",
  22060. params: {
  22061. owner: {
  22062. required: true,
  22063. type: "string"
  22064. },
  22065. page: {
  22066. type: "integer"
  22067. },
  22068. per_page: {
  22069. type: "integer"
  22070. },
  22071. repo: {
  22072. required: true,
  22073. type: "string"
  22074. }
  22075. },
  22076. url: "/repos/:owner/:repo/hooks"
  22077. },
  22078. listInvitations: {
  22079. method: "GET",
  22080. params: {
  22081. owner: {
  22082. required: true,
  22083. type: "string"
  22084. },
  22085. page: {
  22086. type: "integer"
  22087. },
  22088. per_page: {
  22089. type: "integer"
  22090. },
  22091. repo: {
  22092. required: true,
  22093. type: "string"
  22094. }
  22095. },
  22096. url: "/repos/:owner/:repo/invitations"
  22097. },
  22098. listInvitationsForAuthenticatedUser: {
  22099. method: "GET",
  22100. params: {
  22101. page: {
  22102. type: "integer"
  22103. },
  22104. per_page: {
  22105. type: "integer"
  22106. }
  22107. },
  22108. url: "/user/repository_invitations"
  22109. },
  22110. listLanguages: {
  22111. method: "GET",
  22112. params: {
  22113. owner: {
  22114. required: true,
  22115. type: "string"
  22116. },
  22117. repo: {
  22118. required: true,
  22119. type: "string"
  22120. }
  22121. },
  22122. url: "/repos/:owner/:repo/languages"
  22123. },
  22124. listPagesBuilds: {
  22125. method: "GET",
  22126. params: {
  22127. owner: {
  22128. required: true,
  22129. type: "string"
  22130. },
  22131. page: {
  22132. type: "integer"
  22133. },
  22134. per_page: {
  22135. type: "integer"
  22136. },
  22137. repo: {
  22138. required: true,
  22139. type: "string"
  22140. }
  22141. },
  22142. url: "/repos/:owner/:repo/pages/builds"
  22143. },
  22144. listProtectedBranchRequiredStatusChecksContexts: {
  22145. method: "GET",
  22146. params: {
  22147. branch: {
  22148. required: true,
  22149. type: "string"
  22150. },
  22151. owner: {
  22152. required: true,
  22153. type: "string"
  22154. },
  22155. repo: {
  22156. required: true,
  22157. type: "string"
  22158. }
  22159. },
  22160. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22161. },
  22162. listProtectedBranchTeamRestrictions: {
  22163. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22164. method: "GET",
  22165. params: {
  22166. branch: {
  22167. required: true,
  22168. type: "string"
  22169. },
  22170. owner: {
  22171. required: true,
  22172. type: "string"
  22173. },
  22174. repo: {
  22175. required: true,
  22176. type: "string"
  22177. }
  22178. },
  22179. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22180. },
  22181. listProtectedBranchUserRestrictions: {
  22182. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22183. method: "GET",
  22184. params: {
  22185. branch: {
  22186. required: true,
  22187. type: "string"
  22188. },
  22189. owner: {
  22190. required: true,
  22191. type: "string"
  22192. },
  22193. repo: {
  22194. required: true,
  22195. type: "string"
  22196. }
  22197. },
  22198. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22199. },
  22200. listPublic: {
  22201. method: "GET",
  22202. params: {
  22203. page: {
  22204. type: "integer"
  22205. },
  22206. per_page: {
  22207. type: "integer"
  22208. },
  22209. since: {
  22210. type: "integer"
  22211. }
  22212. },
  22213. url: "/repositories"
  22214. },
  22215. listPullRequestsAssociatedWithCommit: {
  22216. headers: {
  22217. accept: "application/vnd.github.groot-preview+json"
  22218. },
  22219. method: "GET",
  22220. params: {
  22221. commit_sha: {
  22222. required: true,
  22223. type: "string"
  22224. },
  22225. owner: {
  22226. required: true,
  22227. type: "string"
  22228. },
  22229. page: {
  22230. type: "integer"
  22231. },
  22232. per_page: {
  22233. type: "integer"
  22234. },
  22235. repo: {
  22236. required: true,
  22237. type: "string"
  22238. }
  22239. },
  22240. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22241. },
  22242. listReleases: {
  22243. method: "GET",
  22244. params: {
  22245. owner: {
  22246. required: true,
  22247. type: "string"
  22248. },
  22249. page: {
  22250. type: "integer"
  22251. },
  22252. per_page: {
  22253. type: "integer"
  22254. },
  22255. repo: {
  22256. required: true,
  22257. type: "string"
  22258. }
  22259. },
  22260. url: "/repos/:owner/:repo/releases"
  22261. },
  22262. listStatusesForRef: {
  22263. method: "GET",
  22264. params: {
  22265. owner: {
  22266. required: true,
  22267. type: "string"
  22268. },
  22269. page: {
  22270. type: "integer"
  22271. },
  22272. per_page: {
  22273. type: "integer"
  22274. },
  22275. ref: {
  22276. required: true,
  22277. type: "string"
  22278. },
  22279. repo: {
  22280. required: true,
  22281. type: "string"
  22282. }
  22283. },
  22284. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22285. },
  22286. listTags: {
  22287. method: "GET",
  22288. params: {
  22289. owner: {
  22290. required: true,
  22291. type: "string"
  22292. },
  22293. page: {
  22294. type: "integer"
  22295. },
  22296. per_page: {
  22297. type: "integer"
  22298. },
  22299. repo: {
  22300. required: true,
  22301. type: "string"
  22302. }
  22303. },
  22304. url: "/repos/:owner/:repo/tags"
  22305. },
  22306. listTeams: {
  22307. method: "GET",
  22308. params: {
  22309. owner: {
  22310. required: true,
  22311. type: "string"
  22312. },
  22313. page: {
  22314. type: "integer"
  22315. },
  22316. per_page: {
  22317. type: "integer"
  22318. },
  22319. repo: {
  22320. required: true,
  22321. type: "string"
  22322. }
  22323. },
  22324. url: "/repos/:owner/:repo/teams"
  22325. },
  22326. listTeamsWithAccessToProtectedBranch: {
  22327. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22328. method: "GET",
  22329. params: {
  22330. branch: {
  22331. required: true,
  22332. type: "string"
  22333. },
  22334. owner: {
  22335. required: true,
  22336. type: "string"
  22337. },
  22338. repo: {
  22339. required: true,
  22340. type: "string"
  22341. }
  22342. },
  22343. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22344. },
  22345. listTopics: {
  22346. headers: {
  22347. accept: "application/vnd.github.mercy-preview+json"
  22348. },
  22349. method: "GET",
  22350. params: {
  22351. owner: {
  22352. required: true,
  22353. type: "string"
  22354. },
  22355. repo: {
  22356. required: true,
  22357. type: "string"
  22358. }
  22359. },
  22360. url: "/repos/:owner/:repo/topics"
  22361. },
  22362. listUsersWithAccessToProtectedBranch: {
  22363. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22364. method: "GET",
  22365. params: {
  22366. branch: {
  22367. required: true,
  22368. type: "string"
  22369. },
  22370. owner: {
  22371. required: true,
  22372. type: "string"
  22373. },
  22374. repo: {
  22375. required: true,
  22376. type: "string"
  22377. }
  22378. },
  22379. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22380. },
  22381. merge: {
  22382. method: "POST",
  22383. params: {
  22384. base: {
  22385. required: true,
  22386. type: "string"
  22387. },
  22388. commit_message: {
  22389. type: "string"
  22390. },
  22391. head: {
  22392. required: true,
  22393. type: "string"
  22394. },
  22395. owner: {
  22396. required: true,
  22397. type: "string"
  22398. },
  22399. repo: {
  22400. required: true,
  22401. type: "string"
  22402. }
  22403. },
  22404. url: "/repos/:owner/:repo/merges"
  22405. },
  22406. pingHook: {
  22407. method: "POST",
  22408. params: {
  22409. hook_id: {
  22410. required: true,
  22411. type: "integer"
  22412. },
  22413. owner: {
  22414. required: true,
  22415. type: "string"
  22416. },
  22417. repo: {
  22418. required: true,
  22419. type: "string"
  22420. }
  22421. },
  22422. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22423. },
  22424. removeBranchProtection: {
  22425. method: "DELETE",
  22426. params: {
  22427. branch: {
  22428. required: true,
  22429. type: "string"
  22430. },
  22431. owner: {
  22432. required: true,
  22433. type: "string"
  22434. },
  22435. repo: {
  22436. required: true,
  22437. type: "string"
  22438. }
  22439. },
  22440. url: "/repos/:owner/:repo/branches/:branch/protection"
  22441. },
  22442. removeCollaborator: {
  22443. method: "DELETE",
  22444. params: {
  22445. owner: {
  22446. required: true,
  22447. type: "string"
  22448. },
  22449. repo: {
  22450. required: true,
  22451. type: "string"
  22452. },
  22453. username: {
  22454. required: true,
  22455. type: "string"
  22456. }
  22457. },
  22458. url: "/repos/:owner/:repo/collaborators/:username"
  22459. },
  22460. removeDeployKey: {
  22461. method: "DELETE",
  22462. params: {
  22463. key_id: {
  22464. required: true,
  22465. type: "integer"
  22466. },
  22467. owner: {
  22468. required: true,
  22469. type: "string"
  22470. },
  22471. repo: {
  22472. required: true,
  22473. type: "string"
  22474. }
  22475. },
  22476. url: "/repos/:owner/:repo/keys/:key_id"
  22477. },
  22478. removeProtectedBranchAdminEnforcement: {
  22479. method: "DELETE",
  22480. params: {
  22481. branch: {
  22482. required: true,
  22483. type: "string"
  22484. },
  22485. owner: {
  22486. required: true,
  22487. type: "string"
  22488. },
  22489. repo: {
  22490. required: true,
  22491. type: "string"
  22492. }
  22493. },
  22494. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22495. },
  22496. removeProtectedBranchAppRestrictions: {
  22497. method: "DELETE",
  22498. params: {
  22499. apps: {
  22500. mapTo: "data",
  22501. required: true,
  22502. type: "string[]"
  22503. },
  22504. branch: {
  22505. required: true,
  22506. type: "string"
  22507. },
  22508. owner: {
  22509. required: true,
  22510. type: "string"
  22511. },
  22512. repo: {
  22513. required: true,
  22514. type: "string"
  22515. }
  22516. },
  22517. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22518. },
  22519. removeProtectedBranchPullRequestReviewEnforcement: {
  22520. method: "DELETE",
  22521. params: {
  22522. branch: {
  22523. required: true,
  22524. type: "string"
  22525. },
  22526. owner: {
  22527. required: true,
  22528. type: "string"
  22529. },
  22530. repo: {
  22531. required: true,
  22532. type: "string"
  22533. }
  22534. },
  22535. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22536. },
  22537. removeProtectedBranchRequiredSignatures: {
  22538. headers: {
  22539. accept: "application/vnd.github.zzzax-preview+json"
  22540. },
  22541. method: "DELETE",
  22542. params: {
  22543. branch: {
  22544. required: true,
  22545. type: "string"
  22546. },
  22547. owner: {
  22548. required: true,
  22549. type: "string"
  22550. },
  22551. repo: {
  22552. required: true,
  22553. type: "string"
  22554. }
  22555. },
  22556. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22557. },
  22558. removeProtectedBranchRequiredStatusChecks: {
  22559. method: "DELETE",
  22560. params: {
  22561. branch: {
  22562. required: true,
  22563. type: "string"
  22564. },
  22565. owner: {
  22566. required: true,
  22567. type: "string"
  22568. },
  22569. repo: {
  22570. required: true,
  22571. type: "string"
  22572. }
  22573. },
  22574. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22575. },
  22576. removeProtectedBranchRequiredStatusChecksContexts: {
  22577. method: "DELETE",
  22578. params: {
  22579. branch: {
  22580. required: true,
  22581. type: "string"
  22582. },
  22583. contexts: {
  22584. mapTo: "data",
  22585. required: true,
  22586. type: "string[]"
  22587. },
  22588. owner: {
  22589. required: true,
  22590. type: "string"
  22591. },
  22592. repo: {
  22593. required: true,
  22594. type: "string"
  22595. }
  22596. },
  22597. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22598. },
  22599. removeProtectedBranchRestrictions: {
  22600. method: "DELETE",
  22601. params: {
  22602. branch: {
  22603. required: true,
  22604. type: "string"
  22605. },
  22606. owner: {
  22607. required: true,
  22608. type: "string"
  22609. },
  22610. repo: {
  22611. required: true,
  22612. type: "string"
  22613. }
  22614. },
  22615. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22616. },
  22617. removeProtectedBranchTeamRestrictions: {
  22618. method: "DELETE",
  22619. params: {
  22620. branch: {
  22621. required: true,
  22622. type: "string"
  22623. },
  22624. owner: {
  22625. required: true,
  22626. type: "string"
  22627. },
  22628. repo: {
  22629. required: true,
  22630. type: "string"
  22631. },
  22632. teams: {
  22633. mapTo: "data",
  22634. required: true,
  22635. type: "string[]"
  22636. }
  22637. },
  22638. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22639. },
  22640. removeProtectedBranchUserRestrictions: {
  22641. method: "DELETE",
  22642. params: {
  22643. branch: {
  22644. required: true,
  22645. type: "string"
  22646. },
  22647. owner: {
  22648. required: true,
  22649. type: "string"
  22650. },
  22651. repo: {
  22652. required: true,
  22653. type: "string"
  22654. },
  22655. users: {
  22656. mapTo: "data",
  22657. required: true,
  22658. type: "string[]"
  22659. }
  22660. },
  22661. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22662. },
  22663. replaceProtectedBranchAppRestrictions: {
  22664. method: "PUT",
  22665. params: {
  22666. apps: {
  22667. mapTo: "data",
  22668. required: true,
  22669. type: "string[]"
  22670. },
  22671. branch: {
  22672. required: true,
  22673. type: "string"
  22674. },
  22675. owner: {
  22676. required: true,
  22677. type: "string"
  22678. },
  22679. repo: {
  22680. required: true,
  22681. type: "string"
  22682. }
  22683. },
  22684. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22685. },
  22686. replaceProtectedBranchRequiredStatusChecksContexts: {
  22687. method: "PUT",
  22688. params: {
  22689. branch: {
  22690. required: true,
  22691. type: "string"
  22692. },
  22693. contexts: {
  22694. mapTo: "data",
  22695. required: true,
  22696. type: "string[]"
  22697. },
  22698. owner: {
  22699. required: true,
  22700. type: "string"
  22701. },
  22702. repo: {
  22703. required: true,
  22704. type: "string"
  22705. }
  22706. },
  22707. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22708. },
  22709. replaceProtectedBranchTeamRestrictions: {
  22710. method: "PUT",
  22711. params: {
  22712. branch: {
  22713. required: true,
  22714. type: "string"
  22715. },
  22716. owner: {
  22717. required: true,
  22718. type: "string"
  22719. },
  22720. repo: {
  22721. required: true,
  22722. type: "string"
  22723. },
  22724. teams: {
  22725. mapTo: "data",
  22726. required: true,
  22727. type: "string[]"
  22728. }
  22729. },
  22730. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22731. },
  22732. replaceProtectedBranchUserRestrictions: {
  22733. method: "PUT",
  22734. params: {
  22735. branch: {
  22736. required: true,
  22737. type: "string"
  22738. },
  22739. owner: {
  22740. required: true,
  22741. type: "string"
  22742. },
  22743. repo: {
  22744. required: true,
  22745. type: "string"
  22746. },
  22747. users: {
  22748. mapTo: "data",
  22749. required: true,
  22750. type: "string[]"
  22751. }
  22752. },
  22753. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22754. },
  22755. replaceTopics: {
  22756. headers: {
  22757. accept: "application/vnd.github.mercy-preview+json"
  22758. },
  22759. method: "PUT",
  22760. params: {
  22761. names: {
  22762. required: true,
  22763. type: "string[]"
  22764. },
  22765. owner: {
  22766. required: true,
  22767. type: "string"
  22768. },
  22769. repo: {
  22770. required: true,
  22771. type: "string"
  22772. }
  22773. },
  22774. url: "/repos/:owner/:repo/topics"
  22775. },
  22776. requestPageBuild: {
  22777. method: "POST",
  22778. params: {
  22779. owner: {
  22780. required: true,
  22781. type: "string"
  22782. },
  22783. repo: {
  22784. required: true,
  22785. type: "string"
  22786. }
  22787. },
  22788. url: "/repos/:owner/:repo/pages/builds"
  22789. },
  22790. retrieveCommunityProfileMetrics: {
  22791. method: "GET",
  22792. params: {
  22793. owner: {
  22794. required: true,
  22795. type: "string"
  22796. },
  22797. repo: {
  22798. required: true,
  22799. type: "string"
  22800. }
  22801. },
  22802. url: "/repos/:owner/:repo/community/profile"
  22803. },
  22804. testPushHook: {
  22805. method: "POST",
  22806. params: {
  22807. hook_id: {
  22808. required: true,
  22809. type: "integer"
  22810. },
  22811. owner: {
  22812. required: true,
  22813. type: "string"
  22814. },
  22815. repo: {
  22816. required: true,
  22817. type: "string"
  22818. }
  22819. },
  22820. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22821. },
  22822. transfer: {
  22823. method: "POST",
  22824. params: {
  22825. new_owner: {
  22826. type: "string"
  22827. },
  22828. owner: {
  22829. required: true,
  22830. type: "string"
  22831. },
  22832. repo: {
  22833. required: true,
  22834. type: "string"
  22835. },
  22836. team_ids: {
  22837. type: "integer[]"
  22838. }
  22839. },
  22840. url: "/repos/:owner/:repo/transfer"
  22841. },
  22842. update: {
  22843. method: "PATCH",
  22844. params: {
  22845. allow_merge_commit: {
  22846. type: "boolean"
  22847. },
  22848. allow_rebase_merge: {
  22849. type: "boolean"
  22850. },
  22851. allow_squash_merge: {
  22852. type: "boolean"
  22853. },
  22854. archived: {
  22855. type: "boolean"
  22856. },
  22857. default_branch: {
  22858. type: "string"
  22859. },
  22860. delete_branch_on_merge: {
  22861. type: "boolean"
  22862. },
  22863. description: {
  22864. type: "string"
  22865. },
  22866. has_issues: {
  22867. type: "boolean"
  22868. },
  22869. has_projects: {
  22870. type: "boolean"
  22871. },
  22872. has_wiki: {
  22873. type: "boolean"
  22874. },
  22875. homepage: {
  22876. type: "string"
  22877. },
  22878. is_template: {
  22879. type: "boolean"
  22880. },
  22881. name: {
  22882. type: "string"
  22883. },
  22884. owner: {
  22885. required: true,
  22886. type: "string"
  22887. },
  22888. private: {
  22889. type: "boolean"
  22890. },
  22891. repo: {
  22892. required: true,
  22893. type: "string"
  22894. },
  22895. visibility: {
  22896. enum: ["public", "private", "visibility", "internal"],
  22897. type: "string"
  22898. }
  22899. },
  22900. url: "/repos/:owner/:repo"
  22901. },
  22902. updateBranchProtection: {
  22903. method: "PUT",
  22904. params: {
  22905. allow_deletions: {
  22906. type: "boolean"
  22907. },
  22908. allow_force_pushes: {
  22909. allowNull: true,
  22910. type: "boolean"
  22911. },
  22912. branch: {
  22913. required: true,
  22914. type: "string"
  22915. },
  22916. enforce_admins: {
  22917. allowNull: true,
  22918. required: true,
  22919. type: "boolean"
  22920. },
  22921. owner: {
  22922. required: true,
  22923. type: "string"
  22924. },
  22925. repo: {
  22926. required: true,
  22927. type: "string"
  22928. },
  22929. required_linear_history: {
  22930. type: "boolean"
  22931. },
  22932. required_pull_request_reviews: {
  22933. allowNull: true,
  22934. required: true,
  22935. type: "object"
  22936. },
  22937. "required_pull_request_reviews.dismiss_stale_reviews": {
  22938. type: "boolean"
  22939. },
  22940. "required_pull_request_reviews.dismissal_restrictions": {
  22941. type: "object"
  22942. },
  22943. "required_pull_request_reviews.dismissal_restrictions.teams": {
  22944. type: "string[]"
  22945. },
  22946. "required_pull_request_reviews.dismissal_restrictions.users": {
  22947. type: "string[]"
  22948. },
  22949. "required_pull_request_reviews.require_code_owner_reviews": {
  22950. type: "boolean"
  22951. },
  22952. "required_pull_request_reviews.required_approving_review_count": {
  22953. type: "integer"
  22954. },
  22955. required_status_checks: {
  22956. allowNull: true,
  22957. required: true,
  22958. type: "object"
  22959. },
  22960. "required_status_checks.contexts": {
  22961. required: true,
  22962. type: "string[]"
  22963. },
  22964. "required_status_checks.strict": {
  22965. required: true,
  22966. type: "boolean"
  22967. },
  22968. restrictions: {
  22969. allowNull: true,
  22970. required: true,
  22971. type: "object"
  22972. },
  22973. "restrictions.apps": {
  22974. type: "string[]"
  22975. },
  22976. "restrictions.teams": {
  22977. required: true,
  22978. type: "string[]"
  22979. },
  22980. "restrictions.users": {
  22981. required: true,
  22982. type: "string[]"
  22983. }
  22984. },
  22985. url: "/repos/:owner/:repo/branches/:branch/protection"
  22986. },
  22987. updateCommitComment: {
  22988. method: "PATCH",
  22989. params: {
  22990. body: {
  22991. required: true,
  22992. type: "string"
  22993. },
  22994. comment_id: {
  22995. required: true,
  22996. type: "integer"
  22997. },
  22998. owner: {
  22999. required: true,
  23000. type: "string"
  23001. },
  23002. repo: {
  23003. required: true,
  23004. type: "string"
  23005. }
  23006. },
  23007. url: "/repos/:owner/:repo/comments/:comment_id"
  23008. },
  23009. updateFile: {
  23010. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23011. method: "PUT",
  23012. params: {
  23013. author: {
  23014. type: "object"
  23015. },
  23016. "author.email": {
  23017. required: true,
  23018. type: "string"
  23019. },
  23020. "author.name": {
  23021. required: true,
  23022. type: "string"
  23023. },
  23024. branch: {
  23025. type: "string"
  23026. },
  23027. committer: {
  23028. type: "object"
  23029. },
  23030. "committer.email": {
  23031. required: true,
  23032. type: "string"
  23033. },
  23034. "committer.name": {
  23035. required: true,
  23036. type: "string"
  23037. },
  23038. content: {
  23039. required: true,
  23040. type: "string"
  23041. },
  23042. message: {
  23043. required: true,
  23044. type: "string"
  23045. },
  23046. owner: {
  23047. required: true,
  23048. type: "string"
  23049. },
  23050. path: {
  23051. required: true,
  23052. type: "string"
  23053. },
  23054. repo: {
  23055. required: true,
  23056. type: "string"
  23057. },
  23058. sha: {
  23059. type: "string"
  23060. }
  23061. },
  23062. url: "/repos/:owner/:repo/contents/:path"
  23063. },
  23064. updateHook: {
  23065. method: "PATCH",
  23066. params: {
  23067. active: {
  23068. type: "boolean"
  23069. },
  23070. add_events: {
  23071. type: "string[]"
  23072. },
  23073. config: {
  23074. type: "object"
  23075. },
  23076. "config.content_type": {
  23077. type: "string"
  23078. },
  23079. "config.insecure_ssl": {
  23080. type: "string"
  23081. },
  23082. "config.secret": {
  23083. type: "string"
  23084. },
  23085. "config.url": {
  23086. required: true,
  23087. type: "string"
  23088. },
  23089. events: {
  23090. type: "string[]"
  23091. },
  23092. hook_id: {
  23093. required: true,
  23094. type: "integer"
  23095. },
  23096. owner: {
  23097. required: true,
  23098. type: "string"
  23099. },
  23100. remove_events: {
  23101. type: "string[]"
  23102. },
  23103. repo: {
  23104. required: true,
  23105. type: "string"
  23106. }
  23107. },
  23108. url: "/repos/:owner/:repo/hooks/:hook_id"
  23109. },
  23110. updateInformationAboutPagesSite: {
  23111. method: "PUT",
  23112. params: {
  23113. cname: {
  23114. type: "string"
  23115. },
  23116. owner: {
  23117. required: true,
  23118. type: "string"
  23119. },
  23120. repo: {
  23121. required: true,
  23122. type: "string"
  23123. },
  23124. source: {
  23125. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23126. type: "string"
  23127. }
  23128. },
  23129. url: "/repos/:owner/:repo/pages"
  23130. },
  23131. updateInvitation: {
  23132. method: "PATCH",
  23133. params: {
  23134. invitation_id: {
  23135. required: true,
  23136. type: "integer"
  23137. },
  23138. owner: {
  23139. required: true,
  23140. type: "string"
  23141. },
  23142. permissions: {
  23143. enum: ["read", "write", "admin"],
  23144. type: "string"
  23145. },
  23146. repo: {
  23147. required: true,
  23148. type: "string"
  23149. }
  23150. },
  23151. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23152. },
  23153. updateProtectedBranchPullRequestReviewEnforcement: {
  23154. method: "PATCH",
  23155. params: {
  23156. branch: {
  23157. required: true,
  23158. type: "string"
  23159. },
  23160. dismiss_stale_reviews: {
  23161. type: "boolean"
  23162. },
  23163. dismissal_restrictions: {
  23164. type: "object"
  23165. },
  23166. "dismissal_restrictions.teams": {
  23167. type: "string[]"
  23168. },
  23169. "dismissal_restrictions.users": {
  23170. type: "string[]"
  23171. },
  23172. owner: {
  23173. required: true,
  23174. type: "string"
  23175. },
  23176. repo: {
  23177. required: true,
  23178. type: "string"
  23179. },
  23180. require_code_owner_reviews: {
  23181. type: "boolean"
  23182. },
  23183. required_approving_review_count: {
  23184. type: "integer"
  23185. }
  23186. },
  23187. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23188. },
  23189. updateProtectedBranchRequiredStatusChecks: {
  23190. method: "PATCH",
  23191. params: {
  23192. branch: {
  23193. required: true,
  23194. type: "string"
  23195. },
  23196. contexts: {
  23197. type: "string[]"
  23198. },
  23199. owner: {
  23200. required: true,
  23201. type: "string"
  23202. },
  23203. repo: {
  23204. required: true,
  23205. type: "string"
  23206. },
  23207. strict: {
  23208. type: "boolean"
  23209. }
  23210. },
  23211. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23212. },
  23213. updateRelease: {
  23214. method: "PATCH",
  23215. params: {
  23216. body: {
  23217. type: "string"
  23218. },
  23219. draft: {
  23220. type: "boolean"
  23221. },
  23222. name: {
  23223. type: "string"
  23224. },
  23225. owner: {
  23226. required: true,
  23227. type: "string"
  23228. },
  23229. prerelease: {
  23230. type: "boolean"
  23231. },
  23232. release_id: {
  23233. required: true,
  23234. type: "integer"
  23235. },
  23236. repo: {
  23237. required: true,
  23238. type: "string"
  23239. },
  23240. tag_name: {
  23241. type: "string"
  23242. },
  23243. target_commitish: {
  23244. type: "string"
  23245. }
  23246. },
  23247. url: "/repos/:owner/:repo/releases/:release_id"
  23248. },
  23249. updateReleaseAsset: {
  23250. method: "PATCH",
  23251. params: {
  23252. asset_id: {
  23253. required: true,
  23254. type: "integer"
  23255. },
  23256. label: {
  23257. type: "string"
  23258. },
  23259. name: {
  23260. type: "string"
  23261. },
  23262. owner: {
  23263. required: true,
  23264. type: "string"
  23265. },
  23266. repo: {
  23267. required: true,
  23268. type: "string"
  23269. }
  23270. },
  23271. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23272. },
  23273. uploadReleaseAsset: {
  23274. method: "POST",
  23275. params: {
  23276. data: {
  23277. mapTo: "data",
  23278. required: true,
  23279. type: "string | object"
  23280. },
  23281. file: {
  23282. alias: "data",
  23283. deprecated: true,
  23284. type: "string | object"
  23285. },
  23286. headers: {
  23287. required: true,
  23288. type: "object"
  23289. },
  23290. "headers.content-length": {
  23291. required: true,
  23292. type: "integer"
  23293. },
  23294. "headers.content-type": {
  23295. required: true,
  23296. type: "string"
  23297. },
  23298. label: {
  23299. type: "string"
  23300. },
  23301. name: {
  23302. required: true,
  23303. type: "string"
  23304. },
  23305. url: {
  23306. required: true,
  23307. type: "string"
  23308. }
  23309. },
  23310. url: ":url"
  23311. }
  23312. },
  23313. search: {
  23314. code: {
  23315. method: "GET",
  23316. params: {
  23317. order: {
  23318. enum: ["desc", "asc"],
  23319. type: "string"
  23320. },
  23321. page: {
  23322. type: "integer"
  23323. },
  23324. per_page: {
  23325. type: "integer"
  23326. },
  23327. q: {
  23328. required: true,
  23329. type: "string"
  23330. },
  23331. sort: {
  23332. enum: ["indexed"],
  23333. type: "string"
  23334. }
  23335. },
  23336. url: "/search/code"
  23337. },
  23338. commits: {
  23339. headers: {
  23340. accept: "application/vnd.github.cloak-preview+json"
  23341. },
  23342. method: "GET",
  23343. params: {
  23344. order: {
  23345. enum: ["desc", "asc"],
  23346. type: "string"
  23347. },
  23348. page: {
  23349. type: "integer"
  23350. },
  23351. per_page: {
  23352. type: "integer"
  23353. },
  23354. q: {
  23355. required: true,
  23356. type: "string"
  23357. },
  23358. sort: {
  23359. enum: ["author-date", "committer-date"],
  23360. type: "string"
  23361. }
  23362. },
  23363. url: "/search/commits"
  23364. },
  23365. issues: {
  23366. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23367. method: "GET",
  23368. params: {
  23369. order: {
  23370. enum: ["desc", "asc"],
  23371. type: "string"
  23372. },
  23373. page: {
  23374. type: "integer"
  23375. },
  23376. per_page: {
  23377. type: "integer"
  23378. },
  23379. q: {
  23380. required: true,
  23381. type: "string"
  23382. },
  23383. sort: {
  23384. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23385. type: "string"
  23386. }
  23387. },
  23388. url: "/search/issues"
  23389. },
  23390. issuesAndPullRequests: {
  23391. method: "GET",
  23392. params: {
  23393. order: {
  23394. enum: ["desc", "asc"],
  23395. type: "string"
  23396. },
  23397. page: {
  23398. type: "integer"
  23399. },
  23400. per_page: {
  23401. type: "integer"
  23402. },
  23403. q: {
  23404. required: true,
  23405. type: "string"
  23406. },
  23407. sort: {
  23408. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23409. type: "string"
  23410. }
  23411. },
  23412. url: "/search/issues"
  23413. },
  23414. labels: {
  23415. method: "GET",
  23416. params: {
  23417. order: {
  23418. enum: ["desc", "asc"],
  23419. type: "string"
  23420. },
  23421. q: {
  23422. required: true,
  23423. type: "string"
  23424. },
  23425. repository_id: {
  23426. required: true,
  23427. type: "integer"
  23428. },
  23429. sort: {
  23430. enum: ["created", "updated"],
  23431. type: "string"
  23432. }
  23433. },
  23434. url: "/search/labels"
  23435. },
  23436. repos: {
  23437. method: "GET",
  23438. params: {
  23439. order: {
  23440. enum: ["desc", "asc"],
  23441. type: "string"
  23442. },
  23443. page: {
  23444. type: "integer"
  23445. },
  23446. per_page: {
  23447. type: "integer"
  23448. },
  23449. q: {
  23450. required: true,
  23451. type: "string"
  23452. },
  23453. sort: {
  23454. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23455. type: "string"
  23456. }
  23457. },
  23458. url: "/search/repositories"
  23459. },
  23460. topics: {
  23461. method: "GET",
  23462. params: {
  23463. q: {
  23464. required: true,
  23465. type: "string"
  23466. }
  23467. },
  23468. url: "/search/topics"
  23469. },
  23470. users: {
  23471. method: "GET",
  23472. params: {
  23473. order: {
  23474. enum: ["desc", "asc"],
  23475. type: "string"
  23476. },
  23477. page: {
  23478. type: "integer"
  23479. },
  23480. per_page: {
  23481. type: "integer"
  23482. },
  23483. q: {
  23484. required: true,
  23485. type: "string"
  23486. },
  23487. sort: {
  23488. enum: ["followers", "repositories", "joined"],
  23489. type: "string"
  23490. }
  23491. },
  23492. url: "/search/users"
  23493. }
  23494. },
  23495. teams: {
  23496. addMember: {
  23497. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23498. method: "PUT",
  23499. params: {
  23500. team_id: {
  23501. required: true,
  23502. type: "integer"
  23503. },
  23504. username: {
  23505. required: true,
  23506. type: "string"
  23507. }
  23508. },
  23509. url: "/teams/:team_id/members/:username"
  23510. },
  23511. addMemberLegacy: {
  23512. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23513. method: "PUT",
  23514. params: {
  23515. team_id: {
  23516. required: true,
  23517. type: "integer"
  23518. },
  23519. username: {
  23520. required: true,
  23521. type: "string"
  23522. }
  23523. },
  23524. url: "/teams/:team_id/members/:username"
  23525. },
  23526. addOrUpdateMembership: {
  23527. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23528. method: "PUT",
  23529. params: {
  23530. role: {
  23531. enum: ["member", "maintainer"],
  23532. type: "string"
  23533. },
  23534. team_id: {
  23535. required: true,
  23536. type: "integer"
  23537. },
  23538. username: {
  23539. required: true,
  23540. type: "string"
  23541. }
  23542. },
  23543. url: "/teams/:team_id/memberships/:username"
  23544. },
  23545. addOrUpdateMembershipInOrg: {
  23546. method: "PUT",
  23547. params: {
  23548. org: {
  23549. required: true,
  23550. type: "string"
  23551. },
  23552. role: {
  23553. enum: ["member", "maintainer"],
  23554. type: "string"
  23555. },
  23556. team_slug: {
  23557. required: true,
  23558. type: "string"
  23559. },
  23560. username: {
  23561. required: true,
  23562. type: "string"
  23563. }
  23564. },
  23565. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23566. },
  23567. addOrUpdateMembershipLegacy: {
  23568. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23569. method: "PUT",
  23570. params: {
  23571. role: {
  23572. enum: ["member", "maintainer"],
  23573. type: "string"
  23574. },
  23575. team_id: {
  23576. required: true,
  23577. type: "integer"
  23578. },
  23579. username: {
  23580. required: true,
  23581. type: "string"
  23582. }
  23583. },
  23584. url: "/teams/:team_id/memberships/:username"
  23585. },
  23586. addOrUpdateProject: {
  23587. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23588. headers: {
  23589. accept: "application/vnd.github.inertia-preview+json"
  23590. },
  23591. method: "PUT",
  23592. params: {
  23593. permission: {
  23594. enum: ["read", "write", "admin"],
  23595. type: "string"
  23596. },
  23597. project_id: {
  23598. required: true,
  23599. type: "integer"
  23600. },
  23601. team_id: {
  23602. required: true,
  23603. type: "integer"
  23604. }
  23605. },
  23606. url: "/teams/:team_id/projects/:project_id"
  23607. },
  23608. addOrUpdateProjectInOrg: {
  23609. headers: {
  23610. accept: "application/vnd.github.inertia-preview+json"
  23611. },
  23612. method: "PUT",
  23613. params: {
  23614. org: {
  23615. required: true,
  23616. type: "string"
  23617. },
  23618. permission: {
  23619. enum: ["read", "write", "admin"],
  23620. type: "string"
  23621. },
  23622. project_id: {
  23623. required: true,
  23624. type: "integer"
  23625. },
  23626. team_slug: {
  23627. required: true,
  23628. type: "string"
  23629. }
  23630. },
  23631. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23632. },
  23633. addOrUpdateProjectLegacy: {
  23634. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23635. headers: {
  23636. accept: "application/vnd.github.inertia-preview+json"
  23637. },
  23638. method: "PUT",
  23639. params: {
  23640. permission: {
  23641. enum: ["read", "write", "admin"],
  23642. type: "string"
  23643. },
  23644. project_id: {
  23645. required: true,
  23646. type: "integer"
  23647. },
  23648. team_id: {
  23649. required: true,
  23650. type: "integer"
  23651. }
  23652. },
  23653. url: "/teams/:team_id/projects/:project_id"
  23654. },
  23655. addOrUpdateRepo: {
  23656. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23657. method: "PUT",
  23658. params: {
  23659. owner: {
  23660. required: true,
  23661. type: "string"
  23662. },
  23663. permission: {
  23664. enum: ["pull", "push", "admin"],
  23665. type: "string"
  23666. },
  23667. repo: {
  23668. required: true,
  23669. type: "string"
  23670. },
  23671. team_id: {
  23672. required: true,
  23673. type: "integer"
  23674. }
  23675. },
  23676. url: "/teams/:team_id/repos/:owner/:repo"
  23677. },
  23678. addOrUpdateRepoInOrg: {
  23679. method: "PUT",
  23680. params: {
  23681. org: {
  23682. required: true,
  23683. type: "string"
  23684. },
  23685. owner: {
  23686. required: true,
  23687. type: "string"
  23688. },
  23689. permission: {
  23690. enum: ["pull", "push", "admin"],
  23691. type: "string"
  23692. },
  23693. repo: {
  23694. required: true,
  23695. type: "string"
  23696. },
  23697. team_slug: {
  23698. required: true,
  23699. type: "string"
  23700. }
  23701. },
  23702. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23703. },
  23704. addOrUpdateRepoLegacy: {
  23705. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23706. method: "PUT",
  23707. params: {
  23708. owner: {
  23709. required: true,
  23710. type: "string"
  23711. },
  23712. permission: {
  23713. enum: ["pull", "push", "admin"],
  23714. type: "string"
  23715. },
  23716. repo: {
  23717. required: true,
  23718. type: "string"
  23719. },
  23720. team_id: {
  23721. required: true,
  23722. type: "integer"
  23723. }
  23724. },
  23725. url: "/teams/:team_id/repos/:owner/:repo"
  23726. },
  23727. checkManagesRepo: {
  23728. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23729. method: "GET",
  23730. params: {
  23731. owner: {
  23732. required: true,
  23733. type: "string"
  23734. },
  23735. repo: {
  23736. required: true,
  23737. type: "string"
  23738. },
  23739. team_id: {
  23740. required: true,
  23741. type: "integer"
  23742. }
  23743. },
  23744. url: "/teams/:team_id/repos/:owner/:repo"
  23745. },
  23746. checkManagesRepoInOrg: {
  23747. method: "GET",
  23748. params: {
  23749. org: {
  23750. required: true,
  23751. type: "string"
  23752. },
  23753. owner: {
  23754. required: true,
  23755. type: "string"
  23756. },
  23757. repo: {
  23758. required: true,
  23759. type: "string"
  23760. },
  23761. team_slug: {
  23762. required: true,
  23763. type: "string"
  23764. }
  23765. },
  23766. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23767. },
  23768. checkManagesRepoLegacy: {
  23769. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23770. method: "GET",
  23771. params: {
  23772. owner: {
  23773. required: true,
  23774. type: "string"
  23775. },
  23776. repo: {
  23777. required: true,
  23778. type: "string"
  23779. },
  23780. team_id: {
  23781. required: true,
  23782. type: "integer"
  23783. }
  23784. },
  23785. url: "/teams/:team_id/repos/:owner/:repo"
  23786. },
  23787. create: {
  23788. method: "POST",
  23789. params: {
  23790. description: {
  23791. type: "string"
  23792. },
  23793. maintainers: {
  23794. type: "string[]"
  23795. },
  23796. name: {
  23797. required: true,
  23798. type: "string"
  23799. },
  23800. org: {
  23801. required: true,
  23802. type: "string"
  23803. },
  23804. parent_team_id: {
  23805. type: "integer"
  23806. },
  23807. permission: {
  23808. enum: ["pull", "push", "admin"],
  23809. type: "string"
  23810. },
  23811. privacy: {
  23812. enum: ["secret", "closed"],
  23813. type: "string"
  23814. },
  23815. repo_names: {
  23816. type: "string[]"
  23817. }
  23818. },
  23819. url: "/orgs/:org/teams"
  23820. },
  23821. createDiscussion: {
  23822. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  23823. method: "POST",
  23824. params: {
  23825. body: {
  23826. required: true,
  23827. type: "string"
  23828. },
  23829. private: {
  23830. type: "boolean"
  23831. },
  23832. team_id: {
  23833. required: true,
  23834. type: "integer"
  23835. },
  23836. title: {
  23837. required: true,
  23838. type: "string"
  23839. }
  23840. },
  23841. url: "/teams/:team_id/discussions"
  23842. },
  23843. createDiscussionComment: {
  23844. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  23845. method: "POST",
  23846. params: {
  23847. body: {
  23848. required: true,
  23849. type: "string"
  23850. },
  23851. discussion_number: {
  23852. required: true,
  23853. type: "integer"
  23854. },
  23855. team_id: {
  23856. required: true,
  23857. type: "integer"
  23858. }
  23859. },
  23860. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23861. },
  23862. createDiscussionCommentInOrg: {
  23863. method: "POST",
  23864. params: {
  23865. body: {
  23866. required: true,
  23867. type: "string"
  23868. },
  23869. discussion_number: {
  23870. required: true,
  23871. type: "integer"
  23872. },
  23873. org: {
  23874. required: true,
  23875. type: "string"
  23876. },
  23877. team_slug: {
  23878. required: true,
  23879. type: "string"
  23880. }
  23881. },
  23882. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  23883. },
  23884. createDiscussionCommentLegacy: {
  23885. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  23886. method: "POST",
  23887. params: {
  23888. body: {
  23889. required: true,
  23890. type: "string"
  23891. },
  23892. discussion_number: {
  23893. required: true,
  23894. type: "integer"
  23895. },
  23896. team_id: {
  23897. required: true,
  23898. type: "integer"
  23899. }
  23900. },
  23901. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23902. },
  23903. createDiscussionInOrg: {
  23904. method: "POST",
  23905. params: {
  23906. body: {
  23907. required: true,
  23908. type: "string"
  23909. },
  23910. org: {
  23911. required: true,
  23912. type: "string"
  23913. },
  23914. private: {
  23915. type: "boolean"
  23916. },
  23917. team_slug: {
  23918. required: true,
  23919. type: "string"
  23920. },
  23921. title: {
  23922. required: true,
  23923. type: "string"
  23924. }
  23925. },
  23926. url: "/orgs/:org/teams/:team_slug/discussions"
  23927. },
  23928. createDiscussionLegacy: {
  23929. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  23930. method: "POST",
  23931. params: {
  23932. body: {
  23933. required: true,
  23934. type: "string"
  23935. },
  23936. private: {
  23937. type: "boolean"
  23938. },
  23939. team_id: {
  23940. required: true,
  23941. type: "integer"
  23942. },
  23943. title: {
  23944. required: true,
  23945. type: "string"
  23946. }
  23947. },
  23948. url: "/teams/:team_id/discussions"
  23949. },
  23950. delete: {
  23951. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  23952. method: "DELETE",
  23953. params: {
  23954. team_id: {
  23955. required: true,
  23956. type: "integer"
  23957. }
  23958. },
  23959. url: "/teams/:team_id"
  23960. },
  23961. deleteDiscussion: {
  23962. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  23963. method: "DELETE",
  23964. params: {
  23965. discussion_number: {
  23966. required: true,
  23967. type: "integer"
  23968. },
  23969. team_id: {
  23970. required: true,
  23971. type: "integer"
  23972. }
  23973. },
  23974. url: "/teams/:team_id/discussions/:discussion_number"
  23975. },
  23976. deleteDiscussionComment: {
  23977. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  23978. method: "DELETE",
  23979. params: {
  23980. comment_number: {
  23981. required: true,
  23982. type: "integer"
  23983. },
  23984. discussion_number: {
  23985. required: true,
  23986. type: "integer"
  23987. },
  23988. team_id: {
  23989. required: true,
  23990. type: "integer"
  23991. }
  23992. },
  23993. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  23994. },
  23995. deleteDiscussionCommentInOrg: {
  23996. method: "DELETE",
  23997. params: {
  23998. comment_number: {
  23999. required: true,
  24000. type: "integer"
  24001. },
  24002. discussion_number: {
  24003. required: true,
  24004. type: "integer"
  24005. },
  24006. org: {
  24007. required: true,
  24008. type: "string"
  24009. },
  24010. team_slug: {
  24011. required: true,
  24012. type: "string"
  24013. }
  24014. },
  24015. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24016. },
  24017. deleteDiscussionCommentLegacy: {
  24018. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24019. method: "DELETE",
  24020. params: {
  24021. comment_number: {
  24022. required: true,
  24023. type: "integer"
  24024. },
  24025. discussion_number: {
  24026. required: true,
  24027. type: "integer"
  24028. },
  24029. team_id: {
  24030. required: true,
  24031. type: "integer"
  24032. }
  24033. },
  24034. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24035. },
  24036. deleteDiscussionInOrg: {
  24037. method: "DELETE",
  24038. params: {
  24039. discussion_number: {
  24040. required: true,
  24041. type: "integer"
  24042. },
  24043. org: {
  24044. required: true,
  24045. type: "string"
  24046. },
  24047. team_slug: {
  24048. required: true,
  24049. type: "string"
  24050. }
  24051. },
  24052. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24053. },
  24054. deleteDiscussionLegacy: {
  24055. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24056. method: "DELETE",
  24057. params: {
  24058. discussion_number: {
  24059. required: true,
  24060. type: "integer"
  24061. },
  24062. team_id: {
  24063. required: true,
  24064. type: "integer"
  24065. }
  24066. },
  24067. url: "/teams/:team_id/discussions/:discussion_number"
  24068. },
  24069. deleteInOrg: {
  24070. method: "DELETE",
  24071. params: {
  24072. org: {
  24073. required: true,
  24074. type: "string"
  24075. },
  24076. team_slug: {
  24077. required: true,
  24078. type: "string"
  24079. }
  24080. },
  24081. url: "/orgs/:org/teams/:team_slug"
  24082. },
  24083. deleteLegacy: {
  24084. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24085. method: "DELETE",
  24086. params: {
  24087. team_id: {
  24088. required: true,
  24089. type: "integer"
  24090. }
  24091. },
  24092. url: "/teams/:team_id"
  24093. },
  24094. get: {
  24095. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24096. method: "GET",
  24097. params: {
  24098. team_id: {
  24099. required: true,
  24100. type: "integer"
  24101. }
  24102. },
  24103. url: "/teams/:team_id"
  24104. },
  24105. getByName: {
  24106. method: "GET",
  24107. params: {
  24108. org: {
  24109. required: true,
  24110. type: "string"
  24111. },
  24112. team_slug: {
  24113. required: true,
  24114. type: "string"
  24115. }
  24116. },
  24117. url: "/orgs/:org/teams/:team_slug"
  24118. },
  24119. getDiscussion: {
  24120. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24121. method: "GET",
  24122. params: {
  24123. discussion_number: {
  24124. required: true,
  24125. type: "integer"
  24126. },
  24127. team_id: {
  24128. required: true,
  24129. type: "integer"
  24130. }
  24131. },
  24132. url: "/teams/:team_id/discussions/:discussion_number"
  24133. },
  24134. getDiscussionComment: {
  24135. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24136. method: "GET",
  24137. params: {
  24138. comment_number: {
  24139. required: true,
  24140. type: "integer"
  24141. },
  24142. discussion_number: {
  24143. required: true,
  24144. type: "integer"
  24145. },
  24146. team_id: {
  24147. required: true,
  24148. type: "integer"
  24149. }
  24150. },
  24151. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24152. },
  24153. getDiscussionCommentInOrg: {
  24154. method: "GET",
  24155. params: {
  24156. comment_number: {
  24157. required: true,
  24158. type: "integer"
  24159. },
  24160. discussion_number: {
  24161. required: true,
  24162. type: "integer"
  24163. },
  24164. org: {
  24165. required: true,
  24166. type: "string"
  24167. },
  24168. team_slug: {
  24169. required: true,
  24170. type: "string"
  24171. }
  24172. },
  24173. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24174. },
  24175. getDiscussionCommentLegacy: {
  24176. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24177. method: "GET",
  24178. params: {
  24179. comment_number: {
  24180. required: true,
  24181. type: "integer"
  24182. },
  24183. discussion_number: {
  24184. required: true,
  24185. type: "integer"
  24186. },
  24187. team_id: {
  24188. required: true,
  24189. type: "integer"
  24190. }
  24191. },
  24192. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24193. },
  24194. getDiscussionInOrg: {
  24195. method: "GET",
  24196. params: {
  24197. discussion_number: {
  24198. required: true,
  24199. type: "integer"
  24200. },
  24201. org: {
  24202. required: true,
  24203. type: "string"
  24204. },
  24205. team_slug: {
  24206. required: true,
  24207. type: "string"
  24208. }
  24209. },
  24210. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24211. },
  24212. getDiscussionLegacy: {
  24213. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24214. method: "GET",
  24215. params: {
  24216. discussion_number: {
  24217. required: true,
  24218. type: "integer"
  24219. },
  24220. team_id: {
  24221. required: true,
  24222. type: "integer"
  24223. }
  24224. },
  24225. url: "/teams/:team_id/discussions/:discussion_number"
  24226. },
  24227. getLegacy: {
  24228. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24229. method: "GET",
  24230. params: {
  24231. team_id: {
  24232. required: true,
  24233. type: "integer"
  24234. }
  24235. },
  24236. url: "/teams/:team_id"
  24237. },
  24238. getMember: {
  24239. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24240. method: "GET",
  24241. params: {
  24242. team_id: {
  24243. required: true,
  24244. type: "integer"
  24245. },
  24246. username: {
  24247. required: true,
  24248. type: "string"
  24249. }
  24250. },
  24251. url: "/teams/:team_id/members/:username"
  24252. },
  24253. getMemberLegacy: {
  24254. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24255. method: "GET",
  24256. params: {
  24257. team_id: {
  24258. required: true,
  24259. type: "integer"
  24260. },
  24261. username: {
  24262. required: true,
  24263. type: "string"
  24264. }
  24265. },
  24266. url: "/teams/:team_id/members/:username"
  24267. },
  24268. getMembership: {
  24269. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24270. method: "GET",
  24271. params: {
  24272. team_id: {
  24273. required: true,
  24274. type: "integer"
  24275. },
  24276. username: {
  24277. required: true,
  24278. type: "string"
  24279. }
  24280. },
  24281. url: "/teams/:team_id/memberships/:username"
  24282. },
  24283. getMembershipInOrg: {
  24284. method: "GET",
  24285. params: {
  24286. org: {
  24287. required: true,
  24288. type: "string"
  24289. },
  24290. team_slug: {
  24291. required: true,
  24292. type: "string"
  24293. },
  24294. username: {
  24295. required: true,
  24296. type: "string"
  24297. }
  24298. },
  24299. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24300. },
  24301. getMembershipLegacy: {
  24302. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24303. method: "GET",
  24304. params: {
  24305. team_id: {
  24306. required: true,
  24307. type: "integer"
  24308. },
  24309. username: {
  24310. required: true,
  24311. type: "string"
  24312. }
  24313. },
  24314. url: "/teams/:team_id/memberships/:username"
  24315. },
  24316. list: {
  24317. method: "GET",
  24318. params: {
  24319. org: {
  24320. required: true,
  24321. type: "string"
  24322. },
  24323. page: {
  24324. type: "integer"
  24325. },
  24326. per_page: {
  24327. type: "integer"
  24328. }
  24329. },
  24330. url: "/orgs/:org/teams"
  24331. },
  24332. listChild: {
  24333. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24334. method: "GET",
  24335. params: {
  24336. page: {
  24337. type: "integer"
  24338. },
  24339. per_page: {
  24340. type: "integer"
  24341. },
  24342. team_id: {
  24343. required: true,
  24344. type: "integer"
  24345. }
  24346. },
  24347. url: "/teams/:team_id/teams"
  24348. },
  24349. listChildInOrg: {
  24350. method: "GET",
  24351. params: {
  24352. org: {
  24353. required: true,
  24354. type: "string"
  24355. },
  24356. page: {
  24357. type: "integer"
  24358. },
  24359. per_page: {
  24360. type: "integer"
  24361. },
  24362. team_slug: {
  24363. required: true,
  24364. type: "string"
  24365. }
  24366. },
  24367. url: "/orgs/:org/teams/:team_slug/teams"
  24368. },
  24369. listChildLegacy: {
  24370. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24371. method: "GET",
  24372. params: {
  24373. page: {
  24374. type: "integer"
  24375. },
  24376. per_page: {
  24377. type: "integer"
  24378. },
  24379. team_id: {
  24380. required: true,
  24381. type: "integer"
  24382. }
  24383. },
  24384. url: "/teams/:team_id/teams"
  24385. },
  24386. listDiscussionComments: {
  24387. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24388. method: "GET",
  24389. params: {
  24390. direction: {
  24391. enum: ["asc", "desc"],
  24392. type: "string"
  24393. },
  24394. discussion_number: {
  24395. required: true,
  24396. type: "integer"
  24397. },
  24398. page: {
  24399. type: "integer"
  24400. },
  24401. per_page: {
  24402. type: "integer"
  24403. },
  24404. team_id: {
  24405. required: true,
  24406. type: "integer"
  24407. }
  24408. },
  24409. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24410. },
  24411. listDiscussionCommentsInOrg: {
  24412. method: "GET",
  24413. params: {
  24414. direction: {
  24415. enum: ["asc", "desc"],
  24416. type: "string"
  24417. },
  24418. discussion_number: {
  24419. required: true,
  24420. type: "integer"
  24421. },
  24422. org: {
  24423. required: true,
  24424. type: "string"
  24425. },
  24426. page: {
  24427. type: "integer"
  24428. },
  24429. per_page: {
  24430. type: "integer"
  24431. },
  24432. team_slug: {
  24433. required: true,
  24434. type: "string"
  24435. }
  24436. },
  24437. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24438. },
  24439. listDiscussionCommentsLegacy: {
  24440. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24441. method: "GET",
  24442. params: {
  24443. direction: {
  24444. enum: ["asc", "desc"],
  24445. type: "string"
  24446. },
  24447. discussion_number: {
  24448. required: true,
  24449. type: "integer"
  24450. },
  24451. page: {
  24452. type: "integer"
  24453. },
  24454. per_page: {
  24455. type: "integer"
  24456. },
  24457. team_id: {
  24458. required: true,
  24459. type: "integer"
  24460. }
  24461. },
  24462. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24463. },
  24464. listDiscussions: {
  24465. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24466. method: "GET",
  24467. params: {
  24468. direction: {
  24469. enum: ["asc", "desc"],
  24470. type: "string"
  24471. },
  24472. page: {
  24473. type: "integer"
  24474. },
  24475. per_page: {
  24476. type: "integer"
  24477. },
  24478. team_id: {
  24479. required: true,
  24480. type: "integer"
  24481. }
  24482. },
  24483. url: "/teams/:team_id/discussions"
  24484. },
  24485. listDiscussionsInOrg: {
  24486. method: "GET",
  24487. params: {
  24488. direction: {
  24489. enum: ["asc", "desc"],
  24490. type: "string"
  24491. },
  24492. org: {
  24493. required: true,
  24494. type: "string"
  24495. },
  24496. page: {
  24497. type: "integer"
  24498. },
  24499. per_page: {
  24500. type: "integer"
  24501. },
  24502. team_slug: {
  24503. required: true,
  24504. type: "string"
  24505. }
  24506. },
  24507. url: "/orgs/:org/teams/:team_slug/discussions"
  24508. },
  24509. listDiscussionsLegacy: {
  24510. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24511. method: "GET",
  24512. params: {
  24513. direction: {
  24514. enum: ["asc", "desc"],
  24515. type: "string"
  24516. },
  24517. page: {
  24518. type: "integer"
  24519. },
  24520. per_page: {
  24521. type: "integer"
  24522. },
  24523. team_id: {
  24524. required: true,
  24525. type: "integer"
  24526. }
  24527. },
  24528. url: "/teams/:team_id/discussions"
  24529. },
  24530. listForAuthenticatedUser: {
  24531. method: "GET",
  24532. params: {
  24533. page: {
  24534. type: "integer"
  24535. },
  24536. per_page: {
  24537. type: "integer"
  24538. }
  24539. },
  24540. url: "/user/teams"
  24541. },
  24542. listMembers: {
  24543. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24544. method: "GET",
  24545. params: {
  24546. page: {
  24547. type: "integer"
  24548. },
  24549. per_page: {
  24550. type: "integer"
  24551. },
  24552. role: {
  24553. enum: ["member", "maintainer", "all"],
  24554. type: "string"
  24555. },
  24556. team_id: {
  24557. required: true,
  24558. type: "integer"
  24559. }
  24560. },
  24561. url: "/teams/:team_id/members"
  24562. },
  24563. listMembersInOrg: {
  24564. method: "GET",
  24565. params: {
  24566. org: {
  24567. required: true,
  24568. type: "string"
  24569. },
  24570. page: {
  24571. type: "integer"
  24572. },
  24573. per_page: {
  24574. type: "integer"
  24575. },
  24576. role: {
  24577. enum: ["member", "maintainer", "all"],
  24578. type: "string"
  24579. },
  24580. team_slug: {
  24581. required: true,
  24582. type: "string"
  24583. }
  24584. },
  24585. url: "/orgs/:org/teams/:team_slug/members"
  24586. },
  24587. listMembersLegacy: {
  24588. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24589. method: "GET",
  24590. params: {
  24591. page: {
  24592. type: "integer"
  24593. },
  24594. per_page: {
  24595. type: "integer"
  24596. },
  24597. role: {
  24598. enum: ["member", "maintainer", "all"],
  24599. type: "string"
  24600. },
  24601. team_id: {
  24602. required: true,
  24603. type: "integer"
  24604. }
  24605. },
  24606. url: "/teams/:team_id/members"
  24607. },
  24608. listPendingInvitations: {
  24609. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24610. method: "GET",
  24611. params: {
  24612. page: {
  24613. type: "integer"
  24614. },
  24615. per_page: {
  24616. type: "integer"
  24617. },
  24618. team_id: {
  24619. required: true,
  24620. type: "integer"
  24621. }
  24622. },
  24623. url: "/teams/:team_id/invitations"
  24624. },
  24625. listPendingInvitationsInOrg: {
  24626. method: "GET",
  24627. params: {
  24628. org: {
  24629. required: true,
  24630. type: "string"
  24631. },
  24632. page: {
  24633. type: "integer"
  24634. },
  24635. per_page: {
  24636. type: "integer"
  24637. },
  24638. team_slug: {
  24639. required: true,
  24640. type: "string"
  24641. }
  24642. },
  24643. url: "/orgs/:org/teams/:team_slug/invitations"
  24644. },
  24645. listPendingInvitationsLegacy: {
  24646. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24647. method: "GET",
  24648. params: {
  24649. page: {
  24650. type: "integer"
  24651. },
  24652. per_page: {
  24653. type: "integer"
  24654. },
  24655. team_id: {
  24656. required: true,
  24657. type: "integer"
  24658. }
  24659. },
  24660. url: "/teams/:team_id/invitations"
  24661. },
  24662. listProjects: {
  24663. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24664. headers: {
  24665. accept: "application/vnd.github.inertia-preview+json"
  24666. },
  24667. method: "GET",
  24668. params: {
  24669. page: {
  24670. type: "integer"
  24671. },
  24672. per_page: {
  24673. type: "integer"
  24674. },
  24675. team_id: {
  24676. required: true,
  24677. type: "integer"
  24678. }
  24679. },
  24680. url: "/teams/:team_id/projects"
  24681. },
  24682. listProjectsInOrg: {
  24683. headers: {
  24684. accept: "application/vnd.github.inertia-preview+json"
  24685. },
  24686. method: "GET",
  24687. params: {
  24688. org: {
  24689. required: true,
  24690. type: "string"
  24691. },
  24692. page: {
  24693. type: "integer"
  24694. },
  24695. per_page: {
  24696. type: "integer"
  24697. },
  24698. team_slug: {
  24699. required: true,
  24700. type: "string"
  24701. }
  24702. },
  24703. url: "/orgs/:org/teams/:team_slug/projects"
  24704. },
  24705. listProjectsLegacy: {
  24706. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24707. headers: {
  24708. accept: "application/vnd.github.inertia-preview+json"
  24709. },
  24710. method: "GET",
  24711. params: {
  24712. page: {
  24713. type: "integer"
  24714. },
  24715. per_page: {
  24716. type: "integer"
  24717. },
  24718. team_id: {
  24719. required: true,
  24720. type: "integer"
  24721. }
  24722. },
  24723. url: "/teams/:team_id/projects"
  24724. },
  24725. listRepos: {
  24726. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24727. method: "GET",
  24728. params: {
  24729. page: {
  24730. type: "integer"
  24731. },
  24732. per_page: {
  24733. type: "integer"
  24734. },
  24735. team_id: {
  24736. required: true,
  24737. type: "integer"
  24738. }
  24739. },
  24740. url: "/teams/:team_id/repos"
  24741. },
  24742. listReposInOrg: {
  24743. method: "GET",
  24744. params: {
  24745. org: {
  24746. required: true,
  24747. type: "string"
  24748. },
  24749. page: {
  24750. type: "integer"
  24751. },
  24752. per_page: {
  24753. type: "integer"
  24754. },
  24755. team_slug: {
  24756. required: true,
  24757. type: "string"
  24758. }
  24759. },
  24760. url: "/orgs/:org/teams/:team_slug/repos"
  24761. },
  24762. listReposLegacy: {
  24763. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24764. method: "GET",
  24765. params: {
  24766. page: {
  24767. type: "integer"
  24768. },
  24769. per_page: {
  24770. type: "integer"
  24771. },
  24772. team_id: {
  24773. required: true,
  24774. type: "integer"
  24775. }
  24776. },
  24777. url: "/teams/:team_id/repos"
  24778. },
  24779. removeMember: {
  24780. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24781. method: "DELETE",
  24782. params: {
  24783. team_id: {
  24784. required: true,
  24785. type: "integer"
  24786. },
  24787. username: {
  24788. required: true,
  24789. type: "string"
  24790. }
  24791. },
  24792. url: "/teams/:team_id/members/:username"
  24793. },
  24794. removeMemberLegacy: {
  24795. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24796. method: "DELETE",
  24797. params: {
  24798. team_id: {
  24799. required: true,
  24800. type: "integer"
  24801. },
  24802. username: {
  24803. required: true,
  24804. type: "string"
  24805. }
  24806. },
  24807. url: "/teams/:team_id/members/:username"
  24808. },
  24809. removeMembership: {
  24810. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24811. method: "DELETE",
  24812. params: {
  24813. team_id: {
  24814. required: true,
  24815. type: "integer"
  24816. },
  24817. username: {
  24818. required: true,
  24819. type: "string"
  24820. }
  24821. },
  24822. url: "/teams/:team_id/memberships/:username"
  24823. },
  24824. removeMembershipInOrg: {
  24825. method: "DELETE",
  24826. params: {
  24827. org: {
  24828. required: true,
  24829. type: "string"
  24830. },
  24831. team_slug: {
  24832. required: true,
  24833. type: "string"
  24834. },
  24835. username: {
  24836. required: true,
  24837. type: "string"
  24838. }
  24839. },
  24840. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24841. },
  24842. removeMembershipLegacy: {
  24843. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  24844. method: "DELETE",
  24845. params: {
  24846. team_id: {
  24847. required: true,
  24848. type: "integer"
  24849. },
  24850. username: {
  24851. required: true,
  24852. type: "string"
  24853. }
  24854. },
  24855. url: "/teams/:team_id/memberships/:username"
  24856. },
  24857. removeProject: {
  24858. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  24859. method: "DELETE",
  24860. params: {
  24861. project_id: {
  24862. required: true,
  24863. type: "integer"
  24864. },
  24865. team_id: {
  24866. required: true,
  24867. type: "integer"
  24868. }
  24869. },
  24870. url: "/teams/:team_id/projects/:project_id"
  24871. },
  24872. removeProjectInOrg: {
  24873. method: "DELETE",
  24874. params: {
  24875. org: {
  24876. required: true,
  24877. type: "string"
  24878. },
  24879. project_id: {
  24880. required: true,
  24881. type: "integer"
  24882. },
  24883. team_slug: {
  24884. required: true,
  24885. type: "string"
  24886. }
  24887. },
  24888. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24889. },
  24890. removeProjectLegacy: {
  24891. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  24892. method: "DELETE",
  24893. params: {
  24894. project_id: {
  24895. required: true,
  24896. type: "integer"
  24897. },
  24898. team_id: {
  24899. required: true,
  24900. type: "integer"
  24901. }
  24902. },
  24903. url: "/teams/:team_id/projects/:project_id"
  24904. },
  24905. removeRepo: {
  24906. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  24907. method: "DELETE",
  24908. params: {
  24909. owner: {
  24910. required: true,
  24911. type: "string"
  24912. },
  24913. repo: {
  24914. required: true,
  24915. type: "string"
  24916. },
  24917. team_id: {
  24918. required: true,
  24919. type: "integer"
  24920. }
  24921. },
  24922. url: "/teams/:team_id/repos/:owner/:repo"
  24923. },
  24924. removeRepoInOrg: {
  24925. method: "DELETE",
  24926. params: {
  24927. org: {
  24928. required: true,
  24929. type: "string"
  24930. },
  24931. owner: {
  24932. required: true,
  24933. type: "string"
  24934. },
  24935. repo: {
  24936. required: true,
  24937. type: "string"
  24938. },
  24939. team_slug: {
  24940. required: true,
  24941. type: "string"
  24942. }
  24943. },
  24944. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24945. },
  24946. removeRepoLegacy: {
  24947. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  24948. method: "DELETE",
  24949. params: {
  24950. owner: {
  24951. required: true,
  24952. type: "string"
  24953. },
  24954. repo: {
  24955. required: true,
  24956. type: "string"
  24957. },
  24958. team_id: {
  24959. required: true,
  24960. type: "integer"
  24961. }
  24962. },
  24963. url: "/teams/:team_id/repos/:owner/:repo"
  24964. },
  24965. reviewProject: {
  24966. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  24967. headers: {
  24968. accept: "application/vnd.github.inertia-preview+json"
  24969. },
  24970. method: "GET",
  24971. params: {
  24972. project_id: {
  24973. required: true,
  24974. type: "integer"
  24975. },
  24976. team_id: {
  24977. required: true,
  24978. type: "integer"
  24979. }
  24980. },
  24981. url: "/teams/:team_id/projects/:project_id"
  24982. },
  24983. reviewProjectInOrg: {
  24984. headers: {
  24985. accept: "application/vnd.github.inertia-preview+json"
  24986. },
  24987. method: "GET",
  24988. params: {
  24989. org: {
  24990. required: true,
  24991. type: "string"
  24992. },
  24993. project_id: {
  24994. required: true,
  24995. type: "integer"
  24996. },
  24997. team_slug: {
  24998. required: true,
  24999. type: "string"
  25000. }
  25001. },
  25002. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25003. },
  25004. reviewProjectLegacy: {
  25005. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25006. headers: {
  25007. accept: "application/vnd.github.inertia-preview+json"
  25008. },
  25009. method: "GET",
  25010. params: {
  25011. project_id: {
  25012. required: true,
  25013. type: "integer"
  25014. },
  25015. team_id: {
  25016. required: true,
  25017. type: "integer"
  25018. }
  25019. },
  25020. url: "/teams/:team_id/projects/:project_id"
  25021. },
  25022. update: {
  25023. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25024. method: "PATCH",
  25025. params: {
  25026. description: {
  25027. type: "string"
  25028. },
  25029. name: {
  25030. required: true,
  25031. type: "string"
  25032. },
  25033. parent_team_id: {
  25034. type: "integer"
  25035. },
  25036. permission: {
  25037. enum: ["pull", "push", "admin"],
  25038. type: "string"
  25039. },
  25040. privacy: {
  25041. enum: ["secret", "closed"],
  25042. type: "string"
  25043. },
  25044. team_id: {
  25045. required: true,
  25046. type: "integer"
  25047. }
  25048. },
  25049. url: "/teams/:team_id"
  25050. },
  25051. updateDiscussion: {
  25052. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25053. method: "PATCH",
  25054. params: {
  25055. body: {
  25056. type: "string"
  25057. },
  25058. discussion_number: {
  25059. required: true,
  25060. type: "integer"
  25061. },
  25062. team_id: {
  25063. required: true,
  25064. type: "integer"
  25065. },
  25066. title: {
  25067. type: "string"
  25068. }
  25069. },
  25070. url: "/teams/:team_id/discussions/:discussion_number"
  25071. },
  25072. updateDiscussionComment: {
  25073. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25074. method: "PATCH",
  25075. params: {
  25076. body: {
  25077. required: true,
  25078. type: "string"
  25079. },
  25080. comment_number: {
  25081. required: true,
  25082. type: "integer"
  25083. },
  25084. discussion_number: {
  25085. required: true,
  25086. type: "integer"
  25087. },
  25088. team_id: {
  25089. required: true,
  25090. type: "integer"
  25091. }
  25092. },
  25093. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25094. },
  25095. updateDiscussionCommentInOrg: {
  25096. method: "PATCH",
  25097. params: {
  25098. body: {
  25099. required: true,
  25100. type: "string"
  25101. },
  25102. comment_number: {
  25103. required: true,
  25104. type: "integer"
  25105. },
  25106. discussion_number: {
  25107. required: true,
  25108. type: "integer"
  25109. },
  25110. org: {
  25111. required: true,
  25112. type: "string"
  25113. },
  25114. team_slug: {
  25115. required: true,
  25116. type: "string"
  25117. }
  25118. },
  25119. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25120. },
  25121. updateDiscussionCommentLegacy: {
  25122. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25123. method: "PATCH",
  25124. params: {
  25125. body: {
  25126. required: true,
  25127. type: "string"
  25128. },
  25129. comment_number: {
  25130. required: true,
  25131. type: "integer"
  25132. },
  25133. discussion_number: {
  25134. required: true,
  25135. type: "integer"
  25136. },
  25137. team_id: {
  25138. required: true,
  25139. type: "integer"
  25140. }
  25141. },
  25142. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25143. },
  25144. updateDiscussionInOrg: {
  25145. method: "PATCH",
  25146. params: {
  25147. body: {
  25148. type: "string"
  25149. },
  25150. discussion_number: {
  25151. required: true,
  25152. type: "integer"
  25153. },
  25154. org: {
  25155. required: true,
  25156. type: "string"
  25157. },
  25158. team_slug: {
  25159. required: true,
  25160. type: "string"
  25161. },
  25162. title: {
  25163. type: "string"
  25164. }
  25165. },
  25166. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25167. },
  25168. updateDiscussionLegacy: {
  25169. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25170. method: "PATCH",
  25171. params: {
  25172. body: {
  25173. type: "string"
  25174. },
  25175. discussion_number: {
  25176. required: true,
  25177. type: "integer"
  25178. },
  25179. team_id: {
  25180. required: true,
  25181. type: "integer"
  25182. },
  25183. title: {
  25184. type: "string"
  25185. }
  25186. },
  25187. url: "/teams/:team_id/discussions/:discussion_number"
  25188. },
  25189. updateInOrg: {
  25190. method: "PATCH",
  25191. params: {
  25192. description: {
  25193. type: "string"
  25194. },
  25195. name: {
  25196. required: true,
  25197. type: "string"
  25198. },
  25199. org: {
  25200. required: true,
  25201. type: "string"
  25202. },
  25203. parent_team_id: {
  25204. type: "integer"
  25205. },
  25206. permission: {
  25207. enum: ["pull", "push", "admin"],
  25208. type: "string"
  25209. },
  25210. privacy: {
  25211. enum: ["secret", "closed"],
  25212. type: "string"
  25213. },
  25214. team_slug: {
  25215. required: true,
  25216. type: "string"
  25217. }
  25218. },
  25219. url: "/orgs/:org/teams/:team_slug"
  25220. },
  25221. updateLegacy: {
  25222. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25223. method: "PATCH",
  25224. params: {
  25225. description: {
  25226. type: "string"
  25227. },
  25228. name: {
  25229. required: true,
  25230. type: "string"
  25231. },
  25232. parent_team_id: {
  25233. type: "integer"
  25234. },
  25235. permission: {
  25236. enum: ["pull", "push", "admin"],
  25237. type: "string"
  25238. },
  25239. privacy: {
  25240. enum: ["secret", "closed"],
  25241. type: "string"
  25242. },
  25243. team_id: {
  25244. required: true,
  25245. type: "integer"
  25246. }
  25247. },
  25248. url: "/teams/:team_id"
  25249. }
  25250. },
  25251. users: {
  25252. addEmails: {
  25253. method: "POST",
  25254. params: {
  25255. emails: {
  25256. required: true,
  25257. type: "string[]"
  25258. }
  25259. },
  25260. url: "/user/emails"
  25261. },
  25262. block: {
  25263. method: "PUT",
  25264. params: {
  25265. username: {
  25266. required: true,
  25267. type: "string"
  25268. }
  25269. },
  25270. url: "/user/blocks/:username"
  25271. },
  25272. checkBlocked: {
  25273. method: "GET",
  25274. params: {
  25275. username: {
  25276. required: true,
  25277. type: "string"
  25278. }
  25279. },
  25280. url: "/user/blocks/:username"
  25281. },
  25282. checkFollowing: {
  25283. method: "GET",
  25284. params: {
  25285. username: {
  25286. required: true,
  25287. type: "string"
  25288. }
  25289. },
  25290. url: "/user/following/:username"
  25291. },
  25292. checkFollowingForUser: {
  25293. method: "GET",
  25294. params: {
  25295. target_user: {
  25296. required: true,
  25297. type: "string"
  25298. },
  25299. username: {
  25300. required: true,
  25301. type: "string"
  25302. }
  25303. },
  25304. url: "/users/:username/following/:target_user"
  25305. },
  25306. createGpgKey: {
  25307. method: "POST",
  25308. params: {
  25309. armored_public_key: {
  25310. type: "string"
  25311. }
  25312. },
  25313. url: "/user/gpg_keys"
  25314. },
  25315. createPublicKey: {
  25316. method: "POST",
  25317. params: {
  25318. key: {
  25319. type: "string"
  25320. },
  25321. title: {
  25322. type: "string"
  25323. }
  25324. },
  25325. url: "/user/keys"
  25326. },
  25327. deleteEmails: {
  25328. method: "DELETE",
  25329. params: {
  25330. emails: {
  25331. required: true,
  25332. type: "string[]"
  25333. }
  25334. },
  25335. url: "/user/emails"
  25336. },
  25337. deleteGpgKey: {
  25338. method: "DELETE",
  25339. params: {
  25340. gpg_key_id: {
  25341. required: true,
  25342. type: "integer"
  25343. }
  25344. },
  25345. url: "/user/gpg_keys/:gpg_key_id"
  25346. },
  25347. deletePublicKey: {
  25348. method: "DELETE",
  25349. params: {
  25350. key_id: {
  25351. required: true,
  25352. type: "integer"
  25353. }
  25354. },
  25355. url: "/user/keys/:key_id"
  25356. },
  25357. follow: {
  25358. method: "PUT",
  25359. params: {
  25360. username: {
  25361. required: true,
  25362. type: "string"
  25363. }
  25364. },
  25365. url: "/user/following/:username"
  25366. },
  25367. getAuthenticated: {
  25368. method: "GET",
  25369. params: {},
  25370. url: "/user"
  25371. },
  25372. getByUsername: {
  25373. method: "GET",
  25374. params: {
  25375. username: {
  25376. required: true,
  25377. type: "string"
  25378. }
  25379. },
  25380. url: "/users/:username"
  25381. },
  25382. getContextForUser: {
  25383. method: "GET",
  25384. params: {
  25385. subject_id: {
  25386. type: "string"
  25387. },
  25388. subject_type: {
  25389. enum: ["organization", "repository", "issue", "pull_request"],
  25390. type: "string"
  25391. },
  25392. username: {
  25393. required: true,
  25394. type: "string"
  25395. }
  25396. },
  25397. url: "/users/:username/hovercard"
  25398. },
  25399. getGpgKey: {
  25400. method: "GET",
  25401. params: {
  25402. gpg_key_id: {
  25403. required: true,
  25404. type: "integer"
  25405. }
  25406. },
  25407. url: "/user/gpg_keys/:gpg_key_id"
  25408. },
  25409. getPublicKey: {
  25410. method: "GET",
  25411. params: {
  25412. key_id: {
  25413. required: true,
  25414. type: "integer"
  25415. }
  25416. },
  25417. url: "/user/keys/:key_id"
  25418. },
  25419. list: {
  25420. method: "GET",
  25421. params: {
  25422. page: {
  25423. type: "integer"
  25424. },
  25425. per_page: {
  25426. type: "integer"
  25427. },
  25428. since: {
  25429. type: "string"
  25430. }
  25431. },
  25432. url: "/users"
  25433. },
  25434. listBlocked: {
  25435. method: "GET",
  25436. params: {},
  25437. url: "/user/blocks"
  25438. },
  25439. listEmails: {
  25440. method: "GET",
  25441. params: {
  25442. page: {
  25443. type: "integer"
  25444. },
  25445. per_page: {
  25446. type: "integer"
  25447. }
  25448. },
  25449. url: "/user/emails"
  25450. },
  25451. listFollowersForAuthenticatedUser: {
  25452. method: "GET",
  25453. params: {
  25454. page: {
  25455. type: "integer"
  25456. },
  25457. per_page: {
  25458. type: "integer"
  25459. }
  25460. },
  25461. url: "/user/followers"
  25462. },
  25463. listFollowersForUser: {
  25464. method: "GET",
  25465. params: {
  25466. page: {
  25467. type: "integer"
  25468. },
  25469. per_page: {
  25470. type: "integer"
  25471. },
  25472. username: {
  25473. required: true,
  25474. type: "string"
  25475. }
  25476. },
  25477. url: "/users/:username/followers"
  25478. },
  25479. listFollowingForAuthenticatedUser: {
  25480. method: "GET",
  25481. params: {
  25482. page: {
  25483. type: "integer"
  25484. },
  25485. per_page: {
  25486. type: "integer"
  25487. }
  25488. },
  25489. url: "/user/following"
  25490. },
  25491. listFollowingForUser: {
  25492. method: "GET",
  25493. params: {
  25494. page: {
  25495. type: "integer"
  25496. },
  25497. per_page: {
  25498. type: "integer"
  25499. },
  25500. username: {
  25501. required: true,
  25502. type: "string"
  25503. }
  25504. },
  25505. url: "/users/:username/following"
  25506. },
  25507. listGpgKeys: {
  25508. method: "GET",
  25509. params: {
  25510. page: {
  25511. type: "integer"
  25512. },
  25513. per_page: {
  25514. type: "integer"
  25515. }
  25516. },
  25517. url: "/user/gpg_keys"
  25518. },
  25519. listGpgKeysForUser: {
  25520. method: "GET",
  25521. params: {
  25522. page: {
  25523. type: "integer"
  25524. },
  25525. per_page: {
  25526. type: "integer"
  25527. },
  25528. username: {
  25529. required: true,
  25530. type: "string"
  25531. }
  25532. },
  25533. url: "/users/:username/gpg_keys"
  25534. },
  25535. listPublicEmails: {
  25536. method: "GET",
  25537. params: {
  25538. page: {
  25539. type: "integer"
  25540. },
  25541. per_page: {
  25542. type: "integer"
  25543. }
  25544. },
  25545. url: "/user/public_emails"
  25546. },
  25547. listPublicKeys: {
  25548. method: "GET",
  25549. params: {
  25550. page: {
  25551. type: "integer"
  25552. },
  25553. per_page: {
  25554. type: "integer"
  25555. }
  25556. },
  25557. url: "/user/keys"
  25558. },
  25559. listPublicKeysForUser: {
  25560. method: "GET",
  25561. params: {
  25562. page: {
  25563. type: "integer"
  25564. },
  25565. per_page: {
  25566. type: "integer"
  25567. },
  25568. username: {
  25569. required: true,
  25570. type: "string"
  25571. }
  25572. },
  25573. url: "/users/:username/keys"
  25574. },
  25575. togglePrimaryEmailVisibility: {
  25576. method: "PATCH",
  25577. params: {
  25578. email: {
  25579. required: true,
  25580. type: "string"
  25581. },
  25582. visibility: {
  25583. required: true,
  25584. type: "string"
  25585. }
  25586. },
  25587. url: "/user/email/visibility"
  25588. },
  25589. unblock: {
  25590. method: "DELETE",
  25591. params: {
  25592. username: {
  25593. required: true,
  25594. type: "string"
  25595. }
  25596. },
  25597. url: "/user/blocks/:username"
  25598. },
  25599. unfollow: {
  25600. method: "DELETE",
  25601. params: {
  25602. username: {
  25603. required: true,
  25604. type: "string"
  25605. }
  25606. },
  25607. url: "/user/following/:username"
  25608. },
  25609. updateAuthenticated: {
  25610. method: "PATCH",
  25611. params: {
  25612. bio: {
  25613. type: "string"
  25614. },
  25615. blog: {
  25616. type: "string"
  25617. },
  25618. company: {
  25619. type: "string"
  25620. },
  25621. email: {
  25622. type: "string"
  25623. },
  25624. hireable: {
  25625. type: "boolean"
  25626. },
  25627. location: {
  25628. type: "string"
  25629. },
  25630. name: {
  25631. type: "string"
  25632. }
  25633. },
  25634. url: "/user"
  25635. }
  25636. }
  25637. };
  25638. const VERSION = "2.4.0";
  25639. function registerEndpoints(octokit, routes) {
  25640. Object.keys(routes).forEach(namespaceName => {
  25641. if (!octokit[namespaceName]) {
  25642. octokit[namespaceName] = {};
  25643. }
  25644. Object.keys(routes[namespaceName]).forEach(apiName => {
  25645. const apiOptions = routes[namespaceName][apiName];
  25646. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25647. if (typeof apiOptions[key] !== "undefined") {
  25648. map[key] = apiOptions[key];
  25649. }
  25650. return map;
  25651. }, {});
  25652. endpointDefaults.request = {
  25653. validate: apiOptions.params
  25654. };
  25655. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25656. // Not the most elegant solution, but we don’t want to move deprecation
  25657. // logic into octokit/endpoint.js as it’s out of scope
  25658. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25659. if (hasDeprecatedParam) {
  25660. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25661. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25662. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25663. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25664. }
  25665. if (apiOptions.deprecated) {
  25666. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25667. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25668. octokit[namespaceName][apiName] = request;
  25669. return request.apply(null, arguments);
  25670. }, request);
  25671. return;
  25672. }
  25673. octokit[namespaceName][apiName] = request;
  25674. });
  25675. });
  25676. }
  25677. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25678. const patchedMethod = options => {
  25679. options = Object.assign({}, options);
  25680. Object.keys(options).forEach(key => {
  25681. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25682. const aliasKey = apiOptions.params[key].alias;
  25683. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25684. if (!(aliasKey in options)) {
  25685. options[aliasKey] = options[key];
  25686. }
  25687. delete options[key];
  25688. }
  25689. });
  25690. return method(options);
  25691. };
  25692. Object.keys(method).forEach(key => {
  25693. patchedMethod[key] = method[key];
  25694. });
  25695. return patchedMethod;
  25696. }
  25697. /**
  25698. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25699. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25700. * done, we will remove the registerEndpoints methods and return the methods
  25701. * directly as with the other plugins. At that point we will also remove the
  25702. * legacy workarounds and deprecations.
  25703. *
  25704. * See the plan at
  25705. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25706. */
  25707. function restEndpointMethods(octokit) {
  25708. // @ts-ignore
  25709. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25710. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25711. // See https://github.com/octokit/rest.js/pull/1134
  25712. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25713. Object.defineProperty(octokit, deprecatedScope, {
  25714. get() {
  25715. octokit.log.warn( // @ts-ignore
  25716. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25717. return octokit[scope];
  25718. }
  25719. });
  25720. });
  25721. return {};
  25722. }
  25723. restEndpointMethods.VERSION = VERSION;
  25724. exports.restEndpointMethods = restEndpointMethods;
  25725. //# sourceMappingURL=index.js.map
  25726. /***/ }),
  25727. /***/ 850:
  25728. /***/ (function(module, __unusedexports, __webpack_require__) {
  25729. module.exports = paginationMethodsPlugin
  25730. function paginationMethodsPlugin (octokit) {
  25731. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25732. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25733. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25734. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25735. octokit.hasFirstPage = __webpack_require__(536)
  25736. octokit.hasLastPage = __webpack_require__(336)
  25737. octokit.hasNextPage = __webpack_require__(929)
  25738. octokit.hasPreviousPage = __webpack_require__(558)
  25739. }
  25740. /***/ }),
  25741. /***/ 854:
  25742. /***/ (function(module) {
  25743. /**
  25744. * lodash (Custom Build) <https://lodash.com/>
  25745. * Build: `lodash modularize exports="npm" -o ./`
  25746. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25747. * Released under MIT license <https://lodash.com/license>
  25748. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25749. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25750. */
  25751. /** Used as the `TypeError` message for "Functions" methods. */
  25752. var FUNC_ERROR_TEXT = 'Expected a function';
  25753. /** Used to stand-in for `undefined` hash values. */
  25754. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25755. /** Used as references for various `Number` constants. */
  25756. var INFINITY = 1 / 0;
  25757. /** `Object#toString` result references. */
  25758. var funcTag = '[object Function]',
  25759. genTag = '[object GeneratorFunction]',
  25760. symbolTag = '[object Symbol]';
  25761. /** Used to match property names within property paths. */
  25762. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25763. reIsPlainProp = /^\w*$/,
  25764. reLeadingDot = /^\./,
  25765. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25766. /**
  25767. * Used to match `RegExp`
  25768. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25769. */
  25770. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25771. /** Used to match backslashes in property paths. */
  25772. var reEscapeChar = /\\(\\)?/g;
  25773. /** Used to detect host constructors (Safari). */
  25774. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25775. /** Detect free variable `global` from Node.js. */
  25776. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25777. /** Detect free variable `self`. */
  25778. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25779. /** Used as a reference to the global object. */
  25780. var root = freeGlobal || freeSelf || Function('return this')();
  25781. /**
  25782. * Gets the value at `key` of `object`.
  25783. *
  25784. * @private
  25785. * @param {Object} [object] The object to query.
  25786. * @param {string} key The key of the property to get.
  25787. * @returns {*} Returns the property value.
  25788. */
  25789. function getValue(object, key) {
  25790. return object == null ? undefined : object[key];
  25791. }
  25792. /**
  25793. * Checks if `value` is a host object in IE < 9.
  25794. *
  25795. * @private
  25796. * @param {*} value The value to check.
  25797. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25798. */
  25799. function isHostObject(value) {
  25800. // Many host objects are `Object` objects that can coerce to strings
  25801. // despite having improperly defined `toString` methods.
  25802. var result = false;
  25803. if (value != null && typeof value.toString != 'function') {
  25804. try {
  25805. result = !!(value + '');
  25806. } catch (e) {}
  25807. }
  25808. return result;
  25809. }
  25810. /** Used for built-in method references. */
  25811. var arrayProto = Array.prototype,
  25812. funcProto = Function.prototype,
  25813. objectProto = Object.prototype;
  25814. /** Used to detect overreaching core-js shims. */
  25815. var coreJsData = root['__core-js_shared__'];
  25816. /** Used to detect methods masquerading as native. */
  25817. var maskSrcKey = (function() {
  25818. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25819. return uid ? ('Symbol(src)_1.' + uid) : '';
  25820. }());
  25821. /** Used to resolve the decompiled source of functions. */
  25822. var funcToString = funcProto.toString;
  25823. /** Used to check objects for own properties. */
  25824. var hasOwnProperty = objectProto.hasOwnProperty;
  25825. /**
  25826. * Used to resolve the
  25827. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  25828. * of values.
  25829. */
  25830. var objectToString = objectProto.toString;
  25831. /** Used to detect if a method is native. */
  25832. var reIsNative = RegExp('^' +
  25833. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  25834. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  25835. );
  25836. /** Built-in value references. */
  25837. var Symbol = root.Symbol,
  25838. splice = arrayProto.splice;
  25839. /* Built-in method references that are verified to be native. */
  25840. var Map = getNative(root, 'Map'),
  25841. nativeCreate = getNative(Object, 'create');
  25842. /** Used to convert symbols to primitives and strings. */
  25843. var symbolProto = Symbol ? Symbol.prototype : undefined,
  25844. symbolToString = symbolProto ? symbolProto.toString : undefined;
  25845. /**
  25846. * Creates a hash object.
  25847. *
  25848. * @private
  25849. * @constructor
  25850. * @param {Array} [entries] The key-value pairs to cache.
  25851. */
  25852. function Hash(entries) {
  25853. var index = -1,
  25854. length = entries ? entries.length : 0;
  25855. this.clear();
  25856. while (++index < length) {
  25857. var entry = entries[index];
  25858. this.set(entry[0], entry[1]);
  25859. }
  25860. }
  25861. /**
  25862. * Removes all key-value entries from the hash.
  25863. *
  25864. * @private
  25865. * @name clear
  25866. * @memberOf Hash
  25867. */
  25868. function hashClear() {
  25869. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  25870. }
  25871. /**
  25872. * Removes `key` and its value from the hash.
  25873. *
  25874. * @private
  25875. * @name delete
  25876. * @memberOf Hash
  25877. * @param {Object} hash The hash to modify.
  25878. * @param {string} key The key of the value to remove.
  25879. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25880. */
  25881. function hashDelete(key) {
  25882. return this.has(key) && delete this.__data__[key];
  25883. }
  25884. /**
  25885. * Gets the hash value for `key`.
  25886. *
  25887. * @private
  25888. * @name get
  25889. * @memberOf Hash
  25890. * @param {string} key The key of the value to get.
  25891. * @returns {*} Returns the entry value.
  25892. */
  25893. function hashGet(key) {
  25894. var data = this.__data__;
  25895. if (nativeCreate) {
  25896. var result = data[key];
  25897. return result === HASH_UNDEFINED ? undefined : result;
  25898. }
  25899. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  25900. }
  25901. /**
  25902. * Checks if a hash value for `key` exists.
  25903. *
  25904. * @private
  25905. * @name has
  25906. * @memberOf Hash
  25907. * @param {string} key The key of the entry to check.
  25908. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25909. */
  25910. function hashHas(key) {
  25911. var data = this.__data__;
  25912. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  25913. }
  25914. /**
  25915. * Sets the hash `key` to `value`.
  25916. *
  25917. * @private
  25918. * @name set
  25919. * @memberOf Hash
  25920. * @param {string} key The key of the value to set.
  25921. * @param {*} value The value to set.
  25922. * @returns {Object} Returns the hash instance.
  25923. */
  25924. function hashSet(key, value) {
  25925. var data = this.__data__;
  25926. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  25927. return this;
  25928. }
  25929. // Add methods to `Hash`.
  25930. Hash.prototype.clear = hashClear;
  25931. Hash.prototype['delete'] = hashDelete;
  25932. Hash.prototype.get = hashGet;
  25933. Hash.prototype.has = hashHas;
  25934. Hash.prototype.set = hashSet;
  25935. /**
  25936. * Creates an list cache object.
  25937. *
  25938. * @private
  25939. * @constructor
  25940. * @param {Array} [entries] The key-value pairs to cache.
  25941. */
  25942. function ListCache(entries) {
  25943. var index = -1,
  25944. length = entries ? entries.length : 0;
  25945. this.clear();
  25946. while (++index < length) {
  25947. var entry = entries[index];
  25948. this.set(entry[0], entry[1]);
  25949. }
  25950. }
  25951. /**
  25952. * Removes all key-value entries from the list cache.
  25953. *
  25954. * @private
  25955. * @name clear
  25956. * @memberOf ListCache
  25957. */
  25958. function listCacheClear() {
  25959. this.__data__ = [];
  25960. }
  25961. /**
  25962. * Removes `key` and its value from the list cache.
  25963. *
  25964. * @private
  25965. * @name delete
  25966. * @memberOf ListCache
  25967. * @param {string} key The key of the value to remove.
  25968. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25969. */
  25970. function listCacheDelete(key) {
  25971. var data = this.__data__,
  25972. index = assocIndexOf(data, key);
  25973. if (index < 0) {
  25974. return false;
  25975. }
  25976. var lastIndex = data.length - 1;
  25977. if (index == lastIndex) {
  25978. data.pop();
  25979. } else {
  25980. splice.call(data, index, 1);
  25981. }
  25982. return true;
  25983. }
  25984. /**
  25985. * Gets the list cache value for `key`.
  25986. *
  25987. * @private
  25988. * @name get
  25989. * @memberOf ListCache
  25990. * @param {string} key The key of the value to get.
  25991. * @returns {*} Returns the entry value.
  25992. */
  25993. function listCacheGet(key) {
  25994. var data = this.__data__,
  25995. index = assocIndexOf(data, key);
  25996. return index < 0 ? undefined : data[index][1];
  25997. }
  25998. /**
  25999. * Checks if a list cache value for `key` exists.
  26000. *
  26001. * @private
  26002. * @name has
  26003. * @memberOf ListCache
  26004. * @param {string} key The key of the entry to check.
  26005. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26006. */
  26007. function listCacheHas(key) {
  26008. return assocIndexOf(this.__data__, key) > -1;
  26009. }
  26010. /**
  26011. * Sets the list cache `key` to `value`.
  26012. *
  26013. * @private
  26014. * @name set
  26015. * @memberOf ListCache
  26016. * @param {string} key The key of the value to set.
  26017. * @param {*} value The value to set.
  26018. * @returns {Object} Returns the list cache instance.
  26019. */
  26020. function listCacheSet(key, value) {
  26021. var data = this.__data__,
  26022. index = assocIndexOf(data, key);
  26023. if (index < 0) {
  26024. data.push([key, value]);
  26025. } else {
  26026. data[index][1] = value;
  26027. }
  26028. return this;
  26029. }
  26030. // Add methods to `ListCache`.
  26031. ListCache.prototype.clear = listCacheClear;
  26032. ListCache.prototype['delete'] = listCacheDelete;
  26033. ListCache.prototype.get = listCacheGet;
  26034. ListCache.prototype.has = listCacheHas;
  26035. ListCache.prototype.set = listCacheSet;
  26036. /**
  26037. * Creates a map cache object to store key-value pairs.
  26038. *
  26039. * @private
  26040. * @constructor
  26041. * @param {Array} [entries] The key-value pairs to cache.
  26042. */
  26043. function MapCache(entries) {
  26044. var index = -1,
  26045. length = entries ? entries.length : 0;
  26046. this.clear();
  26047. while (++index < length) {
  26048. var entry = entries[index];
  26049. this.set(entry[0], entry[1]);
  26050. }
  26051. }
  26052. /**
  26053. * Removes all key-value entries from the map.
  26054. *
  26055. * @private
  26056. * @name clear
  26057. * @memberOf MapCache
  26058. */
  26059. function mapCacheClear() {
  26060. this.__data__ = {
  26061. 'hash': new Hash,
  26062. 'map': new (Map || ListCache),
  26063. 'string': new Hash
  26064. };
  26065. }
  26066. /**
  26067. * Removes `key` and its value from the map.
  26068. *
  26069. * @private
  26070. * @name delete
  26071. * @memberOf MapCache
  26072. * @param {string} key The key of the value to remove.
  26073. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26074. */
  26075. function mapCacheDelete(key) {
  26076. return getMapData(this, key)['delete'](key);
  26077. }
  26078. /**
  26079. * Gets the map value for `key`.
  26080. *
  26081. * @private
  26082. * @name get
  26083. * @memberOf MapCache
  26084. * @param {string} key The key of the value to get.
  26085. * @returns {*} Returns the entry value.
  26086. */
  26087. function mapCacheGet(key) {
  26088. return getMapData(this, key).get(key);
  26089. }
  26090. /**
  26091. * Checks if a map value for `key` exists.
  26092. *
  26093. * @private
  26094. * @name has
  26095. * @memberOf MapCache
  26096. * @param {string} key The key of the entry to check.
  26097. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26098. */
  26099. function mapCacheHas(key) {
  26100. return getMapData(this, key).has(key);
  26101. }
  26102. /**
  26103. * Sets the map `key` to `value`.
  26104. *
  26105. * @private
  26106. * @name set
  26107. * @memberOf MapCache
  26108. * @param {string} key The key of the value to set.
  26109. * @param {*} value The value to set.
  26110. * @returns {Object} Returns the map cache instance.
  26111. */
  26112. function mapCacheSet(key, value) {
  26113. getMapData(this, key).set(key, value);
  26114. return this;
  26115. }
  26116. // Add methods to `MapCache`.
  26117. MapCache.prototype.clear = mapCacheClear;
  26118. MapCache.prototype['delete'] = mapCacheDelete;
  26119. MapCache.prototype.get = mapCacheGet;
  26120. MapCache.prototype.has = mapCacheHas;
  26121. MapCache.prototype.set = mapCacheSet;
  26122. /**
  26123. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26124. *
  26125. * @private
  26126. * @param {Array} array The array to inspect.
  26127. * @param {*} key The key to search for.
  26128. * @returns {number} Returns the index of the matched value, else `-1`.
  26129. */
  26130. function assocIndexOf(array, key) {
  26131. var length = array.length;
  26132. while (length--) {
  26133. if (eq(array[length][0], key)) {
  26134. return length;
  26135. }
  26136. }
  26137. return -1;
  26138. }
  26139. /**
  26140. * The base implementation of `_.get` without support for default values.
  26141. *
  26142. * @private
  26143. * @param {Object} object The object to query.
  26144. * @param {Array|string} path The path of the property to get.
  26145. * @returns {*} Returns the resolved value.
  26146. */
  26147. function baseGet(object, path) {
  26148. path = isKey(path, object) ? [path] : castPath(path);
  26149. var index = 0,
  26150. length = path.length;
  26151. while (object != null && index < length) {
  26152. object = object[toKey(path[index++])];
  26153. }
  26154. return (index && index == length) ? object : undefined;
  26155. }
  26156. /**
  26157. * The base implementation of `_.isNative` without bad shim checks.
  26158. *
  26159. * @private
  26160. * @param {*} value The value to check.
  26161. * @returns {boolean} Returns `true` if `value` is a native function,
  26162. * else `false`.
  26163. */
  26164. function baseIsNative(value) {
  26165. if (!isObject(value) || isMasked(value)) {
  26166. return false;
  26167. }
  26168. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26169. return pattern.test(toSource(value));
  26170. }
  26171. /**
  26172. * The base implementation of `_.toString` which doesn't convert nullish
  26173. * values to empty strings.
  26174. *
  26175. * @private
  26176. * @param {*} value The value to process.
  26177. * @returns {string} Returns the string.
  26178. */
  26179. function baseToString(value) {
  26180. // Exit early for strings to avoid a performance hit in some environments.
  26181. if (typeof value == 'string') {
  26182. return value;
  26183. }
  26184. if (isSymbol(value)) {
  26185. return symbolToString ? symbolToString.call(value) : '';
  26186. }
  26187. var result = (value + '');
  26188. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26189. }
  26190. /**
  26191. * Casts `value` to a path array if it's not one.
  26192. *
  26193. * @private
  26194. * @param {*} value The value to inspect.
  26195. * @returns {Array} Returns the cast property path array.
  26196. */
  26197. function castPath(value) {
  26198. return isArray(value) ? value : stringToPath(value);
  26199. }
  26200. /**
  26201. * Gets the data for `map`.
  26202. *
  26203. * @private
  26204. * @param {Object} map The map to query.
  26205. * @param {string} key The reference key.
  26206. * @returns {*} Returns the map data.
  26207. */
  26208. function getMapData(map, key) {
  26209. var data = map.__data__;
  26210. return isKeyable(key)
  26211. ? data[typeof key == 'string' ? 'string' : 'hash']
  26212. : data.map;
  26213. }
  26214. /**
  26215. * Gets the native function at `key` of `object`.
  26216. *
  26217. * @private
  26218. * @param {Object} object The object to query.
  26219. * @param {string} key The key of the method to get.
  26220. * @returns {*} Returns the function if it's native, else `undefined`.
  26221. */
  26222. function getNative(object, key) {
  26223. var value = getValue(object, key);
  26224. return baseIsNative(value) ? value : undefined;
  26225. }
  26226. /**
  26227. * Checks if `value` is a property name and not a property path.
  26228. *
  26229. * @private
  26230. * @param {*} value The value to check.
  26231. * @param {Object} [object] The object to query keys on.
  26232. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26233. */
  26234. function isKey(value, object) {
  26235. if (isArray(value)) {
  26236. return false;
  26237. }
  26238. var type = typeof value;
  26239. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26240. value == null || isSymbol(value)) {
  26241. return true;
  26242. }
  26243. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26244. (object != null && value in Object(object));
  26245. }
  26246. /**
  26247. * Checks if `value` is suitable for use as unique object key.
  26248. *
  26249. * @private
  26250. * @param {*} value The value to check.
  26251. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26252. */
  26253. function isKeyable(value) {
  26254. var type = typeof value;
  26255. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26256. ? (value !== '__proto__')
  26257. : (value === null);
  26258. }
  26259. /**
  26260. * Checks if `func` has its source masked.
  26261. *
  26262. * @private
  26263. * @param {Function} func The function to check.
  26264. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26265. */
  26266. function isMasked(func) {
  26267. return !!maskSrcKey && (maskSrcKey in func);
  26268. }
  26269. /**
  26270. * Converts `string` to a property path array.
  26271. *
  26272. * @private
  26273. * @param {string} string The string to convert.
  26274. * @returns {Array} Returns the property path array.
  26275. */
  26276. var stringToPath = memoize(function(string) {
  26277. string = toString(string);
  26278. var result = [];
  26279. if (reLeadingDot.test(string)) {
  26280. result.push('');
  26281. }
  26282. string.replace(rePropName, function(match, number, quote, string) {
  26283. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26284. });
  26285. return result;
  26286. });
  26287. /**
  26288. * Converts `value` to a string key if it's not a string or symbol.
  26289. *
  26290. * @private
  26291. * @param {*} value The value to inspect.
  26292. * @returns {string|symbol} Returns the key.
  26293. */
  26294. function toKey(value) {
  26295. if (typeof value == 'string' || isSymbol(value)) {
  26296. return value;
  26297. }
  26298. var result = (value + '');
  26299. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26300. }
  26301. /**
  26302. * Converts `func` to its source code.
  26303. *
  26304. * @private
  26305. * @param {Function} func The function to process.
  26306. * @returns {string} Returns the source code.
  26307. */
  26308. function toSource(func) {
  26309. if (func != null) {
  26310. try {
  26311. return funcToString.call(func);
  26312. } catch (e) {}
  26313. try {
  26314. return (func + '');
  26315. } catch (e) {}
  26316. }
  26317. return '';
  26318. }
  26319. /**
  26320. * Creates a function that memoizes the result of `func`. If `resolver` is
  26321. * provided, it determines the cache key for storing the result based on the
  26322. * arguments provided to the memoized function. By default, the first argument
  26323. * provided to the memoized function is used as the map cache key. The `func`
  26324. * is invoked with the `this` binding of the memoized function.
  26325. *
  26326. * **Note:** The cache is exposed as the `cache` property on the memoized
  26327. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26328. * constructor with one whose instances implement the
  26329. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26330. * method interface of `delete`, `get`, `has`, and `set`.
  26331. *
  26332. * @static
  26333. * @memberOf _
  26334. * @since 0.1.0
  26335. * @category Function
  26336. * @param {Function} func The function to have its output memoized.
  26337. * @param {Function} [resolver] The function to resolve the cache key.
  26338. * @returns {Function} Returns the new memoized function.
  26339. * @example
  26340. *
  26341. * var object = { 'a': 1, 'b': 2 };
  26342. * var other = { 'c': 3, 'd': 4 };
  26343. *
  26344. * var values = _.memoize(_.values);
  26345. * values(object);
  26346. * // => [1, 2]
  26347. *
  26348. * values(other);
  26349. * // => [3, 4]
  26350. *
  26351. * object.a = 2;
  26352. * values(object);
  26353. * // => [1, 2]
  26354. *
  26355. * // Modify the result cache.
  26356. * values.cache.set(object, ['a', 'b']);
  26357. * values(object);
  26358. * // => ['a', 'b']
  26359. *
  26360. * // Replace `_.memoize.Cache`.
  26361. * _.memoize.Cache = WeakMap;
  26362. */
  26363. function memoize(func, resolver) {
  26364. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26365. throw new TypeError(FUNC_ERROR_TEXT);
  26366. }
  26367. var memoized = function() {
  26368. var args = arguments,
  26369. key = resolver ? resolver.apply(this, args) : args[0],
  26370. cache = memoized.cache;
  26371. if (cache.has(key)) {
  26372. return cache.get(key);
  26373. }
  26374. var result = func.apply(this, args);
  26375. memoized.cache = cache.set(key, result);
  26376. return result;
  26377. };
  26378. memoized.cache = new (memoize.Cache || MapCache);
  26379. return memoized;
  26380. }
  26381. // Assign cache to `_.memoize`.
  26382. memoize.Cache = MapCache;
  26383. /**
  26384. * Performs a
  26385. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26386. * comparison between two values to determine if they are equivalent.
  26387. *
  26388. * @static
  26389. * @memberOf _
  26390. * @since 4.0.0
  26391. * @category Lang
  26392. * @param {*} value The value to compare.
  26393. * @param {*} other The other value to compare.
  26394. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26395. * @example
  26396. *
  26397. * var object = { 'a': 1 };
  26398. * var other = { 'a': 1 };
  26399. *
  26400. * _.eq(object, object);
  26401. * // => true
  26402. *
  26403. * _.eq(object, other);
  26404. * // => false
  26405. *
  26406. * _.eq('a', 'a');
  26407. * // => true
  26408. *
  26409. * _.eq('a', Object('a'));
  26410. * // => false
  26411. *
  26412. * _.eq(NaN, NaN);
  26413. * // => true
  26414. */
  26415. function eq(value, other) {
  26416. return value === other || (value !== value && other !== other);
  26417. }
  26418. /**
  26419. * Checks if `value` is classified as an `Array` object.
  26420. *
  26421. * @static
  26422. * @memberOf _
  26423. * @since 0.1.0
  26424. * @category Lang
  26425. * @param {*} value The value to check.
  26426. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26427. * @example
  26428. *
  26429. * _.isArray([1, 2, 3]);
  26430. * // => true
  26431. *
  26432. * _.isArray(document.body.children);
  26433. * // => false
  26434. *
  26435. * _.isArray('abc');
  26436. * // => false
  26437. *
  26438. * _.isArray(_.noop);
  26439. * // => false
  26440. */
  26441. var isArray = Array.isArray;
  26442. /**
  26443. * Checks if `value` is classified as a `Function` object.
  26444. *
  26445. * @static
  26446. * @memberOf _
  26447. * @since 0.1.0
  26448. * @category Lang
  26449. * @param {*} value The value to check.
  26450. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26451. * @example
  26452. *
  26453. * _.isFunction(_);
  26454. * // => true
  26455. *
  26456. * _.isFunction(/abc/);
  26457. * // => false
  26458. */
  26459. function isFunction(value) {
  26460. // The use of `Object#toString` avoids issues with the `typeof` operator
  26461. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26462. var tag = isObject(value) ? objectToString.call(value) : '';
  26463. return tag == funcTag || tag == genTag;
  26464. }
  26465. /**
  26466. * Checks if `value` is the
  26467. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26468. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26469. *
  26470. * @static
  26471. * @memberOf _
  26472. * @since 0.1.0
  26473. * @category Lang
  26474. * @param {*} value The value to check.
  26475. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26476. * @example
  26477. *
  26478. * _.isObject({});
  26479. * // => true
  26480. *
  26481. * _.isObject([1, 2, 3]);
  26482. * // => true
  26483. *
  26484. * _.isObject(_.noop);
  26485. * // => true
  26486. *
  26487. * _.isObject(null);
  26488. * // => false
  26489. */
  26490. function isObject(value) {
  26491. var type = typeof value;
  26492. return !!value && (type == 'object' || type == 'function');
  26493. }
  26494. /**
  26495. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26496. * and has a `typeof` result of "object".
  26497. *
  26498. * @static
  26499. * @memberOf _
  26500. * @since 4.0.0
  26501. * @category Lang
  26502. * @param {*} value The value to check.
  26503. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26504. * @example
  26505. *
  26506. * _.isObjectLike({});
  26507. * // => true
  26508. *
  26509. * _.isObjectLike([1, 2, 3]);
  26510. * // => true
  26511. *
  26512. * _.isObjectLike(_.noop);
  26513. * // => false
  26514. *
  26515. * _.isObjectLike(null);
  26516. * // => false
  26517. */
  26518. function isObjectLike(value) {
  26519. return !!value && typeof value == 'object';
  26520. }
  26521. /**
  26522. * Checks if `value` is classified as a `Symbol` primitive or object.
  26523. *
  26524. * @static
  26525. * @memberOf _
  26526. * @since 4.0.0
  26527. * @category Lang
  26528. * @param {*} value The value to check.
  26529. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26530. * @example
  26531. *
  26532. * _.isSymbol(Symbol.iterator);
  26533. * // => true
  26534. *
  26535. * _.isSymbol('abc');
  26536. * // => false
  26537. */
  26538. function isSymbol(value) {
  26539. return typeof value == 'symbol' ||
  26540. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26541. }
  26542. /**
  26543. * Converts `value` to a string. An empty string is returned for `null`
  26544. * and `undefined` values. The sign of `-0` is preserved.
  26545. *
  26546. * @static
  26547. * @memberOf _
  26548. * @since 4.0.0
  26549. * @category Lang
  26550. * @param {*} value The value to process.
  26551. * @returns {string} Returns the string.
  26552. * @example
  26553. *
  26554. * _.toString(null);
  26555. * // => ''
  26556. *
  26557. * _.toString(-0);
  26558. * // => '-0'
  26559. *
  26560. * _.toString([1, 2, 3]);
  26561. * // => '1,2,3'
  26562. */
  26563. function toString(value) {
  26564. return value == null ? '' : baseToString(value);
  26565. }
  26566. /**
  26567. * Gets the value at `path` of `object`. If the resolved value is
  26568. * `undefined`, the `defaultValue` is returned in its place.
  26569. *
  26570. * @static
  26571. * @memberOf _
  26572. * @since 3.7.0
  26573. * @category Object
  26574. * @param {Object} object The object to query.
  26575. * @param {Array|string} path The path of the property to get.
  26576. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26577. * @returns {*} Returns the resolved value.
  26578. * @example
  26579. *
  26580. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26581. *
  26582. * _.get(object, 'a[0].b.c');
  26583. * // => 3
  26584. *
  26585. * _.get(object, ['a', '0', 'b', 'c']);
  26586. * // => 3
  26587. *
  26588. * _.get(object, 'a.b.c', 'default');
  26589. * // => 'default'
  26590. */
  26591. function get(object, path, defaultValue) {
  26592. var result = object == null ? undefined : baseGet(object, path);
  26593. return result === undefined ? defaultValue : result;
  26594. }
  26595. module.exports = get;
  26596. /***/ }),
  26597. /***/ 855:
  26598. /***/ (function(module, __unusedexports, __webpack_require__) {
  26599. module.exports = registerPlugin;
  26600. const factory = __webpack_require__(47);
  26601. function registerPlugin(plugins, pluginFunction) {
  26602. return factory(
  26603. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26604. );
  26605. }
  26606. /***/ }),
  26607. /***/ 856:
  26608. /***/ (function(module, __unusedexports, __webpack_require__) {
  26609. module.exports = __webpack_require__(141);
  26610. /***/ }),
  26611. /***/ 863:
  26612. /***/ (function(module, __unusedexports, __webpack_require__) {
  26613. module.exports = authenticationBeforeRequest;
  26614. const btoa = __webpack_require__(675);
  26615. const withAuthorizationPrefix = __webpack_require__(143);
  26616. function authenticationBeforeRequest(state, options) {
  26617. if (typeof state.auth === "string") {
  26618. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26619. return;
  26620. }
  26621. if (state.auth.username) {
  26622. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26623. options.headers.authorization = `Basic ${hash}`;
  26624. if (state.otp) {
  26625. options.headers["x-github-otp"] = state.otp;
  26626. }
  26627. return;
  26628. }
  26629. if (state.auth.clientId) {
  26630. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26631. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26632. // URL though: `/applications/:client_id/tokens/:access_token`.
  26633. //
  26634. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26635. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26636. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26637. //
  26638. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26639. // as well as "/applications/123/tokens/token456"
  26640. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26641. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26642. options.headers.authorization = `Basic ${hash}`;
  26643. return;
  26644. }
  26645. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26646. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26647. return;
  26648. }
  26649. return Promise.resolve()
  26650. .then(() => {
  26651. return state.auth();
  26652. })
  26653. .then(authorization => {
  26654. options.headers.authorization = withAuthorizationPrefix(authorization);
  26655. });
  26656. }
  26657. /***/ }),
  26658. /***/ 866:
  26659. /***/ (function(module, __unusedexports, __webpack_require__) {
  26660. "use strict";
  26661. var shebangRegex = __webpack_require__(816);
  26662. module.exports = function (str) {
  26663. var match = str.match(shebangRegex);
  26664. if (!match) {
  26665. return null;
  26666. }
  26667. var arr = match[0].replace(/#! ?/, '').split(' ');
  26668. var bin = arr[0].split('/').pop();
  26669. var arg = arr[1];
  26670. return (bin === 'env' ?
  26671. arg :
  26672. bin + (arg ? ' ' + arg : '')
  26673. );
  26674. };
  26675. /***/ }),
  26676. /***/ 874:
  26677. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26678. "use strict";
  26679. // Copyright (c) Microsoft. All rights reserved.
  26680. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26681. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26682. return new (P || (P = Promise))(function (resolve, reject) {
  26683. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26684. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26685. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26686. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26687. });
  26688. };
  26689. Object.defineProperty(exports, "__esModule", { value: true });
  26690. const url = __webpack_require__(835);
  26691. const http = __webpack_require__(605);
  26692. const https = __webpack_require__(34);
  26693. let fs;
  26694. let tunnel;
  26695. var HttpCodes;
  26696. (function (HttpCodes) {
  26697. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26698. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26699. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26700. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26701. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26702. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26703. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26704. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26705. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26706. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26707. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26708. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26709. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26710. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26711. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26712. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26713. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26714. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26715. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26716. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26717. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26718. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26719. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26720. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26721. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26722. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26723. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26724. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26725. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26726. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26727. const ExponentialBackoffCeiling = 10;
  26728. const ExponentialBackoffTimeSlice = 5;
  26729. class HttpClientResponse {
  26730. constructor(message) {
  26731. this.message = message;
  26732. }
  26733. readBody() {
  26734. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26735. let output = '';
  26736. this.message.on('data', (chunk) => {
  26737. output += chunk;
  26738. });
  26739. this.message.on('end', () => {
  26740. resolve(output);
  26741. });
  26742. }));
  26743. }
  26744. }
  26745. exports.HttpClientResponse = HttpClientResponse;
  26746. function isHttps(requestUrl) {
  26747. let parsedUrl = url.parse(requestUrl);
  26748. return parsedUrl.protocol === 'https:';
  26749. }
  26750. exports.isHttps = isHttps;
  26751. var EnvironmentVariables;
  26752. (function (EnvironmentVariables) {
  26753. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26754. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26755. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26756. class HttpClient {
  26757. constructor(userAgent, handlers, requestOptions) {
  26758. this._ignoreSslError = false;
  26759. this._allowRedirects = true;
  26760. this._maxRedirects = 50;
  26761. this._allowRetries = false;
  26762. this._maxRetries = 1;
  26763. this._keepAlive = false;
  26764. this._disposed = false;
  26765. this.userAgent = userAgent;
  26766. this.handlers = handlers || [];
  26767. this.requestOptions = requestOptions;
  26768. if (requestOptions) {
  26769. if (requestOptions.ignoreSslError != null) {
  26770. this._ignoreSslError = requestOptions.ignoreSslError;
  26771. }
  26772. this._socketTimeout = requestOptions.socketTimeout;
  26773. this._httpProxy = requestOptions.proxy;
  26774. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26775. this._httpProxyBypassHosts = [];
  26776. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26777. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26778. });
  26779. }
  26780. this._certConfig = requestOptions.cert;
  26781. if (this._certConfig) {
  26782. // If using cert, need fs
  26783. fs = __webpack_require__(747);
  26784. // cache the cert content into memory, so we don't have to read it from disk every time
  26785. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26786. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26787. }
  26788. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26789. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26790. }
  26791. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26792. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26793. }
  26794. }
  26795. if (requestOptions.allowRedirects != null) {
  26796. this._allowRedirects = requestOptions.allowRedirects;
  26797. }
  26798. if (requestOptions.maxRedirects != null) {
  26799. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26800. }
  26801. if (requestOptions.keepAlive != null) {
  26802. this._keepAlive = requestOptions.keepAlive;
  26803. }
  26804. if (requestOptions.allowRetries != null) {
  26805. this._allowRetries = requestOptions.allowRetries;
  26806. }
  26807. if (requestOptions.maxRetries != null) {
  26808. this._maxRetries = requestOptions.maxRetries;
  26809. }
  26810. }
  26811. }
  26812. options(requestUrl, additionalHeaders) {
  26813. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26814. }
  26815. get(requestUrl, additionalHeaders) {
  26816. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26817. }
  26818. del(requestUrl, additionalHeaders) {
  26819. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26820. }
  26821. post(requestUrl, data, additionalHeaders) {
  26822. return this.request('POST', requestUrl, data, additionalHeaders || {});
  26823. }
  26824. patch(requestUrl, data, additionalHeaders) {
  26825. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  26826. }
  26827. put(requestUrl, data, additionalHeaders) {
  26828. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  26829. }
  26830. head(requestUrl, additionalHeaders) {
  26831. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  26832. }
  26833. sendStream(verb, requestUrl, stream, additionalHeaders) {
  26834. return this.request(verb, requestUrl, stream, additionalHeaders);
  26835. }
  26836. /**
  26837. * Makes a raw http request.
  26838. * All other methods such as get, post, patch, and request ultimately call this.
  26839. * Prefer get, del, post and patch
  26840. */
  26841. request(verb, requestUrl, data, headers) {
  26842. return __awaiter(this, void 0, void 0, function* () {
  26843. if (this._disposed) {
  26844. throw new Error("Client has already been disposed.");
  26845. }
  26846. let info = this._prepareRequest(verb, requestUrl, headers);
  26847. // Only perform retries on reads since writes may not be idempotent.
  26848. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  26849. let numTries = 0;
  26850. let response;
  26851. while (numTries < maxTries) {
  26852. response = yield this.requestRaw(info, data);
  26853. // Check if it's an authentication challenge
  26854. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  26855. let authenticationHandler;
  26856. for (let i = 0; i < this.handlers.length; i++) {
  26857. if (this.handlers[i].canHandleAuthentication(response)) {
  26858. authenticationHandler = this.handlers[i];
  26859. break;
  26860. }
  26861. }
  26862. if (authenticationHandler) {
  26863. return authenticationHandler.handleAuthentication(this, info, data);
  26864. }
  26865. else {
  26866. // We have received an unauthorized response but have no handlers to handle it.
  26867. // Let the response return to the caller.
  26868. return response;
  26869. }
  26870. }
  26871. let redirectsRemaining = this._maxRedirects;
  26872. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  26873. && this._allowRedirects
  26874. && redirectsRemaining > 0) {
  26875. const redirectUrl = response.message.headers["location"];
  26876. if (!redirectUrl) {
  26877. // if there's no location to redirect to, we won't
  26878. break;
  26879. }
  26880. // we need to finish reading the response before reassigning response
  26881. // which will leak the open socket.
  26882. yield response.readBody();
  26883. // let's make the request with the new redirectUrl
  26884. info = this._prepareRequest(verb, redirectUrl, headers);
  26885. response = yield this.requestRaw(info, data);
  26886. redirectsRemaining--;
  26887. }
  26888. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  26889. // If not a retry code, return immediately instead of retrying
  26890. return response;
  26891. }
  26892. numTries += 1;
  26893. if (numTries < maxTries) {
  26894. yield response.readBody();
  26895. yield this._performExponentialBackoff(numTries);
  26896. }
  26897. }
  26898. return response;
  26899. });
  26900. }
  26901. /**
  26902. * Needs to be called if keepAlive is set to true in request options.
  26903. */
  26904. dispose() {
  26905. if (this._agent) {
  26906. this._agent.destroy();
  26907. }
  26908. this._disposed = true;
  26909. }
  26910. /**
  26911. * Raw request.
  26912. * @param info
  26913. * @param data
  26914. */
  26915. requestRaw(info, data) {
  26916. return new Promise((resolve, reject) => {
  26917. let callbackForResult = function (err, res) {
  26918. if (err) {
  26919. reject(err);
  26920. }
  26921. resolve(res);
  26922. };
  26923. this.requestRawWithCallback(info, data, callbackForResult);
  26924. });
  26925. }
  26926. /**
  26927. * Raw request with callback.
  26928. * @param info
  26929. * @param data
  26930. * @param onResult
  26931. */
  26932. requestRawWithCallback(info, data, onResult) {
  26933. let socket;
  26934. let isDataString = typeof (data) === 'string';
  26935. if (typeof (data) === 'string') {
  26936. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  26937. }
  26938. let callbackCalled = false;
  26939. let handleResult = (err, res) => {
  26940. if (!callbackCalled) {
  26941. callbackCalled = true;
  26942. onResult(err, res);
  26943. }
  26944. };
  26945. let req = info.httpModule.request(info.options, (msg) => {
  26946. let res = new HttpClientResponse(msg);
  26947. handleResult(null, res);
  26948. });
  26949. req.on('socket', (sock) => {
  26950. socket = sock;
  26951. });
  26952. // If we ever get disconnected, we want the socket to timeout eventually
  26953. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  26954. if (socket) {
  26955. socket.end();
  26956. }
  26957. handleResult(new Error('Request timeout: ' + info.options.path), null);
  26958. });
  26959. req.on('error', function (err) {
  26960. // err has statusCode property
  26961. // res should have headers
  26962. handleResult(err, null);
  26963. });
  26964. if (data && typeof (data) === 'string') {
  26965. req.write(data, 'utf8');
  26966. }
  26967. if (data && typeof (data) !== 'string') {
  26968. data.on('close', function () {
  26969. req.end();
  26970. });
  26971. data.pipe(req);
  26972. }
  26973. else {
  26974. req.end();
  26975. }
  26976. }
  26977. _prepareRequest(method, requestUrl, headers) {
  26978. const info = {};
  26979. info.parsedUrl = url.parse(requestUrl);
  26980. const usingSsl = info.parsedUrl.protocol === 'https:';
  26981. info.httpModule = usingSsl ? https : http;
  26982. const defaultPort = usingSsl ? 443 : 80;
  26983. info.options = {};
  26984. info.options.host = info.parsedUrl.hostname;
  26985. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  26986. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  26987. info.options.method = method;
  26988. info.options.headers = this._mergeHeaders(headers);
  26989. info.options.headers["user-agent"] = this.userAgent;
  26990. info.options.agent = this._getAgent(requestUrl);
  26991. // gives handlers an opportunity to participate
  26992. if (this.handlers && !this._isPresigned(requestUrl)) {
  26993. this.handlers.forEach((handler) => {
  26994. handler.prepareRequest(info.options);
  26995. });
  26996. }
  26997. return info;
  26998. }
  26999. _isPresigned(requestUrl) {
  27000. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27001. const patterns = this.requestOptions.presignedUrlPatterns;
  27002. for (let i = 0; i < patterns.length; i++) {
  27003. if (requestUrl.match(patterns[i])) {
  27004. return true;
  27005. }
  27006. }
  27007. }
  27008. return false;
  27009. }
  27010. _mergeHeaders(headers) {
  27011. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27012. if (this.requestOptions && this.requestOptions.headers) {
  27013. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27014. }
  27015. return lowercaseKeys(headers || {});
  27016. }
  27017. _getAgent(requestUrl) {
  27018. let agent;
  27019. let proxy = this._getProxy(requestUrl);
  27020. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27021. if (this._keepAlive && useProxy) {
  27022. agent = this._proxyAgent;
  27023. }
  27024. if (this._keepAlive && !useProxy) {
  27025. agent = this._agent;
  27026. }
  27027. // if agent is already assigned use that agent.
  27028. if (!!agent) {
  27029. return agent;
  27030. }
  27031. let parsedUrl = url.parse(requestUrl);
  27032. const usingSsl = parsedUrl.protocol === 'https:';
  27033. let maxSockets = 100;
  27034. if (!!this.requestOptions) {
  27035. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27036. }
  27037. if (useProxy) {
  27038. // If using proxy, need tunnel
  27039. if (!tunnel) {
  27040. tunnel = __webpack_require__(856);
  27041. }
  27042. const agentOptions = {
  27043. maxSockets: maxSockets,
  27044. keepAlive: this._keepAlive,
  27045. proxy: {
  27046. proxyAuth: proxy.proxyAuth,
  27047. host: proxy.proxyUrl.hostname,
  27048. port: proxy.proxyUrl.port
  27049. },
  27050. };
  27051. let tunnelAgent;
  27052. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27053. if (usingSsl) {
  27054. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27055. }
  27056. else {
  27057. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27058. }
  27059. agent = tunnelAgent(agentOptions);
  27060. this._proxyAgent = agent;
  27061. }
  27062. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27063. if (this._keepAlive && !agent) {
  27064. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27065. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27066. this._agent = agent;
  27067. }
  27068. // if not using private agent and tunnel agent isn't setup then use global agent
  27069. if (!agent) {
  27070. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27071. }
  27072. if (usingSsl && this._ignoreSslError) {
  27073. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27074. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27075. // we have to cast it to any and change it directly
  27076. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27077. }
  27078. if (usingSsl && this._certConfig) {
  27079. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27080. }
  27081. return agent;
  27082. }
  27083. _getProxy(requestUrl) {
  27084. const parsedUrl = url.parse(requestUrl);
  27085. let usingSsl = parsedUrl.protocol === 'https:';
  27086. let proxyConfig = this._httpProxy;
  27087. // fallback to http_proxy and https_proxy env
  27088. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27089. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27090. if (!proxyConfig) {
  27091. if (https_proxy && usingSsl) {
  27092. proxyConfig = {
  27093. proxyUrl: https_proxy
  27094. };
  27095. }
  27096. else if (http_proxy) {
  27097. proxyConfig = {
  27098. proxyUrl: http_proxy
  27099. };
  27100. }
  27101. }
  27102. let proxyUrl;
  27103. let proxyAuth;
  27104. if (proxyConfig) {
  27105. if (proxyConfig.proxyUrl.length > 0) {
  27106. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27107. }
  27108. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27109. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27110. }
  27111. }
  27112. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27113. }
  27114. _isBypassProxy(requestUrl) {
  27115. if (!this._httpProxyBypassHosts) {
  27116. return false;
  27117. }
  27118. let bypass = false;
  27119. this._httpProxyBypassHosts.forEach(bypassHost => {
  27120. if (bypassHost.test(requestUrl)) {
  27121. bypass = true;
  27122. }
  27123. });
  27124. return bypass;
  27125. }
  27126. _performExponentialBackoff(retryNumber) {
  27127. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27128. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27129. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27130. }
  27131. }
  27132. exports.HttpClient = HttpClient;
  27133. /***/ }),
  27134. /***/ 881:
  27135. /***/ (function(module) {
  27136. "use strict";
  27137. const isWin = process.platform === 'win32';
  27138. function notFoundError(original, syscall) {
  27139. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27140. code: 'ENOENT',
  27141. errno: 'ENOENT',
  27142. syscall: `${syscall} ${original.command}`,
  27143. path: original.command,
  27144. spawnargs: original.args,
  27145. });
  27146. }
  27147. function hookChildProcess(cp, parsed) {
  27148. if (!isWin) {
  27149. return;
  27150. }
  27151. const originalEmit = cp.emit;
  27152. cp.emit = function (name, arg1) {
  27153. // If emitting "exit" event and exit code is 1, we need to check if
  27154. // the command exists and emit an "error" instead
  27155. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27156. if (name === 'exit') {
  27157. const err = verifyENOENT(arg1, parsed, 'spawn');
  27158. if (err) {
  27159. return originalEmit.call(cp, 'error', err);
  27160. }
  27161. }
  27162. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27163. };
  27164. }
  27165. function verifyENOENT(status, parsed) {
  27166. if (isWin && status === 1 && !parsed.file) {
  27167. return notFoundError(parsed.original, 'spawn');
  27168. }
  27169. return null;
  27170. }
  27171. function verifyENOENTSync(status, parsed) {
  27172. if (isWin && status === 1 && !parsed.file) {
  27173. return notFoundError(parsed.original, 'spawnSync');
  27174. }
  27175. return null;
  27176. }
  27177. module.exports = {
  27178. hookChildProcess,
  27179. verifyENOENT,
  27180. verifyENOENTSync,
  27181. notFoundError,
  27182. };
  27183. /***/ }),
  27184. /***/ 883:
  27185. /***/ (function(module) {
  27186. /**
  27187. * lodash (Custom Build) <https://lodash.com/>
  27188. * Build: `lodash modularize exports="npm" -o ./`
  27189. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27190. * Released under MIT license <https://lodash.com/license>
  27191. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27192. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27193. */
  27194. /** Used as the `TypeError` message for "Functions" methods. */
  27195. var FUNC_ERROR_TEXT = 'Expected a function';
  27196. /** Used to stand-in for `undefined` hash values. */
  27197. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27198. /** Used as references for various `Number` constants. */
  27199. var INFINITY = 1 / 0,
  27200. MAX_SAFE_INTEGER = 9007199254740991;
  27201. /** `Object#toString` result references. */
  27202. var funcTag = '[object Function]',
  27203. genTag = '[object GeneratorFunction]',
  27204. symbolTag = '[object Symbol]';
  27205. /** Used to match property names within property paths. */
  27206. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27207. reIsPlainProp = /^\w*$/,
  27208. reLeadingDot = /^\./,
  27209. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27210. /**
  27211. * Used to match `RegExp`
  27212. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27213. */
  27214. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27215. /** Used to match backslashes in property paths. */
  27216. var reEscapeChar = /\\(\\)?/g;
  27217. /** Used to detect host constructors (Safari). */
  27218. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27219. /** Used to detect unsigned integer values. */
  27220. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27221. /** Detect free variable `global` from Node.js. */
  27222. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27223. /** Detect free variable `self`. */
  27224. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27225. /** Used as a reference to the global object. */
  27226. var root = freeGlobal || freeSelf || Function('return this')();
  27227. /**
  27228. * Gets the value at `key` of `object`.
  27229. *
  27230. * @private
  27231. * @param {Object} [object] The object to query.
  27232. * @param {string} key The key of the property to get.
  27233. * @returns {*} Returns the property value.
  27234. */
  27235. function getValue(object, key) {
  27236. return object == null ? undefined : object[key];
  27237. }
  27238. /**
  27239. * Checks if `value` is a host object in IE < 9.
  27240. *
  27241. * @private
  27242. * @param {*} value The value to check.
  27243. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27244. */
  27245. function isHostObject(value) {
  27246. // Many host objects are `Object` objects that can coerce to strings
  27247. // despite having improperly defined `toString` methods.
  27248. var result = false;
  27249. if (value != null && typeof value.toString != 'function') {
  27250. try {
  27251. result = !!(value + '');
  27252. } catch (e) {}
  27253. }
  27254. return result;
  27255. }
  27256. /** Used for built-in method references. */
  27257. var arrayProto = Array.prototype,
  27258. funcProto = Function.prototype,
  27259. objectProto = Object.prototype;
  27260. /** Used to detect overreaching core-js shims. */
  27261. var coreJsData = root['__core-js_shared__'];
  27262. /** Used to detect methods masquerading as native. */
  27263. var maskSrcKey = (function() {
  27264. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27265. return uid ? ('Symbol(src)_1.' + uid) : '';
  27266. }());
  27267. /** Used to resolve the decompiled source of functions. */
  27268. var funcToString = funcProto.toString;
  27269. /** Used to check objects for own properties. */
  27270. var hasOwnProperty = objectProto.hasOwnProperty;
  27271. /**
  27272. * Used to resolve the
  27273. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27274. * of values.
  27275. */
  27276. var objectToString = objectProto.toString;
  27277. /** Used to detect if a method is native. */
  27278. var reIsNative = RegExp('^' +
  27279. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27280. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27281. );
  27282. /** Built-in value references. */
  27283. var Symbol = root.Symbol,
  27284. splice = arrayProto.splice;
  27285. /* Built-in method references that are verified to be native. */
  27286. var Map = getNative(root, 'Map'),
  27287. nativeCreate = getNative(Object, 'create');
  27288. /** Used to convert symbols to primitives and strings. */
  27289. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27290. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27291. /**
  27292. * Creates a hash object.
  27293. *
  27294. * @private
  27295. * @constructor
  27296. * @param {Array} [entries] The key-value pairs to cache.
  27297. */
  27298. function Hash(entries) {
  27299. var index = -1,
  27300. length = entries ? entries.length : 0;
  27301. this.clear();
  27302. while (++index < length) {
  27303. var entry = entries[index];
  27304. this.set(entry[0], entry[1]);
  27305. }
  27306. }
  27307. /**
  27308. * Removes all key-value entries from the hash.
  27309. *
  27310. * @private
  27311. * @name clear
  27312. * @memberOf Hash
  27313. */
  27314. function hashClear() {
  27315. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27316. }
  27317. /**
  27318. * Removes `key` and its value from the hash.
  27319. *
  27320. * @private
  27321. * @name delete
  27322. * @memberOf Hash
  27323. * @param {Object} hash The hash to modify.
  27324. * @param {string} key The key of the value to remove.
  27325. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27326. */
  27327. function hashDelete(key) {
  27328. return this.has(key) && delete this.__data__[key];
  27329. }
  27330. /**
  27331. * Gets the hash value for `key`.
  27332. *
  27333. * @private
  27334. * @name get
  27335. * @memberOf Hash
  27336. * @param {string} key The key of the value to get.
  27337. * @returns {*} Returns the entry value.
  27338. */
  27339. function hashGet(key) {
  27340. var data = this.__data__;
  27341. if (nativeCreate) {
  27342. var result = data[key];
  27343. return result === HASH_UNDEFINED ? undefined : result;
  27344. }
  27345. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27346. }
  27347. /**
  27348. * Checks if a hash value for `key` exists.
  27349. *
  27350. * @private
  27351. * @name has
  27352. * @memberOf Hash
  27353. * @param {string} key The key of the entry to check.
  27354. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27355. */
  27356. function hashHas(key) {
  27357. var data = this.__data__;
  27358. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27359. }
  27360. /**
  27361. * Sets the hash `key` to `value`.
  27362. *
  27363. * @private
  27364. * @name set
  27365. * @memberOf Hash
  27366. * @param {string} key The key of the value to set.
  27367. * @param {*} value The value to set.
  27368. * @returns {Object} Returns the hash instance.
  27369. */
  27370. function hashSet(key, value) {
  27371. var data = this.__data__;
  27372. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27373. return this;
  27374. }
  27375. // Add methods to `Hash`.
  27376. Hash.prototype.clear = hashClear;
  27377. Hash.prototype['delete'] = hashDelete;
  27378. Hash.prototype.get = hashGet;
  27379. Hash.prototype.has = hashHas;
  27380. Hash.prototype.set = hashSet;
  27381. /**
  27382. * Creates an list cache object.
  27383. *
  27384. * @private
  27385. * @constructor
  27386. * @param {Array} [entries] The key-value pairs to cache.
  27387. */
  27388. function ListCache(entries) {
  27389. var index = -1,
  27390. length = entries ? entries.length : 0;
  27391. this.clear();
  27392. while (++index < length) {
  27393. var entry = entries[index];
  27394. this.set(entry[0], entry[1]);
  27395. }
  27396. }
  27397. /**
  27398. * Removes all key-value entries from the list cache.
  27399. *
  27400. * @private
  27401. * @name clear
  27402. * @memberOf ListCache
  27403. */
  27404. function listCacheClear() {
  27405. this.__data__ = [];
  27406. }
  27407. /**
  27408. * Removes `key` and its value from the list cache.
  27409. *
  27410. * @private
  27411. * @name delete
  27412. * @memberOf ListCache
  27413. * @param {string} key The key of the value to remove.
  27414. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27415. */
  27416. function listCacheDelete(key) {
  27417. var data = this.__data__,
  27418. index = assocIndexOf(data, key);
  27419. if (index < 0) {
  27420. return false;
  27421. }
  27422. var lastIndex = data.length - 1;
  27423. if (index == lastIndex) {
  27424. data.pop();
  27425. } else {
  27426. splice.call(data, index, 1);
  27427. }
  27428. return true;
  27429. }
  27430. /**
  27431. * Gets the list cache value for `key`.
  27432. *
  27433. * @private
  27434. * @name get
  27435. * @memberOf ListCache
  27436. * @param {string} key The key of the value to get.
  27437. * @returns {*} Returns the entry value.
  27438. */
  27439. function listCacheGet(key) {
  27440. var data = this.__data__,
  27441. index = assocIndexOf(data, key);
  27442. return index < 0 ? undefined : data[index][1];
  27443. }
  27444. /**
  27445. * Checks if a list cache value for `key` exists.
  27446. *
  27447. * @private
  27448. * @name has
  27449. * @memberOf ListCache
  27450. * @param {string} key The key of the entry to check.
  27451. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27452. */
  27453. function listCacheHas(key) {
  27454. return assocIndexOf(this.__data__, key) > -1;
  27455. }
  27456. /**
  27457. * Sets the list cache `key` to `value`.
  27458. *
  27459. * @private
  27460. * @name set
  27461. * @memberOf ListCache
  27462. * @param {string} key The key of the value to set.
  27463. * @param {*} value The value to set.
  27464. * @returns {Object} Returns the list cache instance.
  27465. */
  27466. function listCacheSet(key, value) {
  27467. var data = this.__data__,
  27468. index = assocIndexOf(data, key);
  27469. if (index < 0) {
  27470. data.push([key, value]);
  27471. } else {
  27472. data[index][1] = value;
  27473. }
  27474. return this;
  27475. }
  27476. // Add methods to `ListCache`.
  27477. ListCache.prototype.clear = listCacheClear;
  27478. ListCache.prototype['delete'] = listCacheDelete;
  27479. ListCache.prototype.get = listCacheGet;
  27480. ListCache.prototype.has = listCacheHas;
  27481. ListCache.prototype.set = listCacheSet;
  27482. /**
  27483. * Creates a map cache object to store key-value pairs.
  27484. *
  27485. * @private
  27486. * @constructor
  27487. * @param {Array} [entries] The key-value pairs to cache.
  27488. */
  27489. function MapCache(entries) {
  27490. var index = -1,
  27491. length = entries ? entries.length : 0;
  27492. this.clear();
  27493. while (++index < length) {
  27494. var entry = entries[index];
  27495. this.set(entry[0], entry[1]);
  27496. }
  27497. }
  27498. /**
  27499. * Removes all key-value entries from the map.
  27500. *
  27501. * @private
  27502. * @name clear
  27503. * @memberOf MapCache
  27504. */
  27505. function mapCacheClear() {
  27506. this.__data__ = {
  27507. 'hash': new Hash,
  27508. 'map': new (Map || ListCache),
  27509. 'string': new Hash
  27510. };
  27511. }
  27512. /**
  27513. * Removes `key` and its value from the map.
  27514. *
  27515. * @private
  27516. * @name delete
  27517. * @memberOf MapCache
  27518. * @param {string} key The key of the value to remove.
  27519. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27520. */
  27521. function mapCacheDelete(key) {
  27522. return getMapData(this, key)['delete'](key);
  27523. }
  27524. /**
  27525. * Gets the map value for `key`.
  27526. *
  27527. * @private
  27528. * @name get
  27529. * @memberOf MapCache
  27530. * @param {string} key The key of the value to get.
  27531. * @returns {*} Returns the entry value.
  27532. */
  27533. function mapCacheGet(key) {
  27534. return getMapData(this, key).get(key);
  27535. }
  27536. /**
  27537. * Checks if a map value for `key` exists.
  27538. *
  27539. * @private
  27540. * @name has
  27541. * @memberOf MapCache
  27542. * @param {string} key The key of the entry to check.
  27543. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27544. */
  27545. function mapCacheHas(key) {
  27546. return getMapData(this, key).has(key);
  27547. }
  27548. /**
  27549. * Sets the map `key` to `value`.
  27550. *
  27551. * @private
  27552. * @name set
  27553. * @memberOf MapCache
  27554. * @param {string} key The key of the value to set.
  27555. * @param {*} value The value to set.
  27556. * @returns {Object} Returns the map cache instance.
  27557. */
  27558. function mapCacheSet(key, value) {
  27559. getMapData(this, key).set(key, value);
  27560. return this;
  27561. }
  27562. // Add methods to `MapCache`.
  27563. MapCache.prototype.clear = mapCacheClear;
  27564. MapCache.prototype['delete'] = mapCacheDelete;
  27565. MapCache.prototype.get = mapCacheGet;
  27566. MapCache.prototype.has = mapCacheHas;
  27567. MapCache.prototype.set = mapCacheSet;
  27568. /**
  27569. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27570. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27571. * for equality comparisons.
  27572. *
  27573. * @private
  27574. * @param {Object} object The object to modify.
  27575. * @param {string} key The key of the property to assign.
  27576. * @param {*} value The value to assign.
  27577. */
  27578. function assignValue(object, key, value) {
  27579. var objValue = object[key];
  27580. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27581. (value === undefined && !(key in object))) {
  27582. object[key] = value;
  27583. }
  27584. }
  27585. /**
  27586. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27587. *
  27588. * @private
  27589. * @param {Array} array The array to inspect.
  27590. * @param {*} key The key to search for.
  27591. * @returns {number} Returns the index of the matched value, else `-1`.
  27592. */
  27593. function assocIndexOf(array, key) {
  27594. var length = array.length;
  27595. while (length--) {
  27596. if (eq(array[length][0], key)) {
  27597. return length;
  27598. }
  27599. }
  27600. return -1;
  27601. }
  27602. /**
  27603. * The base implementation of `_.isNative` without bad shim checks.
  27604. *
  27605. * @private
  27606. * @param {*} value The value to check.
  27607. * @returns {boolean} Returns `true` if `value` is a native function,
  27608. * else `false`.
  27609. */
  27610. function baseIsNative(value) {
  27611. if (!isObject(value) || isMasked(value)) {
  27612. return false;
  27613. }
  27614. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27615. return pattern.test(toSource(value));
  27616. }
  27617. /**
  27618. * The base implementation of `_.set`.
  27619. *
  27620. * @private
  27621. * @param {Object} object The object to modify.
  27622. * @param {Array|string} path The path of the property to set.
  27623. * @param {*} value The value to set.
  27624. * @param {Function} [customizer] The function to customize path creation.
  27625. * @returns {Object} Returns `object`.
  27626. */
  27627. function baseSet(object, path, value, customizer) {
  27628. if (!isObject(object)) {
  27629. return object;
  27630. }
  27631. path = isKey(path, object) ? [path] : castPath(path);
  27632. var index = -1,
  27633. length = path.length,
  27634. lastIndex = length - 1,
  27635. nested = object;
  27636. while (nested != null && ++index < length) {
  27637. var key = toKey(path[index]),
  27638. newValue = value;
  27639. if (index != lastIndex) {
  27640. var objValue = nested[key];
  27641. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27642. if (newValue === undefined) {
  27643. newValue = isObject(objValue)
  27644. ? objValue
  27645. : (isIndex(path[index + 1]) ? [] : {});
  27646. }
  27647. }
  27648. assignValue(nested, key, newValue);
  27649. nested = nested[key];
  27650. }
  27651. return object;
  27652. }
  27653. /**
  27654. * The base implementation of `_.toString` which doesn't convert nullish
  27655. * values to empty strings.
  27656. *
  27657. * @private
  27658. * @param {*} value The value to process.
  27659. * @returns {string} Returns the string.
  27660. */
  27661. function baseToString(value) {
  27662. // Exit early for strings to avoid a performance hit in some environments.
  27663. if (typeof value == 'string') {
  27664. return value;
  27665. }
  27666. if (isSymbol(value)) {
  27667. return symbolToString ? symbolToString.call(value) : '';
  27668. }
  27669. var result = (value + '');
  27670. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27671. }
  27672. /**
  27673. * Casts `value` to a path array if it's not one.
  27674. *
  27675. * @private
  27676. * @param {*} value The value to inspect.
  27677. * @returns {Array} Returns the cast property path array.
  27678. */
  27679. function castPath(value) {
  27680. return isArray(value) ? value : stringToPath(value);
  27681. }
  27682. /**
  27683. * Gets the data for `map`.
  27684. *
  27685. * @private
  27686. * @param {Object} map The map to query.
  27687. * @param {string} key The reference key.
  27688. * @returns {*} Returns the map data.
  27689. */
  27690. function getMapData(map, key) {
  27691. var data = map.__data__;
  27692. return isKeyable(key)
  27693. ? data[typeof key == 'string' ? 'string' : 'hash']
  27694. : data.map;
  27695. }
  27696. /**
  27697. * Gets the native function at `key` of `object`.
  27698. *
  27699. * @private
  27700. * @param {Object} object The object to query.
  27701. * @param {string} key The key of the method to get.
  27702. * @returns {*} Returns the function if it's native, else `undefined`.
  27703. */
  27704. function getNative(object, key) {
  27705. var value = getValue(object, key);
  27706. return baseIsNative(value) ? value : undefined;
  27707. }
  27708. /**
  27709. * Checks if `value` is a valid array-like index.
  27710. *
  27711. * @private
  27712. * @param {*} value The value to check.
  27713. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27714. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27715. */
  27716. function isIndex(value, length) {
  27717. length = length == null ? MAX_SAFE_INTEGER : length;
  27718. return !!length &&
  27719. (typeof value == 'number' || reIsUint.test(value)) &&
  27720. (value > -1 && value % 1 == 0 && value < length);
  27721. }
  27722. /**
  27723. * Checks if `value` is a property name and not a property path.
  27724. *
  27725. * @private
  27726. * @param {*} value The value to check.
  27727. * @param {Object} [object] The object to query keys on.
  27728. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27729. */
  27730. function isKey(value, object) {
  27731. if (isArray(value)) {
  27732. return false;
  27733. }
  27734. var type = typeof value;
  27735. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27736. value == null || isSymbol(value)) {
  27737. return true;
  27738. }
  27739. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27740. (object != null && value in Object(object));
  27741. }
  27742. /**
  27743. * Checks if `value` is suitable for use as unique object key.
  27744. *
  27745. * @private
  27746. * @param {*} value The value to check.
  27747. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27748. */
  27749. function isKeyable(value) {
  27750. var type = typeof value;
  27751. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27752. ? (value !== '__proto__')
  27753. : (value === null);
  27754. }
  27755. /**
  27756. * Checks if `func` has its source masked.
  27757. *
  27758. * @private
  27759. * @param {Function} func The function to check.
  27760. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27761. */
  27762. function isMasked(func) {
  27763. return !!maskSrcKey && (maskSrcKey in func);
  27764. }
  27765. /**
  27766. * Converts `string` to a property path array.
  27767. *
  27768. * @private
  27769. * @param {string} string The string to convert.
  27770. * @returns {Array} Returns the property path array.
  27771. */
  27772. var stringToPath = memoize(function(string) {
  27773. string = toString(string);
  27774. var result = [];
  27775. if (reLeadingDot.test(string)) {
  27776. result.push('');
  27777. }
  27778. string.replace(rePropName, function(match, number, quote, string) {
  27779. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27780. });
  27781. return result;
  27782. });
  27783. /**
  27784. * Converts `value` to a string key if it's not a string or symbol.
  27785. *
  27786. * @private
  27787. * @param {*} value The value to inspect.
  27788. * @returns {string|symbol} Returns the key.
  27789. */
  27790. function toKey(value) {
  27791. if (typeof value == 'string' || isSymbol(value)) {
  27792. return value;
  27793. }
  27794. var result = (value + '');
  27795. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27796. }
  27797. /**
  27798. * Converts `func` to its source code.
  27799. *
  27800. * @private
  27801. * @param {Function} func The function to process.
  27802. * @returns {string} Returns the source code.
  27803. */
  27804. function toSource(func) {
  27805. if (func != null) {
  27806. try {
  27807. return funcToString.call(func);
  27808. } catch (e) {}
  27809. try {
  27810. return (func + '');
  27811. } catch (e) {}
  27812. }
  27813. return '';
  27814. }
  27815. /**
  27816. * Creates a function that memoizes the result of `func`. If `resolver` is
  27817. * provided, it determines the cache key for storing the result based on the
  27818. * arguments provided to the memoized function. By default, the first argument
  27819. * provided to the memoized function is used as the map cache key. The `func`
  27820. * is invoked with the `this` binding of the memoized function.
  27821. *
  27822. * **Note:** The cache is exposed as the `cache` property on the memoized
  27823. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  27824. * constructor with one whose instances implement the
  27825. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  27826. * method interface of `delete`, `get`, `has`, and `set`.
  27827. *
  27828. * @static
  27829. * @memberOf _
  27830. * @since 0.1.0
  27831. * @category Function
  27832. * @param {Function} func The function to have its output memoized.
  27833. * @param {Function} [resolver] The function to resolve the cache key.
  27834. * @returns {Function} Returns the new memoized function.
  27835. * @example
  27836. *
  27837. * var object = { 'a': 1, 'b': 2 };
  27838. * var other = { 'c': 3, 'd': 4 };
  27839. *
  27840. * var values = _.memoize(_.values);
  27841. * values(object);
  27842. * // => [1, 2]
  27843. *
  27844. * values(other);
  27845. * // => [3, 4]
  27846. *
  27847. * object.a = 2;
  27848. * values(object);
  27849. * // => [1, 2]
  27850. *
  27851. * // Modify the result cache.
  27852. * values.cache.set(object, ['a', 'b']);
  27853. * values(object);
  27854. * // => ['a', 'b']
  27855. *
  27856. * // Replace `_.memoize.Cache`.
  27857. * _.memoize.Cache = WeakMap;
  27858. */
  27859. function memoize(func, resolver) {
  27860. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  27861. throw new TypeError(FUNC_ERROR_TEXT);
  27862. }
  27863. var memoized = function() {
  27864. var args = arguments,
  27865. key = resolver ? resolver.apply(this, args) : args[0],
  27866. cache = memoized.cache;
  27867. if (cache.has(key)) {
  27868. return cache.get(key);
  27869. }
  27870. var result = func.apply(this, args);
  27871. memoized.cache = cache.set(key, result);
  27872. return result;
  27873. };
  27874. memoized.cache = new (memoize.Cache || MapCache);
  27875. return memoized;
  27876. }
  27877. // Assign cache to `_.memoize`.
  27878. memoize.Cache = MapCache;
  27879. /**
  27880. * Performs a
  27881. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27882. * comparison between two values to determine if they are equivalent.
  27883. *
  27884. * @static
  27885. * @memberOf _
  27886. * @since 4.0.0
  27887. * @category Lang
  27888. * @param {*} value The value to compare.
  27889. * @param {*} other The other value to compare.
  27890. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  27891. * @example
  27892. *
  27893. * var object = { 'a': 1 };
  27894. * var other = { 'a': 1 };
  27895. *
  27896. * _.eq(object, object);
  27897. * // => true
  27898. *
  27899. * _.eq(object, other);
  27900. * // => false
  27901. *
  27902. * _.eq('a', 'a');
  27903. * // => true
  27904. *
  27905. * _.eq('a', Object('a'));
  27906. * // => false
  27907. *
  27908. * _.eq(NaN, NaN);
  27909. * // => true
  27910. */
  27911. function eq(value, other) {
  27912. return value === other || (value !== value && other !== other);
  27913. }
  27914. /**
  27915. * Checks if `value` is classified as an `Array` object.
  27916. *
  27917. * @static
  27918. * @memberOf _
  27919. * @since 0.1.0
  27920. * @category Lang
  27921. * @param {*} value The value to check.
  27922. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  27923. * @example
  27924. *
  27925. * _.isArray([1, 2, 3]);
  27926. * // => true
  27927. *
  27928. * _.isArray(document.body.children);
  27929. * // => false
  27930. *
  27931. * _.isArray('abc');
  27932. * // => false
  27933. *
  27934. * _.isArray(_.noop);
  27935. * // => false
  27936. */
  27937. var isArray = Array.isArray;
  27938. /**
  27939. * Checks if `value` is classified as a `Function` object.
  27940. *
  27941. * @static
  27942. * @memberOf _
  27943. * @since 0.1.0
  27944. * @category Lang
  27945. * @param {*} value The value to check.
  27946. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  27947. * @example
  27948. *
  27949. * _.isFunction(_);
  27950. * // => true
  27951. *
  27952. * _.isFunction(/abc/);
  27953. * // => false
  27954. */
  27955. function isFunction(value) {
  27956. // The use of `Object#toString` avoids issues with the `typeof` operator
  27957. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  27958. var tag = isObject(value) ? objectToString.call(value) : '';
  27959. return tag == funcTag || tag == genTag;
  27960. }
  27961. /**
  27962. * Checks if `value` is the
  27963. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  27964. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  27965. *
  27966. * @static
  27967. * @memberOf _
  27968. * @since 0.1.0
  27969. * @category Lang
  27970. * @param {*} value The value to check.
  27971. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  27972. * @example
  27973. *
  27974. * _.isObject({});
  27975. * // => true
  27976. *
  27977. * _.isObject([1, 2, 3]);
  27978. * // => true
  27979. *
  27980. * _.isObject(_.noop);
  27981. * // => true
  27982. *
  27983. * _.isObject(null);
  27984. * // => false
  27985. */
  27986. function isObject(value) {
  27987. var type = typeof value;
  27988. return !!value && (type == 'object' || type == 'function');
  27989. }
  27990. /**
  27991. * Checks if `value` is object-like. A value is object-like if it's not `null`
  27992. * and has a `typeof` result of "object".
  27993. *
  27994. * @static
  27995. * @memberOf _
  27996. * @since 4.0.0
  27997. * @category Lang
  27998. * @param {*} value The value to check.
  27999. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28000. * @example
  28001. *
  28002. * _.isObjectLike({});
  28003. * // => true
  28004. *
  28005. * _.isObjectLike([1, 2, 3]);
  28006. * // => true
  28007. *
  28008. * _.isObjectLike(_.noop);
  28009. * // => false
  28010. *
  28011. * _.isObjectLike(null);
  28012. * // => false
  28013. */
  28014. function isObjectLike(value) {
  28015. return !!value && typeof value == 'object';
  28016. }
  28017. /**
  28018. * Checks if `value` is classified as a `Symbol` primitive or object.
  28019. *
  28020. * @static
  28021. * @memberOf _
  28022. * @since 4.0.0
  28023. * @category Lang
  28024. * @param {*} value The value to check.
  28025. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28026. * @example
  28027. *
  28028. * _.isSymbol(Symbol.iterator);
  28029. * // => true
  28030. *
  28031. * _.isSymbol('abc');
  28032. * // => false
  28033. */
  28034. function isSymbol(value) {
  28035. return typeof value == 'symbol' ||
  28036. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28037. }
  28038. /**
  28039. * Converts `value` to a string. An empty string is returned for `null`
  28040. * and `undefined` values. The sign of `-0` is preserved.
  28041. *
  28042. * @static
  28043. * @memberOf _
  28044. * @since 4.0.0
  28045. * @category Lang
  28046. * @param {*} value The value to process.
  28047. * @returns {string} Returns the string.
  28048. * @example
  28049. *
  28050. * _.toString(null);
  28051. * // => ''
  28052. *
  28053. * _.toString(-0);
  28054. * // => '-0'
  28055. *
  28056. * _.toString([1, 2, 3]);
  28057. * // => '1,2,3'
  28058. */
  28059. function toString(value) {
  28060. return value == null ? '' : baseToString(value);
  28061. }
  28062. /**
  28063. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28064. * it's created. Arrays are created for missing index properties while objects
  28065. * are created for all other missing properties. Use `_.setWith` to customize
  28066. * `path` creation.
  28067. *
  28068. * **Note:** This method mutates `object`.
  28069. *
  28070. * @static
  28071. * @memberOf _
  28072. * @since 3.7.0
  28073. * @category Object
  28074. * @param {Object} object The object to modify.
  28075. * @param {Array|string} path The path of the property to set.
  28076. * @param {*} value The value to set.
  28077. * @returns {Object} Returns `object`.
  28078. * @example
  28079. *
  28080. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28081. *
  28082. * _.set(object, 'a[0].b.c', 4);
  28083. * console.log(object.a[0].b.c);
  28084. * // => 4
  28085. *
  28086. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28087. * console.log(object.x[0].y.z);
  28088. * // => 5
  28089. */
  28090. function set(object, path, value) {
  28091. return object == null ? object : baseSet(object, path, value);
  28092. }
  28093. module.exports = set;
  28094. /***/ }),
  28095. /***/ 898:
  28096. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28097. "use strict";
  28098. Object.defineProperty(exports, '__esModule', { value: true });
  28099. var request = __webpack_require__(753);
  28100. var universalUserAgent = __webpack_require__(796);
  28101. const VERSION = "4.3.1";
  28102. class GraphqlError extends Error {
  28103. constructor(request, response) {
  28104. const message = response.data.errors[0].message;
  28105. super(message);
  28106. Object.assign(this, response.data);
  28107. this.name = "GraphqlError";
  28108. this.request = request; // Maintains proper stack trace (only available on V8)
  28109. /* istanbul ignore next */
  28110. if (Error.captureStackTrace) {
  28111. Error.captureStackTrace(this, this.constructor);
  28112. }
  28113. }
  28114. }
  28115. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28116. function graphql(request, query, options) {
  28117. options = typeof query === "string" ? options = Object.assign({
  28118. query
  28119. }, options) : options = query;
  28120. const requestOptions = Object.keys(options).reduce((result, key) => {
  28121. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28122. result[key] = options[key];
  28123. return result;
  28124. }
  28125. if (!result.variables) {
  28126. result.variables = {};
  28127. }
  28128. result.variables[key] = options[key];
  28129. return result;
  28130. }, {});
  28131. return request(requestOptions).then(response => {
  28132. if (response.data.errors) {
  28133. throw new GraphqlError(requestOptions, {
  28134. data: response.data
  28135. });
  28136. }
  28137. return response.data.data;
  28138. });
  28139. }
  28140. function withDefaults(request$1, newDefaults) {
  28141. const newRequest = request$1.defaults(newDefaults);
  28142. const newApi = (query, options) => {
  28143. return graphql(newRequest, query, options);
  28144. };
  28145. return Object.assign(newApi, {
  28146. defaults: withDefaults.bind(null, newRequest),
  28147. endpoint: request.request.endpoint
  28148. });
  28149. }
  28150. const graphql$1 = withDefaults(request.request, {
  28151. headers: {
  28152. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28153. },
  28154. method: "POST",
  28155. url: "/graphql"
  28156. });
  28157. function withCustomRequest(customRequest) {
  28158. return withDefaults(customRequest, {
  28159. method: "POST",
  28160. url: "/graphql"
  28161. });
  28162. }
  28163. exports.graphql = graphql$1;
  28164. exports.withCustomRequest = withCustomRequest;
  28165. //# sourceMappingURL=index.js.map
  28166. /***/ }),
  28167. /***/ 916:
  28168. /***/ (function(__unusedmodule, exports) {
  28169. "use strict";
  28170. Object.defineProperty(exports, '__esModule', { value: true });
  28171. const VERSION = "1.0.0";
  28172. /**
  28173. * @param octokit Octokit instance
  28174. * @param options Options passed to Octokit constructor
  28175. */
  28176. function requestLog(octokit) {
  28177. octokit.hook.wrap("request", (request, options) => {
  28178. octokit.log.debug("request", options);
  28179. const start = Date.now();
  28180. const requestOptions = octokit.request.endpoint.parse(options);
  28181. const path = requestOptions.url.replace(options.baseUrl, "");
  28182. return request(options).then(response => {
  28183. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28184. return response;
  28185. }).catch(error => {
  28186. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28187. throw error;
  28188. });
  28189. });
  28190. }
  28191. requestLog.VERSION = VERSION;
  28192. exports.requestLog = requestLog;
  28193. //# sourceMappingURL=index.js.map
  28194. /***/ }),
  28195. /***/ 929:
  28196. /***/ (function(module, __unusedexports, __webpack_require__) {
  28197. module.exports = hasNextPage
  28198. const deprecate = __webpack_require__(370)
  28199. const getPageLinks = __webpack_require__(577)
  28200. function hasNextPage (link) {
  28201. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28202. return getPageLinks(link).next
  28203. }
  28204. /***/ }),
  28205. /***/ 948:
  28206. /***/ (function(module) {
  28207. "use strict";
  28208. /**
  28209. * Tries to execute a function and discards any error that occurs.
  28210. * @param {Function} fn - Function that might or might not throw an error.
  28211. * @returns {?*} Return-value of the function when no error occurred.
  28212. */
  28213. module.exports = function(fn) {
  28214. try { return fn() } catch (e) {}
  28215. }
  28216. /***/ }),
  28217. /***/ 950:
  28218. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28219. "use strict";
  28220. Object.defineProperty(exports, "__esModule", { value: true });
  28221. const url = __webpack_require__(835);
  28222. function getProxyUrl(reqUrl) {
  28223. let usingSsl = reqUrl.protocol === 'https:';
  28224. let proxyUrl;
  28225. if (checkBypass(reqUrl)) {
  28226. return proxyUrl;
  28227. }
  28228. let proxyVar;
  28229. if (usingSsl) {
  28230. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28231. }
  28232. else {
  28233. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28234. }
  28235. if (proxyVar) {
  28236. proxyUrl = url.parse(proxyVar);
  28237. }
  28238. return proxyUrl;
  28239. }
  28240. exports.getProxyUrl = getProxyUrl;
  28241. function checkBypass(reqUrl) {
  28242. if (!reqUrl.hostname) {
  28243. return false;
  28244. }
  28245. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28246. if (!noProxy) {
  28247. return false;
  28248. }
  28249. // Determine the request port
  28250. let reqPort;
  28251. if (reqUrl.port) {
  28252. reqPort = Number(reqUrl.port);
  28253. }
  28254. else if (reqUrl.protocol === 'http:') {
  28255. reqPort = 80;
  28256. }
  28257. else if (reqUrl.protocol === 'https:') {
  28258. reqPort = 443;
  28259. }
  28260. // Format the request hostname and hostname with port
  28261. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28262. if (typeof reqPort === 'number') {
  28263. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28264. }
  28265. // Compare request host against noproxy
  28266. for (let upperNoProxyItem of noProxy
  28267. .split(',')
  28268. .map(x => x.trim().toUpperCase())
  28269. .filter(x => x)) {
  28270. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28271. return true;
  28272. }
  28273. }
  28274. return false;
  28275. }
  28276. exports.checkBypass = checkBypass;
  28277. /***/ }),
  28278. /***/ 954:
  28279. /***/ (function(module) {
  28280. module.exports = validateAuth;
  28281. function validateAuth(auth) {
  28282. if (typeof auth === "string") {
  28283. return;
  28284. }
  28285. if (typeof auth === "function") {
  28286. return;
  28287. }
  28288. if (auth.username && auth.password) {
  28289. return;
  28290. }
  28291. if (auth.clientId && auth.clientSecret) {
  28292. return;
  28293. }
  28294. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28295. }
  28296. /***/ }),
  28297. /***/ 955:
  28298. /***/ (function(module, __unusedexports, __webpack_require__) {
  28299. "use strict";
  28300. const path = __webpack_require__(622);
  28301. const childProcess = __webpack_require__(129);
  28302. const crossSpawn = __webpack_require__(20);
  28303. const stripEof = __webpack_require__(768);
  28304. const npmRunPath = __webpack_require__(621);
  28305. const isStream = __webpack_require__(323);
  28306. const _getStream = __webpack_require__(145);
  28307. const pFinally = __webpack_require__(697);
  28308. const onExit = __webpack_require__(260);
  28309. const errname = __webpack_require__(427);
  28310. const stdio = __webpack_require__(168);
  28311. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28312. function handleArgs(cmd, args, opts) {
  28313. let parsed;
  28314. opts = Object.assign({
  28315. extendEnv: true,
  28316. env: {}
  28317. }, opts);
  28318. if (opts.extendEnv) {
  28319. opts.env = Object.assign({}, process.env, opts.env);
  28320. }
  28321. if (opts.__winShell === true) {
  28322. delete opts.__winShell;
  28323. parsed = {
  28324. command: cmd,
  28325. args,
  28326. options: opts,
  28327. file: cmd,
  28328. original: {
  28329. cmd,
  28330. args
  28331. }
  28332. };
  28333. } else {
  28334. parsed = crossSpawn._parse(cmd, args, opts);
  28335. }
  28336. opts = Object.assign({
  28337. maxBuffer: TEN_MEGABYTES,
  28338. buffer: true,
  28339. stripEof: true,
  28340. preferLocal: true,
  28341. localDir: parsed.options.cwd || process.cwd(),
  28342. encoding: 'utf8',
  28343. reject: true,
  28344. cleanup: true
  28345. }, parsed.options);
  28346. opts.stdio = stdio(opts);
  28347. if (opts.preferLocal) {
  28348. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28349. }
  28350. if (opts.detached) {
  28351. // #115
  28352. opts.cleanup = false;
  28353. }
  28354. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28355. // #116
  28356. parsed.args.unshift('/q');
  28357. }
  28358. return {
  28359. cmd: parsed.command,
  28360. args: parsed.args,
  28361. opts,
  28362. parsed
  28363. };
  28364. }
  28365. function handleInput(spawned, input) {
  28366. if (input === null || input === undefined) {
  28367. return;
  28368. }
  28369. if (isStream(input)) {
  28370. input.pipe(spawned.stdin);
  28371. } else {
  28372. spawned.stdin.end(input);
  28373. }
  28374. }
  28375. function handleOutput(opts, val) {
  28376. if (val && opts.stripEof) {
  28377. val = stripEof(val);
  28378. }
  28379. return val;
  28380. }
  28381. function handleShell(fn, cmd, opts) {
  28382. let file = '/bin/sh';
  28383. let args = ['-c', cmd];
  28384. opts = Object.assign({}, opts);
  28385. if (process.platform === 'win32') {
  28386. opts.__winShell = true;
  28387. file = process.env.comspec || 'cmd.exe';
  28388. args = ['/s', '/c', `"${cmd}"`];
  28389. opts.windowsVerbatimArguments = true;
  28390. }
  28391. if (opts.shell) {
  28392. file = opts.shell;
  28393. delete opts.shell;
  28394. }
  28395. return fn(file, args, opts);
  28396. }
  28397. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28398. if (!process[stream]) {
  28399. return null;
  28400. }
  28401. let ret;
  28402. if (!buffer) {
  28403. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28404. ret = new Promise((resolve, reject) => {
  28405. process[stream]
  28406. .once('end', resolve)
  28407. .once('error', reject);
  28408. });
  28409. } else if (encoding) {
  28410. ret = _getStream(process[stream], {
  28411. encoding,
  28412. maxBuffer
  28413. });
  28414. } else {
  28415. ret = _getStream.buffer(process[stream], {maxBuffer});
  28416. }
  28417. return ret.catch(err => {
  28418. err.stream = stream;
  28419. err.message = `${stream} ${err.message}`;
  28420. throw err;
  28421. });
  28422. }
  28423. function makeError(result, options) {
  28424. const {stdout, stderr} = result;
  28425. let err = result.error;
  28426. const {code, signal} = result;
  28427. const {parsed, joinedCmd} = options;
  28428. const timedOut = options.timedOut || false;
  28429. if (!err) {
  28430. let output = '';
  28431. if (Array.isArray(parsed.opts.stdio)) {
  28432. if (parsed.opts.stdio[2] !== 'inherit') {
  28433. output += output.length > 0 ? stderr : `\n${stderr}`;
  28434. }
  28435. if (parsed.opts.stdio[1] !== 'inherit') {
  28436. output += `\n${stdout}`;
  28437. }
  28438. } else if (parsed.opts.stdio !== 'inherit') {
  28439. output = `\n${stderr}${stdout}`;
  28440. }
  28441. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28442. err.code = code < 0 ? errname(code) : code;
  28443. }
  28444. err.stdout = stdout;
  28445. err.stderr = stderr;
  28446. err.failed = true;
  28447. err.signal = signal || null;
  28448. err.cmd = joinedCmd;
  28449. err.timedOut = timedOut;
  28450. return err;
  28451. }
  28452. function joinCmd(cmd, args) {
  28453. let joinedCmd = cmd;
  28454. if (Array.isArray(args) && args.length > 0) {
  28455. joinedCmd += ' ' + args.join(' ');
  28456. }
  28457. return joinedCmd;
  28458. }
  28459. module.exports = (cmd, args, opts) => {
  28460. const parsed = handleArgs(cmd, args, opts);
  28461. const {encoding, buffer, maxBuffer} = parsed.opts;
  28462. const joinedCmd = joinCmd(cmd, args);
  28463. let spawned;
  28464. try {
  28465. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28466. } catch (err) {
  28467. return Promise.reject(err);
  28468. }
  28469. let removeExitHandler;
  28470. if (parsed.opts.cleanup) {
  28471. removeExitHandler = onExit(() => {
  28472. spawned.kill();
  28473. });
  28474. }
  28475. let timeoutId = null;
  28476. let timedOut = false;
  28477. const cleanup = () => {
  28478. if (timeoutId) {
  28479. clearTimeout(timeoutId);
  28480. timeoutId = null;
  28481. }
  28482. if (removeExitHandler) {
  28483. removeExitHandler();
  28484. }
  28485. };
  28486. if (parsed.opts.timeout > 0) {
  28487. timeoutId = setTimeout(() => {
  28488. timeoutId = null;
  28489. timedOut = true;
  28490. spawned.kill(parsed.opts.killSignal);
  28491. }, parsed.opts.timeout);
  28492. }
  28493. const processDone = new Promise(resolve => {
  28494. spawned.on('exit', (code, signal) => {
  28495. cleanup();
  28496. resolve({code, signal});
  28497. });
  28498. spawned.on('error', err => {
  28499. cleanup();
  28500. resolve({error: err});
  28501. });
  28502. if (spawned.stdin) {
  28503. spawned.stdin.on('error', err => {
  28504. cleanup();
  28505. resolve({error: err});
  28506. });
  28507. }
  28508. });
  28509. function destroy() {
  28510. if (spawned.stdout) {
  28511. spawned.stdout.destroy();
  28512. }
  28513. if (spawned.stderr) {
  28514. spawned.stderr.destroy();
  28515. }
  28516. }
  28517. const handlePromise = () => pFinally(Promise.all([
  28518. processDone,
  28519. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28520. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28521. ]).then(arr => {
  28522. const result = arr[0];
  28523. result.stdout = arr[1];
  28524. result.stderr = arr[2];
  28525. if (result.error || result.code !== 0 || result.signal !== null) {
  28526. const err = makeError(result, {
  28527. joinedCmd,
  28528. parsed,
  28529. timedOut
  28530. });
  28531. // TODO: missing some timeout logic for killed
  28532. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28533. // err.killed = spawned.killed || killed;
  28534. err.killed = err.killed || spawned.killed;
  28535. if (!parsed.opts.reject) {
  28536. return err;
  28537. }
  28538. throw err;
  28539. }
  28540. return {
  28541. stdout: handleOutput(parsed.opts, result.stdout),
  28542. stderr: handleOutput(parsed.opts, result.stderr),
  28543. code: 0,
  28544. failed: false,
  28545. killed: false,
  28546. signal: null,
  28547. cmd: joinedCmd,
  28548. timedOut: false
  28549. };
  28550. }), destroy);
  28551. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28552. handleInput(spawned, parsed.opts.input);
  28553. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28554. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28555. return spawned;
  28556. };
  28557. // TODO: set `stderr: 'ignore'` when that option is implemented
  28558. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28559. // TODO: set `stdout: 'ignore'` when that option is implemented
  28560. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28561. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28562. module.exports.sync = (cmd, args, opts) => {
  28563. const parsed = handleArgs(cmd, args, opts);
  28564. const joinedCmd = joinCmd(cmd, args);
  28565. if (isStream(parsed.opts.input)) {
  28566. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28567. }
  28568. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28569. result.code = result.status;
  28570. if (result.error || result.status !== 0 || result.signal !== null) {
  28571. const err = makeError(result, {
  28572. joinedCmd,
  28573. parsed
  28574. });
  28575. if (!parsed.opts.reject) {
  28576. return err;
  28577. }
  28578. throw err;
  28579. }
  28580. return {
  28581. stdout: handleOutput(parsed.opts, result.stdout),
  28582. stderr: handleOutput(parsed.opts, result.stderr),
  28583. code: 0,
  28584. failed: false,
  28585. signal: null,
  28586. cmd: joinedCmd,
  28587. timedOut: false
  28588. };
  28589. };
  28590. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28591. /***/ }),
  28592. /***/ 966:
  28593. /***/ (function(module, __unusedexports, __webpack_require__) {
  28594. "use strict";
  28595. const {PassThrough} = __webpack_require__(413);
  28596. module.exports = options => {
  28597. options = Object.assign({}, options);
  28598. const {array} = options;
  28599. let {encoding} = options;
  28600. const buffer = encoding === 'buffer';
  28601. let objectMode = false;
  28602. if (array) {
  28603. objectMode = !(encoding || buffer);
  28604. } else {
  28605. encoding = encoding || 'utf8';
  28606. }
  28607. if (buffer) {
  28608. encoding = null;
  28609. }
  28610. let len = 0;
  28611. const ret = [];
  28612. const stream = new PassThrough({objectMode});
  28613. if (encoding) {
  28614. stream.setEncoding(encoding);
  28615. }
  28616. stream.on('data', chunk => {
  28617. ret.push(chunk);
  28618. if (objectMode) {
  28619. len = ret.length;
  28620. } else {
  28621. len += chunk.length;
  28622. }
  28623. });
  28624. stream.getBufferedValue = () => {
  28625. if (array) {
  28626. return ret;
  28627. }
  28628. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28629. };
  28630. stream.getBufferedLength = () => len;
  28631. return stream;
  28632. };
  28633. /***/ }),
  28634. /***/ 969:
  28635. /***/ (function(module, __unusedexports, __webpack_require__) {
  28636. var wrappy = __webpack_require__(11)
  28637. module.exports = wrappy(once)
  28638. module.exports.strict = wrappy(onceStrict)
  28639. once.proto = once(function () {
  28640. Object.defineProperty(Function.prototype, 'once', {
  28641. value: function () {
  28642. return once(this)
  28643. },
  28644. configurable: true
  28645. })
  28646. Object.defineProperty(Function.prototype, 'onceStrict', {
  28647. value: function () {
  28648. return onceStrict(this)
  28649. },
  28650. configurable: true
  28651. })
  28652. })
  28653. function once (fn) {
  28654. var f = function () {
  28655. if (f.called) return f.value
  28656. f.called = true
  28657. return f.value = fn.apply(this, arguments)
  28658. }
  28659. f.called = false
  28660. return f
  28661. }
  28662. function onceStrict (fn) {
  28663. var f = function () {
  28664. if (f.called)
  28665. throw new Error(f.onceError)
  28666. f.called = true
  28667. return f.value = fn.apply(this, arguments)
  28668. }
  28669. var name = fn.name || 'Function wrapped with `once`'
  28670. f.onceError = name + " shouldn't be called more than once"
  28671. f.called = false
  28672. return f
  28673. }
  28674. /***/ }),
  28675. /***/ 986:
  28676. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28677. "use strict";
  28678. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28679. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28680. return new (P || (P = Promise))(function (resolve, reject) {
  28681. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28682. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28683. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28684. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28685. });
  28686. };
  28687. Object.defineProperty(exports, "__esModule", { value: true });
  28688. const tr = __webpack_require__(9);
  28689. /**
  28690. * Exec a command.
  28691. * Output will be streamed to the live console.
  28692. * Returns promise with return code
  28693. *
  28694. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28695. * @param args optional arguments for tool. Escaping is handled by the lib.
  28696. * @param options optional exec options. See ExecOptions
  28697. * @returns Promise<number> exit code
  28698. */
  28699. function exec(commandLine, args, options) {
  28700. return __awaiter(this, void 0, void 0, function* () {
  28701. const commandArgs = tr.argStringToArray(commandLine);
  28702. if (commandArgs.length === 0) {
  28703. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28704. }
  28705. // Path to tool to execute should be first arg
  28706. const toolPath = commandArgs[0];
  28707. args = commandArgs.slice(1).concat(args || []);
  28708. const runner = new tr.ToolRunner(toolPath, args, options);
  28709. return runner.exec();
  28710. });
  28711. }
  28712. exports.exec = exec;
  28713. //# sourceMappingURL=exec.js.map
  28714. /***/ }),
  28715. /***/ 991:
  28716. /***/ (function(module, __unusedexports, __webpack_require__) {
  28717. module.exports = authenticationRequestError;
  28718. const { RequestError } = __webpack_require__(497);
  28719. function authenticationRequestError(state, error, options) {
  28720. if (!error.headers) throw error;
  28721. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28722. // handle "2FA required" error only
  28723. if (error.status !== 401 || !otpRequired) {
  28724. throw error;
  28725. }
  28726. if (
  28727. error.status === 401 &&
  28728. otpRequired &&
  28729. error.request &&
  28730. error.request.headers["x-github-otp"]
  28731. ) {
  28732. if (state.otp) {
  28733. delete state.otp; // no longer valid, request again
  28734. } else {
  28735. throw new RequestError(
  28736. "Invalid one-time password for two-factor authentication",
  28737. 401,
  28738. {
  28739. headers: error.headers,
  28740. request: options
  28741. }
  28742. );
  28743. }
  28744. }
  28745. if (typeof state.auth.on2fa !== "function") {
  28746. throw new RequestError(
  28747. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28748. 401,
  28749. {
  28750. headers: error.headers,
  28751. request: options
  28752. }
  28753. );
  28754. }
  28755. return Promise.resolve()
  28756. .then(() => {
  28757. return state.auth.on2fa();
  28758. })
  28759. .then(oneTimePassword => {
  28760. const newOptions = Object.assign(options, {
  28761. headers: Object.assign(options.headers, {
  28762. "x-github-otp": oneTimePassword
  28763. })
  28764. });
  28765. return state.octokit.request(newOptions).then(response => {
  28766. // If OTP still valid, then persist it for following requests
  28767. state.otp = oneTimePassword;
  28768. return response;
  28769. });
  28770. });
  28771. }
  28772. /***/ })
  28773. /******/ });