index.js 815 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440
  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. /***/ 82:
  1279. /***/ (function(__unusedmodule, exports) {
  1280. "use strict";
  1281. // We use any as a valid input type
  1282. /* eslint-disable @typescript-eslint/no-explicit-any */
  1283. Object.defineProperty(exports, "__esModule", { value: true });
  1284. /**
  1285. * Sanitizes an input into a string so it can be passed into issueCommand safely
  1286. * @param input input to sanitize into a string
  1287. */
  1288. function toCommandValue(input) {
  1289. if (input === null || input === undefined) {
  1290. return '';
  1291. }
  1292. else if (typeof input === 'string' || input instanceof String) {
  1293. return input;
  1294. }
  1295. return JSON.stringify(input);
  1296. }
  1297. exports.toCommandValue = toCommandValue;
  1298. //# sourceMappingURL=utils.js.map
  1299. /***/ }),
  1300. /***/ 87:
  1301. /***/ (function(module) {
  1302. module.exports = require("os");
  1303. /***/ }),
  1304. /***/ 102:
  1305. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1306. "use strict";
  1307. // For internal use, subject to change.
  1308. var __importStar = (this && this.__importStar) || function (mod) {
  1309. if (mod && mod.__esModule) return mod;
  1310. var result = {};
  1311. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1312. result["default"] = mod;
  1313. return result;
  1314. };
  1315. Object.defineProperty(exports, "__esModule", { value: true });
  1316. // We use any as a valid input type
  1317. /* eslint-disable @typescript-eslint/no-explicit-any */
  1318. const fs = __importStar(__webpack_require__(747));
  1319. const os = __importStar(__webpack_require__(87));
  1320. const utils_1 = __webpack_require__(82);
  1321. function issueCommand(command, message) {
  1322. const filePath = process.env[`GITHUB_${command}`];
  1323. if (!filePath) {
  1324. throw new Error(`Unable to find environment variable for file command ${command}`);
  1325. }
  1326. if (!fs.existsSync(filePath)) {
  1327. throw new Error(`Missing file at path: ${filePath}`);
  1328. }
  1329. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  1330. encoding: 'utf8'
  1331. });
  1332. }
  1333. exports.issueCommand = issueCommand;
  1334. //# sourceMappingURL=file-command.js.map
  1335. /***/ }),
  1336. /***/ 118:
  1337. /***/ (function(module, __unusedexports, __webpack_require__) {
  1338. "use strict";
  1339. const os = __webpack_require__(87);
  1340. const nameMap = new Map([
  1341. [19, 'Catalina'],
  1342. [18, 'Mojave'],
  1343. [17, 'High Sierra'],
  1344. [16, 'Sierra'],
  1345. [15, 'El Capitan'],
  1346. [14, 'Yosemite'],
  1347. [13, 'Mavericks'],
  1348. [12, 'Mountain Lion'],
  1349. [11, 'Lion'],
  1350. [10, 'Snow Leopard'],
  1351. [9, 'Leopard'],
  1352. [8, 'Tiger'],
  1353. [7, 'Panther'],
  1354. [6, 'Jaguar'],
  1355. [5, 'Puma']
  1356. ]);
  1357. const macosRelease = release => {
  1358. release = Number((release || os.release()).split('.')[0]);
  1359. return {
  1360. name: nameMap.get(release),
  1361. version: '10.' + (release - 4)
  1362. };
  1363. };
  1364. module.exports = macosRelease;
  1365. // TODO: remove this in the next major version
  1366. module.exports.default = macosRelease;
  1367. /***/ }),
  1368. /***/ 126:
  1369. /***/ (function(module) {
  1370. /**
  1371. * lodash (Custom Build) <https://lodash.com/>
  1372. * Build: `lodash modularize exports="npm" -o ./`
  1373. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1374. * Released under MIT license <https://lodash.com/license>
  1375. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1376. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1377. */
  1378. /** Used as the size to enable large array optimizations. */
  1379. var LARGE_ARRAY_SIZE = 200;
  1380. /** Used to stand-in for `undefined` hash values. */
  1381. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1382. /** Used as references for various `Number` constants. */
  1383. var INFINITY = 1 / 0;
  1384. /** `Object#toString` result references. */
  1385. var funcTag = '[object Function]',
  1386. genTag = '[object GeneratorFunction]';
  1387. /**
  1388. * Used to match `RegExp`
  1389. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1390. */
  1391. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1392. /** Used to detect host constructors (Safari). */
  1393. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1394. /** Detect free variable `global` from Node.js. */
  1395. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1396. /** Detect free variable `self`. */
  1397. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1398. /** Used as a reference to the global object. */
  1399. var root = freeGlobal || freeSelf || Function('return this')();
  1400. /**
  1401. * A specialized version of `_.includes` for arrays without support for
  1402. * specifying an index to search from.
  1403. *
  1404. * @private
  1405. * @param {Array} [array] The array to inspect.
  1406. * @param {*} target The value to search for.
  1407. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1408. */
  1409. function arrayIncludes(array, value) {
  1410. var length = array ? array.length : 0;
  1411. return !!length && baseIndexOf(array, value, 0) > -1;
  1412. }
  1413. /**
  1414. * This function is like `arrayIncludes` except that it accepts a comparator.
  1415. *
  1416. * @private
  1417. * @param {Array} [array] The array to inspect.
  1418. * @param {*} target The value to search for.
  1419. * @param {Function} comparator The comparator invoked per element.
  1420. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1421. */
  1422. function arrayIncludesWith(array, value, comparator) {
  1423. var index = -1,
  1424. length = array ? array.length : 0;
  1425. while (++index < length) {
  1426. if (comparator(value, array[index])) {
  1427. return true;
  1428. }
  1429. }
  1430. return false;
  1431. }
  1432. /**
  1433. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1434. * support for iteratee shorthands.
  1435. *
  1436. * @private
  1437. * @param {Array} array The array to inspect.
  1438. * @param {Function} predicate The function invoked per iteration.
  1439. * @param {number} fromIndex The index to search from.
  1440. * @param {boolean} [fromRight] Specify iterating from right to left.
  1441. * @returns {number} Returns the index of the matched value, else `-1`.
  1442. */
  1443. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1444. var length = array.length,
  1445. index = fromIndex + (fromRight ? 1 : -1);
  1446. while ((fromRight ? index-- : ++index < length)) {
  1447. if (predicate(array[index], index, array)) {
  1448. return index;
  1449. }
  1450. }
  1451. return -1;
  1452. }
  1453. /**
  1454. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1455. *
  1456. * @private
  1457. * @param {Array} array The array to inspect.
  1458. * @param {*} value The value to search for.
  1459. * @param {number} fromIndex The index to search from.
  1460. * @returns {number} Returns the index of the matched value, else `-1`.
  1461. */
  1462. function baseIndexOf(array, value, fromIndex) {
  1463. if (value !== value) {
  1464. return baseFindIndex(array, baseIsNaN, fromIndex);
  1465. }
  1466. var index = fromIndex - 1,
  1467. length = array.length;
  1468. while (++index < length) {
  1469. if (array[index] === value) {
  1470. return index;
  1471. }
  1472. }
  1473. return -1;
  1474. }
  1475. /**
  1476. * The base implementation of `_.isNaN` without support for number objects.
  1477. *
  1478. * @private
  1479. * @param {*} value The value to check.
  1480. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1481. */
  1482. function baseIsNaN(value) {
  1483. return value !== value;
  1484. }
  1485. /**
  1486. * Checks if a cache value for `key` exists.
  1487. *
  1488. * @private
  1489. * @param {Object} cache The cache to query.
  1490. * @param {string} key The key of the entry to check.
  1491. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1492. */
  1493. function cacheHas(cache, key) {
  1494. return cache.has(key);
  1495. }
  1496. /**
  1497. * Gets the value at `key` of `object`.
  1498. *
  1499. * @private
  1500. * @param {Object} [object] The object to query.
  1501. * @param {string} key The key of the property to get.
  1502. * @returns {*} Returns the property value.
  1503. */
  1504. function getValue(object, key) {
  1505. return object == null ? undefined : object[key];
  1506. }
  1507. /**
  1508. * Checks if `value` is a host object in IE < 9.
  1509. *
  1510. * @private
  1511. * @param {*} value The value to check.
  1512. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1513. */
  1514. function isHostObject(value) {
  1515. // Many host objects are `Object` objects that can coerce to strings
  1516. // despite having improperly defined `toString` methods.
  1517. var result = false;
  1518. if (value != null && typeof value.toString != 'function') {
  1519. try {
  1520. result = !!(value + '');
  1521. } catch (e) {}
  1522. }
  1523. return result;
  1524. }
  1525. /**
  1526. * Converts `set` to an array of its values.
  1527. *
  1528. * @private
  1529. * @param {Object} set The set to convert.
  1530. * @returns {Array} Returns the values.
  1531. */
  1532. function setToArray(set) {
  1533. var index = -1,
  1534. result = Array(set.size);
  1535. set.forEach(function(value) {
  1536. result[++index] = value;
  1537. });
  1538. return result;
  1539. }
  1540. /** Used for built-in method references. */
  1541. var arrayProto = Array.prototype,
  1542. funcProto = Function.prototype,
  1543. objectProto = Object.prototype;
  1544. /** Used to detect overreaching core-js shims. */
  1545. var coreJsData = root['__core-js_shared__'];
  1546. /** Used to detect methods masquerading as native. */
  1547. var maskSrcKey = (function() {
  1548. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1549. return uid ? ('Symbol(src)_1.' + uid) : '';
  1550. }());
  1551. /** Used to resolve the decompiled source of functions. */
  1552. var funcToString = funcProto.toString;
  1553. /** Used to check objects for own properties. */
  1554. var hasOwnProperty = objectProto.hasOwnProperty;
  1555. /**
  1556. * Used to resolve the
  1557. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1558. * of values.
  1559. */
  1560. var objectToString = objectProto.toString;
  1561. /** Used to detect if a method is native. */
  1562. var reIsNative = RegExp('^' +
  1563. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1564. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1565. );
  1566. /** Built-in value references. */
  1567. var splice = arrayProto.splice;
  1568. /* Built-in method references that are verified to be native. */
  1569. var Map = getNative(root, 'Map'),
  1570. Set = getNative(root, 'Set'),
  1571. nativeCreate = getNative(Object, 'create');
  1572. /**
  1573. * Creates a hash object.
  1574. *
  1575. * @private
  1576. * @constructor
  1577. * @param {Array} [entries] The key-value pairs to cache.
  1578. */
  1579. function Hash(entries) {
  1580. var index = -1,
  1581. length = entries ? entries.length : 0;
  1582. this.clear();
  1583. while (++index < length) {
  1584. var entry = entries[index];
  1585. this.set(entry[0], entry[1]);
  1586. }
  1587. }
  1588. /**
  1589. * Removes all key-value entries from the hash.
  1590. *
  1591. * @private
  1592. * @name clear
  1593. * @memberOf Hash
  1594. */
  1595. function hashClear() {
  1596. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1597. }
  1598. /**
  1599. * Removes `key` and its value from the hash.
  1600. *
  1601. * @private
  1602. * @name delete
  1603. * @memberOf Hash
  1604. * @param {Object} hash The hash to modify.
  1605. * @param {string} key The key of the value to remove.
  1606. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1607. */
  1608. function hashDelete(key) {
  1609. return this.has(key) && delete this.__data__[key];
  1610. }
  1611. /**
  1612. * Gets the hash value for `key`.
  1613. *
  1614. * @private
  1615. * @name get
  1616. * @memberOf Hash
  1617. * @param {string} key The key of the value to get.
  1618. * @returns {*} Returns the entry value.
  1619. */
  1620. function hashGet(key) {
  1621. var data = this.__data__;
  1622. if (nativeCreate) {
  1623. var result = data[key];
  1624. return result === HASH_UNDEFINED ? undefined : result;
  1625. }
  1626. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1627. }
  1628. /**
  1629. * Checks if a hash value for `key` exists.
  1630. *
  1631. * @private
  1632. * @name has
  1633. * @memberOf Hash
  1634. * @param {string} key The key of the entry to check.
  1635. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1636. */
  1637. function hashHas(key) {
  1638. var data = this.__data__;
  1639. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1640. }
  1641. /**
  1642. * Sets the hash `key` to `value`.
  1643. *
  1644. * @private
  1645. * @name set
  1646. * @memberOf Hash
  1647. * @param {string} key The key of the value to set.
  1648. * @param {*} value The value to set.
  1649. * @returns {Object} Returns the hash instance.
  1650. */
  1651. function hashSet(key, value) {
  1652. var data = this.__data__;
  1653. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1654. return this;
  1655. }
  1656. // Add methods to `Hash`.
  1657. Hash.prototype.clear = hashClear;
  1658. Hash.prototype['delete'] = hashDelete;
  1659. Hash.prototype.get = hashGet;
  1660. Hash.prototype.has = hashHas;
  1661. Hash.prototype.set = hashSet;
  1662. /**
  1663. * Creates an list cache object.
  1664. *
  1665. * @private
  1666. * @constructor
  1667. * @param {Array} [entries] The key-value pairs to cache.
  1668. */
  1669. function ListCache(entries) {
  1670. var index = -1,
  1671. length = entries ? entries.length : 0;
  1672. this.clear();
  1673. while (++index < length) {
  1674. var entry = entries[index];
  1675. this.set(entry[0], entry[1]);
  1676. }
  1677. }
  1678. /**
  1679. * Removes all key-value entries from the list cache.
  1680. *
  1681. * @private
  1682. * @name clear
  1683. * @memberOf ListCache
  1684. */
  1685. function listCacheClear() {
  1686. this.__data__ = [];
  1687. }
  1688. /**
  1689. * Removes `key` and its value from the list cache.
  1690. *
  1691. * @private
  1692. * @name delete
  1693. * @memberOf ListCache
  1694. * @param {string} key The key of the value to remove.
  1695. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1696. */
  1697. function listCacheDelete(key) {
  1698. var data = this.__data__,
  1699. index = assocIndexOf(data, key);
  1700. if (index < 0) {
  1701. return false;
  1702. }
  1703. var lastIndex = data.length - 1;
  1704. if (index == lastIndex) {
  1705. data.pop();
  1706. } else {
  1707. splice.call(data, index, 1);
  1708. }
  1709. return true;
  1710. }
  1711. /**
  1712. * Gets the list cache value for `key`.
  1713. *
  1714. * @private
  1715. * @name get
  1716. * @memberOf ListCache
  1717. * @param {string} key The key of the value to get.
  1718. * @returns {*} Returns the entry value.
  1719. */
  1720. function listCacheGet(key) {
  1721. var data = this.__data__,
  1722. index = assocIndexOf(data, key);
  1723. return index < 0 ? undefined : data[index][1];
  1724. }
  1725. /**
  1726. * Checks if a list cache value for `key` exists.
  1727. *
  1728. * @private
  1729. * @name has
  1730. * @memberOf ListCache
  1731. * @param {string} key The key of the entry to check.
  1732. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1733. */
  1734. function listCacheHas(key) {
  1735. return assocIndexOf(this.__data__, key) > -1;
  1736. }
  1737. /**
  1738. * Sets the list cache `key` to `value`.
  1739. *
  1740. * @private
  1741. * @name set
  1742. * @memberOf ListCache
  1743. * @param {string} key The key of the value to set.
  1744. * @param {*} value The value to set.
  1745. * @returns {Object} Returns the list cache instance.
  1746. */
  1747. function listCacheSet(key, value) {
  1748. var data = this.__data__,
  1749. index = assocIndexOf(data, key);
  1750. if (index < 0) {
  1751. data.push([key, value]);
  1752. } else {
  1753. data[index][1] = value;
  1754. }
  1755. return this;
  1756. }
  1757. // Add methods to `ListCache`.
  1758. ListCache.prototype.clear = listCacheClear;
  1759. ListCache.prototype['delete'] = listCacheDelete;
  1760. ListCache.prototype.get = listCacheGet;
  1761. ListCache.prototype.has = listCacheHas;
  1762. ListCache.prototype.set = listCacheSet;
  1763. /**
  1764. * Creates a map cache object to store key-value pairs.
  1765. *
  1766. * @private
  1767. * @constructor
  1768. * @param {Array} [entries] The key-value pairs to cache.
  1769. */
  1770. function MapCache(entries) {
  1771. var index = -1,
  1772. length = entries ? entries.length : 0;
  1773. this.clear();
  1774. while (++index < length) {
  1775. var entry = entries[index];
  1776. this.set(entry[0], entry[1]);
  1777. }
  1778. }
  1779. /**
  1780. * Removes all key-value entries from the map.
  1781. *
  1782. * @private
  1783. * @name clear
  1784. * @memberOf MapCache
  1785. */
  1786. function mapCacheClear() {
  1787. this.__data__ = {
  1788. 'hash': new Hash,
  1789. 'map': new (Map || ListCache),
  1790. 'string': new Hash
  1791. };
  1792. }
  1793. /**
  1794. * Removes `key` and its value from the map.
  1795. *
  1796. * @private
  1797. * @name delete
  1798. * @memberOf MapCache
  1799. * @param {string} key The key of the value to remove.
  1800. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1801. */
  1802. function mapCacheDelete(key) {
  1803. return getMapData(this, key)['delete'](key);
  1804. }
  1805. /**
  1806. * Gets the map value for `key`.
  1807. *
  1808. * @private
  1809. * @name get
  1810. * @memberOf MapCache
  1811. * @param {string} key The key of the value to get.
  1812. * @returns {*} Returns the entry value.
  1813. */
  1814. function mapCacheGet(key) {
  1815. return getMapData(this, key).get(key);
  1816. }
  1817. /**
  1818. * Checks if a map value for `key` exists.
  1819. *
  1820. * @private
  1821. * @name has
  1822. * @memberOf MapCache
  1823. * @param {string} key The key of the entry to check.
  1824. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1825. */
  1826. function mapCacheHas(key) {
  1827. return getMapData(this, key).has(key);
  1828. }
  1829. /**
  1830. * Sets the map `key` to `value`.
  1831. *
  1832. * @private
  1833. * @name set
  1834. * @memberOf MapCache
  1835. * @param {string} key The key of the value to set.
  1836. * @param {*} value The value to set.
  1837. * @returns {Object} Returns the map cache instance.
  1838. */
  1839. function mapCacheSet(key, value) {
  1840. getMapData(this, key).set(key, value);
  1841. return this;
  1842. }
  1843. // Add methods to `MapCache`.
  1844. MapCache.prototype.clear = mapCacheClear;
  1845. MapCache.prototype['delete'] = mapCacheDelete;
  1846. MapCache.prototype.get = mapCacheGet;
  1847. MapCache.prototype.has = mapCacheHas;
  1848. MapCache.prototype.set = mapCacheSet;
  1849. /**
  1850. *
  1851. * Creates an array cache object to store unique values.
  1852. *
  1853. * @private
  1854. * @constructor
  1855. * @param {Array} [values] The values to cache.
  1856. */
  1857. function SetCache(values) {
  1858. var index = -1,
  1859. length = values ? values.length : 0;
  1860. this.__data__ = new MapCache;
  1861. while (++index < length) {
  1862. this.add(values[index]);
  1863. }
  1864. }
  1865. /**
  1866. * Adds `value` to the array cache.
  1867. *
  1868. * @private
  1869. * @name add
  1870. * @memberOf SetCache
  1871. * @alias push
  1872. * @param {*} value The value to cache.
  1873. * @returns {Object} Returns the cache instance.
  1874. */
  1875. function setCacheAdd(value) {
  1876. this.__data__.set(value, HASH_UNDEFINED);
  1877. return this;
  1878. }
  1879. /**
  1880. * Checks if `value` is in the array cache.
  1881. *
  1882. * @private
  1883. * @name has
  1884. * @memberOf SetCache
  1885. * @param {*} value The value to search for.
  1886. * @returns {number} Returns `true` if `value` is found, else `false`.
  1887. */
  1888. function setCacheHas(value) {
  1889. return this.__data__.has(value);
  1890. }
  1891. // Add methods to `SetCache`.
  1892. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1893. SetCache.prototype.has = setCacheHas;
  1894. /**
  1895. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1896. *
  1897. * @private
  1898. * @param {Array} array The array to inspect.
  1899. * @param {*} key The key to search for.
  1900. * @returns {number} Returns the index of the matched value, else `-1`.
  1901. */
  1902. function assocIndexOf(array, key) {
  1903. var length = array.length;
  1904. while (length--) {
  1905. if (eq(array[length][0], key)) {
  1906. return length;
  1907. }
  1908. }
  1909. return -1;
  1910. }
  1911. /**
  1912. * The base implementation of `_.isNative` without bad shim checks.
  1913. *
  1914. * @private
  1915. * @param {*} value The value to check.
  1916. * @returns {boolean} Returns `true` if `value` is a native function,
  1917. * else `false`.
  1918. */
  1919. function baseIsNative(value) {
  1920. if (!isObject(value) || isMasked(value)) {
  1921. return false;
  1922. }
  1923. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1924. return pattern.test(toSource(value));
  1925. }
  1926. /**
  1927. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1928. *
  1929. * @private
  1930. * @param {Array} array The array to inspect.
  1931. * @param {Function} [iteratee] The iteratee invoked per element.
  1932. * @param {Function} [comparator] The comparator invoked per element.
  1933. * @returns {Array} Returns the new duplicate free array.
  1934. */
  1935. function baseUniq(array, iteratee, comparator) {
  1936. var index = -1,
  1937. includes = arrayIncludes,
  1938. length = array.length,
  1939. isCommon = true,
  1940. result = [],
  1941. seen = result;
  1942. if (comparator) {
  1943. isCommon = false;
  1944. includes = arrayIncludesWith;
  1945. }
  1946. else if (length >= LARGE_ARRAY_SIZE) {
  1947. var set = iteratee ? null : createSet(array);
  1948. if (set) {
  1949. return setToArray(set);
  1950. }
  1951. isCommon = false;
  1952. includes = cacheHas;
  1953. seen = new SetCache;
  1954. }
  1955. else {
  1956. seen = iteratee ? [] : result;
  1957. }
  1958. outer:
  1959. while (++index < length) {
  1960. var value = array[index],
  1961. computed = iteratee ? iteratee(value) : value;
  1962. value = (comparator || value !== 0) ? value : 0;
  1963. if (isCommon && computed === computed) {
  1964. var seenIndex = seen.length;
  1965. while (seenIndex--) {
  1966. if (seen[seenIndex] === computed) {
  1967. continue outer;
  1968. }
  1969. }
  1970. if (iteratee) {
  1971. seen.push(computed);
  1972. }
  1973. result.push(value);
  1974. }
  1975. else if (!includes(seen, computed, comparator)) {
  1976. if (seen !== result) {
  1977. seen.push(computed);
  1978. }
  1979. result.push(value);
  1980. }
  1981. }
  1982. return result;
  1983. }
  1984. /**
  1985. * Creates a set object of `values`.
  1986. *
  1987. * @private
  1988. * @param {Array} values The values to add to the set.
  1989. * @returns {Object} Returns the new set.
  1990. */
  1991. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1992. return new Set(values);
  1993. };
  1994. /**
  1995. * Gets the data for `map`.
  1996. *
  1997. * @private
  1998. * @param {Object} map The map to query.
  1999. * @param {string} key The reference key.
  2000. * @returns {*} Returns the map data.
  2001. */
  2002. function getMapData(map, key) {
  2003. var data = map.__data__;
  2004. return isKeyable(key)
  2005. ? data[typeof key == 'string' ? 'string' : 'hash']
  2006. : data.map;
  2007. }
  2008. /**
  2009. * Gets the native function at `key` of `object`.
  2010. *
  2011. * @private
  2012. * @param {Object} object The object to query.
  2013. * @param {string} key The key of the method to get.
  2014. * @returns {*} Returns the function if it's native, else `undefined`.
  2015. */
  2016. function getNative(object, key) {
  2017. var value = getValue(object, key);
  2018. return baseIsNative(value) ? value : undefined;
  2019. }
  2020. /**
  2021. * Checks if `value` is suitable for use as unique object key.
  2022. *
  2023. * @private
  2024. * @param {*} value The value to check.
  2025. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  2026. */
  2027. function isKeyable(value) {
  2028. var type = typeof value;
  2029. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  2030. ? (value !== '__proto__')
  2031. : (value === null);
  2032. }
  2033. /**
  2034. * Checks if `func` has its source masked.
  2035. *
  2036. * @private
  2037. * @param {Function} func The function to check.
  2038. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  2039. */
  2040. function isMasked(func) {
  2041. return !!maskSrcKey && (maskSrcKey in func);
  2042. }
  2043. /**
  2044. * Converts `func` to its source code.
  2045. *
  2046. * @private
  2047. * @param {Function} func The function to process.
  2048. * @returns {string} Returns the source code.
  2049. */
  2050. function toSource(func) {
  2051. if (func != null) {
  2052. try {
  2053. return funcToString.call(func);
  2054. } catch (e) {}
  2055. try {
  2056. return (func + '');
  2057. } catch (e) {}
  2058. }
  2059. return '';
  2060. }
  2061. /**
  2062. * Creates a duplicate-free version of an array, using
  2063. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2064. * for equality comparisons, in which only the first occurrence of each
  2065. * element is kept.
  2066. *
  2067. * @static
  2068. * @memberOf _
  2069. * @since 0.1.0
  2070. * @category Array
  2071. * @param {Array} array The array to inspect.
  2072. * @returns {Array} Returns the new duplicate free array.
  2073. * @example
  2074. *
  2075. * _.uniq([2, 1, 2]);
  2076. * // => [2, 1]
  2077. */
  2078. function uniq(array) {
  2079. return (array && array.length)
  2080. ? baseUniq(array)
  2081. : [];
  2082. }
  2083. /**
  2084. * Performs a
  2085. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2086. * comparison between two values to determine if they are equivalent.
  2087. *
  2088. * @static
  2089. * @memberOf _
  2090. * @since 4.0.0
  2091. * @category Lang
  2092. * @param {*} value The value to compare.
  2093. * @param {*} other The other value to compare.
  2094. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2095. * @example
  2096. *
  2097. * var object = { 'a': 1 };
  2098. * var other = { 'a': 1 };
  2099. *
  2100. * _.eq(object, object);
  2101. * // => true
  2102. *
  2103. * _.eq(object, other);
  2104. * // => false
  2105. *
  2106. * _.eq('a', 'a');
  2107. * // => true
  2108. *
  2109. * _.eq('a', Object('a'));
  2110. * // => false
  2111. *
  2112. * _.eq(NaN, NaN);
  2113. * // => true
  2114. */
  2115. function eq(value, other) {
  2116. return value === other || (value !== value && other !== other);
  2117. }
  2118. /**
  2119. * Checks if `value` is classified as a `Function` object.
  2120. *
  2121. * @static
  2122. * @memberOf _
  2123. * @since 0.1.0
  2124. * @category Lang
  2125. * @param {*} value The value to check.
  2126. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2127. * @example
  2128. *
  2129. * _.isFunction(_);
  2130. * // => true
  2131. *
  2132. * _.isFunction(/abc/);
  2133. * // => false
  2134. */
  2135. function isFunction(value) {
  2136. // The use of `Object#toString` avoids issues with the `typeof` operator
  2137. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2138. var tag = isObject(value) ? objectToString.call(value) : '';
  2139. return tag == funcTag || tag == genTag;
  2140. }
  2141. /**
  2142. * Checks if `value` is the
  2143. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2144. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2145. *
  2146. * @static
  2147. * @memberOf _
  2148. * @since 0.1.0
  2149. * @category Lang
  2150. * @param {*} value The value to check.
  2151. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2152. * @example
  2153. *
  2154. * _.isObject({});
  2155. * // => true
  2156. *
  2157. * _.isObject([1, 2, 3]);
  2158. * // => true
  2159. *
  2160. * _.isObject(_.noop);
  2161. * // => true
  2162. *
  2163. * _.isObject(null);
  2164. * // => false
  2165. */
  2166. function isObject(value) {
  2167. var type = typeof value;
  2168. return !!value && (type == 'object' || type == 'function');
  2169. }
  2170. /**
  2171. * This method returns `undefined`.
  2172. *
  2173. * @static
  2174. * @memberOf _
  2175. * @since 2.3.0
  2176. * @category Util
  2177. * @example
  2178. *
  2179. * _.times(2, _.noop);
  2180. * // => [undefined, undefined]
  2181. */
  2182. function noop() {
  2183. // No operation performed.
  2184. }
  2185. module.exports = uniq;
  2186. /***/ }),
  2187. /***/ 129:
  2188. /***/ (function(module) {
  2189. module.exports = require("child_process");
  2190. /***/ }),
  2191. /***/ 139:
  2192. /***/ (function(module, __unusedexports, __webpack_require__) {
  2193. // Unique ID creation requires a high quality random # generator. In node.js
  2194. // this is pretty straight-forward - we use the crypto API.
  2195. var crypto = __webpack_require__(417);
  2196. module.exports = function nodeRNG() {
  2197. return crypto.randomBytes(16);
  2198. };
  2199. /***/ }),
  2200. /***/ 141:
  2201. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2202. "use strict";
  2203. var net = __webpack_require__(631);
  2204. var tls = __webpack_require__(16);
  2205. var http = __webpack_require__(605);
  2206. var https = __webpack_require__(34);
  2207. var events = __webpack_require__(614);
  2208. var assert = __webpack_require__(357);
  2209. var util = __webpack_require__(669);
  2210. exports.httpOverHttp = httpOverHttp;
  2211. exports.httpsOverHttp = httpsOverHttp;
  2212. exports.httpOverHttps = httpOverHttps;
  2213. exports.httpsOverHttps = httpsOverHttps;
  2214. function httpOverHttp(options) {
  2215. var agent = new TunnelingAgent(options);
  2216. agent.request = http.request;
  2217. return agent;
  2218. }
  2219. function httpsOverHttp(options) {
  2220. var agent = new TunnelingAgent(options);
  2221. agent.request = http.request;
  2222. agent.createSocket = createSecureSocket;
  2223. return agent;
  2224. }
  2225. function httpOverHttps(options) {
  2226. var agent = new TunnelingAgent(options);
  2227. agent.request = https.request;
  2228. return agent;
  2229. }
  2230. function httpsOverHttps(options) {
  2231. var agent = new TunnelingAgent(options);
  2232. agent.request = https.request;
  2233. agent.createSocket = createSecureSocket;
  2234. return agent;
  2235. }
  2236. function TunnelingAgent(options) {
  2237. var self = this;
  2238. self.options = options || {};
  2239. self.proxyOptions = self.options.proxy || {};
  2240. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2241. self.requests = [];
  2242. self.sockets = [];
  2243. self.on('free', function onFree(socket, host, port, localAddress) {
  2244. var options = toOptions(host, port, localAddress);
  2245. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2246. var pending = self.requests[i];
  2247. if (pending.host === options.host && pending.port === options.port) {
  2248. // Detect the request to connect same origin server,
  2249. // reuse the connection.
  2250. self.requests.splice(i, 1);
  2251. pending.request.onSocket(socket);
  2252. return;
  2253. }
  2254. }
  2255. socket.destroy();
  2256. self.removeSocket(socket);
  2257. });
  2258. }
  2259. util.inherits(TunnelingAgent, events.EventEmitter);
  2260. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2261. var self = this;
  2262. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2263. if (self.sockets.length >= this.maxSockets) {
  2264. // We are over limit so we'll add it to the queue.
  2265. self.requests.push(options);
  2266. return;
  2267. }
  2268. // If we are under maxSockets create a new one.
  2269. self.createSocket(options, function(socket) {
  2270. socket.on('free', onFree);
  2271. socket.on('close', onCloseOrRemove);
  2272. socket.on('agentRemove', onCloseOrRemove);
  2273. req.onSocket(socket);
  2274. function onFree() {
  2275. self.emit('free', socket, options);
  2276. }
  2277. function onCloseOrRemove(err) {
  2278. self.removeSocket(socket);
  2279. socket.removeListener('free', onFree);
  2280. socket.removeListener('close', onCloseOrRemove);
  2281. socket.removeListener('agentRemove', onCloseOrRemove);
  2282. }
  2283. });
  2284. };
  2285. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2286. var self = this;
  2287. var placeholder = {};
  2288. self.sockets.push(placeholder);
  2289. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2290. method: 'CONNECT',
  2291. path: options.host + ':' + options.port,
  2292. agent: false
  2293. });
  2294. if (connectOptions.proxyAuth) {
  2295. connectOptions.headers = connectOptions.headers || {};
  2296. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2297. new Buffer(connectOptions.proxyAuth).toString('base64');
  2298. }
  2299. debug('making CONNECT request');
  2300. var connectReq = self.request(connectOptions);
  2301. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2302. connectReq.once('response', onResponse); // for v0.6
  2303. connectReq.once('upgrade', onUpgrade); // for v0.6
  2304. connectReq.once('connect', onConnect); // for v0.7 or later
  2305. connectReq.once('error', onError);
  2306. connectReq.end();
  2307. function onResponse(res) {
  2308. // Very hacky. This is necessary to avoid http-parser leaks.
  2309. res.upgrade = true;
  2310. }
  2311. function onUpgrade(res, socket, head) {
  2312. // Hacky.
  2313. process.nextTick(function() {
  2314. onConnect(res, socket, head);
  2315. });
  2316. }
  2317. function onConnect(res, socket, head) {
  2318. connectReq.removeAllListeners();
  2319. socket.removeAllListeners();
  2320. if (res.statusCode === 200) {
  2321. assert.equal(head.length, 0);
  2322. debug('tunneling connection has established');
  2323. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2324. cb(socket);
  2325. } else {
  2326. debug('tunneling socket could not be established, statusCode=%d',
  2327. res.statusCode);
  2328. var error = new Error('tunneling socket could not be established, ' +
  2329. 'statusCode=' + res.statusCode);
  2330. error.code = 'ECONNRESET';
  2331. options.request.emit('error', error);
  2332. self.removeSocket(placeholder);
  2333. }
  2334. }
  2335. function onError(cause) {
  2336. connectReq.removeAllListeners();
  2337. debug('tunneling socket could not be established, cause=%s\n',
  2338. cause.message, cause.stack);
  2339. var error = new Error('tunneling socket could not be established, ' +
  2340. 'cause=' + cause.message);
  2341. error.code = 'ECONNRESET';
  2342. options.request.emit('error', error);
  2343. self.removeSocket(placeholder);
  2344. }
  2345. };
  2346. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2347. var pos = this.sockets.indexOf(socket)
  2348. if (pos === -1) {
  2349. return;
  2350. }
  2351. this.sockets.splice(pos, 1);
  2352. var pending = this.requests.shift();
  2353. if (pending) {
  2354. // If we have pending requests and a socket gets closed a new one
  2355. // needs to be created to take over in the pool for the one that closed.
  2356. this.createSocket(pending, function(socket) {
  2357. pending.request.onSocket(socket);
  2358. });
  2359. }
  2360. };
  2361. function createSecureSocket(options, cb) {
  2362. var self = this;
  2363. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2364. var hostHeader = options.request.getHeader('host');
  2365. var tlsOptions = mergeOptions({}, self.options, {
  2366. socket: socket,
  2367. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2368. });
  2369. // 0 is dummy port for v0.6
  2370. var secureSocket = tls.connect(0, tlsOptions);
  2371. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2372. cb(secureSocket);
  2373. });
  2374. }
  2375. function toOptions(host, port, localAddress) {
  2376. if (typeof host === 'string') { // since v0.10
  2377. return {
  2378. host: host,
  2379. port: port,
  2380. localAddress: localAddress
  2381. };
  2382. }
  2383. return host; // for v0.11 or later
  2384. }
  2385. function mergeOptions(target) {
  2386. for (var i = 1, len = arguments.length; i < len; ++i) {
  2387. var overrides = arguments[i];
  2388. if (typeof overrides === 'object') {
  2389. var keys = Object.keys(overrides);
  2390. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2391. var k = keys[j];
  2392. if (overrides[k] !== undefined) {
  2393. target[k] = overrides[k];
  2394. }
  2395. }
  2396. }
  2397. }
  2398. return target;
  2399. }
  2400. var debug;
  2401. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2402. debug = function() {
  2403. var args = Array.prototype.slice.call(arguments);
  2404. if (typeof args[0] === 'string') {
  2405. args[0] = 'TUNNEL: ' + args[0];
  2406. } else {
  2407. args.unshift('TUNNEL:');
  2408. }
  2409. console.error.apply(console, args);
  2410. }
  2411. } else {
  2412. debug = function() {};
  2413. }
  2414. exports.debug = debug; // for test
  2415. /***/ }),
  2416. /***/ 143:
  2417. /***/ (function(module, __unusedexports, __webpack_require__) {
  2418. module.exports = withAuthorizationPrefix;
  2419. const atob = __webpack_require__(368);
  2420. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2421. function withAuthorizationPrefix(authorization) {
  2422. if (/^(basic|bearer|token) /i.test(authorization)) {
  2423. return authorization;
  2424. }
  2425. try {
  2426. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2427. return `basic ${authorization}`;
  2428. }
  2429. } catch (error) {}
  2430. if (authorization.split(/\./).length === 3) {
  2431. return `bearer ${authorization}`;
  2432. }
  2433. return `token ${authorization}`;
  2434. }
  2435. /***/ }),
  2436. /***/ 145:
  2437. /***/ (function(module, __unusedexports, __webpack_require__) {
  2438. "use strict";
  2439. const pump = __webpack_require__(453);
  2440. const bufferStream = __webpack_require__(966);
  2441. class MaxBufferError extends Error {
  2442. constructor() {
  2443. super('maxBuffer exceeded');
  2444. this.name = 'MaxBufferError';
  2445. }
  2446. }
  2447. function getStream(inputStream, options) {
  2448. if (!inputStream) {
  2449. return Promise.reject(new Error('Expected a stream'));
  2450. }
  2451. options = Object.assign({maxBuffer: Infinity}, options);
  2452. const {maxBuffer} = options;
  2453. let stream;
  2454. return new Promise((resolve, reject) => {
  2455. const rejectPromise = error => {
  2456. if (error) { // A null check
  2457. error.bufferedData = stream.getBufferedValue();
  2458. }
  2459. reject(error);
  2460. };
  2461. stream = pump(inputStream, bufferStream(options), error => {
  2462. if (error) {
  2463. rejectPromise(error);
  2464. return;
  2465. }
  2466. resolve();
  2467. });
  2468. stream.on('data', () => {
  2469. if (stream.getBufferedLength() > maxBuffer) {
  2470. rejectPromise(new MaxBufferError());
  2471. }
  2472. });
  2473. }).then(() => stream.getBufferedValue());
  2474. }
  2475. module.exports = getStream;
  2476. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2477. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2478. module.exports.MaxBufferError = MaxBufferError;
  2479. /***/ }),
  2480. /***/ 148:
  2481. /***/ (function(module, __unusedexports, __webpack_require__) {
  2482. module.exports = paginatePlugin;
  2483. const { paginateRest } = __webpack_require__(299);
  2484. function paginatePlugin(octokit) {
  2485. Object.assign(octokit, paginateRest(octokit));
  2486. }
  2487. /***/ }),
  2488. /***/ 153:
  2489. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2490. "use strict";
  2491. var __importStar = (this && this.__importStar) || function (mod) {
  2492. if (mod && mod.__esModule) return mod;
  2493. var result = {};
  2494. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2495. result["default"] = mod;
  2496. return result;
  2497. };
  2498. Object.defineProperty(exports, "__esModule", { value: true });
  2499. const coreCommand = __importStar(__webpack_require__(431));
  2500. /**
  2501. * Indicates whether the POST action is running
  2502. */
  2503. exports.IsPost = !!process.env['STATE_isPost'];
  2504. /**
  2505. * The repository path for the POST action. The value is empty during the MAIN action.
  2506. */
  2507. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2508. /**
  2509. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2510. */
  2511. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2512. /**
  2513. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2514. */
  2515. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2516. /**
  2517. * Save the repository path so the POST action can retrieve the value.
  2518. */
  2519. function setRepositoryPath(repositoryPath) {
  2520. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2521. }
  2522. exports.setRepositoryPath = setRepositoryPath;
  2523. /**
  2524. * Save the SSH key path so the POST action can retrieve the value.
  2525. */
  2526. function setSshKeyPath(sshKeyPath) {
  2527. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2528. }
  2529. exports.setSshKeyPath = setSshKeyPath;
  2530. /**
  2531. * Save the SSH known hosts path so the POST action can retrieve the value.
  2532. */
  2533. function setSshKnownHostsPath(sshKnownHostsPath) {
  2534. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2535. }
  2536. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2537. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2538. // This is necessary since we don't have a separate entry point.
  2539. if (!exports.IsPost) {
  2540. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2541. }
  2542. /***/ }),
  2543. /***/ 168:
  2544. /***/ (function(module) {
  2545. "use strict";
  2546. const alias = ['stdin', 'stdout', 'stderr'];
  2547. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2548. module.exports = opts => {
  2549. if (!opts) {
  2550. return null;
  2551. }
  2552. if (opts.stdio && hasAlias(opts)) {
  2553. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2554. }
  2555. if (typeof opts.stdio === 'string') {
  2556. return opts.stdio;
  2557. }
  2558. const stdio = opts.stdio || [];
  2559. if (!Array.isArray(stdio)) {
  2560. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2561. }
  2562. const result = [];
  2563. const len = Math.max(stdio.length, alias.length);
  2564. for (let i = 0; i < len; i++) {
  2565. let value = null;
  2566. if (stdio[i] !== undefined) {
  2567. value = stdio[i];
  2568. } else if (opts[alias[i]] !== undefined) {
  2569. value = opts[alias[i]];
  2570. }
  2571. result[i] = value;
  2572. }
  2573. return result;
  2574. };
  2575. /***/ }),
  2576. /***/ 179:
  2577. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2578. "use strict";
  2579. var net = __webpack_require__(631);
  2580. var tls = __webpack_require__(16);
  2581. var http = __webpack_require__(605);
  2582. var https = __webpack_require__(34);
  2583. var events = __webpack_require__(614);
  2584. var assert = __webpack_require__(357);
  2585. var util = __webpack_require__(669);
  2586. exports.httpOverHttp = httpOverHttp;
  2587. exports.httpsOverHttp = httpsOverHttp;
  2588. exports.httpOverHttps = httpOverHttps;
  2589. exports.httpsOverHttps = httpsOverHttps;
  2590. function httpOverHttp(options) {
  2591. var agent = new TunnelingAgent(options);
  2592. agent.request = http.request;
  2593. return agent;
  2594. }
  2595. function httpsOverHttp(options) {
  2596. var agent = new TunnelingAgent(options);
  2597. agent.request = http.request;
  2598. agent.createSocket = createSecureSocket;
  2599. agent.defaultPort = 443;
  2600. return agent;
  2601. }
  2602. function httpOverHttps(options) {
  2603. var agent = new TunnelingAgent(options);
  2604. agent.request = https.request;
  2605. return agent;
  2606. }
  2607. function httpsOverHttps(options) {
  2608. var agent = new TunnelingAgent(options);
  2609. agent.request = https.request;
  2610. agent.createSocket = createSecureSocket;
  2611. agent.defaultPort = 443;
  2612. return agent;
  2613. }
  2614. function TunnelingAgent(options) {
  2615. var self = this;
  2616. self.options = options || {};
  2617. self.proxyOptions = self.options.proxy || {};
  2618. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2619. self.requests = [];
  2620. self.sockets = [];
  2621. self.on('free', function onFree(socket, host, port, localAddress) {
  2622. var options = toOptions(host, port, localAddress);
  2623. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2624. var pending = self.requests[i];
  2625. if (pending.host === options.host && pending.port === options.port) {
  2626. // Detect the request to connect same origin server,
  2627. // reuse the connection.
  2628. self.requests.splice(i, 1);
  2629. pending.request.onSocket(socket);
  2630. return;
  2631. }
  2632. }
  2633. socket.destroy();
  2634. self.removeSocket(socket);
  2635. });
  2636. }
  2637. util.inherits(TunnelingAgent, events.EventEmitter);
  2638. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2639. var self = this;
  2640. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2641. if (self.sockets.length >= this.maxSockets) {
  2642. // We are over limit so we'll add it to the queue.
  2643. self.requests.push(options);
  2644. return;
  2645. }
  2646. // If we are under maxSockets create a new one.
  2647. self.createSocket(options, function(socket) {
  2648. socket.on('free', onFree);
  2649. socket.on('close', onCloseOrRemove);
  2650. socket.on('agentRemove', onCloseOrRemove);
  2651. req.onSocket(socket);
  2652. function onFree() {
  2653. self.emit('free', socket, options);
  2654. }
  2655. function onCloseOrRemove(err) {
  2656. self.removeSocket(socket);
  2657. socket.removeListener('free', onFree);
  2658. socket.removeListener('close', onCloseOrRemove);
  2659. socket.removeListener('agentRemove', onCloseOrRemove);
  2660. }
  2661. });
  2662. };
  2663. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2664. var self = this;
  2665. var placeholder = {};
  2666. self.sockets.push(placeholder);
  2667. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2668. method: 'CONNECT',
  2669. path: options.host + ':' + options.port,
  2670. agent: false,
  2671. headers: {
  2672. host: options.host + ':' + options.port
  2673. }
  2674. });
  2675. if (options.localAddress) {
  2676. connectOptions.localAddress = options.localAddress;
  2677. }
  2678. if (connectOptions.proxyAuth) {
  2679. connectOptions.headers = connectOptions.headers || {};
  2680. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2681. new Buffer(connectOptions.proxyAuth).toString('base64');
  2682. }
  2683. debug('making CONNECT request');
  2684. var connectReq = self.request(connectOptions);
  2685. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2686. connectReq.once('response', onResponse); // for v0.6
  2687. connectReq.once('upgrade', onUpgrade); // for v0.6
  2688. connectReq.once('connect', onConnect); // for v0.7 or later
  2689. connectReq.once('error', onError);
  2690. connectReq.end();
  2691. function onResponse(res) {
  2692. // Very hacky. This is necessary to avoid http-parser leaks.
  2693. res.upgrade = true;
  2694. }
  2695. function onUpgrade(res, socket, head) {
  2696. // Hacky.
  2697. process.nextTick(function() {
  2698. onConnect(res, socket, head);
  2699. });
  2700. }
  2701. function onConnect(res, socket, head) {
  2702. connectReq.removeAllListeners();
  2703. socket.removeAllListeners();
  2704. if (res.statusCode !== 200) {
  2705. debug('tunneling socket could not be established, statusCode=%d',
  2706. res.statusCode);
  2707. socket.destroy();
  2708. var error = new Error('tunneling socket could not be established, ' +
  2709. 'statusCode=' + res.statusCode);
  2710. error.code = 'ECONNRESET';
  2711. options.request.emit('error', error);
  2712. self.removeSocket(placeholder);
  2713. return;
  2714. }
  2715. if (head.length > 0) {
  2716. debug('got illegal response body from proxy');
  2717. socket.destroy();
  2718. var error = new Error('got illegal response body from proxy');
  2719. error.code = 'ECONNRESET';
  2720. options.request.emit('error', error);
  2721. self.removeSocket(placeholder);
  2722. return;
  2723. }
  2724. debug('tunneling connection has established');
  2725. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2726. return cb(socket);
  2727. }
  2728. function onError(cause) {
  2729. connectReq.removeAllListeners();
  2730. debug('tunneling socket could not be established, cause=%s\n',
  2731. cause.message, cause.stack);
  2732. var error = new Error('tunneling socket could not be established, ' +
  2733. 'cause=' + cause.message);
  2734. error.code = 'ECONNRESET';
  2735. options.request.emit('error', error);
  2736. self.removeSocket(placeholder);
  2737. }
  2738. };
  2739. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2740. var pos = this.sockets.indexOf(socket)
  2741. if (pos === -1) {
  2742. return;
  2743. }
  2744. this.sockets.splice(pos, 1);
  2745. var pending = this.requests.shift();
  2746. if (pending) {
  2747. // If we have pending requests and a socket gets closed a new one
  2748. // needs to be created to take over in the pool for the one that closed.
  2749. this.createSocket(pending, function(socket) {
  2750. pending.request.onSocket(socket);
  2751. });
  2752. }
  2753. };
  2754. function createSecureSocket(options, cb) {
  2755. var self = this;
  2756. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2757. var hostHeader = options.request.getHeader('host');
  2758. var tlsOptions = mergeOptions({}, self.options, {
  2759. socket: socket,
  2760. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2761. });
  2762. // 0 is dummy port for v0.6
  2763. var secureSocket = tls.connect(0, tlsOptions);
  2764. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2765. cb(secureSocket);
  2766. });
  2767. }
  2768. function toOptions(host, port, localAddress) {
  2769. if (typeof host === 'string') { // since v0.10
  2770. return {
  2771. host: host,
  2772. port: port,
  2773. localAddress: localAddress
  2774. };
  2775. }
  2776. return host; // for v0.11 or later
  2777. }
  2778. function mergeOptions(target) {
  2779. for (var i = 1, len = arguments.length; i < len; ++i) {
  2780. var overrides = arguments[i];
  2781. if (typeof overrides === 'object') {
  2782. var keys = Object.keys(overrides);
  2783. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2784. var k = keys[j];
  2785. if (overrides[k] !== undefined) {
  2786. target[k] = overrides[k];
  2787. }
  2788. }
  2789. }
  2790. }
  2791. return target;
  2792. }
  2793. var debug;
  2794. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2795. debug = function() {
  2796. var args = Array.prototype.slice.call(arguments);
  2797. if (typeof args[0] === 'string') {
  2798. args[0] = 'TUNNEL: ' + args[0];
  2799. } else {
  2800. args.unshift('TUNNEL:');
  2801. }
  2802. console.error.apply(console, args);
  2803. }
  2804. } else {
  2805. debug = function() {};
  2806. }
  2807. exports.debug = debug; // for test
  2808. /***/ }),
  2809. /***/ 190:
  2810. /***/ (function(module, __unusedexports, __webpack_require__) {
  2811. module.exports = authenticationPlugin;
  2812. const { createTokenAuth } = __webpack_require__(813);
  2813. const { Deprecation } = __webpack_require__(692);
  2814. const once = __webpack_require__(969);
  2815. const beforeRequest = __webpack_require__(863);
  2816. const requestError = __webpack_require__(991);
  2817. const validate = __webpack_require__(954);
  2818. const withAuthorizationPrefix = __webpack_require__(143);
  2819. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2820. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2821. function authenticationPlugin(octokit, options) {
  2822. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2823. if (options.authStrategy) {
  2824. const auth = options.authStrategy(options.auth);
  2825. octokit.hook.wrap("request", auth.hook);
  2826. octokit.auth = auth;
  2827. return;
  2828. }
  2829. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2830. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2831. if (!options.auth) {
  2832. octokit.auth = () =>
  2833. Promise.resolve({
  2834. type: "unauthenticated"
  2835. });
  2836. return;
  2837. }
  2838. const isBasicAuthString =
  2839. typeof options.auth === "string" &&
  2840. /^basic/.test(withAuthorizationPrefix(options.auth));
  2841. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2842. if (typeof options.auth === "string" && !isBasicAuthString) {
  2843. const auth = createTokenAuth(options.auth);
  2844. octokit.hook.wrap("request", auth.hook);
  2845. octokit.auth = auth;
  2846. return;
  2847. }
  2848. // Otherwise log a deprecation message
  2849. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2850. ? [
  2851. deprecateAuthBasic,
  2852. '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)'
  2853. ]
  2854. : [
  2855. deprecateAuthObject,
  2856. '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)'
  2857. ];
  2858. deprecationMethod(
  2859. octokit.log,
  2860. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2861. );
  2862. octokit.auth = () =>
  2863. Promise.resolve({
  2864. type: "deprecated",
  2865. message: deprecationMessapge
  2866. });
  2867. validate(options.auth);
  2868. const state = {
  2869. octokit,
  2870. auth: options.auth
  2871. };
  2872. octokit.hook.before("request", beforeRequest.bind(null, state));
  2873. octokit.hook.error("request", requestError.bind(null, state));
  2874. }
  2875. /***/ }),
  2876. /***/ 197:
  2877. /***/ (function(module, __unusedexports, __webpack_require__) {
  2878. module.exports = isexe
  2879. isexe.sync = sync
  2880. var fs = __webpack_require__(747)
  2881. function isexe (path, options, cb) {
  2882. fs.stat(path, function (er, stat) {
  2883. cb(er, er ? false : checkStat(stat, options))
  2884. })
  2885. }
  2886. function sync (path, options) {
  2887. return checkStat(fs.statSync(path), options)
  2888. }
  2889. function checkStat (stat, options) {
  2890. return stat.isFile() && checkMode(stat, options)
  2891. }
  2892. function checkMode (stat, options) {
  2893. var mod = stat.mode
  2894. var uid = stat.uid
  2895. var gid = stat.gid
  2896. var myUid = options.uid !== undefined ?
  2897. options.uid : process.getuid && process.getuid()
  2898. var myGid = options.gid !== undefined ?
  2899. options.gid : process.getgid && process.getgid()
  2900. var u = parseInt('100', 8)
  2901. var g = parseInt('010', 8)
  2902. var o = parseInt('001', 8)
  2903. var ug = u | g
  2904. var ret = (mod & o) ||
  2905. (mod & g) && gid === myGid ||
  2906. (mod & u) && uid === myUid ||
  2907. (mod & ug) && myUid === 0
  2908. return ret
  2909. }
  2910. /***/ }),
  2911. /***/ 198:
  2912. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2913. "use strict";
  2914. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2915. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2916. return new (P || (P = Promise))(function (resolve, reject) {
  2917. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2918. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2919. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2920. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2921. });
  2922. };
  2923. var __importStar = (this && this.__importStar) || function (mod) {
  2924. if (mod && mod.__esModule) return mod;
  2925. var result = {};
  2926. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2927. result["default"] = mod;
  2928. return result;
  2929. };
  2930. Object.defineProperty(exports, "__esModule", { value: true });
  2931. const core = __importStar(__webpack_require__(470));
  2932. const coreCommand = __importStar(__webpack_require__(431));
  2933. const gitSourceProvider = __importStar(__webpack_require__(293));
  2934. const inputHelper = __importStar(__webpack_require__(821));
  2935. const path = __importStar(__webpack_require__(622));
  2936. const stateHelper = __importStar(__webpack_require__(153));
  2937. function run() {
  2938. return __awaiter(this, void 0, void 0, function* () {
  2939. try {
  2940. const sourceSettings = inputHelper.getInputs();
  2941. try {
  2942. // Register problem matcher
  2943. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2944. // Get sources
  2945. yield gitSourceProvider.getSource(sourceSettings);
  2946. }
  2947. finally {
  2948. // Unregister problem matcher
  2949. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2950. }
  2951. }
  2952. catch (error) {
  2953. core.setFailed(error.message);
  2954. }
  2955. });
  2956. }
  2957. function cleanup() {
  2958. return __awaiter(this, void 0, void 0, function* () {
  2959. try {
  2960. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2961. }
  2962. catch (error) {
  2963. core.warning(error.message);
  2964. }
  2965. });
  2966. }
  2967. // Main
  2968. if (!stateHelper.IsPost) {
  2969. run();
  2970. }
  2971. // Post
  2972. else {
  2973. cleanup();
  2974. }
  2975. /***/ }),
  2976. /***/ 211:
  2977. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2978. "use strict";
  2979. Object.defineProperty(exports, '__esModule', { value: true });
  2980. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2981. var osName = _interopDefault(__webpack_require__(2));
  2982. function getUserAgent() {
  2983. try {
  2984. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2985. } catch (error) {
  2986. if (/wmic os get Caption/.test(error.message)) {
  2987. return "Windows <version undetectable>";
  2988. }
  2989. return "<environment undetectable>";
  2990. }
  2991. }
  2992. exports.getUserAgent = getUserAgent;
  2993. //# sourceMappingURL=index.js.map
  2994. /***/ }),
  2995. /***/ 215:
  2996. /***/ (function(module) {
  2997. 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"};
  2998. /***/ }),
  2999. /***/ 227:
  3000. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3001. "use strict";
  3002. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3003. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3004. return new (P || (P = Promise))(function (resolve, reject) {
  3005. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3006. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3007. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3008. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3009. });
  3010. };
  3011. var __importStar = (this && this.__importStar) || function (mod) {
  3012. if (mod && mod.__esModule) return mod;
  3013. var result = {};
  3014. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  3015. result["default"] = mod;
  3016. return result;
  3017. };
  3018. Object.defineProperty(exports, "__esModule", { value: true });
  3019. const url_1 = __webpack_require__(835);
  3020. const core = __importStar(__webpack_require__(470));
  3021. const github = __importStar(__webpack_require__(469));
  3022. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  3023. function getCheckoutInfo(git, ref, commit) {
  3024. return __awaiter(this, void 0, void 0, function* () {
  3025. if (!git) {
  3026. throw new Error('Arg git cannot be empty');
  3027. }
  3028. if (!ref && !commit) {
  3029. throw new Error('Args ref and commit cannot both be empty');
  3030. }
  3031. const result = {};
  3032. const upperRef = (ref || '').toUpperCase();
  3033. // SHA only
  3034. if (!ref) {
  3035. result.ref = commit;
  3036. }
  3037. // refs/heads/
  3038. else if (upperRef.startsWith('REFS/HEADS/')) {
  3039. const branch = ref.substring('refs/heads/'.length);
  3040. result.ref = branch;
  3041. result.startPoint = `refs/remotes/origin/${branch}`;
  3042. }
  3043. // refs/pull/
  3044. else if (upperRef.startsWith('REFS/PULL/')) {
  3045. const branch = ref.substring('refs/pull/'.length);
  3046. result.ref = `refs/remotes/pull/${branch}`;
  3047. }
  3048. // refs/tags/
  3049. else if (upperRef.startsWith('REFS/')) {
  3050. result.ref = ref;
  3051. }
  3052. // Unqualified ref, check for a matching branch or tag
  3053. else {
  3054. if (yield git.branchExists(true, `origin/${ref}`)) {
  3055. result.ref = ref;
  3056. result.startPoint = `refs/remotes/origin/${ref}`;
  3057. }
  3058. else if (yield git.tagExists(`${ref}`)) {
  3059. result.ref = `refs/tags/${ref}`;
  3060. }
  3061. else {
  3062. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3063. }
  3064. }
  3065. return result;
  3066. });
  3067. }
  3068. exports.getCheckoutInfo = getCheckoutInfo;
  3069. function getRefSpecForAllHistory(ref, commit) {
  3070. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  3071. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  3072. const branch = ref.substring('refs/pull/'.length);
  3073. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  3074. }
  3075. return result;
  3076. }
  3077. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  3078. function getRefSpec(ref, commit) {
  3079. if (!ref && !commit) {
  3080. throw new Error('Args ref and commit cannot both be empty');
  3081. }
  3082. const upperRef = (ref || '').toUpperCase();
  3083. // SHA
  3084. if (commit) {
  3085. // refs/heads
  3086. if (upperRef.startsWith('REFS/HEADS/')) {
  3087. const branch = ref.substring('refs/heads/'.length);
  3088. return [`+${commit}:refs/remotes/origin/${branch}`];
  3089. }
  3090. // refs/pull/
  3091. else if (upperRef.startsWith('REFS/PULL/')) {
  3092. const branch = ref.substring('refs/pull/'.length);
  3093. return [`+${commit}:refs/remotes/pull/${branch}`];
  3094. }
  3095. // refs/tags/
  3096. else if (upperRef.startsWith('REFS/TAGS/')) {
  3097. return [`+${commit}:${ref}`];
  3098. }
  3099. // Otherwise no destination ref
  3100. else {
  3101. return [commit];
  3102. }
  3103. }
  3104. // Unqualified ref, check for a matching branch or tag
  3105. else if (!upperRef.startsWith('REFS/')) {
  3106. return [
  3107. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3108. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3109. ];
  3110. }
  3111. // refs/heads/
  3112. else if (upperRef.startsWith('REFS/HEADS/')) {
  3113. const branch = ref.substring('refs/heads/'.length);
  3114. return [`+${ref}:refs/remotes/origin/${branch}`];
  3115. }
  3116. // refs/pull/
  3117. else if (upperRef.startsWith('REFS/PULL/')) {
  3118. const branch = ref.substring('refs/pull/'.length);
  3119. return [`+${ref}:refs/remotes/pull/${branch}`];
  3120. }
  3121. // refs/tags/
  3122. else {
  3123. return [`+${ref}:${ref}`];
  3124. }
  3125. }
  3126. exports.getRefSpec = getRefSpec;
  3127. /**
  3128. * Tests whether the initial fetch created the ref at the expected commit
  3129. */
  3130. function testRef(git, ref, commit) {
  3131. return __awaiter(this, void 0, void 0, function* () {
  3132. if (!git) {
  3133. throw new Error('Arg git cannot be empty');
  3134. }
  3135. if (!ref && !commit) {
  3136. throw new Error('Args ref and commit cannot both be empty');
  3137. }
  3138. // No SHA? Nothing to test
  3139. if (!commit) {
  3140. return true;
  3141. }
  3142. // SHA only?
  3143. else if (!ref) {
  3144. return yield git.shaExists(commit);
  3145. }
  3146. const upperRef = ref.toUpperCase();
  3147. // refs/heads/
  3148. if (upperRef.startsWith('REFS/HEADS/')) {
  3149. const branch = ref.substring('refs/heads/'.length);
  3150. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  3151. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  3152. }
  3153. // refs/pull/
  3154. else if (upperRef.startsWith('REFS/PULL/')) {
  3155. // Assume matches because fetched using the commit
  3156. return true;
  3157. }
  3158. // refs/tags/
  3159. else if (upperRef.startsWith('REFS/TAGS/')) {
  3160. const tagName = ref.substring('refs/tags/'.length);
  3161. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  3162. }
  3163. // Unexpected
  3164. else {
  3165. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  3166. return true;
  3167. }
  3168. });
  3169. }
  3170. exports.testRef = testRef;
  3171. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3172. return __awaiter(this, void 0, void 0, function* () {
  3173. try {
  3174. // GHES?
  3175. if (isGhes()) {
  3176. return;
  3177. }
  3178. // Auth token?
  3179. if (!token) {
  3180. return;
  3181. }
  3182. // Public PR synchronize, for workflow repo?
  3183. if (fromPayload('repository.private') !== false ||
  3184. github.context.eventName !== 'pull_request' ||
  3185. fromPayload('action') !== 'synchronize' ||
  3186. repositoryOwner !== github.context.repo.owner ||
  3187. repositoryName !== github.context.repo.repo ||
  3188. ref !== github.context.ref ||
  3189. !ref.startsWith('refs/pull/') ||
  3190. commit !== github.context.sha) {
  3191. return;
  3192. }
  3193. // Head SHA
  3194. const expectedHeadSha = fromPayload('after');
  3195. if (!expectedHeadSha) {
  3196. core.debug('Unable to determine head sha');
  3197. return;
  3198. }
  3199. // Base SHA
  3200. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3201. if (!expectedBaseSha) {
  3202. core.debug('Unable to determine base sha');
  3203. return;
  3204. }
  3205. // Expected message?
  3206. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3207. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3208. return;
  3209. }
  3210. // Extract details from message
  3211. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3212. if (!match) {
  3213. core.debug('Unexpected message format');
  3214. return;
  3215. }
  3216. // Post telemetry
  3217. const actualHeadSha = match[1];
  3218. if (actualHeadSha !== expectedHeadSha) {
  3219. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3220. const octokit = new github.GitHub(token, {
  3221. 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})`
  3222. });
  3223. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3224. }
  3225. }
  3226. catch (err) {
  3227. core.debug(`Error when validating commit info: ${err.stack}`);
  3228. }
  3229. });
  3230. }
  3231. exports.checkCommitInfo = checkCommitInfo;
  3232. function fromPayload(path) {
  3233. return select(github.context.payload, path);
  3234. }
  3235. function select(obj, path) {
  3236. if (!obj) {
  3237. return undefined;
  3238. }
  3239. const i = path.indexOf('.');
  3240. if (i < 0) {
  3241. return obj[path];
  3242. }
  3243. const key = path.substr(0, i);
  3244. return select(obj[key], path.substr(i + 1));
  3245. }
  3246. function isGhes() {
  3247. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3248. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3249. }
  3250. /***/ }),
  3251. /***/ 260:
  3252. /***/ (function(module, __unusedexports, __webpack_require__) {
  3253. // Note: since nyc uses this module to output coverage, any lines
  3254. // that are in the direct sync flow of nyc's outputCoverage are
  3255. // ignored, since we can never get coverage for them.
  3256. var assert = __webpack_require__(357)
  3257. var signals = __webpack_require__(654)
  3258. var EE = __webpack_require__(614)
  3259. /* istanbul ignore if */
  3260. if (typeof EE !== 'function') {
  3261. EE = EE.EventEmitter
  3262. }
  3263. var emitter
  3264. if (process.__signal_exit_emitter__) {
  3265. emitter = process.__signal_exit_emitter__
  3266. } else {
  3267. emitter = process.__signal_exit_emitter__ = new EE()
  3268. emitter.count = 0
  3269. emitter.emitted = {}
  3270. }
  3271. // Because this emitter is a global, we have to check to see if a
  3272. // previous version of this library failed to enable infinite listeners.
  3273. // I know what you're about to say. But literally everything about
  3274. // signal-exit is a compromise with evil. Get used to it.
  3275. if (!emitter.infinite) {
  3276. emitter.setMaxListeners(Infinity)
  3277. emitter.infinite = true
  3278. }
  3279. module.exports = function (cb, opts) {
  3280. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3281. if (loaded === false) {
  3282. load()
  3283. }
  3284. var ev = 'exit'
  3285. if (opts && opts.alwaysLast) {
  3286. ev = 'afterexit'
  3287. }
  3288. var remove = function () {
  3289. emitter.removeListener(ev, cb)
  3290. if (emitter.listeners('exit').length === 0 &&
  3291. emitter.listeners('afterexit').length === 0) {
  3292. unload()
  3293. }
  3294. }
  3295. emitter.on(ev, cb)
  3296. return remove
  3297. }
  3298. module.exports.unload = unload
  3299. function unload () {
  3300. if (!loaded) {
  3301. return
  3302. }
  3303. loaded = false
  3304. signals.forEach(function (sig) {
  3305. try {
  3306. process.removeListener(sig, sigListeners[sig])
  3307. } catch (er) {}
  3308. })
  3309. process.emit = originalProcessEmit
  3310. process.reallyExit = originalProcessReallyExit
  3311. emitter.count -= 1
  3312. }
  3313. function emit (event, code, signal) {
  3314. if (emitter.emitted[event]) {
  3315. return
  3316. }
  3317. emitter.emitted[event] = true
  3318. emitter.emit(event, code, signal)
  3319. }
  3320. // { <signal>: <listener fn>, ... }
  3321. var sigListeners = {}
  3322. signals.forEach(function (sig) {
  3323. sigListeners[sig] = function listener () {
  3324. // If there are no other listeners, an exit is coming!
  3325. // Simplest way: remove us and then re-send the signal.
  3326. // We know that this will kill the process, so we can
  3327. // safely emit now.
  3328. var listeners = process.listeners(sig)
  3329. if (listeners.length === emitter.count) {
  3330. unload()
  3331. emit('exit', null, sig)
  3332. /* istanbul ignore next */
  3333. emit('afterexit', null, sig)
  3334. /* istanbul ignore next */
  3335. process.kill(process.pid, sig)
  3336. }
  3337. }
  3338. })
  3339. module.exports.signals = function () {
  3340. return signals
  3341. }
  3342. module.exports.load = load
  3343. var loaded = false
  3344. function load () {
  3345. if (loaded) {
  3346. return
  3347. }
  3348. loaded = true
  3349. // This is the number of onSignalExit's that are in play.
  3350. // It's important so that we can count the correct number of
  3351. // listeners on signals, and don't wait for the other one to
  3352. // handle it instead of us.
  3353. emitter.count += 1
  3354. signals = signals.filter(function (sig) {
  3355. try {
  3356. process.on(sig, sigListeners[sig])
  3357. return true
  3358. } catch (er) {
  3359. return false
  3360. }
  3361. })
  3362. process.emit = processEmit
  3363. process.reallyExit = processReallyExit
  3364. }
  3365. var originalProcessReallyExit = process.reallyExit
  3366. function processReallyExit (code) {
  3367. process.exitCode = code || 0
  3368. emit('exit', process.exitCode, null)
  3369. /* istanbul ignore next */
  3370. emit('afterexit', process.exitCode, null)
  3371. /* istanbul ignore next */
  3372. originalProcessReallyExit.call(process, process.exitCode)
  3373. }
  3374. var originalProcessEmit = process.emit
  3375. function processEmit (ev, arg) {
  3376. if (ev === 'exit') {
  3377. if (arg !== undefined) {
  3378. process.exitCode = arg
  3379. }
  3380. var ret = originalProcessEmit.apply(this, arguments)
  3381. emit('exit', process.exitCode, null)
  3382. /* istanbul ignore next */
  3383. emit('afterexit', process.exitCode, null)
  3384. return ret
  3385. } else {
  3386. return originalProcessEmit.apply(this, arguments)
  3387. }
  3388. }
  3389. /***/ }),
  3390. /***/ 262:
  3391. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3392. "use strict";
  3393. Object.defineProperty(exports, "__esModule", { value: true });
  3394. const fs_1 = __webpack_require__(747);
  3395. const os_1 = __webpack_require__(87);
  3396. class Context {
  3397. /**
  3398. * Hydrate the context from the environment
  3399. */
  3400. constructor() {
  3401. this.payload = {};
  3402. if (process.env.GITHUB_EVENT_PATH) {
  3403. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3404. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3405. }
  3406. else {
  3407. const path = process.env.GITHUB_EVENT_PATH;
  3408. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3409. }
  3410. }
  3411. this.eventName = process.env.GITHUB_EVENT_NAME;
  3412. this.sha = process.env.GITHUB_SHA;
  3413. this.ref = process.env.GITHUB_REF;
  3414. this.workflow = process.env.GITHUB_WORKFLOW;
  3415. this.action = process.env.GITHUB_ACTION;
  3416. this.actor = process.env.GITHUB_ACTOR;
  3417. }
  3418. get issue() {
  3419. const payload = this.payload;
  3420. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3421. }
  3422. get repo() {
  3423. if (process.env.GITHUB_REPOSITORY) {
  3424. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3425. return { owner, repo };
  3426. }
  3427. if (this.payload.repository) {
  3428. return {
  3429. owner: this.payload.repository.owner.login,
  3430. repo: this.payload.repository.name
  3431. };
  3432. }
  3433. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3434. }
  3435. }
  3436. exports.Context = Context;
  3437. //# sourceMappingURL=context.js.map
  3438. /***/ }),
  3439. /***/ 265:
  3440. /***/ (function(module, __unusedexports, __webpack_require__) {
  3441. module.exports = getPage
  3442. const deprecate = __webpack_require__(370)
  3443. const getPageLinks = __webpack_require__(577)
  3444. const HttpError = __webpack_require__(297)
  3445. function getPage (octokit, link, which, headers) {
  3446. 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.`)
  3447. const url = getPageLinks(link)[which]
  3448. if (!url) {
  3449. const urlError = new HttpError(`No ${which} page found`, 404)
  3450. return Promise.reject(urlError)
  3451. }
  3452. const requestOptions = {
  3453. url,
  3454. headers: applyAcceptHeader(link, headers)
  3455. }
  3456. const promise = octokit.request(requestOptions)
  3457. return promise
  3458. }
  3459. function applyAcceptHeader (res, headers) {
  3460. const previous = res.headers && res.headers['x-github-media-type']
  3461. if (!previous || (headers && headers.accept)) {
  3462. return headers
  3463. }
  3464. headers = headers || {}
  3465. headers.accept = 'application/vnd.' + previous
  3466. .replace('; param=', '.')
  3467. .replace('; format=', '+')
  3468. return headers
  3469. }
  3470. /***/ }),
  3471. /***/ 280:
  3472. /***/ (function(module, exports) {
  3473. exports = module.exports = SemVer
  3474. var debug
  3475. /* istanbul ignore next */
  3476. if (typeof process === 'object' &&
  3477. process.env &&
  3478. process.env.NODE_DEBUG &&
  3479. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3480. debug = function () {
  3481. var args = Array.prototype.slice.call(arguments, 0)
  3482. args.unshift('SEMVER')
  3483. console.log.apply(console, args)
  3484. }
  3485. } else {
  3486. debug = function () {}
  3487. }
  3488. // Note: this is the semver.org version of the spec that it implements
  3489. // Not necessarily the package version of this code.
  3490. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3491. var MAX_LENGTH = 256
  3492. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3493. /* istanbul ignore next */ 9007199254740991
  3494. // Max safe segment length for coercion.
  3495. var MAX_SAFE_COMPONENT_LENGTH = 16
  3496. // The actual regexps go on exports.re
  3497. var re = exports.re = []
  3498. var src = exports.src = []
  3499. var R = 0
  3500. // The following Regular Expressions can be used for tokenizing,
  3501. // validating, and parsing SemVer version strings.
  3502. // ## Numeric Identifier
  3503. // A single `0`, or a non-zero digit followed by zero or more digits.
  3504. var NUMERICIDENTIFIER = R++
  3505. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3506. var NUMERICIDENTIFIERLOOSE = R++
  3507. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3508. // ## Non-numeric Identifier
  3509. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3510. // more letters, digits, or hyphens.
  3511. var NONNUMERICIDENTIFIER = R++
  3512. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3513. // ## Main Version
  3514. // Three dot-separated numeric identifiers.
  3515. var MAINVERSION = R++
  3516. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3517. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3518. '(' + src[NUMERICIDENTIFIER] + ')'
  3519. var MAINVERSIONLOOSE = R++
  3520. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3521. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3522. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3523. // ## Pre-release Version Identifier
  3524. // A numeric identifier, or a non-numeric identifier.
  3525. var PRERELEASEIDENTIFIER = R++
  3526. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3527. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3528. var PRERELEASEIDENTIFIERLOOSE = R++
  3529. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3530. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3531. // ## Pre-release Version
  3532. // Hyphen, followed by one or more dot-separated pre-release version
  3533. // identifiers.
  3534. var PRERELEASE = R++
  3535. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3536. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3537. var PRERELEASELOOSE = R++
  3538. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3539. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3540. // ## Build Metadata Identifier
  3541. // Any combination of digits, letters, or hyphens.
  3542. var BUILDIDENTIFIER = R++
  3543. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3544. // ## Build Metadata
  3545. // Plus sign, followed by one or more period-separated build metadata
  3546. // identifiers.
  3547. var BUILD = R++
  3548. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3549. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3550. // ## Full Version String
  3551. // A main version, followed optionally by a pre-release version and
  3552. // build metadata.
  3553. // Note that the only major, minor, patch, and pre-release sections of
  3554. // the version string are capturing groups. The build metadata is not a
  3555. // capturing group, because it should not ever be used in version
  3556. // comparison.
  3557. var FULL = R++
  3558. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3559. src[PRERELEASE] + '?' +
  3560. src[BUILD] + '?'
  3561. src[FULL] = '^' + FULLPLAIN + '$'
  3562. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3563. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3564. // common in the npm registry.
  3565. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3566. src[PRERELEASELOOSE] + '?' +
  3567. src[BUILD] + '?'
  3568. var LOOSE = R++
  3569. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3570. var GTLT = R++
  3571. src[GTLT] = '((?:<|>)?=?)'
  3572. // Something like "2.*" or "1.2.x".
  3573. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3574. // Only the first item is strictly required.
  3575. var XRANGEIDENTIFIERLOOSE = R++
  3576. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3577. var XRANGEIDENTIFIER = R++
  3578. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3579. var XRANGEPLAIN = R++
  3580. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3581. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3582. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3583. '(?:' + src[PRERELEASE] + ')?' +
  3584. src[BUILD] + '?' +
  3585. ')?)?'
  3586. var XRANGEPLAINLOOSE = R++
  3587. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3588. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3589. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3590. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3591. src[BUILD] + '?' +
  3592. ')?)?'
  3593. var XRANGE = R++
  3594. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3595. var XRANGELOOSE = R++
  3596. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3597. // Coercion.
  3598. // Extract anything that could conceivably be a part of a valid semver
  3599. var COERCE = R++
  3600. src[COERCE] = '(?:^|[^\\d])' +
  3601. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3602. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3603. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3604. '(?:$|[^\\d])'
  3605. // Tilde ranges.
  3606. // Meaning is "reasonably at or greater than"
  3607. var LONETILDE = R++
  3608. src[LONETILDE] = '(?:~>?)'
  3609. var TILDETRIM = R++
  3610. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3611. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3612. var tildeTrimReplace = '$1~'
  3613. var TILDE = R++
  3614. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3615. var TILDELOOSE = R++
  3616. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3617. // Caret ranges.
  3618. // Meaning is "at least and backwards compatible with"
  3619. var LONECARET = R++
  3620. src[LONECARET] = '(?:\\^)'
  3621. var CARETTRIM = R++
  3622. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3623. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3624. var caretTrimReplace = '$1^'
  3625. var CARET = R++
  3626. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3627. var CARETLOOSE = R++
  3628. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3629. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3630. var COMPARATORLOOSE = R++
  3631. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3632. var COMPARATOR = R++
  3633. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3634. // An expression to strip any whitespace between the gtlt and the thing
  3635. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3636. var COMPARATORTRIM = R++
  3637. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3638. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3639. // this one has to use the /g flag
  3640. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3641. var comparatorTrimReplace = '$1$2$3'
  3642. // Something like `1.2.3 - 1.2.4`
  3643. // Note that these all use the loose form, because they'll be
  3644. // checked against either the strict or loose comparator form
  3645. // later.
  3646. var HYPHENRANGE = R++
  3647. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3648. '\\s+-\\s+' +
  3649. '(' + src[XRANGEPLAIN] + ')' +
  3650. '\\s*$'
  3651. var HYPHENRANGELOOSE = R++
  3652. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3653. '\\s+-\\s+' +
  3654. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3655. '\\s*$'
  3656. // Star ranges basically just allow anything at all.
  3657. var STAR = R++
  3658. src[STAR] = '(<|>)?=?\\s*\\*'
  3659. // Compile to actual regexp objects.
  3660. // All are flag-free, unless they were created above with a flag.
  3661. for (var i = 0; i < R; i++) {
  3662. debug(i, src[i])
  3663. if (!re[i]) {
  3664. re[i] = new RegExp(src[i])
  3665. }
  3666. }
  3667. exports.parse = parse
  3668. function parse (version, options) {
  3669. if (!options || typeof options !== 'object') {
  3670. options = {
  3671. loose: !!options,
  3672. includePrerelease: false
  3673. }
  3674. }
  3675. if (version instanceof SemVer) {
  3676. return version
  3677. }
  3678. if (typeof version !== 'string') {
  3679. return null
  3680. }
  3681. if (version.length > MAX_LENGTH) {
  3682. return null
  3683. }
  3684. var r = options.loose ? re[LOOSE] : re[FULL]
  3685. if (!r.test(version)) {
  3686. return null
  3687. }
  3688. try {
  3689. return new SemVer(version, options)
  3690. } catch (er) {
  3691. return null
  3692. }
  3693. }
  3694. exports.valid = valid
  3695. function valid (version, options) {
  3696. var v = parse(version, options)
  3697. return v ? v.version : null
  3698. }
  3699. exports.clean = clean
  3700. function clean (version, options) {
  3701. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3702. return s ? s.version : null
  3703. }
  3704. exports.SemVer = SemVer
  3705. function SemVer (version, options) {
  3706. if (!options || typeof options !== 'object') {
  3707. options = {
  3708. loose: !!options,
  3709. includePrerelease: false
  3710. }
  3711. }
  3712. if (version instanceof SemVer) {
  3713. if (version.loose === options.loose) {
  3714. return version
  3715. } else {
  3716. version = version.version
  3717. }
  3718. } else if (typeof version !== 'string') {
  3719. throw new TypeError('Invalid Version: ' + version)
  3720. }
  3721. if (version.length > MAX_LENGTH) {
  3722. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3723. }
  3724. if (!(this instanceof SemVer)) {
  3725. return new SemVer(version, options)
  3726. }
  3727. debug('SemVer', version, options)
  3728. this.options = options
  3729. this.loose = !!options.loose
  3730. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3731. if (!m) {
  3732. throw new TypeError('Invalid Version: ' + version)
  3733. }
  3734. this.raw = version
  3735. // these are actually numbers
  3736. this.major = +m[1]
  3737. this.minor = +m[2]
  3738. this.patch = +m[3]
  3739. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3740. throw new TypeError('Invalid major version')
  3741. }
  3742. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3743. throw new TypeError('Invalid minor version')
  3744. }
  3745. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3746. throw new TypeError('Invalid patch version')
  3747. }
  3748. // numberify any prerelease numeric ids
  3749. if (!m[4]) {
  3750. this.prerelease = []
  3751. } else {
  3752. this.prerelease = m[4].split('.').map(function (id) {
  3753. if (/^[0-9]+$/.test(id)) {
  3754. var num = +id
  3755. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3756. return num
  3757. }
  3758. }
  3759. return id
  3760. })
  3761. }
  3762. this.build = m[5] ? m[5].split('.') : []
  3763. this.format()
  3764. }
  3765. SemVer.prototype.format = function () {
  3766. this.version = this.major + '.' + this.minor + '.' + this.patch
  3767. if (this.prerelease.length) {
  3768. this.version += '-' + this.prerelease.join('.')
  3769. }
  3770. return this.version
  3771. }
  3772. SemVer.prototype.toString = function () {
  3773. return this.version
  3774. }
  3775. SemVer.prototype.compare = function (other) {
  3776. debug('SemVer.compare', this.version, this.options, other)
  3777. if (!(other instanceof SemVer)) {
  3778. other = new SemVer(other, this.options)
  3779. }
  3780. return this.compareMain(other) || this.comparePre(other)
  3781. }
  3782. SemVer.prototype.compareMain = function (other) {
  3783. if (!(other instanceof SemVer)) {
  3784. other = new SemVer(other, this.options)
  3785. }
  3786. return compareIdentifiers(this.major, other.major) ||
  3787. compareIdentifiers(this.minor, other.minor) ||
  3788. compareIdentifiers(this.patch, other.patch)
  3789. }
  3790. SemVer.prototype.comparePre = function (other) {
  3791. if (!(other instanceof SemVer)) {
  3792. other = new SemVer(other, this.options)
  3793. }
  3794. // NOT having a prerelease is > having one
  3795. if (this.prerelease.length && !other.prerelease.length) {
  3796. return -1
  3797. } else if (!this.prerelease.length && other.prerelease.length) {
  3798. return 1
  3799. } else if (!this.prerelease.length && !other.prerelease.length) {
  3800. return 0
  3801. }
  3802. var i = 0
  3803. do {
  3804. var a = this.prerelease[i]
  3805. var b = other.prerelease[i]
  3806. debug('prerelease compare', i, a, b)
  3807. if (a === undefined && b === undefined) {
  3808. return 0
  3809. } else if (b === undefined) {
  3810. return 1
  3811. } else if (a === undefined) {
  3812. return -1
  3813. } else if (a === b) {
  3814. continue
  3815. } else {
  3816. return compareIdentifiers(a, b)
  3817. }
  3818. } while (++i)
  3819. }
  3820. // preminor will bump the version up to the next minor release, and immediately
  3821. // down to pre-release. premajor and prepatch work the same way.
  3822. SemVer.prototype.inc = function (release, identifier) {
  3823. switch (release) {
  3824. case 'premajor':
  3825. this.prerelease.length = 0
  3826. this.patch = 0
  3827. this.minor = 0
  3828. this.major++
  3829. this.inc('pre', identifier)
  3830. break
  3831. case 'preminor':
  3832. this.prerelease.length = 0
  3833. this.patch = 0
  3834. this.minor++
  3835. this.inc('pre', identifier)
  3836. break
  3837. case 'prepatch':
  3838. // If this is already a prerelease, it will bump to the next version
  3839. // drop any prereleases that might already exist, since they are not
  3840. // relevant at this point.
  3841. this.prerelease.length = 0
  3842. this.inc('patch', identifier)
  3843. this.inc('pre', identifier)
  3844. break
  3845. // If the input is a non-prerelease version, this acts the same as
  3846. // prepatch.
  3847. case 'prerelease':
  3848. if (this.prerelease.length === 0) {
  3849. this.inc('patch', identifier)
  3850. }
  3851. this.inc('pre', identifier)
  3852. break
  3853. case 'major':
  3854. // If this is a pre-major version, bump up to the same major version.
  3855. // Otherwise increment major.
  3856. // 1.0.0-5 bumps to 1.0.0
  3857. // 1.1.0 bumps to 2.0.0
  3858. if (this.minor !== 0 ||
  3859. this.patch !== 0 ||
  3860. this.prerelease.length === 0) {
  3861. this.major++
  3862. }
  3863. this.minor = 0
  3864. this.patch = 0
  3865. this.prerelease = []
  3866. break
  3867. case 'minor':
  3868. // If this is a pre-minor version, bump up to the same minor version.
  3869. // Otherwise increment minor.
  3870. // 1.2.0-5 bumps to 1.2.0
  3871. // 1.2.1 bumps to 1.3.0
  3872. if (this.patch !== 0 || this.prerelease.length === 0) {
  3873. this.minor++
  3874. }
  3875. this.patch = 0
  3876. this.prerelease = []
  3877. break
  3878. case 'patch':
  3879. // If this is not a pre-release version, it will increment the patch.
  3880. // If it is a pre-release it will bump up to the same patch version.
  3881. // 1.2.0-5 patches to 1.2.0
  3882. // 1.2.0 patches to 1.2.1
  3883. if (this.prerelease.length === 0) {
  3884. this.patch++
  3885. }
  3886. this.prerelease = []
  3887. break
  3888. // This probably shouldn't be used publicly.
  3889. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3890. case 'pre':
  3891. if (this.prerelease.length === 0) {
  3892. this.prerelease = [0]
  3893. } else {
  3894. var i = this.prerelease.length
  3895. while (--i >= 0) {
  3896. if (typeof this.prerelease[i] === 'number') {
  3897. this.prerelease[i]++
  3898. i = -2
  3899. }
  3900. }
  3901. if (i === -1) {
  3902. // didn't increment anything
  3903. this.prerelease.push(0)
  3904. }
  3905. }
  3906. if (identifier) {
  3907. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3908. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3909. if (this.prerelease[0] === identifier) {
  3910. if (isNaN(this.prerelease[1])) {
  3911. this.prerelease = [identifier, 0]
  3912. }
  3913. } else {
  3914. this.prerelease = [identifier, 0]
  3915. }
  3916. }
  3917. break
  3918. default:
  3919. throw new Error('invalid increment argument: ' + release)
  3920. }
  3921. this.format()
  3922. this.raw = this.version
  3923. return this
  3924. }
  3925. exports.inc = inc
  3926. function inc (version, release, loose, identifier) {
  3927. if (typeof (loose) === 'string') {
  3928. identifier = loose
  3929. loose = undefined
  3930. }
  3931. try {
  3932. return new SemVer(version, loose).inc(release, identifier).version
  3933. } catch (er) {
  3934. return null
  3935. }
  3936. }
  3937. exports.diff = diff
  3938. function diff (version1, version2) {
  3939. if (eq(version1, version2)) {
  3940. return null
  3941. } else {
  3942. var v1 = parse(version1)
  3943. var v2 = parse(version2)
  3944. var prefix = ''
  3945. if (v1.prerelease.length || v2.prerelease.length) {
  3946. prefix = 'pre'
  3947. var defaultResult = 'prerelease'
  3948. }
  3949. for (var key in v1) {
  3950. if (key === 'major' || key === 'minor' || key === 'patch') {
  3951. if (v1[key] !== v2[key]) {
  3952. return prefix + key
  3953. }
  3954. }
  3955. }
  3956. return defaultResult // may be undefined
  3957. }
  3958. }
  3959. exports.compareIdentifiers = compareIdentifiers
  3960. var numeric = /^[0-9]+$/
  3961. function compareIdentifiers (a, b) {
  3962. var anum = numeric.test(a)
  3963. var bnum = numeric.test(b)
  3964. if (anum && bnum) {
  3965. a = +a
  3966. b = +b
  3967. }
  3968. return a === b ? 0
  3969. : (anum && !bnum) ? -1
  3970. : (bnum && !anum) ? 1
  3971. : a < b ? -1
  3972. : 1
  3973. }
  3974. exports.rcompareIdentifiers = rcompareIdentifiers
  3975. function rcompareIdentifiers (a, b) {
  3976. return compareIdentifiers(b, a)
  3977. }
  3978. exports.major = major
  3979. function major (a, loose) {
  3980. return new SemVer(a, loose).major
  3981. }
  3982. exports.minor = minor
  3983. function minor (a, loose) {
  3984. return new SemVer(a, loose).minor
  3985. }
  3986. exports.patch = patch
  3987. function patch (a, loose) {
  3988. return new SemVer(a, loose).patch
  3989. }
  3990. exports.compare = compare
  3991. function compare (a, b, loose) {
  3992. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3993. }
  3994. exports.compareLoose = compareLoose
  3995. function compareLoose (a, b) {
  3996. return compare(a, b, true)
  3997. }
  3998. exports.rcompare = rcompare
  3999. function rcompare (a, b, loose) {
  4000. return compare(b, a, loose)
  4001. }
  4002. exports.sort = sort
  4003. function sort (list, loose) {
  4004. return list.sort(function (a, b) {
  4005. return exports.compare(a, b, loose)
  4006. })
  4007. }
  4008. exports.rsort = rsort
  4009. function rsort (list, loose) {
  4010. return list.sort(function (a, b) {
  4011. return exports.rcompare(a, b, loose)
  4012. })
  4013. }
  4014. exports.gt = gt
  4015. function gt (a, b, loose) {
  4016. return compare(a, b, loose) > 0
  4017. }
  4018. exports.lt = lt
  4019. function lt (a, b, loose) {
  4020. return compare(a, b, loose) < 0
  4021. }
  4022. exports.eq = eq
  4023. function eq (a, b, loose) {
  4024. return compare(a, b, loose) === 0
  4025. }
  4026. exports.neq = neq
  4027. function neq (a, b, loose) {
  4028. return compare(a, b, loose) !== 0
  4029. }
  4030. exports.gte = gte
  4031. function gte (a, b, loose) {
  4032. return compare(a, b, loose) >= 0
  4033. }
  4034. exports.lte = lte
  4035. function lte (a, b, loose) {
  4036. return compare(a, b, loose) <= 0
  4037. }
  4038. exports.cmp = cmp
  4039. function cmp (a, op, b, loose) {
  4040. switch (op) {
  4041. case '===':
  4042. if (typeof a === 'object')
  4043. a = a.version
  4044. if (typeof b === 'object')
  4045. b = b.version
  4046. return a === b
  4047. case '!==':
  4048. if (typeof a === 'object')
  4049. a = a.version
  4050. if (typeof b === 'object')
  4051. b = b.version
  4052. return a !== b
  4053. case '':
  4054. case '=':
  4055. case '==':
  4056. return eq(a, b, loose)
  4057. case '!=':
  4058. return neq(a, b, loose)
  4059. case '>':
  4060. return gt(a, b, loose)
  4061. case '>=':
  4062. return gte(a, b, loose)
  4063. case '<':
  4064. return lt(a, b, loose)
  4065. case '<=':
  4066. return lte(a, b, loose)
  4067. default:
  4068. throw new TypeError('Invalid operator: ' + op)
  4069. }
  4070. }
  4071. exports.Comparator = Comparator
  4072. function Comparator (comp, options) {
  4073. if (!options || typeof options !== 'object') {
  4074. options = {
  4075. loose: !!options,
  4076. includePrerelease: false
  4077. }
  4078. }
  4079. if (comp instanceof Comparator) {
  4080. if (comp.loose === !!options.loose) {
  4081. return comp
  4082. } else {
  4083. comp = comp.value
  4084. }
  4085. }
  4086. if (!(this instanceof Comparator)) {
  4087. return new Comparator(comp, options)
  4088. }
  4089. debug('comparator', comp, options)
  4090. this.options = options
  4091. this.loose = !!options.loose
  4092. this.parse(comp)
  4093. if (this.semver === ANY) {
  4094. this.value = ''
  4095. } else {
  4096. this.value = this.operator + this.semver.version
  4097. }
  4098. debug('comp', this)
  4099. }
  4100. var ANY = {}
  4101. Comparator.prototype.parse = function (comp) {
  4102. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4103. var m = comp.match(r)
  4104. if (!m) {
  4105. throw new TypeError('Invalid comparator: ' + comp)
  4106. }
  4107. this.operator = m[1]
  4108. if (this.operator === '=') {
  4109. this.operator = ''
  4110. }
  4111. // if it literally is just '>' or '' then allow anything.
  4112. if (!m[2]) {
  4113. this.semver = ANY
  4114. } else {
  4115. this.semver = new SemVer(m[2], this.options.loose)
  4116. }
  4117. }
  4118. Comparator.prototype.toString = function () {
  4119. return this.value
  4120. }
  4121. Comparator.prototype.test = function (version) {
  4122. debug('Comparator.test', version, this.options.loose)
  4123. if (this.semver === ANY) {
  4124. return true
  4125. }
  4126. if (typeof version === 'string') {
  4127. version = new SemVer(version, this.options)
  4128. }
  4129. return cmp(version, this.operator, this.semver, this.options)
  4130. }
  4131. Comparator.prototype.intersects = function (comp, options) {
  4132. if (!(comp instanceof Comparator)) {
  4133. throw new TypeError('a Comparator is required')
  4134. }
  4135. if (!options || typeof options !== 'object') {
  4136. options = {
  4137. loose: !!options,
  4138. includePrerelease: false
  4139. }
  4140. }
  4141. var rangeTmp
  4142. if (this.operator === '') {
  4143. rangeTmp = new Range(comp.value, options)
  4144. return satisfies(this.value, rangeTmp, options)
  4145. } else if (comp.operator === '') {
  4146. rangeTmp = new Range(this.value, options)
  4147. return satisfies(comp.semver, rangeTmp, options)
  4148. }
  4149. var sameDirectionIncreasing =
  4150. (this.operator === '>=' || this.operator === '>') &&
  4151. (comp.operator === '>=' || comp.operator === '>')
  4152. var sameDirectionDecreasing =
  4153. (this.operator === '<=' || this.operator === '<') &&
  4154. (comp.operator === '<=' || comp.operator === '<')
  4155. var sameSemVer = this.semver.version === comp.semver.version
  4156. var differentDirectionsInclusive =
  4157. (this.operator === '>=' || this.operator === '<=') &&
  4158. (comp.operator === '>=' || comp.operator === '<=')
  4159. var oppositeDirectionsLessThan =
  4160. cmp(this.semver, '<', comp.semver, options) &&
  4161. ((this.operator === '>=' || this.operator === '>') &&
  4162. (comp.operator === '<=' || comp.operator === '<'))
  4163. var oppositeDirectionsGreaterThan =
  4164. cmp(this.semver, '>', comp.semver, options) &&
  4165. ((this.operator === '<=' || this.operator === '<') &&
  4166. (comp.operator === '>=' || comp.operator === '>'))
  4167. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4168. (sameSemVer && differentDirectionsInclusive) ||
  4169. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4170. }
  4171. exports.Range = Range
  4172. function Range (range, options) {
  4173. if (!options || typeof options !== 'object') {
  4174. options = {
  4175. loose: !!options,
  4176. includePrerelease: false
  4177. }
  4178. }
  4179. if (range instanceof Range) {
  4180. if (range.loose === !!options.loose &&
  4181. range.includePrerelease === !!options.includePrerelease) {
  4182. return range
  4183. } else {
  4184. return new Range(range.raw, options)
  4185. }
  4186. }
  4187. if (range instanceof Comparator) {
  4188. return new Range(range.value, options)
  4189. }
  4190. if (!(this instanceof Range)) {
  4191. return new Range(range, options)
  4192. }
  4193. this.options = options
  4194. this.loose = !!options.loose
  4195. this.includePrerelease = !!options.includePrerelease
  4196. // First, split based on boolean or ||
  4197. this.raw = range
  4198. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4199. return this.parseRange(range.trim())
  4200. }, this).filter(function (c) {
  4201. // throw out any that are not relevant for whatever reason
  4202. return c.length
  4203. })
  4204. if (!this.set.length) {
  4205. throw new TypeError('Invalid SemVer Range: ' + range)
  4206. }
  4207. this.format()
  4208. }
  4209. Range.prototype.format = function () {
  4210. this.range = this.set.map(function (comps) {
  4211. return comps.join(' ').trim()
  4212. }).join('||').trim()
  4213. return this.range
  4214. }
  4215. Range.prototype.toString = function () {
  4216. return this.range
  4217. }
  4218. Range.prototype.parseRange = function (range) {
  4219. var loose = this.options.loose
  4220. range = range.trim()
  4221. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4222. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4223. range = range.replace(hr, hyphenReplace)
  4224. debug('hyphen replace', range)
  4225. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4226. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4227. debug('comparator trim', range, re[COMPARATORTRIM])
  4228. // `~ 1.2.3` => `~1.2.3`
  4229. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4230. // `^ 1.2.3` => `^1.2.3`
  4231. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4232. // normalize spaces
  4233. range = range.split(/\s+/).join(' ')
  4234. // At this point, the range is completely trimmed and
  4235. // ready to be split into comparators.
  4236. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4237. var set = range.split(' ').map(function (comp) {
  4238. return parseComparator(comp, this.options)
  4239. }, this).join(' ').split(/\s+/)
  4240. if (this.options.loose) {
  4241. // in loose mode, throw out any that are not valid comparators
  4242. set = set.filter(function (comp) {
  4243. return !!comp.match(compRe)
  4244. })
  4245. }
  4246. set = set.map(function (comp) {
  4247. return new Comparator(comp, this.options)
  4248. }, this)
  4249. return set
  4250. }
  4251. Range.prototype.intersects = function (range, options) {
  4252. if (!(range instanceof Range)) {
  4253. throw new TypeError('a Range is required')
  4254. }
  4255. return this.set.some(function (thisComparators) {
  4256. return thisComparators.every(function (thisComparator) {
  4257. return range.set.some(function (rangeComparators) {
  4258. return rangeComparators.every(function (rangeComparator) {
  4259. return thisComparator.intersects(rangeComparator, options)
  4260. })
  4261. })
  4262. })
  4263. })
  4264. }
  4265. // Mostly just for testing and legacy API reasons
  4266. exports.toComparators = toComparators
  4267. function toComparators (range, options) {
  4268. return new Range(range, options).set.map(function (comp) {
  4269. return comp.map(function (c) {
  4270. return c.value
  4271. }).join(' ').trim().split(' ')
  4272. })
  4273. }
  4274. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4275. // already replaced the hyphen ranges
  4276. // turn into a set of JUST comparators.
  4277. function parseComparator (comp, options) {
  4278. debug('comp', comp, options)
  4279. comp = replaceCarets(comp, options)
  4280. debug('caret', comp)
  4281. comp = replaceTildes(comp, options)
  4282. debug('tildes', comp)
  4283. comp = replaceXRanges(comp, options)
  4284. debug('xrange', comp)
  4285. comp = replaceStars(comp, options)
  4286. debug('stars', comp)
  4287. return comp
  4288. }
  4289. function isX (id) {
  4290. return !id || id.toLowerCase() === 'x' || id === '*'
  4291. }
  4292. // ~, ~> --> * (any, kinda silly)
  4293. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4294. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4295. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4296. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4297. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4298. function replaceTildes (comp, options) {
  4299. return comp.trim().split(/\s+/).map(function (comp) {
  4300. return replaceTilde(comp, options)
  4301. }).join(' ')
  4302. }
  4303. function replaceTilde (comp, options) {
  4304. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4305. return comp.replace(r, function (_, M, m, p, pr) {
  4306. debug('tilde', comp, _, M, m, p, pr)
  4307. var ret
  4308. if (isX(M)) {
  4309. ret = ''
  4310. } else if (isX(m)) {
  4311. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4312. } else if (isX(p)) {
  4313. // ~1.2 == >=1.2.0 <1.3.0
  4314. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4315. } else if (pr) {
  4316. debug('replaceTilde pr', pr)
  4317. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4318. ' <' + M + '.' + (+m + 1) + '.0'
  4319. } else {
  4320. // ~1.2.3 == >=1.2.3 <1.3.0
  4321. ret = '>=' + M + '.' + m + '.' + p +
  4322. ' <' + M + '.' + (+m + 1) + '.0'
  4323. }
  4324. debug('tilde return', ret)
  4325. return ret
  4326. })
  4327. }
  4328. // ^ --> * (any, kinda silly)
  4329. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4330. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4331. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4332. // ^1.2.3 --> >=1.2.3 <2.0.0
  4333. // ^1.2.0 --> >=1.2.0 <2.0.0
  4334. function replaceCarets (comp, options) {
  4335. return comp.trim().split(/\s+/).map(function (comp) {
  4336. return replaceCaret(comp, options)
  4337. }).join(' ')
  4338. }
  4339. function replaceCaret (comp, options) {
  4340. debug('caret', comp, options)
  4341. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4342. return comp.replace(r, function (_, M, m, p, pr) {
  4343. debug('caret', comp, _, M, m, p, pr)
  4344. var ret
  4345. if (isX(M)) {
  4346. ret = ''
  4347. } else if (isX(m)) {
  4348. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4349. } else if (isX(p)) {
  4350. if (M === '0') {
  4351. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4352. } else {
  4353. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4354. }
  4355. } else if (pr) {
  4356. debug('replaceCaret pr', pr)
  4357. if (M === '0') {
  4358. if (m === '0') {
  4359. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4360. ' <' + M + '.' + m + '.' + (+p + 1)
  4361. } else {
  4362. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4363. ' <' + M + '.' + (+m + 1) + '.0'
  4364. }
  4365. } else {
  4366. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4367. ' <' + (+M + 1) + '.0.0'
  4368. }
  4369. } else {
  4370. debug('no pr')
  4371. if (M === '0') {
  4372. if (m === '0') {
  4373. ret = '>=' + M + '.' + m + '.' + p +
  4374. ' <' + M + '.' + m + '.' + (+p + 1)
  4375. } else {
  4376. ret = '>=' + M + '.' + m + '.' + p +
  4377. ' <' + M + '.' + (+m + 1) + '.0'
  4378. }
  4379. } else {
  4380. ret = '>=' + M + '.' + m + '.' + p +
  4381. ' <' + (+M + 1) + '.0.0'
  4382. }
  4383. }
  4384. debug('caret return', ret)
  4385. return ret
  4386. })
  4387. }
  4388. function replaceXRanges (comp, options) {
  4389. debug('replaceXRanges', comp, options)
  4390. return comp.split(/\s+/).map(function (comp) {
  4391. return replaceXRange(comp, options)
  4392. }).join(' ')
  4393. }
  4394. function replaceXRange (comp, options) {
  4395. comp = comp.trim()
  4396. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4397. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4398. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4399. var xM = isX(M)
  4400. var xm = xM || isX(m)
  4401. var xp = xm || isX(p)
  4402. var anyX = xp
  4403. if (gtlt === '=' && anyX) {
  4404. gtlt = ''
  4405. }
  4406. if (xM) {
  4407. if (gtlt === '>' || gtlt === '<') {
  4408. // nothing is allowed
  4409. ret = '<0.0.0'
  4410. } else {
  4411. // nothing is forbidden
  4412. ret = '*'
  4413. }
  4414. } else if (gtlt && anyX) {
  4415. // we know patch is an x, because we have any x at all.
  4416. // replace X with 0
  4417. if (xm) {
  4418. m = 0
  4419. }
  4420. p = 0
  4421. if (gtlt === '>') {
  4422. // >1 => >=2.0.0
  4423. // >1.2 => >=1.3.0
  4424. // >1.2.3 => >= 1.2.4
  4425. gtlt = '>='
  4426. if (xm) {
  4427. M = +M + 1
  4428. m = 0
  4429. p = 0
  4430. } else {
  4431. m = +m + 1
  4432. p = 0
  4433. }
  4434. } else if (gtlt === '<=') {
  4435. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4436. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4437. gtlt = '<'
  4438. if (xm) {
  4439. M = +M + 1
  4440. } else {
  4441. m = +m + 1
  4442. }
  4443. }
  4444. ret = gtlt + M + '.' + m + '.' + p
  4445. } else if (xm) {
  4446. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4447. } else if (xp) {
  4448. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4449. }
  4450. debug('xRange return', ret)
  4451. return ret
  4452. })
  4453. }
  4454. // Because * is AND-ed with everything else in the comparator,
  4455. // and '' means "any version", just remove the *s entirely.
  4456. function replaceStars (comp, options) {
  4457. debug('replaceStars', comp, options)
  4458. // Looseness is ignored here. star is always as loose as it gets!
  4459. return comp.trim().replace(re[STAR], '')
  4460. }
  4461. // This function is passed to string.replace(re[HYPHENRANGE])
  4462. // M, m, patch, prerelease, build
  4463. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4464. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4465. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4466. function hyphenReplace ($0,
  4467. from, fM, fm, fp, fpr, fb,
  4468. to, tM, tm, tp, tpr, tb) {
  4469. if (isX(fM)) {
  4470. from = ''
  4471. } else if (isX(fm)) {
  4472. from = '>=' + fM + '.0.0'
  4473. } else if (isX(fp)) {
  4474. from = '>=' + fM + '.' + fm + '.0'
  4475. } else {
  4476. from = '>=' + from
  4477. }
  4478. if (isX(tM)) {
  4479. to = ''
  4480. } else if (isX(tm)) {
  4481. to = '<' + (+tM + 1) + '.0.0'
  4482. } else if (isX(tp)) {
  4483. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4484. } else if (tpr) {
  4485. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4486. } else {
  4487. to = '<=' + to
  4488. }
  4489. return (from + ' ' + to).trim()
  4490. }
  4491. // if ANY of the sets match ALL of its comparators, then pass
  4492. Range.prototype.test = function (version) {
  4493. if (!version) {
  4494. return false
  4495. }
  4496. if (typeof version === 'string') {
  4497. version = new SemVer(version, this.options)
  4498. }
  4499. for (var i = 0; i < this.set.length; i++) {
  4500. if (testSet(this.set[i], version, this.options)) {
  4501. return true
  4502. }
  4503. }
  4504. return false
  4505. }
  4506. function testSet (set, version, options) {
  4507. for (var i = 0; i < set.length; i++) {
  4508. if (!set[i].test(version)) {
  4509. return false
  4510. }
  4511. }
  4512. if (version.prerelease.length && !options.includePrerelease) {
  4513. // Find the set of versions that are allowed to have prereleases
  4514. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4515. // That should allow `1.2.3-pr.2` to pass.
  4516. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4517. // even though it's within the range set by the comparators.
  4518. for (i = 0; i < set.length; i++) {
  4519. debug(set[i].semver)
  4520. if (set[i].semver === ANY) {
  4521. continue
  4522. }
  4523. if (set[i].semver.prerelease.length > 0) {
  4524. var allowed = set[i].semver
  4525. if (allowed.major === version.major &&
  4526. allowed.minor === version.minor &&
  4527. allowed.patch === version.patch) {
  4528. return true
  4529. }
  4530. }
  4531. }
  4532. // Version has a -pre, but it's not one of the ones we like.
  4533. return false
  4534. }
  4535. return true
  4536. }
  4537. exports.satisfies = satisfies
  4538. function satisfies (version, range, options) {
  4539. try {
  4540. range = new Range(range, options)
  4541. } catch (er) {
  4542. return false
  4543. }
  4544. return range.test(version)
  4545. }
  4546. exports.maxSatisfying = maxSatisfying
  4547. function maxSatisfying (versions, range, options) {
  4548. var max = null
  4549. var maxSV = null
  4550. try {
  4551. var rangeObj = new Range(range, options)
  4552. } catch (er) {
  4553. return null
  4554. }
  4555. versions.forEach(function (v) {
  4556. if (rangeObj.test(v)) {
  4557. // satisfies(v, range, options)
  4558. if (!max || maxSV.compare(v) === -1) {
  4559. // compare(max, v, true)
  4560. max = v
  4561. maxSV = new SemVer(max, options)
  4562. }
  4563. }
  4564. })
  4565. return max
  4566. }
  4567. exports.minSatisfying = minSatisfying
  4568. function minSatisfying (versions, range, options) {
  4569. var min = null
  4570. var minSV = null
  4571. try {
  4572. var rangeObj = new Range(range, options)
  4573. } catch (er) {
  4574. return null
  4575. }
  4576. versions.forEach(function (v) {
  4577. if (rangeObj.test(v)) {
  4578. // satisfies(v, range, options)
  4579. if (!min || minSV.compare(v) === 1) {
  4580. // compare(min, v, true)
  4581. min = v
  4582. minSV = new SemVer(min, options)
  4583. }
  4584. }
  4585. })
  4586. return min
  4587. }
  4588. exports.minVersion = minVersion
  4589. function minVersion (range, loose) {
  4590. range = new Range(range, loose)
  4591. var minver = new SemVer('0.0.0')
  4592. if (range.test(minver)) {
  4593. return minver
  4594. }
  4595. minver = new SemVer('0.0.0-0')
  4596. if (range.test(minver)) {
  4597. return minver
  4598. }
  4599. minver = null
  4600. for (var i = 0; i < range.set.length; ++i) {
  4601. var comparators = range.set[i]
  4602. comparators.forEach(function (comparator) {
  4603. // Clone to avoid manipulating the comparator's semver object.
  4604. var compver = new SemVer(comparator.semver.version)
  4605. switch (comparator.operator) {
  4606. case '>':
  4607. if (compver.prerelease.length === 0) {
  4608. compver.patch++
  4609. } else {
  4610. compver.prerelease.push(0)
  4611. }
  4612. compver.raw = compver.format()
  4613. /* fallthrough */
  4614. case '':
  4615. case '>=':
  4616. if (!minver || gt(minver, compver)) {
  4617. minver = compver
  4618. }
  4619. break
  4620. case '<':
  4621. case '<=':
  4622. /* Ignore maximum versions */
  4623. break
  4624. /* istanbul ignore next */
  4625. default:
  4626. throw new Error('Unexpected operation: ' + comparator.operator)
  4627. }
  4628. })
  4629. }
  4630. if (minver && range.test(minver)) {
  4631. return minver
  4632. }
  4633. return null
  4634. }
  4635. exports.validRange = validRange
  4636. function validRange (range, options) {
  4637. try {
  4638. // Return '*' instead of '' so that truthiness works.
  4639. // This will throw if it's invalid anyway
  4640. return new Range(range, options).range || '*'
  4641. } catch (er) {
  4642. return null
  4643. }
  4644. }
  4645. // Determine if version is less than all the versions possible in the range
  4646. exports.ltr = ltr
  4647. function ltr (version, range, options) {
  4648. return outside(version, range, '<', options)
  4649. }
  4650. // Determine if version is greater than all the versions possible in the range.
  4651. exports.gtr = gtr
  4652. function gtr (version, range, options) {
  4653. return outside(version, range, '>', options)
  4654. }
  4655. exports.outside = outside
  4656. function outside (version, range, hilo, options) {
  4657. version = new SemVer(version, options)
  4658. range = new Range(range, options)
  4659. var gtfn, ltefn, ltfn, comp, ecomp
  4660. switch (hilo) {
  4661. case '>':
  4662. gtfn = gt
  4663. ltefn = lte
  4664. ltfn = lt
  4665. comp = '>'
  4666. ecomp = '>='
  4667. break
  4668. case '<':
  4669. gtfn = lt
  4670. ltefn = gte
  4671. ltfn = gt
  4672. comp = '<'
  4673. ecomp = '<='
  4674. break
  4675. default:
  4676. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4677. }
  4678. // If it satisifes the range it is not outside
  4679. if (satisfies(version, range, options)) {
  4680. return false
  4681. }
  4682. // From now on, variable terms are as if we're in "gtr" mode.
  4683. // but note that everything is flipped for the "ltr" function.
  4684. for (var i = 0; i < range.set.length; ++i) {
  4685. var comparators = range.set[i]
  4686. var high = null
  4687. var low = null
  4688. comparators.forEach(function (comparator) {
  4689. if (comparator.semver === ANY) {
  4690. comparator = new Comparator('>=0.0.0')
  4691. }
  4692. high = high || comparator
  4693. low = low || comparator
  4694. if (gtfn(comparator.semver, high.semver, options)) {
  4695. high = comparator
  4696. } else if (ltfn(comparator.semver, low.semver, options)) {
  4697. low = comparator
  4698. }
  4699. })
  4700. // If the edge version comparator has a operator then our version
  4701. // isn't outside it
  4702. if (high.operator === comp || high.operator === ecomp) {
  4703. return false
  4704. }
  4705. // If the lowest version comparator has an operator and our version
  4706. // is less than it then it isn't higher than the range
  4707. if ((!low.operator || low.operator === comp) &&
  4708. ltefn(version, low.semver)) {
  4709. return false
  4710. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4711. return false
  4712. }
  4713. }
  4714. return true
  4715. }
  4716. exports.prerelease = prerelease
  4717. function prerelease (version, options) {
  4718. var parsed = parse(version, options)
  4719. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4720. }
  4721. exports.intersects = intersects
  4722. function intersects (r1, r2, options) {
  4723. r1 = new Range(r1, options)
  4724. r2 = new Range(r2, options)
  4725. return r1.intersects(r2)
  4726. }
  4727. exports.coerce = coerce
  4728. function coerce (version) {
  4729. if (version instanceof SemVer) {
  4730. return version
  4731. }
  4732. if (typeof version !== 'string') {
  4733. return null
  4734. }
  4735. var match = version.match(re[COERCE])
  4736. if (match == null) {
  4737. return null
  4738. }
  4739. return parse(match[1] +
  4740. '.' + (match[2] || '0') +
  4741. '.' + (match[3] || '0'))
  4742. }
  4743. /***/ }),
  4744. /***/ 287:
  4745. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4746. "use strict";
  4747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4749. return new (P || (P = Promise))(function (resolve, reject) {
  4750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4754. });
  4755. };
  4756. var __importStar = (this && this.__importStar) || function (mod) {
  4757. if (mod && mod.__esModule) return mod;
  4758. var result = {};
  4759. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4760. result["default"] = mod;
  4761. return result;
  4762. };
  4763. var __importDefault = (this && this.__importDefault) || function (mod) {
  4764. return (mod && mod.__esModule) ? mod : { "default": mod };
  4765. };
  4766. Object.defineProperty(exports, "__esModule", { value: true });
  4767. const assert = __importStar(__webpack_require__(357));
  4768. const core = __importStar(__webpack_require__(470));
  4769. const exec = __importStar(__webpack_require__(986));
  4770. const fs = __importStar(__webpack_require__(747));
  4771. const io = __importStar(__webpack_require__(1));
  4772. const os = __importStar(__webpack_require__(87));
  4773. const path = __importStar(__webpack_require__(622));
  4774. const regexpHelper = __importStar(__webpack_require__(528));
  4775. const stateHelper = __importStar(__webpack_require__(153));
  4776. const urlHelper = __importStar(__webpack_require__(81));
  4777. const v4_1 = __importDefault(__webpack_require__(826));
  4778. const IS_WINDOWS = process.platform === 'win32';
  4779. const SSH_COMMAND_KEY = 'core.sshCommand';
  4780. function createAuthHelper(git, settings) {
  4781. return new GitAuthHelper(git, settings);
  4782. }
  4783. exports.createAuthHelper = createAuthHelper;
  4784. class GitAuthHelper {
  4785. constructor(gitCommandManager, gitSourceSettings) {
  4786. this.sshCommand = '';
  4787. this.sshKeyPath = '';
  4788. this.sshKnownHostsPath = '';
  4789. this.temporaryHomePath = '';
  4790. this.git = gitCommandManager;
  4791. this.settings = gitSourceSettings || {};
  4792. // Token auth header
  4793. const serverUrl = urlHelper.getServerUrl();
  4794. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4795. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4796. core.setSecret(basicCredential);
  4797. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4798. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4799. // Instead of SSH URL
  4800. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4801. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4802. }
  4803. configureAuth() {
  4804. return __awaiter(this, void 0, void 0, function* () {
  4805. // Remove possible previous values
  4806. yield this.removeAuth();
  4807. // Configure new values
  4808. yield this.configureSsh();
  4809. yield this.configureToken();
  4810. });
  4811. }
  4812. configureGlobalAuth() {
  4813. return __awaiter(this, void 0, void 0, function* () {
  4814. // Create a temp home directory
  4815. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4816. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4817. const uniqueId = v4_1.default();
  4818. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4819. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4820. // Copy the global git config
  4821. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4822. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4823. let configExists = false;
  4824. try {
  4825. yield fs.promises.stat(gitConfigPath);
  4826. configExists = true;
  4827. }
  4828. catch (err) {
  4829. if (err.code !== 'ENOENT') {
  4830. throw err;
  4831. }
  4832. }
  4833. if (configExists) {
  4834. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4835. yield io.cp(gitConfigPath, newGitConfigPath);
  4836. }
  4837. else {
  4838. yield fs.promises.writeFile(newGitConfigPath, '');
  4839. }
  4840. try {
  4841. // Override HOME
  4842. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4843. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4844. // Configure the token
  4845. yield this.configureToken(newGitConfigPath, true);
  4846. // Configure HTTPS instead of SSH
  4847. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4848. if (!this.settings.sshKey) {
  4849. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4850. }
  4851. }
  4852. catch (err) {
  4853. // Unset in case somehow written to the real global config
  4854. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4855. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4856. throw err;
  4857. }
  4858. });
  4859. }
  4860. configureSubmoduleAuth() {
  4861. return __awaiter(this, void 0, void 0, function* () {
  4862. // Remove possible previous HTTPS instead of SSH
  4863. yield this.removeGitConfig(this.insteadOfKey, true);
  4864. if (this.settings.persistCredentials) {
  4865. // Configure a placeholder value. This approach avoids the credential being captured
  4866. // by process creation audit events, which are commonly logged. For more information,
  4867. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4868. 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);
  4869. // Replace the placeholder
  4870. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4871. for (const configPath of configPaths) {
  4872. core.debug(`Replacing token placeholder in '${configPath}'`);
  4873. yield this.replaceTokenPlaceholder(configPath);
  4874. }
  4875. if (this.settings.sshKey) {
  4876. // Configure core.sshCommand
  4877. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4878. }
  4879. else {
  4880. // Configure HTTPS instead of SSH
  4881. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4882. }
  4883. }
  4884. });
  4885. }
  4886. removeAuth() {
  4887. return __awaiter(this, void 0, void 0, function* () {
  4888. yield this.removeSsh();
  4889. yield this.removeToken();
  4890. });
  4891. }
  4892. removeGlobalAuth() {
  4893. return __awaiter(this, void 0, void 0, function* () {
  4894. core.debug(`Unsetting HOME override`);
  4895. this.git.removeEnvironmentVariable('HOME');
  4896. yield io.rmRF(this.temporaryHomePath);
  4897. });
  4898. }
  4899. configureSsh() {
  4900. return __awaiter(this, void 0, void 0, function* () {
  4901. if (!this.settings.sshKey) {
  4902. return;
  4903. }
  4904. // Write key
  4905. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4906. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4907. const uniqueId = v4_1.default();
  4908. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4909. stateHelper.setSshKeyPath(this.sshKeyPath);
  4910. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4911. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4912. // Remove inherited permissions on Windows
  4913. if (IS_WINDOWS) {
  4914. const icacls = yield io.which('icacls.exe');
  4915. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4916. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4917. }
  4918. // Write known hosts
  4919. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4920. let userKnownHosts = '';
  4921. try {
  4922. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4923. }
  4924. catch (err) {
  4925. if (err.code !== 'ENOENT') {
  4926. throw err;
  4927. }
  4928. }
  4929. let knownHosts = '';
  4930. if (userKnownHosts) {
  4931. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4932. }
  4933. if (this.settings.sshKnownHosts) {
  4934. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4935. }
  4936. 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`;
  4937. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4938. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4939. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4940. // Configure GIT_SSH_COMMAND
  4941. const sshPath = yield io.which('ssh', true);
  4942. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4943. if (this.settings.sshStrict) {
  4944. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4945. }
  4946. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4947. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4948. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4949. // Configure core.sshCommand
  4950. if (this.settings.persistCredentials) {
  4951. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4952. }
  4953. });
  4954. }
  4955. configureToken(configPath, globalConfig) {
  4956. return __awaiter(this, void 0, void 0, function* () {
  4957. // Validate args
  4958. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4959. // Default config path
  4960. if (!configPath && !globalConfig) {
  4961. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4962. }
  4963. // Configure a placeholder value. This approach avoids the credential being captured
  4964. // by process creation audit events, which are commonly logged. For more information,
  4965. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4966. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4967. // Replace the placeholder
  4968. yield this.replaceTokenPlaceholder(configPath || '');
  4969. });
  4970. }
  4971. replaceTokenPlaceholder(configPath) {
  4972. return __awaiter(this, void 0, void 0, function* () {
  4973. assert.ok(configPath, 'configPath is not defined');
  4974. let content = (yield fs.promises.readFile(configPath)).toString();
  4975. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4976. if (placeholderIndex < 0 ||
  4977. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4978. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4979. }
  4980. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4981. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4982. yield fs.promises.writeFile(configPath, content);
  4983. });
  4984. }
  4985. removeSsh() {
  4986. return __awaiter(this, void 0, void 0, function* () {
  4987. // SSH key
  4988. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4989. if (keyPath) {
  4990. try {
  4991. yield io.rmRF(keyPath);
  4992. }
  4993. catch (err) {
  4994. core.debug(err.message);
  4995. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4996. }
  4997. }
  4998. // SSH known hosts
  4999. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  5000. if (knownHostsPath) {
  5001. try {
  5002. yield io.rmRF(knownHostsPath);
  5003. }
  5004. catch (_a) {
  5005. // Intentionally empty
  5006. }
  5007. }
  5008. // SSH command
  5009. yield this.removeGitConfig(SSH_COMMAND_KEY);
  5010. });
  5011. }
  5012. removeToken() {
  5013. return __awaiter(this, void 0, void 0, function* () {
  5014. // HTTP extra header
  5015. yield this.removeGitConfig(this.tokenConfigKey);
  5016. });
  5017. }
  5018. removeGitConfig(configKey, submoduleOnly = false) {
  5019. return __awaiter(this, void 0, void 0, function* () {
  5020. if (!submoduleOnly) {
  5021. if ((yield this.git.configExists(configKey)) &&
  5022. !(yield this.git.tryConfigUnset(configKey))) {
  5023. // Load the config contents
  5024. core.warning(`Failed to remove '${configKey}' from the git config`);
  5025. }
  5026. }
  5027. const pattern = regexpHelper.escape(configKey);
  5028. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  5029. });
  5030. }
  5031. }
  5032. /***/ }),
  5033. /***/ 289:
  5034. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5035. "use strict";
  5036. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5037. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5038. return new (P || (P = Promise))(function (resolve, reject) {
  5039. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5040. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5041. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5042. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5043. });
  5044. };
  5045. var __importStar = (this && this.__importStar) || function (mod) {
  5046. if (mod && mod.__esModule) return mod;
  5047. var result = {};
  5048. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5049. result["default"] = mod;
  5050. return result;
  5051. };
  5052. Object.defineProperty(exports, "__esModule", { value: true });
  5053. const core = __importStar(__webpack_require__(470));
  5054. const exec = __importStar(__webpack_require__(986));
  5055. const fshelper = __importStar(__webpack_require__(618));
  5056. const io = __importStar(__webpack_require__(1));
  5057. const path = __importStar(__webpack_require__(622));
  5058. const refHelper = __importStar(__webpack_require__(227));
  5059. const regexpHelper = __importStar(__webpack_require__(528));
  5060. const retryHelper = __importStar(__webpack_require__(587));
  5061. const git_version_1 = __webpack_require__(559);
  5062. // Auth header not supported before 2.9
  5063. // Wire protocol v2 not supported before 2.18
  5064. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  5065. function createCommandManager(workingDirectory, lfs) {
  5066. return __awaiter(this, void 0, void 0, function* () {
  5067. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  5068. });
  5069. }
  5070. exports.createCommandManager = createCommandManager;
  5071. class GitCommandManager {
  5072. // Private constructor; use createCommandManager()
  5073. constructor() {
  5074. this.gitEnv = {
  5075. GIT_TERMINAL_PROMPT: '0',
  5076. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  5077. };
  5078. this.gitPath = '';
  5079. this.lfs = false;
  5080. this.workingDirectory = '';
  5081. }
  5082. branchDelete(remote, branch) {
  5083. return __awaiter(this, void 0, void 0, function* () {
  5084. const args = ['branch', '--delete', '--force'];
  5085. if (remote) {
  5086. args.push('--remote');
  5087. }
  5088. args.push(branch);
  5089. yield this.execGit(args);
  5090. });
  5091. }
  5092. branchExists(remote, pattern) {
  5093. return __awaiter(this, void 0, void 0, function* () {
  5094. const args = ['branch', '--list'];
  5095. if (remote) {
  5096. args.push('--remote');
  5097. }
  5098. args.push(pattern);
  5099. const output = yield this.execGit(args);
  5100. return !!output.stdout.trim();
  5101. });
  5102. }
  5103. branchList(remote) {
  5104. return __awaiter(this, void 0, void 0, function* () {
  5105. const result = [];
  5106. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  5107. // "branch --list" is more difficult when in a detached HEAD state.
  5108. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5109. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5110. const args = ['rev-parse', '--symbolic-full-name'];
  5111. if (remote) {
  5112. args.push('--remotes=origin');
  5113. }
  5114. else {
  5115. args.push('--branches');
  5116. }
  5117. const output = yield this.execGit(args);
  5118. for (let branch of output.stdout.trim().split('\n')) {
  5119. branch = branch.trim();
  5120. if (branch) {
  5121. if (branch.startsWith('refs/heads/')) {
  5122. branch = branch.substr('refs/heads/'.length);
  5123. }
  5124. else if (branch.startsWith('refs/remotes/')) {
  5125. branch = branch.substr('refs/remotes/'.length);
  5126. }
  5127. result.push(branch);
  5128. }
  5129. }
  5130. return result;
  5131. });
  5132. }
  5133. checkout(ref, startPoint) {
  5134. return __awaiter(this, void 0, void 0, function* () {
  5135. const args = ['checkout', '--progress', '--force'];
  5136. if (startPoint) {
  5137. args.push('-B', ref, startPoint);
  5138. }
  5139. else {
  5140. args.push(ref);
  5141. }
  5142. yield this.execGit(args);
  5143. });
  5144. }
  5145. checkoutDetach() {
  5146. return __awaiter(this, void 0, void 0, function* () {
  5147. const args = ['checkout', '--detach'];
  5148. yield this.execGit(args);
  5149. });
  5150. }
  5151. config(configKey, configValue, globalConfig) {
  5152. return __awaiter(this, void 0, void 0, function* () {
  5153. yield this.execGit([
  5154. 'config',
  5155. globalConfig ? '--global' : '--local',
  5156. configKey,
  5157. configValue
  5158. ]);
  5159. });
  5160. }
  5161. configExists(configKey, globalConfig) {
  5162. return __awaiter(this, void 0, void 0, function* () {
  5163. const pattern = regexpHelper.escape(configKey);
  5164. const output = yield this.execGit([
  5165. 'config',
  5166. globalConfig ? '--global' : '--local',
  5167. '--name-only',
  5168. '--get-regexp',
  5169. pattern
  5170. ], true);
  5171. return output.exitCode === 0;
  5172. });
  5173. }
  5174. fetch(refSpec, fetchDepth) {
  5175. return __awaiter(this, void 0, void 0, function* () {
  5176. const args = ['-c', 'protocol.version=2', 'fetch'];
  5177. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  5178. args.push('--no-tags');
  5179. }
  5180. args.push('--prune', '--progress', '--no-recurse-submodules');
  5181. if (fetchDepth && fetchDepth > 0) {
  5182. args.push(`--depth=${fetchDepth}`);
  5183. }
  5184. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5185. args.push('--unshallow');
  5186. }
  5187. args.push('origin');
  5188. for (const arg of refSpec) {
  5189. args.push(arg);
  5190. }
  5191. const that = this;
  5192. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5193. yield that.execGit(args);
  5194. }));
  5195. });
  5196. }
  5197. getDefaultBranch(repositoryUrl) {
  5198. return __awaiter(this, void 0, void 0, function* () {
  5199. let output;
  5200. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5201. output = yield this.execGit([
  5202. 'ls-remote',
  5203. '--quiet',
  5204. '--exit-code',
  5205. '--symref',
  5206. repositoryUrl,
  5207. 'HEAD'
  5208. ]);
  5209. }));
  5210. if (output) {
  5211. // Satisfy compiler, will always be set
  5212. for (let line of output.stdout.trim().split('\n')) {
  5213. line = line.trim();
  5214. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  5215. return line
  5216. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  5217. .trim();
  5218. }
  5219. }
  5220. }
  5221. throw new Error('Unexpected output when retrieving default branch');
  5222. });
  5223. }
  5224. getWorkingDirectory() {
  5225. return this.workingDirectory;
  5226. }
  5227. init() {
  5228. return __awaiter(this, void 0, void 0, function* () {
  5229. yield this.execGit(['init', this.workingDirectory]);
  5230. });
  5231. }
  5232. isDetached() {
  5233. return __awaiter(this, void 0, void 0, function* () {
  5234. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5235. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5236. return !output.stdout.trim().startsWith('refs/heads/');
  5237. });
  5238. }
  5239. lfsFetch(ref) {
  5240. return __awaiter(this, void 0, void 0, function* () {
  5241. const args = ['lfs', 'fetch', 'origin', ref];
  5242. const that = this;
  5243. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5244. yield that.execGit(args);
  5245. }));
  5246. });
  5247. }
  5248. lfsInstall() {
  5249. return __awaiter(this, void 0, void 0, function* () {
  5250. yield this.execGit(['lfs', 'install', '--local']);
  5251. });
  5252. }
  5253. log1(format) {
  5254. return __awaiter(this, void 0, void 0, function* () {
  5255. var args = format ? ['log', '-1', format] : ['log', '-1'];
  5256. var silent = format ? false : true;
  5257. const output = yield this.execGit(args, false, silent);
  5258. return output.stdout;
  5259. });
  5260. }
  5261. remoteAdd(remoteName, remoteUrl) {
  5262. return __awaiter(this, void 0, void 0, function* () {
  5263. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5264. });
  5265. }
  5266. removeEnvironmentVariable(name) {
  5267. delete this.gitEnv[name];
  5268. }
  5269. /**
  5270. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5271. * For an annotated tag, the tag SHA is returned.
  5272. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  5273. * @returns {Promise<string>}
  5274. */
  5275. revParse(ref) {
  5276. return __awaiter(this, void 0, void 0, function* () {
  5277. const output = yield this.execGit(['rev-parse', ref]);
  5278. return output.stdout.trim();
  5279. });
  5280. }
  5281. setEnvironmentVariable(name, value) {
  5282. this.gitEnv[name] = value;
  5283. }
  5284. shaExists(sha) {
  5285. return __awaiter(this, void 0, void 0, function* () {
  5286. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5287. const output = yield this.execGit(args, true);
  5288. return output.exitCode === 0;
  5289. });
  5290. }
  5291. submoduleForeach(command, recursive) {
  5292. return __awaiter(this, void 0, void 0, function* () {
  5293. const args = ['submodule', 'foreach'];
  5294. if (recursive) {
  5295. args.push('--recursive');
  5296. }
  5297. args.push(command);
  5298. const output = yield this.execGit(args);
  5299. return output.stdout;
  5300. });
  5301. }
  5302. submoduleSync(recursive) {
  5303. return __awaiter(this, void 0, void 0, function* () {
  5304. const args = ['submodule', 'sync'];
  5305. if (recursive) {
  5306. args.push('--recursive');
  5307. }
  5308. yield this.execGit(args);
  5309. });
  5310. }
  5311. submoduleUpdate(fetchDepth, recursive) {
  5312. return __awaiter(this, void 0, void 0, function* () {
  5313. const args = ['-c', 'protocol.version=2'];
  5314. args.push('submodule', 'update', '--init', '--force');
  5315. if (fetchDepth > 0) {
  5316. args.push(`--depth=${fetchDepth}`);
  5317. }
  5318. if (recursive) {
  5319. args.push('--recursive');
  5320. }
  5321. yield this.execGit(args);
  5322. });
  5323. }
  5324. tagExists(pattern) {
  5325. return __awaiter(this, void 0, void 0, function* () {
  5326. const output = yield this.execGit(['tag', '--list', pattern]);
  5327. return !!output.stdout.trim();
  5328. });
  5329. }
  5330. tryClean() {
  5331. return __awaiter(this, void 0, void 0, function* () {
  5332. const output = yield this.execGit(['clean', '-ffdx'], true);
  5333. return output.exitCode === 0;
  5334. });
  5335. }
  5336. tryConfigUnset(configKey, globalConfig) {
  5337. return __awaiter(this, void 0, void 0, function* () {
  5338. const output = yield this.execGit([
  5339. 'config',
  5340. globalConfig ? '--global' : '--local',
  5341. '--unset-all',
  5342. configKey
  5343. ], true);
  5344. return output.exitCode === 0;
  5345. });
  5346. }
  5347. tryDisableAutomaticGarbageCollection() {
  5348. return __awaiter(this, void 0, void 0, function* () {
  5349. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5350. return output.exitCode === 0;
  5351. });
  5352. }
  5353. tryGetFetchUrl() {
  5354. return __awaiter(this, void 0, void 0, function* () {
  5355. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5356. if (output.exitCode !== 0) {
  5357. return '';
  5358. }
  5359. const stdout = output.stdout.trim();
  5360. if (stdout.includes('\n')) {
  5361. return '';
  5362. }
  5363. return stdout;
  5364. });
  5365. }
  5366. tryReset() {
  5367. return __awaiter(this, void 0, void 0, function* () {
  5368. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5369. return output.exitCode === 0;
  5370. });
  5371. }
  5372. static createCommandManager(workingDirectory, lfs) {
  5373. return __awaiter(this, void 0, void 0, function* () {
  5374. const result = new GitCommandManager();
  5375. yield result.initializeCommandManager(workingDirectory, lfs);
  5376. return result;
  5377. });
  5378. }
  5379. execGit(args, allowAllExitCodes = false, silent = false) {
  5380. return __awaiter(this, void 0, void 0, function* () {
  5381. fshelper.directoryExistsSync(this.workingDirectory, true);
  5382. const result = new GitOutput();
  5383. const env = {};
  5384. for (const key of Object.keys(process.env)) {
  5385. env[key] = process.env[key];
  5386. }
  5387. for (const key of Object.keys(this.gitEnv)) {
  5388. env[key] = this.gitEnv[key];
  5389. }
  5390. const stdout = [];
  5391. const options = {
  5392. cwd: this.workingDirectory,
  5393. env,
  5394. silent,
  5395. ignoreReturnCode: allowAllExitCodes,
  5396. listeners: {
  5397. stdout: (data) => {
  5398. stdout.push(data.toString());
  5399. }
  5400. }
  5401. };
  5402. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5403. result.stdout = stdout.join('');
  5404. return result;
  5405. });
  5406. }
  5407. initializeCommandManager(workingDirectory, lfs) {
  5408. return __awaiter(this, void 0, void 0, function* () {
  5409. this.workingDirectory = workingDirectory;
  5410. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5411. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5412. this.lfs = lfs;
  5413. if (!this.lfs) {
  5414. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5415. }
  5416. this.gitPath = yield io.which('git', true);
  5417. // Git version
  5418. core.debug('Getting git version');
  5419. let gitVersion = new git_version_1.GitVersion();
  5420. let gitOutput = yield this.execGit(['version']);
  5421. let stdout = gitOutput.stdout.trim();
  5422. if (!stdout.includes('\n')) {
  5423. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5424. if (match) {
  5425. gitVersion = new git_version_1.GitVersion(match[0]);
  5426. }
  5427. }
  5428. if (!gitVersion.isValid()) {
  5429. throw new Error('Unable to determine git version');
  5430. }
  5431. // Minimum git version
  5432. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5433. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5434. }
  5435. if (this.lfs) {
  5436. // Git-lfs version
  5437. core.debug('Getting git-lfs version');
  5438. let gitLfsVersion = new git_version_1.GitVersion();
  5439. const gitLfsPath = yield io.which('git-lfs', true);
  5440. gitOutput = yield this.execGit(['lfs', 'version']);
  5441. stdout = gitOutput.stdout.trim();
  5442. if (!stdout.includes('\n')) {
  5443. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5444. if (match) {
  5445. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5446. }
  5447. }
  5448. if (!gitLfsVersion.isValid()) {
  5449. throw new Error('Unable to determine git-lfs version');
  5450. }
  5451. // Minimum git-lfs version
  5452. // Note:
  5453. // - Auth header not supported before 2.1
  5454. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5455. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5456. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5457. }
  5458. }
  5459. // Set the user agent
  5460. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5461. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5462. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5463. });
  5464. }
  5465. }
  5466. class GitOutput {
  5467. constructor() {
  5468. this.stdout = '';
  5469. this.exitCode = 0;
  5470. }
  5471. }
  5472. /***/ }),
  5473. /***/ 293:
  5474. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5475. "use strict";
  5476. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5477. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5478. return new (P || (P = Promise))(function (resolve, reject) {
  5479. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5480. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5481. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5482. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5483. });
  5484. };
  5485. var __importStar = (this && this.__importStar) || function (mod) {
  5486. if (mod && mod.__esModule) return mod;
  5487. var result = {};
  5488. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5489. result["default"] = mod;
  5490. return result;
  5491. };
  5492. Object.defineProperty(exports, "__esModule", { value: true });
  5493. const core = __importStar(__webpack_require__(470));
  5494. const fsHelper = __importStar(__webpack_require__(618));
  5495. const gitAuthHelper = __importStar(__webpack_require__(287));
  5496. const gitCommandManager = __importStar(__webpack_require__(289));
  5497. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5498. const githubApiHelper = __importStar(__webpack_require__(464));
  5499. const io = __importStar(__webpack_require__(1));
  5500. const path = __importStar(__webpack_require__(622));
  5501. const refHelper = __importStar(__webpack_require__(227));
  5502. const stateHelper = __importStar(__webpack_require__(153));
  5503. const urlHelper = __importStar(__webpack_require__(81));
  5504. function getSource(settings) {
  5505. return __awaiter(this, void 0, void 0, function* () {
  5506. // Repository URL
  5507. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5508. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5509. // Remove conflicting file path
  5510. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5511. yield io.rmRF(settings.repositoryPath);
  5512. }
  5513. // Create directory
  5514. let isExisting = true;
  5515. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5516. isExisting = false;
  5517. yield io.mkdirP(settings.repositoryPath);
  5518. }
  5519. // Git command manager
  5520. core.startGroup('Getting Git version info');
  5521. const git = yield getGitCommandManager(settings);
  5522. core.endGroup();
  5523. // Prepare existing directory, otherwise recreate
  5524. if (isExisting) {
  5525. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5526. }
  5527. if (!git) {
  5528. // Downloading using REST API
  5529. core.info(`The repository will be downloaded using the GitHub REST API`);
  5530. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5531. if (settings.submodules) {
  5532. 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.`);
  5533. }
  5534. else if (settings.sshKey) {
  5535. 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.`);
  5536. }
  5537. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5538. return;
  5539. }
  5540. // Save state for POST action
  5541. stateHelper.setRepositoryPath(settings.repositoryPath);
  5542. // Initialize the repository
  5543. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5544. core.startGroup('Initializing the repository');
  5545. yield git.init();
  5546. yield git.remoteAdd('origin', repositoryUrl);
  5547. core.endGroup();
  5548. }
  5549. // Disable automatic garbage collection
  5550. core.startGroup('Disabling automatic garbage collection');
  5551. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5552. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5553. }
  5554. core.endGroup();
  5555. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5556. try {
  5557. // Configure auth
  5558. core.startGroup('Setting up auth');
  5559. yield authHelper.configureAuth();
  5560. core.endGroup();
  5561. // Determine the default branch
  5562. if (!settings.ref && !settings.commit) {
  5563. core.startGroup('Determining the default branch');
  5564. if (settings.sshKey) {
  5565. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  5566. }
  5567. else {
  5568. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  5569. }
  5570. core.endGroup();
  5571. }
  5572. // LFS install
  5573. if (settings.lfs) {
  5574. yield git.lfsInstall();
  5575. }
  5576. // Fetch
  5577. core.startGroup('Fetching the repository');
  5578. if (settings.fetchDepth <= 0) {
  5579. // Fetch all branches and tags
  5580. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5581. yield git.fetch(refSpec);
  5582. // When all history is fetched, the ref we're interested in may have moved to a different
  5583. // commit (push or force push). If so, fetch again with a targeted refspec.
  5584. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5585. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5586. yield git.fetch(refSpec);
  5587. }
  5588. }
  5589. else {
  5590. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5591. yield git.fetch(refSpec, settings.fetchDepth);
  5592. }
  5593. core.endGroup();
  5594. // Checkout info
  5595. core.startGroup('Determining the checkout info');
  5596. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5597. core.endGroup();
  5598. // LFS fetch
  5599. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5600. // Explicit lfs fetch will fetch lfs objects in parallel.
  5601. if (settings.lfs) {
  5602. core.startGroup('Fetching LFS objects');
  5603. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5604. core.endGroup();
  5605. }
  5606. // Checkout
  5607. core.startGroup('Checking out the ref');
  5608. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5609. core.endGroup();
  5610. // Submodules
  5611. if (settings.submodules) {
  5612. try {
  5613. // Temporarily override global config
  5614. core.startGroup('Setting up auth for fetching submodules');
  5615. yield authHelper.configureGlobalAuth();
  5616. core.endGroup();
  5617. // Checkout submodules
  5618. core.startGroup('Fetching submodules');
  5619. yield git.submoduleSync(settings.nestedSubmodules);
  5620. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5621. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5622. core.endGroup();
  5623. // Persist credentials
  5624. if (settings.persistCredentials) {
  5625. core.startGroup('Persisting credentials for submodules');
  5626. yield authHelper.configureSubmoduleAuth();
  5627. core.endGroup();
  5628. }
  5629. }
  5630. finally {
  5631. // Remove temporary global config override
  5632. yield authHelper.removeGlobalAuth();
  5633. }
  5634. }
  5635. // Get commit information
  5636. const commitInfo = yield git.log1();
  5637. // Log commit sha
  5638. yield git.log1("--format='%H'");
  5639. // Check for incorrect pull request merge commit
  5640. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5641. }
  5642. finally {
  5643. // Remove auth
  5644. if (!settings.persistCredentials) {
  5645. core.startGroup('Removing auth');
  5646. yield authHelper.removeAuth();
  5647. core.endGroup();
  5648. }
  5649. }
  5650. });
  5651. }
  5652. exports.getSource = getSource;
  5653. function cleanup(repositoryPath) {
  5654. return __awaiter(this, void 0, void 0, function* () {
  5655. // Repo exists?
  5656. if (!repositoryPath ||
  5657. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5658. return;
  5659. }
  5660. let git;
  5661. try {
  5662. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5663. }
  5664. catch (_a) {
  5665. return;
  5666. }
  5667. // Remove auth
  5668. const authHelper = gitAuthHelper.createAuthHelper(git);
  5669. yield authHelper.removeAuth();
  5670. });
  5671. }
  5672. exports.cleanup = cleanup;
  5673. function getGitCommandManager(settings) {
  5674. return __awaiter(this, void 0, void 0, function* () {
  5675. core.info(`Working directory is '${settings.repositoryPath}'`);
  5676. try {
  5677. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5678. }
  5679. catch (err) {
  5680. // Git is required for LFS
  5681. if (settings.lfs) {
  5682. throw err;
  5683. }
  5684. // Otherwise fallback to REST API
  5685. return undefined;
  5686. }
  5687. });
  5688. }
  5689. /***/ }),
  5690. /***/ 294:
  5691. /***/ (function(module, __unusedexports, __webpack_require__) {
  5692. module.exports = parseOptions;
  5693. const { Deprecation } = __webpack_require__(692);
  5694. const { getUserAgent } = __webpack_require__(796);
  5695. const once = __webpack_require__(969);
  5696. const pkg = __webpack_require__(215);
  5697. const deprecateOptionsTimeout = once((log, deprecation) =>
  5698. log.warn(deprecation)
  5699. );
  5700. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5701. const deprecateOptionsHeaders = once((log, deprecation) =>
  5702. log.warn(deprecation)
  5703. );
  5704. function parseOptions(options, log, hook) {
  5705. if (options.headers) {
  5706. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5707. newObj[key.toLowerCase()] = options.headers[key];
  5708. return newObj;
  5709. }, {});
  5710. }
  5711. const clientDefaults = {
  5712. headers: options.headers || {},
  5713. request: options.request || {},
  5714. mediaType: {
  5715. previews: [],
  5716. format: ""
  5717. }
  5718. };
  5719. if (options.baseUrl) {
  5720. clientDefaults.baseUrl = options.baseUrl;
  5721. }
  5722. if (options.userAgent) {
  5723. clientDefaults.headers["user-agent"] = options.userAgent;
  5724. }
  5725. if (options.previews) {
  5726. clientDefaults.mediaType.previews = options.previews;
  5727. }
  5728. if (options.timeZone) {
  5729. clientDefaults.headers["time-zone"] = options.timeZone;
  5730. }
  5731. if (options.timeout) {
  5732. deprecateOptionsTimeout(
  5733. log,
  5734. new Deprecation(
  5735. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5736. )
  5737. );
  5738. clientDefaults.request.timeout = options.timeout;
  5739. }
  5740. if (options.agent) {
  5741. deprecateOptionsAgent(
  5742. log,
  5743. new Deprecation(
  5744. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5745. )
  5746. );
  5747. clientDefaults.request.agent = options.agent;
  5748. }
  5749. if (options.headers) {
  5750. deprecateOptionsHeaders(
  5751. log,
  5752. new Deprecation(
  5753. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5754. )
  5755. );
  5756. }
  5757. const userAgentOption = clientDefaults.headers["user-agent"];
  5758. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5759. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5760. .filter(Boolean)
  5761. .join(" ");
  5762. clientDefaults.request.hook = hook.bind(null, "request");
  5763. return clientDefaults;
  5764. }
  5765. /***/ }),
  5766. /***/ 297:
  5767. /***/ (function(module) {
  5768. module.exports = class HttpError extends Error {
  5769. constructor (message, code, headers) {
  5770. super(message)
  5771. // Maintains proper stack trace (only available on V8)
  5772. /* istanbul ignore next */
  5773. if (Error.captureStackTrace) {
  5774. Error.captureStackTrace(this, this.constructor)
  5775. }
  5776. this.name = 'HttpError'
  5777. this.code = code
  5778. this.headers = headers
  5779. }
  5780. }
  5781. /***/ }),
  5782. /***/ 299:
  5783. /***/ (function(__unusedmodule, exports) {
  5784. "use strict";
  5785. Object.defineProperty(exports, '__esModule', { value: true });
  5786. const VERSION = "1.1.2";
  5787. /**
  5788. * Some “list” response that can be paginated have a different response structure
  5789. *
  5790. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5791. * /installation/repositories also has `repository_selection`), as well as a key with
  5792. * the list of the items which name varies from endpoint to endpoint:
  5793. *
  5794. * - https://developer.github.com/v3/search/#example (key `items`)
  5795. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5796. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5797. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5798. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5799. *
  5800. * Octokit normalizes these responses so that paginated results are always returned following
  5801. * the same structure. One challenge is that if the list response has only one page, no Link
  5802. * header is provided, so this header alone is not sufficient to check wether a response is
  5803. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5804. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5805. * property because it also exists in the response of Get the combined status for a specific ref.
  5806. */
  5807. 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))?([^/]|$)/];
  5808. function normalizePaginatedListResponse(octokit, url, response) {
  5809. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5810. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5811. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5812. // to retrieve the same information.
  5813. const incompleteResults = response.data.incomplete_results;
  5814. const repositorySelection = response.data.repository_selection;
  5815. const totalCount = response.data.total_count;
  5816. delete response.data.incomplete_results;
  5817. delete response.data.repository_selection;
  5818. delete response.data.total_count;
  5819. const namespaceKey = Object.keys(response.data)[0];
  5820. const data = response.data[namespaceKey];
  5821. response.data = data;
  5822. if (typeof incompleteResults !== "undefined") {
  5823. response.data.incomplete_results = incompleteResults;
  5824. }
  5825. if (typeof repositorySelection !== "undefined") {
  5826. response.data.repository_selection = repositorySelection;
  5827. }
  5828. response.data.total_count = totalCount;
  5829. Object.defineProperty(response.data, namespaceKey, {
  5830. get() {
  5831. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5832. return Array.from(data);
  5833. }
  5834. });
  5835. }
  5836. function iterator(octokit, route, parameters) {
  5837. const options = octokit.request.endpoint(route, parameters);
  5838. const method = options.method;
  5839. const headers = options.headers;
  5840. let url = options.url;
  5841. return {
  5842. [Symbol.asyncIterator]: () => ({
  5843. next() {
  5844. if (!url) {
  5845. return Promise.resolve({
  5846. done: true
  5847. });
  5848. }
  5849. return octokit.request({
  5850. method,
  5851. url,
  5852. headers
  5853. }).then(response => {
  5854. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5855. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5856. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5857. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5858. return {
  5859. value: response
  5860. };
  5861. });
  5862. }
  5863. })
  5864. };
  5865. }
  5866. function paginate(octokit, route, parameters, mapFn) {
  5867. if (typeof parameters === "function") {
  5868. mapFn = parameters;
  5869. parameters = undefined;
  5870. }
  5871. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5872. }
  5873. function gather(octokit, results, iterator, mapFn) {
  5874. return iterator.next().then(result => {
  5875. if (result.done) {
  5876. return results;
  5877. }
  5878. let earlyExit = false;
  5879. function done() {
  5880. earlyExit = true;
  5881. }
  5882. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5883. if (earlyExit) {
  5884. return results;
  5885. }
  5886. return gather(octokit, results, iterator, mapFn);
  5887. });
  5888. }
  5889. /**
  5890. * @param octokit Octokit instance
  5891. * @param options Options passed to Octokit constructor
  5892. */
  5893. function paginateRest(octokit) {
  5894. return {
  5895. paginate: Object.assign(paginate.bind(null, octokit), {
  5896. iterator: iterator.bind(null, octokit)
  5897. })
  5898. };
  5899. }
  5900. paginateRest.VERSION = VERSION;
  5901. exports.paginateRest = paginateRest;
  5902. //# sourceMappingURL=index.js.map
  5903. /***/ }),
  5904. /***/ 323:
  5905. /***/ (function(module) {
  5906. "use strict";
  5907. var isStream = module.exports = function (stream) {
  5908. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5909. };
  5910. isStream.writable = function (stream) {
  5911. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5912. };
  5913. isStream.readable = function (stream) {
  5914. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5915. };
  5916. isStream.duplex = function (stream) {
  5917. return isStream.writable(stream) && isStream.readable(stream);
  5918. };
  5919. isStream.transform = function (stream) {
  5920. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5921. };
  5922. /***/ }),
  5923. /***/ 335:
  5924. /***/ (function(module, __unusedexports, __webpack_require__) {
  5925. module.exports = __webpack_require__(179);
  5926. /***/ }),
  5927. /***/ 336:
  5928. /***/ (function(module, __unusedexports, __webpack_require__) {
  5929. module.exports = hasLastPage
  5930. const deprecate = __webpack_require__(370)
  5931. const getPageLinks = __webpack_require__(577)
  5932. function hasLastPage (link) {
  5933. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5934. return getPageLinks(link).last
  5935. }
  5936. /***/ }),
  5937. /***/ 348:
  5938. /***/ (function(module, __unusedexports, __webpack_require__) {
  5939. "use strict";
  5940. module.exports = validate;
  5941. const { RequestError } = __webpack_require__(497);
  5942. const get = __webpack_require__(854);
  5943. const set = __webpack_require__(883);
  5944. function validate(octokit, options) {
  5945. if (!options.request.validate) {
  5946. return;
  5947. }
  5948. const { validate: params } = options.request;
  5949. Object.keys(params).forEach(parameterName => {
  5950. const parameter = get(params, parameterName);
  5951. const expectedType = parameter.type;
  5952. let parentParameterName;
  5953. let parentValue;
  5954. let parentParamIsPresent = true;
  5955. let parentParameterIsArray = false;
  5956. if (/\./.test(parameterName)) {
  5957. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5958. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5959. if (parentParameterIsArray) {
  5960. parentParameterName = parentParameterName.slice(0, -2);
  5961. }
  5962. parentValue = get(options, parentParameterName);
  5963. parentParamIsPresent =
  5964. parentParameterName === "headers" ||
  5965. (typeof parentValue === "object" && parentValue !== null);
  5966. }
  5967. const values = parentParameterIsArray
  5968. ? (get(options, parentParameterName) || []).map(
  5969. value => value[parameterName.split(/\./).pop()]
  5970. )
  5971. : [get(options, parameterName)];
  5972. values.forEach((value, i) => {
  5973. const valueIsPresent = typeof value !== "undefined";
  5974. const valueIsNull = value === null;
  5975. const currentParameterName = parentParameterIsArray
  5976. ? parameterName.replace(/\[\]/, `[${i}]`)
  5977. : parameterName;
  5978. if (!parameter.required && !valueIsPresent) {
  5979. return;
  5980. }
  5981. // if the parent parameter is of type object but allows null
  5982. // then the child parameters can be ignored
  5983. if (!parentParamIsPresent) {
  5984. return;
  5985. }
  5986. if (parameter.allowNull && valueIsNull) {
  5987. return;
  5988. }
  5989. if (!parameter.allowNull && valueIsNull) {
  5990. throw new RequestError(
  5991. `'${currentParameterName}' cannot be null`,
  5992. 400,
  5993. {
  5994. request: options
  5995. }
  5996. );
  5997. }
  5998. if (parameter.required && !valueIsPresent) {
  5999. throw new RequestError(
  6000. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  6001. value
  6002. )}`,
  6003. 400,
  6004. {
  6005. request: options
  6006. }
  6007. );
  6008. }
  6009. // parse to integer before checking for enum
  6010. // so that string "1" will match enum with number 1
  6011. if (expectedType === "integer") {
  6012. const unparsedValue = value;
  6013. value = parseInt(value, 10);
  6014. if (isNaN(value)) {
  6015. throw new RequestError(
  6016. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  6017. unparsedValue
  6018. )} is NaN`,
  6019. 400,
  6020. {
  6021. request: options
  6022. }
  6023. );
  6024. }
  6025. }
  6026. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  6027. throw new RequestError(
  6028. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  6029. value
  6030. )}`,
  6031. 400,
  6032. {
  6033. request: options
  6034. }
  6035. );
  6036. }
  6037. if (parameter.validation) {
  6038. const regex = new RegExp(parameter.validation);
  6039. if (!regex.test(value)) {
  6040. throw new RequestError(
  6041. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  6042. value
  6043. )}`,
  6044. 400,
  6045. {
  6046. request: options
  6047. }
  6048. );
  6049. }
  6050. }
  6051. if (expectedType === "object" && typeof value === "string") {
  6052. try {
  6053. value = JSON.parse(value);
  6054. } catch (exception) {
  6055. throw new RequestError(
  6056. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  6057. value
  6058. )}`,
  6059. 400,
  6060. {
  6061. request: options
  6062. }
  6063. );
  6064. }
  6065. }
  6066. set(options, parameter.mapTo || currentParameterName, value);
  6067. });
  6068. });
  6069. return options;
  6070. }
  6071. /***/ }),
  6072. /***/ 349:
  6073. /***/ (function(module, __unusedexports, __webpack_require__) {
  6074. module.exports = authenticationRequestError;
  6075. const { RequestError } = __webpack_require__(497);
  6076. function authenticationRequestError(state, error, options) {
  6077. /* istanbul ignore next */
  6078. if (!error.headers) throw error;
  6079. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  6080. // handle "2FA required" error only
  6081. if (error.status !== 401 || !otpRequired) {
  6082. throw error;
  6083. }
  6084. if (
  6085. error.status === 401 &&
  6086. otpRequired &&
  6087. error.request &&
  6088. error.request.headers["x-github-otp"]
  6089. ) {
  6090. throw new RequestError(
  6091. "Invalid one-time password for two-factor authentication",
  6092. 401,
  6093. {
  6094. headers: error.headers,
  6095. request: options
  6096. }
  6097. );
  6098. }
  6099. if (typeof state.auth.on2fa !== "function") {
  6100. throw new RequestError(
  6101. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6102. 401,
  6103. {
  6104. headers: error.headers,
  6105. request: options
  6106. }
  6107. );
  6108. }
  6109. return Promise.resolve()
  6110. .then(() => {
  6111. return state.auth.on2fa();
  6112. })
  6113. .then(oneTimePassword => {
  6114. const newOptions = Object.assign(options, {
  6115. headers: Object.assign(
  6116. { "x-github-otp": oneTimePassword },
  6117. options.headers
  6118. )
  6119. });
  6120. return state.octokit.request(newOptions);
  6121. });
  6122. }
  6123. /***/ }),
  6124. /***/ 357:
  6125. /***/ (function(module) {
  6126. module.exports = require("assert");
  6127. /***/ }),
  6128. /***/ 363:
  6129. /***/ (function(module) {
  6130. module.exports = register
  6131. function register (state, name, method, options) {
  6132. if (typeof method !== 'function') {
  6133. throw new Error('method for before hook must be a function')
  6134. }
  6135. if (!options) {
  6136. options = {}
  6137. }
  6138. if (Array.isArray(name)) {
  6139. return name.reverse().reduce(function (callback, name) {
  6140. return register.bind(null, state, name, callback, options)
  6141. }, method)()
  6142. }
  6143. return Promise.resolve()
  6144. .then(function () {
  6145. if (!state.registry[name]) {
  6146. return method(options)
  6147. }
  6148. return (state.registry[name]).reduce(function (method, registered) {
  6149. return registered.hook.bind(null, method, options)
  6150. }, method)()
  6151. })
  6152. }
  6153. /***/ }),
  6154. /***/ 368:
  6155. /***/ (function(module) {
  6156. module.exports = function atob(str) {
  6157. return Buffer.from(str, 'base64').toString('binary')
  6158. }
  6159. /***/ }),
  6160. /***/ 370:
  6161. /***/ (function(module) {
  6162. module.exports = deprecate
  6163. const loggedMessages = {}
  6164. function deprecate (message) {
  6165. if (loggedMessages[message]) {
  6166. return
  6167. }
  6168. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6169. loggedMessages[message] = 1
  6170. }
  6171. /***/ }),
  6172. /***/ 385:
  6173. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6174. "use strict";
  6175. Object.defineProperty(exports, '__esModule', { value: true });
  6176. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6177. var isPlainObject = _interopDefault(__webpack_require__(696));
  6178. var universalUserAgent = __webpack_require__(562);
  6179. function lowercaseKeys(object) {
  6180. if (!object) {
  6181. return {};
  6182. }
  6183. return Object.keys(object).reduce((newObj, key) => {
  6184. newObj[key.toLowerCase()] = object[key];
  6185. return newObj;
  6186. }, {});
  6187. }
  6188. function mergeDeep(defaults, options) {
  6189. const result = Object.assign({}, defaults);
  6190. Object.keys(options).forEach(key => {
  6191. if (isPlainObject(options[key])) {
  6192. if (!(key in defaults)) Object.assign(result, {
  6193. [key]: options[key]
  6194. });else result[key] = mergeDeep(defaults[key], options[key]);
  6195. } else {
  6196. Object.assign(result, {
  6197. [key]: options[key]
  6198. });
  6199. }
  6200. });
  6201. return result;
  6202. }
  6203. function merge(defaults, route, options) {
  6204. if (typeof route === "string") {
  6205. let [method, url] = route.split(" ");
  6206. options = Object.assign(url ? {
  6207. method,
  6208. url
  6209. } : {
  6210. url: method
  6211. }, options);
  6212. } else {
  6213. options = Object.assign({}, route);
  6214. } // lowercase header names before merging with defaults to avoid duplicates
  6215. options.headers = lowercaseKeys(options.headers);
  6216. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6217. if (defaults && defaults.mediaType.previews.length) {
  6218. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6219. }
  6220. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6221. return mergedOptions;
  6222. }
  6223. function addQueryParameters(url, parameters) {
  6224. const separator = /\?/.test(url) ? "&" : "?";
  6225. const names = Object.keys(parameters);
  6226. if (names.length === 0) {
  6227. return url;
  6228. }
  6229. return url + separator + names.map(name => {
  6230. if (name === "q") {
  6231. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6232. }
  6233. return `${name}=${encodeURIComponent(parameters[name])}`;
  6234. }).join("&");
  6235. }
  6236. const urlVariableRegex = /\{[^}]+\}/g;
  6237. function removeNonChars(variableName) {
  6238. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6239. }
  6240. function extractUrlVariableNames(url) {
  6241. const matches = url.match(urlVariableRegex);
  6242. if (!matches) {
  6243. return [];
  6244. }
  6245. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6246. }
  6247. function omit(object, keysToOmit) {
  6248. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6249. obj[key] = object[key];
  6250. return obj;
  6251. }, {});
  6252. }
  6253. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6254. // TODO: create separate package.
  6255. //
  6256. // Copyright (c) 2012-2014, Bram Stein
  6257. // All rights reserved.
  6258. // Redistribution and use in source and binary forms, with or without
  6259. // modification, are permitted provided that the following conditions
  6260. // are met:
  6261. // 1. Redistributions of source code must retain the above copyright
  6262. // notice, this list of conditions and the following disclaimer.
  6263. // 2. Redistributions in binary form must reproduce the above copyright
  6264. // notice, this list of conditions and the following disclaimer in the
  6265. // documentation and/or other materials provided with the distribution.
  6266. // 3. The name of the author may not be used to endorse or promote products
  6267. // derived from this software without specific prior written permission.
  6268. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6269. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6270. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6271. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6272. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6273. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6274. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6275. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6276. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6277. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6278. /* istanbul ignore file */
  6279. function encodeReserved(str) {
  6280. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6281. if (!/%[0-9A-Fa-f]/.test(part)) {
  6282. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6283. }
  6284. return part;
  6285. }).join("");
  6286. }
  6287. function encodeUnreserved(str) {
  6288. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6289. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6290. });
  6291. }
  6292. function encodeValue(operator, value, key) {
  6293. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6294. if (key) {
  6295. return encodeUnreserved(key) + "=" + value;
  6296. } else {
  6297. return value;
  6298. }
  6299. }
  6300. function isDefined(value) {
  6301. return value !== undefined && value !== null;
  6302. }
  6303. function isKeyOperator(operator) {
  6304. return operator === ";" || operator === "&" || operator === "?";
  6305. }
  6306. function getValues(context, operator, key, modifier) {
  6307. var value = context[key],
  6308. result = [];
  6309. if (isDefined(value) && value !== "") {
  6310. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6311. value = value.toString();
  6312. if (modifier && modifier !== "*") {
  6313. value = value.substring(0, parseInt(modifier, 10));
  6314. }
  6315. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6316. } else {
  6317. if (modifier === "*") {
  6318. if (Array.isArray(value)) {
  6319. value.filter(isDefined).forEach(function (value) {
  6320. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6321. });
  6322. } else {
  6323. Object.keys(value).forEach(function (k) {
  6324. if (isDefined(value[k])) {
  6325. result.push(encodeValue(operator, value[k], k));
  6326. }
  6327. });
  6328. }
  6329. } else {
  6330. const tmp = [];
  6331. if (Array.isArray(value)) {
  6332. value.filter(isDefined).forEach(function (value) {
  6333. tmp.push(encodeValue(operator, value));
  6334. });
  6335. } else {
  6336. Object.keys(value).forEach(function (k) {
  6337. if (isDefined(value[k])) {
  6338. tmp.push(encodeUnreserved(k));
  6339. tmp.push(encodeValue(operator, value[k].toString()));
  6340. }
  6341. });
  6342. }
  6343. if (isKeyOperator(operator)) {
  6344. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6345. } else if (tmp.length !== 0) {
  6346. result.push(tmp.join(","));
  6347. }
  6348. }
  6349. }
  6350. } else {
  6351. if (operator === ";") {
  6352. if (isDefined(value)) {
  6353. result.push(encodeUnreserved(key));
  6354. }
  6355. } else if (value === "" && (operator === "&" || operator === "?")) {
  6356. result.push(encodeUnreserved(key) + "=");
  6357. } else if (value === "") {
  6358. result.push("");
  6359. }
  6360. }
  6361. return result;
  6362. }
  6363. function parseUrl(template) {
  6364. return {
  6365. expand: expand.bind(null, template)
  6366. };
  6367. }
  6368. function expand(template, context) {
  6369. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6370. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6371. if (expression) {
  6372. let operator = "";
  6373. const values = [];
  6374. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6375. operator = expression.charAt(0);
  6376. expression = expression.substr(1);
  6377. }
  6378. expression.split(/,/g).forEach(function (variable) {
  6379. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6380. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6381. });
  6382. if (operator && operator !== "+") {
  6383. var separator = ",";
  6384. if (operator === "?") {
  6385. separator = "&";
  6386. } else if (operator !== "#") {
  6387. separator = operator;
  6388. }
  6389. return (values.length !== 0 ? operator : "") + values.join(separator);
  6390. } else {
  6391. return values.join(",");
  6392. }
  6393. } else {
  6394. return encodeReserved(literal);
  6395. }
  6396. });
  6397. }
  6398. function parse(options) {
  6399. // https://fetch.spec.whatwg.org/#methods
  6400. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6401. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6402. let headers = Object.assign({}, options.headers);
  6403. let body;
  6404. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6405. const urlVariableNames = extractUrlVariableNames(url);
  6406. url = parseUrl(url).expand(parameters);
  6407. if (!/^http/.test(url)) {
  6408. url = options.baseUrl + url;
  6409. }
  6410. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6411. const remainingParameters = omit(parameters, omittedParameters);
  6412. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6413. if (!isBinaryRequset) {
  6414. if (options.mediaType.format) {
  6415. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6416. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6417. }
  6418. if (options.mediaType.previews.length) {
  6419. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6420. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6421. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6422. return `application/vnd.github.${preview}-preview${format}`;
  6423. }).join(",");
  6424. }
  6425. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6426. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6427. if (["GET", "HEAD"].includes(method)) {
  6428. url = addQueryParameters(url, remainingParameters);
  6429. } else {
  6430. if ("data" in remainingParameters) {
  6431. body = remainingParameters.data;
  6432. } else {
  6433. if (Object.keys(remainingParameters).length) {
  6434. body = remainingParameters;
  6435. } else {
  6436. headers["content-length"] = 0;
  6437. }
  6438. }
  6439. } // default content-type for JSON if body is set
  6440. if (!headers["content-type"] && typeof body !== "undefined") {
  6441. headers["content-type"] = "application/json; charset=utf-8";
  6442. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6443. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6444. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6445. body = "";
  6446. } // Only return body/request keys if present
  6447. return Object.assign({
  6448. method,
  6449. url,
  6450. headers
  6451. }, typeof body !== "undefined" ? {
  6452. body
  6453. } : null, options.request ? {
  6454. request: options.request
  6455. } : null);
  6456. }
  6457. function endpointWithDefaults(defaults, route, options) {
  6458. return parse(merge(defaults, route, options));
  6459. }
  6460. function withDefaults(oldDefaults, newDefaults) {
  6461. const DEFAULTS = merge(oldDefaults, newDefaults);
  6462. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6463. return Object.assign(endpoint, {
  6464. DEFAULTS,
  6465. defaults: withDefaults.bind(null, DEFAULTS),
  6466. merge: merge.bind(null, DEFAULTS),
  6467. parse
  6468. });
  6469. }
  6470. const VERSION = "6.0.1";
  6471. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6472. // So we use RequestParameters and add method as additional required property.
  6473. const DEFAULTS = {
  6474. method: "GET",
  6475. baseUrl: "https://api.github.com",
  6476. headers: {
  6477. accept: "application/vnd.github.v3+json",
  6478. "user-agent": userAgent
  6479. },
  6480. mediaType: {
  6481. format: "",
  6482. previews: []
  6483. }
  6484. };
  6485. const endpoint = withDefaults(null, DEFAULTS);
  6486. exports.endpoint = endpoint;
  6487. //# sourceMappingURL=index.js.map
  6488. /***/ }),
  6489. /***/ 389:
  6490. /***/ (function(module, __unusedexports, __webpack_require__) {
  6491. "use strict";
  6492. const fs = __webpack_require__(747);
  6493. const shebangCommand = __webpack_require__(866);
  6494. function readShebang(command) {
  6495. // Read the first 150 bytes from the file
  6496. const size = 150;
  6497. let buffer;
  6498. if (Buffer.alloc) {
  6499. // Node.js v4.5+ / v5.10+
  6500. buffer = Buffer.alloc(size);
  6501. } else {
  6502. // Old Node.js API
  6503. buffer = new Buffer(size);
  6504. buffer.fill(0); // zero-fill
  6505. }
  6506. let fd;
  6507. try {
  6508. fd = fs.openSync(command, 'r');
  6509. fs.readSync(fd, buffer, 0, size, 0);
  6510. fs.closeSync(fd);
  6511. } catch (e) { /* Empty */ }
  6512. // Attempt to extract shebang (null is returned if not a shebang)
  6513. return shebangCommand(buffer.toString());
  6514. }
  6515. module.exports = readShebang;
  6516. /***/ }),
  6517. /***/ 402:
  6518. /***/ (function(module, __unusedexports, __webpack_require__) {
  6519. module.exports = Octokit;
  6520. const { request } = __webpack_require__(753);
  6521. const Hook = __webpack_require__(523);
  6522. const parseClientOptions = __webpack_require__(294);
  6523. function Octokit(plugins, options) {
  6524. options = options || {};
  6525. const hook = new Hook.Collection();
  6526. const log = Object.assign(
  6527. {
  6528. debug: () => {},
  6529. info: () => {},
  6530. warn: console.warn,
  6531. error: console.error
  6532. },
  6533. options && options.log
  6534. );
  6535. const api = {
  6536. hook,
  6537. log,
  6538. request: request.defaults(parseClientOptions(options, log, hook))
  6539. };
  6540. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6541. return api;
  6542. }
  6543. /***/ }),
  6544. /***/ 413:
  6545. /***/ (function(module) {
  6546. module.exports = require("stream");
  6547. /***/ }),
  6548. /***/ 417:
  6549. /***/ (function(module) {
  6550. module.exports = require("crypto");
  6551. /***/ }),
  6552. /***/ 427:
  6553. /***/ (function(module, __unusedexports, __webpack_require__) {
  6554. "use strict";
  6555. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6556. // In that case, fall back to a deprecated internal.
  6557. const util = __webpack_require__(669);
  6558. let uv;
  6559. if (typeof util.getSystemErrorName === 'function') {
  6560. module.exports = util.getSystemErrorName;
  6561. } else {
  6562. try {
  6563. uv = process.binding('uv');
  6564. if (typeof uv.errname !== 'function') {
  6565. throw new TypeError('uv.errname is not a function');
  6566. }
  6567. } catch (err) {
  6568. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6569. uv = null;
  6570. }
  6571. module.exports = code => errname(uv, code);
  6572. }
  6573. // Used for testing the fallback behavior
  6574. module.exports.__test__ = errname;
  6575. function errname(uv, code) {
  6576. if (uv) {
  6577. return uv.errname(code);
  6578. }
  6579. if (!(code < 0)) {
  6580. throw new Error('err >= 0');
  6581. }
  6582. return `Unknown system error ${code}`;
  6583. }
  6584. /***/ }),
  6585. /***/ 430:
  6586. /***/ (function(module, __unusedexports, __webpack_require__) {
  6587. module.exports = octokitValidate;
  6588. const validate = __webpack_require__(348);
  6589. function octokitValidate(octokit) {
  6590. octokit.hook.before("request", validate.bind(null, octokit));
  6591. }
  6592. /***/ }),
  6593. /***/ 431:
  6594. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6595. "use strict";
  6596. var __importStar = (this && this.__importStar) || function (mod) {
  6597. if (mod && mod.__esModule) return mod;
  6598. var result = {};
  6599. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6600. result["default"] = mod;
  6601. return result;
  6602. };
  6603. Object.defineProperty(exports, "__esModule", { value: true });
  6604. const os = __importStar(__webpack_require__(87));
  6605. const utils_1 = __webpack_require__(82);
  6606. /**
  6607. * Commands
  6608. *
  6609. * Command Format:
  6610. * ::name key=value,key=value::message
  6611. *
  6612. * Examples:
  6613. * ::warning::This is the message
  6614. * ::set-env name=MY_VAR::some value
  6615. */
  6616. function issueCommand(command, properties, message) {
  6617. const cmd = new Command(command, properties, message);
  6618. process.stdout.write(cmd.toString() + os.EOL);
  6619. }
  6620. exports.issueCommand = issueCommand;
  6621. function issue(name, message = '') {
  6622. issueCommand(name, {}, message);
  6623. }
  6624. exports.issue = issue;
  6625. const CMD_STRING = '::';
  6626. class Command {
  6627. constructor(command, properties, message) {
  6628. if (!command) {
  6629. command = 'missing.command';
  6630. }
  6631. this.command = command;
  6632. this.properties = properties;
  6633. this.message = message;
  6634. }
  6635. toString() {
  6636. let cmdStr = CMD_STRING + this.command;
  6637. if (this.properties && Object.keys(this.properties).length > 0) {
  6638. cmdStr += ' ';
  6639. let first = true;
  6640. for (const key in this.properties) {
  6641. if (this.properties.hasOwnProperty(key)) {
  6642. const val = this.properties[key];
  6643. if (val) {
  6644. if (first) {
  6645. first = false;
  6646. }
  6647. else {
  6648. cmdStr += ',';
  6649. }
  6650. cmdStr += `${key}=${escapeProperty(val)}`;
  6651. }
  6652. }
  6653. }
  6654. }
  6655. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  6656. return cmdStr;
  6657. }
  6658. }
  6659. function escapeData(s) {
  6660. return utils_1.toCommandValue(s)
  6661. .replace(/%/g, '%25')
  6662. .replace(/\r/g, '%0D')
  6663. .replace(/\n/g, '%0A');
  6664. }
  6665. function escapeProperty(s) {
  6666. return utils_1.toCommandValue(s)
  6667. .replace(/%/g, '%25')
  6668. .replace(/\r/g, '%0D')
  6669. .replace(/\n/g, '%0A')
  6670. .replace(/:/g, '%3A')
  6671. .replace(/,/g, '%2C');
  6672. }
  6673. //# sourceMappingURL=command.js.map
  6674. /***/ }),
  6675. /***/ 438:
  6676. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6677. "use strict";
  6678. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6679. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6680. return new (P || (P = Promise))(function (resolve, reject) {
  6681. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6682. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6683. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6684. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6685. });
  6686. };
  6687. var __importStar = (this && this.__importStar) || function (mod) {
  6688. if (mod && mod.__esModule) return mod;
  6689. var result = {};
  6690. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6691. result["default"] = mod;
  6692. return result;
  6693. };
  6694. Object.defineProperty(exports, "__esModule", { value: true });
  6695. const assert = __importStar(__webpack_require__(357));
  6696. const core = __importStar(__webpack_require__(470));
  6697. const fs = __importStar(__webpack_require__(747));
  6698. const fsHelper = __importStar(__webpack_require__(618));
  6699. const io = __importStar(__webpack_require__(1));
  6700. const path = __importStar(__webpack_require__(622));
  6701. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6702. return __awaiter(this, void 0, void 0, function* () {
  6703. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6704. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6705. // Indicates whether to delete the directory contents
  6706. let remove = false;
  6707. // Check whether using git or REST API
  6708. if (!git) {
  6709. remove = true;
  6710. }
  6711. // Fetch URL does not match
  6712. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6713. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6714. remove = true;
  6715. }
  6716. else {
  6717. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6718. const lockPaths = [
  6719. path.join(repositoryPath, '.git', 'index.lock'),
  6720. path.join(repositoryPath, '.git', 'shallow.lock')
  6721. ];
  6722. for (const lockPath of lockPaths) {
  6723. try {
  6724. yield io.rmRF(lockPath);
  6725. }
  6726. catch (error) {
  6727. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6728. }
  6729. }
  6730. try {
  6731. core.startGroup('Removing previously created refs, to avoid conflicts');
  6732. // Checkout detached HEAD
  6733. if (!(yield git.isDetached())) {
  6734. yield git.checkoutDetach();
  6735. }
  6736. // Remove all refs/heads/*
  6737. let branches = yield git.branchList(false);
  6738. for (const branch of branches) {
  6739. yield git.branchDelete(false, branch);
  6740. }
  6741. // Remove any conflicting refs/remotes/origin/*
  6742. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6743. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6744. if (ref) {
  6745. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6746. if (ref.startsWith('refs/heads/')) {
  6747. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6748. const upperName1Slash = `${upperName1}/`;
  6749. branches = yield git.branchList(true);
  6750. for (const branch of branches) {
  6751. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6752. const upperName2Slash = `${upperName2}/`;
  6753. if (upperName1.startsWith(upperName2Slash) ||
  6754. upperName2.startsWith(upperName1Slash)) {
  6755. yield git.branchDelete(true, branch);
  6756. }
  6757. }
  6758. }
  6759. }
  6760. core.endGroup();
  6761. // Clean
  6762. if (clean) {
  6763. core.startGroup('Cleaning the repository');
  6764. if (!(yield git.tryClean())) {
  6765. 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}'.`);
  6766. remove = true;
  6767. }
  6768. else if (!(yield git.tryReset())) {
  6769. remove = true;
  6770. }
  6771. core.endGroup();
  6772. if (remove) {
  6773. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6774. }
  6775. }
  6776. }
  6777. catch (error) {
  6778. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6779. remove = true;
  6780. }
  6781. }
  6782. if (remove) {
  6783. // Delete the contents of the directory. Don't delete the directory itself
  6784. // since it might be the current working directory.
  6785. core.info(`Deleting the contents of '${repositoryPath}'`);
  6786. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6787. yield io.rmRF(path.join(repositoryPath, file));
  6788. }
  6789. }
  6790. });
  6791. }
  6792. exports.prepareExistingDirectory = prepareExistingDirectory;
  6793. /***/ }),
  6794. /***/ 453:
  6795. /***/ (function(module, __unusedexports, __webpack_require__) {
  6796. var once = __webpack_require__(969)
  6797. var eos = __webpack_require__(3)
  6798. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6799. var noop = function () {}
  6800. var ancient = /^v?\.0/.test(process.version)
  6801. var isFn = function (fn) {
  6802. return typeof fn === 'function'
  6803. }
  6804. var isFS = function (stream) {
  6805. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6806. if (!fs) return false // browser
  6807. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6808. }
  6809. var isRequest = function (stream) {
  6810. return stream.setHeader && isFn(stream.abort)
  6811. }
  6812. var destroyer = function (stream, reading, writing, callback) {
  6813. callback = once(callback)
  6814. var closed = false
  6815. stream.on('close', function () {
  6816. closed = true
  6817. })
  6818. eos(stream, {readable: reading, writable: writing}, function (err) {
  6819. if (err) return callback(err)
  6820. closed = true
  6821. callback()
  6822. })
  6823. var destroyed = false
  6824. return function (err) {
  6825. if (closed) return
  6826. if (destroyed) return
  6827. destroyed = true
  6828. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6829. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6830. if (isFn(stream.destroy)) return stream.destroy()
  6831. callback(err || new Error('stream was destroyed'))
  6832. }
  6833. }
  6834. var call = function (fn) {
  6835. fn()
  6836. }
  6837. var pipe = function (from, to) {
  6838. return from.pipe(to)
  6839. }
  6840. var pump = function () {
  6841. var streams = Array.prototype.slice.call(arguments)
  6842. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6843. if (Array.isArray(streams[0])) streams = streams[0]
  6844. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6845. var error
  6846. var destroys = streams.map(function (stream, i) {
  6847. var reading = i < streams.length - 1
  6848. var writing = i > 0
  6849. return destroyer(stream, reading, writing, function (err) {
  6850. if (!error) error = err
  6851. if (err) destroys.forEach(call)
  6852. if (reading) return
  6853. destroys.forEach(call)
  6854. callback(error)
  6855. })
  6856. })
  6857. return streams.reduce(pipe)
  6858. }
  6859. module.exports = pump
  6860. /***/ }),
  6861. /***/ 454:
  6862. /***/ (function(module, exports, __webpack_require__) {
  6863. "use strict";
  6864. Object.defineProperty(exports, '__esModule', { value: true });
  6865. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6866. var Stream = _interopDefault(__webpack_require__(413));
  6867. var http = _interopDefault(__webpack_require__(605));
  6868. var Url = _interopDefault(__webpack_require__(835));
  6869. var https = _interopDefault(__webpack_require__(34));
  6870. var zlib = _interopDefault(__webpack_require__(761));
  6871. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6872. // fix for "Readable" isn't a named export issue
  6873. const Readable = Stream.Readable;
  6874. const BUFFER = Symbol('buffer');
  6875. const TYPE = Symbol('type');
  6876. class Blob {
  6877. constructor() {
  6878. this[TYPE] = '';
  6879. const blobParts = arguments[0];
  6880. const options = arguments[1];
  6881. const buffers = [];
  6882. let size = 0;
  6883. if (blobParts) {
  6884. const a = blobParts;
  6885. const length = Number(a.length);
  6886. for (let i = 0; i < length; i++) {
  6887. const element = a[i];
  6888. let buffer;
  6889. if (element instanceof Buffer) {
  6890. buffer = element;
  6891. } else if (ArrayBuffer.isView(element)) {
  6892. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6893. } else if (element instanceof ArrayBuffer) {
  6894. buffer = Buffer.from(element);
  6895. } else if (element instanceof Blob) {
  6896. buffer = element[BUFFER];
  6897. } else {
  6898. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6899. }
  6900. size += buffer.length;
  6901. buffers.push(buffer);
  6902. }
  6903. }
  6904. this[BUFFER] = Buffer.concat(buffers);
  6905. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6906. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6907. this[TYPE] = type;
  6908. }
  6909. }
  6910. get size() {
  6911. return this[BUFFER].length;
  6912. }
  6913. get type() {
  6914. return this[TYPE];
  6915. }
  6916. text() {
  6917. return Promise.resolve(this[BUFFER].toString());
  6918. }
  6919. arrayBuffer() {
  6920. const buf = this[BUFFER];
  6921. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6922. return Promise.resolve(ab);
  6923. }
  6924. stream() {
  6925. const readable = new Readable();
  6926. readable._read = function () {};
  6927. readable.push(this[BUFFER]);
  6928. readable.push(null);
  6929. return readable;
  6930. }
  6931. toString() {
  6932. return '[object Blob]';
  6933. }
  6934. slice() {
  6935. const size = this.size;
  6936. const start = arguments[0];
  6937. const end = arguments[1];
  6938. let relativeStart, relativeEnd;
  6939. if (start === undefined) {
  6940. relativeStart = 0;
  6941. } else if (start < 0) {
  6942. relativeStart = Math.max(size + start, 0);
  6943. } else {
  6944. relativeStart = Math.min(start, size);
  6945. }
  6946. if (end === undefined) {
  6947. relativeEnd = size;
  6948. } else if (end < 0) {
  6949. relativeEnd = Math.max(size + end, 0);
  6950. } else {
  6951. relativeEnd = Math.min(end, size);
  6952. }
  6953. const span = Math.max(relativeEnd - relativeStart, 0);
  6954. const buffer = this[BUFFER];
  6955. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6956. const blob = new Blob([], { type: arguments[2] });
  6957. blob[BUFFER] = slicedBuffer;
  6958. return blob;
  6959. }
  6960. }
  6961. Object.defineProperties(Blob.prototype, {
  6962. size: { enumerable: true },
  6963. type: { enumerable: true },
  6964. slice: { enumerable: true }
  6965. });
  6966. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6967. value: 'Blob',
  6968. writable: false,
  6969. enumerable: false,
  6970. configurable: true
  6971. });
  6972. /**
  6973. * fetch-error.js
  6974. *
  6975. * FetchError interface for operational errors
  6976. */
  6977. /**
  6978. * Create FetchError instance
  6979. *
  6980. * @param String message Error message for human
  6981. * @param String type Error type for machine
  6982. * @param String systemError For Node.js system error
  6983. * @return FetchError
  6984. */
  6985. function FetchError(message, type, systemError) {
  6986. Error.call(this, message);
  6987. this.message = message;
  6988. this.type = type;
  6989. // when err.type is `system`, err.code contains system error code
  6990. if (systemError) {
  6991. this.code = this.errno = systemError.code;
  6992. }
  6993. // hide custom error implementation details from end-users
  6994. Error.captureStackTrace(this, this.constructor);
  6995. }
  6996. FetchError.prototype = Object.create(Error.prototype);
  6997. FetchError.prototype.constructor = FetchError;
  6998. FetchError.prototype.name = 'FetchError';
  6999. let convert;
  7000. try {
  7001. convert = __webpack_require__(18).convert;
  7002. } catch (e) {}
  7003. const INTERNALS = Symbol('Body internals');
  7004. // fix an issue where "PassThrough" isn't a named export for node <10
  7005. const PassThrough = Stream.PassThrough;
  7006. /**
  7007. * Body mixin
  7008. *
  7009. * Ref: https://fetch.spec.whatwg.org/#body
  7010. *
  7011. * @param Stream body Readable stream
  7012. * @param Object opts Response options
  7013. * @return Void
  7014. */
  7015. function Body(body) {
  7016. var _this = this;
  7017. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  7018. _ref$size = _ref.size;
  7019. let size = _ref$size === undefined ? 0 : _ref$size;
  7020. var _ref$timeout = _ref.timeout;
  7021. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  7022. if (body == null) {
  7023. // body is undefined or null
  7024. body = null;
  7025. } else if (isURLSearchParams(body)) {
  7026. // body is a URLSearchParams
  7027. body = Buffer.from(body.toString());
  7028. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7029. // body is ArrayBuffer
  7030. body = Buffer.from(body);
  7031. } else if (ArrayBuffer.isView(body)) {
  7032. // body is ArrayBufferView
  7033. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  7034. } else if (body instanceof Stream) ; else {
  7035. // none of the above
  7036. // coerce to string then buffer
  7037. body = Buffer.from(String(body));
  7038. }
  7039. this[INTERNALS] = {
  7040. body,
  7041. disturbed: false,
  7042. error: null
  7043. };
  7044. this.size = size;
  7045. this.timeout = timeout;
  7046. if (body instanceof Stream) {
  7047. body.on('error', function (err) {
  7048. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  7049. _this[INTERNALS].error = error;
  7050. });
  7051. }
  7052. }
  7053. Body.prototype = {
  7054. get body() {
  7055. return this[INTERNALS].body;
  7056. },
  7057. get bodyUsed() {
  7058. return this[INTERNALS].disturbed;
  7059. },
  7060. /**
  7061. * Decode response as ArrayBuffer
  7062. *
  7063. * @return Promise
  7064. */
  7065. arrayBuffer() {
  7066. return consumeBody.call(this).then(function (buf) {
  7067. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  7068. });
  7069. },
  7070. /**
  7071. * Return raw response as Blob
  7072. *
  7073. * @return Promise
  7074. */
  7075. blob() {
  7076. let ct = this.headers && this.headers.get('content-type') || '';
  7077. return consumeBody.call(this).then(function (buf) {
  7078. return Object.assign(
  7079. // Prevent copying
  7080. new Blob([], {
  7081. type: ct.toLowerCase()
  7082. }), {
  7083. [BUFFER]: buf
  7084. });
  7085. });
  7086. },
  7087. /**
  7088. * Decode response as json
  7089. *
  7090. * @return Promise
  7091. */
  7092. json() {
  7093. var _this2 = this;
  7094. return consumeBody.call(this).then(function (buffer) {
  7095. try {
  7096. return JSON.parse(buffer.toString());
  7097. } catch (err) {
  7098. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  7099. }
  7100. });
  7101. },
  7102. /**
  7103. * Decode response as text
  7104. *
  7105. * @return Promise
  7106. */
  7107. text() {
  7108. return consumeBody.call(this).then(function (buffer) {
  7109. return buffer.toString();
  7110. });
  7111. },
  7112. /**
  7113. * Decode response as buffer (non-spec api)
  7114. *
  7115. * @return Promise
  7116. */
  7117. buffer() {
  7118. return consumeBody.call(this);
  7119. },
  7120. /**
  7121. * Decode response as text, while automatically detecting the encoding and
  7122. * trying to decode to UTF-8 (non-spec api)
  7123. *
  7124. * @return Promise
  7125. */
  7126. textConverted() {
  7127. var _this3 = this;
  7128. return consumeBody.call(this).then(function (buffer) {
  7129. return convertBody(buffer, _this3.headers);
  7130. });
  7131. }
  7132. };
  7133. // In browsers, all properties are enumerable.
  7134. Object.defineProperties(Body.prototype, {
  7135. body: { enumerable: true },
  7136. bodyUsed: { enumerable: true },
  7137. arrayBuffer: { enumerable: true },
  7138. blob: { enumerable: true },
  7139. json: { enumerable: true },
  7140. text: { enumerable: true }
  7141. });
  7142. Body.mixIn = function (proto) {
  7143. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7144. // istanbul ignore else: future proof
  7145. if (!(name in proto)) {
  7146. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7147. Object.defineProperty(proto, name, desc);
  7148. }
  7149. }
  7150. };
  7151. /**
  7152. * Consume and convert an entire Body to a Buffer.
  7153. *
  7154. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7155. *
  7156. * @return Promise
  7157. */
  7158. function consumeBody() {
  7159. var _this4 = this;
  7160. if (this[INTERNALS].disturbed) {
  7161. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7162. }
  7163. this[INTERNALS].disturbed = true;
  7164. if (this[INTERNALS].error) {
  7165. return Body.Promise.reject(this[INTERNALS].error);
  7166. }
  7167. let body = this.body;
  7168. // body is null
  7169. if (body === null) {
  7170. return Body.Promise.resolve(Buffer.alloc(0));
  7171. }
  7172. // body is blob
  7173. if (isBlob(body)) {
  7174. body = body.stream();
  7175. }
  7176. // body is buffer
  7177. if (Buffer.isBuffer(body)) {
  7178. return Body.Promise.resolve(body);
  7179. }
  7180. // istanbul ignore if: should never happen
  7181. if (!(body instanceof Stream)) {
  7182. return Body.Promise.resolve(Buffer.alloc(0));
  7183. }
  7184. // body is stream
  7185. // get ready to actually consume the body
  7186. let accum = [];
  7187. let accumBytes = 0;
  7188. let abort = false;
  7189. return new Body.Promise(function (resolve, reject) {
  7190. let resTimeout;
  7191. // allow timeout on slow response body
  7192. if (_this4.timeout) {
  7193. resTimeout = setTimeout(function () {
  7194. abort = true;
  7195. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7196. }, _this4.timeout);
  7197. }
  7198. // handle stream errors
  7199. body.on('error', function (err) {
  7200. if (err.name === 'AbortError') {
  7201. // if the request was aborted, reject with this Error
  7202. abort = true;
  7203. reject(err);
  7204. } else {
  7205. // other errors, such as incorrect content-encoding
  7206. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7207. }
  7208. });
  7209. body.on('data', function (chunk) {
  7210. if (abort || chunk === null) {
  7211. return;
  7212. }
  7213. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7214. abort = true;
  7215. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7216. return;
  7217. }
  7218. accumBytes += chunk.length;
  7219. accum.push(chunk);
  7220. });
  7221. body.on('end', function () {
  7222. if (abort) {
  7223. return;
  7224. }
  7225. clearTimeout(resTimeout);
  7226. try {
  7227. resolve(Buffer.concat(accum, accumBytes));
  7228. } catch (err) {
  7229. // handle streams that have accumulated too much data (issue #414)
  7230. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7231. }
  7232. });
  7233. });
  7234. }
  7235. /**
  7236. * Detect buffer encoding and convert to target encoding
  7237. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7238. *
  7239. * @param Buffer buffer Incoming buffer
  7240. * @param String encoding Target encoding
  7241. * @return String
  7242. */
  7243. function convertBody(buffer, headers) {
  7244. if (typeof convert !== 'function') {
  7245. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7246. }
  7247. const ct = headers.get('content-type');
  7248. let charset = 'utf-8';
  7249. let res, str;
  7250. // header
  7251. if (ct) {
  7252. res = /charset=([^;]*)/i.exec(ct);
  7253. }
  7254. // no charset in content type, peek at response body for at most 1024 bytes
  7255. str = buffer.slice(0, 1024).toString();
  7256. // html5
  7257. if (!res && str) {
  7258. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7259. }
  7260. // html4
  7261. if (!res && str) {
  7262. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7263. if (res) {
  7264. res = /charset=(.*)/i.exec(res.pop());
  7265. }
  7266. }
  7267. // xml
  7268. if (!res && str) {
  7269. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7270. }
  7271. // found charset
  7272. if (res) {
  7273. charset = res.pop();
  7274. // prevent decode issues when sites use incorrect encoding
  7275. // ref: https://hsivonen.fi/encoding-menu/
  7276. if (charset === 'gb2312' || charset === 'gbk') {
  7277. charset = 'gb18030';
  7278. }
  7279. }
  7280. // turn raw buffers into a single utf-8 buffer
  7281. return convert(buffer, 'UTF-8', charset).toString();
  7282. }
  7283. /**
  7284. * Detect a URLSearchParams object
  7285. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7286. *
  7287. * @param Object obj Object to detect by type or brand
  7288. * @return String
  7289. */
  7290. function isURLSearchParams(obj) {
  7291. // Duck-typing as a necessary condition.
  7292. 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') {
  7293. return false;
  7294. }
  7295. // Brand-checking and more duck-typing as optional condition.
  7296. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7297. }
  7298. /**
  7299. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7300. * @param {*} obj
  7301. * @return {boolean}
  7302. */
  7303. function isBlob(obj) {
  7304. 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]);
  7305. }
  7306. /**
  7307. * Clone body given Res/Req instance
  7308. *
  7309. * @param Mixed instance Response or Request instance
  7310. * @return Mixed
  7311. */
  7312. function clone(instance) {
  7313. let p1, p2;
  7314. let body = instance.body;
  7315. // don't allow cloning a used body
  7316. if (instance.bodyUsed) {
  7317. throw new Error('cannot clone body after it is used');
  7318. }
  7319. // check that body is a stream and not form-data object
  7320. // note: we can't clone the form-data object without having it as a dependency
  7321. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7322. // tee instance body
  7323. p1 = new PassThrough();
  7324. p2 = new PassThrough();
  7325. body.pipe(p1);
  7326. body.pipe(p2);
  7327. // set instance body to teed body and return the other teed body
  7328. instance[INTERNALS].body = p1;
  7329. body = p2;
  7330. }
  7331. return body;
  7332. }
  7333. /**
  7334. * Performs the operation "extract a `Content-Type` value from |object|" as
  7335. * specified in the specification:
  7336. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7337. *
  7338. * This function assumes that instance.body is present.
  7339. *
  7340. * @param Mixed instance Any options.body input
  7341. */
  7342. function extractContentType(body) {
  7343. if (body === null) {
  7344. // body is null
  7345. return null;
  7346. } else if (typeof body === 'string') {
  7347. // body is string
  7348. return 'text/plain;charset=UTF-8';
  7349. } else if (isURLSearchParams(body)) {
  7350. // body is a URLSearchParams
  7351. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7352. } else if (isBlob(body)) {
  7353. // body is blob
  7354. return body.type || null;
  7355. } else if (Buffer.isBuffer(body)) {
  7356. // body is buffer
  7357. return null;
  7358. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7359. // body is ArrayBuffer
  7360. return null;
  7361. } else if (ArrayBuffer.isView(body)) {
  7362. // body is ArrayBufferView
  7363. return null;
  7364. } else if (typeof body.getBoundary === 'function') {
  7365. // detect form data input from form-data module
  7366. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7367. } else if (body instanceof Stream) {
  7368. // body is stream
  7369. // can't really do much about this
  7370. return null;
  7371. } else {
  7372. // Body constructor defaults other things to string
  7373. return 'text/plain;charset=UTF-8';
  7374. }
  7375. }
  7376. /**
  7377. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7378. * For us, we have to explicitly get it with a function.
  7379. *
  7380. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7381. *
  7382. * @param Body instance Instance of Body
  7383. * @return Number? Number of bytes, or null if not possible
  7384. */
  7385. function getTotalBytes(instance) {
  7386. const body = instance.body;
  7387. if (body === null) {
  7388. // body is null
  7389. return 0;
  7390. } else if (isBlob(body)) {
  7391. return body.size;
  7392. } else if (Buffer.isBuffer(body)) {
  7393. // body is buffer
  7394. return body.length;
  7395. } else if (body && typeof body.getLengthSync === 'function') {
  7396. // detect form data input from form-data module
  7397. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7398. body.hasKnownLength && body.hasKnownLength()) {
  7399. // 2.x
  7400. return body.getLengthSync();
  7401. }
  7402. return null;
  7403. } else {
  7404. // body is stream
  7405. return null;
  7406. }
  7407. }
  7408. /**
  7409. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7410. *
  7411. * @param Body instance Instance of Body
  7412. * @return Void
  7413. */
  7414. function writeToStream(dest, instance) {
  7415. const body = instance.body;
  7416. if (body === null) {
  7417. // body is null
  7418. dest.end();
  7419. } else if (isBlob(body)) {
  7420. body.stream().pipe(dest);
  7421. } else if (Buffer.isBuffer(body)) {
  7422. // body is buffer
  7423. dest.write(body);
  7424. dest.end();
  7425. } else {
  7426. // body is stream
  7427. body.pipe(dest);
  7428. }
  7429. }
  7430. // expose Promise
  7431. Body.Promise = global.Promise;
  7432. /**
  7433. * headers.js
  7434. *
  7435. * Headers class offers convenient helpers
  7436. */
  7437. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7438. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7439. function validateName(name) {
  7440. name = `${name}`;
  7441. if (invalidTokenRegex.test(name) || name === '') {
  7442. throw new TypeError(`${name} is not a legal HTTP header name`);
  7443. }
  7444. }
  7445. function validateValue(value) {
  7446. value = `${value}`;
  7447. if (invalidHeaderCharRegex.test(value)) {
  7448. throw new TypeError(`${value} is not a legal HTTP header value`);
  7449. }
  7450. }
  7451. /**
  7452. * Find the key in the map object given a header name.
  7453. *
  7454. * Returns undefined if not found.
  7455. *
  7456. * @param String name Header name
  7457. * @return String|Undefined
  7458. */
  7459. function find(map, name) {
  7460. name = name.toLowerCase();
  7461. for (const key in map) {
  7462. if (key.toLowerCase() === name) {
  7463. return key;
  7464. }
  7465. }
  7466. return undefined;
  7467. }
  7468. const MAP = Symbol('map');
  7469. class Headers {
  7470. /**
  7471. * Headers class
  7472. *
  7473. * @param Object headers Response headers
  7474. * @return Void
  7475. */
  7476. constructor() {
  7477. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7478. this[MAP] = Object.create(null);
  7479. if (init instanceof Headers) {
  7480. const rawHeaders = init.raw();
  7481. const headerNames = Object.keys(rawHeaders);
  7482. for (const headerName of headerNames) {
  7483. for (const value of rawHeaders[headerName]) {
  7484. this.append(headerName, value);
  7485. }
  7486. }
  7487. return;
  7488. }
  7489. // We don't worry about converting prop to ByteString here as append()
  7490. // will handle it.
  7491. if (init == null) ; else if (typeof init === 'object') {
  7492. const method = init[Symbol.iterator];
  7493. if (method != null) {
  7494. if (typeof method !== 'function') {
  7495. throw new TypeError('Header pairs must be iterable');
  7496. }
  7497. // sequence<sequence<ByteString>>
  7498. // Note: per spec we have to first exhaust the lists then process them
  7499. const pairs = [];
  7500. for (const pair of init) {
  7501. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7502. throw new TypeError('Each header pair must be iterable');
  7503. }
  7504. pairs.push(Array.from(pair));
  7505. }
  7506. for (const pair of pairs) {
  7507. if (pair.length !== 2) {
  7508. throw new TypeError('Each header pair must be a name/value tuple');
  7509. }
  7510. this.append(pair[0], pair[1]);
  7511. }
  7512. } else {
  7513. // record<ByteString, ByteString>
  7514. for (const key of Object.keys(init)) {
  7515. const value = init[key];
  7516. this.append(key, value);
  7517. }
  7518. }
  7519. } else {
  7520. throw new TypeError('Provided initializer must be an object');
  7521. }
  7522. }
  7523. /**
  7524. * Return combined header value given name
  7525. *
  7526. * @param String name Header name
  7527. * @return Mixed
  7528. */
  7529. get(name) {
  7530. name = `${name}`;
  7531. validateName(name);
  7532. const key = find(this[MAP], name);
  7533. if (key === undefined) {
  7534. return null;
  7535. }
  7536. return this[MAP][key].join(', ');
  7537. }
  7538. /**
  7539. * Iterate over all headers
  7540. *
  7541. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7542. * @param Boolean thisArg `this` context for callback function
  7543. * @return Void
  7544. */
  7545. forEach(callback) {
  7546. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7547. let pairs = getHeaders(this);
  7548. let i = 0;
  7549. while (i < pairs.length) {
  7550. var _pairs$i = pairs[i];
  7551. const name = _pairs$i[0],
  7552. value = _pairs$i[1];
  7553. callback.call(thisArg, value, name, this);
  7554. pairs = getHeaders(this);
  7555. i++;
  7556. }
  7557. }
  7558. /**
  7559. * Overwrite header values given name
  7560. *
  7561. * @param String name Header name
  7562. * @param String value Header value
  7563. * @return Void
  7564. */
  7565. set(name, value) {
  7566. name = `${name}`;
  7567. value = `${value}`;
  7568. validateName(name);
  7569. validateValue(value);
  7570. const key = find(this[MAP], name);
  7571. this[MAP][key !== undefined ? key : name] = [value];
  7572. }
  7573. /**
  7574. * Append a value onto existing header
  7575. *
  7576. * @param String name Header name
  7577. * @param String value Header value
  7578. * @return Void
  7579. */
  7580. append(name, value) {
  7581. name = `${name}`;
  7582. value = `${value}`;
  7583. validateName(name);
  7584. validateValue(value);
  7585. const key = find(this[MAP], name);
  7586. if (key !== undefined) {
  7587. this[MAP][key].push(value);
  7588. } else {
  7589. this[MAP][name] = [value];
  7590. }
  7591. }
  7592. /**
  7593. * Check for header name existence
  7594. *
  7595. * @param String name Header name
  7596. * @return Boolean
  7597. */
  7598. has(name) {
  7599. name = `${name}`;
  7600. validateName(name);
  7601. return find(this[MAP], name) !== undefined;
  7602. }
  7603. /**
  7604. * Delete all header values given name
  7605. *
  7606. * @param String name Header name
  7607. * @return Void
  7608. */
  7609. delete(name) {
  7610. name = `${name}`;
  7611. validateName(name);
  7612. const key = find(this[MAP], name);
  7613. if (key !== undefined) {
  7614. delete this[MAP][key];
  7615. }
  7616. }
  7617. /**
  7618. * Return raw headers (non-spec api)
  7619. *
  7620. * @return Object
  7621. */
  7622. raw() {
  7623. return this[MAP];
  7624. }
  7625. /**
  7626. * Get an iterator on keys.
  7627. *
  7628. * @return Iterator
  7629. */
  7630. keys() {
  7631. return createHeadersIterator(this, 'key');
  7632. }
  7633. /**
  7634. * Get an iterator on values.
  7635. *
  7636. * @return Iterator
  7637. */
  7638. values() {
  7639. return createHeadersIterator(this, 'value');
  7640. }
  7641. /**
  7642. * Get an iterator on entries.
  7643. *
  7644. * This is the default iterator of the Headers object.
  7645. *
  7646. * @return Iterator
  7647. */
  7648. [Symbol.iterator]() {
  7649. return createHeadersIterator(this, 'key+value');
  7650. }
  7651. }
  7652. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7653. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7654. value: 'Headers',
  7655. writable: false,
  7656. enumerable: false,
  7657. configurable: true
  7658. });
  7659. Object.defineProperties(Headers.prototype, {
  7660. get: { enumerable: true },
  7661. forEach: { enumerable: true },
  7662. set: { enumerable: true },
  7663. append: { enumerable: true },
  7664. has: { enumerable: true },
  7665. delete: { enumerable: true },
  7666. keys: { enumerable: true },
  7667. values: { enumerable: true },
  7668. entries: { enumerable: true }
  7669. });
  7670. function getHeaders(headers) {
  7671. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7672. const keys = Object.keys(headers[MAP]).sort();
  7673. return keys.map(kind === 'key' ? function (k) {
  7674. return k.toLowerCase();
  7675. } : kind === 'value' ? function (k) {
  7676. return headers[MAP][k].join(', ');
  7677. } : function (k) {
  7678. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7679. });
  7680. }
  7681. const INTERNAL = Symbol('internal');
  7682. function createHeadersIterator(target, kind) {
  7683. const iterator = Object.create(HeadersIteratorPrototype);
  7684. iterator[INTERNAL] = {
  7685. target,
  7686. kind,
  7687. index: 0
  7688. };
  7689. return iterator;
  7690. }
  7691. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7692. next() {
  7693. // istanbul ignore if
  7694. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7695. throw new TypeError('Value of `this` is not a HeadersIterator');
  7696. }
  7697. var _INTERNAL = this[INTERNAL];
  7698. const target = _INTERNAL.target,
  7699. kind = _INTERNAL.kind,
  7700. index = _INTERNAL.index;
  7701. const values = getHeaders(target, kind);
  7702. const len = values.length;
  7703. if (index >= len) {
  7704. return {
  7705. value: undefined,
  7706. done: true
  7707. };
  7708. }
  7709. this[INTERNAL].index = index + 1;
  7710. return {
  7711. value: values[index],
  7712. done: false
  7713. };
  7714. }
  7715. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7716. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7717. value: 'HeadersIterator',
  7718. writable: false,
  7719. enumerable: false,
  7720. configurable: true
  7721. });
  7722. /**
  7723. * Export the Headers object in a form that Node.js can consume.
  7724. *
  7725. * @param Headers headers
  7726. * @return Object
  7727. */
  7728. function exportNodeCompatibleHeaders(headers) {
  7729. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7730. // http.request() only supports string as Host header. This hack makes
  7731. // specifying custom Host header possible.
  7732. const hostHeaderKey = find(headers[MAP], 'Host');
  7733. if (hostHeaderKey !== undefined) {
  7734. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7735. }
  7736. return obj;
  7737. }
  7738. /**
  7739. * Create a Headers object from an object of headers, ignoring those that do
  7740. * not conform to HTTP grammar productions.
  7741. *
  7742. * @param Object obj Object of headers
  7743. * @return Headers
  7744. */
  7745. function createHeadersLenient(obj) {
  7746. const headers = new Headers();
  7747. for (const name of Object.keys(obj)) {
  7748. if (invalidTokenRegex.test(name)) {
  7749. continue;
  7750. }
  7751. if (Array.isArray(obj[name])) {
  7752. for (const val of obj[name]) {
  7753. if (invalidHeaderCharRegex.test(val)) {
  7754. continue;
  7755. }
  7756. if (headers[MAP][name] === undefined) {
  7757. headers[MAP][name] = [val];
  7758. } else {
  7759. headers[MAP][name].push(val);
  7760. }
  7761. }
  7762. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7763. headers[MAP][name] = [obj[name]];
  7764. }
  7765. }
  7766. return headers;
  7767. }
  7768. const INTERNALS$1 = Symbol('Response internals');
  7769. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7770. const STATUS_CODES = http.STATUS_CODES;
  7771. /**
  7772. * Response class
  7773. *
  7774. * @param Stream body Readable stream
  7775. * @param Object opts Response options
  7776. * @return Void
  7777. */
  7778. class Response {
  7779. constructor() {
  7780. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7781. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7782. Body.call(this, body, opts);
  7783. const status = opts.status || 200;
  7784. const headers = new Headers(opts.headers);
  7785. if (body != null && !headers.has('Content-Type')) {
  7786. const contentType = extractContentType(body);
  7787. if (contentType) {
  7788. headers.append('Content-Type', contentType);
  7789. }
  7790. }
  7791. this[INTERNALS$1] = {
  7792. url: opts.url,
  7793. status,
  7794. statusText: opts.statusText || STATUS_CODES[status],
  7795. headers,
  7796. counter: opts.counter
  7797. };
  7798. }
  7799. get url() {
  7800. return this[INTERNALS$1].url || '';
  7801. }
  7802. get status() {
  7803. return this[INTERNALS$1].status;
  7804. }
  7805. /**
  7806. * Convenience property representing if the request ended normally
  7807. */
  7808. get ok() {
  7809. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7810. }
  7811. get redirected() {
  7812. return this[INTERNALS$1].counter > 0;
  7813. }
  7814. get statusText() {
  7815. return this[INTERNALS$1].statusText;
  7816. }
  7817. get headers() {
  7818. return this[INTERNALS$1].headers;
  7819. }
  7820. /**
  7821. * Clone this response
  7822. *
  7823. * @return Response
  7824. */
  7825. clone() {
  7826. return new Response(clone(this), {
  7827. url: this.url,
  7828. status: this.status,
  7829. statusText: this.statusText,
  7830. headers: this.headers,
  7831. ok: this.ok,
  7832. redirected: this.redirected
  7833. });
  7834. }
  7835. }
  7836. Body.mixIn(Response.prototype);
  7837. Object.defineProperties(Response.prototype, {
  7838. url: { enumerable: true },
  7839. status: { enumerable: true },
  7840. ok: { enumerable: true },
  7841. redirected: { enumerable: true },
  7842. statusText: { enumerable: true },
  7843. headers: { enumerable: true },
  7844. clone: { enumerable: true }
  7845. });
  7846. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7847. value: 'Response',
  7848. writable: false,
  7849. enumerable: false,
  7850. configurable: true
  7851. });
  7852. const INTERNALS$2 = Symbol('Request internals');
  7853. // fix an issue where "format", "parse" aren't a named export for node <10
  7854. const parse_url = Url.parse;
  7855. const format_url = Url.format;
  7856. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7857. /**
  7858. * Check if a value is an instance of Request.
  7859. *
  7860. * @param Mixed input
  7861. * @return Boolean
  7862. */
  7863. function isRequest(input) {
  7864. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7865. }
  7866. function isAbortSignal(signal) {
  7867. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7868. return !!(proto && proto.constructor.name === 'AbortSignal');
  7869. }
  7870. /**
  7871. * Request class
  7872. *
  7873. * @param Mixed input Url or Request instance
  7874. * @param Object init Custom options
  7875. * @return Void
  7876. */
  7877. class Request {
  7878. constructor(input) {
  7879. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7880. let parsedURL;
  7881. // normalize input
  7882. if (!isRequest(input)) {
  7883. if (input && input.href) {
  7884. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7885. // will fall into this branch also (since their `toString()` will return
  7886. // `href` property anyway)
  7887. parsedURL = parse_url(input.href);
  7888. } else {
  7889. // coerce input to a string before attempting to parse
  7890. parsedURL = parse_url(`${input}`);
  7891. }
  7892. input = {};
  7893. } else {
  7894. parsedURL = parse_url(input.url);
  7895. }
  7896. let method = init.method || input.method || 'GET';
  7897. method = method.toUpperCase();
  7898. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7899. throw new TypeError('Request with GET/HEAD method cannot have body');
  7900. }
  7901. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7902. Body.call(this, inputBody, {
  7903. timeout: init.timeout || input.timeout || 0,
  7904. size: init.size || input.size || 0
  7905. });
  7906. const headers = new Headers(init.headers || input.headers || {});
  7907. if (inputBody != null && !headers.has('Content-Type')) {
  7908. const contentType = extractContentType(inputBody);
  7909. if (contentType) {
  7910. headers.append('Content-Type', contentType);
  7911. }
  7912. }
  7913. let signal = isRequest(input) ? input.signal : null;
  7914. if ('signal' in init) signal = init.signal;
  7915. if (signal != null && !isAbortSignal(signal)) {
  7916. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7917. }
  7918. this[INTERNALS$2] = {
  7919. method,
  7920. redirect: init.redirect || input.redirect || 'follow',
  7921. headers,
  7922. parsedURL,
  7923. signal
  7924. };
  7925. // node-fetch-only options
  7926. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7927. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7928. this.counter = init.counter || input.counter || 0;
  7929. this.agent = init.agent || input.agent;
  7930. }
  7931. get method() {
  7932. return this[INTERNALS$2].method;
  7933. }
  7934. get url() {
  7935. return format_url(this[INTERNALS$2].parsedURL);
  7936. }
  7937. get headers() {
  7938. return this[INTERNALS$2].headers;
  7939. }
  7940. get redirect() {
  7941. return this[INTERNALS$2].redirect;
  7942. }
  7943. get signal() {
  7944. return this[INTERNALS$2].signal;
  7945. }
  7946. /**
  7947. * Clone this request
  7948. *
  7949. * @return Request
  7950. */
  7951. clone() {
  7952. return new Request(this);
  7953. }
  7954. }
  7955. Body.mixIn(Request.prototype);
  7956. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7957. value: 'Request',
  7958. writable: false,
  7959. enumerable: false,
  7960. configurable: true
  7961. });
  7962. Object.defineProperties(Request.prototype, {
  7963. method: { enumerable: true },
  7964. url: { enumerable: true },
  7965. headers: { enumerable: true },
  7966. redirect: { enumerable: true },
  7967. clone: { enumerable: true },
  7968. signal: { enumerable: true }
  7969. });
  7970. /**
  7971. * Convert a Request to Node.js http request options.
  7972. *
  7973. * @param Request A Request instance
  7974. * @return Object The options object to be passed to http.request
  7975. */
  7976. function getNodeRequestOptions(request) {
  7977. const parsedURL = request[INTERNALS$2].parsedURL;
  7978. const headers = new Headers(request[INTERNALS$2].headers);
  7979. // fetch step 1.3
  7980. if (!headers.has('Accept')) {
  7981. headers.set('Accept', '*/*');
  7982. }
  7983. // Basic fetch
  7984. if (!parsedURL.protocol || !parsedURL.hostname) {
  7985. throw new TypeError('Only absolute URLs are supported');
  7986. }
  7987. if (!/^https?:$/.test(parsedURL.protocol)) {
  7988. throw new TypeError('Only HTTP(S) protocols are supported');
  7989. }
  7990. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7991. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7992. }
  7993. // HTTP-network-or-cache fetch steps 2.4-2.7
  7994. let contentLengthValue = null;
  7995. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7996. contentLengthValue = '0';
  7997. }
  7998. if (request.body != null) {
  7999. const totalBytes = getTotalBytes(request);
  8000. if (typeof totalBytes === 'number') {
  8001. contentLengthValue = String(totalBytes);
  8002. }
  8003. }
  8004. if (contentLengthValue) {
  8005. headers.set('Content-Length', contentLengthValue);
  8006. }
  8007. // HTTP-network-or-cache fetch step 2.11
  8008. if (!headers.has('User-Agent')) {
  8009. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  8010. }
  8011. // HTTP-network-or-cache fetch step 2.15
  8012. if (request.compress && !headers.has('Accept-Encoding')) {
  8013. headers.set('Accept-Encoding', 'gzip,deflate');
  8014. }
  8015. let agent = request.agent;
  8016. if (typeof agent === 'function') {
  8017. agent = agent(parsedURL);
  8018. }
  8019. if (!headers.has('Connection') && !agent) {
  8020. headers.set('Connection', 'close');
  8021. }
  8022. // HTTP-network fetch step 4.2
  8023. // chunked encoding is handled by Node.js
  8024. return Object.assign({}, parsedURL, {
  8025. method: request.method,
  8026. headers: exportNodeCompatibleHeaders(headers),
  8027. agent
  8028. });
  8029. }
  8030. /**
  8031. * abort-error.js
  8032. *
  8033. * AbortError interface for cancelled requests
  8034. */
  8035. /**
  8036. * Create AbortError instance
  8037. *
  8038. * @param String message Error message for human
  8039. * @return AbortError
  8040. */
  8041. function AbortError(message) {
  8042. Error.call(this, message);
  8043. this.type = 'aborted';
  8044. this.message = message;
  8045. // hide custom error implementation details from end-users
  8046. Error.captureStackTrace(this, this.constructor);
  8047. }
  8048. AbortError.prototype = Object.create(Error.prototype);
  8049. AbortError.prototype.constructor = AbortError;
  8050. AbortError.prototype.name = 'AbortError';
  8051. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  8052. const PassThrough$1 = Stream.PassThrough;
  8053. const resolve_url = Url.resolve;
  8054. /**
  8055. * Fetch function
  8056. *
  8057. * @param Mixed url Absolute url or Request instance
  8058. * @param Object opts Fetch options
  8059. * @return Promise
  8060. */
  8061. function fetch(url, opts) {
  8062. // allow custom promise
  8063. if (!fetch.Promise) {
  8064. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  8065. }
  8066. Body.Promise = fetch.Promise;
  8067. // wrap http.request into fetch
  8068. return new fetch.Promise(function (resolve, reject) {
  8069. // build request object
  8070. const request = new Request(url, opts);
  8071. const options = getNodeRequestOptions(request);
  8072. const send = (options.protocol === 'https:' ? https : http).request;
  8073. const signal = request.signal;
  8074. let response = null;
  8075. const abort = function abort() {
  8076. let error = new AbortError('The user aborted a request.');
  8077. reject(error);
  8078. if (request.body && request.body instanceof Stream.Readable) {
  8079. request.body.destroy(error);
  8080. }
  8081. if (!response || !response.body) return;
  8082. response.body.emit('error', error);
  8083. };
  8084. if (signal && signal.aborted) {
  8085. abort();
  8086. return;
  8087. }
  8088. const abortAndFinalize = function abortAndFinalize() {
  8089. abort();
  8090. finalize();
  8091. };
  8092. // send request
  8093. const req = send(options);
  8094. let reqTimeout;
  8095. if (signal) {
  8096. signal.addEventListener('abort', abortAndFinalize);
  8097. }
  8098. function finalize() {
  8099. req.abort();
  8100. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8101. clearTimeout(reqTimeout);
  8102. }
  8103. if (request.timeout) {
  8104. req.once('socket', function (socket) {
  8105. reqTimeout = setTimeout(function () {
  8106. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  8107. finalize();
  8108. }, request.timeout);
  8109. });
  8110. }
  8111. req.on('error', function (err) {
  8112. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8113. finalize();
  8114. });
  8115. req.on('response', function (res) {
  8116. clearTimeout(reqTimeout);
  8117. const headers = createHeadersLenient(res.headers);
  8118. // HTTP fetch step 5
  8119. if (fetch.isRedirect(res.statusCode)) {
  8120. // HTTP fetch step 5.2
  8121. const location = headers.get('Location');
  8122. // HTTP fetch step 5.3
  8123. const locationURL = location === null ? null : resolve_url(request.url, location);
  8124. // HTTP fetch step 5.5
  8125. switch (request.redirect) {
  8126. case 'error':
  8127. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8128. finalize();
  8129. return;
  8130. case 'manual':
  8131. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8132. if (locationURL !== null) {
  8133. // handle corrupted header
  8134. try {
  8135. headers.set('Location', locationURL);
  8136. } catch (err) {
  8137. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8138. reject(err);
  8139. }
  8140. }
  8141. break;
  8142. case 'follow':
  8143. // HTTP-redirect fetch step 2
  8144. if (locationURL === null) {
  8145. break;
  8146. }
  8147. // HTTP-redirect fetch step 5
  8148. if (request.counter >= request.follow) {
  8149. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8150. finalize();
  8151. return;
  8152. }
  8153. // HTTP-redirect fetch step 6 (counter increment)
  8154. // Create a new Request object.
  8155. const requestOpts = {
  8156. headers: new Headers(request.headers),
  8157. follow: request.follow,
  8158. counter: request.counter + 1,
  8159. agent: request.agent,
  8160. compress: request.compress,
  8161. method: request.method,
  8162. body: request.body,
  8163. signal: request.signal,
  8164. timeout: request.timeout
  8165. };
  8166. // HTTP-redirect fetch step 9
  8167. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8168. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8169. finalize();
  8170. return;
  8171. }
  8172. // HTTP-redirect fetch step 11
  8173. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8174. requestOpts.method = 'GET';
  8175. requestOpts.body = undefined;
  8176. requestOpts.headers.delete('content-length');
  8177. }
  8178. // HTTP-redirect fetch step 15
  8179. resolve(fetch(new Request(locationURL, requestOpts)));
  8180. finalize();
  8181. return;
  8182. }
  8183. }
  8184. // prepare response
  8185. res.once('end', function () {
  8186. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8187. });
  8188. let body = res.pipe(new PassThrough$1());
  8189. const response_options = {
  8190. url: request.url,
  8191. status: res.statusCode,
  8192. statusText: res.statusMessage,
  8193. headers: headers,
  8194. size: request.size,
  8195. timeout: request.timeout,
  8196. counter: request.counter
  8197. };
  8198. // HTTP-network fetch step 12.1.1.3
  8199. const codings = headers.get('Content-Encoding');
  8200. // HTTP-network fetch step 12.1.1.4: handle content codings
  8201. // in following scenarios we ignore compression support
  8202. // 1. compression support is disabled
  8203. // 2. HEAD request
  8204. // 3. no Content-Encoding header
  8205. // 4. no content response (204)
  8206. // 5. content not modified response (304)
  8207. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8208. response = new Response(body, response_options);
  8209. resolve(response);
  8210. return;
  8211. }
  8212. // For Node v6+
  8213. // Be less strict when decoding compressed responses, since sometimes
  8214. // servers send slightly invalid responses that are still accepted
  8215. // by common browsers.
  8216. // Always using Z_SYNC_FLUSH is what cURL does.
  8217. const zlibOptions = {
  8218. flush: zlib.Z_SYNC_FLUSH,
  8219. finishFlush: zlib.Z_SYNC_FLUSH
  8220. };
  8221. // for gzip
  8222. if (codings == 'gzip' || codings == 'x-gzip') {
  8223. body = body.pipe(zlib.createGunzip(zlibOptions));
  8224. response = new Response(body, response_options);
  8225. resolve(response);
  8226. return;
  8227. }
  8228. // for deflate
  8229. if (codings == 'deflate' || codings == 'x-deflate') {
  8230. // handle the infamous raw deflate response from old servers
  8231. // a hack for old IIS and Apache servers
  8232. const raw = res.pipe(new PassThrough$1());
  8233. raw.once('data', function (chunk) {
  8234. // see http://stackoverflow.com/questions/37519828
  8235. if ((chunk[0] & 0x0F) === 0x08) {
  8236. body = body.pipe(zlib.createInflate());
  8237. } else {
  8238. body = body.pipe(zlib.createInflateRaw());
  8239. }
  8240. response = new Response(body, response_options);
  8241. resolve(response);
  8242. });
  8243. return;
  8244. }
  8245. // for br
  8246. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8247. body = body.pipe(zlib.createBrotliDecompress());
  8248. response = new Response(body, response_options);
  8249. resolve(response);
  8250. return;
  8251. }
  8252. // otherwise, use response as-is
  8253. response = new Response(body, response_options);
  8254. resolve(response);
  8255. });
  8256. writeToStream(req, request);
  8257. });
  8258. }
  8259. /**
  8260. * Redirect code matching
  8261. *
  8262. * @param Number code Status code
  8263. * @return Boolean
  8264. */
  8265. fetch.isRedirect = function (code) {
  8266. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8267. };
  8268. // expose Promise
  8269. fetch.Promise = global.Promise;
  8270. module.exports = exports = fetch;
  8271. Object.defineProperty(exports, "__esModule", { value: true });
  8272. exports.default = exports;
  8273. exports.Headers = Headers;
  8274. exports.Request = Request;
  8275. exports.Response = Response;
  8276. exports.FetchError = FetchError;
  8277. /***/ }),
  8278. /***/ 462:
  8279. /***/ (function(module) {
  8280. "use strict";
  8281. // See http://www.robvanderwoude.com/escapechars.php
  8282. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8283. function escapeCommand(arg) {
  8284. // Escape meta chars
  8285. arg = arg.replace(metaCharsRegExp, '^$1');
  8286. return arg;
  8287. }
  8288. function escapeArgument(arg, doubleEscapeMetaChars) {
  8289. // Convert to string
  8290. arg = `${arg}`;
  8291. // Algorithm below is based on https://qntm.org/cmd
  8292. // Sequence of backslashes followed by a double quote:
  8293. // double up all the backslashes and escape the double quote
  8294. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8295. // Sequence of backslashes followed by the end of the string
  8296. // (which will become a double quote later):
  8297. // double up all the backslashes
  8298. arg = arg.replace(/(\\*)$/, '$1$1');
  8299. // All other backslashes occur literally
  8300. // Quote the whole thing:
  8301. arg = `"${arg}"`;
  8302. // Escape meta chars
  8303. arg = arg.replace(metaCharsRegExp, '^$1');
  8304. // Double escape meta chars if necessary
  8305. if (doubleEscapeMetaChars) {
  8306. arg = arg.replace(metaCharsRegExp, '^$1');
  8307. }
  8308. return arg;
  8309. }
  8310. module.exports.command = escapeCommand;
  8311. module.exports.argument = escapeArgument;
  8312. /***/ }),
  8313. /***/ 463:
  8314. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8315. "use strict";
  8316. Object.defineProperty(exports, '__esModule', { value: true });
  8317. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8318. var deprecation = __webpack_require__(692);
  8319. var once = _interopDefault(__webpack_require__(969));
  8320. const logOnce = once(deprecation => console.warn(deprecation));
  8321. /**
  8322. * Error with extra properties to help with debugging
  8323. */
  8324. class RequestError extends Error {
  8325. constructor(message, statusCode, options) {
  8326. super(message); // Maintains proper stack trace (only available on V8)
  8327. /* istanbul ignore next */
  8328. if (Error.captureStackTrace) {
  8329. Error.captureStackTrace(this, this.constructor);
  8330. }
  8331. this.name = "HttpError";
  8332. this.status = statusCode;
  8333. Object.defineProperty(this, "code", {
  8334. get() {
  8335. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8336. return statusCode;
  8337. }
  8338. });
  8339. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8340. const requestCopy = Object.assign({}, options.request);
  8341. if (options.request.headers.authorization) {
  8342. requestCopy.headers = Object.assign({}, options.request.headers, {
  8343. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8344. });
  8345. }
  8346. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8347. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8348. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8349. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8350. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8351. this.request = requestCopy;
  8352. }
  8353. }
  8354. exports.RequestError = RequestError;
  8355. //# sourceMappingURL=index.js.map
  8356. /***/ }),
  8357. /***/ 464:
  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. var __importStar = (this && this.__importStar) || function (mod) {
  8370. if (mod && mod.__esModule) return mod;
  8371. var result = {};
  8372. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8373. result["default"] = mod;
  8374. return result;
  8375. };
  8376. var __importDefault = (this && this.__importDefault) || function (mod) {
  8377. return (mod && mod.__esModule) ? mod : { "default": mod };
  8378. };
  8379. Object.defineProperty(exports, "__esModule", { value: true });
  8380. const assert = __importStar(__webpack_require__(357));
  8381. const core = __importStar(__webpack_require__(470));
  8382. const fs = __importStar(__webpack_require__(747));
  8383. const github = __importStar(__webpack_require__(469));
  8384. const io = __importStar(__webpack_require__(1));
  8385. const path = __importStar(__webpack_require__(622));
  8386. const retryHelper = __importStar(__webpack_require__(587));
  8387. const toolCache = __importStar(__webpack_require__(533));
  8388. const v4_1 = __importDefault(__webpack_require__(826));
  8389. const IS_WINDOWS = process.platform === 'win32';
  8390. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8391. return __awaiter(this, void 0, void 0, function* () {
  8392. // Determine the default branch
  8393. if (!ref && !commit) {
  8394. core.info('Determining the default branch');
  8395. ref = yield getDefaultBranch(authToken, owner, repo);
  8396. }
  8397. // Download the archive
  8398. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8399. core.info('Downloading the archive');
  8400. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8401. }));
  8402. // Write archive to disk
  8403. core.info('Writing archive to disk');
  8404. const uniqueId = v4_1.default();
  8405. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8406. yield fs.promises.writeFile(archivePath, archiveData);
  8407. archiveData = Buffer.from(''); // Free memory
  8408. // Extract archive
  8409. core.info('Extracting the archive');
  8410. const extractPath = path.join(repositoryPath, uniqueId);
  8411. yield io.mkdirP(extractPath);
  8412. if (IS_WINDOWS) {
  8413. yield toolCache.extractZip(archivePath, extractPath);
  8414. }
  8415. else {
  8416. yield toolCache.extractTar(archivePath, extractPath);
  8417. }
  8418. yield io.rmRF(archivePath);
  8419. // Determine the path of the repository content. The archive contains
  8420. // a top-level folder and the repository content is inside.
  8421. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8422. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8423. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8424. core.info(`Resolved version ${archiveVersion}`);
  8425. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8426. // Move the files
  8427. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8428. const sourcePath = path.join(tempRepositoryPath, fileName);
  8429. const targetPath = path.join(repositoryPath, fileName);
  8430. if (IS_WINDOWS) {
  8431. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8432. }
  8433. else {
  8434. yield io.mv(sourcePath, targetPath);
  8435. }
  8436. }
  8437. yield io.rmRF(extractPath);
  8438. });
  8439. }
  8440. exports.downloadRepository = downloadRepository;
  8441. /**
  8442. * Looks up the default branch name
  8443. */
  8444. function getDefaultBranch(authToken, owner, repo) {
  8445. return __awaiter(this, void 0, void 0, function* () {
  8446. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8447. core.info('Retrieving the default branch name');
  8448. const octokit = new github.GitHub(authToken);
  8449. let result;
  8450. try {
  8451. // Get the default branch from the repo info
  8452. const response = yield octokit.repos.get({ owner, repo });
  8453. result = response.data.default_branch;
  8454. assert.ok(result, 'default_branch cannot be empty');
  8455. }
  8456. catch (err) {
  8457. // Handle .wiki repo
  8458. if (err['status'] === 404 && repo.toUpperCase().endsWith('.WIKI')) {
  8459. result = 'master';
  8460. }
  8461. // Otherwise error
  8462. else {
  8463. throw err;
  8464. }
  8465. }
  8466. // Print the default branch
  8467. core.info(`Default branch '${result}'`);
  8468. // Prefix with 'refs/heads'
  8469. if (!result.startsWith('refs/')) {
  8470. result = `refs/heads/${result}`;
  8471. }
  8472. return result;
  8473. }));
  8474. });
  8475. }
  8476. exports.getDefaultBranch = getDefaultBranch;
  8477. function downloadArchive(authToken, owner, repo, ref, commit) {
  8478. return __awaiter(this, void 0, void 0, function* () {
  8479. const octokit = new github.GitHub(authToken);
  8480. const params = {
  8481. owner: owner,
  8482. repo: repo,
  8483. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8484. ref: commit || ref
  8485. };
  8486. const response = yield octokit.repos.getArchiveLink(params);
  8487. if (response.status != 200) {
  8488. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8489. }
  8490. return Buffer.from(response.data); // response.data is ArrayBuffer
  8491. });
  8492. }
  8493. /***/ }),
  8494. /***/ 469:
  8495. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8496. "use strict";
  8497. var __importStar = (this && this.__importStar) || function (mod) {
  8498. if (mod && mod.__esModule) return mod;
  8499. var result = {};
  8500. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8501. result["default"] = mod;
  8502. return result;
  8503. };
  8504. Object.defineProperty(exports, "__esModule", { value: true });
  8505. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8506. const graphql_1 = __webpack_require__(898);
  8507. const rest_1 = __webpack_require__(0);
  8508. const Context = __importStar(__webpack_require__(262));
  8509. const httpClient = __importStar(__webpack_require__(539));
  8510. // We need this in order to extend Octokit
  8511. rest_1.Octokit.prototype = new rest_1.Octokit();
  8512. exports.context = new Context.Context();
  8513. class GitHub extends rest_1.Octokit {
  8514. constructor(token, opts) {
  8515. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8516. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8517. }
  8518. /**
  8519. * Disambiguates the constructor overload parameters
  8520. */
  8521. static disambiguate(token, opts) {
  8522. return [
  8523. typeof token === 'string' ? token : '',
  8524. typeof token === 'object' ? token : opts || {}
  8525. ];
  8526. }
  8527. static getOctokitOptions(args) {
  8528. const token = args[0];
  8529. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8530. // Base URL - GHES or Dotcom
  8531. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8532. // Auth
  8533. const auth = GitHub.getAuthString(token, options);
  8534. if (auth) {
  8535. options.auth = auth;
  8536. }
  8537. // Proxy
  8538. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8539. if (agent) {
  8540. // Shallow clone - don't mutate the object provided by the caller
  8541. options.request = options.request ? Object.assign({}, options.request) : {};
  8542. // Set the agent
  8543. options.request.agent = agent;
  8544. }
  8545. return options;
  8546. }
  8547. static getGraphQL(args) {
  8548. const defaults = {};
  8549. defaults.baseUrl = this.getGraphQLBaseUrl();
  8550. const token = args[0];
  8551. const options = args[1];
  8552. // Authorization
  8553. const auth = this.getAuthString(token, options);
  8554. if (auth) {
  8555. defaults.headers = {
  8556. authorization: auth
  8557. };
  8558. }
  8559. // Proxy
  8560. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8561. if (agent) {
  8562. defaults.request = { agent };
  8563. }
  8564. return graphql_1.graphql.defaults(defaults);
  8565. }
  8566. static getAuthString(token, options) {
  8567. // Validate args
  8568. if (!token && !options.auth) {
  8569. throw new Error('Parameter token or opts.auth is required');
  8570. }
  8571. else if (token && options.auth) {
  8572. throw new Error('Parameters token and opts.auth may not both be specified');
  8573. }
  8574. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8575. }
  8576. static getProxyAgent(destinationUrl, options) {
  8577. var _a;
  8578. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8579. if (httpClient.getProxyUrl(destinationUrl)) {
  8580. const hc = new httpClient.HttpClient();
  8581. return hc.getAgent(destinationUrl);
  8582. }
  8583. }
  8584. return undefined;
  8585. }
  8586. static getApiBaseUrl() {
  8587. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8588. }
  8589. static getGraphQLBaseUrl() {
  8590. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8591. // Shouldn't be a trailing slash, but remove if so
  8592. if (url.endsWith('/')) {
  8593. url = url.substr(0, url.length - 1);
  8594. }
  8595. // Remove trailing "/graphql"
  8596. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8597. url = url.substr(0, url.length - '/graphql'.length);
  8598. }
  8599. return url;
  8600. }
  8601. }
  8602. exports.GitHub = GitHub;
  8603. //# sourceMappingURL=github.js.map
  8604. /***/ }),
  8605. /***/ 470:
  8606. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8607. "use strict";
  8608. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8609. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8610. return new (P || (P = Promise))(function (resolve, reject) {
  8611. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8612. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8613. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8614. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8615. });
  8616. };
  8617. var __importStar = (this && this.__importStar) || function (mod) {
  8618. if (mod && mod.__esModule) return mod;
  8619. var result = {};
  8620. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8621. result["default"] = mod;
  8622. return result;
  8623. };
  8624. Object.defineProperty(exports, "__esModule", { value: true });
  8625. const command_1 = __webpack_require__(431);
  8626. const file_command_1 = __webpack_require__(102);
  8627. const utils_1 = __webpack_require__(82);
  8628. const os = __importStar(__webpack_require__(87));
  8629. const path = __importStar(__webpack_require__(622));
  8630. /**
  8631. * The code to exit an action
  8632. */
  8633. var ExitCode;
  8634. (function (ExitCode) {
  8635. /**
  8636. * A code indicating that the action was successful
  8637. */
  8638. ExitCode[ExitCode["Success"] = 0] = "Success";
  8639. /**
  8640. * A code indicating that the action was a failure
  8641. */
  8642. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8643. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8644. //-----------------------------------------------------------------------
  8645. // Variables
  8646. //-----------------------------------------------------------------------
  8647. /**
  8648. * Sets env variable for this action and future actions in the job
  8649. * @param name the name of the variable to set
  8650. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  8651. */
  8652. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  8653. function exportVariable(name, val) {
  8654. const convertedVal = utils_1.toCommandValue(val);
  8655. process.env[name] = convertedVal;
  8656. const filePath = process.env['GITHUB_ENV'] || '';
  8657. if (filePath) {
  8658. const delimiter = '_GitHubActionsFileCommandDelimeter_';
  8659. const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
  8660. file_command_1.issueCommand('ENV', commandValue);
  8661. }
  8662. else {
  8663. command_1.issueCommand('set-env', { name }, convertedVal);
  8664. }
  8665. }
  8666. exports.exportVariable = exportVariable;
  8667. /**
  8668. * Registers a secret which will get masked from logs
  8669. * @param secret value of the secret
  8670. */
  8671. function setSecret(secret) {
  8672. command_1.issueCommand('add-mask', {}, secret);
  8673. }
  8674. exports.setSecret = setSecret;
  8675. /**
  8676. * Prepends inputPath to the PATH (for this action and future actions)
  8677. * @param inputPath
  8678. */
  8679. function addPath(inputPath) {
  8680. const filePath = process.env['GITHUB_PATH'] || '';
  8681. if (filePath) {
  8682. file_command_1.issueCommand('PATH', inputPath);
  8683. }
  8684. else {
  8685. command_1.issueCommand('add-path', {}, inputPath);
  8686. }
  8687. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8688. }
  8689. exports.addPath = addPath;
  8690. /**
  8691. * Gets the value of an input. The value is also trimmed.
  8692. *
  8693. * @param name name of the input to get
  8694. * @param options optional. See InputOptions.
  8695. * @returns string
  8696. */
  8697. function getInput(name, options) {
  8698. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8699. if (options && options.required && !val) {
  8700. throw new Error(`Input required and not supplied: ${name}`);
  8701. }
  8702. return val.trim();
  8703. }
  8704. exports.getInput = getInput;
  8705. /**
  8706. * Sets the value of an output.
  8707. *
  8708. * @param name name of the output to set
  8709. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  8710. */
  8711. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  8712. function setOutput(name, value) {
  8713. command_1.issueCommand('set-output', { name }, value);
  8714. }
  8715. exports.setOutput = setOutput;
  8716. /**
  8717. * Enables or disables the echoing of commands into stdout for the rest of the step.
  8718. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  8719. *
  8720. */
  8721. function setCommandEcho(enabled) {
  8722. command_1.issue('echo', enabled ? 'on' : 'off');
  8723. }
  8724. exports.setCommandEcho = setCommandEcho;
  8725. //-----------------------------------------------------------------------
  8726. // Results
  8727. //-----------------------------------------------------------------------
  8728. /**
  8729. * Sets the action status to failed.
  8730. * When the action exits it will be with an exit code of 1
  8731. * @param message add error issue message
  8732. */
  8733. function setFailed(message) {
  8734. process.exitCode = ExitCode.Failure;
  8735. error(message);
  8736. }
  8737. exports.setFailed = setFailed;
  8738. //-----------------------------------------------------------------------
  8739. // Logging Commands
  8740. //-----------------------------------------------------------------------
  8741. /**
  8742. * Gets whether Actions Step Debug is on or not
  8743. */
  8744. function isDebug() {
  8745. return process.env['RUNNER_DEBUG'] === '1';
  8746. }
  8747. exports.isDebug = isDebug;
  8748. /**
  8749. * Writes debug message to user log
  8750. * @param message debug message
  8751. */
  8752. function debug(message) {
  8753. command_1.issueCommand('debug', {}, message);
  8754. }
  8755. exports.debug = debug;
  8756. /**
  8757. * Adds an error issue
  8758. * @param message error issue message. Errors will be converted to string via toString()
  8759. */
  8760. function error(message) {
  8761. command_1.issue('error', message instanceof Error ? message.toString() : message);
  8762. }
  8763. exports.error = error;
  8764. /**
  8765. * Adds an warning issue
  8766. * @param message warning issue message. Errors will be converted to string via toString()
  8767. */
  8768. function warning(message) {
  8769. command_1.issue('warning', message instanceof Error ? message.toString() : message);
  8770. }
  8771. exports.warning = warning;
  8772. /**
  8773. * Writes info to log with console.log.
  8774. * @param message info message
  8775. */
  8776. function info(message) {
  8777. process.stdout.write(message + os.EOL);
  8778. }
  8779. exports.info = info;
  8780. /**
  8781. * Begin an output group.
  8782. *
  8783. * Output until the next `groupEnd` will be foldable in this group
  8784. *
  8785. * @param name The name of the output group
  8786. */
  8787. function startGroup(name) {
  8788. command_1.issue('group', name);
  8789. }
  8790. exports.startGroup = startGroup;
  8791. /**
  8792. * End an output group.
  8793. */
  8794. function endGroup() {
  8795. command_1.issue('endgroup');
  8796. }
  8797. exports.endGroup = endGroup;
  8798. /**
  8799. * Wrap an asynchronous function call in a group.
  8800. *
  8801. * Returns the same type as the function itself.
  8802. *
  8803. * @param name The name of the group
  8804. * @param fn The function to wrap in the group
  8805. */
  8806. function group(name, fn) {
  8807. return __awaiter(this, void 0, void 0, function* () {
  8808. startGroup(name);
  8809. let result;
  8810. try {
  8811. result = yield fn();
  8812. }
  8813. finally {
  8814. endGroup();
  8815. }
  8816. return result;
  8817. });
  8818. }
  8819. exports.group = group;
  8820. //-----------------------------------------------------------------------
  8821. // Wrapper action state
  8822. //-----------------------------------------------------------------------
  8823. /**
  8824. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  8825. *
  8826. * @param name name of the state to store
  8827. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  8828. */
  8829. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  8830. function saveState(name, value) {
  8831. command_1.issueCommand('save-state', { name }, value);
  8832. }
  8833. exports.saveState = saveState;
  8834. /**
  8835. * Gets the value of an state set by this action's main execution.
  8836. *
  8837. * @param name name of the state to get
  8838. * @returns string
  8839. */
  8840. function getState(name) {
  8841. return process.env[`STATE_${name}`] || '';
  8842. }
  8843. exports.getState = getState;
  8844. //# sourceMappingURL=core.js.map
  8845. /***/ }),
  8846. /***/ 471:
  8847. /***/ (function(module, __unusedexports, __webpack_require__) {
  8848. module.exports = authenticationBeforeRequest;
  8849. const btoa = __webpack_require__(675);
  8850. const uniq = __webpack_require__(126);
  8851. function authenticationBeforeRequest(state, options) {
  8852. if (!state.auth.type) {
  8853. return;
  8854. }
  8855. if (state.auth.type === "basic") {
  8856. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8857. options.headers.authorization = `Basic ${hash}`;
  8858. return;
  8859. }
  8860. if (state.auth.type === "token") {
  8861. options.headers.authorization = `token ${state.auth.token}`;
  8862. return;
  8863. }
  8864. if (state.auth.type === "app") {
  8865. options.headers.authorization = `Bearer ${state.auth.token}`;
  8866. const acceptHeaders = options.headers.accept
  8867. .split(",")
  8868. .concat("application/vnd.github.machine-man-preview+json");
  8869. options.headers.accept = uniq(acceptHeaders)
  8870. .filter(Boolean)
  8871. .join(",");
  8872. return;
  8873. }
  8874. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8875. if (state.auth.token) {
  8876. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8877. return;
  8878. }
  8879. const key = encodeURIComponent(state.auth.key);
  8880. const secret = encodeURIComponent(state.auth.secret);
  8881. options.url += `client_id=${key}&client_secret=${secret}`;
  8882. }
  8883. /***/ }),
  8884. /***/ 489:
  8885. /***/ (function(module, __unusedexports, __webpack_require__) {
  8886. "use strict";
  8887. const path = __webpack_require__(622);
  8888. const which = __webpack_require__(814);
  8889. const pathKey = __webpack_require__(39)();
  8890. function resolveCommandAttempt(parsed, withoutPathExt) {
  8891. const cwd = process.cwd();
  8892. const hasCustomCwd = parsed.options.cwd != null;
  8893. // If a custom `cwd` was specified, we need to change the process cwd
  8894. // because `which` will do stat calls but does not support a custom cwd
  8895. if (hasCustomCwd) {
  8896. try {
  8897. process.chdir(parsed.options.cwd);
  8898. } catch (err) {
  8899. /* Empty */
  8900. }
  8901. }
  8902. let resolved;
  8903. try {
  8904. resolved = which.sync(parsed.command, {
  8905. path: (parsed.options.env || process.env)[pathKey],
  8906. pathExt: withoutPathExt ? path.delimiter : undefined,
  8907. });
  8908. } catch (e) {
  8909. /* Empty */
  8910. } finally {
  8911. process.chdir(cwd);
  8912. }
  8913. // If we successfully resolved, ensure that an absolute path is returned
  8914. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8915. if (resolved) {
  8916. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8917. }
  8918. return resolved;
  8919. }
  8920. function resolveCommand(parsed) {
  8921. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8922. }
  8923. module.exports = resolveCommand;
  8924. /***/ }),
  8925. /***/ 497:
  8926. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8927. "use strict";
  8928. Object.defineProperty(exports, '__esModule', { value: true });
  8929. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8930. var deprecation = __webpack_require__(692);
  8931. var once = _interopDefault(__webpack_require__(969));
  8932. const logOnce = once(deprecation => console.warn(deprecation));
  8933. /**
  8934. * Error with extra properties to help with debugging
  8935. */
  8936. class RequestError extends Error {
  8937. constructor(message, statusCode, options) {
  8938. super(message); // Maintains proper stack trace (only available on V8)
  8939. /* istanbul ignore next */
  8940. if (Error.captureStackTrace) {
  8941. Error.captureStackTrace(this, this.constructor);
  8942. }
  8943. this.name = "HttpError";
  8944. this.status = statusCode;
  8945. Object.defineProperty(this, "code", {
  8946. get() {
  8947. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8948. return statusCode;
  8949. }
  8950. });
  8951. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8952. const requestCopy = Object.assign({}, options.request);
  8953. if (options.request.headers.authorization) {
  8954. requestCopy.headers = Object.assign({}, options.request.headers, {
  8955. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8956. });
  8957. }
  8958. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8959. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8960. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8961. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8962. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8963. this.request = requestCopy;
  8964. }
  8965. }
  8966. exports.RequestError = RequestError;
  8967. //# sourceMappingURL=index.js.map
  8968. /***/ }),
  8969. /***/ 510:
  8970. /***/ (function(module) {
  8971. module.exports = addHook
  8972. function addHook (state, kind, name, hook) {
  8973. var orig = hook
  8974. if (!state.registry[name]) {
  8975. state.registry[name] = []
  8976. }
  8977. if (kind === 'before') {
  8978. hook = function (method, options) {
  8979. return Promise.resolve()
  8980. .then(orig.bind(null, options))
  8981. .then(method.bind(null, options))
  8982. }
  8983. }
  8984. if (kind === 'after') {
  8985. hook = function (method, options) {
  8986. var result
  8987. return Promise.resolve()
  8988. .then(method.bind(null, options))
  8989. .then(function (result_) {
  8990. result = result_
  8991. return orig(result, options)
  8992. })
  8993. .then(function () {
  8994. return result
  8995. })
  8996. }
  8997. }
  8998. if (kind === 'error') {
  8999. hook = function (method, options) {
  9000. return Promise.resolve()
  9001. .then(method.bind(null, options))
  9002. .catch(function (error) {
  9003. return orig(error, options)
  9004. })
  9005. }
  9006. }
  9007. state.registry[name].push({
  9008. hook: hook,
  9009. orig: orig
  9010. })
  9011. }
  9012. /***/ }),
  9013. /***/ 523:
  9014. /***/ (function(module, __unusedexports, __webpack_require__) {
  9015. var register = __webpack_require__(363)
  9016. var addHook = __webpack_require__(510)
  9017. var removeHook = __webpack_require__(763)
  9018. // bind with array of arguments: https://stackoverflow.com/a/21792913
  9019. var bind = Function.bind
  9020. var bindable = bind.bind(bind)
  9021. function bindApi (hook, state, name) {
  9022. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  9023. hook.api = { remove: removeHookRef }
  9024. hook.remove = removeHookRef
  9025. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  9026. var args = name ? [state, kind, name] : [state, kind]
  9027. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  9028. })
  9029. }
  9030. function HookSingular () {
  9031. var singularHookName = 'h'
  9032. var singularHookState = {
  9033. registry: {}
  9034. }
  9035. var singularHook = register.bind(null, singularHookState, singularHookName)
  9036. bindApi(singularHook, singularHookState, singularHookName)
  9037. return singularHook
  9038. }
  9039. function HookCollection () {
  9040. var state = {
  9041. registry: {}
  9042. }
  9043. var hook = register.bind(null, state)
  9044. bindApi(hook, state)
  9045. return hook
  9046. }
  9047. var collectionHookDeprecationMessageDisplayed = false
  9048. function Hook () {
  9049. if (!collectionHookDeprecationMessageDisplayed) {
  9050. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  9051. collectionHookDeprecationMessageDisplayed = true
  9052. }
  9053. return HookCollection()
  9054. }
  9055. Hook.Singular = HookSingular.bind()
  9056. Hook.Collection = HookCollection.bind()
  9057. module.exports = Hook
  9058. // expose constructors as a named property for TypeScript
  9059. module.exports.Hook = Hook
  9060. module.exports.Singular = Hook.Singular
  9061. module.exports.Collection = Hook.Collection
  9062. /***/ }),
  9063. /***/ 528:
  9064. /***/ (function(__unusedmodule, exports) {
  9065. "use strict";
  9066. Object.defineProperty(exports, "__esModule", { value: true });
  9067. function escape(value) {
  9068. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  9069. return `\\${x}`;
  9070. });
  9071. }
  9072. exports.escape = escape;
  9073. /***/ }),
  9074. /***/ 529:
  9075. /***/ (function(module, __unusedexports, __webpack_require__) {
  9076. const factory = __webpack_require__(47);
  9077. module.exports = factory();
  9078. /***/ }),
  9079. /***/ 533:
  9080. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9081. "use strict";
  9082. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9083. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9084. return new (P || (P = Promise))(function (resolve, reject) {
  9085. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9086. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9087. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9088. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9089. });
  9090. };
  9091. Object.defineProperty(exports, "__esModule", { value: true });
  9092. const core = __webpack_require__(470);
  9093. const io = __webpack_require__(1);
  9094. const fs = __webpack_require__(747);
  9095. const os = __webpack_require__(87);
  9096. const path = __webpack_require__(622);
  9097. const httpm = __webpack_require__(874);
  9098. const semver = __webpack_require__(656);
  9099. const uuidV4 = __webpack_require__(826);
  9100. const exec_1 = __webpack_require__(986);
  9101. const assert_1 = __webpack_require__(357);
  9102. class HTTPError extends Error {
  9103. constructor(httpStatusCode) {
  9104. super(`Unexpected HTTP response: ${httpStatusCode}`);
  9105. this.httpStatusCode = httpStatusCode;
  9106. Object.setPrototypeOf(this, new.target.prototype);
  9107. }
  9108. }
  9109. exports.HTTPError = HTTPError;
  9110. const IS_WINDOWS = process.platform === 'win32';
  9111. const userAgent = 'actions/tool-cache';
  9112. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  9113. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  9114. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  9115. // If directories not found, place them in common temp locations
  9116. if (!tempDirectory || !cacheRoot) {
  9117. let baseLocation;
  9118. if (IS_WINDOWS) {
  9119. // On windows use the USERPROFILE env variable
  9120. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  9121. }
  9122. else {
  9123. if (process.platform === 'darwin') {
  9124. baseLocation = '/Users';
  9125. }
  9126. else {
  9127. baseLocation = '/home';
  9128. }
  9129. }
  9130. if (!tempDirectory) {
  9131. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  9132. }
  9133. if (!cacheRoot) {
  9134. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  9135. }
  9136. }
  9137. /**
  9138. * Download a tool from an url and stream it into a file
  9139. *
  9140. * @param url url of tool to download
  9141. * @returns path to downloaded tool
  9142. */
  9143. function downloadTool(url) {
  9144. return __awaiter(this, void 0, void 0, function* () {
  9145. // Wrap in a promise so that we can resolve from within stream callbacks
  9146. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  9147. try {
  9148. const http = new httpm.HttpClient(userAgent, [], {
  9149. allowRetries: true,
  9150. maxRetries: 3
  9151. });
  9152. const destPath = path.join(tempDirectory, uuidV4());
  9153. yield io.mkdirP(tempDirectory);
  9154. core.debug(`Downloading ${url}`);
  9155. core.debug(`Downloading ${destPath}`);
  9156. if (fs.existsSync(destPath)) {
  9157. throw new Error(`Destination file path ${destPath} already exists`);
  9158. }
  9159. const response = yield http.get(url);
  9160. if (response.message.statusCode !== 200) {
  9161. const err = new HTTPError(response.message.statusCode);
  9162. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9163. throw err;
  9164. }
  9165. const file = fs.createWriteStream(destPath);
  9166. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  9167. try {
  9168. const stream = response.message.pipe(file);
  9169. stream.on('close', () => {
  9170. core.debug('download complete');
  9171. resolve(destPath);
  9172. });
  9173. }
  9174. catch (err) {
  9175. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9176. reject(err);
  9177. }
  9178. }));
  9179. file.on('error', err => {
  9180. file.end();
  9181. reject(err);
  9182. });
  9183. }
  9184. catch (err) {
  9185. reject(err);
  9186. }
  9187. }));
  9188. });
  9189. }
  9190. exports.downloadTool = downloadTool;
  9191. /**
  9192. * Extract a .7z file
  9193. *
  9194. * @param file path to the .7z file
  9195. * @param dest destination directory. Optional.
  9196. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  9197. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  9198. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  9199. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  9200. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  9201. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  9202. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  9203. * to 7zr.exe can be pass to this function.
  9204. * @returns path to the destination directory
  9205. */
  9206. function extract7z(file, dest, _7zPath) {
  9207. return __awaiter(this, void 0, void 0, function* () {
  9208. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  9209. assert_1.ok(file, 'parameter "file" is required');
  9210. dest = dest || (yield _createExtractFolder(dest));
  9211. const originalCwd = process.cwd();
  9212. process.chdir(dest);
  9213. if (_7zPath) {
  9214. try {
  9215. const args = [
  9216. 'x',
  9217. '-bb1',
  9218. '-bd',
  9219. '-sccUTF-8',
  9220. file
  9221. ];
  9222. const options = {
  9223. silent: true
  9224. };
  9225. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9226. }
  9227. finally {
  9228. process.chdir(originalCwd);
  9229. }
  9230. }
  9231. else {
  9232. const escapedScript = path
  9233. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9234. .replace(/'/g, "''")
  9235. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9236. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9237. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9238. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9239. const args = [
  9240. '-NoLogo',
  9241. '-Sta',
  9242. '-NoProfile',
  9243. '-NonInteractive',
  9244. '-ExecutionPolicy',
  9245. 'Unrestricted',
  9246. '-Command',
  9247. command
  9248. ];
  9249. const options = {
  9250. silent: true
  9251. };
  9252. try {
  9253. const powershellPath = yield io.which('powershell', true);
  9254. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9255. }
  9256. finally {
  9257. process.chdir(originalCwd);
  9258. }
  9259. }
  9260. return dest;
  9261. });
  9262. }
  9263. exports.extract7z = extract7z;
  9264. /**
  9265. * Extract a tar
  9266. *
  9267. * @param file path to the tar
  9268. * @param dest destination directory. Optional.
  9269. * @param flags flags for the tar. Optional.
  9270. * @returns path to the destination directory
  9271. */
  9272. function extractTar(file, dest, flags = 'xz') {
  9273. return __awaiter(this, void 0, void 0, function* () {
  9274. if (!file) {
  9275. throw new Error("parameter 'file' is required");
  9276. }
  9277. dest = dest || (yield _createExtractFolder(dest));
  9278. const tarPath = yield io.which('tar', true);
  9279. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9280. return dest;
  9281. });
  9282. }
  9283. exports.extractTar = extractTar;
  9284. /**
  9285. * Extract a zip
  9286. *
  9287. * @param file path to the zip
  9288. * @param dest destination directory. Optional.
  9289. * @returns path to the destination directory
  9290. */
  9291. function extractZip(file, dest) {
  9292. return __awaiter(this, void 0, void 0, function* () {
  9293. if (!file) {
  9294. throw new Error("parameter 'file' is required");
  9295. }
  9296. dest = dest || (yield _createExtractFolder(dest));
  9297. if (IS_WINDOWS) {
  9298. yield extractZipWin(file, dest);
  9299. }
  9300. else {
  9301. yield extractZipNix(file, dest);
  9302. }
  9303. return dest;
  9304. });
  9305. }
  9306. exports.extractZip = extractZip;
  9307. function extractZipWin(file, dest) {
  9308. return __awaiter(this, void 0, void 0, function* () {
  9309. // build the powershell command
  9310. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9311. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9312. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9313. // run powershell
  9314. const powershellPath = yield io.which('powershell');
  9315. const args = [
  9316. '-NoLogo',
  9317. '-Sta',
  9318. '-NoProfile',
  9319. '-NonInteractive',
  9320. '-ExecutionPolicy',
  9321. 'Unrestricted',
  9322. '-Command',
  9323. command
  9324. ];
  9325. yield exec_1.exec(`"${powershellPath}"`, args);
  9326. });
  9327. }
  9328. function extractZipNix(file, dest) {
  9329. return __awaiter(this, void 0, void 0, function* () {
  9330. const unzipPath = yield io.which('unzip');
  9331. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9332. });
  9333. }
  9334. /**
  9335. * Caches a directory and installs it into the tool cacheDir
  9336. *
  9337. * @param sourceDir the directory to cache into tools
  9338. * @param tool tool name
  9339. * @param version version of the tool. semver format
  9340. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9341. */
  9342. function cacheDir(sourceDir, tool, version, arch) {
  9343. return __awaiter(this, void 0, void 0, function* () {
  9344. version = semver.clean(version) || version;
  9345. arch = arch || os.arch();
  9346. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9347. core.debug(`source dir: ${sourceDir}`);
  9348. if (!fs.statSync(sourceDir).isDirectory()) {
  9349. throw new Error('sourceDir is not a directory');
  9350. }
  9351. // Create the tool dir
  9352. const destPath = yield _createToolPath(tool, version, arch);
  9353. // copy each child item. do not move. move can fail on Windows
  9354. // due to anti-virus software having an open handle on a file.
  9355. for (const itemName of fs.readdirSync(sourceDir)) {
  9356. const s = path.join(sourceDir, itemName);
  9357. yield io.cp(s, destPath, { recursive: true });
  9358. }
  9359. // write .complete
  9360. _completeToolPath(tool, version, arch);
  9361. return destPath;
  9362. });
  9363. }
  9364. exports.cacheDir = cacheDir;
  9365. /**
  9366. * Caches a downloaded file (GUID) and installs it
  9367. * into the tool cache with a given targetName
  9368. *
  9369. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9370. * @param targetFile the name of the file name in the tools directory
  9371. * @param tool tool name
  9372. * @param version version of the tool. semver format
  9373. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9374. */
  9375. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9376. return __awaiter(this, void 0, void 0, function* () {
  9377. version = semver.clean(version) || version;
  9378. arch = arch || os.arch();
  9379. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9380. core.debug(`source file: ${sourceFile}`);
  9381. if (!fs.statSync(sourceFile).isFile()) {
  9382. throw new Error('sourceFile is not a file');
  9383. }
  9384. // create the tool dir
  9385. const destFolder = yield _createToolPath(tool, version, arch);
  9386. // copy instead of move. move can fail on Windows due to
  9387. // anti-virus software having an open handle on a file.
  9388. const destPath = path.join(destFolder, targetFile);
  9389. core.debug(`destination file ${destPath}`);
  9390. yield io.cp(sourceFile, destPath);
  9391. // write .complete
  9392. _completeToolPath(tool, version, arch);
  9393. return destFolder;
  9394. });
  9395. }
  9396. exports.cacheFile = cacheFile;
  9397. /**
  9398. * Finds the path to a tool version in the local installed tool cache
  9399. *
  9400. * @param toolName name of the tool
  9401. * @param versionSpec version of the tool
  9402. * @param arch optional arch. defaults to arch of computer
  9403. */
  9404. function find(toolName, versionSpec, arch) {
  9405. if (!toolName) {
  9406. throw new Error('toolName parameter is required');
  9407. }
  9408. if (!versionSpec) {
  9409. throw new Error('versionSpec parameter is required');
  9410. }
  9411. arch = arch || os.arch();
  9412. // attempt to resolve an explicit version
  9413. if (!_isExplicitVersion(versionSpec)) {
  9414. const localVersions = findAllVersions(toolName, arch);
  9415. const match = _evaluateVersions(localVersions, versionSpec);
  9416. versionSpec = match;
  9417. }
  9418. // check for the explicit version in the cache
  9419. let toolPath = '';
  9420. if (versionSpec) {
  9421. versionSpec = semver.clean(versionSpec) || '';
  9422. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9423. core.debug(`checking cache: ${cachePath}`);
  9424. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9425. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9426. toolPath = cachePath;
  9427. }
  9428. else {
  9429. core.debug('not found');
  9430. }
  9431. }
  9432. return toolPath;
  9433. }
  9434. exports.find = find;
  9435. /**
  9436. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9437. *
  9438. * @param toolName name of the tool
  9439. * @param arch optional arch. defaults to arch of computer
  9440. */
  9441. function findAllVersions(toolName, arch) {
  9442. const versions = [];
  9443. arch = arch || os.arch();
  9444. const toolPath = path.join(cacheRoot, toolName);
  9445. if (fs.existsSync(toolPath)) {
  9446. const children = fs.readdirSync(toolPath);
  9447. for (const child of children) {
  9448. if (_isExplicitVersion(child)) {
  9449. const fullPath = path.join(toolPath, child, arch || '');
  9450. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9451. versions.push(child);
  9452. }
  9453. }
  9454. }
  9455. }
  9456. return versions;
  9457. }
  9458. exports.findAllVersions = findAllVersions;
  9459. function _createExtractFolder(dest) {
  9460. return __awaiter(this, void 0, void 0, function* () {
  9461. if (!dest) {
  9462. // create a temp dir
  9463. dest = path.join(tempDirectory, uuidV4());
  9464. }
  9465. yield io.mkdirP(dest);
  9466. return dest;
  9467. });
  9468. }
  9469. function _createToolPath(tool, version, arch) {
  9470. return __awaiter(this, void 0, void 0, function* () {
  9471. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9472. core.debug(`destination ${folderPath}`);
  9473. const markerPath = `${folderPath}.complete`;
  9474. yield io.rmRF(folderPath);
  9475. yield io.rmRF(markerPath);
  9476. yield io.mkdirP(folderPath);
  9477. return folderPath;
  9478. });
  9479. }
  9480. function _completeToolPath(tool, version, arch) {
  9481. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9482. const markerPath = `${folderPath}.complete`;
  9483. fs.writeFileSync(markerPath, '');
  9484. core.debug('finished caching tool');
  9485. }
  9486. function _isExplicitVersion(versionSpec) {
  9487. const c = semver.clean(versionSpec) || '';
  9488. core.debug(`isExplicit: ${c}`);
  9489. const valid = semver.valid(c) != null;
  9490. core.debug(`explicit? ${valid}`);
  9491. return valid;
  9492. }
  9493. function _evaluateVersions(versions, versionSpec) {
  9494. let version = '';
  9495. core.debug(`evaluating ${versions.length} versions`);
  9496. versions = versions.sort((a, b) => {
  9497. if (semver.gt(a, b)) {
  9498. return 1;
  9499. }
  9500. return -1;
  9501. });
  9502. for (let i = versions.length - 1; i >= 0; i--) {
  9503. const potential = versions[i];
  9504. const satisfied = semver.satisfies(potential, versionSpec);
  9505. if (satisfied) {
  9506. version = potential;
  9507. break;
  9508. }
  9509. }
  9510. if (version) {
  9511. core.debug(`matched: ${version}`);
  9512. }
  9513. else {
  9514. core.debug('match not found');
  9515. }
  9516. return version;
  9517. }
  9518. //# sourceMappingURL=tool-cache.js.map
  9519. /***/ }),
  9520. /***/ 536:
  9521. /***/ (function(module, __unusedexports, __webpack_require__) {
  9522. module.exports = hasFirstPage
  9523. const deprecate = __webpack_require__(370)
  9524. const getPageLinks = __webpack_require__(577)
  9525. function hasFirstPage (link) {
  9526. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9527. return getPageLinks(link).first
  9528. }
  9529. /***/ }),
  9530. /***/ 539:
  9531. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9532. "use strict";
  9533. Object.defineProperty(exports, "__esModule", { value: true });
  9534. const url = __webpack_require__(835);
  9535. const http = __webpack_require__(605);
  9536. const https = __webpack_require__(34);
  9537. const pm = __webpack_require__(950);
  9538. let tunnel;
  9539. var HttpCodes;
  9540. (function (HttpCodes) {
  9541. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9542. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9543. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9544. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9545. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9546. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9547. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9548. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9549. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9550. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9551. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9552. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9553. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9554. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9555. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9556. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9557. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9558. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9559. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9560. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9561. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9562. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9563. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9564. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9565. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9566. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9567. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9568. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9569. var Headers;
  9570. (function (Headers) {
  9571. Headers["Accept"] = "accept";
  9572. Headers["ContentType"] = "content-type";
  9573. })(Headers = exports.Headers || (exports.Headers = {}));
  9574. var MediaTypes;
  9575. (function (MediaTypes) {
  9576. MediaTypes["ApplicationJson"] = "application/json";
  9577. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9578. /**
  9579. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9580. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9581. */
  9582. function getProxyUrl(serverUrl) {
  9583. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9584. return proxyUrl ? proxyUrl.href : '';
  9585. }
  9586. exports.getProxyUrl = getProxyUrl;
  9587. const HttpRedirectCodes = [
  9588. HttpCodes.MovedPermanently,
  9589. HttpCodes.ResourceMoved,
  9590. HttpCodes.SeeOther,
  9591. HttpCodes.TemporaryRedirect,
  9592. HttpCodes.PermanentRedirect
  9593. ];
  9594. const HttpResponseRetryCodes = [
  9595. HttpCodes.BadGateway,
  9596. HttpCodes.ServiceUnavailable,
  9597. HttpCodes.GatewayTimeout
  9598. ];
  9599. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9600. const ExponentialBackoffCeiling = 10;
  9601. const ExponentialBackoffTimeSlice = 5;
  9602. class HttpClientResponse {
  9603. constructor(message) {
  9604. this.message = message;
  9605. }
  9606. readBody() {
  9607. return new Promise(async (resolve, reject) => {
  9608. let output = Buffer.alloc(0);
  9609. this.message.on('data', (chunk) => {
  9610. output = Buffer.concat([output, chunk]);
  9611. });
  9612. this.message.on('end', () => {
  9613. resolve(output.toString());
  9614. });
  9615. });
  9616. }
  9617. }
  9618. exports.HttpClientResponse = HttpClientResponse;
  9619. function isHttps(requestUrl) {
  9620. let parsedUrl = url.parse(requestUrl);
  9621. return parsedUrl.protocol === 'https:';
  9622. }
  9623. exports.isHttps = isHttps;
  9624. class HttpClient {
  9625. constructor(userAgent, handlers, requestOptions) {
  9626. this._ignoreSslError = false;
  9627. this._allowRedirects = true;
  9628. this._allowRedirectDowngrade = false;
  9629. this._maxRedirects = 50;
  9630. this._allowRetries = false;
  9631. this._maxRetries = 1;
  9632. this._keepAlive = false;
  9633. this._disposed = false;
  9634. this.userAgent = userAgent;
  9635. this.handlers = handlers || [];
  9636. this.requestOptions = requestOptions;
  9637. if (requestOptions) {
  9638. if (requestOptions.ignoreSslError != null) {
  9639. this._ignoreSslError = requestOptions.ignoreSslError;
  9640. }
  9641. this._socketTimeout = requestOptions.socketTimeout;
  9642. if (requestOptions.allowRedirects != null) {
  9643. this._allowRedirects = requestOptions.allowRedirects;
  9644. }
  9645. if (requestOptions.allowRedirectDowngrade != null) {
  9646. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9647. }
  9648. if (requestOptions.maxRedirects != null) {
  9649. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9650. }
  9651. if (requestOptions.keepAlive != null) {
  9652. this._keepAlive = requestOptions.keepAlive;
  9653. }
  9654. if (requestOptions.allowRetries != null) {
  9655. this._allowRetries = requestOptions.allowRetries;
  9656. }
  9657. if (requestOptions.maxRetries != null) {
  9658. this._maxRetries = requestOptions.maxRetries;
  9659. }
  9660. }
  9661. }
  9662. options(requestUrl, additionalHeaders) {
  9663. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9664. }
  9665. get(requestUrl, additionalHeaders) {
  9666. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9667. }
  9668. del(requestUrl, additionalHeaders) {
  9669. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9670. }
  9671. post(requestUrl, data, additionalHeaders) {
  9672. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9673. }
  9674. patch(requestUrl, data, additionalHeaders) {
  9675. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9676. }
  9677. put(requestUrl, data, additionalHeaders) {
  9678. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9679. }
  9680. head(requestUrl, additionalHeaders) {
  9681. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9682. }
  9683. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9684. return this.request(verb, requestUrl, stream, additionalHeaders);
  9685. }
  9686. /**
  9687. * Gets a typed object from an endpoint
  9688. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9689. */
  9690. async getJson(requestUrl, additionalHeaders = {}) {
  9691. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9692. let res = await this.get(requestUrl, additionalHeaders);
  9693. return this._processResponse(res, this.requestOptions);
  9694. }
  9695. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9696. let data = JSON.stringify(obj, null, 2);
  9697. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9698. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9699. let res = await this.post(requestUrl, data, additionalHeaders);
  9700. return this._processResponse(res, this.requestOptions);
  9701. }
  9702. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9703. let data = JSON.stringify(obj, null, 2);
  9704. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9705. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9706. let res = await this.put(requestUrl, data, additionalHeaders);
  9707. return this._processResponse(res, this.requestOptions);
  9708. }
  9709. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9710. let data = JSON.stringify(obj, null, 2);
  9711. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9712. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9713. let res = await this.patch(requestUrl, data, additionalHeaders);
  9714. return this._processResponse(res, this.requestOptions);
  9715. }
  9716. /**
  9717. * Makes a raw http request.
  9718. * All other methods such as get, post, patch, and request ultimately call this.
  9719. * Prefer get, del, post and patch
  9720. */
  9721. async request(verb, requestUrl, data, headers) {
  9722. if (this._disposed) {
  9723. throw new Error('Client has already been disposed.');
  9724. }
  9725. let parsedUrl = url.parse(requestUrl);
  9726. let info = this._prepareRequest(verb, parsedUrl, headers);
  9727. // Only perform retries on reads since writes may not be idempotent.
  9728. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9729. ? this._maxRetries + 1
  9730. : 1;
  9731. let numTries = 0;
  9732. let response;
  9733. while (numTries < maxTries) {
  9734. response = await this.requestRaw(info, data);
  9735. // Check if it's an authentication challenge
  9736. if (response &&
  9737. response.message &&
  9738. response.message.statusCode === HttpCodes.Unauthorized) {
  9739. let authenticationHandler;
  9740. for (let i = 0; i < this.handlers.length; i++) {
  9741. if (this.handlers[i].canHandleAuthentication(response)) {
  9742. authenticationHandler = this.handlers[i];
  9743. break;
  9744. }
  9745. }
  9746. if (authenticationHandler) {
  9747. return authenticationHandler.handleAuthentication(this, info, data);
  9748. }
  9749. else {
  9750. // We have received an unauthorized response but have no handlers to handle it.
  9751. // Let the response return to the caller.
  9752. return response;
  9753. }
  9754. }
  9755. let redirectsRemaining = this._maxRedirects;
  9756. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9757. this._allowRedirects &&
  9758. redirectsRemaining > 0) {
  9759. const redirectUrl = response.message.headers['location'];
  9760. if (!redirectUrl) {
  9761. // if there's no location to redirect to, we won't
  9762. break;
  9763. }
  9764. let parsedRedirectUrl = url.parse(redirectUrl);
  9765. if (parsedUrl.protocol == 'https:' &&
  9766. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9767. !this._allowRedirectDowngrade) {
  9768. 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.');
  9769. }
  9770. // we need to finish reading the response before reassigning response
  9771. // which will leak the open socket.
  9772. await response.readBody();
  9773. // strip authorization header if redirected to a different hostname
  9774. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9775. for (let header in headers) {
  9776. // header names are case insensitive
  9777. if (header.toLowerCase() === 'authorization') {
  9778. delete headers[header];
  9779. }
  9780. }
  9781. }
  9782. // let's make the request with the new redirectUrl
  9783. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9784. response = await this.requestRaw(info, data);
  9785. redirectsRemaining--;
  9786. }
  9787. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9788. // If not a retry code, return immediately instead of retrying
  9789. return response;
  9790. }
  9791. numTries += 1;
  9792. if (numTries < maxTries) {
  9793. await response.readBody();
  9794. await this._performExponentialBackoff(numTries);
  9795. }
  9796. }
  9797. return response;
  9798. }
  9799. /**
  9800. * Needs to be called if keepAlive is set to true in request options.
  9801. */
  9802. dispose() {
  9803. if (this._agent) {
  9804. this._agent.destroy();
  9805. }
  9806. this._disposed = true;
  9807. }
  9808. /**
  9809. * Raw request.
  9810. * @param info
  9811. * @param data
  9812. */
  9813. requestRaw(info, data) {
  9814. return new Promise((resolve, reject) => {
  9815. let callbackForResult = function (err, res) {
  9816. if (err) {
  9817. reject(err);
  9818. }
  9819. resolve(res);
  9820. };
  9821. this.requestRawWithCallback(info, data, callbackForResult);
  9822. });
  9823. }
  9824. /**
  9825. * Raw request with callback.
  9826. * @param info
  9827. * @param data
  9828. * @param onResult
  9829. */
  9830. requestRawWithCallback(info, data, onResult) {
  9831. let socket;
  9832. if (typeof data === 'string') {
  9833. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9834. }
  9835. let callbackCalled = false;
  9836. let handleResult = (err, res) => {
  9837. if (!callbackCalled) {
  9838. callbackCalled = true;
  9839. onResult(err, res);
  9840. }
  9841. };
  9842. let req = info.httpModule.request(info.options, (msg) => {
  9843. let res = new HttpClientResponse(msg);
  9844. handleResult(null, res);
  9845. });
  9846. req.on('socket', sock => {
  9847. socket = sock;
  9848. });
  9849. // If we ever get disconnected, we want the socket to timeout eventually
  9850. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9851. if (socket) {
  9852. socket.end();
  9853. }
  9854. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9855. });
  9856. req.on('error', function (err) {
  9857. // err has statusCode property
  9858. // res should have headers
  9859. handleResult(err, null);
  9860. });
  9861. if (data && typeof data === 'string') {
  9862. req.write(data, 'utf8');
  9863. }
  9864. if (data && typeof data !== 'string') {
  9865. data.on('close', function () {
  9866. req.end();
  9867. });
  9868. data.pipe(req);
  9869. }
  9870. else {
  9871. req.end();
  9872. }
  9873. }
  9874. /**
  9875. * Gets an http agent. This function is useful when you need an http agent that handles
  9876. * routing through a proxy server - depending upon the url and proxy environment variables.
  9877. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9878. */
  9879. getAgent(serverUrl) {
  9880. let parsedUrl = url.parse(serverUrl);
  9881. return this._getAgent(parsedUrl);
  9882. }
  9883. _prepareRequest(method, requestUrl, headers) {
  9884. const info = {};
  9885. info.parsedUrl = requestUrl;
  9886. const usingSsl = info.parsedUrl.protocol === 'https:';
  9887. info.httpModule = usingSsl ? https : http;
  9888. const defaultPort = usingSsl ? 443 : 80;
  9889. info.options = {};
  9890. info.options.host = info.parsedUrl.hostname;
  9891. info.options.port = info.parsedUrl.port
  9892. ? parseInt(info.parsedUrl.port)
  9893. : defaultPort;
  9894. info.options.path =
  9895. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9896. info.options.method = method;
  9897. info.options.headers = this._mergeHeaders(headers);
  9898. if (this.userAgent != null) {
  9899. info.options.headers['user-agent'] = this.userAgent;
  9900. }
  9901. info.options.agent = this._getAgent(info.parsedUrl);
  9902. // gives handlers an opportunity to participate
  9903. if (this.handlers) {
  9904. this.handlers.forEach(handler => {
  9905. handler.prepareRequest(info.options);
  9906. });
  9907. }
  9908. return info;
  9909. }
  9910. _mergeHeaders(headers) {
  9911. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9912. if (this.requestOptions && this.requestOptions.headers) {
  9913. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9914. }
  9915. return lowercaseKeys(headers || {});
  9916. }
  9917. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9918. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9919. let clientHeader;
  9920. if (this.requestOptions && this.requestOptions.headers) {
  9921. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9922. }
  9923. return additionalHeaders[header] || clientHeader || _default;
  9924. }
  9925. _getAgent(parsedUrl) {
  9926. let agent;
  9927. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9928. let useProxy = proxyUrl && proxyUrl.hostname;
  9929. if (this._keepAlive && useProxy) {
  9930. agent = this._proxyAgent;
  9931. }
  9932. if (this._keepAlive && !useProxy) {
  9933. agent = this._agent;
  9934. }
  9935. // if agent is already assigned use that agent.
  9936. if (!!agent) {
  9937. return agent;
  9938. }
  9939. const usingSsl = parsedUrl.protocol === 'https:';
  9940. let maxSockets = 100;
  9941. if (!!this.requestOptions) {
  9942. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9943. }
  9944. if (useProxy) {
  9945. // If using proxy, need tunnel
  9946. if (!tunnel) {
  9947. tunnel = __webpack_require__(335);
  9948. }
  9949. const agentOptions = {
  9950. maxSockets: maxSockets,
  9951. keepAlive: this._keepAlive,
  9952. proxy: {
  9953. proxyAuth: proxyUrl.auth,
  9954. host: proxyUrl.hostname,
  9955. port: proxyUrl.port
  9956. }
  9957. };
  9958. let tunnelAgent;
  9959. const overHttps = proxyUrl.protocol === 'https:';
  9960. if (usingSsl) {
  9961. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9962. }
  9963. else {
  9964. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9965. }
  9966. agent = tunnelAgent(agentOptions);
  9967. this._proxyAgent = agent;
  9968. }
  9969. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9970. if (this._keepAlive && !agent) {
  9971. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9972. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9973. this._agent = agent;
  9974. }
  9975. // if not using private agent and tunnel agent isn't setup then use global agent
  9976. if (!agent) {
  9977. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9978. }
  9979. if (usingSsl && this._ignoreSslError) {
  9980. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9981. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9982. // we have to cast it to any and change it directly
  9983. agent.options = Object.assign(agent.options || {}, {
  9984. rejectUnauthorized: false
  9985. });
  9986. }
  9987. return agent;
  9988. }
  9989. _performExponentialBackoff(retryNumber) {
  9990. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9991. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9992. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9993. }
  9994. static dateTimeDeserializer(key, value) {
  9995. if (typeof value === 'string') {
  9996. let a = new Date(value);
  9997. if (!isNaN(a.valueOf())) {
  9998. return a;
  9999. }
  10000. }
  10001. return value;
  10002. }
  10003. async _processResponse(res, options) {
  10004. return new Promise(async (resolve, reject) => {
  10005. const statusCode = res.message.statusCode;
  10006. const response = {
  10007. statusCode: statusCode,
  10008. result: null,
  10009. headers: {}
  10010. };
  10011. // not found leads to null obj returned
  10012. if (statusCode == HttpCodes.NotFound) {
  10013. resolve(response);
  10014. }
  10015. let obj;
  10016. let contents;
  10017. // get the result from the body
  10018. try {
  10019. contents = await res.readBody();
  10020. if (contents && contents.length > 0) {
  10021. if (options && options.deserializeDates) {
  10022. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  10023. }
  10024. else {
  10025. obj = JSON.parse(contents);
  10026. }
  10027. response.result = obj;
  10028. }
  10029. response.headers = res.message.headers;
  10030. }
  10031. catch (err) {
  10032. // Invalid resource (contents not json); leaving result obj null
  10033. }
  10034. // note that 3xx redirects are handled by the http layer.
  10035. if (statusCode > 299) {
  10036. let msg;
  10037. // if exception/error in body, attempt to get better error
  10038. if (obj && obj.message) {
  10039. msg = obj.message;
  10040. }
  10041. else if (contents && contents.length > 0) {
  10042. // it may be the case that the exception is in the body message as string
  10043. msg = contents;
  10044. }
  10045. else {
  10046. msg = 'Failed request: (' + statusCode + ')';
  10047. }
  10048. let err = new Error(msg);
  10049. // attach statusCode and body obj (if available) to the error object
  10050. err['statusCode'] = statusCode;
  10051. if (response.result) {
  10052. err['result'] = response.result;
  10053. }
  10054. reject(err);
  10055. }
  10056. else {
  10057. resolve(response);
  10058. }
  10059. });
  10060. }
  10061. }
  10062. exports.HttpClient = HttpClient;
  10063. /***/ }),
  10064. /***/ 550:
  10065. /***/ (function(module, __unusedexports, __webpack_require__) {
  10066. module.exports = getNextPage
  10067. const getPage = __webpack_require__(265)
  10068. function getNextPage (octokit, link, headers) {
  10069. return getPage(octokit, link, 'next', headers)
  10070. }
  10071. /***/ }),
  10072. /***/ 558:
  10073. /***/ (function(module, __unusedexports, __webpack_require__) {
  10074. module.exports = hasPreviousPage
  10075. const deprecate = __webpack_require__(370)
  10076. const getPageLinks = __webpack_require__(577)
  10077. function hasPreviousPage (link) {
  10078. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10079. return getPageLinks(link).prev
  10080. }
  10081. /***/ }),
  10082. /***/ 559:
  10083. /***/ (function(__unusedmodule, exports) {
  10084. "use strict";
  10085. Object.defineProperty(exports, "__esModule", { value: true });
  10086. class GitVersion {
  10087. /**
  10088. * Used for comparing the version of git and git-lfs against the minimum required version
  10089. * @param version the version string, e.g. 1.2 or 1.2.3
  10090. */
  10091. constructor(version) {
  10092. this.major = NaN;
  10093. this.minor = NaN;
  10094. this.patch = NaN;
  10095. if (version) {
  10096. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  10097. if (match) {
  10098. this.major = Number(match[1]);
  10099. this.minor = Number(match[2]);
  10100. if (match[4]) {
  10101. this.patch = Number(match[4]);
  10102. }
  10103. }
  10104. }
  10105. }
  10106. /**
  10107. * Compares the instance against a minimum required version
  10108. * @param minimum Minimum version
  10109. */
  10110. checkMinimum(minimum) {
  10111. if (!minimum.isValid()) {
  10112. throw new Error('Arg minimum is not a valid version');
  10113. }
  10114. // Major is insufficient
  10115. if (this.major < minimum.major) {
  10116. return false;
  10117. }
  10118. // Major is equal
  10119. if (this.major === minimum.major) {
  10120. // Minor is insufficient
  10121. if (this.minor < minimum.minor) {
  10122. return false;
  10123. }
  10124. // Minor is equal
  10125. if (this.minor === minimum.minor) {
  10126. // Patch is insufficient
  10127. if (this.patch && this.patch < (minimum.patch || 0)) {
  10128. return false;
  10129. }
  10130. }
  10131. }
  10132. return true;
  10133. }
  10134. /**
  10135. * Indicates whether the instance was constructed from a valid version string
  10136. */
  10137. isValid() {
  10138. return !isNaN(this.major);
  10139. }
  10140. /**
  10141. * Returns the version as a string, e.g. 1.2 or 1.2.3
  10142. */
  10143. toString() {
  10144. let result = '';
  10145. if (this.isValid()) {
  10146. result = `${this.major}.${this.minor}`;
  10147. if (!isNaN(this.patch)) {
  10148. result += `.${this.patch}`;
  10149. }
  10150. }
  10151. return result;
  10152. }
  10153. }
  10154. exports.GitVersion = GitVersion;
  10155. /***/ }),
  10156. /***/ 562:
  10157. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10158. "use strict";
  10159. Object.defineProperty(exports, '__esModule', { value: true });
  10160. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10161. var osName = _interopDefault(__webpack_require__(2));
  10162. function getUserAgent() {
  10163. try {
  10164. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10165. } catch (error) {
  10166. if (/wmic os get Caption/.test(error.message)) {
  10167. return "Windows <version undetectable>";
  10168. }
  10169. return "<environment undetectable>";
  10170. }
  10171. }
  10172. exports.getUserAgent = getUserAgent;
  10173. //# sourceMappingURL=index.js.map
  10174. /***/ }),
  10175. /***/ 563:
  10176. /***/ (function(module, __unusedexports, __webpack_require__) {
  10177. module.exports = getPreviousPage
  10178. const getPage = __webpack_require__(265)
  10179. function getPreviousPage (octokit, link, headers) {
  10180. return getPage(octokit, link, 'prev', headers)
  10181. }
  10182. /***/ }),
  10183. /***/ 568:
  10184. /***/ (function(module, __unusedexports, __webpack_require__) {
  10185. "use strict";
  10186. const path = __webpack_require__(622);
  10187. const niceTry = __webpack_require__(948);
  10188. const resolveCommand = __webpack_require__(489);
  10189. const escape = __webpack_require__(462);
  10190. const readShebang = __webpack_require__(389);
  10191. const semver = __webpack_require__(280);
  10192. const isWin = process.platform === 'win32';
  10193. const isExecutableRegExp = /\.(?:com|exe)$/i;
  10194. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  10195. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  10196. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  10197. function detectShebang(parsed) {
  10198. parsed.file = resolveCommand(parsed);
  10199. const shebang = parsed.file && readShebang(parsed.file);
  10200. if (shebang) {
  10201. parsed.args.unshift(parsed.file);
  10202. parsed.command = shebang;
  10203. return resolveCommand(parsed);
  10204. }
  10205. return parsed.file;
  10206. }
  10207. function parseNonShell(parsed) {
  10208. if (!isWin) {
  10209. return parsed;
  10210. }
  10211. // Detect & add support for shebangs
  10212. const commandFile = detectShebang(parsed);
  10213. // We don't need a shell if the command filename is an executable
  10214. const needsShell = !isExecutableRegExp.test(commandFile);
  10215. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  10216. // Note that `forceShell` is an hidden option used only in tests
  10217. if (parsed.options.forceShell || needsShell) {
  10218. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10219. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10220. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10221. // we need to double escape them
  10222. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10223. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10224. // This is necessary otherwise it will always fail with ENOENT in those cases
  10225. parsed.command = path.normalize(parsed.command);
  10226. // Escape command & arguments
  10227. parsed.command = escape.command(parsed.command);
  10228. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10229. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10230. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10231. parsed.command = process.env.comspec || 'cmd.exe';
  10232. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10233. }
  10234. return parsed;
  10235. }
  10236. function parseShell(parsed) {
  10237. // If node supports the shell option, there's no need to mimic its behavior
  10238. if (supportsShellOption) {
  10239. return parsed;
  10240. }
  10241. // Mimic node shell option
  10242. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10243. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10244. if (isWin) {
  10245. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10246. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10247. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10248. } else {
  10249. if (typeof parsed.options.shell === 'string') {
  10250. parsed.command = parsed.options.shell;
  10251. } else if (process.platform === 'android') {
  10252. parsed.command = '/system/bin/sh';
  10253. } else {
  10254. parsed.command = '/bin/sh';
  10255. }
  10256. parsed.args = ['-c', shellCommand];
  10257. }
  10258. return parsed;
  10259. }
  10260. function parse(command, args, options) {
  10261. // Normalize arguments, similar to nodejs
  10262. if (args && !Array.isArray(args)) {
  10263. options = args;
  10264. args = null;
  10265. }
  10266. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10267. options = Object.assign({}, options); // Clone object to avoid changing the original
  10268. // Build our parsed object
  10269. const parsed = {
  10270. command,
  10271. args,
  10272. options,
  10273. file: undefined,
  10274. original: {
  10275. command,
  10276. args,
  10277. },
  10278. };
  10279. // Delegate further parsing to shell or non-shell
  10280. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10281. }
  10282. module.exports = parse;
  10283. /***/ }),
  10284. /***/ 577:
  10285. /***/ (function(module) {
  10286. module.exports = getPageLinks
  10287. function getPageLinks (link) {
  10288. link = link.link || link.headers.link || ''
  10289. const links = {}
  10290. // link format:
  10291. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10292. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10293. links[type] = uri
  10294. })
  10295. return links
  10296. }
  10297. /***/ }),
  10298. /***/ 587:
  10299. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10300. "use strict";
  10301. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10302. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10303. return new (P || (P = Promise))(function (resolve, reject) {
  10304. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10305. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10306. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10307. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10308. });
  10309. };
  10310. var __importStar = (this && this.__importStar) || function (mod) {
  10311. if (mod && mod.__esModule) return mod;
  10312. var result = {};
  10313. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10314. result["default"] = mod;
  10315. return result;
  10316. };
  10317. Object.defineProperty(exports, "__esModule", { value: true });
  10318. const core = __importStar(__webpack_require__(470));
  10319. const defaultMaxAttempts = 3;
  10320. const defaultMinSeconds = 10;
  10321. const defaultMaxSeconds = 20;
  10322. class RetryHelper {
  10323. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10324. this.maxAttempts = maxAttempts;
  10325. this.minSeconds = Math.floor(minSeconds);
  10326. this.maxSeconds = Math.floor(maxSeconds);
  10327. if (this.minSeconds > this.maxSeconds) {
  10328. throw new Error('min seconds should be less than or equal to max seconds');
  10329. }
  10330. }
  10331. execute(action) {
  10332. return __awaiter(this, void 0, void 0, function* () {
  10333. let attempt = 1;
  10334. while (attempt < this.maxAttempts) {
  10335. // Try
  10336. try {
  10337. return yield action();
  10338. }
  10339. catch (err) {
  10340. core.info(err.message);
  10341. }
  10342. // Sleep
  10343. const seconds = this.getSleepAmount();
  10344. core.info(`Waiting ${seconds} seconds before trying again`);
  10345. yield this.sleep(seconds);
  10346. attempt++;
  10347. }
  10348. // Last attempt
  10349. return yield action();
  10350. });
  10351. }
  10352. getSleepAmount() {
  10353. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10354. this.minSeconds);
  10355. }
  10356. sleep(seconds) {
  10357. return __awaiter(this, void 0, void 0, function* () {
  10358. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10359. });
  10360. }
  10361. }
  10362. exports.RetryHelper = RetryHelper;
  10363. function execute(action) {
  10364. return __awaiter(this, void 0, void 0, function* () {
  10365. const retryHelper = new RetryHelper();
  10366. return yield retryHelper.execute(action);
  10367. });
  10368. }
  10369. exports.execute = execute;
  10370. /***/ }),
  10371. /***/ 605:
  10372. /***/ (function(module) {
  10373. module.exports = require("http");
  10374. /***/ }),
  10375. /***/ 614:
  10376. /***/ (function(module) {
  10377. module.exports = require("events");
  10378. /***/ }),
  10379. /***/ 618:
  10380. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10381. "use strict";
  10382. var __importStar = (this && this.__importStar) || function (mod) {
  10383. if (mod && mod.__esModule) return mod;
  10384. var result = {};
  10385. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10386. result["default"] = mod;
  10387. return result;
  10388. };
  10389. Object.defineProperty(exports, "__esModule", { value: true });
  10390. const fs = __importStar(__webpack_require__(747));
  10391. function directoryExistsSync(path, required) {
  10392. if (!path) {
  10393. throw new Error("Arg 'path' must not be empty");
  10394. }
  10395. let stats;
  10396. try {
  10397. stats = fs.statSync(path);
  10398. }
  10399. catch (error) {
  10400. if (error.code === 'ENOENT') {
  10401. if (!required) {
  10402. return false;
  10403. }
  10404. throw new Error(`Directory '${path}' does not exist`);
  10405. }
  10406. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10407. }
  10408. if (stats.isDirectory()) {
  10409. return true;
  10410. }
  10411. else if (!required) {
  10412. return false;
  10413. }
  10414. throw new Error(`Directory '${path}' does not exist`);
  10415. }
  10416. exports.directoryExistsSync = directoryExistsSync;
  10417. function existsSync(path) {
  10418. if (!path) {
  10419. throw new Error("Arg 'path' must not be empty");
  10420. }
  10421. try {
  10422. fs.statSync(path);
  10423. }
  10424. catch (error) {
  10425. if (error.code === 'ENOENT') {
  10426. return false;
  10427. }
  10428. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10429. }
  10430. return true;
  10431. }
  10432. exports.existsSync = existsSync;
  10433. function fileExistsSync(path) {
  10434. if (!path) {
  10435. throw new Error("Arg 'path' must not be empty");
  10436. }
  10437. let stats;
  10438. try {
  10439. stats = fs.statSync(path);
  10440. }
  10441. catch (error) {
  10442. if (error.code === 'ENOENT') {
  10443. return false;
  10444. }
  10445. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10446. }
  10447. if (!stats.isDirectory()) {
  10448. return true;
  10449. }
  10450. return false;
  10451. }
  10452. exports.fileExistsSync = fileExistsSync;
  10453. /***/ }),
  10454. /***/ 621:
  10455. /***/ (function(module, __unusedexports, __webpack_require__) {
  10456. "use strict";
  10457. const path = __webpack_require__(622);
  10458. const pathKey = __webpack_require__(39);
  10459. module.exports = opts => {
  10460. opts = Object.assign({
  10461. cwd: process.cwd(),
  10462. path: process.env[pathKey()]
  10463. }, opts);
  10464. let prev;
  10465. let pth = path.resolve(opts.cwd);
  10466. const ret = [];
  10467. while (prev !== pth) {
  10468. ret.push(path.join(pth, 'node_modules/.bin'));
  10469. prev = pth;
  10470. pth = path.resolve(pth, '..');
  10471. }
  10472. // ensure the running `node` binary is used
  10473. ret.push(path.dirname(process.execPath));
  10474. return ret.concat(opts.path).join(path.delimiter);
  10475. };
  10476. module.exports.env = opts => {
  10477. opts = Object.assign({
  10478. env: process.env
  10479. }, opts);
  10480. const env = Object.assign({}, opts.env);
  10481. const path = pathKey({env});
  10482. opts.path = env[path];
  10483. env[path] = module.exports(opts);
  10484. return env;
  10485. };
  10486. /***/ }),
  10487. /***/ 622:
  10488. /***/ (function(module) {
  10489. module.exports = require("path");
  10490. /***/ }),
  10491. /***/ 631:
  10492. /***/ (function(module) {
  10493. module.exports = require("net");
  10494. /***/ }),
  10495. /***/ 649:
  10496. /***/ (function(module, __unusedexports, __webpack_require__) {
  10497. module.exports = getLastPage
  10498. const getPage = __webpack_require__(265)
  10499. function getLastPage (octokit, link, headers) {
  10500. return getPage(octokit, link, 'last', headers)
  10501. }
  10502. /***/ }),
  10503. /***/ 654:
  10504. /***/ (function(module) {
  10505. // This is not the set of all possible signals.
  10506. //
  10507. // It IS, however, the set of all signals that trigger
  10508. // an exit on either Linux or BSD systems. Linux is a
  10509. // superset of the signal names supported on BSD, and
  10510. // the unknown signals just fail to register, so we can
  10511. // catch that easily enough.
  10512. //
  10513. // Don't bother with SIGKILL. It's uncatchable, which
  10514. // means that we can't fire any callbacks anyway.
  10515. //
  10516. // If a user does happen to register a handler on a non-
  10517. // fatal signal like SIGWINCH or something, and then
  10518. // exit, it'll end up firing `process.emit('exit')`, so
  10519. // the handler will be fired anyway.
  10520. //
  10521. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10522. // artificially, inherently leave the process in a
  10523. // state from which it is not safe to try and enter JS
  10524. // listeners.
  10525. module.exports = [
  10526. 'SIGABRT',
  10527. 'SIGALRM',
  10528. 'SIGHUP',
  10529. 'SIGINT',
  10530. 'SIGTERM'
  10531. ]
  10532. if (process.platform !== 'win32') {
  10533. module.exports.push(
  10534. 'SIGVTALRM',
  10535. 'SIGXCPU',
  10536. 'SIGXFSZ',
  10537. 'SIGUSR2',
  10538. 'SIGTRAP',
  10539. 'SIGSYS',
  10540. 'SIGQUIT',
  10541. 'SIGIOT'
  10542. // should detect profiler and enable/disable accordingly.
  10543. // see #21
  10544. // 'SIGPROF'
  10545. )
  10546. }
  10547. if (process.platform === 'linux') {
  10548. module.exports.push(
  10549. 'SIGIO',
  10550. 'SIGPOLL',
  10551. 'SIGPWR',
  10552. 'SIGSTKFLT',
  10553. 'SIGUNUSED'
  10554. )
  10555. }
  10556. /***/ }),
  10557. /***/ 656:
  10558. /***/ (function(module, exports) {
  10559. exports = module.exports = SemVer
  10560. var debug
  10561. /* istanbul ignore next */
  10562. if (typeof process === 'object' &&
  10563. process.env &&
  10564. process.env.NODE_DEBUG &&
  10565. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10566. debug = function () {
  10567. var args = Array.prototype.slice.call(arguments, 0)
  10568. args.unshift('SEMVER')
  10569. console.log.apply(console, args)
  10570. }
  10571. } else {
  10572. debug = function () {}
  10573. }
  10574. // Note: this is the semver.org version of the spec that it implements
  10575. // Not necessarily the package version of this code.
  10576. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10577. var MAX_LENGTH = 256
  10578. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10579. /* istanbul ignore next */ 9007199254740991
  10580. // Max safe segment length for coercion.
  10581. var MAX_SAFE_COMPONENT_LENGTH = 16
  10582. // The actual regexps go on exports.re
  10583. var re = exports.re = []
  10584. var src = exports.src = []
  10585. var t = exports.tokens = {}
  10586. var R = 0
  10587. function tok (n) {
  10588. t[n] = R++
  10589. }
  10590. // The following Regular Expressions can be used for tokenizing,
  10591. // validating, and parsing SemVer version strings.
  10592. // ## Numeric Identifier
  10593. // A single `0`, or a non-zero digit followed by zero or more digits.
  10594. tok('NUMERICIDENTIFIER')
  10595. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10596. tok('NUMERICIDENTIFIERLOOSE')
  10597. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10598. // ## Non-numeric Identifier
  10599. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10600. // more letters, digits, or hyphens.
  10601. tok('NONNUMERICIDENTIFIER')
  10602. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10603. // ## Main Version
  10604. // Three dot-separated numeric identifiers.
  10605. tok('MAINVERSION')
  10606. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10607. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10608. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10609. tok('MAINVERSIONLOOSE')
  10610. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10611. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10612. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10613. // ## Pre-release Version Identifier
  10614. // A numeric identifier, or a non-numeric identifier.
  10615. tok('PRERELEASEIDENTIFIER')
  10616. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10617. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10618. tok('PRERELEASEIDENTIFIERLOOSE')
  10619. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10620. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10621. // ## Pre-release Version
  10622. // Hyphen, followed by one or more dot-separated pre-release version
  10623. // identifiers.
  10624. tok('PRERELEASE')
  10625. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10626. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10627. tok('PRERELEASELOOSE')
  10628. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10629. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10630. // ## Build Metadata Identifier
  10631. // Any combination of digits, letters, or hyphens.
  10632. tok('BUILDIDENTIFIER')
  10633. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10634. // ## Build Metadata
  10635. // Plus sign, followed by one or more period-separated build metadata
  10636. // identifiers.
  10637. tok('BUILD')
  10638. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10639. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10640. // ## Full Version String
  10641. // A main version, followed optionally by a pre-release version and
  10642. // build metadata.
  10643. // Note that the only major, minor, patch, and pre-release sections of
  10644. // the version string are capturing groups. The build metadata is not a
  10645. // capturing group, because it should not ever be used in version
  10646. // comparison.
  10647. tok('FULL')
  10648. tok('FULLPLAIN')
  10649. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10650. src[t.PRERELEASE] + '?' +
  10651. src[t.BUILD] + '?'
  10652. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10653. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10654. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10655. // common in the npm registry.
  10656. tok('LOOSEPLAIN')
  10657. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10658. src[t.PRERELEASELOOSE] + '?' +
  10659. src[t.BUILD] + '?'
  10660. tok('LOOSE')
  10661. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10662. tok('GTLT')
  10663. src[t.GTLT] = '((?:<|>)?=?)'
  10664. // Something like "2.*" or "1.2.x".
  10665. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10666. // Only the first item is strictly required.
  10667. tok('XRANGEIDENTIFIERLOOSE')
  10668. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10669. tok('XRANGEIDENTIFIER')
  10670. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10671. tok('XRANGEPLAIN')
  10672. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10673. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10674. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10675. '(?:' + src[t.PRERELEASE] + ')?' +
  10676. src[t.BUILD] + '?' +
  10677. ')?)?'
  10678. tok('XRANGEPLAINLOOSE')
  10679. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10680. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10681. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10682. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10683. src[t.BUILD] + '?' +
  10684. ')?)?'
  10685. tok('XRANGE')
  10686. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10687. tok('XRANGELOOSE')
  10688. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10689. // Coercion.
  10690. // Extract anything that could conceivably be a part of a valid semver
  10691. tok('COERCE')
  10692. src[t.COERCE] = '(^|[^\\d])' +
  10693. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10694. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10695. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10696. '(?:$|[^\\d])'
  10697. tok('COERCERTL')
  10698. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10699. // Tilde ranges.
  10700. // Meaning is "reasonably at or greater than"
  10701. tok('LONETILDE')
  10702. src[t.LONETILDE] = '(?:~>?)'
  10703. tok('TILDETRIM')
  10704. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10705. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10706. var tildeTrimReplace = '$1~'
  10707. tok('TILDE')
  10708. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10709. tok('TILDELOOSE')
  10710. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10711. // Caret ranges.
  10712. // Meaning is "at least and backwards compatible with"
  10713. tok('LONECARET')
  10714. src[t.LONECARET] = '(?:\\^)'
  10715. tok('CARETTRIM')
  10716. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10717. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10718. var caretTrimReplace = '$1^'
  10719. tok('CARET')
  10720. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10721. tok('CARETLOOSE')
  10722. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10723. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10724. tok('COMPARATORLOOSE')
  10725. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10726. tok('COMPARATOR')
  10727. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10728. // An expression to strip any whitespace between the gtlt and the thing
  10729. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10730. tok('COMPARATORTRIM')
  10731. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10732. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10733. // this one has to use the /g flag
  10734. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10735. var comparatorTrimReplace = '$1$2$3'
  10736. // Something like `1.2.3 - 1.2.4`
  10737. // Note that these all use the loose form, because they'll be
  10738. // checked against either the strict or loose comparator form
  10739. // later.
  10740. tok('HYPHENRANGE')
  10741. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10742. '\\s+-\\s+' +
  10743. '(' + src[t.XRANGEPLAIN] + ')' +
  10744. '\\s*$'
  10745. tok('HYPHENRANGELOOSE')
  10746. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10747. '\\s+-\\s+' +
  10748. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10749. '\\s*$'
  10750. // Star ranges basically just allow anything at all.
  10751. tok('STAR')
  10752. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10753. // Compile to actual regexp objects.
  10754. // All are flag-free, unless they were created above with a flag.
  10755. for (var i = 0; i < R; i++) {
  10756. debug(i, src[i])
  10757. if (!re[i]) {
  10758. re[i] = new RegExp(src[i])
  10759. }
  10760. }
  10761. exports.parse = parse
  10762. function parse (version, options) {
  10763. if (!options || typeof options !== 'object') {
  10764. options = {
  10765. loose: !!options,
  10766. includePrerelease: false
  10767. }
  10768. }
  10769. if (version instanceof SemVer) {
  10770. return version
  10771. }
  10772. if (typeof version !== 'string') {
  10773. return null
  10774. }
  10775. if (version.length > MAX_LENGTH) {
  10776. return null
  10777. }
  10778. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10779. if (!r.test(version)) {
  10780. return null
  10781. }
  10782. try {
  10783. return new SemVer(version, options)
  10784. } catch (er) {
  10785. return null
  10786. }
  10787. }
  10788. exports.valid = valid
  10789. function valid (version, options) {
  10790. var v = parse(version, options)
  10791. return v ? v.version : null
  10792. }
  10793. exports.clean = clean
  10794. function clean (version, options) {
  10795. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10796. return s ? s.version : null
  10797. }
  10798. exports.SemVer = SemVer
  10799. function SemVer (version, options) {
  10800. if (!options || typeof options !== 'object') {
  10801. options = {
  10802. loose: !!options,
  10803. includePrerelease: false
  10804. }
  10805. }
  10806. if (version instanceof SemVer) {
  10807. if (version.loose === options.loose) {
  10808. return version
  10809. } else {
  10810. version = version.version
  10811. }
  10812. } else if (typeof version !== 'string') {
  10813. throw new TypeError('Invalid Version: ' + version)
  10814. }
  10815. if (version.length > MAX_LENGTH) {
  10816. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10817. }
  10818. if (!(this instanceof SemVer)) {
  10819. return new SemVer(version, options)
  10820. }
  10821. debug('SemVer', version, options)
  10822. this.options = options
  10823. this.loose = !!options.loose
  10824. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10825. if (!m) {
  10826. throw new TypeError('Invalid Version: ' + version)
  10827. }
  10828. this.raw = version
  10829. // these are actually numbers
  10830. this.major = +m[1]
  10831. this.minor = +m[2]
  10832. this.patch = +m[3]
  10833. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10834. throw new TypeError('Invalid major version')
  10835. }
  10836. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10837. throw new TypeError('Invalid minor version')
  10838. }
  10839. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10840. throw new TypeError('Invalid patch version')
  10841. }
  10842. // numberify any prerelease numeric ids
  10843. if (!m[4]) {
  10844. this.prerelease = []
  10845. } else {
  10846. this.prerelease = m[4].split('.').map(function (id) {
  10847. if (/^[0-9]+$/.test(id)) {
  10848. var num = +id
  10849. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10850. return num
  10851. }
  10852. }
  10853. return id
  10854. })
  10855. }
  10856. this.build = m[5] ? m[5].split('.') : []
  10857. this.format()
  10858. }
  10859. SemVer.prototype.format = function () {
  10860. this.version = this.major + '.' + this.minor + '.' + this.patch
  10861. if (this.prerelease.length) {
  10862. this.version += '-' + this.prerelease.join('.')
  10863. }
  10864. return this.version
  10865. }
  10866. SemVer.prototype.toString = function () {
  10867. return this.version
  10868. }
  10869. SemVer.prototype.compare = function (other) {
  10870. debug('SemVer.compare', this.version, this.options, other)
  10871. if (!(other instanceof SemVer)) {
  10872. other = new SemVer(other, this.options)
  10873. }
  10874. return this.compareMain(other) || this.comparePre(other)
  10875. }
  10876. SemVer.prototype.compareMain = function (other) {
  10877. if (!(other instanceof SemVer)) {
  10878. other = new SemVer(other, this.options)
  10879. }
  10880. return compareIdentifiers(this.major, other.major) ||
  10881. compareIdentifiers(this.minor, other.minor) ||
  10882. compareIdentifiers(this.patch, other.patch)
  10883. }
  10884. SemVer.prototype.comparePre = function (other) {
  10885. if (!(other instanceof SemVer)) {
  10886. other = new SemVer(other, this.options)
  10887. }
  10888. // NOT having a prerelease is > having one
  10889. if (this.prerelease.length && !other.prerelease.length) {
  10890. return -1
  10891. } else if (!this.prerelease.length && other.prerelease.length) {
  10892. return 1
  10893. } else if (!this.prerelease.length && !other.prerelease.length) {
  10894. return 0
  10895. }
  10896. var i = 0
  10897. do {
  10898. var a = this.prerelease[i]
  10899. var b = other.prerelease[i]
  10900. debug('prerelease compare', i, a, b)
  10901. if (a === undefined && b === undefined) {
  10902. return 0
  10903. } else if (b === undefined) {
  10904. return 1
  10905. } else if (a === undefined) {
  10906. return -1
  10907. } else if (a === b) {
  10908. continue
  10909. } else {
  10910. return compareIdentifiers(a, b)
  10911. }
  10912. } while (++i)
  10913. }
  10914. SemVer.prototype.compareBuild = function (other) {
  10915. if (!(other instanceof SemVer)) {
  10916. other = new SemVer(other, this.options)
  10917. }
  10918. var i = 0
  10919. do {
  10920. var a = this.build[i]
  10921. var b = other.build[i]
  10922. debug('prerelease compare', i, a, b)
  10923. if (a === undefined && b === undefined) {
  10924. return 0
  10925. } else if (b === undefined) {
  10926. return 1
  10927. } else if (a === undefined) {
  10928. return -1
  10929. } else if (a === b) {
  10930. continue
  10931. } else {
  10932. return compareIdentifiers(a, b)
  10933. }
  10934. } while (++i)
  10935. }
  10936. // preminor will bump the version up to the next minor release, and immediately
  10937. // down to pre-release. premajor and prepatch work the same way.
  10938. SemVer.prototype.inc = function (release, identifier) {
  10939. switch (release) {
  10940. case 'premajor':
  10941. this.prerelease.length = 0
  10942. this.patch = 0
  10943. this.minor = 0
  10944. this.major++
  10945. this.inc('pre', identifier)
  10946. break
  10947. case 'preminor':
  10948. this.prerelease.length = 0
  10949. this.patch = 0
  10950. this.minor++
  10951. this.inc('pre', identifier)
  10952. break
  10953. case 'prepatch':
  10954. // If this is already a prerelease, it will bump to the next version
  10955. // drop any prereleases that might already exist, since they are not
  10956. // relevant at this point.
  10957. this.prerelease.length = 0
  10958. this.inc('patch', identifier)
  10959. this.inc('pre', identifier)
  10960. break
  10961. // If the input is a non-prerelease version, this acts the same as
  10962. // prepatch.
  10963. case 'prerelease':
  10964. if (this.prerelease.length === 0) {
  10965. this.inc('patch', identifier)
  10966. }
  10967. this.inc('pre', identifier)
  10968. break
  10969. case 'major':
  10970. // If this is a pre-major version, bump up to the same major version.
  10971. // Otherwise increment major.
  10972. // 1.0.0-5 bumps to 1.0.0
  10973. // 1.1.0 bumps to 2.0.0
  10974. if (this.minor !== 0 ||
  10975. this.patch !== 0 ||
  10976. this.prerelease.length === 0) {
  10977. this.major++
  10978. }
  10979. this.minor = 0
  10980. this.patch = 0
  10981. this.prerelease = []
  10982. break
  10983. case 'minor':
  10984. // If this is a pre-minor version, bump up to the same minor version.
  10985. // Otherwise increment minor.
  10986. // 1.2.0-5 bumps to 1.2.0
  10987. // 1.2.1 bumps to 1.3.0
  10988. if (this.patch !== 0 || this.prerelease.length === 0) {
  10989. this.minor++
  10990. }
  10991. this.patch = 0
  10992. this.prerelease = []
  10993. break
  10994. case 'patch':
  10995. // If this is not a pre-release version, it will increment the patch.
  10996. // If it is a pre-release it will bump up to the same patch version.
  10997. // 1.2.0-5 patches to 1.2.0
  10998. // 1.2.0 patches to 1.2.1
  10999. if (this.prerelease.length === 0) {
  11000. this.patch++
  11001. }
  11002. this.prerelease = []
  11003. break
  11004. // This probably shouldn't be used publicly.
  11005. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11006. case 'pre':
  11007. if (this.prerelease.length === 0) {
  11008. this.prerelease = [0]
  11009. } else {
  11010. var i = this.prerelease.length
  11011. while (--i >= 0) {
  11012. if (typeof this.prerelease[i] === 'number') {
  11013. this.prerelease[i]++
  11014. i = -2
  11015. }
  11016. }
  11017. if (i === -1) {
  11018. // didn't increment anything
  11019. this.prerelease.push(0)
  11020. }
  11021. }
  11022. if (identifier) {
  11023. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11024. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11025. if (this.prerelease[0] === identifier) {
  11026. if (isNaN(this.prerelease[1])) {
  11027. this.prerelease = [identifier, 0]
  11028. }
  11029. } else {
  11030. this.prerelease = [identifier, 0]
  11031. }
  11032. }
  11033. break
  11034. default:
  11035. throw new Error('invalid increment argument: ' + release)
  11036. }
  11037. this.format()
  11038. this.raw = this.version
  11039. return this
  11040. }
  11041. exports.inc = inc
  11042. function inc (version, release, loose, identifier) {
  11043. if (typeof (loose) === 'string') {
  11044. identifier = loose
  11045. loose = undefined
  11046. }
  11047. try {
  11048. return new SemVer(version, loose).inc(release, identifier).version
  11049. } catch (er) {
  11050. return null
  11051. }
  11052. }
  11053. exports.diff = diff
  11054. function diff (version1, version2) {
  11055. if (eq(version1, version2)) {
  11056. return null
  11057. } else {
  11058. var v1 = parse(version1)
  11059. var v2 = parse(version2)
  11060. var prefix = ''
  11061. if (v1.prerelease.length || v2.prerelease.length) {
  11062. prefix = 'pre'
  11063. var defaultResult = 'prerelease'
  11064. }
  11065. for (var key in v1) {
  11066. if (key === 'major' || key === 'minor' || key === 'patch') {
  11067. if (v1[key] !== v2[key]) {
  11068. return prefix + key
  11069. }
  11070. }
  11071. }
  11072. return defaultResult // may be undefined
  11073. }
  11074. }
  11075. exports.compareIdentifiers = compareIdentifiers
  11076. var numeric = /^[0-9]+$/
  11077. function compareIdentifiers (a, b) {
  11078. var anum = numeric.test(a)
  11079. var bnum = numeric.test(b)
  11080. if (anum && bnum) {
  11081. a = +a
  11082. b = +b
  11083. }
  11084. return a === b ? 0
  11085. : (anum && !bnum) ? -1
  11086. : (bnum && !anum) ? 1
  11087. : a < b ? -1
  11088. : 1
  11089. }
  11090. exports.rcompareIdentifiers = rcompareIdentifiers
  11091. function rcompareIdentifiers (a, b) {
  11092. return compareIdentifiers(b, a)
  11093. }
  11094. exports.major = major
  11095. function major (a, loose) {
  11096. return new SemVer(a, loose).major
  11097. }
  11098. exports.minor = minor
  11099. function minor (a, loose) {
  11100. return new SemVer(a, loose).minor
  11101. }
  11102. exports.patch = patch
  11103. function patch (a, loose) {
  11104. return new SemVer(a, loose).patch
  11105. }
  11106. exports.compare = compare
  11107. function compare (a, b, loose) {
  11108. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11109. }
  11110. exports.compareLoose = compareLoose
  11111. function compareLoose (a, b) {
  11112. return compare(a, b, true)
  11113. }
  11114. exports.compareBuild = compareBuild
  11115. function compareBuild (a, b, loose) {
  11116. var versionA = new SemVer(a, loose)
  11117. var versionB = new SemVer(b, loose)
  11118. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11119. }
  11120. exports.rcompare = rcompare
  11121. function rcompare (a, b, loose) {
  11122. return compare(b, a, loose)
  11123. }
  11124. exports.sort = sort
  11125. function sort (list, loose) {
  11126. return list.sort(function (a, b) {
  11127. return exports.compareBuild(a, b, loose)
  11128. })
  11129. }
  11130. exports.rsort = rsort
  11131. function rsort (list, loose) {
  11132. return list.sort(function (a, b) {
  11133. return exports.compareBuild(b, a, loose)
  11134. })
  11135. }
  11136. exports.gt = gt
  11137. function gt (a, b, loose) {
  11138. return compare(a, b, loose) > 0
  11139. }
  11140. exports.lt = lt
  11141. function lt (a, b, loose) {
  11142. return compare(a, b, loose) < 0
  11143. }
  11144. exports.eq = eq
  11145. function eq (a, b, loose) {
  11146. return compare(a, b, loose) === 0
  11147. }
  11148. exports.neq = neq
  11149. function neq (a, b, loose) {
  11150. return compare(a, b, loose) !== 0
  11151. }
  11152. exports.gte = gte
  11153. function gte (a, b, loose) {
  11154. return compare(a, b, loose) >= 0
  11155. }
  11156. exports.lte = lte
  11157. function lte (a, b, loose) {
  11158. return compare(a, b, loose) <= 0
  11159. }
  11160. exports.cmp = cmp
  11161. function cmp (a, op, b, loose) {
  11162. switch (op) {
  11163. case '===':
  11164. if (typeof a === 'object')
  11165. a = a.version
  11166. if (typeof b === 'object')
  11167. b = b.version
  11168. return a === b
  11169. case '!==':
  11170. if (typeof a === 'object')
  11171. a = a.version
  11172. if (typeof b === 'object')
  11173. b = b.version
  11174. return a !== b
  11175. case '':
  11176. case '=':
  11177. case '==':
  11178. return eq(a, b, loose)
  11179. case '!=':
  11180. return neq(a, b, loose)
  11181. case '>':
  11182. return gt(a, b, loose)
  11183. case '>=':
  11184. return gte(a, b, loose)
  11185. case '<':
  11186. return lt(a, b, loose)
  11187. case '<=':
  11188. return lte(a, b, loose)
  11189. default:
  11190. throw new TypeError('Invalid operator: ' + op)
  11191. }
  11192. }
  11193. exports.Comparator = Comparator
  11194. function Comparator (comp, options) {
  11195. if (!options || typeof options !== 'object') {
  11196. options = {
  11197. loose: !!options,
  11198. includePrerelease: false
  11199. }
  11200. }
  11201. if (comp instanceof Comparator) {
  11202. if (comp.loose === !!options.loose) {
  11203. return comp
  11204. } else {
  11205. comp = comp.value
  11206. }
  11207. }
  11208. if (!(this instanceof Comparator)) {
  11209. return new Comparator(comp, options)
  11210. }
  11211. debug('comparator', comp, options)
  11212. this.options = options
  11213. this.loose = !!options.loose
  11214. this.parse(comp)
  11215. if (this.semver === ANY) {
  11216. this.value = ''
  11217. } else {
  11218. this.value = this.operator + this.semver.version
  11219. }
  11220. debug('comp', this)
  11221. }
  11222. var ANY = {}
  11223. Comparator.prototype.parse = function (comp) {
  11224. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11225. var m = comp.match(r)
  11226. if (!m) {
  11227. throw new TypeError('Invalid comparator: ' + comp)
  11228. }
  11229. this.operator = m[1] !== undefined ? m[1] : ''
  11230. if (this.operator === '=') {
  11231. this.operator = ''
  11232. }
  11233. // if it literally is just '>' or '' then allow anything.
  11234. if (!m[2]) {
  11235. this.semver = ANY
  11236. } else {
  11237. this.semver = new SemVer(m[2], this.options.loose)
  11238. }
  11239. }
  11240. Comparator.prototype.toString = function () {
  11241. return this.value
  11242. }
  11243. Comparator.prototype.test = function (version) {
  11244. debug('Comparator.test', version, this.options.loose)
  11245. if (this.semver === ANY || version === ANY) {
  11246. return true
  11247. }
  11248. if (typeof version === 'string') {
  11249. try {
  11250. version = new SemVer(version, this.options)
  11251. } catch (er) {
  11252. return false
  11253. }
  11254. }
  11255. return cmp(version, this.operator, this.semver, this.options)
  11256. }
  11257. Comparator.prototype.intersects = function (comp, options) {
  11258. if (!(comp instanceof Comparator)) {
  11259. throw new TypeError('a Comparator is required')
  11260. }
  11261. if (!options || typeof options !== 'object') {
  11262. options = {
  11263. loose: !!options,
  11264. includePrerelease: false
  11265. }
  11266. }
  11267. var rangeTmp
  11268. if (this.operator === '') {
  11269. if (this.value === '') {
  11270. return true
  11271. }
  11272. rangeTmp = new Range(comp.value, options)
  11273. return satisfies(this.value, rangeTmp, options)
  11274. } else if (comp.operator === '') {
  11275. if (comp.value === '') {
  11276. return true
  11277. }
  11278. rangeTmp = new Range(this.value, options)
  11279. return satisfies(comp.semver, rangeTmp, options)
  11280. }
  11281. var sameDirectionIncreasing =
  11282. (this.operator === '>=' || this.operator === '>') &&
  11283. (comp.operator === '>=' || comp.operator === '>')
  11284. var sameDirectionDecreasing =
  11285. (this.operator === '<=' || this.operator === '<') &&
  11286. (comp.operator === '<=' || comp.operator === '<')
  11287. var sameSemVer = this.semver.version === comp.semver.version
  11288. var differentDirectionsInclusive =
  11289. (this.operator === '>=' || this.operator === '<=') &&
  11290. (comp.operator === '>=' || comp.operator === '<=')
  11291. var oppositeDirectionsLessThan =
  11292. cmp(this.semver, '<', comp.semver, options) &&
  11293. ((this.operator === '>=' || this.operator === '>') &&
  11294. (comp.operator === '<=' || comp.operator === '<'))
  11295. var oppositeDirectionsGreaterThan =
  11296. cmp(this.semver, '>', comp.semver, options) &&
  11297. ((this.operator === '<=' || this.operator === '<') &&
  11298. (comp.operator === '>=' || comp.operator === '>'))
  11299. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11300. (sameSemVer && differentDirectionsInclusive) ||
  11301. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11302. }
  11303. exports.Range = Range
  11304. function Range (range, options) {
  11305. if (!options || typeof options !== 'object') {
  11306. options = {
  11307. loose: !!options,
  11308. includePrerelease: false
  11309. }
  11310. }
  11311. if (range instanceof Range) {
  11312. if (range.loose === !!options.loose &&
  11313. range.includePrerelease === !!options.includePrerelease) {
  11314. return range
  11315. } else {
  11316. return new Range(range.raw, options)
  11317. }
  11318. }
  11319. if (range instanceof Comparator) {
  11320. return new Range(range.value, options)
  11321. }
  11322. if (!(this instanceof Range)) {
  11323. return new Range(range, options)
  11324. }
  11325. this.options = options
  11326. this.loose = !!options.loose
  11327. this.includePrerelease = !!options.includePrerelease
  11328. // First, split based on boolean or ||
  11329. this.raw = range
  11330. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11331. return this.parseRange(range.trim())
  11332. }, this).filter(function (c) {
  11333. // throw out any that are not relevant for whatever reason
  11334. return c.length
  11335. })
  11336. if (!this.set.length) {
  11337. throw new TypeError('Invalid SemVer Range: ' + range)
  11338. }
  11339. this.format()
  11340. }
  11341. Range.prototype.format = function () {
  11342. this.range = this.set.map(function (comps) {
  11343. return comps.join(' ').trim()
  11344. }).join('||').trim()
  11345. return this.range
  11346. }
  11347. Range.prototype.toString = function () {
  11348. return this.range
  11349. }
  11350. Range.prototype.parseRange = function (range) {
  11351. var loose = this.options.loose
  11352. range = range.trim()
  11353. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11354. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11355. range = range.replace(hr, hyphenReplace)
  11356. debug('hyphen replace', range)
  11357. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11358. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11359. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11360. // `~ 1.2.3` => `~1.2.3`
  11361. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11362. // `^ 1.2.3` => `^1.2.3`
  11363. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11364. // normalize spaces
  11365. range = range.split(/\s+/).join(' ')
  11366. // At this point, the range is completely trimmed and
  11367. // ready to be split into comparators.
  11368. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11369. var set = range.split(' ').map(function (comp) {
  11370. return parseComparator(comp, this.options)
  11371. }, this).join(' ').split(/\s+/)
  11372. if (this.options.loose) {
  11373. // in loose mode, throw out any that are not valid comparators
  11374. set = set.filter(function (comp) {
  11375. return !!comp.match(compRe)
  11376. })
  11377. }
  11378. set = set.map(function (comp) {
  11379. return new Comparator(comp, this.options)
  11380. }, this)
  11381. return set
  11382. }
  11383. Range.prototype.intersects = function (range, options) {
  11384. if (!(range instanceof Range)) {
  11385. throw new TypeError('a Range is required')
  11386. }
  11387. return this.set.some(function (thisComparators) {
  11388. return (
  11389. isSatisfiable(thisComparators, options) &&
  11390. range.set.some(function (rangeComparators) {
  11391. return (
  11392. isSatisfiable(rangeComparators, options) &&
  11393. thisComparators.every(function (thisComparator) {
  11394. return rangeComparators.every(function (rangeComparator) {
  11395. return thisComparator.intersects(rangeComparator, options)
  11396. })
  11397. })
  11398. )
  11399. })
  11400. )
  11401. })
  11402. }
  11403. // take a set of comparators and determine whether there
  11404. // exists a version which can satisfy it
  11405. function isSatisfiable (comparators, options) {
  11406. var result = true
  11407. var remainingComparators = comparators.slice()
  11408. var testComparator = remainingComparators.pop()
  11409. while (result && remainingComparators.length) {
  11410. result = remainingComparators.every(function (otherComparator) {
  11411. return testComparator.intersects(otherComparator, options)
  11412. })
  11413. testComparator = remainingComparators.pop()
  11414. }
  11415. return result
  11416. }
  11417. // Mostly just for testing and legacy API reasons
  11418. exports.toComparators = toComparators
  11419. function toComparators (range, options) {
  11420. return new Range(range, options).set.map(function (comp) {
  11421. return comp.map(function (c) {
  11422. return c.value
  11423. }).join(' ').trim().split(' ')
  11424. })
  11425. }
  11426. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11427. // already replaced the hyphen ranges
  11428. // turn into a set of JUST comparators.
  11429. function parseComparator (comp, options) {
  11430. debug('comp', comp, options)
  11431. comp = replaceCarets(comp, options)
  11432. debug('caret', comp)
  11433. comp = replaceTildes(comp, options)
  11434. debug('tildes', comp)
  11435. comp = replaceXRanges(comp, options)
  11436. debug('xrange', comp)
  11437. comp = replaceStars(comp, options)
  11438. debug('stars', comp)
  11439. return comp
  11440. }
  11441. function isX (id) {
  11442. return !id || id.toLowerCase() === 'x' || id === '*'
  11443. }
  11444. // ~, ~> --> * (any, kinda silly)
  11445. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11446. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11447. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11448. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11449. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11450. function replaceTildes (comp, options) {
  11451. return comp.trim().split(/\s+/).map(function (comp) {
  11452. return replaceTilde(comp, options)
  11453. }).join(' ')
  11454. }
  11455. function replaceTilde (comp, options) {
  11456. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11457. return comp.replace(r, function (_, M, m, p, pr) {
  11458. debug('tilde', comp, _, M, m, p, pr)
  11459. var ret
  11460. if (isX(M)) {
  11461. ret = ''
  11462. } else if (isX(m)) {
  11463. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11464. } else if (isX(p)) {
  11465. // ~1.2 == >=1.2.0 <1.3.0
  11466. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11467. } else if (pr) {
  11468. debug('replaceTilde pr', pr)
  11469. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11470. ' <' + M + '.' + (+m + 1) + '.0'
  11471. } else {
  11472. // ~1.2.3 == >=1.2.3 <1.3.0
  11473. ret = '>=' + M + '.' + m + '.' + p +
  11474. ' <' + M + '.' + (+m + 1) + '.0'
  11475. }
  11476. debug('tilde return', ret)
  11477. return ret
  11478. })
  11479. }
  11480. // ^ --> * (any, kinda silly)
  11481. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11482. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11483. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11484. // ^1.2.3 --> >=1.2.3 <2.0.0
  11485. // ^1.2.0 --> >=1.2.0 <2.0.0
  11486. function replaceCarets (comp, options) {
  11487. return comp.trim().split(/\s+/).map(function (comp) {
  11488. return replaceCaret(comp, options)
  11489. }).join(' ')
  11490. }
  11491. function replaceCaret (comp, options) {
  11492. debug('caret', comp, options)
  11493. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11494. return comp.replace(r, function (_, M, m, p, pr) {
  11495. debug('caret', comp, _, M, m, p, pr)
  11496. var ret
  11497. if (isX(M)) {
  11498. ret = ''
  11499. } else if (isX(m)) {
  11500. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11501. } else if (isX(p)) {
  11502. if (M === '0') {
  11503. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11504. } else {
  11505. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11506. }
  11507. } else if (pr) {
  11508. debug('replaceCaret pr', pr)
  11509. if (M === '0') {
  11510. if (m === '0') {
  11511. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11512. ' <' + M + '.' + m + '.' + (+p + 1)
  11513. } else {
  11514. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11515. ' <' + M + '.' + (+m + 1) + '.0'
  11516. }
  11517. } else {
  11518. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11519. ' <' + (+M + 1) + '.0.0'
  11520. }
  11521. } else {
  11522. debug('no pr')
  11523. if (M === '0') {
  11524. if (m === '0') {
  11525. ret = '>=' + M + '.' + m + '.' + p +
  11526. ' <' + M + '.' + m + '.' + (+p + 1)
  11527. } else {
  11528. ret = '>=' + M + '.' + m + '.' + p +
  11529. ' <' + M + '.' + (+m + 1) + '.0'
  11530. }
  11531. } else {
  11532. ret = '>=' + M + '.' + m + '.' + p +
  11533. ' <' + (+M + 1) + '.0.0'
  11534. }
  11535. }
  11536. debug('caret return', ret)
  11537. return ret
  11538. })
  11539. }
  11540. function replaceXRanges (comp, options) {
  11541. debug('replaceXRanges', comp, options)
  11542. return comp.split(/\s+/).map(function (comp) {
  11543. return replaceXRange(comp, options)
  11544. }).join(' ')
  11545. }
  11546. function replaceXRange (comp, options) {
  11547. comp = comp.trim()
  11548. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11549. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11550. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11551. var xM = isX(M)
  11552. var xm = xM || isX(m)
  11553. var xp = xm || isX(p)
  11554. var anyX = xp
  11555. if (gtlt === '=' && anyX) {
  11556. gtlt = ''
  11557. }
  11558. // if we're including prereleases in the match, then we need
  11559. // to fix this to -0, the lowest possible prerelease value
  11560. pr = options.includePrerelease ? '-0' : ''
  11561. if (xM) {
  11562. if (gtlt === '>' || gtlt === '<') {
  11563. // nothing is allowed
  11564. ret = '<0.0.0-0'
  11565. } else {
  11566. // nothing is forbidden
  11567. ret = '*'
  11568. }
  11569. } else if (gtlt && anyX) {
  11570. // we know patch is an x, because we have any x at all.
  11571. // replace X with 0
  11572. if (xm) {
  11573. m = 0
  11574. }
  11575. p = 0
  11576. if (gtlt === '>') {
  11577. // >1 => >=2.0.0
  11578. // >1.2 => >=1.3.0
  11579. // >1.2.3 => >= 1.2.4
  11580. gtlt = '>='
  11581. if (xm) {
  11582. M = +M + 1
  11583. m = 0
  11584. p = 0
  11585. } else {
  11586. m = +m + 1
  11587. p = 0
  11588. }
  11589. } else if (gtlt === '<=') {
  11590. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11591. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11592. gtlt = '<'
  11593. if (xm) {
  11594. M = +M + 1
  11595. } else {
  11596. m = +m + 1
  11597. }
  11598. }
  11599. ret = gtlt + M + '.' + m + '.' + p + pr
  11600. } else if (xm) {
  11601. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11602. } else if (xp) {
  11603. ret = '>=' + M + '.' + m + '.0' + pr +
  11604. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11605. }
  11606. debug('xRange return', ret)
  11607. return ret
  11608. })
  11609. }
  11610. // Because * is AND-ed with everything else in the comparator,
  11611. // and '' means "any version", just remove the *s entirely.
  11612. function replaceStars (comp, options) {
  11613. debug('replaceStars', comp, options)
  11614. // Looseness is ignored here. star is always as loose as it gets!
  11615. return comp.trim().replace(re[t.STAR], '')
  11616. }
  11617. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11618. // M, m, patch, prerelease, build
  11619. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11620. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11621. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11622. function hyphenReplace ($0,
  11623. from, fM, fm, fp, fpr, fb,
  11624. to, tM, tm, tp, tpr, tb) {
  11625. if (isX(fM)) {
  11626. from = ''
  11627. } else if (isX(fm)) {
  11628. from = '>=' + fM + '.0.0'
  11629. } else if (isX(fp)) {
  11630. from = '>=' + fM + '.' + fm + '.0'
  11631. } else {
  11632. from = '>=' + from
  11633. }
  11634. if (isX(tM)) {
  11635. to = ''
  11636. } else if (isX(tm)) {
  11637. to = '<' + (+tM + 1) + '.0.0'
  11638. } else if (isX(tp)) {
  11639. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11640. } else if (tpr) {
  11641. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11642. } else {
  11643. to = '<=' + to
  11644. }
  11645. return (from + ' ' + to).trim()
  11646. }
  11647. // if ANY of the sets match ALL of its comparators, then pass
  11648. Range.prototype.test = function (version) {
  11649. if (!version) {
  11650. return false
  11651. }
  11652. if (typeof version === 'string') {
  11653. try {
  11654. version = new SemVer(version, this.options)
  11655. } catch (er) {
  11656. return false
  11657. }
  11658. }
  11659. for (var i = 0; i < this.set.length; i++) {
  11660. if (testSet(this.set[i], version, this.options)) {
  11661. return true
  11662. }
  11663. }
  11664. return false
  11665. }
  11666. function testSet (set, version, options) {
  11667. for (var i = 0; i < set.length; i++) {
  11668. if (!set[i].test(version)) {
  11669. return false
  11670. }
  11671. }
  11672. if (version.prerelease.length && !options.includePrerelease) {
  11673. // Find the set of versions that are allowed to have prereleases
  11674. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11675. // That should allow `1.2.3-pr.2` to pass.
  11676. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11677. // even though it's within the range set by the comparators.
  11678. for (i = 0; i < set.length; i++) {
  11679. debug(set[i].semver)
  11680. if (set[i].semver === ANY) {
  11681. continue
  11682. }
  11683. if (set[i].semver.prerelease.length > 0) {
  11684. var allowed = set[i].semver
  11685. if (allowed.major === version.major &&
  11686. allowed.minor === version.minor &&
  11687. allowed.patch === version.patch) {
  11688. return true
  11689. }
  11690. }
  11691. }
  11692. // Version has a -pre, but it's not one of the ones we like.
  11693. return false
  11694. }
  11695. return true
  11696. }
  11697. exports.satisfies = satisfies
  11698. function satisfies (version, range, options) {
  11699. try {
  11700. range = new Range(range, options)
  11701. } catch (er) {
  11702. return false
  11703. }
  11704. return range.test(version)
  11705. }
  11706. exports.maxSatisfying = maxSatisfying
  11707. function maxSatisfying (versions, range, options) {
  11708. var max = null
  11709. var maxSV = null
  11710. try {
  11711. var rangeObj = new Range(range, options)
  11712. } catch (er) {
  11713. return null
  11714. }
  11715. versions.forEach(function (v) {
  11716. if (rangeObj.test(v)) {
  11717. // satisfies(v, range, options)
  11718. if (!max || maxSV.compare(v) === -1) {
  11719. // compare(max, v, true)
  11720. max = v
  11721. maxSV = new SemVer(max, options)
  11722. }
  11723. }
  11724. })
  11725. return max
  11726. }
  11727. exports.minSatisfying = minSatisfying
  11728. function minSatisfying (versions, range, options) {
  11729. var min = null
  11730. var minSV = null
  11731. try {
  11732. var rangeObj = new Range(range, options)
  11733. } catch (er) {
  11734. return null
  11735. }
  11736. versions.forEach(function (v) {
  11737. if (rangeObj.test(v)) {
  11738. // satisfies(v, range, options)
  11739. if (!min || minSV.compare(v) === 1) {
  11740. // compare(min, v, true)
  11741. min = v
  11742. minSV = new SemVer(min, options)
  11743. }
  11744. }
  11745. })
  11746. return min
  11747. }
  11748. exports.minVersion = minVersion
  11749. function minVersion (range, loose) {
  11750. range = new Range(range, loose)
  11751. var minver = new SemVer('0.0.0')
  11752. if (range.test(minver)) {
  11753. return minver
  11754. }
  11755. minver = new SemVer('0.0.0-0')
  11756. if (range.test(minver)) {
  11757. return minver
  11758. }
  11759. minver = null
  11760. for (var i = 0; i < range.set.length; ++i) {
  11761. var comparators = range.set[i]
  11762. comparators.forEach(function (comparator) {
  11763. // Clone to avoid manipulating the comparator's semver object.
  11764. var compver = new SemVer(comparator.semver.version)
  11765. switch (comparator.operator) {
  11766. case '>':
  11767. if (compver.prerelease.length === 0) {
  11768. compver.patch++
  11769. } else {
  11770. compver.prerelease.push(0)
  11771. }
  11772. compver.raw = compver.format()
  11773. /* fallthrough */
  11774. case '':
  11775. case '>=':
  11776. if (!minver || gt(minver, compver)) {
  11777. minver = compver
  11778. }
  11779. break
  11780. case '<':
  11781. case '<=':
  11782. /* Ignore maximum versions */
  11783. break
  11784. /* istanbul ignore next */
  11785. default:
  11786. throw new Error('Unexpected operation: ' + comparator.operator)
  11787. }
  11788. })
  11789. }
  11790. if (minver && range.test(minver)) {
  11791. return minver
  11792. }
  11793. return null
  11794. }
  11795. exports.validRange = validRange
  11796. function validRange (range, options) {
  11797. try {
  11798. // Return '*' instead of '' so that truthiness works.
  11799. // This will throw if it's invalid anyway
  11800. return new Range(range, options).range || '*'
  11801. } catch (er) {
  11802. return null
  11803. }
  11804. }
  11805. // Determine if version is less than all the versions possible in the range
  11806. exports.ltr = ltr
  11807. function ltr (version, range, options) {
  11808. return outside(version, range, '<', options)
  11809. }
  11810. // Determine if version is greater than all the versions possible in the range.
  11811. exports.gtr = gtr
  11812. function gtr (version, range, options) {
  11813. return outside(version, range, '>', options)
  11814. }
  11815. exports.outside = outside
  11816. function outside (version, range, hilo, options) {
  11817. version = new SemVer(version, options)
  11818. range = new Range(range, options)
  11819. var gtfn, ltefn, ltfn, comp, ecomp
  11820. switch (hilo) {
  11821. case '>':
  11822. gtfn = gt
  11823. ltefn = lte
  11824. ltfn = lt
  11825. comp = '>'
  11826. ecomp = '>='
  11827. break
  11828. case '<':
  11829. gtfn = lt
  11830. ltefn = gte
  11831. ltfn = gt
  11832. comp = '<'
  11833. ecomp = '<='
  11834. break
  11835. default:
  11836. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11837. }
  11838. // If it satisifes the range it is not outside
  11839. if (satisfies(version, range, options)) {
  11840. return false
  11841. }
  11842. // From now on, variable terms are as if we're in "gtr" mode.
  11843. // but note that everything is flipped for the "ltr" function.
  11844. for (var i = 0; i < range.set.length; ++i) {
  11845. var comparators = range.set[i]
  11846. var high = null
  11847. var low = null
  11848. comparators.forEach(function (comparator) {
  11849. if (comparator.semver === ANY) {
  11850. comparator = new Comparator('>=0.0.0')
  11851. }
  11852. high = high || comparator
  11853. low = low || comparator
  11854. if (gtfn(comparator.semver, high.semver, options)) {
  11855. high = comparator
  11856. } else if (ltfn(comparator.semver, low.semver, options)) {
  11857. low = comparator
  11858. }
  11859. })
  11860. // If the edge version comparator has a operator then our version
  11861. // isn't outside it
  11862. if (high.operator === comp || high.operator === ecomp) {
  11863. return false
  11864. }
  11865. // If the lowest version comparator has an operator and our version
  11866. // is less than it then it isn't higher than the range
  11867. if ((!low.operator || low.operator === comp) &&
  11868. ltefn(version, low.semver)) {
  11869. return false
  11870. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11871. return false
  11872. }
  11873. }
  11874. return true
  11875. }
  11876. exports.prerelease = prerelease
  11877. function prerelease (version, options) {
  11878. var parsed = parse(version, options)
  11879. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11880. }
  11881. exports.intersects = intersects
  11882. function intersects (r1, r2, options) {
  11883. r1 = new Range(r1, options)
  11884. r2 = new Range(r2, options)
  11885. return r1.intersects(r2)
  11886. }
  11887. exports.coerce = coerce
  11888. function coerce (version, options) {
  11889. if (version instanceof SemVer) {
  11890. return version
  11891. }
  11892. if (typeof version === 'number') {
  11893. version = String(version)
  11894. }
  11895. if (typeof version !== 'string') {
  11896. return null
  11897. }
  11898. options = options || {}
  11899. var match = null
  11900. if (!options.rtl) {
  11901. match = version.match(re[t.COERCE])
  11902. } else {
  11903. // Find the right-most coercible string that does not share
  11904. // a terminus with a more left-ward coercible string.
  11905. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11906. //
  11907. // Walk through the string checking with a /g regexp
  11908. // Manually set the index so as to pick up overlapping matches.
  11909. // Stop when we get a match that ends at the string end, since no
  11910. // coercible string can be more right-ward without the same terminus.
  11911. var next
  11912. while ((next = re[t.COERCERTL].exec(version)) &&
  11913. (!match || match.index + match[0].length !== version.length)
  11914. ) {
  11915. if (!match ||
  11916. next.index + next[0].length !== match.index + match[0].length) {
  11917. match = next
  11918. }
  11919. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11920. }
  11921. // leave it in a clean state
  11922. re[t.COERCERTL].lastIndex = -1
  11923. }
  11924. if (match === null) {
  11925. return null
  11926. }
  11927. return parse(match[2] +
  11928. '.' + (match[3] || '0') +
  11929. '.' + (match[4] || '0'), options)
  11930. }
  11931. /***/ }),
  11932. /***/ 669:
  11933. /***/ (function(module) {
  11934. module.exports = require("util");
  11935. /***/ }),
  11936. /***/ 672:
  11937. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11938. "use strict";
  11939. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11940. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11941. return new (P || (P = Promise))(function (resolve, reject) {
  11942. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11943. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11944. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11945. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11946. });
  11947. };
  11948. var _a;
  11949. Object.defineProperty(exports, "__esModule", { value: true });
  11950. const assert_1 = __webpack_require__(357);
  11951. const fs = __webpack_require__(747);
  11952. const path = __webpack_require__(622);
  11953. _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;
  11954. exports.IS_WINDOWS = process.platform === 'win32';
  11955. function exists(fsPath) {
  11956. return __awaiter(this, void 0, void 0, function* () {
  11957. try {
  11958. yield exports.stat(fsPath);
  11959. }
  11960. catch (err) {
  11961. if (err.code === 'ENOENT') {
  11962. return false;
  11963. }
  11964. throw err;
  11965. }
  11966. return true;
  11967. });
  11968. }
  11969. exports.exists = exists;
  11970. function isDirectory(fsPath, useStat = false) {
  11971. return __awaiter(this, void 0, void 0, function* () {
  11972. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11973. return stats.isDirectory();
  11974. });
  11975. }
  11976. exports.isDirectory = isDirectory;
  11977. /**
  11978. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11979. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11980. */
  11981. function isRooted(p) {
  11982. p = normalizeSeparators(p);
  11983. if (!p) {
  11984. throw new Error('isRooted() parameter "p" cannot be empty');
  11985. }
  11986. if (exports.IS_WINDOWS) {
  11987. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11988. ); // e.g. C: or C:\hello
  11989. }
  11990. return p.startsWith('/');
  11991. }
  11992. exports.isRooted = isRooted;
  11993. /**
  11994. * Recursively create a directory at `fsPath`.
  11995. *
  11996. * This implementation is optimistic, meaning it attempts to create the full
  11997. * path first, and backs up the path stack from there.
  11998. *
  11999. * @param fsPath The path to create
  12000. * @param maxDepth The maximum recursion depth
  12001. * @param depth The current recursion depth
  12002. */
  12003. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  12004. return __awaiter(this, void 0, void 0, function* () {
  12005. assert_1.ok(fsPath, 'a path argument must be provided');
  12006. fsPath = path.resolve(fsPath);
  12007. if (depth >= maxDepth)
  12008. return exports.mkdir(fsPath);
  12009. try {
  12010. yield exports.mkdir(fsPath);
  12011. return;
  12012. }
  12013. catch (err) {
  12014. switch (err.code) {
  12015. case 'ENOENT': {
  12016. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  12017. yield exports.mkdir(fsPath);
  12018. return;
  12019. }
  12020. default: {
  12021. let stats;
  12022. try {
  12023. stats = yield exports.stat(fsPath);
  12024. }
  12025. catch (err2) {
  12026. throw err;
  12027. }
  12028. if (!stats.isDirectory())
  12029. throw err;
  12030. }
  12031. }
  12032. }
  12033. });
  12034. }
  12035. exports.mkdirP = mkdirP;
  12036. /**
  12037. * Best effort attempt to determine whether a file exists and is executable.
  12038. * @param filePath file path to check
  12039. * @param extensions additional file extensions to try
  12040. * @return if file exists and is executable, returns the file path. otherwise empty string.
  12041. */
  12042. function tryGetExecutablePath(filePath, extensions) {
  12043. return __awaiter(this, void 0, void 0, function* () {
  12044. let stats = undefined;
  12045. try {
  12046. // test file exists
  12047. stats = yield exports.stat(filePath);
  12048. }
  12049. catch (err) {
  12050. if (err.code !== 'ENOENT') {
  12051. // eslint-disable-next-line no-console
  12052. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  12053. }
  12054. }
  12055. if (stats && stats.isFile()) {
  12056. if (exports.IS_WINDOWS) {
  12057. // on Windows, test for valid extension
  12058. const upperExt = path.extname(filePath).toUpperCase();
  12059. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  12060. return filePath;
  12061. }
  12062. }
  12063. else {
  12064. if (isUnixExecutable(stats)) {
  12065. return filePath;
  12066. }
  12067. }
  12068. }
  12069. // try each extension
  12070. const originalFilePath = filePath;
  12071. for (const extension of extensions) {
  12072. filePath = originalFilePath + extension;
  12073. stats = undefined;
  12074. try {
  12075. stats = yield exports.stat(filePath);
  12076. }
  12077. catch (err) {
  12078. if (err.code !== 'ENOENT') {
  12079. // eslint-disable-next-line no-console
  12080. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  12081. }
  12082. }
  12083. if (stats && stats.isFile()) {
  12084. if (exports.IS_WINDOWS) {
  12085. // preserve the case of the actual file (since an extension was appended)
  12086. try {
  12087. const directory = path.dirname(filePath);
  12088. const upperName = path.basename(filePath).toUpperCase();
  12089. for (const actualName of yield exports.readdir(directory)) {
  12090. if (upperName === actualName.toUpperCase()) {
  12091. filePath = path.join(directory, actualName);
  12092. break;
  12093. }
  12094. }
  12095. }
  12096. catch (err) {
  12097. // eslint-disable-next-line no-console
  12098. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  12099. }
  12100. return filePath;
  12101. }
  12102. else {
  12103. if (isUnixExecutable(stats)) {
  12104. return filePath;
  12105. }
  12106. }
  12107. }
  12108. }
  12109. return '';
  12110. });
  12111. }
  12112. exports.tryGetExecutablePath = tryGetExecutablePath;
  12113. function normalizeSeparators(p) {
  12114. p = p || '';
  12115. if (exports.IS_WINDOWS) {
  12116. // convert slashes on Windows
  12117. p = p.replace(/\//g, '\\');
  12118. // remove redundant slashes
  12119. return p.replace(/\\\\+/g, '\\');
  12120. }
  12121. // remove redundant slashes
  12122. return p.replace(/\/\/+/g, '/');
  12123. }
  12124. // on Mac/Linux, test the execute bit
  12125. // R W X R W X R W X
  12126. // 256 128 64 32 16 8 4 2 1
  12127. function isUnixExecutable(stats) {
  12128. return ((stats.mode & 1) > 0 ||
  12129. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  12130. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  12131. }
  12132. //# sourceMappingURL=io-util.js.map
  12133. /***/ }),
  12134. /***/ 674:
  12135. /***/ (function(module, __unusedexports, __webpack_require__) {
  12136. module.exports = authenticate;
  12137. const { Deprecation } = __webpack_require__(692);
  12138. const once = __webpack_require__(969);
  12139. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  12140. function authenticate(state, options) {
  12141. deprecateAuthenticate(
  12142. state.octokit.log,
  12143. new Deprecation(
  12144. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  12145. )
  12146. );
  12147. if (!options) {
  12148. state.auth = false;
  12149. return;
  12150. }
  12151. switch (options.type) {
  12152. case "basic":
  12153. if (!options.username || !options.password) {
  12154. throw new Error(
  12155. "Basic authentication requires both a username and password to be set"
  12156. );
  12157. }
  12158. break;
  12159. case "oauth":
  12160. if (!options.token && !(options.key && options.secret)) {
  12161. throw new Error(
  12162. "OAuth2 authentication requires a token or key & secret to be set"
  12163. );
  12164. }
  12165. break;
  12166. case "token":
  12167. case "app":
  12168. if (!options.token) {
  12169. throw new Error("Token authentication requires a token to be set");
  12170. }
  12171. break;
  12172. default:
  12173. throw new Error(
  12174. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  12175. );
  12176. }
  12177. state.auth = options;
  12178. }
  12179. /***/ }),
  12180. /***/ 675:
  12181. /***/ (function(module) {
  12182. module.exports = function btoa(str) {
  12183. return new Buffer(str).toString('base64')
  12184. }
  12185. /***/ }),
  12186. /***/ 692:
  12187. /***/ (function(__unusedmodule, exports) {
  12188. "use strict";
  12189. Object.defineProperty(exports, '__esModule', { value: true });
  12190. class Deprecation extends Error {
  12191. constructor(message) {
  12192. super(message); // Maintains proper stack trace (only available on V8)
  12193. /* istanbul ignore next */
  12194. if (Error.captureStackTrace) {
  12195. Error.captureStackTrace(this, this.constructor);
  12196. }
  12197. this.name = 'Deprecation';
  12198. }
  12199. }
  12200. exports.Deprecation = Deprecation;
  12201. /***/ }),
  12202. /***/ 696:
  12203. /***/ (function(module) {
  12204. "use strict";
  12205. /*!
  12206. * isobject <https://github.com/jonschlinkert/isobject>
  12207. *
  12208. * Copyright (c) 2014-2017, Jon Schlinkert.
  12209. * Released under the MIT License.
  12210. */
  12211. function isObject(val) {
  12212. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  12213. }
  12214. /*!
  12215. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  12216. *
  12217. * Copyright (c) 2014-2017, Jon Schlinkert.
  12218. * Released under the MIT License.
  12219. */
  12220. function isObjectObject(o) {
  12221. return isObject(o) === true
  12222. && Object.prototype.toString.call(o) === '[object Object]';
  12223. }
  12224. function isPlainObject(o) {
  12225. var ctor,prot;
  12226. if (isObjectObject(o) === false) return false;
  12227. // If has modified constructor
  12228. ctor = o.constructor;
  12229. if (typeof ctor !== 'function') return false;
  12230. // If has modified prototype
  12231. prot = ctor.prototype;
  12232. if (isObjectObject(prot) === false) return false;
  12233. // If constructor does not have an Object-specific method
  12234. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12235. return false;
  12236. }
  12237. // Most likely a plain Object
  12238. return true;
  12239. }
  12240. module.exports = isPlainObject;
  12241. /***/ }),
  12242. /***/ 697:
  12243. /***/ (function(module) {
  12244. "use strict";
  12245. module.exports = (promise, onFinally) => {
  12246. onFinally = onFinally || (() => {});
  12247. return promise.then(
  12248. val => new Promise(resolve => {
  12249. resolve(onFinally());
  12250. }).then(() => val),
  12251. err => new Promise(resolve => {
  12252. resolve(onFinally());
  12253. }).then(() => {
  12254. throw err;
  12255. })
  12256. );
  12257. };
  12258. /***/ }),
  12259. /***/ 722:
  12260. /***/ (function(module) {
  12261. /**
  12262. * Convert array of 16 byte values to UUID string format of the form:
  12263. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12264. */
  12265. var byteToHex = [];
  12266. for (var i = 0; i < 256; ++i) {
  12267. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12268. }
  12269. function bytesToUuid(buf, offset) {
  12270. var i = offset || 0;
  12271. var bth = byteToHex;
  12272. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12273. return ([bth[buf[i++]], bth[buf[i++]],
  12274. bth[buf[i++]], bth[buf[i++]], '-',
  12275. bth[buf[i++]], bth[buf[i++]], '-',
  12276. bth[buf[i++]], bth[buf[i++]], '-',
  12277. bth[buf[i++]], bth[buf[i++]], '-',
  12278. bth[buf[i++]], bth[buf[i++]],
  12279. bth[buf[i++]], bth[buf[i++]],
  12280. bth[buf[i++]], bth[buf[i++]]]).join('');
  12281. }
  12282. module.exports = bytesToUuid;
  12283. /***/ }),
  12284. /***/ 742:
  12285. /***/ (function(module, __unusedexports, __webpack_require__) {
  12286. var fs = __webpack_require__(747)
  12287. var core
  12288. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12289. core = __webpack_require__(818)
  12290. } else {
  12291. core = __webpack_require__(197)
  12292. }
  12293. module.exports = isexe
  12294. isexe.sync = sync
  12295. function isexe (path, options, cb) {
  12296. if (typeof options === 'function') {
  12297. cb = options
  12298. options = {}
  12299. }
  12300. if (!cb) {
  12301. if (typeof Promise !== 'function') {
  12302. throw new TypeError('callback not provided')
  12303. }
  12304. return new Promise(function (resolve, reject) {
  12305. isexe(path, options || {}, function (er, is) {
  12306. if (er) {
  12307. reject(er)
  12308. } else {
  12309. resolve(is)
  12310. }
  12311. })
  12312. })
  12313. }
  12314. core(path, options || {}, function (er, is) {
  12315. // ignore EACCES because that just means we aren't allowed to run it
  12316. if (er) {
  12317. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12318. er = null
  12319. is = false
  12320. }
  12321. }
  12322. cb(er, is)
  12323. })
  12324. }
  12325. function sync (path, options) {
  12326. // my kingdom for a filtered catch
  12327. try {
  12328. return core.sync(path, options || {})
  12329. } catch (er) {
  12330. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12331. return false
  12332. } else {
  12333. throw er
  12334. }
  12335. }
  12336. }
  12337. /***/ }),
  12338. /***/ 747:
  12339. /***/ (function(module) {
  12340. module.exports = require("fs");
  12341. /***/ }),
  12342. /***/ 753:
  12343. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12344. "use strict";
  12345. Object.defineProperty(exports, '__esModule', { value: true });
  12346. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12347. var endpoint = __webpack_require__(385);
  12348. var universalUserAgent = __webpack_require__(211);
  12349. var isPlainObject = _interopDefault(__webpack_require__(696));
  12350. var nodeFetch = _interopDefault(__webpack_require__(454));
  12351. var requestError = __webpack_require__(463);
  12352. const VERSION = "5.4.2";
  12353. function getBufferResponse(response) {
  12354. return response.arrayBuffer();
  12355. }
  12356. function fetchWrapper(requestOptions) {
  12357. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12358. requestOptions.body = JSON.stringify(requestOptions.body);
  12359. }
  12360. let headers = {};
  12361. let status;
  12362. let url;
  12363. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12364. return fetch(requestOptions.url, Object.assign({
  12365. method: requestOptions.method,
  12366. body: requestOptions.body,
  12367. headers: requestOptions.headers,
  12368. redirect: requestOptions.redirect
  12369. }, requestOptions.request)).then(response => {
  12370. url = response.url;
  12371. status = response.status;
  12372. for (const keyAndValue of response.headers) {
  12373. headers[keyAndValue[0]] = keyAndValue[1];
  12374. }
  12375. if (status === 204 || status === 205) {
  12376. return;
  12377. } // GitHub API returns 200 for HEAD requests
  12378. if (requestOptions.method === "HEAD") {
  12379. if (status < 400) {
  12380. return;
  12381. }
  12382. throw new requestError.RequestError(response.statusText, status, {
  12383. headers,
  12384. request: requestOptions
  12385. });
  12386. }
  12387. if (status === 304) {
  12388. throw new requestError.RequestError("Not modified", status, {
  12389. headers,
  12390. request: requestOptions
  12391. });
  12392. }
  12393. if (status >= 400) {
  12394. return response.text().then(message => {
  12395. const error = new requestError.RequestError(message, status, {
  12396. headers,
  12397. request: requestOptions
  12398. });
  12399. try {
  12400. let responseBody = JSON.parse(error.message);
  12401. Object.assign(error, responseBody);
  12402. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12403. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12404. } catch (e) {// ignore, see octokit/rest.js#684
  12405. }
  12406. throw error;
  12407. });
  12408. }
  12409. const contentType = response.headers.get("content-type");
  12410. if (/application\/json/.test(contentType)) {
  12411. return response.json();
  12412. }
  12413. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12414. return response.text();
  12415. }
  12416. return getBufferResponse(response);
  12417. }).then(data => {
  12418. return {
  12419. status,
  12420. url,
  12421. headers,
  12422. data
  12423. };
  12424. }).catch(error => {
  12425. if (error instanceof requestError.RequestError) {
  12426. throw error;
  12427. }
  12428. throw new requestError.RequestError(error.message, 500, {
  12429. headers,
  12430. request: requestOptions
  12431. });
  12432. });
  12433. }
  12434. function withDefaults(oldEndpoint, newDefaults) {
  12435. const endpoint = oldEndpoint.defaults(newDefaults);
  12436. const newApi = function (route, parameters) {
  12437. const endpointOptions = endpoint.merge(route, parameters);
  12438. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12439. return fetchWrapper(endpoint.parse(endpointOptions));
  12440. }
  12441. const request = (route, parameters) => {
  12442. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12443. };
  12444. Object.assign(request, {
  12445. endpoint,
  12446. defaults: withDefaults.bind(null, endpoint)
  12447. });
  12448. return endpointOptions.request.hook(request, endpointOptions);
  12449. };
  12450. return Object.assign(newApi, {
  12451. endpoint,
  12452. defaults: withDefaults.bind(null, endpoint)
  12453. });
  12454. }
  12455. const request = withDefaults(endpoint.endpoint, {
  12456. headers: {
  12457. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12458. }
  12459. });
  12460. exports.request = request;
  12461. //# sourceMappingURL=index.js.map
  12462. /***/ }),
  12463. /***/ 761:
  12464. /***/ (function(module) {
  12465. module.exports = require("zlib");
  12466. /***/ }),
  12467. /***/ 763:
  12468. /***/ (function(module) {
  12469. module.exports = removeHook
  12470. function removeHook (state, name, method) {
  12471. if (!state.registry[name]) {
  12472. return
  12473. }
  12474. var index = state.registry[name]
  12475. .map(function (registered) { return registered.orig })
  12476. .indexOf(method)
  12477. if (index === -1) {
  12478. return
  12479. }
  12480. state.registry[name].splice(index, 1)
  12481. }
  12482. /***/ }),
  12483. /***/ 768:
  12484. /***/ (function(module) {
  12485. "use strict";
  12486. module.exports = function (x) {
  12487. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12488. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12489. if (x[x.length - 1] === lf) {
  12490. x = x.slice(0, x.length - 1);
  12491. }
  12492. if (x[x.length - 1] === cr) {
  12493. x = x.slice(0, x.length - 1);
  12494. }
  12495. return x;
  12496. };
  12497. /***/ }),
  12498. /***/ 777:
  12499. /***/ (function(module, __unusedexports, __webpack_require__) {
  12500. module.exports = getFirstPage
  12501. const getPage = __webpack_require__(265)
  12502. function getFirstPage (octokit, link, headers) {
  12503. return getPage(octokit, link, 'first', headers)
  12504. }
  12505. /***/ }),
  12506. /***/ 796:
  12507. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12508. "use strict";
  12509. Object.defineProperty(exports, '__esModule', { value: true });
  12510. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12511. var osName = _interopDefault(__webpack_require__(2));
  12512. function getUserAgent() {
  12513. try {
  12514. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12515. } catch (error) {
  12516. if (/wmic os get Caption/.test(error.message)) {
  12517. return "Windows <version undetectable>";
  12518. }
  12519. throw error;
  12520. }
  12521. }
  12522. exports.getUserAgent = getUserAgent;
  12523. //# sourceMappingURL=index.js.map
  12524. /***/ }),
  12525. /***/ 813:
  12526. /***/ (function(__unusedmodule, exports) {
  12527. "use strict";
  12528. Object.defineProperty(exports, '__esModule', { value: true });
  12529. async function auth(token) {
  12530. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12531. return {
  12532. type: "token",
  12533. token: token,
  12534. tokenType
  12535. };
  12536. }
  12537. /**
  12538. * Prefix token for usage in the Authorization header
  12539. *
  12540. * @param token OAuth token or JSON Web Token
  12541. */
  12542. function withAuthorizationPrefix(token) {
  12543. if (token.split(/\./).length === 3) {
  12544. return `bearer ${token}`;
  12545. }
  12546. return `token ${token}`;
  12547. }
  12548. async function hook(token, request, route, parameters) {
  12549. const endpoint = request.endpoint.merge(route, parameters);
  12550. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12551. return request(endpoint);
  12552. }
  12553. const createTokenAuth = function createTokenAuth(token) {
  12554. if (!token) {
  12555. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12556. }
  12557. if (typeof token !== "string") {
  12558. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12559. }
  12560. token = token.replace(/^(token|bearer) +/i, "");
  12561. return Object.assign(auth.bind(null, token), {
  12562. hook: hook.bind(null, token)
  12563. });
  12564. };
  12565. exports.createTokenAuth = createTokenAuth;
  12566. //# sourceMappingURL=index.js.map
  12567. /***/ }),
  12568. /***/ 814:
  12569. /***/ (function(module, __unusedexports, __webpack_require__) {
  12570. module.exports = which
  12571. which.sync = whichSync
  12572. var isWindows = process.platform === 'win32' ||
  12573. process.env.OSTYPE === 'cygwin' ||
  12574. process.env.OSTYPE === 'msys'
  12575. var path = __webpack_require__(622)
  12576. var COLON = isWindows ? ';' : ':'
  12577. var isexe = __webpack_require__(742)
  12578. function getNotFoundError (cmd) {
  12579. var er = new Error('not found: ' + cmd)
  12580. er.code = 'ENOENT'
  12581. return er
  12582. }
  12583. function getPathInfo (cmd, opt) {
  12584. var colon = opt.colon || COLON
  12585. var pathEnv = opt.path || process.env.PATH || ''
  12586. var pathExt = ['']
  12587. pathEnv = pathEnv.split(colon)
  12588. var pathExtExe = ''
  12589. if (isWindows) {
  12590. pathEnv.unshift(process.cwd())
  12591. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12592. pathExt = pathExtExe.split(colon)
  12593. // Always test the cmd itself first. isexe will check to make sure
  12594. // it's found in the pathExt set.
  12595. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12596. pathExt.unshift('')
  12597. }
  12598. // If it has a slash, then we don't bother searching the pathenv.
  12599. // just check the file itself, and that's it.
  12600. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12601. pathEnv = ['']
  12602. return {
  12603. env: pathEnv,
  12604. ext: pathExt,
  12605. extExe: pathExtExe
  12606. }
  12607. }
  12608. function which (cmd, opt, cb) {
  12609. if (typeof opt === 'function') {
  12610. cb = opt
  12611. opt = {}
  12612. }
  12613. var info = getPathInfo(cmd, opt)
  12614. var pathEnv = info.env
  12615. var pathExt = info.ext
  12616. var pathExtExe = info.extExe
  12617. var found = []
  12618. ;(function F (i, l) {
  12619. if (i === l) {
  12620. if (opt.all && found.length)
  12621. return cb(null, found)
  12622. else
  12623. return cb(getNotFoundError(cmd))
  12624. }
  12625. var pathPart = pathEnv[i]
  12626. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12627. pathPart = pathPart.slice(1, -1)
  12628. var p = path.join(pathPart, cmd)
  12629. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12630. p = cmd.slice(0, 2) + p
  12631. }
  12632. ;(function E (ii, ll) {
  12633. if (ii === ll) return F(i + 1, l)
  12634. var ext = pathExt[ii]
  12635. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12636. if (!er && is) {
  12637. if (opt.all)
  12638. found.push(p + ext)
  12639. else
  12640. return cb(null, p + ext)
  12641. }
  12642. return E(ii + 1, ll)
  12643. })
  12644. })(0, pathExt.length)
  12645. })(0, pathEnv.length)
  12646. }
  12647. function whichSync (cmd, opt) {
  12648. opt = opt || {}
  12649. var info = getPathInfo(cmd, opt)
  12650. var pathEnv = info.env
  12651. var pathExt = info.ext
  12652. var pathExtExe = info.extExe
  12653. var found = []
  12654. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12655. var pathPart = pathEnv[i]
  12656. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12657. pathPart = pathPart.slice(1, -1)
  12658. var p = path.join(pathPart, cmd)
  12659. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12660. p = cmd.slice(0, 2) + p
  12661. }
  12662. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12663. var cur = p + pathExt[j]
  12664. var is
  12665. try {
  12666. is = isexe.sync(cur, { pathExt: pathExtExe })
  12667. if (is) {
  12668. if (opt.all)
  12669. found.push(cur)
  12670. else
  12671. return cur
  12672. }
  12673. } catch (ex) {}
  12674. }
  12675. }
  12676. if (opt.all && found.length)
  12677. return found
  12678. if (opt.nothrow)
  12679. return null
  12680. throw getNotFoundError(cmd)
  12681. }
  12682. /***/ }),
  12683. /***/ 816:
  12684. /***/ (function(module) {
  12685. "use strict";
  12686. module.exports = /^#!.*/;
  12687. /***/ }),
  12688. /***/ 818:
  12689. /***/ (function(module, __unusedexports, __webpack_require__) {
  12690. module.exports = isexe
  12691. isexe.sync = sync
  12692. var fs = __webpack_require__(747)
  12693. function checkPathExt (path, options) {
  12694. var pathext = options.pathExt !== undefined ?
  12695. options.pathExt : process.env.PATHEXT
  12696. if (!pathext) {
  12697. return true
  12698. }
  12699. pathext = pathext.split(';')
  12700. if (pathext.indexOf('') !== -1) {
  12701. return true
  12702. }
  12703. for (var i = 0; i < pathext.length; i++) {
  12704. var p = pathext[i].toLowerCase()
  12705. if (p && path.substr(-p.length).toLowerCase() === p) {
  12706. return true
  12707. }
  12708. }
  12709. return false
  12710. }
  12711. function checkStat (stat, path, options) {
  12712. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12713. return false
  12714. }
  12715. return checkPathExt(path, options)
  12716. }
  12717. function isexe (path, options, cb) {
  12718. fs.stat(path, function (er, stat) {
  12719. cb(er, er ? false : checkStat(stat, path, options))
  12720. })
  12721. }
  12722. function sync (path, options) {
  12723. return checkStat(fs.statSync(path), path, options)
  12724. }
  12725. /***/ }),
  12726. /***/ 821:
  12727. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12728. "use strict";
  12729. var __importStar = (this && this.__importStar) || function (mod) {
  12730. if (mod && mod.__esModule) return mod;
  12731. var result = {};
  12732. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12733. result["default"] = mod;
  12734. return result;
  12735. };
  12736. Object.defineProperty(exports, "__esModule", { value: true });
  12737. const core = __importStar(__webpack_require__(470));
  12738. const fsHelper = __importStar(__webpack_require__(618));
  12739. const github = __importStar(__webpack_require__(469));
  12740. const path = __importStar(__webpack_require__(622));
  12741. function getInputs() {
  12742. const result = {};
  12743. // GitHub workspace
  12744. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12745. if (!githubWorkspacePath) {
  12746. throw new Error('GITHUB_WORKSPACE not defined');
  12747. }
  12748. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12749. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12750. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12751. // Qualified repository
  12752. const qualifiedRepository = core.getInput('repository') ||
  12753. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12754. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12755. const splitRepository = qualifiedRepository.split('/');
  12756. if (splitRepository.length !== 2 ||
  12757. !splitRepository[0] ||
  12758. !splitRepository[1]) {
  12759. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12760. }
  12761. result.repositoryOwner = splitRepository[0];
  12762. result.repositoryName = splitRepository[1];
  12763. // Repository path
  12764. result.repositoryPath = core.getInput('path') || '.';
  12765. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12766. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12767. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12768. }
  12769. // Workflow repository?
  12770. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12771. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12772. // Source branch, source version
  12773. result.ref = core.getInput('ref');
  12774. if (!result.ref) {
  12775. if (isWorkflowRepository) {
  12776. result.ref = github.context.ref;
  12777. result.commit = github.context.sha;
  12778. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12779. // the ref is unqualifed like "main" instead of "refs/heads/main".
  12780. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12781. result.ref = `refs/heads/${result.ref}`;
  12782. }
  12783. }
  12784. }
  12785. // SHA?
  12786. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12787. result.commit = result.ref;
  12788. result.ref = '';
  12789. }
  12790. core.debug(`ref = '${result.ref}'`);
  12791. core.debug(`commit = '${result.commit}'`);
  12792. // Clean
  12793. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12794. core.debug(`clean = ${result.clean}`);
  12795. // Fetch depth
  12796. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12797. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12798. result.fetchDepth = 0;
  12799. }
  12800. core.debug(`fetch depth = ${result.fetchDepth}`);
  12801. // LFS
  12802. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12803. core.debug(`lfs = ${result.lfs}`);
  12804. // Submodules
  12805. result.submodules = false;
  12806. result.nestedSubmodules = false;
  12807. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12808. if (submodulesString == 'RECURSIVE') {
  12809. result.submodules = true;
  12810. result.nestedSubmodules = true;
  12811. }
  12812. else if (submodulesString == 'TRUE') {
  12813. result.submodules = true;
  12814. }
  12815. core.debug(`submodules = ${result.submodules}`);
  12816. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12817. // Auth token
  12818. result.authToken = core.getInput('token', { required: true });
  12819. // SSH
  12820. result.sshKey = core.getInput('ssh-key');
  12821. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12822. result.sshStrict =
  12823. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12824. // Persist credentials
  12825. result.persistCredentials =
  12826. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12827. return result;
  12828. }
  12829. exports.getInputs = getInputs;
  12830. /***/ }),
  12831. /***/ 826:
  12832. /***/ (function(module, __unusedexports, __webpack_require__) {
  12833. var rng = __webpack_require__(139);
  12834. var bytesToUuid = __webpack_require__(722);
  12835. function v4(options, buf, offset) {
  12836. var i = buf && offset || 0;
  12837. if (typeof(options) == 'string') {
  12838. buf = options === 'binary' ? new Array(16) : null;
  12839. options = null;
  12840. }
  12841. options = options || {};
  12842. var rnds = options.random || (options.rng || rng)();
  12843. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12844. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12845. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12846. // Copy bytes to buffer, if provided
  12847. if (buf) {
  12848. for (var ii = 0; ii < 16; ++ii) {
  12849. buf[i + ii] = rnds[ii];
  12850. }
  12851. }
  12852. return buf || bytesToUuid(rnds);
  12853. }
  12854. module.exports = v4;
  12855. /***/ }),
  12856. /***/ 835:
  12857. /***/ (function(module) {
  12858. module.exports = require("url");
  12859. /***/ }),
  12860. /***/ 842:
  12861. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12862. "use strict";
  12863. Object.defineProperty(exports, '__esModule', { value: true });
  12864. var deprecation = __webpack_require__(692);
  12865. var endpointsByScope = {
  12866. actions: {
  12867. cancelWorkflowRun: {
  12868. method: "POST",
  12869. params: {
  12870. owner: {
  12871. required: true,
  12872. type: "string"
  12873. },
  12874. repo: {
  12875. required: true,
  12876. type: "string"
  12877. },
  12878. run_id: {
  12879. required: true,
  12880. type: "integer"
  12881. }
  12882. },
  12883. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12884. },
  12885. createOrUpdateSecretForRepo: {
  12886. method: "PUT",
  12887. params: {
  12888. encrypted_value: {
  12889. type: "string"
  12890. },
  12891. key_id: {
  12892. type: "string"
  12893. },
  12894. name: {
  12895. required: true,
  12896. type: "string"
  12897. },
  12898. owner: {
  12899. required: true,
  12900. type: "string"
  12901. },
  12902. repo: {
  12903. required: true,
  12904. type: "string"
  12905. }
  12906. },
  12907. url: "/repos/:owner/:repo/actions/secrets/:name"
  12908. },
  12909. createRegistrationToken: {
  12910. method: "POST",
  12911. params: {
  12912. owner: {
  12913. required: true,
  12914. type: "string"
  12915. },
  12916. repo: {
  12917. required: true,
  12918. type: "string"
  12919. }
  12920. },
  12921. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12922. },
  12923. createRemoveToken: {
  12924. method: "POST",
  12925. params: {
  12926. owner: {
  12927. required: true,
  12928. type: "string"
  12929. },
  12930. repo: {
  12931. required: true,
  12932. type: "string"
  12933. }
  12934. },
  12935. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12936. },
  12937. deleteArtifact: {
  12938. method: "DELETE",
  12939. params: {
  12940. artifact_id: {
  12941. required: true,
  12942. type: "integer"
  12943. },
  12944. owner: {
  12945. required: true,
  12946. type: "string"
  12947. },
  12948. repo: {
  12949. required: true,
  12950. type: "string"
  12951. }
  12952. },
  12953. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12954. },
  12955. deleteSecretFromRepo: {
  12956. method: "DELETE",
  12957. params: {
  12958. name: {
  12959. required: true,
  12960. type: "string"
  12961. },
  12962. owner: {
  12963. required: true,
  12964. type: "string"
  12965. },
  12966. repo: {
  12967. required: true,
  12968. type: "string"
  12969. }
  12970. },
  12971. url: "/repos/:owner/:repo/actions/secrets/:name"
  12972. },
  12973. downloadArtifact: {
  12974. method: "GET",
  12975. params: {
  12976. archive_format: {
  12977. required: true,
  12978. type: "string"
  12979. },
  12980. artifact_id: {
  12981. required: true,
  12982. type: "integer"
  12983. },
  12984. owner: {
  12985. required: true,
  12986. type: "string"
  12987. },
  12988. repo: {
  12989. required: true,
  12990. type: "string"
  12991. }
  12992. },
  12993. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12994. },
  12995. getArtifact: {
  12996. method: "GET",
  12997. params: {
  12998. artifact_id: {
  12999. required: true,
  13000. type: "integer"
  13001. },
  13002. owner: {
  13003. required: true,
  13004. type: "string"
  13005. },
  13006. repo: {
  13007. required: true,
  13008. type: "string"
  13009. }
  13010. },
  13011. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  13012. },
  13013. getPublicKey: {
  13014. method: "GET",
  13015. params: {
  13016. owner: {
  13017. required: true,
  13018. type: "string"
  13019. },
  13020. repo: {
  13021. required: true,
  13022. type: "string"
  13023. }
  13024. },
  13025. url: "/repos/:owner/:repo/actions/secrets/public-key"
  13026. },
  13027. getSecret: {
  13028. method: "GET",
  13029. params: {
  13030. name: {
  13031. required: true,
  13032. type: "string"
  13033. },
  13034. owner: {
  13035. required: true,
  13036. type: "string"
  13037. },
  13038. page: {
  13039. type: "integer"
  13040. },
  13041. per_page: {
  13042. type: "integer"
  13043. },
  13044. repo: {
  13045. required: true,
  13046. type: "string"
  13047. }
  13048. },
  13049. url: "/repos/:owner/:repo/actions/secrets/:name"
  13050. },
  13051. getSelfHostedRunner: {
  13052. method: "GET",
  13053. params: {
  13054. owner: {
  13055. required: true,
  13056. type: "string"
  13057. },
  13058. repo: {
  13059. required: true,
  13060. type: "string"
  13061. },
  13062. runner_id: {
  13063. required: true,
  13064. type: "integer"
  13065. }
  13066. },
  13067. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13068. },
  13069. getWorkflow: {
  13070. method: "GET",
  13071. params: {
  13072. owner: {
  13073. required: true,
  13074. type: "string"
  13075. },
  13076. repo: {
  13077. required: true,
  13078. type: "string"
  13079. },
  13080. workflow_id: {
  13081. required: true,
  13082. type: "integer"
  13083. }
  13084. },
  13085. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  13086. },
  13087. getWorkflowJob: {
  13088. method: "GET",
  13089. params: {
  13090. job_id: {
  13091. required: true,
  13092. type: "integer"
  13093. },
  13094. owner: {
  13095. required: true,
  13096. type: "string"
  13097. },
  13098. repo: {
  13099. required: true,
  13100. type: "string"
  13101. }
  13102. },
  13103. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  13104. },
  13105. getWorkflowRun: {
  13106. method: "GET",
  13107. params: {
  13108. owner: {
  13109. required: true,
  13110. type: "string"
  13111. },
  13112. repo: {
  13113. required: true,
  13114. type: "string"
  13115. },
  13116. run_id: {
  13117. required: true,
  13118. type: "integer"
  13119. }
  13120. },
  13121. url: "/repos/:owner/:repo/actions/runs/:run_id"
  13122. },
  13123. listDownloadsForSelfHostedRunnerApplication: {
  13124. method: "GET",
  13125. params: {
  13126. owner: {
  13127. required: true,
  13128. type: "string"
  13129. },
  13130. repo: {
  13131. required: true,
  13132. type: "string"
  13133. }
  13134. },
  13135. url: "/repos/:owner/:repo/actions/runners/downloads"
  13136. },
  13137. listJobsForWorkflowRun: {
  13138. method: "GET",
  13139. params: {
  13140. owner: {
  13141. required: true,
  13142. type: "string"
  13143. },
  13144. page: {
  13145. type: "integer"
  13146. },
  13147. per_page: {
  13148. type: "integer"
  13149. },
  13150. repo: {
  13151. required: true,
  13152. type: "string"
  13153. },
  13154. run_id: {
  13155. required: true,
  13156. type: "integer"
  13157. }
  13158. },
  13159. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  13160. },
  13161. listRepoWorkflowRuns: {
  13162. method: "GET",
  13163. params: {
  13164. actor: {
  13165. type: "string"
  13166. },
  13167. branch: {
  13168. type: "string"
  13169. },
  13170. event: {
  13171. type: "string"
  13172. },
  13173. owner: {
  13174. required: true,
  13175. type: "string"
  13176. },
  13177. page: {
  13178. type: "integer"
  13179. },
  13180. per_page: {
  13181. type: "integer"
  13182. },
  13183. repo: {
  13184. required: true,
  13185. type: "string"
  13186. },
  13187. status: {
  13188. enum: ["completed", "status", "conclusion"],
  13189. type: "string"
  13190. }
  13191. },
  13192. url: "/repos/:owner/:repo/actions/runs"
  13193. },
  13194. listRepoWorkflows: {
  13195. method: "GET",
  13196. params: {
  13197. owner: {
  13198. required: true,
  13199. type: "string"
  13200. },
  13201. page: {
  13202. type: "integer"
  13203. },
  13204. per_page: {
  13205. type: "integer"
  13206. },
  13207. repo: {
  13208. required: true,
  13209. type: "string"
  13210. }
  13211. },
  13212. url: "/repos/:owner/:repo/actions/workflows"
  13213. },
  13214. listSecretsForRepo: {
  13215. method: "GET",
  13216. params: {
  13217. owner: {
  13218. required: true,
  13219. type: "string"
  13220. },
  13221. page: {
  13222. type: "integer"
  13223. },
  13224. per_page: {
  13225. type: "integer"
  13226. },
  13227. repo: {
  13228. required: true,
  13229. type: "string"
  13230. }
  13231. },
  13232. url: "/repos/:owner/:repo/actions/secrets"
  13233. },
  13234. listSelfHostedRunnersForRepo: {
  13235. method: "GET",
  13236. params: {
  13237. owner: {
  13238. required: true,
  13239. type: "string"
  13240. },
  13241. page: {
  13242. type: "integer"
  13243. },
  13244. per_page: {
  13245. type: "integer"
  13246. },
  13247. repo: {
  13248. required: true,
  13249. type: "string"
  13250. }
  13251. },
  13252. url: "/repos/:owner/:repo/actions/runners"
  13253. },
  13254. listWorkflowJobLogs: {
  13255. method: "GET",
  13256. params: {
  13257. job_id: {
  13258. required: true,
  13259. type: "integer"
  13260. },
  13261. owner: {
  13262. required: true,
  13263. type: "string"
  13264. },
  13265. page: {
  13266. type: "integer"
  13267. },
  13268. per_page: {
  13269. type: "integer"
  13270. },
  13271. repo: {
  13272. required: true,
  13273. type: "string"
  13274. }
  13275. },
  13276. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13277. },
  13278. listWorkflowRunArtifacts: {
  13279. method: "GET",
  13280. params: {
  13281. owner: {
  13282. required: true,
  13283. type: "string"
  13284. },
  13285. page: {
  13286. type: "integer"
  13287. },
  13288. per_page: {
  13289. type: "integer"
  13290. },
  13291. repo: {
  13292. required: true,
  13293. type: "string"
  13294. },
  13295. run_id: {
  13296. required: true,
  13297. type: "integer"
  13298. }
  13299. },
  13300. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13301. },
  13302. listWorkflowRunLogs: {
  13303. method: "GET",
  13304. params: {
  13305. owner: {
  13306. required: true,
  13307. type: "string"
  13308. },
  13309. page: {
  13310. type: "integer"
  13311. },
  13312. per_page: {
  13313. type: "integer"
  13314. },
  13315. repo: {
  13316. required: true,
  13317. type: "string"
  13318. },
  13319. run_id: {
  13320. required: true,
  13321. type: "integer"
  13322. }
  13323. },
  13324. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13325. },
  13326. listWorkflowRuns: {
  13327. method: "GET",
  13328. params: {
  13329. actor: {
  13330. type: "string"
  13331. },
  13332. branch: {
  13333. type: "string"
  13334. },
  13335. event: {
  13336. type: "string"
  13337. },
  13338. owner: {
  13339. required: true,
  13340. type: "string"
  13341. },
  13342. page: {
  13343. type: "integer"
  13344. },
  13345. per_page: {
  13346. type: "integer"
  13347. },
  13348. repo: {
  13349. required: true,
  13350. type: "string"
  13351. },
  13352. status: {
  13353. enum: ["completed", "status", "conclusion"],
  13354. type: "string"
  13355. },
  13356. workflow_id: {
  13357. required: true,
  13358. type: "integer"
  13359. }
  13360. },
  13361. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13362. },
  13363. reRunWorkflow: {
  13364. method: "POST",
  13365. params: {
  13366. owner: {
  13367. required: true,
  13368. type: "string"
  13369. },
  13370. repo: {
  13371. required: true,
  13372. type: "string"
  13373. },
  13374. run_id: {
  13375. required: true,
  13376. type: "integer"
  13377. }
  13378. },
  13379. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13380. },
  13381. removeSelfHostedRunner: {
  13382. method: "DELETE",
  13383. params: {
  13384. owner: {
  13385. required: true,
  13386. type: "string"
  13387. },
  13388. repo: {
  13389. required: true,
  13390. type: "string"
  13391. },
  13392. runner_id: {
  13393. required: true,
  13394. type: "integer"
  13395. }
  13396. },
  13397. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13398. }
  13399. },
  13400. activity: {
  13401. checkStarringRepo: {
  13402. method: "GET",
  13403. params: {
  13404. owner: {
  13405. required: true,
  13406. type: "string"
  13407. },
  13408. repo: {
  13409. required: true,
  13410. type: "string"
  13411. }
  13412. },
  13413. url: "/user/starred/:owner/:repo"
  13414. },
  13415. deleteRepoSubscription: {
  13416. method: "DELETE",
  13417. params: {
  13418. owner: {
  13419. required: true,
  13420. type: "string"
  13421. },
  13422. repo: {
  13423. required: true,
  13424. type: "string"
  13425. }
  13426. },
  13427. url: "/repos/:owner/:repo/subscription"
  13428. },
  13429. deleteThreadSubscription: {
  13430. method: "DELETE",
  13431. params: {
  13432. thread_id: {
  13433. required: true,
  13434. type: "integer"
  13435. }
  13436. },
  13437. url: "/notifications/threads/:thread_id/subscription"
  13438. },
  13439. getRepoSubscription: {
  13440. method: "GET",
  13441. params: {
  13442. owner: {
  13443. required: true,
  13444. type: "string"
  13445. },
  13446. repo: {
  13447. required: true,
  13448. type: "string"
  13449. }
  13450. },
  13451. url: "/repos/:owner/:repo/subscription"
  13452. },
  13453. getThread: {
  13454. method: "GET",
  13455. params: {
  13456. thread_id: {
  13457. required: true,
  13458. type: "integer"
  13459. }
  13460. },
  13461. url: "/notifications/threads/:thread_id"
  13462. },
  13463. getThreadSubscription: {
  13464. method: "GET",
  13465. params: {
  13466. thread_id: {
  13467. required: true,
  13468. type: "integer"
  13469. }
  13470. },
  13471. url: "/notifications/threads/:thread_id/subscription"
  13472. },
  13473. listEventsForOrg: {
  13474. method: "GET",
  13475. params: {
  13476. org: {
  13477. required: true,
  13478. type: "string"
  13479. },
  13480. page: {
  13481. type: "integer"
  13482. },
  13483. per_page: {
  13484. type: "integer"
  13485. },
  13486. username: {
  13487. required: true,
  13488. type: "string"
  13489. }
  13490. },
  13491. url: "/users/:username/events/orgs/:org"
  13492. },
  13493. listEventsForUser: {
  13494. method: "GET",
  13495. params: {
  13496. page: {
  13497. type: "integer"
  13498. },
  13499. per_page: {
  13500. type: "integer"
  13501. },
  13502. username: {
  13503. required: true,
  13504. type: "string"
  13505. }
  13506. },
  13507. url: "/users/:username/events"
  13508. },
  13509. listFeeds: {
  13510. method: "GET",
  13511. params: {},
  13512. url: "/feeds"
  13513. },
  13514. listNotifications: {
  13515. method: "GET",
  13516. params: {
  13517. all: {
  13518. type: "boolean"
  13519. },
  13520. before: {
  13521. type: "string"
  13522. },
  13523. page: {
  13524. type: "integer"
  13525. },
  13526. participating: {
  13527. type: "boolean"
  13528. },
  13529. per_page: {
  13530. type: "integer"
  13531. },
  13532. since: {
  13533. type: "string"
  13534. }
  13535. },
  13536. url: "/notifications"
  13537. },
  13538. listNotificationsForRepo: {
  13539. method: "GET",
  13540. params: {
  13541. all: {
  13542. type: "boolean"
  13543. },
  13544. before: {
  13545. type: "string"
  13546. },
  13547. owner: {
  13548. required: true,
  13549. type: "string"
  13550. },
  13551. page: {
  13552. type: "integer"
  13553. },
  13554. participating: {
  13555. type: "boolean"
  13556. },
  13557. per_page: {
  13558. type: "integer"
  13559. },
  13560. repo: {
  13561. required: true,
  13562. type: "string"
  13563. },
  13564. since: {
  13565. type: "string"
  13566. }
  13567. },
  13568. url: "/repos/:owner/:repo/notifications"
  13569. },
  13570. listPublicEvents: {
  13571. method: "GET",
  13572. params: {
  13573. page: {
  13574. type: "integer"
  13575. },
  13576. per_page: {
  13577. type: "integer"
  13578. }
  13579. },
  13580. url: "/events"
  13581. },
  13582. listPublicEventsForOrg: {
  13583. method: "GET",
  13584. params: {
  13585. org: {
  13586. required: true,
  13587. type: "string"
  13588. },
  13589. page: {
  13590. type: "integer"
  13591. },
  13592. per_page: {
  13593. type: "integer"
  13594. }
  13595. },
  13596. url: "/orgs/:org/events"
  13597. },
  13598. listPublicEventsForRepoNetwork: {
  13599. method: "GET",
  13600. params: {
  13601. owner: {
  13602. required: true,
  13603. type: "string"
  13604. },
  13605. page: {
  13606. type: "integer"
  13607. },
  13608. per_page: {
  13609. type: "integer"
  13610. },
  13611. repo: {
  13612. required: true,
  13613. type: "string"
  13614. }
  13615. },
  13616. url: "/networks/:owner/:repo/events"
  13617. },
  13618. listPublicEventsForUser: {
  13619. method: "GET",
  13620. params: {
  13621. page: {
  13622. type: "integer"
  13623. },
  13624. per_page: {
  13625. type: "integer"
  13626. },
  13627. username: {
  13628. required: true,
  13629. type: "string"
  13630. }
  13631. },
  13632. url: "/users/:username/events/public"
  13633. },
  13634. listReceivedEventsForUser: {
  13635. method: "GET",
  13636. params: {
  13637. page: {
  13638. type: "integer"
  13639. },
  13640. per_page: {
  13641. type: "integer"
  13642. },
  13643. username: {
  13644. required: true,
  13645. type: "string"
  13646. }
  13647. },
  13648. url: "/users/:username/received_events"
  13649. },
  13650. listReceivedPublicEventsForUser: {
  13651. method: "GET",
  13652. params: {
  13653. page: {
  13654. type: "integer"
  13655. },
  13656. per_page: {
  13657. type: "integer"
  13658. },
  13659. username: {
  13660. required: true,
  13661. type: "string"
  13662. }
  13663. },
  13664. url: "/users/:username/received_events/public"
  13665. },
  13666. listRepoEvents: {
  13667. method: "GET",
  13668. params: {
  13669. owner: {
  13670. required: true,
  13671. type: "string"
  13672. },
  13673. page: {
  13674. type: "integer"
  13675. },
  13676. per_page: {
  13677. type: "integer"
  13678. },
  13679. repo: {
  13680. required: true,
  13681. type: "string"
  13682. }
  13683. },
  13684. url: "/repos/:owner/:repo/events"
  13685. },
  13686. listReposStarredByAuthenticatedUser: {
  13687. method: "GET",
  13688. params: {
  13689. direction: {
  13690. enum: ["asc", "desc"],
  13691. type: "string"
  13692. },
  13693. page: {
  13694. type: "integer"
  13695. },
  13696. per_page: {
  13697. type: "integer"
  13698. },
  13699. sort: {
  13700. enum: ["created", "updated"],
  13701. type: "string"
  13702. }
  13703. },
  13704. url: "/user/starred"
  13705. },
  13706. listReposStarredByUser: {
  13707. method: "GET",
  13708. params: {
  13709. direction: {
  13710. enum: ["asc", "desc"],
  13711. type: "string"
  13712. },
  13713. page: {
  13714. type: "integer"
  13715. },
  13716. per_page: {
  13717. type: "integer"
  13718. },
  13719. sort: {
  13720. enum: ["created", "updated"],
  13721. type: "string"
  13722. },
  13723. username: {
  13724. required: true,
  13725. type: "string"
  13726. }
  13727. },
  13728. url: "/users/:username/starred"
  13729. },
  13730. listReposWatchedByUser: {
  13731. method: "GET",
  13732. params: {
  13733. page: {
  13734. type: "integer"
  13735. },
  13736. per_page: {
  13737. type: "integer"
  13738. },
  13739. username: {
  13740. required: true,
  13741. type: "string"
  13742. }
  13743. },
  13744. url: "/users/:username/subscriptions"
  13745. },
  13746. listStargazersForRepo: {
  13747. method: "GET",
  13748. params: {
  13749. owner: {
  13750. required: true,
  13751. type: "string"
  13752. },
  13753. page: {
  13754. type: "integer"
  13755. },
  13756. per_page: {
  13757. type: "integer"
  13758. },
  13759. repo: {
  13760. required: true,
  13761. type: "string"
  13762. }
  13763. },
  13764. url: "/repos/:owner/:repo/stargazers"
  13765. },
  13766. listWatchedReposForAuthenticatedUser: {
  13767. method: "GET",
  13768. params: {
  13769. page: {
  13770. type: "integer"
  13771. },
  13772. per_page: {
  13773. type: "integer"
  13774. }
  13775. },
  13776. url: "/user/subscriptions"
  13777. },
  13778. listWatchersForRepo: {
  13779. method: "GET",
  13780. params: {
  13781. owner: {
  13782. required: true,
  13783. type: "string"
  13784. },
  13785. page: {
  13786. type: "integer"
  13787. },
  13788. per_page: {
  13789. type: "integer"
  13790. },
  13791. repo: {
  13792. required: true,
  13793. type: "string"
  13794. }
  13795. },
  13796. url: "/repos/:owner/:repo/subscribers"
  13797. },
  13798. markAsRead: {
  13799. method: "PUT",
  13800. params: {
  13801. last_read_at: {
  13802. type: "string"
  13803. }
  13804. },
  13805. url: "/notifications"
  13806. },
  13807. markNotificationsAsReadForRepo: {
  13808. method: "PUT",
  13809. params: {
  13810. last_read_at: {
  13811. type: "string"
  13812. },
  13813. owner: {
  13814. required: true,
  13815. type: "string"
  13816. },
  13817. repo: {
  13818. required: true,
  13819. type: "string"
  13820. }
  13821. },
  13822. url: "/repos/:owner/:repo/notifications"
  13823. },
  13824. markThreadAsRead: {
  13825. method: "PATCH",
  13826. params: {
  13827. thread_id: {
  13828. required: true,
  13829. type: "integer"
  13830. }
  13831. },
  13832. url: "/notifications/threads/:thread_id"
  13833. },
  13834. setRepoSubscription: {
  13835. method: "PUT",
  13836. params: {
  13837. ignored: {
  13838. type: "boolean"
  13839. },
  13840. owner: {
  13841. required: true,
  13842. type: "string"
  13843. },
  13844. repo: {
  13845. required: true,
  13846. type: "string"
  13847. },
  13848. subscribed: {
  13849. type: "boolean"
  13850. }
  13851. },
  13852. url: "/repos/:owner/:repo/subscription"
  13853. },
  13854. setThreadSubscription: {
  13855. method: "PUT",
  13856. params: {
  13857. ignored: {
  13858. type: "boolean"
  13859. },
  13860. thread_id: {
  13861. required: true,
  13862. type: "integer"
  13863. }
  13864. },
  13865. url: "/notifications/threads/:thread_id/subscription"
  13866. },
  13867. starRepo: {
  13868. method: "PUT",
  13869. params: {
  13870. owner: {
  13871. required: true,
  13872. type: "string"
  13873. },
  13874. repo: {
  13875. required: true,
  13876. type: "string"
  13877. }
  13878. },
  13879. url: "/user/starred/:owner/:repo"
  13880. },
  13881. unstarRepo: {
  13882. method: "DELETE",
  13883. params: {
  13884. owner: {
  13885. required: true,
  13886. type: "string"
  13887. },
  13888. repo: {
  13889. required: true,
  13890. type: "string"
  13891. }
  13892. },
  13893. url: "/user/starred/:owner/:repo"
  13894. }
  13895. },
  13896. apps: {
  13897. addRepoToInstallation: {
  13898. headers: {
  13899. accept: "application/vnd.github.machine-man-preview+json"
  13900. },
  13901. method: "PUT",
  13902. params: {
  13903. installation_id: {
  13904. required: true,
  13905. type: "integer"
  13906. },
  13907. repository_id: {
  13908. required: true,
  13909. type: "integer"
  13910. }
  13911. },
  13912. url: "/user/installations/:installation_id/repositories/:repository_id"
  13913. },
  13914. checkAccountIsAssociatedWithAny: {
  13915. method: "GET",
  13916. params: {
  13917. account_id: {
  13918. required: true,
  13919. type: "integer"
  13920. }
  13921. },
  13922. url: "/marketplace_listing/accounts/:account_id"
  13923. },
  13924. checkAccountIsAssociatedWithAnyStubbed: {
  13925. method: "GET",
  13926. params: {
  13927. account_id: {
  13928. required: true,
  13929. type: "integer"
  13930. }
  13931. },
  13932. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13933. },
  13934. checkAuthorization: {
  13935. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13936. method: "GET",
  13937. params: {
  13938. access_token: {
  13939. required: true,
  13940. type: "string"
  13941. },
  13942. client_id: {
  13943. required: true,
  13944. type: "string"
  13945. }
  13946. },
  13947. url: "/applications/:client_id/tokens/:access_token"
  13948. },
  13949. checkToken: {
  13950. headers: {
  13951. accept: "application/vnd.github.doctor-strange-preview+json"
  13952. },
  13953. method: "POST",
  13954. params: {
  13955. access_token: {
  13956. type: "string"
  13957. },
  13958. client_id: {
  13959. required: true,
  13960. type: "string"
  13961. }
  13962. },
  13963. url: "/applications/:client_id/token"
  13964. },
  13965. createContentAttachment: {
  13966. headers: {
  13967. accept: "application/vnd.github.corsair-preview+json"
  13968. },
  13969. method: "POST",
  13970. params: {
  13971. body: {
  13972. required: true,
  13973. type: "string"
  13974. },
  13975. content_reference_id: {
  13976. required: true,
  13977. type: "integer"
  13978. },
  13979. title: {
  13980. required: true,
  13981. type: "string"
  13982. }
  13983. },
  13984. url: "/content_references/:content_reference_id/attachments"
  13985. },
  13986. createFromManifest: {
  13987. headers: {
  13988. accept: "application/vnd.github.fury-preview+json"
  13989. },
  13990. method: "POST",
  13991. params: {
  13992. code: {
  13993. required: true,
  13994. type: "string"
  13995. }
  13996. },
  13997. url: "/app-manifests/:code/conversions"
  13998. },
  13999. createInstallationToken: {
  14000. headers: {
  14001. accept: "application/vnd.github.machine-man-preview+json"
  14002. },
  14003. method: "POST",
  14004. params: {
  14005. installation_id: {
  14006. required: true,
  14007. type: "integer"
  14008. },
  14009. permissions: {
  14010. type: "object"
  14011. },
  14012. repository_ids: {
  14013. type: "integer[]"
  14014. }
  14015. },
  14016. url: "/app/installations/:installation_id/access_tokens"
  14017. },
  14018. deleteAuthorization: {
  14019. headers: {
  14020. accept: "application/vnd.github.doctor-strange-preview+json"
  14021. },
  14022. method: "DELETE",
  14023. params: {
  14024. access_token: {
  14025. type: "string"
  14026. },
  14027. client_id: {
  14028. required: true,
  14029. type: "string"
  14030. }
  14031. },
  14032. url: "/applications/:client_id/grant"
  14033. },
  14034. deleteInstallation: {
  14035. headers: {
  14036. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  14037. },
  14038. method: "DELETE",
  14039. params: {
  14040. installation_id: {
  14041. required: true,
  14042. type: "integer"
  14043. }
  14044. },
  14045. url: "/app/installations/:installation_id"
  14046. },
  14047. deleteToken: {
  14048. headers: {
  14049. accept: "application/vnd.github.doctor-strange-preview+json"
  14050. },
  14051. method: "DELETE",
  14052. params: {
  14053. access_token: {
  14054. type: "string"
  14055. },
  14056. client_id: {
  14057. required: true,
  14058. type: "string"
  14059. }
  14060. },
  14061. url: "/applications/:client_id/token"
  14062. },
  14063. findOrgInstallation: {
  14064. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  14065. headers: {
  14066. accept: "application/vnd.github.machine-man-preview+json"
  14067. },
  14068. method: "GET",
  14069. params: {
  14070. org: {
  14071. required: true,
  14072. type: "string"
  14073. }
  14074. },
  14075. url: "/orgs/:org/installation"
  14076. },
  14077. findRepoInstallation: {
  14078. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  14079. headers: {
  14080. accept: "application/vnd.github.machine-man-preview+json"
  14081. },
  14082. method: "GET",
  14083. params: {
  14084. owner: {
  14085. required: true,
  14086. type: "string"
  14087. },
  14088. repo: {
  14089. required: true,
  14090. type: "string"
  14091. }
  14092. },
  14093. url: "/repos/:owner/:repo/installation"
  14094. },
  14095. findUserInstallation: {
  14096. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  14097. headers: {
  14098. accept: "application/vnd.github.machine-man-preview+json"
  14099. },
  14100. method: "GET",
  14101. params: {
  14102. username: {
  14103. required: true,
  14104. type: "string"
  14105. }
  14106. },
  14107. url: "/users/:username/installation"
  14108. },
  14109. getAuthenticated: {
  14110. headers: {
  14111. accept: "application/vnd.github.machine-man-preview+json"
  14112. },
  14113. method: "GET",
  14114. params: {},
  14115. url: "/app"
  14116. },
  14117. getBySlug: {
  14118. headers: {
  14119. accept: "application/vnd.github.machine-man-preview+json"
  14120. },
  14121. method: "GET",
  14122. params: {
  14123. app_slug: {
  14124. required: true,
  14125. type: "string"
  14126. }
  14127. },
  14128. url: "/apps/:app_slug"
  14129. },
  14130. getInstallation: {
  14131. headers: {
  14132. accept: "application/vnd.github.machine-man-preview+json"
  14133. },
  14134. method: "GET",
  14135. params: {
  14136. installation_id: {
  14137. required: true,
  14138. type: "integer"
  14139. }
  14140. },
  14141. url: "/app/installations/:installation_id"
  14142. },
  14143. getOrgInstallation: {
  14144. headers: {
  14145. accept: "application/vnd.github.machine-man-preview+json"
  14146. },
  14147. method: "GET",
  14148. params: {
  14149. org: {
  14150. required: true,
  14151. type: "string"
  14152. }
  14153. },
  14154. url: "/orgs/:org/installation"
  14155. },
  14156. getRepoInstallation: {
  14157. headers: {
  14158. accept: "application/vnd.github.machine-man-preview+json"
  14159. },
  14160. method: "GET",
  14161. params: {
  14162. owner: {
  14163. required: true,
  14164. type: "string"
  14165. },
  14166. repo: {
  14167. required: true,
  14168. type: "string"
  14169. }
  14170. },
  14171. url: "/repos/:owner/:repo/installation"
  14172. },
  14173. getUserInstallation: {
  14174. headers: {
  14175. accept: "application/vnd.github.machine-man-preview+json"
  14176. },
  14177. method: "GET",
  14178. params: {
  14179. username: {
  14180. required: true,
  14181. type: "string"
  14182. }
  14183. },
  14184. url: "/users/:username/installation"
  14185. },
  14186. listAccountsUserOrOrgOnPlan: {
  14187. method: "GET",
  14188. params: {
  14189. direction: {
  14190. enum: ["asc", "desc"],
  14191. type: "string"
  14192. },
  14193. page: {
  14194. type: "integer"
  14195. },
  14196. per_page: {
  14197. type: "integer"
  14198. },
  14199. plan_id: {
  14200. required: true,
  14201. type: "integer"
  14202. },
  14203. sort: {
  14204. enum: ["created", "updated"],
  14205. type: "string"
  14206. }
  14207. },
  14208. url: "/marketplace_listing/plans/:plan_id/accounts"
  14209. },
  14210. listAccountsUserOrOrgOnPlanStubbed: {
  14211. method: "GET",
  14212. params: {
  14213. direction: {
  14214. enum: ["asc", "desc"],
  14215. type: "string"
  14216. },
  14217. page: {
  14218. type: "integer"
  14219. },
  14220. per_page: {
  14221. type: "integer"
  14222. },
  14223. plan_id: {
  14224. required: true,
  14225. type: "integer"
  14226. },
  14227. sort: {
  14228. enum: ["created", "updated"],
  14229. type: "string"
  14230. }
  14231. },
  14232. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14233. },
  14234. listInstallationReposForAuthenticatedUser: {
  14235. headers: {
  14236. accept: "application/vnd.github.machine-man-preview+json"
  14237. },
  14238. method: "GET",
  14239. params: {
  14240. installation_id: {
  14241. required: true,
  14242. type: "integer"
  14243. },
  14244. page: {
  14245. type: "integer"
  14246. },
  14247. per_page: {
  14248. type: "integer"
  14249. }
  14250. },
  14251. url: "/user/installations/:installation_id/repositories"
  14252. },
  14253. listInstallations: {
  14254. headers: {
  14255. accept: "application/vnd.github.machine-man-preview+json"
  14256. },
  14257. method: "GET",
  14258. params: {
  14259. page: {
  14260. type: "integer"
  14261. },
  14262. per_page: {
  14263. type: "integer"
  14264. }
  14265. },
  14266. url: "/app/installations"
  14267. },
  14268. listInstallationsForAuthenticatedUser: {
  14269. headers: {
  14270. accept: "application/vnd.github.machine-man-preview+json"
  14271. },
  14272. method: "GET",
  14273. params: {
  14274. page: {
  14275. type: "integer"
  14276. },
  14277. per_page: {
  14278. type: "integer"
  14279. }
  14280. },
  14281. url: "/user/installations"
  14282. },
  14283. listMarketplacePurchasesForAuthenticatedUser: {
  14284. method: "GET",
  14285. params: {
  14286. page: {
  14287. type: "integer"
  14288. },
  14289. per_page: {
  14290. type: "integer"
  14291. }
  14292. },
  14293. url: "/user/marketplace_purchases"
  14294. },
  14295. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14296. method: "GET",
  14297. params: {
  14298. page: {
  14299. type: "integer"
  14300. },
  14301. per_page: {
  14302. type: "integer"
  14303. }
  14304. },
  14305. url: "/user/marketplace_purchases/stubbed"
  14306. },
  14307. listPlans: {
  14308. method: "GET",
  14309. params: {
  14310. page: {
  14311. type: "integer"
  14312. },
  14313. per_page: {
  14314. type: "integer"
  14315. }
  14316. },
  14317. url: "/marketplace_listing/plans"
  14318. },
  14319. listPlansStubbed: {
  14320. method: "GET",
  14321. params: {
  14322. page: {
  14323. type: "integer"
  14324. },
  14325. per_page: {
  14326. type: "integer"
  14327. }
  14328. },
  14329. url: "/marketplace_listing/stubbed/plans"
  14330. },
  14331. listRepos: {
  14332. headers: {
  14333. accept: "application/vnd.github.machine-man-preview+json"
  14334. },
  14335. method: "GET",
  14336. params: {
  14337. page: {
  14338. type: "integer"
  14339. },
  14340. per_page: {
  14341. type: "integer"
  14342. }
  14343. },
  14344. url: "/installation/repositories"
  14345. },
  14346. removeRepoFromInstallation: {
  14347. headers: {
  14348. accept: "application/vnd.github.machine-man-preview+json"
  14349. },
  14350. method: "DELETE",
  14351. params: {
  14352. installation_id: {
  14353. required: true,
  14354. type: "integer"
  14355. },
  14356. repository_id: {
  14357. required: true,
  14358. type: "integer"
  14359. }
  14360. },
  14361. url: "/user/installations/:installation_id/repositories/:repository_id"
  14362. },
  14363. resetAuthorization: {
  14364. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14365. method: "POST",
  14366. params: {
  14367. access_token: {
  14368. required: true,
  14369. type: "string"
  14370. },
  14371. client_id: {
  14372. required: true,
  14373. type: "string"
  14374. }
  14375. },
  14376. url: "/applications/:client_id/tokens/:access_token"
  14377. },
  14378. resetToken: {
  14379. headers: {
  14380. accept: "application/vnd.github.doctor-strange-preview+json"
  14381. },
  14382. method: "PATCH",
  14383. params: {
  14384. access_token: {
  14385. type: "string"
  14386. },
  14387. client_id: {
  14388. required: true,
  14389. type: "string"
  14390. }
  14391. },
  14392. url: "/applications/:client_id/token"
  14393. },
  14394. revokeAuthorizationForApplication: {
  14395. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14396. method: "DELETE",
  14397. params: {
  14398. access_token: {
  14399. required: true,
  14400. type: "string"
  14401. },
  14402. client_id: {
  14403. required: true,
  14404. type: "string"
  14405. }
  14406. },
  14407. url: "/applications/:client_id/tokens/:access_token"
  14408. },
  14409. revokeGrantForApplication: {
  14410. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14411. method: "DELETE",
  14412. params: {
  14413. access_token: {
  14414. required: true,
  14415. type: "string"
  14416. },
  14417. client_id: {
  14418. required: true,
  14419. type: "string"
  14420. }
  14421. },
  14422. url: "/applications/:client_id/grants/:access_token"
  14423. },
  14424. revokeInstallationToken: {
  14425. headers: {
  14426. accept: "application/vnd.github.gambit-preview+json"
  14427. },
  14428. method: "DELETE",
  14429. params: {},
  14430. url: "/installation/token"
  14431. }
  14432. },
  14433. checks: {
  14434. create: {
  14435. headers: {
  14436. accept: "application/vnd.github.antiope-preview+json"
  14437. },
  14438. method: "POST",
  14439. params: {
  14440. actions: {
  14441. type: "object[]"
  14442. },
  14443. "actions[].description": {
  14444. required: true,
  14445. type: "string"
  14446. },
  14447. "actions[].identifier": {
  14448. required: true,
  14449. type: "string"
  14450. },
  14451. "actions[].label": {
  14452. required: true,
  14453. type: "string"
  14454. },
  14455. completed_at: {
  14456. type: "string"
  14457. },
  14458. conclusion: {
  14459. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14460. type: "string"
  14461. },
  14462. details_url: {
  14463. type: "string"
  14464. },
  14465. external_id: {
  14466. type: "string"
  14467. },
  14468. head_sha: {
  14469. required: true,
  14470. type: "string"
  14471. },
  14472. name: {
  14473. required: true,
  14474. type: "string"
  14475. },
  14476. output: {
  14477. type: "object"
  14478. },
  14479. "output.annotations": {
  14480. type: "object[]"
  14481. },
  14482. "output.annotations[].annotation_level": {
  14483. enum: ["notice", "warning", "failure"],
  14484. required: true,
  14485. type: "string"
  14486. },
  14487. "output.annotations[].end_column": {
  14488. type: "integer"
  14489. },
  14490. "output.annotations[].end_line": {
  14491. required: true,
  14492. type: "integer"
  14493. },
  14494. "output.annotations[].message": {
  14495. required: true,
  14496. type: "string"
  14497. },
  14498. "output.annotations[].path": {
  14499. required: true,
  14500. type: "string"
  14501. },
  14502. "output.annotations[].raw_details": {
  14503. type: "string"
  14504. },
  14505. "output.annotations[].start_column": {
  14506. type: "integer"
  14507. },
  14508. "output.annotations[].start_line": {
  14509. required: true,
  14510. type: "integer"
  14511. },
  14512. "output.annotations[].title": {
  14513. type: "string"
  14514. },
  14515. "output.images": {
  14516. type: "object[]"
  14517. },
  14518. "output.images[].alt": {
  14519. required: true,
  14520. type: "string"
  14521. },
  14522. "output.images[].caption": {
  14523. type: "string"
  14524. },
  14525. "output.images[].image_url": {
  14526. required: true,
  14527. type: "string"
  14528. },
  14529. "output.summary": {
  14530. required: true,
  14531. type: "string"
  14532. },
  14533. "output.text": {
  14534. type: "string"
  14535. },
  14536. "output.title": {
  14537. required: true,
  14538. type: "string"
  14539. },
  14540. owner: {
  14541. required: true,
  14542. type: "string"
  14543. },
  14544. repo: {
  14545. required: true,
  14546. type: "string"
  14547. },
  14548. started_at: {
  14549. type: "string"
  14550. },
  14551. status: {
  14552. enum: ["queued", "in_progress", "completed"],
  14553. type: "string"
  14554. }
  14555. },
  14556. url: "/repos/:owner/:repo/check-runs"
  14557. },
  14558. createSuite: {
  14559. headers: {
  14560. accept: "application/vnd.github.antiope-preview+json"
  14561. },
  14562. method: "POST",
  14563. params: {
  14564. head_sha: {
  14565. required: true,
  14566. type: "string"
  14567. },
  14568. owner: {
  14569. required: true,
  14570. type: "string"
  14571. },
  14572. repo: {
  14573. required: true,
  14574. type: "string"
  14575. }
  14576. },
  14577. url: "/repos/:owner/:repo/check-suites"
  14578. },
  14579. get: {
  14580. headers: {
  14581. accept: "application/vnd.github.antiope-preview+json"
  14582. },
  14583. method: "GET",
  14584. params: {
  14585. check_run_id: {
  14586. required: true,
  14587. type: "integer"
  14588. },
  14589. owner: {
  14590. required: true,
  14591. type: "string"
  14592. },
  14593. repo: {
  14594. required: true,
  14595. type: "string"
  14596. }
  14597. },
  14598. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14599. },
  14600. getSuite: {
  14601. headers: {
  14602. accept: "application/vnd.github.antiope-preview+json"
  14603. },
  14604. method: "GET",
  14605. params: {
  14606. check_suite_id: {
  14607. required: true,
  14608. type: "integer"
  14609. },
  14610. owner: {
  14611. required: true,
  14612. type: "string"
  14613. },
  14614. repo: {
  14615. required: true,
  14616. type: "string"
  14617. }
  14618. },
  14619. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14620. },
  14621. listAnnotations: {
  14622. headers: {
  14623. accept: "application/vnd.github.antiope-preview+json"
  14624. },
  14625. method: "GET",
  14626. params: {
  14627. check_run_id: {
  14628. required: true,
  14629. type: "integer"
  14630. },
  14631. owner: {
  14632. required: true,
  14633. type: "string"
  14634. },
  14635. page: {
  14636. type: "integer"
  14637. },
  14638. per_page: {
  14639. type: "integer"
  14640. },
  14641. repo: {
  14642. required: true,
  14643. type: "string"
  14644. }
  14645. },
  14646. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14647. },
  14648. listForRef: {
  14649. headers: {
  14650. accept: "application/vnd.github.antiope-preview+json"
  14651. },
  14652. method: "GET",
  14653. params: {
  14654. check_name: {
  14655. type: "string"
  14656. },
  14657. filter: {
  14658. enum: ["latest", "all"],
  14659. type: "string"
  14660. },
  14661. owner: {
  14662. required: true,
  14663. type: "string"
  14664. },
  14665. page: {
  14666. type: "integer"
  14667. },
  14668. per_page: {
  14669. type: "integer"
  14670. },
  14671. ref: {
  14672. required: true,
  14673. type: "string"
  14674. },
  14675. repo: {
  14676. required: true,
  14677. type: "string"
  14678. },
  14679. status: {
  14680. enum: ["queued", "in_progress", "completed"],
  14681. type: "string"
  14682. }
  14683. },
  14684. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14685. },
  14686. listForSuite: {
  14687. headers: {
  14688. accept: "application/vnd.github.antiope-preview+json"
  14689. },
  14690. method: "GET",
  14691. params: {
  14692. check_name: {
  14693. type: "string"
  14694. },
  14695. check_suite_id: {
  14696. required: true,
  14697. type: "integer"
  14698. },
  14699. filter: {
  14700. enum: ["latest", "all"],
  14701. type: "string"
  14702. },
  14703. owner: {
  14704. required: true,
  14705. type: "string"
  14706. },
  14707. page: {
  14708. type: "integer"
  14709. },
  14710. per_page: {
  14711. type: "integer"
  14712. },
  14713. repo: {
  14714. required: true,
  14715. type: "string"
  14716. },
  14717. status: {
  14718. enum: ["queued", "in_progress", "completed"],
  14719. type: "string"
  14720. }
  14721. },
  14722. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14723. },
  14724. listSuitesForRef: {
  14725. headers: {
  14726. accept: "application/vnd.github.antiope-preview+json"
  14727. },
  14728. method: "GET",
  14729. params: {
  14730. app_id: {
  14731. type: "integer"
  14732. },
  14733. check_name: {
  14734. type: "string"
  14735. },
  14736. owner: {
  14737. required: true,
  14738. type: "string"
  14739. },
  14740. page: {
  14741. type: "integer"
  14742. },
  14743. per_page: {
  14744. type: "integer"
  14745. },
  14746. ref: {
  14747. required: true,
  14748. type: "string"
  14749. },
  14750. repo: {
  14751. required: true,
  14752. type: "string"
  14753. }
  14754. },
  14755. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14756. },
  14757. rerequestSuite: {
  14758. headers: {
  14759. accept: "application/vnd.github.antiope-preview+json"
  14760. },
  14761. method: "POST",
  14762. params: {
  14763. check_suite_id: {
  14764. required: true,
  14765. type: "integer"
  14766. },
  14767. owner: {
  14768. required: true,
  14769. type: "string"
  14770. },
  14771. repo: {
  14772. required: true,
  14773. type: "string"
  14774. }
  14775. },
  14776. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14777. },
  14778. setSuitesPreferences: {
  14779. headers: {
  14780. accept: "application/vnd.github.antiope-preview+json"
  14781. },
  14782. method: "PATCH",
  14783. params: {
  14784. auto_trigger_checks: {
  14785. type: "object[]"
  14786. },
  14787. "auto_trigger_checks[].app_id": {
  14788. required: true,
  14789. type: "integer"
  14790. },
  14791. "auto_trigger_checks[].setting": {
  14792. required: true,
  14793. type: "boolean"
  14794. },
  14795. owner: {
  14796. required: true,
  14797. type: "string"
  14798. },
  14799. repo: {
  14800. required: true,
  14801. type: "string"
  14802. }
  14803. },
  14804. url: "/repos/:owner/:repo/check-suites/preferences"
  14805. },
  14806. update: {
  14807. headers: {
  14808. accept: "application/vnd.github.antiope-preview+json"
  14809. },
  14810. method: "PATCH",
  14811. params: {
  14812. actions: {
  14813. type: "object[]"
  14814. },
  14815. "actions[].description": {
  14816. required: true,
  14817. type: "string"
  14818. },
  14819. "actions[].identifier": {
  14820. required: true,
  14821. type: "string"
  14822. },
  14823. "actions[].label": {
  14824. required: true,
  14825. type: "string"
  14826. },
  14827. check_run_id: {
  14828. required: true,
  14829. type: "integer"
  14830. },
  14831. completed_at: {
  14832. type: "string"
  14833. },
  14834. conclusion: {
  14835. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14836. type: "string"
  14837. },
  14838. details_url: {
  14839. type: "string"
  14840. },
  14841. external_id: {
  14842. type: "string"
  14843. },
  14844. name: {
  14845. type: "string"
  14846. },
  14847. output: {
  14848. type: "object"
  14849. },
  14850. "output.annotations": {
  14851. type: "object[]"
  14852. },
  14853. "output.annotations[].annotation_level": {
  14854. enum: ["notice", "warning", "failure"],
  14855. required: true,
  14856. type: "string"
  14857. },
  14858. "output.annotations[].end_column": {
  14859. type: "integer"
  14860. },
  14861. "output.annotations[].end_line": {
  14862. required: true,
  14863. type: "integer"
  14864. },
  14865. "output.annotations[].message": {
  14866. required: true,
  14867. type: "string"
  14868. },
  14869. "output.annotations[].path": {
  14870. required: true,
  14871. type: "string"
  14872. },
  14873. "output.annotations[].raw_details": {
  14874. type: "string"
  14875. },
  14876. "output.annotations[].start_column": {
  14877. type: "integer"
  14878. },
  14879. "output.annotations[].start_line": {
  14880. required: true,
  14881. type: "integer"
  14882. },
  14883. "output.annotations[].title": {
  14884. type: "string"
  14885. },
  14886. "output.images": {
  14887. type: "object[]"
  14888. },
  14889. "output.images[].alt": {
  14890. required: true,
  14891. type: "string"
  14892. },
  14893. "output.images[].caption": {
  14894. type: "string"
  14895. },
  14896. "output.images[].image_url": {
  14897. required: true,
  14898. type: "string"
  14899. },
  14900. "output.summary": {
  14901. required: true,
  14902. type: "string"
  14903. },
  14904. "output.text": {
  14905. type: "string"
  14906. },
  14907. "output.title": {
  14908. type: "string"
  14909. },
  14910. owner: {
  14911. required: true,
  14912. type: "string"
  14913. },
  14914. repo: {
  14915. required: true,
  14916. type: "string"
  14917. },
  14918. started_at: {
  14919. type: "string"
  14920. },
  14921. status: {
  14922. enum: ["queued", "in_progress", "completed"],
  14923. type: "string"
  14924. }
  14925. },
  14926. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14927. }
  14928. },
  14929. codesOfConduct: {
  14930. getConductCode: {
  14931. headers: {
  14932. accept: "application/vnd.github.scarlet-witch-preview+json"
  14933. },
  14934. method: "GET",
  14935. params: {
  14936. key: {
  14937. required: true,
  14938. type: "string"
  14939. }
  14940. },
  14941. url: "/codes_of_conduct/:key"
  14942. },
  14943. getForRepo: {
  14944. headers: {
  14945. accept: "application/vnd.github.scarlet-witch-preview+json"
  14946. },
  14947. method: "GET",
  14948. params: {
  14949. owner: {
  14950. required: true,
  14951. type: "string"
  14952. },
  14953. repo: {
  14954. required: true,
  14955. type: "string"
  14956. }
  14957. },
  14958. url: "/repos/:owner/:repo/community/code_of_conduct"
  14959. },
  14960. listConductCodes: {
  14961. headers: {
  14962. accept: "application/vnd.github.scarlet-witch-preview+json"
  14963. },
  14964. method: "GET",
  14965. params: {},
  14966. url: "/codes_of_conduct"
  14967. }
  14968. },
  14969. emojis: {
  14970. get: {
  14971. method: "GET",
  14972. params: {},
  14973. url: "/emojis"
  14974. }
  14975. },
  14976. gists: {
  14977. checkIsStarred: {
  14978. method: "GET",
  14979. params: {
  14980. gist_id: {
  14981. required: true,
  14982. type: "string"
  14983. }
  14984. },
  14985. url: "/gists/:gist_id/star"
  14986. },
  14987. create: {
  14988. method: "POST",
  14989. params: {
  14990. description: {
  14991. type: "string"
  14992. },
  14993. files: {
  14994. required: true,
  14995. type: "object"
  14996. },
  14997. "files.content": {
  14998. type: "string"
  14999. },
  15000. public: {
  15001. type: "boolean"
  15002. }
  15003. },
  15004. url: "/gists"
  15005. },
  15006. createComment: {
  15007. method: "POST",
  15008. params: {
  15009. body: {
  15010. required: true,
  15011. type: "string"
  15012. },
  15013. gist_id: {
  15014. required: true,
  15015. type: "string"
  15016. }
  15017. },
  15018. url: "/gists/:gist_id/comments"
  15019. },
  15020. delete: {
  15021. method: "DELETE",
  15022. params: {
  15023. gist_id: {
  15024. required: true,
  15025. type: "string"
  15026. }
  15027. },
  15028. url: "/gists/:gist_id"
  15029. },
  15030. deleteComment: {
  15031. method: "DELETE",
  15032. params: {
  15033. comment_id: {
  15034. required: true,
  15035. type: "integer"
  15036. },
  15037. gist_id: {
  15038. required: true,
  15039. type: "string"
  15040. }
  15041. },
  15042. url: "/gists/:gist_id/comments/:comment_id"
  15043. },
  15044. fork: {
  15045. method: "POST",
  15046. params: {
  15047. gist_id: {
  15048. required: true,
  15049. type: "string"
  15050. }
  15051. },
  15052. url: "/gists/:gist_id/forks"
  15053. },
  15054. get: {
  15055. method: "GET",
  15056. params: {
  15057. gist_id: {
  15058. required: true,
  15059. type: "string"
  15060. }
  15061. },
  15062. url: "/gists/:gist_id"
  15063. },
  15064. getComment: {
  15065. method: "GET",
  15066. params: {
  15067. comment_id: {
  15068. required: true,
  15069. type: "integer"
  15070. },
  15071. gist_id: {
  15072. required: true,
  15073. type: "string"
  15074. }
  15075. },
  15076. url: "/gists/:gist_id/comments/:comment_id"
  15077. },
  15078. getRevision: {
  15079. method: "GET",
  15080. params: {
  15081. gist_id: {
  15082. required: true,
  15083. type: "string"
  15084. },
  15085. sha: {
  15086. required: true,
  15087. type: "string"
  15088. }
  15089. },
  15090. url: "/gists/:gist_id/:sha"
  15091. },
  15092. list: {
  15093. method: "GET",
  15094. params: {
  15095. page: {
  15096. type: "integer"
  15097. },
  15098. per_page: {
  15099. type: "integer"
  15100. },
  15101. since: {
  15102. type: "string"
  15103. }
  15104. },
  15105. url: "/gists"
  15106. },
  15107. listComments: {
  15108. method: "GET",
  15109. params: {
  15110. gist_id: {
  15111. required: true,
  15112. type: "string"
  15113. },
  15114. page: {
  15115. type: "integer"
  15116. },
  15117. per_page: {
  15118. type: "integer"
  15119. }
  15120. },
  15121. url: "/gists/:gist_id/comments"
  15122. },
  15123. listCommits: {
  15124. method: "GET",
  15125. params: {
  15126. gist_id: {
  15127. required: true,
  15128. type: "string"
  15129. },
  15130. page: {
  15131. type: "integer"
  15132. },
  15133. per_page: {
  15134. type: "integer"
  15135. }
  15136. },
  15137. url: "/gists/:gist_id/commits"
  15138. },
  15139. listForks: {
  15140. method: "GET",
  15141. params: {
  15142. gist_id: {
  15143. required: true,
  15144. type: "string"
  15145. },
  15146. page: {
  15147. type: "integer"
  15148. },
  15149. per_page: {
  15150. type: "integer"
  15151. }
  15152. },
  15153. url: "/gists/:gist_id/forks"
  15154. },
  15155. listPublic: {
  15156. method: "GET",
  15157. params: {
  15158. page: {
  15159. type: "integer"
  15160. },
  15161. per_page: {
  15162. type: "integer"
  15163. },
  15164. since: {
  15165. type: "string"
  15166. }
  15167. },
  15168. url: "/gists/public"
  15169. },
  15170. listPublicForUser: {
  15171. method: "GET",
  15172. params: {
  15173. page: {
  15174. type: "integer"
  15175. },
  15176. per_page: {
  15177. type: "integer"
  15178. },
  15179. since: {
  15180. type: "string"
  15181. },
  15182. username: {
  15183. required: true,
  15184. type: "string"
  15185. }
  15186. },
  15187. url: "/users/:username/gists"
  15188. },
  15189. listStarred: {
  15190. method: "GET",
  15191. params: {
  15192. page: {
  15193. type: "integer"
  15194. },
  15195. per_page: {
  15196. type: "integer"
  15197. },
  15198. since: {
  15199. type: "string"
  15200. }
  15201. },
  15202. url: "/gists/starred"
  15203. },
  15204. star: {
  15205. method: "PUT",
  15206. params: {
  15207. gist_id: {
  15208. required: true,
  15209. type: "string"
  15210. }
  15211. },
  15212. url: "/gists/:gist_id/star"
  15213. },
  15214. unstar: {
  15215. method: "DELETE",
  15216. params: {
  15217. gist_id: {
  15218. required: true,
  15219. type: "string"
  15220. }
  15221. },
  15222. url: "/gists/:gist_id/star"
  15223. },
  15224. update: {
  15225. method: "PATCH",
  15226. params: {
  15227. description: {
  15228. type: "string"
  15229. },
  15230. files: {
  15231. type: "object"
  15232. },
  15233. "files.content": {
  15234. type: "string"
  15235. },
  15236. "files.filename": {
  15237. type: "string"
  15238. },
  15239. gist_id: {
  15240. required: true,
  15241. type: "string"
  15242. }
  15243. },
  15244. url: "/gists/:gist_id"
  15245. },
  15246. updateComment: {
  15247. method: "PATCH",
  15248. params: {
  15249. body: {
  15250. required: true,
  15251. type: "string"
  15252. },
  15253. comment_id: {
  15254. required: true,
  15255. type: "integer"
  15256. },
  15257. gist_id: {
  15258. required: true,
  15259. type: "string"
  15260. }
  15261. },
  15262. url: "/gists/:gist_id/comments/:comment_id"
  15263. }
  15264. },
  15265. git: {
  15266. createBlob: {
  15267. method: "POST",
  15268. params: {
  15269. content: {
  15270. required: true,
  15271. type: "string"
  15272. },
  15273. encoding: {
  15274. type: "string"
  15275. },
  15276. owner: {
  15277. required: true,
  15278. type: "string"
  15279. },
  15280. repo: {
  15281. required: true,
  15282. type: "string"
  15283. }
  15284. },
  15285. url: "/repos/:owner/:repo/git/blobs"
  15286. },
  15287. createCommit: {
  15288. method: "POST",
  15289. params: {
  15290. author: {
  15291. type: "object"
  15292. },
  15293. "author.date": {
  15294. type: "string"
  15295. },
  15296. "author.email": {
  15297. type: "string"
  15298. },
  15299. "author.name": {
  15300. type: "string"
  15301. },
  15302. committer: {
  15303. type: "object"
  15304. },
  15305. "committer.date": {
  15306. type: "string"
  15307. },
  15308. "committer.email": {
  15309. type: "string"
  15310. },
  15311. "committer.name": {
  15312. type: "string"
  15313. },
  15314. message: {
  15315. required: true,
  15316. type: "string"
  15317. },
  15318. owner: {
  15319. required: true,
  15320. type: "string"
  15321. },
  15322. parents: {
  15323. required: true,
  15324. type: "string[]"
  15325. },
  15326. repo: {
  15327. required: true,
  15328. type: "string"
  15329. },
  15330. signature: {
  15331. type: "string"
  15332. },
  15333. tree: {
  15334. required: true,
  15335. type: "string"
  15336. }
  15337. },
  15338. url: "/repos/:owner/:repo/git/commits"
  15339. },
  15340. createRef: {
  15341. method: "POST",
  15342. params: {
  15343. owner: {
  15344. required: true,
  15345. type: "string"
  15346. },
  15347. ref: {
  15348. required: true,
  15349. type: "string"
  15350. },
  15351. repo: {
  15352. required: true,
  15353. type: "string"
  15354. },
  15355. sha: {
  15356. required: true,
  15357. type: "string"
  15358. }
  15359. },
  15360. url: "/repos/:owner/:repo/git/refs"
  15361. },
  15362. createTag: {
  15363. method: "POST",
  15364. params: {
  15365. message: {
  15366. required: true,
  15367. type: "string"
  15368. },
  15369. object: {
  15370. required: true,
  15371. type: "string"
  15372. },
  15373. owner: {
  15374. required: true,
  15375. type: "string"
  15376. },
  15377. repo: {
  15378. required: true,
  15379. type: "string"
  15380. },
  15381. tag: {
  15382. required: true,
  15383. type: "string"
  15384. },
  15385. tagger: {
  15386. type: "object"
  15387. },
  15388. "tagger.date": {
  15389. type: "string"
  15390. },
  15391. "tagger.email": {
  15392. type: "string"
  15393. },
  15394. "tagger.name": {
  15395. type: "string"
  15396. },
  15397. type: {
  15398. enum: ["commit", "tree", "blob"],
  15399. required: true,
  15400. type: "string"
  15401. }
  15402. },
  15403. url: "/repos/:owner/:repo/git/tags"
  15404. },
  15405. createTree: {
  15406. method: "POST",
  15407. params: {
  15408. base_tree: {
  15409. type: "string"
  15410. },
  15411. owner: {
  15412. required: true,
  15413. type: "string"
  15414. },
  15415. repo: {
  15416. required: true,
  15417. type: "string"
  15418. },
  15419. tree: {
  15420. required: true,
  15421. type: "object[]"
  15422. },
  15423. "tree[].content": {
  15424. type: "string"
  15425. },
  15426. "tree[].mode": {
  15427. enum: ["100644", "100755", "040000", "160000", "120000"],
  15428. type: "string"
  15429. },
  15430. "tree[].path": {
  15431. type: "string"
  15432. },
  15433. "tree[].sha": {
  15434. allowNull: true,
  15435. type: "string"
  15436. },
  15437. "tree[].type": {
  15438. enum: ["blob", "tree", "commit"],
  15439. type: "string"
  15440. }
  15441. },
  15442. url: "/repos/:owner/:repo/git/trees"
  15443. },
  15444. deleteRef: {
  15445. method: "DELETE",
  15446. params: {
  15447. owner: {
  15448. required: true,
  15449. type: "string"
  15450. },
  15451. ref: {
  15452. required: true,
  15453. type: "string"
  15454. },
  15455. repo: {
  15456. required: true,
  15457. type: "string"
  15458. }
  15459. },
  15460. url: "/repos/:owner/:repo/git/refs/:ref"
  15461. },
  15462. getBlob: {
  15463. method: "GET",
  15464. params: {
  15465. file_sha: {
  15466. required: true,
  15467. type: "string"
  15468. },
  15469. owner: {
  15470. required: true,
  15471. type: "string"
  15472. },
  15473. repo: {
  15474. required: true,
  15475. type: "string"
  15476. }
  15477. },
  15478. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15479. },
  15480. getCommit: {
  15481. method: "GET",
  15482. params: {
  15483. commit_sha: {
  15484. required: true,
  15485. type: "string"
  15486. },
  15487. owner: {
  15488. required: true,
  15489. type: "string"
  15490. },
  15491. repo: {
  15492. required: true,
  15493. type: "string"
  15494. }
  15495. },
  15496. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15497. },
  15498. getRef: {
  15499. method: "GET",
  15500. params: {
  15501. owner: {
  15502. required: true,
  15503. type: "string"
  15504. },
  15505. ref: {
  15506. required: true,
  15507. type: "string"
  15508. },
  15509. repo: {
  15510. required: true,
  15511. type: "string"
  15512. }
  15513. },
  15514. url: "/repos/:owner/:repo/git/ref/:ref"
  15515. },
  15516. getTag: {
  15517. method: "GET",
  15518. params: {
  15519. owner: {
  15520. required: true,
  15521. type: "string"
  15522. },
  15523. repo: {
  15524. required: true,
  15525. type: "string"
  15526. },
  15527. tag_sha: {
  15528. required: true,
  15529. type: "string"
  15530. }
  15531. },
  15532. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15533. },
  15534. getTree: {
  15535. method: "GET",
  15536. params: {
  15537. owner: {
  15538. required: true,
  15539. type: "string"
  15540. },
  15541. recursive: {
  15542. enum: ["1"],
  15543. type: "integer"
  15544. },
  15545. repo: {
  15546. required: true,
  15547. type: "string"
  15548. },
  15549. tree_sha: {
  15550. required: true,
  15551. type: "string"
  15552. }
  15553. },
  15554. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15555. },
  15556. listMatchingRefs: {
  15557. method: "GET",
  15558. params: {
  15559. owner: {
  15560. required: true,
  15561. type: "string"
  15562. },
  15563. page: {
  15564. type: "integer"
  15565. },
  15566. per_page: {
  15567. type: "integer"
  15568. },
  15569. ref: {
  15570. required: true,
  15571. type: "string"
  15572. },
  15573. repo: {
  15574. required: true,
  15575. type: "string"
  15576. }
  15577. },
  15578. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15579. },
  15580. listRefs: {
  15581. method: "GET",
  15582. params: {
  15583. namespace: {
  15584. type: "string"
  15585. },
  15586. owner: {
  15587. required: true,
  15588. type: "string"
  15589. },
  15590. page: {
  15591. type: "integer"
  15592. },
  15593. per_page: {
  15594. type: "integer"
  15595. },
  15596. repo: {
  15597. required: true,
  15598. type: "string"
  15599. }
  15600. },
  15601. url: "/repos/:owner/:repo/git/refs/:namespace"
  15602. },
  15603. updateRef: {
  15604. method: "PATCH",
  15605. params: {
  15606. force: {
  15607. type: "boolean"
  15608. },
  15609. owner: {
  15610. required: true,
  15611. type: "string"
  15612. },
  15613. ref: {
  15614. required: true,
  15615. type: "string"
  15616. },
  15617. repo: {
  15618. required: true,
  15619. type: "string"
  15620. },
  15621. sha: {
  15622. required: true,
  15623. type: "string"
  15624. }
  15625. },
  15626. url: "/repos/:owner/:repo/git/refs/:ref"
  15627. }
  15628. },
  15629. gitignore: {
  15630. getTemplate: {
  15631. method: "GET",
  15632. params: {
  15633. name: {
  15634. required: true,
  15635. type: "string"
  15636. }
  15637. },
  15638. url: "/gitignore/templates/:name"
  15639. },
  15640. listTemplates: {
  15641. method: "GET",
  15642. params: {},
  15643. url: "/gitignore/templates"
  15644. }
  15645. },
  15646. interactions: {
  15647. addOrUpdateRestrictionsForOrg: {
  15648. headers: {
  15649. accept: "application/vnd.github.sombra-preview+json"
  15650. },
  15651. method: "PUT",
  15652. params: {
  15653. limit: {
  15654. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15655. required: true,
  15656. type: "string"
  15657. },
  15658. org: {
  15659. required: true,
  15660. type: "string"
  15661. }
  15662. },
  15663. url: "/orgs/:org/interaction-limits"
  15664. },
  15665. addOrUpdateRestrictionsForRepo: {
  15666. headers: {
  15667. accept: "application/vnd.github.sombra-preview+json"
  15668. },
  15669. method: "PUT",
  15670. params: {
  15671. limit: {
  15672. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15673. required: true,
  15674. type: "string"
  15675. },
  15676. owner: {
  15677. required: true,
  15678. type: "string"
  15679. },
  15680. repo: {
  15681. required: true,
  15682. type: "string"
  15683. }
  15684. },
  15685. url: "/repos/:owner/:repo/interaction-limits"
  15686. },
  15687. getRestrictionsForOrg: {
  15688. headers: {
  15689. accept: "application/vnd.github.sombra-preview+json"
  15690. },
  15691. method: "GET",
  15692. params: {
  15693. org: {
  15694. required: true,
  15695. type: "string"
  15696. }
  15697. },
  15698. url: "/orgs/:org/interaction-limits"
  15699. },
  15700. getRestrictionsForRepo: {
  15701. headers: {
  15702. accept: "application/vnd.github.sombra-preview+json"
  15703. },
  15704. method: "GET",
  15705. params: {
  15706. owner: {
  15707. required: true,
  15708. type: "string"
  15709. },
  15710. repo: {
  15711. required: true,
  15712. type: "string"
  15713. }
  15714. },
  15715. url: "/repos/:owner/:repo/interaction-limits"
  15716. },
  15717. removeRestrictionsForOrg: {
  15718. headers: {
  15719. accept: "application/vnd.github.sombra-preview+json"
  15720. },
  15721. method: "DELETE",
  15722. params: {
  15723. org: {
  15724. required: true,
  15725. type: "string"
  15726. }
  15727. },
  15728. url: "/orgs/:org/interaction-limits"
  15729. },
  15730. removeRestrictionsForRepo: {
  15731. headers: {
  15732. accept: "application/vnd.github.sombra-preview+json"
  15733. },
  15734. method: "DELETE",
  15735. params: {
  15736. owner: {
  15737. required: true,
  15738. type: "string"
  15739. },
  15740. repo: {
  15741. required: true,
  15742. type: "string"
  15743. }
  15744. },
  15745. url: "/repos/:owner/:repo/interaction-limits"
  15746. }
  15747. },
  15748. issues: {
  15749. addAssignees: {
  15750. method: "POST",
  15751. params: {
  15752. assignees: {
  15753. type: "string[]"
  15754. },
  15755. issue_number: {
  15756. required: true,
  15757. type: "integer"
  15758. },
  15759. number: {
  15760. alias: "issue_number",
  15761. deprecated: true,
  15762. type: "integer"
  15763. },
  15764. owner: {
  15765. required: true,
  15766. type: "string"
  15767. },
  15768. repo: {
  15769. required: true,
  15770. type: "string"
  15771. }
  15772. },
  15773. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15774. },
  15775. addLabels: {
  15776. method: "POST",
  15777. params: {
  15778. issue_number: {
  15779. required: true,
  15780. type: "integer"
  15781. },
  15782. labels: {
  15783. required: true,
  15784. type: "string[]"
  15785. },
  15786. number: {
  15787. alias: "issue_number",
  15788. deprecated: true,
  15789. type: "integer"
  15790. },
  15791. owner: {
  15792. required: true,
  15793. type: "string"
  15794. },
  15795. repo: {
  15796. required: true,
  15797. type: "string"
  15798. }
  15799. },
  15800. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15801. },
  15802. checkAssignee: {
  15803. method: "GET",
  15804. params: {
  15805. assignee: {
  15806. required: true,
  15807. type: "string"
  15808. },
  15809. owner: {
  15810. required: true,
  15811. type: "string"
  15812. },
  15813. repo: {
  15814. required: true,
  15815. type: "string"
  15816. }
  15817. },
  15818. url: "/repos/:owner/:repo/assignees/:assignee"
  15819. },
  15820. create: {
  15821. method: "POST",
  15822. params: {
  15823. assignee: {
  15824. type: "string"
  15825. },
  15826. assignees: {
  15827. type: "string[]"
  15828. },
  15829. body: {
  15830. type: "string"
  15831. },
  15832. labels: {
  15833. type: "string[]"
  15834. },
  15835. milestone: {
  15836. type: "integer"
  15837. },
  15838. owner: {
  15839. required: true,
  15840. type: "string"
  15841. },
  15842. repo: {
  15843. required: true,
  15844. type: "string"
  15845. },
  15846. title: {
  15847. required: true,
  15848. type: "string"
  15849. }
  15850. },
  15851. url: "/repos/:owner/:repo/issues"
  15852. },
  15853. createComment: {
  15854. method: "POST",
  15855. params: {
  15856. body: {
  15857. required: true,
  15858. type: "string"
  15859. },
  15860. issue_number: {
  15861. required: true,
  15862. type: "integer"
  15863. },
  15864. number: {
  15865. alias: "issue_number",
  15866. deprecated: true,
  15867. type: "integer"
  15868. },
  15869. owner: {
  15870. required: true,
  15871. type: "string"
  15872. },
  15873. repo: {
  15874. required: true,
  15875. type: "string"
  15876. }
  15877. },
  15878. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15879. },
  15880. createLabel: {
  15881. method: "POST",
  15882. params: {
  15883. color: {
  15884. required: true,
  15885. type: "string"
  15886. },
  15887. description: {
  15888. type: "string"
  15889. },
  15890. name: {
  15891. required: true,
  15892. type: "string"
  15893. },
  15894. owner: {
  15895. required: true,
  15896. type: "string"
  15897. },
  15898. repo: {
  15899. required: true,
  15900. type: "string"
  15901. }
  15902. },
  15903. url: "/repos/:owner/:repo/labels"
  15904. },
  15905. createMilestone: {
  15906. method: "POST",
  15907. params: {
  15908. description: {
  15909. type: "string"
  15910. },
  15911. due_on: {
  15912. type: "string"
  15913. },
  15914. owner: {
  15915. required: true,
  15916. type: "string"
  15917. },
  15918. repo: {
  15919. required: true,
  15920. type: "string"
  15921. },
  15922. state: {
  15923. enum: ["open", "closed"],
  15924. type: "string"
  15925. },
  15926. title: {
  15927. required: true,
  15928. type: "string"
  15929. }
  15930. },
  15931. url: "/repos/:owner/:repo/milestones"
  15932. },
  15933. deleteComment: {
  15934. method: "DELETE",
  15935. params: {
  15936. comment_id: {
  15937. required: true,
  15938. type: "integer"
  15939. },
  15940. owner: {
  15941. required: true,
  15942. type: "string"
  15943. },
  15944. repo: {
  15945. required: true,
  15946. type: "string"
  15947. }
  15948. },
  15949. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15950. },
  15951. deleteLabel: {
  15952. method: "DELETE",
  15953. params: {
  15954. name: {
  15955. required: true,
  15956. type: "string"
  15957. },
  15958. owner: {
  15959. required: true,
  15960. type: "string"
  15961. },
  15962. repo: {
  15963. required: true,
  15964. type: "string"
  15965. }
  15966. },
  15967. url: "/repos/:owner/:repo/labels/:name"
  15968. },
  15969. deleteMilestone: {
  15970. method: "DELETE",
  15971. params: {
  15972. milestone_number: {
  15973. required: true,
  15974. type: "integer"
  15975. },
  15976. number: {
  15977. alias: "milestone_number",
  15978. deprecated: true,
  15979. type: "integer"
  15980. },
  15981. owner: {
  15982. required: true,
  15983. type: "string"
  15984. },
  15985. repo: {
  15986. required: true,
  15987. type: "string"
  15988. }
  15989. },
  15990. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15991. },
  15992. get: {
  15993. method: "GET",
  15994. params: {
  15995. issue_number: {
  15996. required: true,
  15997. type: "integer"
  15998. },
  15999. number: {
  16000. alias: "issue_number",
  16001. deprecated: true,
  16002. type: "integer"
  16003. },
  16004. owner: {
  16005. required: true,
  16006. type: "string"
  16007. },
  16008. repo: {
  16009. required: true,
  16010. type: "string"
  16011. }
  16012. },
  16013. url: "/repos/:owner/:repo/issues/:issue_number"
  16014. },
  16015. getComment: {
  16016. method: "GET",
  16017. params: {
  16018. comment_id: {
  16019. required: true,
  16020. type: "integer"
  16021. },
  16022. owner: {
  16023. required: true,
  16024. type: "string"
  16025. },
  16026. repo: {
  16027. required: true,
  16028. type: "string"
  16029. }
  16030. },
  16031. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16032. },
  16033. getEvent: {
  16034. method: "GET",
  16035. params: {
  16036. event_id: {
  16037. required: true,
  16038. type: "integer"
  16039. },
  16040. owner: {
  16041. required: true,
  16042. type: "string"
  16043. },
  16044. repo: {
  16045. required: true,
  16046. type: "string"
  16047. }
  16048. },
  16049. url: "/repos/:owner/:repo/issues/events/:event_id"
  16050. },
  16051. getLabel: {
  16052. method: "GET",
  16053. params: {
  16054. name: {
  16055. required: true,
  16056. type: "string"
  16057. },
  16058. owner: {
  16059. required: true,
  16060. type: "string"
  16061. },
  16062. repo: {
  16063. required: true,
  16064. type: "string"
  16065. }
  16066. },
  16067. url: "/repos/:owner/:repo/labels/:name"
  16068. },
  16069. getMilestone: {
  16070. method: "GET",
  16071. params: {
  16072. milestone_number: {
  16073. required: true,
  16074. type: "integer"
  16075. },
  16076. number: {
  16077. alias: "milestone_number",
  16078. deprecated: true,
  16079. type: "integer"
  16080. },
  16081. owner: {
  16082. required: true,
  16083. type: "string"
  16084. },
  16085. repo: {
  16086. required: true,
  16087. type: "string"
  16088. }
  16089. },
  16090. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16091. },
  16092. list: {
  16093. method: "GET",
  16094. params: {
  16095. direction: {
  16096. enum: ["asc", "desc"],
  16097. type: "string"
  16098. },
  16099. filter: {
  16100. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16101. type: "string"
  16102. },
  16103. labels: {
  16104. type: "string"
  16105. },
  16106. page: {
  16107. type: "integer"
  16108. },
  16109. per_page: {
  16110. type: "integer"
  16111. },
  16112. since: {
  16113. type: "string"
  16114. },
  16115. sort: {
  16116. enum: ["created", "updated", "comments"],
  16117. type: "string"
  16118. },
  16119. state: {
  16120. enum: ["open", "closed", "all"],
  16121. type: "string"
  16122. }
  16123. },
  16124. url: "/issues"
  16125. },
  16126. listAssignees: {
  16127. method: "GET",
  16128. params: {
  16129. owner: {
  16130. required: true,
  16131. type: "string"
  16132. },
  16133. page: {
  16134. type: "integer"
  16135. },
  16136. per_page: {
  16137. type: "integer"
  16138. },
  16139. repo: {
  16140. required: true,
  16141. type: "string"
  16142. }
  16143. },
  16144. url: "/repos/:owner/:repo/assignees"
  16145. },
  16146. listComments: {
  16147. method: "GET",
  16148. params: {
  16149. issue_number: {
  16150. required: true,
  16151. type: "integer"
  16152. },
  16153. number: {
  16154. alias: "issue_number",
  16155. deprecated: true,
  16156. type: "integer"
  16157. },
  16158. owner: {
  16159. required: true,
  16160. type: "string"
  16161. },
  16162. page: {
  16163. type: "integer"
  16164. },
  16165. per_page: {
  16166. type: "integer"
  16167. },
  16168. repo: {
  16169. required: true,
  16170. type: "string"
  16171. },
  16172. since: {
  16173. type: "string"
  16174. }
  16175. },
  16176. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  16177. },
  16178. listCommentsForRepo: {
  16179. method: "GET",
  16180. params: {
  16181. direction: {
  16182. enum: ["asc", "desc"],
  16183. type: "string"
  16184. },
  16185. owner: {
  16186. required: true,
  16187. type: "string"
  16188. },
  16189. repo: {
  16190. required: true,
  16191. type: "string"
  16192. },
  16193. since: {
  16194. type: "string"
  16195. },
  16196. sort: {
  16197. enum: ["created", "updated"],
  16198. type: "string"
  16199. }
  16200. },
  16201. url: "/repos/:owner/:repo/issues/comments"
  16202. },
  16203. listEvents: {
  16204. method: "GET",
  16205. params: {
  16206. issue_number: {
  16207. required: true,
  16208. type: "integer"
  16209. },
  16210. number: {
  16211. alias: "issue_number",
  16212. deprecated: true,
  16213. type: "integer"
  16214. },
  16215. owner: {
  16216. required: true,
  16217. type: "string"
  16218. },
  16219. page: {
  16220. type: "integer"
  16221. },
  16222. per_page: {
  16223. type: "integer"
  16224. },
  16225. repo: {
  16226. required: true,
  16227. type: "string"
  16228. }
  16229. },
  16230. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16231. },
  16232. listEventsForRepo: {
  16233. method: "GET",
  16234. params: {
  16235. owner: {
  16236. required: true,
  16237. type: "string"
  16238. },
  16239. page: {
  16240. type: "integer"
  16241. },
  16242. per_page: {
  16243. type: "integer"
  16244. },
  16245. repo: {
  16246. required: true,
  16247. type: "string"
  16248. }
  16249. },
  16250. url: "/repos/:owner/:repo/issues/events"
  16251. },
  16252. listEventsForTimeline: {
  16253. headers: {
  16254. accept: "application/vnd.github.mockingbird-preview+json"
  16255. },
  16256. method: "GET",
  16257. params: {
  16258. issue_number: {
  16259. required: true,
  16260. type: "integer"
  16261. },
  16262. number: {
  16263. alias: "issue_number",
  16264. deprecated: true,
  16265. type: "integer"
  16266. },
  16267. owner: {
  16268. required: true,
  16269. type: "string"
  16270. },
  16271. page: {
  16272. type: "integer"
  16273. },
  16274. per_page: {
  16275. type: "integer"
  16276. },
  16277. repo: {
  16278. required: true,
  16279. type: "string"
  16280. }
  16281. },
  16282. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16283. },
  16284. listForAuthenticatedUser: {
  16285. method: "GET",
  16286. params: {
  16287. direction: {
  16288. enum: ["asc", "desc"],
  16289. type: "string"
  16290. },
  16291. filter: {
  16292. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16293. type: "string"
  16294. },
  16295. labels: {
  16296. type: "string"
  16297. },
  16298. page: {
  16299. type: "integer"
  16300. },
  16301. per_page: {
  16302. type: "integer"
  16303. },
  16304. since: {
  16305. type: "string"
  16306. },
  16307. sort: {
  16308. enum: ["created", "updated", "comments"],
  16309. type: "string"
  16310. },
  16311. state: {
  16312. enum: ["open", "closed", "all"],
  16313. type: "string"
  16314. }
  16315. },
  16316. url: "/user/issues"
  16317. },
  16318. listForOrg: {
  16319. method: "GET",
  16320. params: {
  16321. direction: {
  16322. enum: ["asc", "desc"],
  16323. type: "string"
  16324. },
  16325. filter: {
  16326. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16327. type: "string"
  16328. },
  16329. labels: {
  16330. type: "string"
  16331. },
  16332. org: {
  16333. required: true,
  16334. type: "string"
  16335. },
  16336. page: {
  16337. type: "integer"
  16338. },
  16339. per_page: {
  16340. type: "integer"
  16341. },
  16342. since: {
  16343. type: "string"
  16344. },
  16345. sort: {
  16346. enum: ["created", "updated", "comments"],
  16347. type: "string"
  16348. },
  16349. state: {
  16350. enum: ["open", "closed", "all"],
  16351. type: "string"
  16352. }
  16353. },
  16354. url: "/orgs/:org/issues"
  16355. },
  16356. listForRepo: {
  16357. method: "GET",
  16358. params: {
  16359. assignee: {
  16360. type: "string"
  16361. },
  16362. creator: {
  16363. type: "string"
  16364. },
  16365. direction: {
  16366. enum: ["asc", "desc"],
  16367. type: "string"
  16368. },
  16369. labels: {
  16370. type: "string"
  16371. },
  16372. mentioned: {
  16373. type: "string"
  16374. },
  16375. milestone: {
  16376. type: "string"
  16377. },
  16378. owner: {
  16379. required: true,
  16380. type: "string"
  16381. },
  16382. page: {
  16383. type: "integer"
  16384. },
  16385. per_page: {
  16386. type: "integer"
  16387. },
  16388. repo: {
  16389. required: true,
  16390. type: "string"
  16391. },
  16392. since: {
  16393. type: "string"
  16394. },
  16395. sort: {
  16396. enum: ["created", "updated", "comments"],
  16397. type: "string"
  16398. },
  16399. state: {
  16400. enum: ["open", "closed", "all"],
  16401. type: "string"
  16402. }
  16403. },
  16404. url: "/repos/:owner/:repo/issues"
  16405. },
  16406. listLabelsForMilestone: {
  16407. method: "GET",
  16408. params: {
  16409. milestone_number: {
  16410. required: true,
  16411. type: "integer"
  16412. },
  16413. number: {
  16414. alias: "milestone_number",
  16415. deprecated: true,
  16416. type: "integer"
  16417. },
  16418. owner: {
  16419. required: true,
  16420. type: "string"
  16421. },
  16422. page: {
  16423. type: "integer"
  16424. },
  16425. per_page: {
  16426. type: "integer"
  16427. },
  16428. repo: {
  16429. required: true,
  16430. type: "string"
  16431. }
  16432. },
  16433. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16434. },
  16435. listLabelsForRepo: {
  16436. method: "GET",
  16437. params: {
  16438. owner: {
  16439. required: true,
  16440. type: "string"
  16441. },
  16442. page: {
  16443. type: "integer"
  16444. },
  16445. per_page: {
  16446. type: "integer"
  16447. },
  16448. repo: {
  16449. required: true,
  16450. type: "string"
  16451. }
  16452. },
  16453. url: "/repos/:owner/:repo/labels"
  16454. },
  16455. listLabelsOnIssue: {
  16456. method: "GET",
  16457. params: {
  16458. issue_number: {
  16459. required: true,
  16460. type: "integer"
  16461. },
  16462. number: {
  16463. alias: "issue_number",
  16464. deprecated: true,
  16465. type: "integer"
  16466. },
  16467. owner: {
  16468. required: true,
  16469. type: "string"
  16470. },
  16471. page: {
  16472. type: "integer"
  16473. },
  16474. per_page: {
  16475. type: "integer"
  16476. },
  16477. repo: {
  16478. required: true,
  16479. type: "string"
  16480. }
  16481. },
  16482. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16483. },
  16484. listMilestonesForRepo: {
  16485. method: "GET",
  16486. params: {
  16487. direction: {
  16488. enum: ["asc", "desc"],
  16489. type: "string"
  16490. },
  16491. owner: {
  16492. required: true,
  16493. type: "string"
  16494. },
  16495. page: {
  16496. type: "integer"
  16497. },
  16498. per_page: {
  16499. type: "integer"
  16500. },
  16501. repo: {
  16502. required: true,
  16503. type: "string"
  16504. },
  16505. sort: {
  16506. enum: ["due_on", "completeness"],
  16507. type: "string"
  16508. },
  16509. state: {
  16510. enum: ["open", "closed", "all"],
  16511. type: "string"
  16512. }
  16513. },
  16514. url: "/repos/:owner/:repo/milestones"
  16515. },
  16516. lock: {
  16517. method: "PUT",
  16518. params: {
  16519. issue_number: {
  16520. required: true,
  16521. type: "integer"
  16522. },
  16523. lock_reason: {
  16524. enum: ["off-topic", "too heated", "resolved", "spam"],
  16525. type: "string"
  16526. },
  16527. number: {
  16528. alias: "issue_number",
  16529. deprecated: true,
  16530. type: "integer"
  16531. },
  16532. owner: {
  16533. required: true,
  16534. type: "string"
  16535. },
  16536. repo: {
  16537. required: true,
  16538. type: "string"
  16539. }
  16540. },
  16541. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16542. },
  16543. removeAssignees: {
  16544. method: "DELETE",
  16545. params: {
  16546. assignees: {
  16547. type: "string[]"
  16548. },
  16549. issue_number: {
  16550. required: true,
  16551. type: "integer"
  16552. },
  16553. number: {
  16554. alias: "issue_number",
  16555. deprecated: true,
  16556. type: "integer"
  16557. },
  16558. owner: {
  16559. required: true,
  16560. type: "string"
  16561. },
  16562. repo: {
  16563. required: true,
  16564. type: "string"
  16565. }
  16566. },
  16567. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16568. },
  16569. removeLabel: {
  16570. method: "DELETE",
  16571. params: {
  16572. issue_number: {
  16573. required: true,
  16574. type: "integer"
  16575. },
  16576. name: {
  16577. required: true,
  16578. type: "string"
  16579. },
  16580. number: {
  16581. alias: "issue_number",
  16582. deprecated: true,
  16583. type: "integer"
  16584. },
  16585. owner: {
  16586. required: true,
  16587. type: "string"
  16588. },
  16589. repo: {
  16590. required: true,
  16591. type: "string"
  16592. }
  16593. },
  16594. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16595. },
  16596. removeLabels: {
  16597. method: "DELETE",
  16598. params: {
  16599. issue_number: {
  16600. required: true,
  16601. type: "integer"
  16602. },
  16603. number: {
  16604. alias: "issue_number",
  16605. deprecated: true,
  16606. type: "integer"
  16607. },
  16608. owner: {
  16609. required: true,
  16610. type: "string"
  16611. },
  16612. repo: {
  16613. required: true,
  16614. type: "string"
  16615. }
  16616. },
  16617. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16618. },
  16619. replaceLabels: {
  16620. method: "PUT",
  16621. params: {
  16622. issue_number: {
  16623. required: true,
  16624. type: "integer"
  16625. },
  16626. labels: {
  16627. type: "string[]"
  16628. },
  16629. number: {
  16630. alias: "issue_number",
  16631. deprecated: true,
  16632. type: "integer"
  16633. },
  16634. owner: {
  16635. required: true,
  16636. type: "string"
  16637. },
  16638. repo: {
  16639. required: true,
  16640. type: "string"
  16641. }
  16642. },
  16643. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16644. },
  16645. unlock: {
  16646. method: "DELETE",
  16647. params: {
  16648. issue_number: {
  16649. required: true,
  16650. type: "integer"
  16651. },
  16652. number: {
  16653. alias: "issue_number",
  16654. deprecated: true,
  16655. type: "integer"
  16656. },
  16657. owner: {
  16658. required: true,
  16659. type: "string"
  16660. },
  16661. repo: {
  16662. required: true,
  16663. type: "string"
  16664. }
  16665. },
  16666. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16667. },
  16668. update: {
  16669. method: "PATCH",
  16670. params: {
  16671. assignee: {
  16672. type: "string"
  16673. },
  16674. assignees: {
  16675. type: "string[]"
  16676. },
  16677. body: {
  16678. type: "string"
  16679. },
  16680. issue_number: {
  16681. required: true,
  16682. type: "integer"
  16683. },
  16684. labels: {
  16685. type: "string[]"
  16686. },
  16687. milestone: {
  16688. allowNull: true,
  16689. type: "integer"
  16690. },
  16691. number: {
  16692. alias: "issue_number",
  16693. deprecated: true,
  16694. type: "integer"
  16695. },
  16696. owner: {
  16697. required: true,
  16698. type: "string"
  16699. },
  16700. repo: {
  16701. required: true,
  16702. type: "string"
  16703. },
  16704. state: {
  16705. enum: ["open", "closed"],
  16706. type: "string"
  16707. },
  16708. title: {
  16709. type: "string"
  16710. }
  16711. },
  16712. url: "/repos/:owner/:repo/issues/:issue_number"
  16713. },
  16714. updateComment: {
  16715. method: "PATCH",
  16716. params: {
  16717. body: {
  16718. required: true,
  16719. type: "string"
  16720. },
  16721. comment_id: {
  16722. required: true,
  16723. type: "integer"
  16724. },
  16725. owner: {
  16726. required: true,
  16727. type: "string"
  16728. },
  16729. repo: {
  16730. required: true,
  16731. type: "string"
  16732. }
  16733. },
  16734. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16735. },
  16736. updateLabel: {
  16737. method: "PATCH",
  16738. params: {
  16739. color: {
  16740. type: "string"
  16741. },
  16742. current_name: {
  16743. required: true,
  16744. type: "string"
  16745. },
  16746. description: {
  16747. type: "string"
  16748. },
  16749. name: {
  16750. type: "string"
  16751. },
  16752. owner: {
  16753. required: true,
  16754. type: "string"
  16755. },
  16756. repo: {
  16757. required: true,
  16758. type: "string"
  16759. }
  16760. },
  16761. url: "/repos/:owner/:repo/labels/:current_name"
  16762. },
  16763. updateMilestone: {
  16764. method: "PATCH",
  16765. params: {
  16766. description: {
  16767. type: "string"
  16768. },
  16769. due_on: {
  16770. type: "string"
  16771. },
  16772. milestone_number: {
  16773. required: true,
  16774. type: "integer"
  16775. },
  16776. number: {
  16777. alias: "milestone_number",
  16778. deprecated: true,
  16779. type: "integer"
  16780. },
  16781. owner: {
  16782. required: true,
  16783. type: "string"
  16784. },
  16785. repo: {
  16786. required: true,
  16787. type: "string"
  16788. },
  16789. state: {
  16790. enum: ["open", "closed"],
  16791. type: "string"
  16792. },
  16793. title: {
  16794. type: "string"
  16795. }
  16796. },
  16797. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16798. }
  16799. },
  16800. licenses: {
  16801. get: {
  16802. method: "GET",
  16803. params: {
  16804. license: {
  16805. required: true,
  16806. type: "string"
  16807. }
  16808. },
  16809. url: "/licenses/:license"
  16810. },
  16811. getForRepo: {
  16812. method: "GET",
  16813. params: {
  16814. owner: {
  16815. required: true,
  16816. type: "string"
  16817. },
  16818. repo: {
  16819. required: true,
  16820. type: "string"
  16821. }
  16822. },
  16823. url: "/repos/:owner/:repo/license"
  16824. },
  16825. list: {
  16826. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16827. method: "GET",
  16828. params: {},
  16829. url: "/licenses"
  16830. },
  16831. listCommonlyUsed: {
  16832. method: "GET",
  16833. params: {},
  16834. url: "/licenses"
  16835. }
  16836. },
  16837. markdown: {
  16838. render: {
  16839. method: "POST",
  16840. params: {
  16841. context: {
  16842. type: "string"
  16843. },
  16844. mode: {
  16845. enum: ["markdown", "gfm"],
  16846. type: "string"
  16847. },
  16848. text: {
  16849. required: true,
  16850. type: "string"
  16851. }
  16852. },
  16853. url: "/markdown"
  16854. },
  16855. renderRaw: {
  16856. headers: {
  16857. "content-type": "text/plain; charset=utf-8"
  16858. },
  16859. method: "POST",
  16860. params: {
  16861. data: {
  16862. mapTo: "data",
  16863. required: true,
  16864. type: "string"
  16865. }
  16866. },
  16867. url: "/markdown/raw"
  16868. }
  16869. },
  16870. meta: {
  16871. get: {
  16872. method: "GET",
  16873. params: {},
  16874. url: "/meta"
  16875. }
  16876. },
  16877. migrations: {
  16878. cancelImport: {
  16879. method: "DELETE",
  16880. params: {
  16881. owner: {
  16882. required: true,
  16883. type: "string"
  16884. },
  16885. repo: {
  16886. required: true,
  16887. type: "string"
  16888. }
  16889. },
  16890. url: "/repos/:owner/:repo/import"
  16891. },
  16892. deleteArchiveForAuthenticatedUser: {
  16893. headers: {
  16894. accept: "application/vnd.github.wyandotte-preview+json"
  16895. },
  16896. method: "DELETE",
  16897. params: {
  16898. migration_id: {
  16899. required: true,
  16900. type: "integer"
  16901. }
  16902. },
  16903. url: "/user/migrations/:migration_id/archive"
  16904. },
  16905. deleteArchiveForOrg: {
  16906. headers: {
  16907. accept: "application/vnd.github.wyandotte-preview+json"
  16908. },
  16909. method: "DELETE",
  16910. params: {
  16911. migration_id: {
  16912. required: true,
  16913. type: "integer"
  16914. },
  16915. org: {
  16916. required: true,
  16917. type: "string"
  16918. }
  16919. },
  16920. url: "/orgs/:org/migrations/:migration_id/archive"
  16921. },
  16922. downloadArchiveForOrg: {
  16923. headers: {
  16924. accept: "application/vnd.github.wyandotte-preview+json"
  16925. },
  16926. method: "GET",
  16927. params: {
  16928. migration_id: {
  16929. required: true,
  16930. type: "integer"
  16931. },
  16932. org: {
  16933. required: true,
  16934. type: "string"
  16935. }
  16936. },
  16937. url: "/orgs/:org/migrations/:migration_id/archive"
  16938. },
  16939. getArchiveForAuthenticatedUser: {
  16940. headers: {
  16941. accept: "application/vnd.github.wyandotte-preview+json"
  16942. },
  16943. method: "GET",
  16944. params: {
  16945. migration_id: {
  16946. required: true,
  16947. type: "integer"
  16948. }
  16949. },
  16950. url: "/user/migrations/:migration_id/archive"
  16951. },
  16952. getArchiveForOrg: {
  16953. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16954. headers: {
  16955. accept: "application/vnd.github.wyandotte-preview+json"
  16956. },
  16957. method: "GET",
  16958. params: {
  16959. migration_id: {
  16960. required: true,
  16961. type: "integer"
  16962. },
  16963. org: {
  16964. required: true,
  16965. type: "string"
  16966. }
  16967. },
  16968. url: "/orgs/:org/migrations/:migration_id/archive"
  16969. },
  16970. getCommitAuthors: {
  16971. method: "GET",
  16972. params: {
  16973. owner: {
  16974. required: true,
  16975. type: "string"
  16976. },
  16977. repo: {
  16978. required: true,
  16979. type: "string"
  16980. },
  16981. since: {
  16982. type: "string"
  16983. }
  16984. },
  16985. url: "/repos/:owner/:repo/import/authors"
  16986. },
  16987. getImportProgress: {
  16988. method: "GET",
  16989. params: {
  16990. owner: {
  16991. required: true,
  16992. type: "string"
  16993. },
  16994. repo: {
  16995. required: true,
  16996. type: "string"
  16997. }
  16998. },
  16999. url: "/repos/:owner/:repo/import"
  17000. },
  17001. getLargeFiles: {
  17002. method: "GET",
  17003. params: {
  17004. owner: {
  17005. required: true,
  17006. type: "string"
  17007. },
  17008. repo: {
  17009. required: true,
  17010. type: "string"
  17011. }
  17012. },
  17013. url: "/repos/:owner/:repo/import/large_files"
  17014. },
  17015. getStatusForAuthenticatedUser: {
  17016. headers: {
  17017. accept: "application/vnd.github.wyandotte-preview+json"
  17018. },
  17019. method: "GET",
  17020. params: {
  17021. migration_id: {
  17022. required: true,
  17023. type: "integer"
  17024. }
  17025. },
  17026. url: "/user/migrations/:migration_id"
  17027. },
  17028. getStatusForOrg: {
  17029. headers: {
  17030. accept: "application/vnd.github.wyandotte-preview+json"
  17031. },
  17032. method: "GET",
  17033. params: {
  17034. migration_id: {
  17035. required: true,
  17036. type: "integer"
  17037. },
  17038. org: {
  17039. required: true,
  17040. type: "string"
  17041. }
  17042. },
  17043. url: "/orgs/:org/migrations/:migration_id"
  17044. },
  17045. listForAuthenticatedUser: {
  17046. headers: {
  17047. accept: "application/vnd.github.wyandotte-preview+json"
  17048. },
  17049. method: "GET",
  17050. params: {
  17051. page: {
  17052. type: "integer"
  17053. },
  17054. per_page: {
  17055. type: "integer"
  17056. }
  17057. },
  17058. url: "/user/migrations"
  17059. },
  17060. listForOrg: {
  17061. headers: {
  17062. accept: "application/vnd.github.wyandotte-preview+json"
  17063. },
  17064. method: "GET",
  17065. params: {
  17066. org: {
  17067. required: true,
  17068. type: "string"
  17069. },
  17070. page: {
  17071. type: "integer"
  17072. },
  17073. per_page: {
  17074. type: "integer"
  17075. }
  17076. },
  17077. url: "/orgs/:org/migrations"
  17078. },
  17079. listReposForOrg: {
  17080. headers: {
  17081. accept: "application/vnd.github.wyandotte-preview+json"
  17082. },
  17083. method: "GET",
  17084. params: {
  17085. migration_id: {
  17086. required: true,
  17087. type: "integer"
  17088. },
  17089. org: {
  17090. required: true,
  17091. type: "string"
  17092. },
  17093. page: {
  17094. type: "integer"
  17095. },
  17096. per_page: {
  17097. type: "integer"
  17098. }
  17099. },
  17100. url: "/orgs/:org/migrations/:migration_id/repositories"
  17101. },
  17102. listReposForUser: {
  17103. headers: {
  17104. accept: "application/vnd.github.wyandotte-preview+json"
  17105. },
  17106. method: "GET",
  17107. params: {
  17108. migration_id: {
  17109. required: true,
  17110. type: "integer"
  17111. },
  17112. page: {
  17113. type: "integer"
  17114. },
  17115. per_page: {
  17116. type: "integer"
  17117. }
  17118. },
  17119. url: "/user/:migration_id/repositories"
  17120. },
  17121. mapCommitAuthor: {
  17122. method: "PATCH",
  17123. params: {
  17124. author_id: {
  17125. required: true,
  17126. type: "integer"
  17127. },
  17128. email: {
  17129. type: "string"
  17130. },
  17131. name: {
  17132. type: "string"
  17133. },
  17134. owner: {
  17135. required: true,
  17136. type: "string"
  17137. },
  17138. repo: {
  17139. required: true,
  17140. type: "string"
  17141. }
  17142. },
  17143. url: "/repos/:owner/:repo/import/authors/:author_id"
  17144. },
  17145. setLfsPreference: {
  17146. method: "PATCH",
  17147. params: {
  17148. owner: {
  17149. required: true,
  17150. type: "string"
  17151. },
  17152. repo: {
  17153. required: true,
  17154. type: "string"
  17155. },
  17156. use_lfs: {
  17157. enum: ["opt_in", "opt_out"],
  17158. required: true,
  17159. type: "string"
  17160. }
  17161. },
  17162. url: "/repos/:owner/:repo/import/lfs"
  17163. },
  17164. startForAuthenticatedUser: {
  17165. method: "POST",
  17166. params: {
  17167. exclude_attachments: {
  17168. type: "boolean"
  17169. },
  17170. lock_repositories: {
  17171. type: "boolean"
  17172. },
  17173. repositories: {
  17174. required: true,
  17175. type: "string[]"
  17176. }
  17177. },
  17178. url: "/user/migrations"
  17179. },
  17180. startForOrg: {
  17181. method: "POST",
  17182. params: {
  17183. exclude_attachments: {
  17184. type: "boolean"
  17185. },
  17186. lock_repositories: {
  17187. type: "boolean"
  17188. },
  17189. org: {
  17190. required: true,
  17191. type: "string"
  17192. },
  17193. repositories: {
  17194. required: true,
  17195. type: "string[]"
  17196. }
  17197. },
  17198. url: "/orgs/:org/migrations"
  17199. },
  17200. startImport: {
  17201. method: "PUT",
  17202. params: {
  17203. owner: {
  17204. required: true,
  17205. type: "string"
  17206. },
  17207. repo: {
  17208. required: true,
  17209. type: "string"
  17210. },
  17211. tfvc_project: {
  17212. type: "string"
  17213. },
  17214. vcs: {
  17215. enum: ["subversion", "git", "mercurial", "tfvc"],
  17216. type: "string"
  17217. },
  17218. vcs_password: {
  17219. type: "string"
  17220. },
  17221. vcs_url: {
  17222. required: true,
  17223. type: "string"
  17224. },
  17225. vcs_username: {
  17226. type: "string"
  17227. }
  17228. },
  17229. url: "/repos/:owner/:repo/import"
  17230. },
  17231. unlockRepoForAuthenticatedUser: {
  17232. headers: {
  17233. accept: "application/vnd.github.wyandotte-preview+json"
  17234. },
  17235. method: "DELETE",
  17236. params: {
  17237. migration_id: {
  17238. required: true,
  17239. type: "integer"
  17240. },
  17241. repo_name: {
  17242. required: true,
  17243. type: "string"
  17244. }
  17245. },
  17246. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17247. },
  17248. unlockRepoForOrg: {
  17249. headers: {
  17250. accept: "application/vnd.github.wyandotte-preview+json"
  17251. },
  17252. method: "DELETE",
  17253. params: {
  17254. migration_id: {
  17255. required: true,
  17256. type: "integer"
  17257. },
  17258. org: {
  17259. required: true,
  17260. type: "string"
  17261. },
  17262. repo_name: {
  17263. required: true,
  17264. type: "string"
  17265. }
  17266. },
  17267. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17268. },
  17269. updateImport: {
  17270. method: "PATCH",
  17271. params: {
  17272. owner: {
  17273. required: true,
  17274. type: "string"
  17275. },
  17276. repo: {
  17277. required: true,
  17278. type: "string"
  17279. },
  17280. vcs_password: {
  17281. type: "string"
  17282. },
  17283. vcs_username: {
  17284. type: "string"
  17285. }
  17286. },
  17287. url: "/repos/:owner/:repo/import"
  17288. }
  17289. },
  17290. oauthAuthorizations: {
  17291. checkAuthorization: {
  17292. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17293. method: "GET",
  17294. params: {
  17295. access_token: {
  17296. required: true,
  17297. type: "string"
  17298. },
  17299. client_id: {
  17300. required: true,
  17301. type: "string"
  17302. }
  17303. },
  17304. url: "/applications/:client_id/tokens/:access_token"
  17305. },
  17306. createAuthorization: {
  17307. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17308. method: "POST",
  17309. params: {
  17310. client_id: {
  17311. type: "string"
  17312. },
  17313. client_secret: {
  17314. type: "string"
  17315. },
  17316. fingerprint: {
  17317. type: "string"
  17318. },
  17319. note: {
  17320. required: true,
  17321. type: "string"
  17322. },
  17323. note_url: {
  17324. type: "string"
  17325. },
  17326. scopes: {
  17327. type: "string[]"
  17328. }
  17329. },
  17330. url: "/authorizations"
  17331. },
  17332. deleteAuthorization: {
  17333. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17334. method: "DELETE",
  17335. params: {
  17336. authorization_id: {
  17337. required: true,
  17338. type: "integer"
  17339. }
  17340. },
  17341. url: "/authorizations/:authorization_id"
  17342. },
  17343. deleteGrant: {
  17344. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17345. method: "DELETE",
  17346. params: {
  17347. grant_id: {
  17348. required: true,
  17349. type: "integer"
  17350. }
  17351. },
  17352. url: "/applications/grants/:grant_id"
  17353. },
  17354. getAuthorization: {
  17355. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17356. method: "GET",
  17357. params: {
  17358. authorization_id: {
  17359. required: true,
  17360. type: "integer"
  17361. }
  17362. },
  17363. url: "/authorizations/:authorization_id"
  17364. },
  17365. getGrant: {
  17366. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17367. method: "GET",
  17368. params: {
  17369. grant_id: {
  17370. required: true,
  17371. type: "integer"
  17372. }
  17373. },
  17374. url: "/applications/grants/:grant_id"
  17375. },
  17376. getOrCreateAuthorizationForApp: {
  17377. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17378. method: "PUT",
  17379. params: {
  17380. client_id: {
  17381. required: true,
  17382. type: "string"
  17383. },
  17384. client_secret: {
  17385. required: true,
  17386. type: "string"
  17387. },
  17388. fingerprint: {
  17389. type: "string"
  17390. },
  17391. note: {
  17392. type: "string"
  17393. },
  17394. note_url: {
  17395. type: "string"
  17396. },
  17397. scopes: {
  17398. type: "string[]"
  17399. }
  17400. },
  17401. url: "/authorizations/clients/:client_id"
  17402. },
  17403. getOrCreateAuthorizationForAppAndFingerprint: {
  17404. 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",
  17405. method: "PUT",
  17406. params: {
  17407. client_id: {
  17408. required: true,
  17409. type: "string"
  17410. },
  17411. client_secret: {
  17412. required: true,
  17413. type: "string"
  17414. },
  17415. fingerprint: {
  17416. required: true,
  17417. type: "string"
  17418. },
  17419. note: {
  17420. type: "string"
  17421. },
  17422. note_url: {
  17423. type: "string"
  17424. },
  17425. scopes: {
  17426. type: "string[]"
  17427. }
  17428. },
  17429. url: "/authorizations/clients/:client_id/:fingerprint"
  17430. },
  17431. getOrCreateAuthorizationForAppFingerprint: {
  17432. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17433. method: "PUT",
  17434. params: {
  17435. client_id: {
  17436. required: true,
  17437. type: "string"
  17438. },
  17439. client_secret: {
  17440. required: true,
  17441. type: "string"
  17442. },
  17443. fingerprint: {
  17444. required: true,
  17445. type: "string"
  17446. },
  17447. note: {
  17448. type: "string"
  17449. },
  17450. note_url: {
  17451. type: "string"
  17452. },
  17453. scopes: {
  17454. type: "string[]"
  17455. }
  17456. },
  17457. url: "/authorizations/clients/:client_id/:fingerprint"
  17458. },
  17459. listAuthorizations: {
  17460. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17461. method: "GET",
  17462. params: {
  17463. page: {
  17464. type: "integer"
  17465. },
  17466. per_page: {
  17467. type: "integer"
  17468. }
  17469. },
  17470. url: "/authorizations"
  17471. },
  17472. listGrants: {
  17473. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17474. method: "GET",
  17475. params: {
  17476. page: {
  17477. type: "integer"
  17478. },
  17479. per_page: {
  17480. type: "integer"
  17481. }
  17482. },
  17483. url: "/applications/grants"
  17484. },
  17485. resetAuthorization: {
  17486. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17487. method: "POST",
  17488. params: {
  17489. access_token: {
  17490. required: true,
  17491. type: "string"
  17492. },
  17493. client_id: {
  17494. required: true,
  17495. type: "string"
  17496. }
  17497. },
  17498. url: "/applications/:client_id/tokens/:access_token"
  17499. },
  17500. revokeAuthorizationForApplication: {
  17501. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17502. method: "DELETE",
  17503. params: {
  17504. access_token: {
  17505. required: true,
  17506. type: "string"
  17507. },
  17508. client_id: {
  17509. required: true,
  17510. type: "string"
  17511. }
  17512. },
  17513. url: "/applications/:client_id/tokens/:access_token"
  17514. },
  17515. revokeGrantForApplication: {
  17516. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17517. method: "DELETE",
  17518. params: {
  17519. access_token: {
  17520. required: true,
  17521. type: "string"
  17522. },
  17523. client_id: {
  17524. required: true,
  17525. type: "string"
  17526. }
  17527. },
  17528. url: "/applications/:client_id/grants/:access_token"
  17529. },
  17530. updateAuthorization: {
  17531. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17532. method: "PATCH",
  17533. params: {
  17534. add_scopes: {
  17535. type: "string[]"
  17536. },
  17537. authorization_id: {
  17538. required: true,
  17539. type: "integer"
  17540. },
  17541. fingerprint: {
  17542. type: "string"
  17543. },
  17544. note: {
  17545. type: "string"
  17546. },
  17547. note_url: {
  17548. type: "string"
  17549. },
  17550. remove_scopes: {
  17551. type: "string[]"
  17552. },
  17553. scopes: {
  17554. type: "string[]"
  17555. }
  17556. },
  17557. url: "/authorizations/:authorization_id"
  17558. }
  17559. },
  17560. orgs: {
  17561. addOrUpdateMembership: {
  17562. method: "PUT",
  17563. params: {
  17564. org: {
  17565. required: true,
  17566. type: "string"
  17567. },
  17568. role: {
  17569. enum: ["admin", "member"],
  17570. type: "string"
  17571. },
  17572. username: {
  17573. required: true,
  17574. type: "string"
  17575. }
  17576. },
  17577. url: "/orgs/:org/memberships/:username"
  17578. },
  17579. blockUser: {
  17580. method: "PUT",
  17581. params: {
  17582. org: {
  17583. required: true,
  17584. type: "string"
  17585. },
  17586. username: {
  17587. required: true,
  17588. type: "string"
  17589. }
  17590. },
  17591. url: "/orgs/:org/blocks/:username"
  17592. },
  17593. checkBlockedUser: {
  17594. method: "GET",
  17595. params: {
  17596. org: {
  17597. required: true,
  17598. type: "string"
  17599. },
  17600. username: {
  17601. required: true,
  17602. type: "string"
  17603. }
  17604. },
  17605. url: "/orgs/:org/blocks/:username"
  17606. },
  17607. checkMembership: {
  17608. method: "GET",
  17609. params: {
  17610. org: {
  17611. required: true,
  17612. type: "string"
  17613. },
  17614. username: {
  17615. required: true,
  17616. type: "string"
  17617. }
  17618. },
  17619. url: "/orgs/:org/members/:username"
  17620. },
  17621. checkPublicMembership: {
  17622. method: "GET",
  17623. params: {
  17624. org: {
  17625. required: true,
  17626. type: "string"
  17627. },
  17628. username: {
  17629. required: true,
  17630. type: "string"
  17631. }
  17632. },
  17633. url: "/orgs/:org/public_members/:username"
  17634. },
  17635. concealMembership: {
  17636. method: "DELETE",
  17637. params: {
  17638. org: {
  17639. required: true,
  17640. type: "string"
  17641. },
  17642. username: {
  17643. required: true,
  17644. type: "string"
  17645. }
  17646. },
  17647. url: "/orgs/:org/public_members/:username"
  17648. },
  17649. convertMemberToOutsideCollaborator: {
  17650. method: "PUT",
  17651. params: {
  17652. org: {
  17653. required: true,
  17654. type: "string"
  17655. },
  17656. username: {
  17657. required: true,
  17658. type: "string"
  17659. }
  17660. },
  17661. url: "/orgs/:org/outside_collaborators/:username"
  17662. },
  17663. createHook: {
  17664. method: "POST",
  17665. params: {
  17666. active: {
  17667. type: "boolean"
  17668. },
  17669. config: {
  17670. required: true,
  17671. type: "object"
  17672. },
  17673. "config.content_type": {
  17674. type: "string"
  17675. },
  17676. "config.insecure_ssl": {
  17677. type: "string"
  17678. },
  17679. "config.secret": {
  17680. type: "string"
  17681. },
  17682. "config.url": {
  17683. required: true,
  17684. type: "string"
  17685. },
  17686. events: {
  17687. type: "string[]"
  17688. },
  17689. name: {
  17690. required: true,
  17691. type: "string"
  17692. },
  17693. org: {
  17694. required: true,
  17695. type: "string"
  17696. }
  17697. },
  17698. url: "/orgs/:org/hooks"
  17699. },
  17700. createInvitation: {
  17701. method: "POST",
  17702. params: {
  17703. email: {
  17704. type: "string"
  17705. },
  17706. invitee_id: {
  17707. type: "integer"
  17708. },
  17709. org: {
  17710. required: true,
  17711. type: "string"
  17712. },
  17713. role: {
  17714. enum: ["admin", "direct_member", "billing_manager"],
  17715. type: "string"
  17716. },
  17717. team_ids: {
  17718. type: "integer[]"
  17719. }
  17720. },
  17721. url: "/orgs/:org/invitations"
  17722. },
  17723. deleteHook: {
  17724. method: "DELETE",
  17725. params: {
  17726. hook_id: {
  17727. required: true,
  17728. type: "integer"
  17729. },
  17730. org: {
  17731. required: true,
  17732. type: "string"
  17733. }
  17734. },
  17735. url: "/orgs/:org/hooks/:hook_id"
  17736. },
  17737. get: {
  17738. method: "GET",
  17739. params: {
  17740. org: {
  17741. required: true,
  17742. type: "string"
  17743. }
  17744. },
  17745. url: "/orgs/:org"
  17746. },
  17747. getHook: {
  17748. method: "GET",
  17749. params: {
  17750. hook_id: {
  17751. required: true,
  17752. type: "integer"
  17753. },
  17754. org: {
  17755. required: true,
  17756. type: "string"
  17757. }
  17758. },
  17759. url: "/orgs/:org/hooks/:hook_id"
  17760. },
  17761. getMembership: {
  17762. method: "GET",
  17763. params: {
  17764. org: {
  17765. required: true,
  17766. type: "string"
  17767. },
  17768. username: {
  17769. required: true,
  17770. type: "string"
  17771. }
  17772. },
  17773. url: "/orgs/:org/memberships/:username"
  17774. },
  17775. getMembershipForAuthenticatedUser: {
  17776. method: "GET",
  17777. params: {
  17778. org: {
  17779. required: true,
  17780. type: "string"
  17781. }
  17782. },
  17783. url: "/user/memberships/orgs/:org"
  17784. },
  17785. list: {
  17786. method: "GET",
  17787. params: {
  17788. page: {
  17789. type: "integer"
  17790. },
  17791. per_page: {
  17792. type: "integer"
  17793. },
  17794. since: {
  17795. type: "integer"
  17796. }
  17797. },
  17798. url: "/organizations"
  17799. },
  17800. listBlockedUsers: {
  17801. method: "GET",
  17802. params: {
  17803. org: {
  17804. required: true,
  17805. type: "string"
  17806. }
  17807. },
  17808. url: "/orgs/:org/blocks"
  17809. },
  17810. listForAuthenticatedUser: {
  17811. method: "GET",
  17812. params: {
  17813. page: {
  17814. type: "integer"
  17815. },
  17816. per_page: {
  17817. type: "integer"
  17818. }
  17819. },
  17820. url: "/user/orgs"
  17821. },
  17822. listForUser: {
  17823. method: "GET",
  17824. params: {
  17825. page: {
  17826. type: "integer"
  17827. },
  17828. per_page: {
  17829. type: "integer"
  17830. },
  17831. username: {
  17832. required: true,
  17833. type: "string"
  17834. }
  17835. },
  17836. url: "/users/:username/orgs"
  17837. },
  17838. listHooks: {
  17839. method: "GET",
  17840. params: {
  17841. org: {
  17842. required: true,
  17843. type: "string"
  17844. },
  17845. page: {
  17846. type: "integer"
  17847. },
  17848. per_page: {
  17849. type: "integer"
  17850. }
  17851. },
  17852. url: "/orgs/:org/hooks"
  17853. },
  17854. listInstallations: {
  17855. headers: {
  17856. accept: "application/vnd.github.machine-man-preview+json"
  17857. },
  17858. method: "GET",
  17859. params: {
  17860. org: {
  17861. required: true,
  17862. type: "string"
  17863. },
  17864. page: {
  17865. type: "integer"
  17866. },
  17867. per_page: {
  17868. type: "integer"
  17869. }
  17870. },
  17871. url: "/orgs/:org/installations"
  17872. },
  17873. listInvitationTeams: {
  17874. method: "GET",
  17875. params: {
  17876. invitation_id: {
  17877. required: true,
  17878. type: "integer"
  17879. },
  17880. org: {
  17881. required: true,
  17882. type: "string"
  17883. },
  17884. page: {
  17885. type: "integer"
  17886. },
  17887. per_page: {
  17888. type: "integer"
  17889. }
  17890. },
  17891. url: "/orgs/:org/invitations/:invitation_id/teams"
  17892. },
  17893. listMembers: {
  17894. method: "GET",
  17895. params: {
  17896. filter: {
  17897. enum: ["2fa_disabled", "all"],
  17898. type: "string"
  17899. },
  17900. org: {
  17901. required: true,
  17902. type: "string"
  17903. },
  17904. page: {
  17905. type: "integer"
  17906. },
  17907. per_page: {
  17908. type: "integer"
  17909. },
  17910. role: {
  17911. enum: ["all", "admin", "member"],
  17912. type: "string"
  17913. }
  17914. },
  17915. url: "/orgs/:org/members"
  17916. },
  17917. listMemberships: {
  17918. method: "GET",
  17919. params: {
  17920. page: {
  17921. type: "integer"
  17922. },
  17923. per_page: {
  17924. type: "integer"
  17925. },
  17926. state: {
  17927. enum: ["active", "pending"],
  17928. type: "string"
  17929. }
  17930. },
  17931. url: "/user/memberships/orgs"
  17932. },
  17933. listOutsideCollaborators: {
  17934. method: "GET",
  17935. params: {
  17936. filter: {
  17937. enum: ["2fa_disabled", "all"],
  17938. type: "string"
  17939. },
  17940. org: {
  17941. required: true,
  17942. type: "string"
  17943. },
  17944. page: {
  17945. type: "integer"
  17946. },
  17947. per_page: {
  17948. type: "integer"
  17949. }
  17950. },
  17951. url: "/orgs/:org/outside_collaborators"
  17952. },
  17953. listPendingInvitations: {
  17954. method: "GET",
  17955. params: {
  17956. org: {
  17957. required: true,
  17958. type: "string"
  17959. },
  17960. page: {
  17961. type: "integer"
  17962. },
  17963. per_page: {
  17964. type: "integer"
  17965. }
  17966. },
  17967. url: "/orgs/:org/invitations"
  17968. },
  17969. listPublicMembers: {
  17970. method: "GET",
  17971. params: {
  17972. org: {
  17973. required: true,
  17974. type: "string"
  17975. },
  17976. page: {
  17977. type: "integer"
  17978. },
  17979. per_page: {
  17980. type: "integer"
  17981. }
  17982. },
  17983. url: "/orgs/:org/public_members"
  17984. },
  17985. pingHook: {
  17986. method: "POST",
  17987. params: {
  17988. hook_id: {
  17989. required: true,
  17990. type: "integer"
  17991. },
  17992. org: {
  17993. required: true,
  17994. type: "string"
  17995. }
  17996. },
  17997. url: "/orgs/:org/hooks/:hook_id/pings"
  17998. },
  17999. publicizeMembership: {
  18000. method: "PUT",
  18001. params: {
  18002. org: {
  18003. required: true,
  18004. type: "string"
  18005. },
  18006. username: {
  18007. required: true,
  18008. type: "string"
  18009. }
  18010. },
  18011. url: "/orgs/:org/public_members/:username"
  18012. },
  18013. removeMember: {
  18014. method: "DELETE",
  18015. params: {
  18016. org: {
  18017. required: true,
  18018. type: "string"
  18019. },
  18020. username: {
  18021. required: true,
  18022. type: "string"
  18023. }
  18024. },
  18025. url: "/orgs/:org/members/:username"
  18026. },
  18027. removeMembership: {
  18028. method: "DELETE",
  18029. params: {
  18030. org: {
  18031. required: true,
  18032. type: "string"
  18033. },
  18034. username: {
  18035. required: true,
  18036. type: "string"
  18037. }
  18038. },
  18039. url: "/orgs/:org/memberships/:username"
  18040. },
  18041. removeOutsideCollaborator: {
  18042. method: "DELETE",
  18043. params: {
  18044. org: {
  18045. required: true,
  18046. type: "string"
  18047. },
  18048. username: {
  18049. required: true,
  18050. type: "string"
  18051. }
  18052. },
  18053. url: "/orgs/:org/outside_collaborators/:username"
  18054. },
  18055. unblockUser: {
  18056. method: "DELETE",
  18057. params: {
  18058. org: {
  18059. required: true,
  18060. type: "string"
  18061. },
  18062. username: {
  18063. required: true,
  18064. type: "string"
  18065. }
  18066. },
  18067. url: "/orgs/:org/blocks/:username"
  18068. },
  18069. update: {
  18070. method: "PATCH",
  18071. params: {
  18072. billing_email: {
  18073. type: "string"
  18074. },
  18075. company: {
  18076. type: "string"
  18077. },
  18078. default_repository_permission: {
  18079. enum: ["read", "write", "admin", "none"],
  18080. type: "string"
  18081. },
  18082. description: {
  18083. type: "string"
  18084. },
  18085. email: {
  18086. type: "string"
  18087. },
  18088. has_organization_projects: {
  18089. type: "boolean"
  18090. },
  18091. has_repository_projects: {
  18092. type: "boolean"
  18093. },
  18094. location: {
  18095. type: "string"
  18096. },
  18097. members_allowed_repository_creation_type: {
  18098. enum: ["all", "private", "none"],
  18099. type: "string"
  18100. },
  18101. members_can_create_internal_repositories: {
  18102. type: "boolean"
  18103. },
  18104. members_can_create_private_repositories: {
  18105. type: "boolean"
  18106. },
  18107. members_can_create_public_repositories: {
  18108. type: "boolean"
  18109. },
  18110. members_can_create_repositories: {
  18111. type: "boolean"
  18112. },
  18113. name: {
  18114. type: "string"
  18115. },
  18116. org: {
  18117. required: true,
  18118. type: "string"
  18119. }
  18120. },
  18121. url: "/orgs/:org"
  18122. },
  18123. updateHook: {
  18124. method: "PATCH",
  18125. params: {
  18126. active: {
  18127. type: "boolean"
  18128. },
  18129. config: {
  18130. type: "object"
  18131. },
  18132. "config.content_type": {
  18133. type: "string"
  18134. },
  18135. "config.insecure_ssl": {
  18136. type: "string"
  18137. },
  18138. "config.secret": {
  18139. type: "string"
  18140. },
  18141. "config.url": {
  18142. required: true,
  18143. type: "string"
  18144. },
  18145. events: {
  18146. type: "string[]"
  18147. },
  18148. hook_id: {
  18149. required: true,
  18150. type: "integer"
  18151. },
  18152. org: {
  18153. required: true,
  18154. type: "string"
  18155. }
  18156. },
  18157. url: "/orgs/:org/hooks/:hook_id"
  18158. },
  18159. updateMembership: {
  18160. method: "PATCH",
  18161. params: {
  18162. org: {
  18163. required: true,
  18164. type: "string"
  18165. },
  18166. state: {
  18167. enum: ["active"],
  18168. required: true,
  18169. type: "string"
  18170. }
  18171. },
  18172. url: "/user/memberships/orgs/:org"
  18173. }
  18174. },
  18175. projects: {
  18176. addCollaborator: {
  18177. headers: {
  18178. accept: "application/vnd.github.inertia-preview+json"
  18179. },
  18180. method: "PUT",
  18181. params: {
  18182. permission: {
  18183. enum: ["read", "write", "admin"],
  18184. type: "string"
  18185. },
  18186. project_id: {
  18187. required: true,
  18188. type: "integer"
  18189. },
  18190. username: {
  18191. required: true,
  18192. type: "string"
  18193. }
  18194. },
  18195. url: "/projects/:project_id/collaborators/:username"
  18196. },
  18197. createCard: {
  18198. headers: {
  18199. accept: "application/vnd.github.inertia-preview+json"
  18200. },
  18201. method: "POST",
  18202. params: {
  18203. column_id: {
  18204. required: true,
  18205. type: "integer"
  18206. },
  18207. content_id: {
  18208. type: "integer"
  18209. },
  18210. content_type: {
  18211. type: "string"
  18212. },
  18213. note: {
  18214. type: "string"
  18215. }
  18216. },
  18217. url: "/projects/columns/:column_id/cards"
  18218. },
  18219. createColumn: {
  18220. headers: {
  18221. accept: "application/vnd.github.inertia-preview+json"
  18222. },
  18223. method: "POST",
  18224. params: {
  18225. name: {
  18226. required: true,
  18227. type: "string"
  18228. },
  18229. project_id: {
  18230. required: true,
  18231. type: "integer"
  18232. }
  18233. },
  18234. url: "/projects/:project_id/columns"
  18235. },
  18236. createForAuthenticatedUser: {
  18237. headers: {
  18238. accept: "application/vnd.github.inertia-preview+json"
  18239. },
  18240. method: "POST",
  18241. params: {
  18242. body: {
  18243. type: "string"
  18244. },
  18245. name: {
  18246. required: true,
  18247. type: "string"
  18248. }
  18249. },
  18250. url: "/user/projects"
  18251. },
  18252. createForOrg: {
  18253. headers: {
  18254. accept: "application/vnd.github.inertia-preview+json"
  18255. },
  18256. method: "POST",
  18257. params: {
  18258. body: {
  18259. type: "string"
  18260. },
  18261. name: {
  18262. required: true,
  18263. type: "string"
  18264. },
  18265. org: {
  18266. required: true,
  18267. type: "string"
  18268. }
  18269. },
  18270. url: "/orgs/:org/projects"
  18271. },
  18272. createForRepo: {
  18273. headers: {
  18274. accept: "application/vnd.github.inertia-preview+json"
  18275. },
  18276. method: "POST",
  18277. params: {
  18278. body: {
  18279. type: "string"
  18280. },
  18281. name: {
  18282. required: true,
  18283. type: "string"
  18284. },
  18285. owner: {
  18286. required: true,
  18287. type: "string"
  18288. },
  18289. repo: {
  18290. required: true,
  18291. type: "string"
  18292. }
  18293. },
  18294. url: "/repos/:owner/:repo/projects"
  18295. },
  18296. delete: {
  18297. headers: {
  18298. accept: "application/vnd.github.inertia-preview+json"
  18299. },
  18300. method: "DELETE",
  18301. params: {
  18302. project_id: {
  18303. required: true,
  18304. type: "integer"
  18305. }
  18306. },
  18307. url: "/projects/:project_id"
  18308. },
  18309. deleteCard: {
  18310. headers: {
  18311. accept: "application/vnd.github.inertia-preview+json"
  18312. },
  18313. method: "DELETE",
  18314. params: {
  18315. card_id: {
  18316. required: true,
  18317. type: "integer"
  18318. }
  18319. },
  18320. url: "/projects/columns/cards/:card_id"
  18321. },
  18322. deleteColumn: {
  18323. headers: {
  18324. accept: "application/vnd.github.inertia-preview+json"
  18325. },
  18326. method: "DELETE",
  18327. params: {
  18328. column_id: {
  18329. required: true,
  18330. type: "integer"
  18331. }
  18332. },
  18333. url: "/projects/columns/:column_id"
  18334. },
  18335. get: {
  18336. headers: {
  18337. accept: "application/vnd.github.inertia-preview+json"
  18338. },
  18339. method: "GET",
  18340. params: {
  18341. project_id: {
  18342. required: true,
  18343. type: "integer"
  18344. }
  18345. },
  18346. url: "/projects/:project_id"
  18347. },
  18348. getCard: {
  18349. headers: {
  18350. accept: "application/vnd.github.inertia-preview+json"
  18351. },
  18352. method: "GET",
  18353. params: {
  18354. card_id: {
  18355. required: true,
  18356. type: "integer"
  18357. }
  18358. },
  18359. url: "/projects/columns/cards/:card_id"
  18360. },
  18361. getColumn: {
  18362. headers: {
  18363. accept: "application/vnd.github.inertia-preview+json"
  18364. },
  18365. method: "GET",
  18366. params: {
  18367. column_id: {
  18368. required: true,
  18369. type: "integer"
  18370. }
  18371. },
  18372. url: "/projects/columns/:column_id"
  18373. },
  18374. listCards: {
  18375. headers: {
  18376. accept: "application/vnd.github.inertia-preview+json"
  18377. },
  18378. method: "GET",
  18379. params: {
  18380. archived_state: {
  18381. enum: ["all", "archived", "not_archived"],
  18382. type: "string"
  18383. },
  18384. column_id: {
  18385. required: true,
  18386. type: "integer"
  18387. },
  18388. page: {
  18389. type: "integer"
  18390. },
  18391. per_page: {
  18392. type: "integer"
  18393. }
  18394. },
  18395. url: "/projects/columns/:column_id/cards"
  18396. },
  18397. listCollaborators: {
  18398. headers: {
  18399. accept: "application/vnd.github.inertia-preview+json"
  18400. },
  18401. method: "GET",
  18402. params: {
  18403. affiliation: {
  18404. enum: ["outside", "direct", "all"],
  18405. type: "string"
  18406. },
  18407. page: {
  18408. type: "integer"
  18409. },
  18410. per_page: {
  18411. type: "integer"
  18412. },
  18413. project_id: {
  18414. required: true,
  18415. type: "integer"
  18416. }
  18417. },
  18418. url: "/projects/:project_id/collaborators"
  18419. },
  18420. listColumns: {
  18421. headers: {
  18422. accept: "application/vnd.github.inertia-preview+json"
  18423. },
  18424. method: "GET",
  18425. params: {
  18426. page: {
  18427. type: "integer"
  18428. },
  18429. per_page: {
  18430. type: "integer"
  18431. },
  18432. project_id: {
  18433. required: true,
  18434. type: "integer"
  18435. }
  18436. },
  18437. url: "/projects/:project_id/columns"
  18438. },
  18439. listForOrg: {
  18440. headers: {
  18441. accept: "application/vnd.github.inertia-preview+json"
  18442. },
  18443. method: "GET",
  18444. params: {
  18445. org: {
  18446. required: true,
  18447. type: "string"
  18448. },
  18449. page: {
  18450. type: "integer"
  18451. },
  18452. per_page: {
  18453. type: "integer"
  18454. },
  18455. state: {
  18456. enum: ["open", "closed", "all"],
  18457. type: "string"
  18458. }
  18459. },
  18460. url: "/orgs/:org/projects"
  18461. },
  18462. listForRepo: {
  18463. headers: {
  18464. accept: "application/vnd.github.inertia-preview+json"
  18465. },
  18466. method: "GET",
  18467. params: {
  18468. owner: {
  18469. required: true,
  18470. type: "string"
  18471. },
  18472. page: {
  18473. type: "integer"
  18474. },
  18475. per_page: {
  18476. type: "integer"
  18477. },
  18478. repo: {
  18479. required: true,
  18480. type: "string"
  18481. },
  18482. state: {
  18483. enum: ["open", "closed", "all"],
  18484. type: "string"
  18485. }
  18486. },
  18487. url: "/repos/:owner/:repo/projects"
  18488. },
  18489. listForUser: {
  18490. headers: {
  18491. accept: "application/vnd.github.inertia-preview+json"
  18492. },
  18493. method: "GET",
  18494. params: {
  18495. page: {
  18496. type: "integer"
  18497. },
  18498. per_page: {
  18499. type: "integer"
  18500. },
  18501. state: {
  18502. enum: ["open", "closed", "all"],
  18503. type: "string"
  18504. },
  18505. username: {
  18506. required: true,
  18507. type: "string"
  18508. }
  18509. },
  18510. url: "/users/:username/projects"
  18511. },
  18512. moveCard: {
  18513. headers: {
  18514. accept: "application/vnd.github.inertia-preview+json"
  18515. },
  18516. method: "POST",
  18517. params: {
  18518. card_id: {
  18519. required: true,
  18520. type: "integer"
  18521. },
  18522. column_id: {
  18523. type: "integer"
  18524. },
  18525. position: {
  18526. required: true,
  18527. type: "string",
  18528. validation: "^(top|bottom|after:\\d+)$"
  18529. }
  18530. },
  18531. url: "/projects/columns/cards/:card_id/moves"
  18532. },
  18533. moveColumn: {
  18534. headers: {
  18535. accept: "application/vnd.github.inertia-preview+json"
  18536. },
  18537. method: "POST",
  18538. params: {
  18539. column_id: {
  18540. required: true,
  18541. type: "integer"
  18542. },
  18543. position: {
  18544. required: true,
  18545. type: "string",
  18546. validation: "^(first|last|after:\\d+)$"
  18547. }
  18548. },
  18549. url: "/projects/columns/:column_id/moves"
  18550. },
  18551. removeCollaborator: {
  18552. headers: {
  18553. accept: "application/vnd.github.inertia-preview+json"
  18554. },
  18555. method: "DELETE",
  18556. params: {
  18557. project_id: {
  18558. required: true,
  18559. type: "integer"
  18560. },
  18561. username: {
  18562. required: true,
  18563. type: "string"
  18564. }
  18565. },
  18566. url: "/projects/:project_id/collaborators/:username"
  18567. },
  18568. reviewUserPermissionLevel: {
  18569. headers: {
  18570. accept: "application/vnd.github.inertia-preview+json"
  18571. },
  18572. method: "GET",
  18573. params: {
  18574. project_id: {
  18575. required: true,
  18576. type: "integer"
  18577. },
  18578. username: {
  18579. required: true,
  18580. type: "string"
  18581. }
  18582. },
  18583. url: "/projects/:project_id/collaborators/:username/permission"
  18584. },
  18585. update: {
  18586. headers: {
  18587. accept: "application/vnd.github.inertia-preview+json"
  18588. },
  18589. method: "PATCH",
  18590. params: {
  18591. body: {
  18592. type: "string"
  18593. },
  18594. name: {
  18595. type: "string"
  18596. },
  18597. organization_permission: {
  18598. type: "string"
  18599. },
  18600. private: {
  18601. type: "boolean"
  18602. },
  18603. project_id: {
  18604. required: true,
  18605. type: "integer"
  18606. },
  18607. state: {
  18608. enum: ["open", "closed"],
  18609. type: "string"
  18610. }
  18611. },
  18612. url: "/projects/:project_id"
  18613. },
  18614. updateCard: {
  18615. headers: {
  18616. accept: "application/vnd.github.inertia-preview+json"
  18617. },
  18618. method: "PATCH",
  18619. params: {
  18620. archived: {
  18621. type: "boolean"
  18622. },
  18623. card_id: {
  18624. required: true,
  18625. type: "integer"
  18626. },
  18627. note: {
  18628. type: "string"
  18629. }
  18630. },
  18631. url: "/projects/columns/cards/:card_id"
  18632. },
  18633. updateColumn: {
  18634. headers: {
  18635. accept: "application/vnd.github.inertia-preview+json"
  18636. },
  18637. method: "PATCH",
  18638. params: {
  18639. column_id: {
  18640. required: true,
  18641. type: "integer"
  18642. },
  18643. name: {
  18644. required: true,
  18645. type: "string"
  18646. }
  18647. },
  18648. url: "/projects/columns/:column_id"
  18649. }
  18650. },
  18651. pulls: {
  18652. checkIfMerged: {
  18653. method: "GET",
  18654. params: {
  18655. number: {
  18656. alias: "pull_number",
  18657. deprecated: true,
  18658. type: "integer"
  18659. },
  18660. owner: {
  18661. required: true,
  18662. type: "string"
  18663. },
  18664. pull_number: {
  18665. required: true,
  18666. type: "integer"
  18667. },
  18668. repo: {
  18669. required: true,
  18670. type: "string"
  18671. }
  18672. },
  18673. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18674. },
  18675. create: {
  18676. method: "POST",
  18677. params: {
  18678. base: {
  18679. required: true,
  18680. type: "string"
  18681. },
  18682. body: {
  18683. type: "string"
  18684. },
  18685. draft: {
  18686. type: "boolean"
  18687. },
  18688. head: {
  18689. required: true,
  18690. type: "string"
  18691. },
  18692. maintainer_can_modify: {
  18693. type: "boolean"
  18694. },
  18695. owner: {
  18696. required: true,
  18697. type: "string"
  18698. },
  18699. repo: {
  18700. required: true,
  18701. type: "string"
  18702. },
  18703. title: {
  18704. required: true,
  18705. type: "string"
  18706. }
  18707. },
  18708. url: "/repos/:owner/:repo/pulls"
  18709. },
  18710. createComment: {
  18711. method: "POST",
  18712. params: {
  18713. body: {
  18714. required: true,
  18715. type: "string"
  18716. },
  18717. commit_id: {
  18718. required: true,
  18719. type: "string"
  18720. },
  18721. in_reply_to: {
  18722. deprecated: true,
  18723. 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.",
  18724. type: "integer"
  18725. },
  18726. line: {
  18727. type: "integer"
  18728. },
  18729. number: {
  18730. alias: "pull_number",
  18731. deprecated: true,
  18732. type: "integer"
  18733. },
  18734. owner: {
  18735. required: true,
  18736. type: "string"
  18737. },
  18738. path: {
  18739. required: true,
  18740. type: "string"
  18741. },
  18742. position: {
  18743. type: "integer"
  18744. },
  18745. pull_number: {
  18746. required: true,
  18747. type: "integer"
  18748. },
  18749. repo: {
  18750. required: true,
  18751. type: "string"
  18752. },
  18753. side: {
  18754. enum: ["LEFT", "RIGHT"],
  18755. type: "string"
  18756. },
  18757. start_line: {
  18758. type: "integer"
  18759. },
  18760. start_side: {
  18761. enum: ["LEFT", "RIGHT", "side"],
  18762. type: "string"
  18763. }
  18764. },
  18765. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18766. },
  18767. createCommentReply: {
  18768. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18769. method: "POST",
  18770. params: {
  18771. body: {
  18772. required: true,
  18773. type: "string"
  18774. },
  18775. commit_id: {
  18776. required: true,
  18777. type: "string"
  18778. },
  18779. in_reply_to: {
  18780. deprecated: true,
  18781. 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.",
  18782. type: "integer"
  18783. },
  18784. line: {
  18785. type: "integer"
  18786. },
  18787. number: {
  18788. alias: "pull_number",
  18789. deprecated: true,
  18790. type: "integer"
  18791. },
  18792. owner: {
  18793. required: true,
  18794. type: "string"
  18795. },
  18796. path: {
  18797. required: true,
  18798. type: "string"
  18799. },
  18800. position: {
  18801. type: "integer"
  18802. },
  18803. pull_number: {
  18804. required: true,
  18805. type: "integer"
  18806. },
  18807. repo: {
  18808. required: true,
  18809. type: "string"
  18810. },
  18811. side: {
  18812. enum: ["LEFT", "RIGHT"],
  18813. type: "string"
  18814. },
  18815. start_line: {
  18816. type: "integer"
  18817. },
  18818. start_side: {
  18819. enum: ["LEFT", "RIGHT", "side"],
  18820. type: "string"
  18821. }
  18822. },
  18823. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18824. },
  18825. createFromIssue: {
  18826. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18827. method: "POST",
  18828. params: {
  18829. base: {
  18830. required: true,
  18831. type: "string"
  18832. },
  18833. draft: {
  18834. type: "boolean"
  18835. },
  18836. head: {
  18837. required: true,
  18838. type: "string"
  18839. },
  18840. issue: {
  18841. required: true,
  18842. type: "integer"
  18843. },
  18844. maintainer_can_modify: {
  18845. type: "boolean"
  18846. },
  18847. owner: {
  18848. required: true,
  18849. type: "string"
  18850. },
  18851. repo: {
  18852. required: true,
  18853. type: "string"
  18854. }
  18855. },
  18856. url: "/repos/:owner/:repo/pulls"
  18857. },
  18858. createReview: {
  18859. method: "POST",
  18860. params: {
  18861. body: {
  18862. type: "string"
  18863. },
  18864. comments: {
  18865. type: "object[]"
  18866. },
  18867. "comments[].body": {
  18868. required: true,
  18869. type: "string"
  18870. },
  18871. "comments[].path": {
  18872. required: true,
  18873. type: "string"
  18874. },
  18875. "comments[].position": {
  18876. required: true,
  18877. type: "integer"
  18878. },
  18879. commit_id: {
  18880. type: "string"
  18881. },
  18882. event: {
  18883. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18884. type: "string"
  18885. },
  18886. number: {
  18887. alias: "pull_number",
  18888. deprecated: true,
  18889. type: "integer"
  18890. },
  18891. owner: {
  18892. required: true,
  18893. type: "string"
  18894. },
  18895. pull_number: {
  18896. required: true,
  18897. type: "integer"
  18898. },
  18899. repo: {
  18900. required: true,
  18901. type: "string"
  18902. }
  18903. },
  18904. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18905. },
  18906. createReviewCommentReply: {
  18907. method: "POST",
  18908. params: {
  18909. body: {
  18910. required: true,
  18911. type: "string"
  18912. },
  18913. comment_id: {
  18914. required: true,
  18915. type: "integer"
  18916. },
  18917. owner: {
  18918. required: true,
  18919. type: "string"
  18920. },
  18921. pull_number: {
  18922. required: true,
  18923. type: "integer"
  18924. },
  18925. repo: {
  18926. required: true,
  18927. type: "string"
  18928. }
  18929. },
  18930. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18931. },
  18932. createReviewRequest: {
  18933. method: "POST",
  18934. params: {
  18935. number: {
  18936. alias: "pull_number",
  18937. deprecated: true,
  18938. type: "integer"
  18939. },
  18940. owner: {
  18941. required: true,
  18942. type: "string"
  18943. },
  18944. pull_number: {
  18945. required: true,
  18946. type: "integer"
  18947. },
  18948. repo: {
  18949. required: true,
  18950. type: "string"
  18951. },
  18952. reviewers: {
  18953. type: "string[]"
  18954. },
  18955. team_reviewers: {
  18956. type: "string[]"
  18957. }
  18958. },
  18959. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18960. },
  18961. deleteComment: {
  18962. method: "DELETE",
  18963. params: {
  18964. comment_id: {
  18965. required: true,
  18966. type: "integer"
  18967. },
  18968. owner: {
  18969. required: true,
  18970. type: "string"
  18971. },
  18972. repo: {
  18973. required: true,
  18974. type: "string"
  18975. }
  18976. },
  18977. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18978. },
  18979. deletePendingReview: {
  18980. method: "DELETE",
  18981. params: {
  18982. number: {
  18983. alias: "pull_number",
  18984. deprecated: true,
  18985. type: "integer"
  18986. },
  18987. owner: {
  18988. required: true,
  18989. type: "string"
  18990. },
  18991. pull_number: {
  18992. required: true,
  18993. type: "integer"
  18994. },
  18995. repo: {
  18996. required: true,
  18997. type: "string"
  18998. },
  18999. review_id: {
  19000. required: true,
  19001. type: "integer"
  19002. }
  19003. },
  19004. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19005. },
  19006. deleteReviewRequest: {
  19007. method: "DELETE",
  19008. params: {
  19009. number: {
  19010. alias: "pull_number",
  19011. deprecated: true,
  19012. type: "integer"
  19013. },
  19014. owner: {
  19015. required: true,
  19016. type: "string"
  19017. },
  19018. pull_number: {
  19019. required: true,
  19020. type: "integer"
  19021. },
  19022. repo: {
  19023. required: true,
  19024. type: "string"
  19025. },
  19026. reviewers: {
  19027. type: "string[]"
  19028. },
  19029. team_reviewers: {
  19030. type: "string[]"
  19031. }
  19032. },
  19033. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19034. },
  19035. dismissReview: {
  19036. method: "PUT",
  19037. params: {
  19038. message: {
  19039. required: true,
  19040. type: "string"
  19041. },
  19042. number: {
  19043. alias: "pull_number",
  19044. deprecated: true,
  19045. type: "integer"
  19046. },
  19047. owner: {
  19048. required: true,
  19049. type: "string"
  19050. },
  19051. pull_number: {
  19052. required: true,
  19053. type: "integer"
  19054. },
  19055. repo: {
  19056. required: true,
  19057. type: "string"
  19058. },
  19059. review_id: {
  19060. required: true,
  19061. type: "integer"
  19062. }
  19063. },
  19064. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  19065. },
  19066. get: {
  19067. method: "GET",
  19068. params: {
  19069. number: {
  19070. alias: "pull_number",
  19071. deprecated: true,
  19072. type: "integer"
  19073. },
  19074. owner: {
  19075. required: true,
  19076. type: "string"
  19077. },
  19078. pull_number: {
  19079. required: true,
  19080. type: "integer"
  19081. },
  19082. repo: {
  19083. required: true,
  19084. type: "string"
  19085. }
  19086. },
  19087. url: "/repos/:owner/:repo/pulls/:pull_number"
  19088. },
  19089. getComment: {
  19090. method: "GET",
  19091. params: {
  19092. comment_id: {
  19093. required: true,
  19094. type: "integer"
  19095. },
  19096. owner: {
  19097. required: true,
  19098. type: "string"
  19099. },
  19100. repo: {
  19101. required: true,
  19102. type: "string"
  19103. }
  19104. },
  19105. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19106. },
  19107. getCommentsForReview: {
  19108. method: "GET",
  19109. params: {
  19110. number: {
  19111. alias: "pull_number",
  19112. deprecated: true,
  19113. type: "integer"
  19114. },
  19115. owner: {
  19116. required: true,
  19117. type: "string"
  19118. },
  19119. page: {
  19120. type: "integer"
  19121. },
  19122. per_page: {
  19123. type: "integer"
  19124. },
  19125. pull_number: {
  19126. required: true,
  19127. type: "integer"
  19128. },
  19129. repo: {
  19130. required: true,
  19131. type: "string"
  19132. },
  19133. review_id: {
  19134. required: true,
  19135. type: "integer"
  19136. }
  19137. },
  19138. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  19139. },
  19140. getReview: {
  19141. method: "GET",
  19142. params: {
  19143. number: {
  19144. alias: "pull_number",
  19145. deprecated: true,
  19146. type: "integer"
  19147. },
  19148. owner: {
  19149. required: true,
  19150. type: "string"
  19151. },
  19152. pull_number: {
  19153. required: true,
  19154. type: "integer"
  19155. },
  19156. repo: {
  19157. required: true,
  19158. type: "string"
  19159. },
  19160. review_id: {
  19161. required: true,
  19162. type: "integer"
  19163. }
  19164. },
  19165. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19166. },
  19167. list: {
  19168. method: "GET",
  19169. params: {
  19170. base: {
  19171. type: "string"
  19172. },
  19173. direction: {
  19174. enum: ["asc", "desc"],
  19175. type: "string"
  19176. },
  19177. head: {
  19178. type: "string"
  19179. },
  19180. owner: {
  19181. required: true,
  19182. type: "string"
  19183. },
  19184. page: {
  19185. type: "integer"
  19186. },
  19187. per_page: {
  19188. type: "integer"
  19189. },
  19190. repo: {
  19191. required: true,
  19192. type: "string"
  19193. },
  19194. sort: {
  19195. enum: ["created", "updated", "popularity", "long-running"],
  19196. type: "string"
  19197. },
  19198. state: {
  19199. enum: ["open", "closed", "all"],
  19200. type: "string"
  19201. }
  19202. },
  19203. url: "/repos/:owner/:repo/pulls"
  19204. },
  19205. listComments: {
  19206. method: "GET",
  19207. params: {
  19208. direction: {
  19209. enum: ["asc", "desc"],
  19210. type: "string"
  19211. },
  19212. number: {
  19213. alias: "pull_number",
  19214. deprecated: true,
  19215. type: "integer"
  19216. },
  19217. owner: {
  19218. required: true,
  19219. type: "string"
  19220. },
  19221. page: {
  19222. type: "integer"
  19223. },
  19224. per_page: {
  19225. type: "integer"
  19226. },
  19227. pull_number: {
  19228. required: true,
  19229. type: "integer"
  19230. },
  19231. repo: {
  19232. required: true,
  19233. type: "string"
  19234. },
  19235. since: {
  19236. type: "string"
  19237. },
  19238. sort: {
  19239. enum: ["created", "updated"],
  19240. type: "string"
  19241. }
  19242. },
  19243. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19244. },
  19245. listCommentsForRepo: {
  19246. method: "GET",
  19247. params: {
  19248. direction: {
  19249. enum: ["asc", "desc"],
  19250. type: "string"
  19251. },
  19252. owner: {
  19253. required: true,
  19254. type: "string"
  19255. },
  19256. page: {
  19257. type: "integer"
  19258. },
  19259. per_page: {
  19260. type: "integer"
  19261. },
  19262. repo: {
  19263. required: true,
  19264. type: "string"
  19265. },
  19266. since: {
  19267. type: "string"
  19268. },
  19269. sort: {
  19270. enum: ["created", "updated"],
  19271. type: "string"
  19272. }
  19273. },
  19274. url: "/repos/:owner/:repo/pulls/comments"
  19275. },
  19276. listCommits: {
  19277. method: "GET",
  19278. params: {
  19279. number: {
  19280. alias: "pull_number",
  19281. deprecated: true,
  19282. type: "integer"
  19283. },
  19284. owner: {
  19285. required: true,
  19286. type: "string"
  19287. },
  19288. page: {
  19289. type: "integer"
  19290. },
  19291. per_page: {
  19292. type: "integer"
  19293. },
  19294. pull_number: {
  19295. required: true,
  19296. type: "integer"
  19297. },
  19298. repo: {
  19299. required: true,
  19300. type: "string"
  19301. }
  19302. },
  19303. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19304. },
  19305. listFiles: {
  19306. method: "GET",
  19307. params: {
  19308. number: {
  19309. alias: "pull_number",
  19310. deprecated: true,
  19311. type: "integer"
  19312. },
  19313. owner: {
  19314. required: true,
  19315. type: "string"
  19316. },
  19317. page: {
  19318. type: "integer"
  19319. },
  19320. per_page: {
  19321. type: "integer"
  19322. },
  19323. pull_number: {
  19324. required: true,
  19325. type: "integer"
  19326. },
  19327. repo: {
  19328. required: true,
  19329. type: "string"
  19330. }
  19331. },
  19332. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19333. },
  19334. listReviewRequests: {
  19335. method: "GET",
  19336. params: {
  19337. number: {
  19338. alias: "pull_number",
  19339. deprecated: true,
  19340. type: "integer"
  19341. },
  19342. owner: {
  19343. required: true,
  19344. type: "string"
  19345. },
  19346. page: {
  19347. type: "integer"
  19348. },
  19349. per_page: {
  19350. type: "integer"
  19351. },
  19352. pull_number: {
  19353. required: true,
  19354. type: "integer"
  19355. },
  19356. repo: {
  19357. required: true,
  19358. type: "string"
  19359. }
  19360. },
  19361. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19362. },
  19363. listReviews: {
  19364. method: "GET",
  19365. params: {
  19366. number: {
  19367. alias: "pull_number",
  19368. deprecated: true,
  19369. type: "integer"
  19370. },
  19371. owner: {
  19372. required: true,
  19373. type: "string"
  19374. },
  19375. page: {
  19376. type: "integer"
  19377. },
  19378. per_page: {
  19379. type: "integer"
  19380. },
  19381. pull_number: {
  19382. required: true,
  19383. type: "integer"
  19384. },
  19385. repo: {
  19386. required: true,
  19387. type: "string"
  19388. }
  19389. },
  19390. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19391. },
  19392. merge: {
  19393. method: "PUT",
  19394. params: {
  19395. commit_message: {
  19396. type: "string"
  19397. },
  19398. commit_title: {
  19399. type: "string"
  19400. },
  19401. merge_method: {
  19402. enum: ["merge", "squash", "rebase"],
  19403. type: "string"
  19404. },
  19405. number: {
  19406. alias: "pull_number",
  19407. deprecated: true,
  19408. type: "integer"
  19409. },
  19410. owner: {
  19411. required: true,
  19412. type: "string"
  19413. },
  19414. pull_number: {
  19415. required: true,
  19416. type: "integer"
  19417. },
  19418. repo: {
  19419. required: true,
  19420. type: "string"
  19421. },
  19422. sha: {
  19423. type: "string"
  19424. }
  19425. },
  19426. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19427. },
  19428. submitReview: {
  19429. method: "POST",
  19430. params: {
  19431. body: {
  19432. type: "string"
  19433. },
  19434. event: {
  19435. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19436. required: true,
  19437. type: "string"
  19438. },
  19439. number: {
  19440. alias: "pull_number",
  19441. deprecated: true,
  19442. type: "integer"
  19443. },
  19444. owner: {
  19445. required: true,
  19446. type: "string"
  19447. },
  19448. pull_number: {
  19449. required: true,
  19450. type: "integer"
  19451. },
  19452. repo: {
  19453. required: true,
  19454. type: "string"
  19455. },
  19456. review_id: {
  19457. required: true,
  19458. type: "integer"
  19459. }
  19460. },
  19461. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19462. },
  19463. update: {
  19464. method: "PATCH",
  19465. params: {
  19466. base: {
  19467. type: "string"
  19468. },
  19469. body: {
  19470. type: "string"
  19471. },
  19472. maintainer_can_modify: {
  19473. type: "boolean"
  19474. },
  19475. number: {
  19476. alias: "pull_number",
  19477. deprecated: true,
  19478. type: "integer"
  19479. },
  19480. owner: {
  19481. required: true,
  19482. type: "string"
  19483. },
  19484. pull_number: {
  19485. required: true,
  19486. type: "integer"
  19487. },
  19488. repo: {
  19489. required: true,
  19490. type: "string"
  19491. },
  19492. state: {
  19493. enum: ["open", "closed"],
  19494. type: "string"
  19495. },
  19496. title: {
  19497. type: "string"
  19498. }
  19499. },
  19500. url: "/repos/:owner/:repo/pulls/:pull_number"
  19501. },
  19502. updateBranch: {
  19503. headers: {
  19504. accept: "application/vnd.github.lydian-preview+json"
  19505. },
  19506. method: "PUT",
  19507. params: {
  19508. expected_head_sha: {
  19509. type: "string"
  19510. },
  19511. owner: {
  19512. required: true,
  19513. type: "string"
  19514. },
  19515. pull_number: {
  19516. required: true,
  19517. type: "integer"
  19518. },
  19519. repo: {
  19520. required: true,
  19521. type: "string"
  19522. }
  19523. },
  19524. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19525. },
  19526. updateComment: {
  19527. method: "PATCH",
  19528. params: {
  19529. body: {
  19530. required: true,
  19531. type: "string"
  19532. },
  19533. comment_id: {
  19534. required: true,
  19535. type: "integer"
  19536. },
  19537. owner: {
  19538. required: true,
  19539. type: "string"
  19540. },
  19541. repo: {
  19542. required: true,
  19543. type: "string"
  19544. }
  19545. },
  19546. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19547. },
  19548. updateReview: {
  19549. method: "PUT",
  19550. params: {
  19551. body: {
  19552. required: true,
  19553. type: "string"
  19554. },
  19555. number: {
  19556. alias: "pull_number",
  19557. deprecated: true,
  19558. type: "integer"
  19559. },
  19560. owner: {
  19561. required: true,
  19562. type: "string"
  19563. },
  19564. pull_number: {
  19565. required: true,
  19566. type: "integer"
  19567. },
  19568. repo: {
  19569. required: true,
  19570. type: "string"
  19571. },
  19572. review_id: {
  19573. required: true,
  19574. type: "integer"
  19575. }
  19576. },
  19577. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19578. }
  19579. },
  19580. rateLimit: {
  19581. get: {
  19582. method: "GET",
  19583. params: {},
  19584. url: "/rate_limit"
  19585. }
  19586. },
  19587. reactions: {
  19588. createForCommitComment: {
  19589. headers: {
  19590. accept: "application/vnd.github.squirrel-girl-preview+json"
  19591. },
  19592. method: "POST",
  19593. params: {
  19594. comment_id: {
  19595. required: true,
  19596. type: "integer"
  19597. },
  19598. content: {
  19599. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19600. required: true,
  19601. type: "string"
  19602. },
  19603. owner: {
  19604. required: true,
  19605. type: "string"
  19606. },
  19607. repo: {
  19608. required: true,
  19609. type: "string"
  19610. }
  19611. },
  19612. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19613. },
  19614. createForIssue: {
  19615. headers: {
  19616. accept: "application/vnd.github.squirrel-girl-preview+json"
  19617. },
  19618. method: "POST",
  19619. params: {
  19620. content: {
  19621. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19622. required: true,
  19623. type: "string"
  19624. },
  19625. issue_number: {
  19626. required: true,
  19627. type: "integer"
  19628. },
  19629. number: {
  19630. alias: "issue_number",
  19631. deprecated: true,
  19632. type: "integer"
  19633. },
  19634. owner: {
  19635. required: true,
  19636. type: "string"
  19637. },
  19638. repo: {
  19639. required: true,
  19640. type: "string"
  19641. }
  19642. },
  19643. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19644. },
  19645. createForIssueComment: {
  19646. headers: {
  19647. accept: "application/vnd.github.squirrel-girl-preview+json"
  19648. },
  19649. method: "POST",
  19650. params: {
  19651. comment_id: {
  19652. required: true,
  19653. type: "integer"
  19654. },
  19655. content: {
  19656. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19657. required: true,
  19658. type: "string"
  19659. },
  19660. owner: {
  19661. required: true,
  19662. type: "string"
  19663. },
  19664. repo: {
  19665. required: true,
  19666. type: "string"
  19667. }
  19668. },
  19669. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19670. },
  19671. createForPullRequestReviewComment: {
  19672. headers: {
  19673. accept: "application/vnd.github.squirrel-girl-preview+json"
  19674. },
  19675. method: "POST",
  19676. params: {
  19677. comment_id: {
  19678. required: true,
  19679. type: "integer"
  19680. },
  19681. content: {
  19682. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19683. required: true,
  19684. type: "string"
  19685. },
  19686. owner: {
  19687. required: true,
  19688. type: "string"
  19689. },
  19690. repo: {
  19691. required: true,
  19692. type: "string"
  19693. }
  19694. },
  19695. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19696. },
  19697. createForTeamDiscussion: {
  19698. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19699. headers: {
  19700. accept: "application/vnd.github.squirrel-girl-preview+json"
  19701. },
  19702. method: "POST",
  19703. params: {
  19704. content: {
  19705. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19706. required: true,
  19707. type: "string"
  19708. },
  19709. discussion_number: {
  19710. required: true,
  19711. type: "integer"
  19712. },
  19713. team_id: {
  19714. required: true,
  19715. type: "integer"
  19716. }
  19717. },
  19718. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19719. },
  19720. createForTeamDiscussionComment: {
  19721. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19722. headers: {
  19723. accept: "application/vnd.github.squirrel-girl-preview+json"
  19724. },
  19725. method: "POST",
  19726. params: {
  19727. comment_number: {
  19728. required: true,
  19729. type: "integer"
  19730. },
  19731. content: {
  19732. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19733. required: true,
  19734. type: "string"
  19735. },
  19736. discussion_number: {
  19737. required: true,
  19738. type: "integer"
  19739. },
  19740. team_id: {
  19741. required: true,
  19742. type: "integer"
  19743. }
  19744. },
  19745. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19746. },
  19747. createForTeamDiscussionCommentInOrg: {
  19748. headers: {
  19749. accept: "application/vnd.github.squirrel-girl-preview+json"
  19750. },
  19751. method: "POST",
  19752. params: {
  19753. comment_number: {
  19754. required: true,
  19755. type: "integer"
  19756. },
  19757. content: {
  19758. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19759. required: true,
  19760. type: "string"
  19761. },
  19762. discussion_number: {
  19763. required: true,
  19764. type: "integer"
  19765. },
  19766. org: {
  19767. required: true,
  19768. type: "string"
  19769. },
  19770. team_slug: {
  19771. required: true,
  19772. type: "string"
  19773. }
  19774. },
  19775. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19776. },
  19777. createForTeamDiscussionCommentLegacy: {
  19778. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19779. headers: {
  19780. accept: "application/vnd.github.squirrel-girl-preview+json"
  19781. },
  19782. method: "POST",
  19783. params: {
  19784. comment_number: {
  19785. required: true,
  19786. type: "integer"
  19787. },
  19788. content: {
  19789. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19790. required: true,
  19791. type: "string"
  19792. },
  19793. discussion_number: {
  19794. required: true,
  19795. type: "integer"
  19796. },
  19797. team_id: {
  19798. required: true,
  19799. type: "integer"
  19800. }
  19801. },
  19802. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19803. },
  19804. createForTeamDiscussionInOrg: {
  19805. headers: {
  19806. accept: "application/vnd.github.squirrel-girl-preview+json"
  19807. },
  19808. method: "POST",
  19809. params: {
  19810. content: {
  19811. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19812. required: true,
  19813. type: "string"
  19814. },
  19815. discussion_number: {
  19816. required: true,
  19817. type: "integer"
  19818. },
  19819. org: {
  19820. required: true,
  19821. type: "string"
  19822. },
  19823. team_slug: {
  19824. required: true,
  19825. type: "string"
  19826. }
  19827. },
  19828. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19829. },
  19830. createForTeamDiscussionLegacy: {
  19831. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19832. headers: {
  19833. accept: "application/vnd.github.squirrel-girl-preview+json"
  19834. },
  19835. method: "POST",
  19836. params: {
  19837. content: {
  19838. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19839. required: true,
  19840. type: "string"
  19841. },
  19842. discussion_number: {
  19843. required: true,
  19844. type: "integer"
  19845. },
  19846. team_id: {
  19847. required: true,
  19848. type: "integer"
  19849. }
  19850. },
  19851. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19852. },
  19853. delete: {
  19854. headers: {
  19855. accept: "application/vnd.github.squirrel-girl-preview+json"
  19856. },
  19857. method: "DELETE",
  19858. params: {
  19859. reaction_id: {
  19860. required: true,
  19861. type: "integer"
  19862. }
  19863. },
  19864. url: "/reactions/:reaction_id"
  19865. },
  19866. listForCommitComment: {
  19867. headers: {
  19868. accept: "application/vnd.github.squirrel-girl-preview+json"
  19869. },
  19870. method: "GET",
  19871. params: {
  19872. comment_id: {
  19873. required: true,
  19874. type: "integer"
  19875. },
  19876. content: {
  19877. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19878. type: "string"
  19879. },
  19880. owner: {
  19881. required: true,
  19882. type: "string"
  19883. },
  19884. page: {
  19885. type: "integer"
  19886. },
  19887. per_page: {
  19888. type: "integer"
  19889. },
  19890. repo: {
  19891. required: true,
  19892. type: "string"
  19893. }
  19894. },
  19895. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19896. },
  19897. listForIssue: {
  19898. headers: {
  19899. accept: "application/vnd.github.squirrel-girl-preview+json"
  19900. },
  19901. method: "GET",
  19902. params: {
  19903. content: {
  19904. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19905. type: "string"
  19906. },
  19907. issue_number: {
  19908. required: true,
  19909. type: "integer"
  19910. },
  19911. number: {
  19912. alias: "issue_number",
  19913. deprecated: true,
  19914. type: "integer"
  19915. },
  19916. owner: {
  19917. required: true,
  19918. type: "string"
  19919. },
  19920. page: {
  19921. type: "integer"
  19922. },
  19923. per_page: {
  19924. type: "integer"
  19925. },
  19926. repo: {
  19927. required: true,
  19928. type: "string"
  19929. }
  19930. },
  19931. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19932. },
  19933. listForIssueComment: {
  19934. headers: {
  19935. accept: "application/vnd.github.squirrel-girl-preview+json"
  19936. },
  19937. method: "GET",
  19938. params: {
  19939. comment_id: {
  19940. required: true,
  19941. type: "integer"
  19942. },
  19943. content: {
  19944. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19945. type: "string"
  19946. },
  19947. owner: {
  19948. required: true,
  19949. type: "string"
  19950. },
  19951. page: {
  19952. type: "integer"
  19953. },
  19954. per_page: {
  19955. type: "integer"
  19956. },
  19957. repo: {
  19958. required: true,
  19959. type: "string"
  19960. }
  19961. },
  19962. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19963. },
  19964. listForPullRequestReviewComment: {
  19965. headers: {
  19966. accept: "application/vnd.github.squirrel-girl-preview+json"
  19967. },
  19968. method: "GET",
  19969. params: {
  19970. comment_id: {
  19971. required: true,
  19972. type: "integer"
  19973. },
  19974. content: {
  19975. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19976. type: "string"
  19977. },
  19978. owner: {
  19979. required: true,
  19980. type: "string"
  19981. },
  19982. page: {
  19983. type: "integer"
  19984. },
  19985. per_page: {
  19986. type: "integer"
  19987. },
  19988. repo: {
  19989. required: true,
  19990. type: "string"
  19991. }
  19992. },
  19993. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19994. },
  19995. listForTeamDiscussion: {
  19996. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19997. headers: {
  19998. accept: "application/vnd.github.squirrel-girl-preview+json"
  19999. },
  20000. method: "GET",
  20001. params: {
  20002. content: {
  20003. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20004. type: "string"
  20005. },
  20006. discussion_number: {
  20007. required: true,
  20008. type: "integer"
  20009. },
  20010. page: {
  20011. type: "integer"
  20012. },
  20013. per_page: {
  20014. type: "integer"
  20015. },
  20016. team_id: {
  20017. required: true,
  20018. type: "integer"
  20019. }
  20020. },
  20021. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20022. },
  20023. listForTeamDiscussionComment: {
  20024. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  20025. headers: {
  20026. accept: "application/vnd.github.squirrel-girl-preview+json"
  20027. },
  20028. method: "GET",
  20029. params: {
  20030. comment_number: {
  20031. required: true,
  20032. type: "integer"
  20033. },
  20034. content: {
  20035. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20036. type: "string"
  20037. },
  20038. discussion_number: {
  20039. required: true,
  20040. type: "integer"
  20041. },
  20042. page: {
  20043. type: "integer"
  20044. },
  20045. per_page: {
  20046. type: "integer"
  20047. },
  20048. team_id: {
  20049. required: true,
  20050. type: "integer"
  20051. }
  20052. },
  20053. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  20054. },
  20055. listForTeamDiscussionCommentInOrg: {
  20056. headers: {
  20057. accept: "application/vnd.github.squirrel-girl-preview+json"
  20058. },
  20059. method: "GET",
  20060. params: {
  20061. comment_number: {
  20062. required: true,
  20063. type: "integer"
  20064. },
  20065. content: {
  20066. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20067. type: "string"
  20068. },
  20069. discussion_number: {
  20070. required: true,
  20071. type: "integer"
  20072. },
  20073. org: {
  20074. required: true,
  20075. type: "string"
  20076. },
  20077. page: {
  20078. type: "integer"
  20079. },
  20080. per_page: {
  20081. type: "integer"
  20082. },
  20083. team_slug: {
  20084. required: true,
  20085. type: "string"
  20086. }
  20087. },
  20088. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  20089. },
  20090. listForTeamDiscussionCommentLegacy: {
  20091. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  20092. headers: {
  20093. accept: "application/vnd.github.squirrel-girl-preview+json"
  20094. },
  20095. method: "GET",
  20096. params: {
  20097. comment_number: {
  20098. required: true,
  20099. type: "integer"
  20100. },
  20101. content: {
  20102. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20103. type: "string"
  20104. },
  20105. discussion_number: {
  20106. required: true,
  20107. type: "integer"
  20108. },
  20109. page: {
  20110. type: "integer"
  20111. },
  20112. per_page: {
  20113. type: "integer"
  20114. },
  20115. team_id: {
  20116. required: true,
  20117. type: "integer"
  20118. }
  20119. },
  20120. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  20121. },
  20122. listForTeamDiscussionInOrg: {
  20123. headers: {
  20124. accept: "application/vnd.github.squirrel-girl-preview+json"
  20125. },
  20126. method: "GET",
  20127. params: {
  20128. content: {
  20129. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20130. type: "string"
  20131. },
  20132. discussion_number: {
  20133. required: true,
  20134. type: "integer"
  20135. },
  20136. org: {
  20137. required: true,
  20138. type: "string"
  20139. },
  20140. page: {
  20141. type: "integer"
  20142. },
  20143. per_page: {
  20144. type: "integer"
  20145. },
  20146. team_slug: {
  20147. required: true,
  20148. type: "string"
  20149. }
  20150. },
  20151. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  20152. },
  20153. listForTeamDiscussionLegacy: {
  20154. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  20155. headers: {
  20156. accept: "application/vnd.github.squirrel-girl-preview+json"
  20157. },
  20158. method: "GET",
  20159. params: {
  20160. content: {
  20161. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20162. type: "string"
  20163. },
  20164. discussion_number: {
  20165. required: true,
  20166. type: "integer"
  20167. },
  20168. page: {
  20169. type: "integer"
  20170. },
  20171. per_page: {
  20172. type: "integer"
  20173. },
  20174. team_id: {
  20175. required: true,
  20176. type: "integer"
  20177. }
  20178. },
  20179. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20180. }
  20181. },
  20182. repos: {
  20183. acceptInvitation: {
  20184. method: "PATCH",
  20185. params: {
  20186. invitation_id: {
  20187. required: true,
  20188. type: "integer"
  20189. }
  20190. },
  20191. url: "/user/repository_invitations/:invitation_id"
  20192. },
  20193. addCollaborator: {
  20194. method: "PUT",
  20195. params: {
  20196. owner: {
  20197. required: true,
  20198. type: "string"
  20199. },
  20200. permission: {
  20201. enum: ["pull", "push", "admin"],
  20202. type: "string"
  20203. },
  20204. repo: {
  20205. required: true,
  20206. type: "string"
  20207. },
  20208. username: {
  20209. required: true,
  20210. type: "string"
  20211. }
  20212. },
  20213. url: "/repos/:owner/:repo/collaborators/:username"
  20214. },
  20215. addDeployKey: {
  20216. method: "POST",
  20217. params: {
  20218. key: {
  20219. required: true,
  20220. type: "string"
  20221. },
  20222. owner: {
  20223. required: true,
  20224. type: "string"
  20225. },
  20226. read_only: {
  20227. type: "boolean"
  20228. },
  20229. repo: {
  20230. required: true,
  20231. type: "string"
  20232. },
  20233. title: {
  20234. type: "string"
  20235. }
  20236. },
  20237. url: "/repos/:owner/:repo/keys"
  20238. },
  20239. addProtectedBranchAdminEnforcement: {
  20240. method: "POST",
  20241. params: {
  20242. branch: {
  20243. required: true,
  20244. type: "string"
  20245. },
  20246. owner: {
  20247. required: true,
  20248. type: "string"
  20249. },
  20250. repo: {
  20251. required: true,
  20252. type: "string"
  20253. }
  20254. },
  20255. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20256. },
  20257. addProtectedBranchAppRestrictions: {
  20258. method: "POST",
  20259. params: {
  20260. apps: {
  20261. mapTo: "data",
  20262. required: true,
  20263. type: "string[]"
  20264. },
  20265. branch: {
  20266. required: true,
  20267. type: "string"
  20268. },
  20269. owner: {
  20270. required: true,
  20271. type: "string"
  20272. },
  20273. repo: {
  20274. required: true,
  20275. type: "string"
  20276. }
  20277. },
  20278. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20279. },
  20280. addProtectedBranchRequiredSignatures: {
  20281. headers: {
  20282. accept: "application/vnd.github.zzzax-preview+json"
  20283. },
  20284. method: "POST",
  20285. params: {
  20286. branch: {
  20287. required: true,
  20288. type: "string"
  20289. },
  20290. owner: {
  20291. required: true,
  20292. type: "string"
  20293. },
  20294. repo: {
  20295. required: true,
  20296. type: "string"
  20297. }
  20298. },
  20299. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20300. },
  20301. addProtectedBranchRequiredStatusChecksContexts: {
  20302. method: "POST",
  20303. params: {
  20304. branch: {
  20305. required: true,
  20306. type: "string"
  20307. },
  20308. contexts: {
  20309. mapTo: "data",
  20310. required: true,
  20311. type: "string[]"
  20312. },
  20313. owner: {
  20314. required: true,
  20315. type: "string"
  20316. },
  20317. repo: {
  20318. required: true,
  20319. type: "string"
  20320. }
  20321. },
  20322. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20323. },
  20324. addProtectedBranchTeamRestrictions: {
  20325. method: "POST",
  20326. params: {
  20327. branch: {
  20328. required: true,
  20329. type: "string"
  20330. },
  20331. owner: {
  20332. required: true,
  20333. type: "string"
  20334. },
  20335. repo: {
  20336. required: true,
  20337. type: "string"
  20338. },
  20339. teams: {
  20340. mapTo: "data",
  20341. required: true,
  20342. type: "string[]"
  20343. }
  20344. },
  20345. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20346. },
  20347. addProtectedBranchUserRestrictions: {
  20348. method: "POST",
  20349. params: {
  20350. branch: {
  20351. required: true,
  20352. type: "string"
  20353. },
  20354. owner: {
  20355. required: true,
  20356. type: "string"
  20357. },
  20358. repo: {
  20359. required: true,
  20360. type: "string"
  20361. },
  20362. users: {
  20363. mapTo: "data",
  20364. required: true,
  20365. type: "string[]"
  20366. }
  20367. },
  20368. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20369. },
  20370. checkCollaborator: {
  20371. method: "GET",
  20372. params: {
  20373. owner: {
  20374. required: true,
  20375. type: "string"
  20376. },
  20377. repo: {
  20378. required: true,
  20379. type: "string"
  20380. },
  20381. username: {
  20382. required: true,
  20383. type: "string"
  20384. }
  20385. },
  20386. url: "/repos/:owner/:repo/collaborators/:username"
  20387. },
  20388. checkVulnerabilityAlerts: {
  20389. headers: {
  20390. accept: "application/vnd.github.dorian-preview+json"
  20391. },
  20392. method: "GET",
  20393. params: {
  20394. owner: {
  20395. required: true,
  20396. type: "string"
  20397. },
  20398. repo: {
  20399. required: true,
  20400. type: "string"
  20401. }
  20402. },
  20403. url: "/repos/:owner/:repo/vulnerability-alerts"
  20404. },
  20405. compareCommits: {
  20406. method: "GET",
  20407. params: {
  20408. base: {
  20409. required: true,
  20410. type: "string"
  20411. },
  20412. head: {
  20413. required: true,
  20414. type: "string"
  20415. },
  20416. owner: {
  20417. required: true,
  20418. type: "string"
  20419. },
  20420. repo: {
  20421. required: true,
  20422. type: "string"
  20423. }
  20424. },
  20425. url: "/repos/:owner/:repo/compare/:base...:head"
  20426. },
  20427. createCommitComment: {
  20428. method: "POST",
  20429. params: {
  20430. body: {
  20431. required: true,
  20432. type: "string"
  20433. },
  20434. commit_sha: {
  20435. required: true,
  20436. type: "string"
  20437. },
  20438. line: {
  20439. type: "integer"
  20440. },
  20441. owner: {
  20442. required: true,
  20443. type: "string"
  20444. },
  20445. path: {
  20446. type: "string"
  20447. },
  20448. position: {
  20449. type: "integer"
  20450. },
  20451. repo: {
  20452. required: true,
  20453. type: "string"
  20454. },
  20455. sha: {
  20456. alias: "commit_sha",
  20457. deprecated: true,
  20458. type: "string"
  20459. }
  20460. },
  20461. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20462. },
  20463. createDeployment: {
  20464. method: "POST",
  20465. params: {
  20466. auto_merge: {
  20467. type: "boolean"
  20468. },
  20469. description: {
  20470. type: "string"
  20471. },
  20472. environment: {
  20473. type: "string"
  20474. },
  20475. owner: {
  20476. required: true,
  20477. type: "string"
  20478. },
  20479. payload: {
  20480. type: "string"
  20481. },
  20482. production_environment: {
  20483. type: "boolean"
  20484. },
  20485. ref: {
  20486. required: true,
  20487. type: "string"
  20488. },
  20489. repo: {
  20490. required: true,
  20491. type: "string"
  20492. },
  20493. required_contexts: {
  20494. type: "string[]"
  20495. },
  20496. task: {
  20497. type: "string"
  20498. },
  20499. transient_environment: {
  20500. type: "boolean"
  20501. }
  20502. },
  20503. url: "/repos/:owner/:repo/deployments"
  20504. },
  20505. createDeploymentStatus: {
  20506. method: "POST",
  20507. params: {
  20508. auto_inactive: {
  20509. type: "boolean"
  20510. },
  20511. deployment_id: {
  20512. required: true,
  20513. type: "integer"
  20514. },
  20515. description: {
  20516. type: "string"
  20517. },
  20518. environment: {
  20519. enum: ["production", "staging", "qa"],
  20520. type: "string"
  20521. },
  20522. environment_url: {
  20523. type: "string"
  20524. },
  20525. log_url: {
  20526. type: "string"
  20527. },
  20528. owner: {
  20529. required: true,
  20530. type: "string"
  20531. },
  20532. repo: {
  20533. required: true,
  20534. type: "string"
  20535. },
  20536. state: {
  20537. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20538. required: true,
  20539. type: "string"
  20540. },
  20541. target_url: {
  20542. type: "string"
  20543. }
  20544. },
  20545. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20546. },
  20547. createDispatchEvent: {
  20548. method: "POST",
  20549. params: {
  20550. client_payload: {
  20551. type: "object"
  20552. },
  20553. event_type: {
  20554. type: "string"
  20555. },
  20556. owner: {
  20557. required: true,
  20558. type: "string"
  20559. },
  20560. repo: {
  20561. required: true,
  20562. type: "string"
  20563. }
  20564. },
  20565. url: "/repos/:owner/:repo/dispatches"
  20566. },
  20567. createFile: {
  20568. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20569. method: "PUT",
  20570. params: {
  20571. author: {
  20572. type: "object"
  20573. },
  20574. "author.email": {
  20575. required: true,
  20576. type: "string"
  20577. },
  20578. "author.name": {
  20579. required: true,
  20580. type: "string"
  20581. },
  20582. branch: {
  20583. type: "string"
  20584. },
  20585. committer: {
  20586. type: "object"
  20587. },
  20588. "committer.email": {
  20589. required: true,
  20590. type: "string"
  20591. },
  20592. "committer.name": {
  20593. required: true,
  20594. type: "string"
  20595. },
  20596. content: {
  20597. required: true,
  20598. type: "string"
  20599. },
  20600. message: {
  20601. required: true,
  20602. type: "string"
  20603. },
  20604. owner: {
  20605. required: true,
  20606. type: "string"
  20607. },
  20608. path: {
  20609. required: true,
  20610. type: "string"
  20611. },
  20612. repo: {
  20613. required: true,
  20614. type: "string"
  20615. },
  20616. sha: {
  20617. type: "string"
  20618. }
  20619. },
  20620. url: "/repos/:owner/:repo/contents/:path"
  20621. },
  20622. createForAuthenticatedUser: {
  20623. method: "POST",
  20624. params: {
  20625. allow_merge_commit: {
  20626. type: "boolean"
  20627. },
  20628. allow_rebase_merge: {
  20629. type: "boolean"
  20630. },
  20631. allow_squash_merge: {
  20632. type: "boolean"
  20633. },
  20634. auto_init: {
  20635. type: "boolean"
  20636. },
  20637. delete_branch_on_merge: {
  20638. type: "boolean"
  20639. },
  20640. description: {
  20641. type: "string"
  20642. },
  20643. gitignore_template: {
  20644. type: "string"
  20645. },
  20646. has_issues: {
  20647. type: "boolean"
  20648. },
  20649. has_projects: {
  20650. type: "boolean"
  20651. },
  20652. has_wiki: {
  20653. type: "boolean"
  20654. },
  20655. homepage: {
  20656. type: "string"
  20657. },
  20658. is_template: {
  20659. type: "boolean"
  20660. },
  20661. license_template: {
  20662. type: "string"
  20663. },
  20664. name: {
  20665. required: true,
  20666. type: "string"
  20667. },
  20668. private: {
  20669. type: "boolean"
  20670. },
  20671. team_id: {
  20672. type: "integer"
  20673. },
  20674. visibility: {
  20675. enum: ["public", "private", "visibility", "internal"],
  20676. type: "string"
  20677. }
  20678. },
  20679. url: "/user/repos"
  20680. },
  20681. createFork: {
  20682. method: "POST",
  20683. params: {
  20684. organization: {
  20685. type: "string"
  20686. },
  20687. owner: {
  20688. required: true,
  20689. type: "string"
  20690. },
  20691. repo: {
  20692. required: true,
  20693. type: "string"
  20694. }
  20695. },
  20696. url: "/repos/:owner/:repo/forks"
  20697. },
  20698. createHook: {
  20699. method: "POST",
  20700. params: {
  20701. active: {
  20702. type: "boolean"
  20703. },
  20704. config: {
  20705. required: true,
  20706. type: "object"
  20707. },
  20708. "config.content_type": {
  20709. type: "string"
  20710. },
  20711. "config.insecure_ssl": {
  20712. type: "string"
  20713. },
  20714. "config.secret": {
  20715. type: "string"
  20716. },
  20717. "config.url": {
  20718. required: true,
  20719. type: "string"
  20720. },
  20721. events: {
  20722. type: "string[]"
  20723. },
  20724. name: {
  20725. type: "string"
  20726. },
  20727. owner: {
  20728. required: true,
  20729. type: "string"
  20730. },
  20731. repo: {
  20732. required: true,
  20733. type: "string"
  20734. }
  20735. },
  20736. url: "/repos/:owner/:repo/hooks"
  20737. },
  20738. createInOrg: {
  20739. method: "POST",
  20740. params: {
  20741. allow_merge_commit: {
  20742. type: "boolean"
  20743. },
  20744. allow_rebase_merge: {
  20745. type: "boolean"
  20746. },
  20747. allow_squash_merge: {
  20748. type: "boolean"
  20749. },
  20750. auto_init: {
  20751. type: "boolean"
  20752. },
  20753. delete_branch_on_merge: {
  20754. type: "boolean"
  20755. },
  20756. description: {
  20757. type: "string"
  20758. },
  20759. gitignore_template: {
  20760. type: "string"
  20761. },
  20762. has_issues: {
  20763. type: "boolean"
  20764. },
  20765. has_projects: {
  20766. type: "boolean"
  20767. },
  20768. has_wiki: {
  20769. type: "boolean"
  20770. },
  20771. homepage: {
  20772. type: "string"
  20773. },
  20774. is_template: {
  20775. type: "boolean"
  20776. },
  20777. license_template: {
  20778. type: "string"
  20779. },
  20780. name: {
  20781. required: true,
  20782. type: "string"
  20783. },
  20784. org: {
  20785. required: true,
  20786. type: "string"
  20787. },
  20788. private: {
  20789. type: "boolean"
  20790. },
  20791. team_id: {
  20792. type: "integer"
  20793. },
  20794. visibility: {
  20795. enum: ["public", "private", "visibility", "internal"],
  20796. type: "string"
  20797. }
  20798. },
  20799. url: "/orgs/:org/repos"
  20800. },
  20801. createOrUpdateFile: {
  20802. method: "PUT",
  20803. params: {
  20804. author: {
  20805. type: "object"
  20806. },
  20807. "author.email": {
  20808. required: true,
  20809. type: "string"
  20810. },
  20811. "author.name": {
  20812. required: true,
  20813. type: "string"
  20814. },
  20815. branch: {
  20816. type: "string"
  20817. },
  20818. committer: {
  20819. type: "object"
  20820. },
  20821. "committer.email": {
  20822. required: true,
  20823. type: "string"
  20824. },
  20825. "committer.name": {
  20826. required: true,
  20827. type: "string"
  20828. },
  20829. content: {
  20830. required: true,
  20831. type: "string"
  20832. },
  20833. message: {
  20834. required: true,
  20835. type: "string"
  20836. },
  20837. owner: {
  20838. required: true,
  20839. type: "string"
  20840. },
  20841. path: {
  20842. required: true,
  20843. type: "string"
  20844. },
  20845. repo: {
  20846. required: true,
  20847. type: "string"
  20848. },
  20849. sha: {
  20850. type: "string"
  20851. }
  20852. },
  20853. url: "/repos/:owner/:repo/contents/:path"
  20854. },
  20855. createRelease: {
  20856. method: "POST",
  20857. params: {
  20858. body: {
  20859. type: "string"
  20860. },
  20861. draft: {
  20862. type: "boolean"
  20863. },
  20864. name: {
  20865. type: "string"
  20866. },
  20867. owner: {
  20868. required: true,
  20869. type: "string"
  20870. },
  20871. prerelease: {
  20872. type: "boolean"
  20873. },
  20874. repo: {
  20875. required: true,
  20876. type: "string"
  20877. },
  20878. tag_name: {
  20879. required: true,
  20880. type: "string"
  20881. },
  20882. target_commitish: {
  20883. type: "string"
  20884. }
  20885. },
  20886. url: "/repos/:owner/:repo/releases"
  20887. },
  20888. createStatus: {
  20889. method: "POST",
  20890. params: {
  20891. context: {
  20892. type: "string"
  20893. },
  20894. description: {
  20895. type: "string"
  20896. },
  20897. owner: {
  20898. required: true,
  20899. type: "string"
  20900. },
  20901. repo: {
  20902. required: true,
  20903. type: "string"
  20904. },
  20905. sha: {
  20906. required: true,
  20907. type: "string"
  20908. },
  20909. state: {
  20910. enum: ["error", "failure", "pending", "success"],
  20911. required: true,
  20912. type: "string"
  20913. },
  20914. target_url: {
  20915. type: "string"
  20916. }
  20917. },
  20918. url: "/repos/:owner/:repo/statuses/:sha"
  20919. },
  20920. createUsingTemplate: {
  20921. headers: {
  20922. accept: "application/vnd.github.baptiste-preview+json"
  20923. },
  20924. method: "POST",
  20925. params: {
  20926. description: {
  20927. type: "string"
  20928. },
  20929. name: {
  20930. required: true,
  20931. type: "string"
  20932. },
  20933. owner: {
  20934. type: "string"
  20935. },
  20936. private: {
  20937. type: "boolean"
  20938. },
  20939. template_owner: {
  20940. required: true,
  20941. type: "string"
  20942. },
  20943. template_repo: {
  20944. required: true,
  20945. type: "string"
  20946. }
  20947. },
  20948. url: "/repos/:template_owner/:template_repo/generate"
  20949. },
  20950. declineInvitation: {
  20951. method: "DELETE",
  20952. params: {
  20953. invitation_id: {
  20954. required: true,
  20955. type: "integer"
  20956. }
  20957. },
  20958. url: "/user/repository_invitations/:invitation_id"
  20959. },
  20960. delete: {
  20961. method: "DELETE",
  20962. params: {
  20963. owner: {
  20964. required: true,
  20965. type: "string"
  20966. },
  20967. repo: {
  20968. required: true,
  20969. type: "string"
  20970. }
  20971. },
  20972. url: "/repos/:owner/:repo"
  20973. },
  20974. deleteCommitComment: {
  20975. method: "DELETE",
  20976. params: {
  20977. comment_id: {
  20978. required: true,
  20979. type: "integer"
  20980. },
  20981. owner: {
  20982. required: true,
  20983. type: "string"
  20984. },
  20985. repo: {
  20986. required: true,
  20987. type: "string"
  20988. }
  20989. },
  20990. url: "/repos/:owner/:repo/comments/:comment_id"
  20991. },
  20992. deleteDownload: {
  20993. method: "DELETE",
  20994. params: {
  20995. download_id: {
  20996. required: true,
  20997. type: "integer"
  20998. },
  20999. owner: {
  21000. required: true,
  21001. type: "string"
  21002. },
  21003. repo: {
  21004. required: true,
  21005. type: "string"
  21006. }
  21007. },
  21008. url: "/repos/:owner/:repo/downloads/:download_id"
  21009. },
  21010. deleteFile: {
  21011. method: "DELETE",
  21012. params: {
  21013. author: {
  21014. type: "object"
  21015. },
  21016. "author.email": {
  21017. type: "string"
  21018. },
  21019. "author.name": {
  21020. type: "string"
  21021. },
  21022. branch: {
  21023. type: "string"
  21024. },
  21025. committer: {
  21026. type: "object"
  21027. },
  21028. "committer.email": {
  21029. type: "string"
  21030. },
  21031. "committer.name": {
  21032. type: "string"
  21033. },
  21034. message: {
  21035. required: true,
  21036. type: "string"
  21037. },
  21038. owner: {
  21039. required: true,
  21040. type: "string"
  21041. },
  21042. path: {
  21043. required: true,
  21044. type: "string"
  21045. },
  21046. repo: {
  21047. required: true,
  21048. type: "string"
  21049. },
  21050. sha: {
  21051. required: true,
  21052. type: "string"
  21053. }
  21054. },
  21055. url: "/repos/:owner/:repo/contents/:path"
  21056. },
  21057. deleteHook: {
  21058. method: "DELETE",
  21059. params: {
  21060. hook_id: {
  21061. required: true,
  21062. type: "integer"
  21063. },
  21064. owner: {
  21065. required: true,
  21066. type: "string"
  21067. },
  21068. repo: {
  21069. required: true,
  21070. type: "string"
  21071. }
  21072. },
  21073. url: "/repos/:owner/:repo/hooks/:hook_id"
  21074. },
  21075. deleteInvitation: {
  21076. method: "DELETE",
  21077. params: {
  21078. invitation_id: {
  21079. required: true,
  21080. type: "integer"
  21081. },
  21082. owner: {
  21083. required: true,
  21084. type: "string"
  21085. },
  21086. repo: {
  21087. required: true,
  21088. type: "string"
  21089. }
  21090. },
  21091. url: "/repos/:owner/:repo/invitations/:invitation_id"
  21092. },
  21093. deleteRelease: {
  21094. method: "DELETE",
  21095. params: {
  21096. owner: {
  21097. required: true,
  21098. type: "string"
  21099. },
  21100. release_id: {
  21101. required: true,
  21102. type: "integer"
  21103. },
  21104. repo: {
  21105. required: true,
  21106. type: "string"
  21107. }
  21108. },
  21109. url: "/repos/:owner/:repo/releases/:release_id"
  21110. },
  21111. deleteReleaseAsset: {
  21112. method: "DELETE",
  21113. params: {
  21114. asset_id: {
  21115. required: true,
  21116. type: "integer"
  21117. },
  21118. owner: {
  21119. required: true,
  21120. type: "string"
  21121. },
  21122. repo: {
  21123. required: true,
  21124. type: "string"
  21125. }
  21126. },
  21127. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21128. },
  21129. disableAutomatedSecurityFixes: {
  21130. headers: {
  21131. accept: "application/vnd.github.london-preview+json"
  21132. },
  21133. method: "DELETE",
  21134. params: {
  21135. owner: {
  21136. required: true,
  21137. type: "string"
  21138. },
  21139. repo: {
  21140. required: true,
  21141. type: "string"
  21142. }
  21143. },
  21144. url: "/repos/:owner/:repo/automated-security-fixes"
  21145. },
  21146. disablePagesSite: {
  21147. headers: {
  21148. accept: "application/vnd.github.switcheroo-preview+json"
  21149. },
  21150. method: "DELETE",
  21151. params: {
  21152. owner: {
  21153. required: true,
  21154. type: "string"
  21155. },
  21156. repo: {
  21157. required: true,
  21158. type: "string"
  21159. }
  21160. },
  21161. url: "/repos/:owner/:repo/pages"
  21162. },
  21163. disableVulnerabilityAlerts: {
  21164. headers: {
  21165. accept: "application/vnd.github.dorian-preview+json"
  21166. },
  21167. method: "DELETE",
  21168. params: {
  21169. owner: {
  21170. required: true,
  21171. type: "string"
  21172. },
  21173. repo: {
  21174. required: true,
  21175. type: "string"
  21176. }
  21177. },
  21178. url: "/repos/:owner/:repo/vulnerability-alerts"
  21179. },
  21180. enableAutomatedSecurityFixes: {
  21181. headers: {
  21182. accept: "application/vnd.github.london-preview+json"
  21183. },
  21184. method: "PUT",
  21185. params: {
  21186. owner: {
  21187. required: true,
  21188. type: "string"
  21189. },
  21190. repo: {
  21191. required: true,
  21192. type: "string"
  21193. }
  21194. },
  21195. url: "/repos/:owner/:repo/automated-security-fixes"
  21196. },
  21197. enablePagesSite: {
  21198. headers: {
  21199. accept: "application/vnd.github.switcheroo-preview+json"
  21200. },
  21201. method: "POST",
  21202. params: {
  21203. owner: {
  21204. required: true,
  21205. type: "string"
  21206. },
  21207. repo: {
  21208. required: true,
  21209. type: "string"
  21210. },
  21211. source: {
  21212. type: "object"
  21213. },
  21214. "source.branch": {
  21215. enum: ["master", "gh-pages"],
  21216. type: "string"
  21217. },
  21218. "source.path": {
  21219. type: "string"
  21220. }
  21221. },
  21222. url: "/repos/:owner/:repo/pages"
  21223. },
  21224. enableVulnerabilityAlerts: {
  21225. headers: {
  21226. accept: "application/vnd.github.dorian-preview+json"
  21227. },
  21228. method: "PUT",
  21229. params: {
  21230. owner: {
  21231. required: true,
  21232. type: "string"
  21233. },
  21234. repo: {
  21235. required: true,
  21236. type: "string"
  21237. }
  21238. },
  21239. url: "/repos/:owner/:repo/vulnerability-alerts"
  21240. },
  21241. get: {
  21242. method: "GET",
  21243. params: {
  21244. owner: {
  21245. required: true,
  21246. type: "string"
  21247. },
  21248. repo: {
  21249. required: true,
  21250. type: "string"
  21251. }
  21252. },
  21253. url: "/repos/:owner/:repo"
  21254. },
  21255. getAppsWithAccessToProtectedBranch: {
  21256. method: "GET",
  21257. params: {
  21258. branch: {
  21259. required: true,
  21260. type: "string"
  21261. },
  21262. owner: {
  21263. required: true,
  21264. type: "string"
  21265. },
  21266. repo: {
  21267. required: true,
  21268. type: "string"
  21269. }
  21270. },
  21271. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21272. },
  21273. getArchiveLink: {
  21274. method: "GET",
  21275. params: {
  21276. archive_format: {
  21277. required: true,
  21278. type: "string"
  21279. },
  21280. owner: {
  21281. required: true,
  21282. type: "string"
  21283. },
  21284. ref: {
  21285. required: true,
  21286. type: "string"
  21287. },
  21288. repo: {
  21289. required: true,
  21290. type: "string"
  21291. }
  21292. },
  21293. url: "/repos/:owner/:repo/:archive_format/:ref"
  21294. },
  21295. getBranch: {
  21296. method: "GET",
  21297. params: {
  21298. branch: {
  21299. required: true,
  21300. type: "string"
  21301. },
  21302. owner: {
  21303. required: true,
  21304. type: "string"
  21305. },
  21306. repo: {
  21307. required: true,
  21308. type: "string"
  21309. }
  21310. },
  21311. url: "/repos/:owner/:repo/branches/:branch"
  21312. },
  21313. getBranchProtection: {
  21314. method: "GET",
  21315. params: {
  21316. branch: {
  21317. required: true,
  21318. type: "string"
  21319. },
  21320. owner: {
  21321. required: true,
  21322. type: "string"
  21323. },
  21324. repo: {
  21325. required: true,
  21326. type: "string"
  21327. }
  21328. },
  21329. url: "/repos/:owner/:repo/branches/:branch/protection"
  21330. },
  21331. getClones: {
  21332. method: "GET",
  21333. params: {
  21334. owner: {
  21335. required: true,
  21336. type: "string"
  21337. },
  21338. per: {
  21339. enum: ["day", "week"],
  21340. type: "string"
  21341. },
  21342. repo: {
  21343. required: true,
  21344. type: "string"
  21345. }
  21346. },
  21347. url: "/repos/:owner/:repo/traffic/clones"
  21348. },
  21349. getCodeFrequencyStats: {
  21350. method: "GET",
  21351. params: {
  21352. owner: {
  21353. required: true,
  21354. type: "string"
  21355. },
  21356. repo: {
  21357. required: true,
  21358. type: "string"
  21359. }
  21360. },
  21361. url: "/repos/:owner/:repo/stats/code_frequency"
  21362. },
  21363. getCollaboratorPermissionLevel: {
  21364. method: "GET",
  21365. params: {
  21366. owner: {
  21367. required: true,
  21368. type: "string"
  21369. },
  21370. repo: {
  21371. required: true,
  21372. type: "string"
  21373. },
  21374. username: {
  21375. required: true,
  21376. type: "string"
  21377. }
  21378. },
  21379. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21380. },
  21381. getCombinedStatusForRef: {
  21382. method: "GET",
  21383. params: {
  21384. owner: {
  21385. required: true,
  21386. type: "string"
  21387. },
  21388. ref: {
  21389. required: true,
  21390. type: "string"
  21391. },
  21392. repo: {
  21393. required: true,
  21394. type: "string"
  21395. }
  21396. },
  21397. url: "/repos/:owner/:repo/commits/:ref/status"
  21398. },
  21399. getCommit: {
  21400. method: "GET",
  21401. params: {
  21402. commit_sha: {
  21403. alias: "ref",
  21404. deprecated: true,
  21405. type: "string"
  21406. },
  21407. owner: {
  21408. required: true,
  21409. type: "string"
  21410. },
  21411. ref: {
  21412. required: true,
  21413. type: "string"
  21414. },
  21415. repo: {
  21416. required: true,
  21417. type: "string"
  21418. },
  21419. sha: {
  21420. alias: "ref",
  21421. deprecated: true,
  21422. type: "string"
  21423. }
  21424. },
  21425. url: "/repos/:owner/:repo/commits/:ref"
  21426. },
  21427. getCommitActivityStats: {
  21428. method: "GET",
  21429. params: {
  21430. owner: {
  21431. required: true,
  21432. type: "string"
  21433. },
  21434. repo: {
  21435. required: true,
  21436. type: "string"
  21437. }
  21438. },
  21439. url: "/repos/:owner/:repo/stats/commit_activity"
  21440. },
  21441. getCommitComment: {
  21442. method: "GET",
  21443. params: {
  21444. comment_id: {
  21445. required: true,
  21446. type: "integer"
  21447. },
  21448. owner: {
  21449. required: true,
  21450. type: "string"
  21451. },
  21452. repo: {
  21453. required: true,
  21454. type: "string"
  21455. }
  21456. },
  21457. url: "/repos/:owner/:repo/comments/:comment_id"
  21458. },
  21459. getCommitRefSha: {
  21460. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21461. headers: {
  21462. accept: "application/vnd.github.v3.sha"
  21463. },
  21464. method: "GET",
  21465. params: {
  21466. owner: {
  21467. required: true,
  21468. type: "string"
  21469. },
  21470. ref: {
  21471. required: true,
  21472. type: "string"
  21473. },
  21474. repo: {
  21475. required: true,
  21476. type: "string"
  21477. }
  21478. },
  21479. url: "/repos/:owner/:repo/commits/:ref"
  21480. },
  21481. getContents: {
  21482. method: "GET",
  21483. params: {
  21484. owner: {
  21485. required: true,
  21486. type: "string"
  21487. },
  21488. path: {
  21489. required: true,
  21490. type: "string"
  21491. },
  21492. ref: {
  21493. type: "string"
  21494. },
  21495. repo: {
  21496. required: true,
  21497. type: "string"
  21498. }
  21499. },
  21500. url: "/repos/:owner/:repo/contents/:path"
  21501. },
  21502. getContributorsStats: {
  21503. method: "GET",
  21504. params: {
  21505. owner: {
  21506. required: true,
  21507. type: "string"
  21508. },
  21509. repo: {
  21510. required: true,
  21511. type: "string"
  21512. }
  21513. },
  21514. url: "/repos/:owner/:repo/stats/contributors"
  21515. },
  21516. getDeployKey: {
  21517. method: "GET",
  21518. params: {
  21519. key_id: {
  21520. required: true,
  21521. type: "integer"
  21522. },
  21523. owner: {
  21524. required: true,
  21525. type: "string"
  21526. },
  21527. repo: {
  21528. required: true,
  21529. type: "string"
  21530. }
  21531. },
  21532. url: "/repos/:owner/:repo/keys/:key_id"
  21533. },
  21534. getDeployment: {
  21535. method: "GET",
  21536. params: {
  21537. deployment_id: {
  21538. required: true,
  21539. type: "integer"
  21540. },
  21541. owner: {
  21542. required: true,
  21543. type: "string"
  21544. },
  21545. repo: {
  21546. required: true,
  21547. type: "string"
  21548. }
  21549. },
  21550. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21551. },
  21552. getDeploymentStatus: {
  21553. method: "GET",
  21554. params: {
  21555. deployment_id: {
  21556. required: true,
  21557. type: "integer"
  21558. },
  21559. owner: {
  21560. required: true,
  21561. type: "string"
  21562. },
  21563. repo: {
  21564. required: true,
  21565. type: "string"
  21566. },
  21567. status_id: {
  21568. required: true,
  21569. type: "integer"
  21570. }
  21571. },
  21572. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21573. },
  21574. getDownload: {
  21575. method: "GET",
  21576. params: {
  21577. download_id: {
  21578. required: true,
  21579. type: "integer"
  21580. },
  21581. owner: {
  21582. required: true,
  21583. type: "string"
  21584. },
  21585. repo: {
  21586. required: true,
  21587. type: "string"
  21588. }
  21589. },
  21590. url: "/repos/:owner/:repo/downloads/:download_id"
  21591. },
  21592. getHook: {
  21593. method: "GET",
  21594. params: {
  21595. hook_id: {
  21596. required: true,
  21597. type: "integer"
  21598. },
  21599. owner: {
  21600. required: true,
  21601. type: "string"
  21602. },
  21603. repo: {
  21604. required: true,
  21605. type: "string"
  21606. }
  21607. },
  21608. url: "/repos/:owner/:repo/hooks/:hook_id"
  21609. },
  21610. getLatestPagesBuild: {
  21611. method: "GET",
  21612. params: {
  21613. owner: {
  21614. required: true,
  21615. type: "string"
  21616. },
  21617. repo: {
  21618. required: true,
  21619. type: "string"
  21620. }
  21621. },
  21622. url: "/repos/:owner/:repo/pages/builds/latest"
  21623. },
  21624. getLatestRelease: {
  21625. method: "GET",
  21626. params: {
  21627. owner: {
  21628. required: true,
  21629. type: "string"
  21630. },
  21631. repo: {
  21632. required: true,
  21633. type: "string"
  21634. }
  21635. },
  21636. url: "/repos/:owner/:repo/releases/latest"
  21637. },
  21638. getPages: {
  21639. method: "GET",
  21640. params: {
  21641. owner: {
  21642. required: true,
  21643. type: "string"
  21644. },
  21645. repo: {
  21646. required: true,
  21647. type: "string"
  21648. }
  21649. },
  21650. url: "/repos/:owner/:repo/pages"
  21651. },
  21652. getPagesBuild: {
  21653. method: "GET",
  21654. params: {
  21655. build_id: {
  21656. required: true,
  21657. type: "integer"
  21658. },
  21659. owner: {
  21660. required: true,
  21661. type: "string"
  21662. },
  21663. repo: {
  21664. required: true,
  21665. type: "string"
  21666. }
  21667. },
  21668. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21669. },
  21670. getParticipationStats: {
  21671. method: "GET",
  21672. params: {
  21673. owner: {
  21674. required: true,
  21675. type: "string"
  21676. },
  21677. repo: {
  21678. required: true,
  21679. type: "string"
  21680. }
  21681. },
  21682. url: "/repos/:owner/:repo/stats/participation"
  21683. },
  21684. getProtectedBranchAdminEnforcement: {
  21685. method: "GET",
  21686. params: {
  21687. branch: {
  21688. required: true,
  21689. type: "string"
  21690. },
  21691. owner: {
  21692. required: true,
  21693. type: "string"
  21694. },
  21695. repo: {
  21696. required: true,
  21697. type: "string"
  21698. }
  21699. },
  21700. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21701. },
  21702. getProtectedBranchPullRequestReviewEnforcement: {
  21703. method: "GET",
  21704. params: {
  21705. branch: {
  21706. required: true,
  21707. type: "string"
  21708. },
  21709. owner: {
  21710. required: true,
  21711. type: "string"
  21712. },
  21713. repo: {
  21714. required: true,
  21715. type: "string"
  21716. }
  21717. },
  21718. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21719. },
  21720. getProtectedBranchRequiredSignatures: {
  21721. headers: {
  21722. accept: "application/vnd.github.zzzax-preview+json"
  21723. },
  21724. method: "GET",
  21725. params: {
  21726. branch: {
  21727. required: true,
  21728. type: "string"
  21729. },
  21730. owner: {
  21731. required: true,
  21732. type: "string"
  21733. },
  21734. repo: {
  21735. required: true,
  21736. type: "string"
  21737. }
  21738. },
  21739. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21740. },
  21741. getProtectedBranchRequiredStatusChecks: {
  21742. method: "GET",
  21743. params: {
  21744. branch: {
  21745. required: true,
  21746. type: "string"
  21747. },
  21748. owner: {
  21749. required: true,
  21750. type: "string"
  21751. },
  21752. repo: {
  21753. required: true,
  21754. type: "string"
  21755. }
  21756. },
  21757. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21758. },
  21759. getProtectedBranchRestrictions: {
  21760. method: "GET",
  21761. params: {
  21762. branch: {
  21763. required: true,
  21764. type: "string"
  21765. },
  21766. owner: {
  21767. required: true,
  21768. type: "string"
  21769. },
  21770. repo: {
  21771. required: true,
  21772. type: "string"
  21773. }
  21774. },
  21775. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21776. },
  21777. getPunchCardStats: {
  21778. method: "GET",
  21779. params: {
  21780. owner: {
  21781. required: true,
  21782. type: "string"
  21783. },
  21784. repo: {
  21785. required: true,
  21786. type: "string"
  21787. }
  21788. },
  21789. url: "/repos/:owner/:repo/stats/punch_card"
  21790. },
  21791. getReadme: {
  21792. method: "GET",
  21793. params: {
  21794. owner: {
  21795. required: true,
  21796. type: "string"
  21797. },
  21798. ref: {
  21799. type: "string"
  21800. },
  21801. repo: {
  21802. required: true,
  21803. type: "string"
  21804. }
  21805. },
  21806. url: "/repos/:owner/:repo/readme"
  21807. },
  21808. getRelease: {
  21809. method: "GET",
  21810. params: {
  21811. owner: {
  21812. required: true,
  21813. type: "string"
  21814. },
  21815. release_id: {
  21816. required: true,
  21817. type: "integer"
  21818. },
  21819. repo: {
  21820. required: true,
  21821. type: "string"
  21822. }
  21823. },
  21824. url: "/repos/:owner/:repo/releases/:release_id"
  21825. },
  21826. getReleaseAsset: {
  21827. method: "GET",
  21828. params: {
  21829. asset_id: {
  21830. required: true,
  21831. type: "integer"
  21832. },
  21833. owner: {
  21834. required: true,
  21835. type: "string"
  21836. },
  21837. repo: {
  21838. required: true,
  21839. type: "string"
  21840. }
  21841. },
  21842. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21843. },
  21844. getReleaseByTag: {
  21845. method: "GET",
  21846. params: {
  21847. owner: {
  21848. required: true,
  21849. type: "string"
  21850. },
  21851. repo: {
  21852. required: true,
  21853. type: "string"
  21854. },
  21855. tag: {
  21856. required: true,
  21857. type: "string"
  21858. }
  21859. },
  21860. url: "/repos/:owner/:repo/releases/tags/:tag"
  21861. },
  21862. getTeamsWithAccessToProtectedBranch: {
  21863. method: "GET",
  21864. params: {
  21865. branch: {
  21866. required: true,
  21867. type: "string"
  21868. },
  21869. owner: {
  21870. required: true,
  21871. type: "string"
  21872. },
  21873. repo: {
  21874. required: true,
  21875. type: "string"
  21876. }
  21877. },
  21878. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21879. },
  21880. getTopPaths: {
  21881. method: "GET",
  21882. params: {
  21883. owner: {
  21884. required: true,
  21885. type: "string"
  21886. },
  21887. repo: {
  21888. required: true,
  21889. type: "string"
  21890. }
  21891. },
  21892. url: "/repos/:owner/:repo/traffic/popular/paths"
  21893. },
  21894. getTopReferrers: {
  21895. method: "GET",
  21896. params: {
  21897. owner: {
  21898. required: true,
  21899. type: "string"
  21900. },
  21901. repo: {
  21902. required: true,
  21903. type: "string"
  21904. }
  21905. },
  21906. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21907. },
  21908. getUsersWithAccessToProtectedBranch: {
  21909. method: "GET",
  21910. params: {
  21911. branch: {
  21912. required: true,
  21913. type: "string"
  21914. },
  21915. owner: {
  21916. required: true,
  21917. type: "string"
  21918. },
  21919. repo: {
  21920. required: true,
  21921. type: "string"
  21922. }
  21923. },
  21924. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21925. },
  21926. getViews: {
  21927. method: "GET",
  21928. params: {
  21929. owner: {
  21930. required: true,
  21931. type: "string"
  21932. },
  21933. per: {
  21934. enum: ["day", "week"],
  21935. type: "string"
  21936. },
  21937. repo: {
  21938. required: true,
  21939. type: "string"
  21940. }
  21941. },
  21942. url: "/repos/:owner/:repo/traffic/views"
  21943. },
  21944. list: {
  21945. method: "GET",
  21946. params: {
  21947. affiliation: {
  21948. type: "string"
  21949. },
  21950. direction: {
  21951. enum: ["asc", "desc"],
  21952. type: "string"
  21953. },
  21954. page: {
  21955. type: "integer"
  21956. },
  21957. per_page: {
  21958. type: "integer"
  21959. },
  21960. sort: {
  21961. enum: ["created", "updated", "pushed", "full_name"],
  21962. type: "string"
  21963. },
  21964. type: {
  21965. enum: ["all", "owner", "public", "private", "member"],
  21966. type: "string"
  21967. },
  21968. visibility: {
  21969. enum: ["all", "public", "private"],
  21970. type: "string"
  21971. }
  21972. },
  21973. url: "/user/repos"
  21974. },
  21975. listAppsWithAccessToProtectedBranch: {
  21976. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21977. method: "GET",
  21978. params: {
  21979. branch: {
  21980. required: true,
  21981. type: "string"
  21982. },
  21983. owner: {
  21984. required: true,
  21985. type: "string"
  21986. },
  21987. repo: {
  21988. required: true,
  21989. type: "string"
  21990. }
  21991. },
  21992. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21993. },
  21994. listAssetsForRelease: {
  21995. method: "GET",
  21996. params: {
  21997. owner: {
  21998. required: true,
  21999. type: "string"
  22000. },
  22001. page: {
  22002. type: "integer"
  22003. },
  22004. per_page: {
  22005. type: "integer"
  22006. },
  22007. release_id: {
  22008. required: true,
  22009. type: "integer"
  22010. },
  22011. repo: {
  22012. required: true,
  22013. type: "string"
  22014. }
  22015. },
  22016. url: "/repos/:owner/:repo/releases/:release_id/assets"
  22017. },
  22018. listBranches: {
  22019. method: "GET",
  22020. params: {
  22021. owner: {
  22022. required: true,
  22023. type: "string"
  22024. },
  22025. page: {
  22026. type: "integer"
  22027. },
  22028. per_page: {
  22029. type: "integer"
  22030. },
  22031. protected: {
  22032. type: "boolean"
  22033. },
  22034. repo: {
  22035. required: true,
  22036. type: "string"
  22037. }
  22038. },
  22039. url: "/repos/:owner/:repo/branches"
  22040. },
  22041. listBranchesForHeadCommit: {
  22042. headers: {
  22043. accept: "application/vnd.github.groot-preview+json"
  22044. },
  22045. method: "GET",
  22046. params: {
  22047. commit_sha: {
  22048. required: true,
  22049. type: "string"
  22050. },
  22051. owner: {
  22052. required: true,
  22053. type: "string"
  22054. },
  22055. repo: {
  22056. required: true,
  22057. type: "string"
  22058. }
  22059. },
  22060. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  22061. },
  22062. listCollaborators: {
  22063. method: "GET",
  22064. params: {
  22065. affiliation: {
  22066. enum: ["outside", "direct", "all"],
  22067. type: "string"
  22068. },
  22069. owner: {
  22070. required: true,
  22071. type: "string"
  22072. },
  22073. page: {
  22074. type: "integer"
  22075. },
  22076. per_page: {
  22077. type: "integer"
  22078. },
  22079. repo: {
  22080. required: true,
  22081. type: "string"
  22082. }
  22083. },
  22084. url: "/repos/:owner/:repo/collaborators"
  22085. },
  22086. listCommentsForCommit: {
  22087. method: "GET",
  22088. params: {
  22089. commit_sha: {
  22090. required: true,
  22091. type: "string"
  22092. },
  22093. owner: {
  22094. required: true,
  22095. type: "string"
  22096. },
  22097. page: {
  22098. type: "integer"
  22099. },
  22100. per_page: {
  22101. type: "integer"
  22102. },
  22103. ref: {
  22104. alias: "commit_sha",
  22105. deprecated: true,
  22106. type: "string"
  22107. },
  22108. repo: {
  22109. required: true,
  22110. type: "string"
  22111. }
  22112. },
  22113. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  22114. },
  22115. listCommitComments: {
  22116. method: "GET",
  22117. params: {
  22118. owner: {
  22119. required: true,
  22120. type: "string"
  22121. },
  22122. page: {
  22123. type: "integer"
  22124. },
  22125. per_page: {
  22126. type: "integer"
  22127. },
  22128. repo: {
  22129. required: true,
  22130. type: "string"
  22131. }
  22132. },
  22133. url: "/repos/:owner/:repo/comments"
  22134. },
  22135. listCommits: {
  22136. method: "GET",
  22137. params: {
  22138. author: {
  22139. type: "string"
  22140. },
  22141. owner: {
  22142. required: true,
  22143. type: "string"
  22144. },
  22145. page: {
  22146. type: "integer"
  22147. },
  22148. path: {
  22149. type: "string"
  22150. },
  22151. per_page: {
  22152. type: "integer"
  22153. },
  22154. repo: {
  22155. required: true,
  22156. type: "string"
  22157. },
  22158. sha: {
  22159. type: "string"
  22160. },
  22161. since: {
  22162. type: "string"
  22163. },
  22164. until: {
  22165. type: "string"
  22166. }
  22167. },
  22168. url: "/repos/:owner/:repo/commits"
  22169. },
  22170. listContributors: {
  22171. method: "GET",
  22172. params: {
  22173. anon: {
  22174. type: "string"
  22175. },
  22176. owner: {
  22177. required: true,
  22178. type: "string"
  22179. },
  22180. page: {
  22181. type: "integer"
  22182. },
  22183. per_page: {
  22184. type: "integer"
  22185. },
  22186. repo: {
  22187. required: true,
  22188. type: "string"
  22189. }
  22190. },
  22191. url: "/repos/:owner/:repo/contributors"
  22192. },
  22193. listDeployKeys: {
  22194. method: "GET",
  22195. params: {
  22196. owner: {
  22197. required: true,
  22198. type: "string"
  22199. },
  22200. page: {
  22201. type: "integer"
  22202. },
  22203. per_page: {
  22204. type: "integer"
  22205. },
  22206. repo: {
  22207. required: true,
  22208. type: "string"
  22209. }
  22210. },
  22211. url: "/repos/:owner/:repo/keys"
  22212. },
  22213. listDeploymentStatuses: {
  22214. method: "GET",
  22215. params: {
  22216. deployment_id: {
  22217. required: true,
  22218. type: "integer"
  22219. },
  22220. owner: {
  22221. required: true,
  22222. type: "string"
  22223. },
  22224. page: {
  22225. type: "integer"
  22226. },
  22227. per_page: {
  22228. type: "integer"
  22229. },
  22230. repo: {
  22231. required: true,
  22232. type: "string"
  22233. }
  22234. },
  22235. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22236. },
  22237. listDeployments: {
  22238. method: "GET",
  22239. params: {
  22240. environment: {
  22241. type: "string"
  22242. },
  22243. owner: {
  22244. required: true,
  22245. type: "string"
  22246. },
  22247. page: {
  22248. type: "integer"
  22249. },
  22250. per_page: {
  22251. type: "integer"
  22252. },
  22253. ref: {
  22254. type: "string"
  22255. },
  22256. repo: {
  22257. required: true,
  22258. type: "string"
  22259. },
  22260. sha: {
  22261. type: "string"
  22262. },
  22263. task: {
  22264. type: "string"
  22265. }
  22266. },
  22267. url: "/repos/:owner/:repo/deployments"
  22268. },
  22269. listDownloads: {
  22270. method: "GET",
  22271. params: {
  22272. owner: {
  22273. required: true,
  22274. type: "string"
  22275. },
  22276. page: {
  22277. type: "integer"
  22278. },
  22279. per_page: {
  22280. type: "integer"
  22281. },
  22282. repo: {
  22283. required: true,
  22284. type: "string"
  22285. }
  22286. },
  22287. url: "/repos/:owner/:repo/downloads"
  22288. },
  22289. listForOrg: {
  22290. method: "GET",
  22291. params: {
  22292. direction: {
  22293. enum: ["asc", "desc"],
  22294. type: "string"
  22295. },
  22296. org: {
  22297. required: true,
  22298. type: "string"
  22299. },
  22300. page: {
  22301. type: "integer"
  22302. },
  22303. per_page: {
  22304. type: "integer"
  22305. },
  22306. sort: {
  22307. enum: ["created", "updated", "pushed", "full_name"],
  22308. type: "string"
  22309. },
  22310. type: {
  22311. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22312. type: "string"
  22313. }
  22314. },
  22315. url: "/orgs/:org/repos"
  22316. },
  22317. listForUser: {
  22318. method: "GET",
  22319. params: {
  22320. direction: {
  22321. enum: ["asc", "desc"],
  22322. type: "string"
  22323. },
  22324. page: {
  22325. type: "integer"
  22326. },
  22327. per_page: {
  22328. type: "integer"
  22329. },
  22330. sort: {
  22331. enum: ["created", "updated", "pushed", "full_name"],
  22332. type: "string"
  22333. },
  22334. type: {
  22335. enum: ["all", "owner", "member"],
  22336. type: "string"
  22337. },
  22338. username: {
  22339. required: true,
  22340. type: "string"
  22341. }
  22342. },
  22343. url: "/users/:username/repos"
  22344. },
  22345. listForks: {
  22346. method: "GET",
  22347. params: {
  22348. owner: {
  22349. required: true,
  22350. type: "string"
  22351. },
  22352. page: {
  22353. type: "integer"
  22354. },
  22355. per_page: {
  22356. type: "integer"
  22357. },
  22358. repo: {
  22359. required: true,
  22360. type: "string"
  22361. },
  22362. sort: {
  22363. enum: ["newest", "oldest", "stargazers"],
  22364. type: "string"
  22365. }
  22366. },
  22367. url: "/repos/:owner/:repo/forks"
  22368. },
  22369. listHooks: {
  22370. method: "GET",
  22371. params: {
  22372. owner: {
  22373. required: true,
  22374. type: "string"
  22375. },
  22376. page: {
  22377. type: "integer"
  22378. },
  22379. per_page: {
  22380. type: "integer"
  22381. },
  22382. repo: {
  22383. required: true,
  22384. type: "string"
  22385. }
  22386. },
  22387. url: "/repos/:owner/:repo/hooks"
  22388. },
  22389. listInvitations: {
  22390. method: "GET",
  22391. params: {
  22392. owner: {
  22393. required: true,
  22394. type: "string"
  22395. },
  22396. page: {
  22397. type: "integer"
  22398. },
  22399. per_page: {
  22400. type: "integer"
  22401. },
  22402. repo: {
  22403. required: true,
  22404. type: "string"
  22405. }
  22406. },
  22407. url: "/repos/:owner/:repo/invitations"
  22408. },
  22409. listInvitationsForAuthenticatedUser: {
  22410. method: "GET",
  22411. params: {
  22412. page: {
  22413. type: "integer"
  22414. },
  22415. per_page: {
  22416. type: "integer"
  22417. }
  22418. },
  22419. url: "/user/repository_invitations"
  22420. },
  22421. listLanguages: {
  22422. method: "GET",
  22423. params: {
  22424. owner: {
  22425. required: true,
  22426. type: "string"
  22427. },
  22428. repo: {
  22429. required: true,
  22430. type: "string"
  22431. }
  22432. },
  22433. url: "/repos/:owner/:repo/languages"
  22434. },
  22435. listPagesBuilds: {
  22436. method: "GET",
  22437. params: {
  22438. owner: {
  22439. required: true,
  22440. type: "string"
  22441. },
  22442. page: {
  22443. type: "integer"
  22444. },
  22445. per_page: {
  22446. type: "integer"
  22447. },
  22448. repo: {
  22449. required: true,
  22450. type: "string"
  22451. }
  22452. },
  22453. url: "/repos/:owner/:repo/pages/builds"
  22454. },
  22455. listProtectedBranchRequiredStatusChecksContexts: {
  22456. method: "GET",
  22457. params: {
  22458. branch: {
  22459. required: true,
  22460. type: "string"
  22461. },
  22462. owner: {
  22463. required: true,
  22464. type: "string"
  22465. },
  22466. repo: {
  22467. required: true,
  22468. type: "string"
  22469. }
  22470. },
  22471. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22472. },
  22473. listProtectedBranchTeamRestrictions: {
  22474. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22475. method: "GET",
  22476. params: {
  22477. branch: {
  22478. required: true,
  22479. type: "string"
  22480. },
  22481. owner: {
  22482. required: true,
  22483. type: "string"
  22484. },
  22485. repo: {
  22486. required: true,
  22487. type: "string"
  22488. }
  22489. },
  22490. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22491. },
  22492. listProtectedBranchUserRestrictions: {
  22493. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22494. method: "GET",
  22495. params: {
  22496. branch: {
  22497. required: true,
  22498. type: "string"
  22499. },
  22500. owner: {
  22501. required: true,
  22502. type: "string"
  22503. },
  22504. repo: {
  22505. required: true,
  22506. type: "string"
  22507. }
  22508. },
  22509. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22510. },
  22511. listPublic: {
  22512. method: "GET",
  22513. params: {
  22514. page: {
  22515. type: "integer"
  22516. },
  22517. per_page: {
  22518. type: "integer"
  22519. },
  22520. since: {
  22521. type: "integer"
  22522. }
  22523. },
  22524. url: "/repositories"
  22525. },
  22526. listPullRequestsAssociatedWithCommit: {
  22527. headers: {
  22528. accept: "application/vnd.github.groot-preview+json"
  22529. },
  22530. method: "GET",
  22531. params: {
  22532. commit_sha: {
  22533. required: true,
  22534. type: "string"
  22535. },
  22536. owner: {
  22537. required: true,
  22538. type: "string"
  22539. },
  22540. page: {
  22541. type: "integer"
  22542. },
  22543. per_page: {
  22544. type: "integer"
  22545. },
  22546. repo: {
  22547. required: true,
  22548. type: "string"
  22549. }
  22550. },
  22551. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22552. },
  22553. listReleases: {
  22554. method: "GET",
  22555. params: {
  22556. owner: {
  22557. required: true,
  22558. type: "string"
  22559. },
  22560. page: {
  22561. type: "integer"
  22562. },
  22563. per_page: {
  22564. type: "integer"
  22565. },
  22566. repo: {
  22567. required: true,
  22568. type: "string"
  22569. }
  22570. },
  22571. url: "/repos/:owner/:repo/releases"
  22572. },
  22573. listStatusesForRef: {
  22574. method: "GET",
  22575. params: {
  22576. owner: {
  22577. required: true,
  22578. type: "string"
  22579. },
  22580. page: {
  22581. type: "integer"
  22582. },
  22583. per_page: {
  22584. type: "integer"
  22585. },
  22586. ref: {
  22587. required: true,
  22588. type: "string"
  22589. },
  22590. repo: {
  22591. required: true,
  22592. type: "string"
  22593. }
  22594. },
  22595. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22596. },
  22597. listTags: {
  22598. method: "GET",
  22599. params: {
  22600. owner: {
  22601. required: true,
  22602. type: "string"
  22603. },
  22604. page: {
  22605. type: "integer"
  22606. },
  22607. per_page: {
  22608. type: "integer"
  22609. },
  22610. repo: {
  22611. required: true,
  22612. type: "string"
  22613. }
  22614. },
  22615. url: "/repos/:owner/:repo/tags"
  22616. },
  22617. listTeams: {
  22618. method: "GET",
  22619. params: {
  22620. owner: {
  22621. required: true,
  22622. type: "string"
  22623. },
  22624. page: {
  22625. type: "integer"
  22626. },
  22627. per_page: {
  22628. type: "integer"
  22629. },
  22630. repo: {
  22631. required: true,
  22632. type: "string"
  22633. }
  22634. },
  22635. url: "/repos/:owner/:repo/teams"
  22636. },
  22637. listTeamsWithAccessToProtectedBranch: {
  22638. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22639. method: "GET",
  22640. params: {
  22641. branch: {
  22642. required: true,
  22643. type: "string"
  22644. },
  22645. owner: {
  22646. required: true,
  22647. type: "string"
  22648. },
  22649. repo: {
  22650. required: true,
  22651. type: "string"
  22652. }
  22653. },
  22654. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22655. },
  22656. listTopics: {
  22657. headers: {
  22658. accept: "application/vnd.github.mercy-preview+json"
  22659. },
  22660. method: "GET",
  22661. params: {
  22662. owner: {
  22663. required: true,
  22664. type: "string"
  22665. },
  22666. repo: {
  22667. required: true,
  22668. type: "string"
  22669. }
  22670. },
  22671. url: "/repos/:owner/:repo/topics"
  22672. },
  22673. listUsersWithAccessToProtectedBranch: {
  22674. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22675. method: "GET",
  22676. params: {
  22677. branch: {
  22678. required: true,
  22679. type: "string"
  22680. },
  22681. owner: {
  22682. required: true,
  22683. type: "string"
  22684. },
  22685. repo: {
  22686. required: true,
  22687. type: "string"
  22688. }
  22689. },
  22690. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22691. },
  22692. merge: {
  22693. method: "POST",
  22694. params: {
  22695. base: {
  22696. required: true,
  22697. type: "string"
  22698. },
  22699. commit_message: {
  22700. type: "string"
  22701. },
  22702. head: {
  22703. required: true,
  22704. type: "string"
  22705. },
  22706. owner: {
  22707. required: true,
  22708. type: "string"
  22709. },
  22710. repo: {
  22711. required: true,
  22712. type: "string"
  22713. }
  22714. },
  22715. url: "/repos/:owner/:repo/merges"
  22716. },
  22717. pingHook: {
  22718. method: "POST",
  22719. params: {
  22720. hook_id: {
  22721. required: true,
  22722. type: "integer"
  22723. },
  22724. owner: {
  22725. required: true,
  22726. type: "string"
  22727. },
  22728. repo: {
  22729. required: true,
  22730. type: "string"
  22731. }
  22732. },
  22733. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22734. },
  22735. removeBranchProtection: {
  22736. method: "DELETE",
  22737. params: {
  22738. branch: {
  22739. required: true,
  22740. type: "string"
  22741. },
  22742. owner: {
  22743. required: true,
  22744. type: "string"
  22745. },
  22746. repo: {
  22747. required: true,
  22748. type: "string"
  22749. }
  22750. },
  22751. url: "/repos/:owner/:repo/branches/:branch/protection"
  22752. },
  22753. removeCollaborator: {
  22754. method: "DELETE",
  22755. params: {
  22756. owner: {
  22757. required: true,
  22758. type: "string"
  22759. },
  22760. repo: {
  22761. required: true,
  22762. type: "string"
  22763. },
  22764. username: {
  22765. required: true,
  22766. type: "string"
  22767. }
  22768. },
  22769. url: "/repos/:owner/:repo/collaborators/:username"
  22770. },
  22771. removeDeployKey: {
  22772. method: "DELETE",
  22773. params: {
  22774. key_id: {
  22775. required: true,
  22776. type: "integer"
  22777. },
  22778. owner: {
  22779. required: true,
  22780. type: "string"
  22781. },
  22782. repo: {
  22783. required: true,
  22784. type: "string"
  22785. }
  22786. },
  22787. url: "/repos/:owner/:repo/keys/:key_id"
  22788. },
  22789. removeProtectedBranchAdminEnforcement: {
  22790. method: "DELETE",
  22791. params: {
  22792. branch: {
  22793. required: true,
  22794. type: "string"
  22795. },
  22796. owner: {
  22797. required: true,
  22798. type: "string"
  22799. },
  22800. repo: {
  22801. required: true,
  22802. type: "string"
  22803. }
  22804. },
  22805. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22806. },
  22807. removeProtectedBranchAppRestrictions: {
  22808. method: "DELETE",
  22809. params: {
  22810. apps: {
  22811. mapTo: "data",
  22812. required: true,
  22813. type: "string[]"
  22814. },
  22815. branch: {
  22816. required: true,
  22817. type: "string"
  22818. },
  22819. owner: {
  22820. required: true,
  22821. type: "string"
  22822. },
  22823. repo: {
  22824. required: true,
  22825. type: "string"
  22826. }
  22827. },
  22828. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22829. },
  22830. removeProtectedBranchPullRequestReviewEnforcement: {
  22831. method: "DELETE",
  22832. params: {
  22833. branch: {
  22834. required: true,
  22835. type: "string"
  22836. },
  22837. owner: {
  22838. required: true,
  22839. type: "string"
  22840. },
  22841. repo: {
  22842. required: true,
  22843. type: "string"
  22844. }
  22845. },
  22846. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22847. },
  22848. removeProtectedBranchRequiredSignatures: {
  22849. headers: {
  22850. accept: "application/vnd.github.zzzax-preview+json"
  22851. },
  22852. method: "DELETE",
  22853. params: {
  22854. branch: {
  22855. required: true,
  22856. type: "string"
  22857. },
  22858. owner: {
  22859. required: true,
  22860. type: "string"
  22861. },
  22862. repo: {
  22863. required: true,
  22864. type: "string"
  22865. }
  22866. },
  22867. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22868. },
  22869. removeProtectedBranchRequiredStatusChecks: {
  22870. method: "DELETE",
  22871. params: {
  22872. branch: {
  22873. required: true,
  22874. type: "string"
  22875. },
  22876. owner: {
  22877. required: true,
  22878. type: "string"
  22879. },
  22880. repo: {
  22881. required: true,
  22882. type: "string"
  22883. }
  22884. },
  22885. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22886. },
  22887. removeProtectedBranchRequiredStatusChecksContexts: {
  22888. method: "DELETE",
  22889. params: {
  22890. branch: {
  22891. required: true,
  22892. type: "string"
  22893. },
  22894. contexts: {
  22895. mapTo: "data",
  22896. required: true,
  22897. type: "string[]"
  22898. },
  22899. owner: {
  22900. required: true,
  22901. type: "string"
  22902. },
  22903. repo: {
  22904. required: true,
  22905. type: "string"
  22906. }
  22907. },
  22908. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22909. },
  22910. removeProtectedBranchRestrictions: {
  22911. method: "DELETE",
  22912. params: {
  22913. branch: {
  22914. required: true,
  22915. type: "string"
  22916. },
  22917. owner: {
  22918. required: true,
  22919. type: "string"
  22920. },
  22921. repo: {
  22922. required: true,
  22923. type: "string"
  22924. }
  22925. },
  22926. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22927. },
  22928. removeProtectedBranchTeamRestrictions: {
  22929. method: "DELETE",
  22930. params: {
  22931. branch: {
  22932. required: true,
  22933. type: "string"
  22934. },
  22935. owner: {
  22936. required: true,
  22937. type: "string"
  22938. },
  22939. repo: {
  22940. required: true,
  22941. type: "string"
  22942. },
  22943. teams: {
  22944. mapTo: "data",
  22945. required: true,
  22946. type: "string[]"
  22947. }
  22948. },
  22949. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22950. },
  22951. removeProtectedBranchUserRestrictions: {
  22952. method: "DELETE",
  22953. params: {
  22954. branch: {
  22955. required: true,
  22956. type: "string"
  22957. },
  22958. owner: {
  22959. required: true,
  22960. type: "string"
  22961. },
  22962. repo: {
  22963. required: true,
  22964. type: "string"
  22965. },
  22966. users: {
  22967. mapTo: "data",
  22968. required: true,
  22969. type: "string[]"
  22970. }
  22971. },
  22972. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22973. },
  22974. replaceProtectedBranchAppRestrictions: {
  22975. method: "PUT",
  22976. params: {
  22977. apps: {
  22978. mapTo: "data",
  22979. required: true,
  22980. type: "string[]"
  22981. },
  22982. branch: {
  22983. required: true,
  22984. type: "string"
  22985. },
  22986. owner: {
  22987. required: true,
  22988. type: "string"
  22989. },
  22990. repo: {
  22991. required: true,
  22992. type: "string"
  22993. }
  22994. },
  22995. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22996. },
  22997. replaceProtectedBranchRequiredStatusChecksContexts: {
  22998. method: "PUT",
  22999. params: {
  23000. branch: {
  23001. required: true,
  23002. type: "string"
  23003. },
  23004. contexts: {
  23005. mapTo: "data",
  23006. required: true,
  23007. type: "string[]"
  23008. },
  23009. owner: {
  23010. required: true,
  23011. type: "string"
  23012. },
  23013. repo: {
  23014. required: true,
  23015. type: "string"
  23016. }
  23017. },
  23018. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  23019. },
  23020. replaceProtectedBranchTeamRestrictions: {
  23021. method: "PUT",
  23022. params: {
  23023. branch: {
  23024. required: true,
  23025. type: "string"
  23026. },
  23027. owner: {
  23028. required: true,
  23029. type: "string"
  23030. },
  23031. repo: {
  23032. required: true,
  23033. type: "string"
  23034. },
  23035. teams: {
  23036. mapTo: "data",
  23037. required: true,
  23038. type: "string[]"
  23039. }
  23040. },
  23041. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  23042. },
  23043. replaceProtectedBranchUserRestrictions: {
  23044. method: "PUT",
  23045. params: {
  23046. branch: {
  23047. required: true,
  23048. type: "string"
  23049. },
  23050. owner: {
  23051. required: true,
  23052. type: "string"
  23053. },
  23054. repo: {
  23055. required: true,
  23056. type: "string"
  23057. },
  23058. users: {
  23059. mapTo: "data",
  23060. required: true,
  23061. type: "string[]"
  23062. }
  23063. },
  23064. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  23065. },
  23066. replaceTopics: {
  23067. headers: {
  23068. accept: "application/vnd.github.mercy-preview+json"
  23069. },
  23070. method: "PUT",
  23071. params: {
  23072. names: {
  23073. required: true,
  23074. type: "string[]"
  23075. },
  23076. owner: {
  23077. required: true,
  23078. type: "string"
  23079. },
  23080. repo: {
  23081. required: true,
  23082. type: "string"
  23083. }
  23084. },
  23085. url: "/repos/:owner/:repo/topics"
  23086. },
  23087. requestPageBuild: {
  23088. method: "POST",
  23089. params: {
  23090. owner: {
  23091. required: true,
  23092. type: "string"
  23093. },
  23094. repo: {
  23095. required: true,
  23096. type: "string"
  23097. }
  23098. },
  23099. url: "/repos/:owner/:repo/pages/builds"
  23100. },
  23101. retrieveCommunityProfileMetrics: {
  23102. method: "GET",
  23103. params: {
  23104. owner: {
  23105. required: true,
  23106. type: "string"
  23107. },
  23108. repo: {
  23109. required: true,
  23110. type: "string"
  23111. }
  23112. },
  23113. url: "/repos/:owner/:repo/community/profile"
  23114. },
  23115. testPushHook: {
  23116. method: "POST",
  23117. params: {
  23118. hook_id: {
  23119. required: true,
  23120. type: "integer"
  23121. },
  23122. owner: {
  23123. required: true,
  23124. type: "string"
  23125. },
  23126. repo: {
  23127. required: true,
  23128. type: "string"
  23129. }
  23130. },
  23131. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  23132. },
  23133. transfer: {
  23134. method: "POST",
  23135. params: {
  23136. new_owner: {
  23137. type: "string"
  23138. },
  23139. owner: {
  23140. required: true,
  23141. type: "string"
  23142. },
  23143. repo: {
  23144. required: true,
  23145. type: "string"
  23146. },
  23147. team_ids: {
  23148. type: "integer[]"
  23149. }
  23150. },
  23151. url: "/repos/:owner/:repo/transfer"
  23152. },
  23153. update: {
  23154. method: "PATCH",
  23155. params: {
  23156. allow_merge_commit: {
  23157. type: "boolean"
  23158. },
  23159. allow_rebase_merge: {
  23160. type: "boolean"
  23161. },
  23162. allow_squash_merge: {
  23163. type: "boolean"
  23164. },
  23165. archived: {
  23166. type: "boolean"
  23167. },
  23168. default_branch: {
  23169. type: "string"
  23170. },
  23171. delete_branch_on_merge: {
  23172. type: "boolean"
  23173. },
  23174. description: {
  23175. type: "string"
  23176. },
  23177. has_issues: {
  23178. type: "boolean"
  23179. },
  23180. has_projects: {
  23181. type: "boolean"
  23182. },
  23183. has_wiki: {
  23184. type: "boolean"
  23185. },
  23186. homepage: {
  23187. type: "string"
  23188. },
  23189. is_template: {
  23190. type: "boolean"
  23191. },
  23192. name: {
  23193. type: "string"
  23194. },
  23195. owner: {
  23196. required: true,
  23197. type: "string"
  23198. },
  23199. private: {
  23200. type: "boolean"
  23201. },
  23202. repo: {
  23203. required: true,
  23204. type: "string"
  23205. },
  23206. visibility: {
  23207. enum: ["public", "private", "visibility", "internal"],
  23208. type: "string"
  23209. }
  23210. },
  23211. url: "/repos/:owner/:repo"
  23212. },
  23213. updateBranchProtection: {
  23214. method: "PUT",
  23215. params: {
  23216. allow_deletions: {
  23217. type: "boolean"
  23218. },
  23219. allow_force_pushes: {
  23220. allowNull: true,
  23221. type: "boolean"
  23222. },
  23223. branch: {
  23224. required: true,
  23225. type: "string"
  23226. },
  23227. enforce_admins: {
  23228. allowNull: true,
  23229. required: true,
  23230. type: "boolean"
  23231. },
  23232. owner: {
  23233. required: true,
  23234. type: "string"
  23235. },
  23236. repo: {
  23237. required: true,
  23238. type: "string"
  23239. },
  23240. required_linear_history: {
  23241. type: "boolean"
  23242. },
  23243. required_pull_request_reviews: {
  23244. allowNull: true,
  23245. required: true,
  23246. type: "object"
  23247. },
  23248. "required_pull_request_reviews.dismiss_stale_reviews": {
  23249. type: "boolean"
  23250. },
  23251. "required_pull_request_reviews.dismissal_restrictions": {
  23252. type: "object"
  23253. },
  23254. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23255. type: "string[]"
  23256. },
  23257. "required_pull_request_reviews.dismissal_restrictions.users": {
  23258. type: "string[]"
  23259. },
  23260. "required_pull_request_reviews.require_code_owner_reviews": {
  23261. type: "boolean"
  23262. },
  23263. "required_pull_request_reviews.required_approving_review_count": {
  23264. type: "integer"
  23265. },
  23266. required_status_checks: {
  23267. allowNull: true,
  23268. required: true,
  23269. type: "object"
  23270. },
  23271. "required_status_checks.contexts": {
  23272. required: true,
  23273. type: "string[]"
  23274. },
  23275. "required_status_checks.strict": {
  23276. required: true,
  23277. type: "boolean"
  23278. },
  23279. restrictions: {
  23280. allowNull: true,
  23281. required: true,
  23282. type: "object"
  23283. },
  23284. "restrictions.apps": {
  23285. type: "string[]"
  23286. },
  23287. "restrictions.teams": {
  23288. required: true,
  23289. type: "string[]"
  23290. },
  23291. "restrictions.users": {
  23292. required: true,
  23293. type: "string[]"
  23294. }
  23295. },
  23296. url: "/repos/:owner/:repo/branches/:branch/protection"
  23297. },
  23298. updateCommitComment: {
  23299. method: "PATCH",
  23300. params: {
  23301. body: {
  23302. required: true,
  23303. type: "string"
  23304. },
  23305. comment_id: {
  23306. required: true,
  23307. type: "integer"
  23308. },
  23309. owner: {
  23310. required: true,
  23311. type: "string"
  23312. },
  23313. repo: {
  23314. required: true,
  23315. type: "string"
  23316. }
  23317. },
  23318. url: "/repos/:owner/:repo/comments/:comment_id"
  23319. },
  23320. updateFile: {
  23321. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23322. method: "PUT",
  23323. params: {
  23324. author: {
  23325. type: "object"
  23326. },
  23327. "author.email": {
  23328. required: true,
  23329. type: "string"
  23330. },
  23331. "author.name": {
  23332. required: true,
  23333. type: "string"
  23334. },
  23335. branch: {
  23336. type: "string"
  23337. },
  23338. committer: {
  23339. type: "object"
  23340. },
  23341. "committer.email": {
  23342. required: true,
  23343. type: "string"
  23344. },
  23345. "committer.name": {
  23346. required: true,
  23347. type: "string"
  23348. },
  23349. content: {
  23350. required: true,
  23351. type: "string"
  23352. },
  23353. message: {
  23354. required: true,
  23355. type: "string"
  23356. },
  23357. owner: {
  23358. required: true,
  23359. type: "string"
  23360. },
  23361. path: {
  23362. required: true,
  23363. type: "string"
  23364. },
  23365. repo: {
  23366. required: true,
  23367. type: "string"
  23368. },
  23369. sha: {
  23370. type: "string"
  23371. }
  23372. },
  23373. url: "/repos/:owner/:repo/contents/:path"
  23374. },
  23375. updateHook: {
  23376. method: "PATCH",
  23377. params: {
  23378. active: {
  23379. type: "boolean"
  23380. },
  23381. add_events: {
  23382. type: "string[]"
  23383. },
  23384. config: {
  23385. type: "object"
  23386. },
  23387. "config.content_type": {
  23388. type: "string"
  23389. },
  23390. "config.insecure_ssl": {
  23391. type: "string"
  23392. },
  23393. "config.secret": {
  23394. type: "string"
  23395. },
  23396. "config.url": {
  23397. required: true,
  23398. type: "string"
  23399. },
  23400. events: {
  23401. type: "string[]"
  23402. },
  23403. hook_id: {
  23404. required: true,
  23405. type: "integer"
  23406. },
  23407. owner: {
  23408. required: true,
  23409. type: "string"
  23410. },
  23411. remove_events: {
  23412. type: "string[]"
  23413. },
  23414. repo: {
  23415. required: true,
  23416. type: "string"
  23417. }
  23418. },
  23419. url: "/repos/:owner/:repo/hooks/:hook_id"
  23420. },
  23421. updateInformationAboutPagesSite: {
  23422. method: "PUT",
  23423. params: {
  23424. cname: {
  23425. type: "string"
  23426. },
  23427. owner: {
  23428. required: true,
  23429. type: "string"
  23430. },
  23431. repo: {
  23432. required: true,
  23433. type: "string"
  23434. },
  23435. source: {
  23436. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23437. type: "string"
  23438. }
  23439. },
  23440. url: "/repos/:owner/:repo/pages"
  23441. },
  23442. updateInvitation: {
  23443. method: "PATCH",
  23444. params: {
  23445. invitation_id: {
  23446. required: true,
  23447. type: "integer"
  23448. },
  23449. owner: {
  23450. required: true,
  23451. type: "string"
  23452. },
  23453. permissions: {
  23454. enum: ["read", "write", "admin"],
  23455. type: "string"
  23456. },
  23457. repo: {
  23458. required: true,
  23459. type: "string"
  23460. }
  23461. },
  23462. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23463. },
  23464. updateProtectedBranchPullRequestReviewEnforcement: {
  23465. method: "PATCH",
  23466. params: {
  23467. branch: {
  23468. required: true,
  23469. type: "string"
  23470. },
  23471. dismiss_stale_reviews: {
  23472. type: "boolean"
  23473. },
  23474. dismissal_restrictions: {
  23475. type: "object"
  23476. },
  23477. "dismissal_restrictions.teams": {
  23478. type: "string[]"
  23479. },
  23480. "dismissal_restrictions.users": {
  23481. type: "string[]"
  23482. },
  23483. owner: {
  23484. required: true,
  23485. type: "string"
  23486. },
  23487. repo: {
  23488. required: true,
  23489. type: "string"
  23490. },
  23491. require_code_owner_reviews: {
  23492. type: "boolean"
  23493. },
  23494. required_approving_review_count: {
  23495. type: "integer"
  23496. }
  23497. },
  23498. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23499. },
  23500. updateProtectedBranchRequiredStatusChecks: {
  23501. method: "PATCH",
  23502. params: {
  23503. branch: {
  23504. required: true,
  23505. type: "string"
  23506. },
  23507. contexts: {
  23508. type: "string[]"
  23509. },
  23510. owner: {
  23511. required: true,
  23512. type: "string"
  23513. },
  23514. repo: {
  23515. required: true,
  23516. type: "string"
  23517. },
  23518. strict: {
  23519. type: "boolean"
  23520. }
  23521. },
  23522. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23523. },
  23524. updateRelease: {
  23525. method: "PATCH",
  23526. params: {
  23527. body: {
  23528. type: "string"
  23529. },
  23530. draft: {
  23531. type: "boolean"
  23532. },
  23533. name: {
  23534. type: "string"
  23535. },
  23536. owner: {
  23537. required: true,
  23538. type: "string"
  23539. },
  23540. prerelease: {
  23541. type: "boolean"
  23542. },
  23543. release_id: {
  23544. required: true,
  23545. type: "integer"
  23546. },
  23547. repo: {
  23548. required: true,
  23549. type: "string"
  23550. },
  23551. tag_name: {
  23552. type: "string"
  23553. },
  23554. target_commitish: {
  23555. type: "string"
  23556. }
  23557. },
  23558. url: "/repos/:owner/:repo/releases/:release_id"
  23559. },
  23560. updateReleaseAsset: {
  23561. method: "PATCH",
  23562. params: {
  23563. asset_id: {
  23564. required: true,
  23565. type: "integer"
  23566. },
  23567. label: {
  23568. type: "string"
  23569. },
  23570. name: {
  23571. type: "string"
  23572. },
  23573. owner: {
  23574. required: true,
  23575. type: "string"
  23576. },
  23577. repo: {
  23578. required: true,
  23579. type: "string"
  23580. }
  23581. },
  23582. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23583. },
  23584. uploadReleaseAsset: {
  23585. method: "POST",
  23586. params: {
  23587. data: {
  23588. mapTo: "data",
  23589. required: true,
  23590. type: "string | object"
  23591. },
  23592. file: {
  23593. alias: "data",
  23594. deprecated: true,
  23595. type: "string | object"
  23596. },
  23597. headers: {
  23598. required: true,
  23599. type: "object"
  23600. },
  23601. "headers.content-length": {
  23602. required: true,
  23603. type: "integer"
  23604. },
  23605. "headers.content-type": {
  23606. required: true,
  23607. type: "string"
  23608. },
  23609. label: {
  23610. type: "string"
  23611. },
  23612. name: {
  23613. required: true,
  23614. type: "string"
  23615. },
  23616. url: {
  23617. required: true,
  23618. type: "string"
  23619. }
  23620. },
  23621. url: ":url"
  23622. }
  23623. },
  23624. search: {
  23625. code: {
  23626. method: "GET",
  23627. params: {
  23628. order: {
  23629. enum: ["desc", "asc"],
  23630. type: "string"
  23631. },
  23632. page: {
  23633. type: "integer"
  23634. },
  23635. per_page: {
  23636. type: "integer"
  23637. },
  23638. q: {
  23639. required: true,
  23640. type: "string"
  23641. },
  23642. sort: {
  23643. enum: ["indexed"],
  23644. type: "string"
  23645. }
  23646. },
  23647. url: "/search/code"
  23648. },
  23649. commits: {
  23650. headers: {
  23651. accept: "application/vnd.github.cloak-preview+json"
  23652. },
  23653. method: "GET",
  23654. params: {
  23655. order: {
  23656. enum: ["desc", "asc"],
  23657. type: "string"
  23658. },
  23659. page: {
  23660. type: "integer"
  23661. },
  23662. per_page: {
  23663. type: "integer"
  23664. },
  23665. q: {
  23666. required: true,
  23667. type: "string"
  23668. },
  23669. sort: {
  23670. enum: ["author-date", "committer-date"],
  23671. type: "string"
  23672. }
  23673. },
  23674. url: "/search/commits"
  23675. },
  23676. issues: {
  23677. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23678. method: "GET",
  23679. params: {
  23680. order: {
  23681. enum: ["desc", "asc"],
  23682. type: "string"
  23683. },
  23684. page: {
  23685. type: "integer"
  23686. },
  23687. per_page: {
  23688. type: "integer"
  23689. },
  23690. q: {
  23691. required: true,
  23692. type: "string"
  23693. },
  23694. sort: {
  23695. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23696. type: "string"
  23697. }
  23698. },
  23699. url: "/search/issues"
  23700. },
  23701. issuesAndPullRequests: {
  23702. method: "GET",
  23703. params: {
  23704. order: {
  23705. enum: ["desc", "asc"],
  23706. type: "string"
  23707. },
  23708. page: {
  23709. type: "integer"
  23710. },
  23711. per_page: {
  23712. type: "integer"
  23713. },
  23714. q: {
  23715. required: true,
  23716. type: "string"
  23717. },
  23718. sort: {
  23719. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23720. type: "string"
  23721. }
  23722. },
  23723. url: "/search/issues"
  23724. },
  23725. labels: {
  23726. method: "GET",
  23727. params: {
  23728. order: {
  23729. enum: ["desc", "asc"],
  23730. type: "string"
  23731. },
  23732. q: {
  23733. required: true,
  23734. type: "string"
  23735. },
  23736. repository_id: {
  23737. required: true,
  23738. type: "integer"
  23739. },
  23740. sort: {
  23741. enum: ["created", "updated"],
  23742. type: "string"
  23743. }
  23744. },
  23745. url: "/search/labels"
  23746. },
  23747. repos: {
  23748. method: "GET",
  23749. params: {
  23750. order: {
  23751. enum: ["desc", "asc"],
  23752. type: "string"
  23753. },
  23754. page: {
  23755. type: "integer"
  23756. },
  23757. per_page: {
  23758. type: "integer"
  23759. },
  23760. q: {
  23761. required: true,
  23762. type: "string"
  23763. },
  23764. sort: {
  23765. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23766. type: "string"
  23767. }
  23768. },
  23769. url: "/search/repositories"
  23770. },
  23771. topics: {
  23772. method: "GET",
  23773. params: {
  23774. q: {
  23775. required: true,
  23776. type: "string"
  23777. }
  23778. },
  23779. url: "/search/topics"
  23780. },
  23781. users: {
  23782. method: "GET",
  23783. params: {
  23784. order: {
  23785. enum: ["desc", "asc"],
  23786. type: "string"
  23787. },
  23788. page: {
  23789. type: "integer"
  23790. },
  23791. per_page: {
  23792. type: "integer"
  23793. },
  23794. q: {
  23795. required: true,
  23796. type: "string"
  23797. },
  23798. sort: {
  23799. enum: ["followers", "repositories", "joined"],
  23800. type: "string"
  23801. }
  23802. },
  23803. url: "/search/users"
  23804. }
  23805. },
  23806. teams: {
  23807. addMember: {
  23808. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23809. method: "PUT",
  23810. params: {
  23811. team_id: {
  23812. required: true,
  23813. type: "integer"
  23814. },
  23815. username: {
  23816. required: true,
  23817. type: "string"
  23818. }
  23819. },
  23820. url: "/teams/:team_id/members/:username"
  23821. },
  23822. addMemberLegacy: {
  23823. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23824. method: "PUT",
  23825. params: {
  23826. team_id: {
  23827. required: true,
  23828. type: "integer"
  23829. },
  23830. username: {
  23831. required: true,
  23832. type: "string"
  23833. }
  23834. },
  23835. url: "/teams/:team_id/members/:username"
  23836. },
  23837. addOrUpdateMembership: {
  23838. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23839. method: "PUT",
  23840. params: {
  23841. role: {
  23842. enum: ["member", "maintainer"],
  23843. type: "string"
  23844. },
  23845. team_id: {
  23846. required: true,
  23847. type: "integer"
  23848. },
  23849. username: {
  23850. required: true,
  23851. type: "string"
  23852. }
  23853. },
  23854. url: "/teams/:team_id/memberships/:username"
  23855. },
  23856. addOrUpdateMembershipInOrg: {
  23857. method: "PUT",
  23858. params: {
  23859. org: {
  23860. required: true,
  23861. type: "string"
  23862. },
  23863. role: {
  23864. enum: ["member", "maintainer"],
  23865. type: "string"
  23866. },
  23867. team_slug: {
  23868. required: true,
  23869. type: "string"
  23870. },
  23871. username: {
  23872. required: true,
  23873. type: "string"
  23874. }
  23875. },
  23876. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23877. },
  23878. addOrUpdateMembershipLegacy: {
  23879. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23880. method: "PUT",
  23881. params: {
  23882. role: {
  23883. enum: ["member", "maintainer"],
  23884. type: "string"
  23885. },
  23886. team_id: {
  23887. required: true,
  23888. type: "integer"
  23889. },
  23890. username: {
  23891. required: true,
  23892. type: "string"
  23893. }
  23894. },
  23895. url: "/teams/:team_id/memberships/:username"
  23896. },
  23897. addOrUpdateProject: {
  23898. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23899. headers: {
  23900. accept: "application/vnd.github.inertia-preview+json"
  23901. },
  23902. method: "PUT",
  23903. params: {
  23904. permission: {
  23905. enum: ["read", "write", "admin"],
  23906. type: "string"
  23907. },
  23908. project_id: {
  23909. required: true,
  23910. type: "integer"
  23911. },
  23912. team_id: {
  23913. required: true,
  23914. type: "integer"
  23915. }
  23916. },
  23917. url: "/teams/:team_id/projects/:project_id"
  23918. },
  23919. addOrUpdateProjectInOrg: {
  23920. headers: {
  23921. accept: "application/vnd.github.inertia-preview+json"
  23922. },
  23923. method: "PUT",
  23924. params: {
  23925. org: {
  23926. required: true,
  23927. type: "string"
  23928. },
  23929. permission: {
  23930. enum: ["read", "write", "admin"],
  23931. type: "string"
  23932. },
  23933. project_id: {
  23934. required: true,
  23935. type: "integer"
  23936. },
  23937. team_slug: {
  23938. required: true,
  23939. type: "string"
  23940. }
  23941. },
  23942. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23943. },
  23944. addOrUpdateProjectLegacy: {
  23945. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23946. headers: {
  23947. accept: "application/vnd.github.inertia-preview+json"
  23948. },
  23949. method: "PUT",
  23950. params: {
  23951. permission: {
  23952. enum: ["read", "write", "admin"],
  23953. type: "string"
  23954. },
  23955. project_id: {
  23956. required: true,
  23957. type: "integer"
  23958. },
  23959. team_id: {
  23960. required: true,
  23961. type: "integer"
  23962. }
  23963. },
  23964. url: "/teams/:team_id/projects/:project_id"
  23965. },
  23966. addOrUpdateRepo: {
  23967. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23968. method: "PUT",
  23969. params: {
  23970. owner: {
  23971. required: true,
  23972. type: "string"
  23973. },
  23974. permission: {
  23975. enum: ["pull", "push", "admin"],
  23976. type: "string"
  23977. },
  23978. repo: {
  23979. required: true,
  23980. type: "string"
  23981. },
  23982. team_id: {
  23983. required: true,
  23984. type: "integer"
  23985. }
  23986. },
  23987. url: "/teams/:team_id/repos/:owner/:repo"
  23988. },
  23989. addOrUpdateRepoInOrg: {
  23990. method: "PUT",
  23991. params: {
  23992. org: {
  23993. required: true,
  23994. type: "string"
  23995. },
  23996. owner: {
  23997. required: true,
  23998. type: "string"
  23999. },
  24000. permission: {
  24001. enum: ["pull", "push", "admin"],
  24002. type: "string"
  24003. },
  24004. repo: {
  24005. required: true,
  24006. type: "string"
  24007. },
  24008. team_slug: {
  24009. required: true,
  24010. type: "string"
  24011. }
  24012. },
  24013. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24014. },
  24015. addOrUpdateRepoLegacy: {
  24016. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  24017. method: "PUT",
  24018. params: {
  24019. owner: {
  24020. required: true,
  24021. type: "string"
  24022. },
  24023. permission: {
  24024. enum: ["pull", "push", "admin"],
  24025. type: "string"
  24026. },
  24027. repo: {
  24028. required: true,
  24029. type: "string"
  24030. },
  24031. team_id: {
  24032. required: true,
  24033. type: "integer"
  24034. }
  24035. },
  24036. url: "/teams/:team_id/repos/:owner/:repo"
  24037. },
  24038. checkManagesRepo: {
  24039. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  24040. method: "GET",
  24041. params: {
  24042. owner: {
  24043. required: true,
  24044. type: "string"
  24045. },
  24046. repo: {
  24047. required: true,
  24048. type: "string"
  24049. },
  24050. team_id: {
  24051. required: true,
  24052. type: "integer"
  24053. }
  24054. },
  24055. url: "/teams/:team_id/repos/:owner/:repo"
  24056. },
  24057. checkManagesRepoInOrg: {
  24058. method: "GET",
  24059. params: {
  24060. org: {
  24061. required: true,
  24062. type: "string"
  24063. },
  24064. owner: {
  24065. required: true,
  24066. type: "string"
  24067. },
  24068. repo: {
  24069. required: true,
  24070. type: "string"
  24071. },
  24072. team_slug: {
  24073. required: true,
  24074. type: "string"
  24075. }
  24076. },
  24077. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24078. },
  24079. checkManagesRepoLegacy: {
  24080. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  24081. method: "GET",
  24082. params: {
  24083. owner: {
  24084. required: true,
  24085. type: "string"
  24086. },
  24087. repo: {
  24088. required: true,
  24089. type: "string"
  24090. },
  24091. team_id: {
  24092. required: true,
  24093. type: "integer"
  24094. }
  24095. },
  24096. url: "/teams/:team_id/repos/:owner/:repo"
  24097. },
  24098. create: {
  24099. method: "POST",
  24100. params: {
  24101. description: {
  24102. type: "string"
  24103. },
  24104. maintainers: {
  24105. type: "string[]"
  24106. },
  24107. name: {
  24108. required: true,
  24109. type: "string"
  24110. },
  24111. org: {
  24112. required: true,
  24113. type: "string"
  24114. },
  24115. parent_team_id: {
  24116. type: "integer"
  24117. },
  24118. permission: {
  24119. enum: ["pull", "push", "admin"],
  24120. type: "string"
  24121. },
  24122. privacy: {
  24123. enum: ["secret", "closed"],
  24124. type: "string"
  24125. },
  24126. repo_names: {
  24127. type: "string[]"
  24128. }
  24129. },
  24130. url: "/orgs/:org/teams"
  24131. },
  24132. createDiscussion: {
  24133. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  24134. method: "POST",
  24135. params: {
  24136. body: {
  24137. required: true,
  24138. type: "string"
  24139. },
  24140. private: {
  24141. type: "boolean"
  24142. },
  24143. team_id: {
  24144. required: true,
  24145. type: "integer"
  24146. },
  24147. title: {
  24148. required: true,
  24149. type: "string"
  24150. }
  24151. },
  24152. url: "/teams/:team_id/discussions"
  24153. },
  24154. createDiscussionComment: {
  24155. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  24156. method: "POST",
  24157. params: {
  24158. body: {
  24159. required: true,
  24160. type: "string"
  24161. },
  24162. discussion_number: {
  24163. required: true,
  24164. type: "integer"
  24165. },
  24166. team_id: {
  24167. required: true,
  24168. type: "integer"
  24169. }
  24170. },
  24171. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24172. },
  24173. createDiscussionCommentInOrg: {
  24174. method: "POST",
  24175. params: {
  24176. body: {
  24177. required: true,
  24178. type: "string"
  24179. },
  24180. discussion_number: {
  24181. required: true,
  24182. type: "integer"
  24183. },
  24184. org: {
  24185. required: true,
  24186. type: "string"
  24187. },
  24188. team_slug: {
  24189. required: true,
  24190. type: "string"
  24191. }
  24192. },
  24193. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24194. },
  24195. createDiscussionCommentLegacy: {
  24196. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  24197. method: "POST",
  24198. params: {
  24199. body: {
  24200. required: true,
  24201. type: "string"
  24202. },
  24203. discussion_number: {
  24204. required: true,
  24205. type: "integer"
  24206. },
  24207. team_id: {
  24208. required: true,
  24209. type: "integer"
  24210. }
  24211. },
  24212. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24213. },
  24214. createDiscussionInOrg: {
  24215. method: "POST",
  24216. params: {
  24217. body: {
  24218. required: true,
  24219. type: "string"
  24220. },
  24221. org: {
  24222. required: true,
  24223. type: "string"
  24224. },
  24225. private: {
  24226. type: "boolean"
  24227. },
  24228. team_slug: {
  24229. required: true,
  24230. type: "string"
  24231. },
  24232. title: {
  24233. required: true,
  24234. type: "string"
  24235. }
  24236. },
  24237. url: "/orgs/:org/teams/:team_slug/discussions"
  24238. },
  24239. createDiscussionLegacy: {
  24240. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24241. method: "POST",
  24242. params: {
  24243. body: {
  24244. required: true,
  24245. type: "string"
  24246. },
  24247. private: {
  24248. type: "boolean"
  24249. },
  24250. team_id: {
  24251. required: true,
  24252. type: "integer"
  24253. },
  24254. title: {
  24255. required: true,
  24256. type: "string"
  24257. }
  24258. },
  24259. url: "/teams/:team_id/discussions"
  24260. },
  24261. delete: {
  24262. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24263. method: "DELETE",
  24264. params: {
  24265. team_id: {
  24266. required: true,
  24267. type: "integer"
  24268. }
  24269. },
  24270. url: "/teams/:team_id"
  24271. },
  24272. deleteDiscussion: {
  24273. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24274. method: "DELETE",
  24275. params: {
  24276. discussion_number: {
  24277. required: true,
  24278. type: "integer"
  24279. },
  24280. team_id: {
  24281. required: true,
  24282. type: "integer"
  24283. }
  24284. },
  24285. url: "/teams/:team_id/discussions/:discussion_number"
  24286. },
  24287. deleteDiscussionComment: {
  24288. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24289. method: "DELETE",
  24290. params: {
  24291. comment_number: {
  24292. required: true,
  24293. type: "integer"
  24294. },
  24295. discussion_number: {
  24296. required: true,
  24297. type: "integer"
  24298. },
  24299. team_id: {
  24300. required: true,
  24301. type: "integer"
  24302. }
  24303. },
  24304. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24305. },
  24306. deleteDiscussionCommentInOrg: {
  24307. method: "DELETE",
  24308. params: {
  24309. comment_number: {
  24310. required: true,
  24311. type: "integer"
  24312. },
  24313. discussion_number: {
  24314. required: true,
  24315. type: "integer"
  24316. },
  24317. org: {
  24318. required: true,
  24319. type: "string"
  24320. },
  24321. team_slug: {
  24322. required: true,
  24323. type: "string"
  24324. }
  24325. },
  24326. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24327. },
  24328. deleteDiscussionCommentLegacy: {
  24329. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24330. method: "DELETE",
  24331. params: {
  24332. comment_number: {
  24333. required: true,
  24334. type: "integer"
  24335. },
  24336. discussion_number: {
  24337. required: true,
  24338. type: "integer"
  24339. },
  24340. team_id: {
  24341. required: true,
  24342. type: "integer"
  24343. }
  24344. },
  24345. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24346. },
  24347. deleteDiscussionInOrg: {
  24348. method: "DELETE",
  24349. params: {
  24350. discussion_number: {
  24351. required: true,
  24352. type: "integer"
  24353. },
  24354. org: {
  24355. required: true,
  24356. type: "string"
  24357. },
  24358. team_slug: {
  24359. required: true,
  24360. type: "string"
  24361. }
  24362. },
  24363. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24364. },
  24365. deleteDiscussionLegacy: {
  24366. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24367. method: "DELETE",
  24368. params: {
  24369. discussion_number: {
  24370. required: true,
  24371. type: "integer"
  24372. },
  24373. team_id: {
  24374. required: true,
  24375. type: "integer"
  24376. }
  24377. },
  24378. url: "/teams/:team_id/discussions/:discussion_number"
  24379. },
  24380. deleteInOrg: {
  24381. method: "DELETE",
  24382. params: {
  24383. org: {
  24384. required: true,
  24385. type: "string"
  24386. },
  24387. team_slug: {
  24388. required: true,
  24389. type: "string"
  24390. }
  24391. },
  24392. url: "/orgs/:org/teams/:team_slug"
  24393. },
  24394. deleteLegacy: {
  24395. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24396. method: "DELETE",
  24397. params: {
  24398. team_id: {
  24399. required: true,
  24400. type: "integer"
  24401. }
  24402. },
  24403. url: "/teams/:team_id"
  24404. },
  24405. get: {
  24406. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24407. method: "GET",
  24408. params: {
  24409. team_id: {
  24410. required: true,
  24411. type: "integer"
  24412. }
  24413. },
  24414. url: "/teams/:team_id"
  24415. },
  24416. getByName: {
  24417. method: "GET",
  24418. params: {
  24419. org: {
  24420. required: true,
  24421. type: "string"
  24422. },
  24423. team_slug: {
  24424. required: true,
  24425. type: "string"
  24426. }
  24427. },
  24428. url: "/orgs/:org/teams/:team_slug"
  24429. },
  24430. getDiscussion: {
  24431. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24432. method: "GET",
  24433. params: {
  24434. discussion_number: {
  24435. required: true,
  24436. type: "integer"
  24437. },
  24438. team_id: {
  24439. required: true,
  24440. type: "integer"
  24441. }
  24442. },
  24443. url: "/teams/:team_id/discussions/:discussion_number"
  24444. },
  24445. getDiscussionComment: {
  24446. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24447. method: "GET",
  24448. params: {
  24449. comment_number: {
  24450. required: true,
  24451. type: "integer"
  24452. },
  24453. discussion_number: {
  24454. required: true,
  24455. type: "integer"
  24456. },
  24457. team_id: {
  24458. required: true,
  24459. type: "integer"
  24460. }
  24461. },
  24462. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24463. },
  24464. getDiscussionCommentInOrg: {
  24465. method: "GET",
  24466. params: {
  24467. comment_number: {
  24468. required: true,
  24469. type: "integer"
  24470. },
  24471. discussion_number: {
  24472. required: true,
  24473. type: "integer"
  24474. },
  24475. org: {
  24476. required: true,
  24477. type: "string"
  24478. },
  24479. team_slug: {
  24480. required: true,
  24481. type: "string"
  24482. }
  24483. },
  24484. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24485. },
  24486. getDiscussionCommentLegacy: {
  24487. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24488. method: "GET",
  24489. params: {
  24490. comment_number: {
  24491. required: true,
  24492. type: "integer"
  24493. },
  24494. discussion_number: {
  24495. required: true,
  24496. type: "integer"
  24497. },
  24498. team_id: {
  24499. required: true,
  24500. type: "integer"
  24501. }
  24502. },
  24503. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24504. },
  24505. getDiscussionInOrg: {
  24506. method: "GET",
  24507. params: {
  24508. discussion_number: {
  24509. required: true,
  24510. type: "integer"
  24511. },
  24512. org: {
  24513. required: true,
  24514. type: "string"
  24515. },
  24516. team_slug: {
  24517. required: true,
  24518. type: "string"
  24519. }
  24520. },
  24521. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24522. },
  24523. getDiscussionLegacy: {
  24524. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24525. method: "GET",
  24526. params: {
  24527. discussion_number: {
  24528. required: true,
  24529. type: "integer"
  24530. },
  24531. team_id: {
  24532. required: true,
  24533. type: "integer"
  24534. }
  24535. },
  24536. url: "/teams/:team_id/discussions/:discussion_number"
  24537. },
  24538. getLegacy: {
  24539. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24540. method: "GET",
  24541. params: {
  24542. team_id: {
  24543. required: true,
  24544. type: "integer"
  24545. }
  24546. },
  24547. url: "/teams/:team_id"
  24548. },
  24549. getMember: {
  24550. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24551. method: "GET",
  24552. params: {
  24553. team_id: {
  24554. required: true,
  24555. type: "integer"
  24556. },
  24557. username: {
  24558. required: true,
  24559. type: "string"
  24560. }
  24561. },
  24562. url: "/teams/:team_id/members/:username"
  24563. },
  24564. getMemberLegacy: {
  24565. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24566. method: "GET",
  24567. params: {
  24568. team_id: {
  24569. required: true,
  24570. type: "integer"
  24571. },
  24572. username: {
  24573. required: true,
  24574. type: "string"
  24575. }
  24576. },
  24577. url: "/teams/:team_id/members/:username"
  24578. },
  24579. getMembership: {
  24580. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24581. method: "GET",
  24582. params: {
  24583. team_id: {
  24584. required: true,
  24585. type: "integer"
  24586. },
  24587. username: {
  24588. required: true,
  24589. type: "string"
  24590. }
  24591. },
  24592. url: "/teams/:team_id/memberships/:username"
  24593. },
  24594. getMembershipInOrg: {
  24595. method: "GET",
  24596. params: {
  24597. org: {
  24598. required: true,
  24599. type: "string"
  24600. },
  24601. team_slug: {
  24602. required: true,
  24603. type: "string"
  24604. },
  24605. username: {
  24606. required: true,
  24607. type: "string"
  24608. }
  24609. },
  24610. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24611. },
  24612. getMembershipLegacy: {
  24613. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24614. method: "GET",
  24615. params: {
  24616. team_id: {
  24617. required: true,
  24618. type: "integer"
  24619. },
  24620. username: {
  24621. required: true,
  24622. type: "string"
  24623. }
  24624. },
  24625. url: "/teams/:team_id/memberships/:username"
  24626. },
  24627. list: {
  24628. method: "GET",
  24629. params: {
  24630. org: {
  24631. required: true,
  24632. type: "string"
  24633. },
  24634. page: {
  24635. type: "integer"
  24636. },
  24637. per_page: {
  24638. type: "integer"
  24639. }
  24640. },
  24641. url: "/orgs/:org/teams"
  24642. },
  24643. listChild: {
  24644. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24645. method: "GET",
  24646. params: {
  24647. page: {
  24648. type: "integer"
  24649. },
  24650. per_page: {
  24651. type: "integer"
  24652. },
  24653. team_id: {
  24654. required: true,
  24655. type: "integer"
  24656. }
  24657. },
  24658. url: "/teams/:team_id/teams"
  24659. },
  24660. listChildInOrg: {
  24661. method: "GET",
  24662. params: {
  24663. org: {
  24664. required: true,
  24665. type: "string"
  24666. },
  24667. page: {
  24668. type: "integer"
  24669. },
  24670. per_page: {
  24671. type: "integer"
  24672. },
  24673. team_slug: {
  24674. required: true,
  24675. type: "string"
  24676. }
  24677. },
  24678. url: "/orgs/:org/teams/:team_slug/teams"
  24679. },
  24680. listChildLegacy: {
  24681. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24682. method: "GET",
  24683. params: {
  24684. page: {
  24685. type: "integer"
  24686. },
  24687. per_page: {
  24688. type: "integer"
  24689. },
  24690. team_id: {
  24691. required: true,
  24692. type: "integer"
  24693. }
  24694. },
  24695. url: "/teams/:team_id/teams"
  24696. },
  24697. listDiscussionComments: {
  24698. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24699. method: "GET",
  24700. params: {
  24701. direction: {
  24702. enum: ["asc", "desc"],
  24703. type: "string"
  24704. },
  24705. discussion_number: {
  24706. required: true,
  24707. type: "integer"
  24708. },
  24709. page: {
  24710. type: "integer"
  24711. },
  24712. per_page: {
  24713. type: "integer"
  24714. },
  24715. team_id: {
  24716. required: true,
  24717. type: "integer"
  24718. }
  24719. },
  24720. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24721. },
  24722. listDiscussionCommentsInOrg: {
  24723. method: "GET",
  24724. params: {
  24725. direction: {
  24726. enum: ["asc", "desc"],
  24727. type: "string"
  24728. },
  24729. discussion_number: {
  24730. required: true,
  24731. type: "integer"
  24732. },
  24733. org: {
  24734. required: true,
  24735. type: "string"
  24736. },
  24737. page: {
  24738. type: "integer"
  24739. },
  24740. per_page: {
  24741. type: "integer"
  24742. },
  24743. team_slug: {
  24744. required: true,
  24745. type: "string"
  24746. }
  24747. },
  24748. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24749. },
  24750. listDiscussionCommentsLegacy: {
  24751. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24752. method: "GET",
  24753. params: {
  24754. direction: {
  24755. enum: ["asc", "desc"],
  24756. type: "string"
  24757. },
  24758. discussion_number: {
  24759. required: true,
  24760. type: "integer"
  24761. },
  24762. page: {
  24763. type: "integer"
  24764. },
  24765. per_page: {
  24766. type: "integer"
  24767. },
  24768. team_id: {
  24769. required: true,
  24770. type: "integer"
  24771. }
  24772. },
  24773. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24774. },
  24775. listDiscussions: {
  24776. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24777. method: "GET",
  24778. params: {
  24779. direction: {
  24780. enum: ["asc", "desc"],
  24781. type: "string"
  24782. },
  24783. page: {
  24784. type: "integer"
  24785. },
  24786. per_page: {
  24787. type: "integer"
  24788. },
  24789. team_id: {
  24790. required: true,
  24791. type: "integer"
  24792. }
  24793. },
  24794. url: "/teams/:team_id/discussions"
  24795. },
  24796. listDiscussionsInOrg: {
  24797. method: "GET",
  24798. params: {
  24799. direction: {
  24800. enum: ["asc", "desc"],
  24801. type: "string"
  24802. },
  24803. org: {
  24804. required: true,
  24805. type: "string"
  24806. },
  24807. page: {
  24808. type: "integer"
  24809. },
  24810. per_page: {
  24811. type: "integer"
  24812. },
  24813. team_slug: {
  24814. required: true,
  24815. type: "string"
  24816. }
  24817. },
  24818. url: "/orgs/:org/teams/:team_slug/discussions"
  24819. },
  24820. listDiscussionsLegacy: {
  24821. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24822. method: "GET",
  24823. params: {
  24824. direction: {
  24825. enum: ["asc", "desc"],
  24826. type: "string"
  24827. },
  24828. page: {
  24829. type: "integer"
  24830. },
  24831. per_page: {
  24832. type: "integer"
  24833. },
  24834. team_id: {
  24835. required: true,
  24836. type: "integer"
  24837. }
  24838. },
  24839. url: "/teams/:team_id/discussions"
  24840. },
  24841. listForAuthenticatedUser: {
  24842. method: "GET",
  24843. params: {
  24844. page: {
  24845. type: "integer"
  24846. },
  24847. per_page: {
  24848. type: "integer"
  24849. }
  24850. },
  24851. url: "/user/teams"
  24852. },
  24853. listMembers: {
  24854. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24855. method: "GET",
  24856. params: {
  24857. page: {
  24858. type: "integer"
  24859. },
  24860. per_page: {
  24861. type: "integer"
  24862. },
  24863. role: {
  24864. enum: ["member", "maintainer", "all"],
  24865. type: "string"
  24866. },
  24867. team_id: {
  24868. required: true,
  24869. type: "integer"
  24870. }
  24871. },
  24872. url: "/teams/:team_id/members"
  24873. },
  24874. listMembersInOrg: {
  24875. method: "GET",
  24876. params: {
  24877. org: {
  24878. required: true,
  24879. type: "string"
  24880. },
  24881. page: {
  24882. type: "integer"
  24883. },
  24884. per_page: {
  24885. type: "integer"
  24886. },
  24887. role: {
  24888. enum: ["member", "maintainer", "all"],
  24889. type: "string"
  24890. },
  24891. team_slug: {
  24892. required: true,
  24893. type: "string"
  24894. }
  24895. },
  24896. url: "/orgs/:org/teams/:team_slug/members"
  24897. },
  24898. listMembersLegacy: {
  24899. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24900. method: "GET",
  24901. params: {
  24902. page: {
  24903. type: "integer"
  24904. },
  24905. per_page: {
  24906. type: "integer"
  24907. },
  24908. role: {
  24909. enum: ["member", "maintainer", "all"],
  24910. type: "string"
  24911. },
  24912. team_id: {
  24913. required: true,
  24914. type: "integer"
  24915. }
  24916. },
  24917. url: "/teams/:team_id/members"
  24918. },
  24919. listPendingInvitations: {
  24920. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24921. method: "GET",
  24922. params: {
  24923. page: {
  24924. type: "integer"
  24925. },
  24926. per_page: {
  24927. type: "integer"
  24928. },
  24929. team_id: {
  24930. required: true,
  24931. type: "integer"
  24932. }
  24933. },
  24934. url: "/teams/:team_id/invitations"
  24935. },
  24936. listPendingInvitationsInOrg: {
  24937. method: "GET",
  24938. params: {
  24939. org: {
  24940. required: true,
  24941. type: "string"
  24942. },
  24943. page: {
  24944. type: "integer"
  24945. },
  24946. per_page: {
  24947. type: "integer"
  24948. },
  24949. team_slug: {
  24950. required: true,
  24951. type: "string"
  24952. }
  24953. },
  24954. url: "/orgs/:org/teams/:team_slug/invitations"
  24955. },
  24956. listPendingInvitationsLegacy: {
  24957. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24958. method: "GET",
  24959. params: {
  24960. page: {
  24961. type: "integer"
  24962. },
  24963. per_page: {
  24964. type: "integer"
  24965. },
  24966. team_id: {
  24967. required: true,
  24968. type: "integer"
  24969. }
  24970. },
  24971. url: "/teams/:team_id/invitations"
  24972. },
  24973. listProjects: {
  24974. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24975. headers: {
  24976. accept: "application/vnd.github.inertia-preview+json"
  24977. },
  24978. method: "GET",
  24979. params: {
  24980. page: {
  24981. type: "integer"
  24982. },
  24983. per_page: {
  24984. type: "integer"
  24985. },
  24986. team_id: {
  24987. required: true,
  24988. type: "integer"
  24989. }
  24990. },
  24991. url: "/teams/:team_id/projects"
  24992. },
  24993. listProjectsInOrg: {
  24994. headers: {
  24995. accept: "application/vnd.github.inertia-preview+json"
  24996. },
  24997. method: "GET",
  24998. params: {
  24999. org: {
  25000. required: true,
  25001. type: "string"
  25002. },
  25003. page: {
  25004. type: "integer"
  25005. },
  25006. per_page: {
  25007. type: "integer"
  25008. },
  25009. team_slug: {
  25010. required: true,
  25011. type: "string"
  25012. }
  25013. },
  25014. url: "/orgs/:org/teams/:team_slug/projects"
  25015. },
  25016. listProjectsLegacy: {
  25017. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  25018. headers: {
  25019. accept: "application/vnd.github.inertia-preview+json"
  25020. },
  25021. method: "GET",
  25022. params: {
  25023. page: {
  25024. type: "integer"
  25025. },
  25026. per_page: {
  25027. type: "integer"
  25028. },
  25029. team_id: {
  25030. required: true,
  25031. type: "integer"
  25032. }
  25033. },
  25034. url: "/teams/:team_id/projects"
  25035. },
  25036. listRepos: {
  25037. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  25038. method: "GET",
  25039. params: {
  25040. page: {
  25041. type: "integer"
  25042. },
  25043. per_page: {
  25044. type: "integer"
  25045. },
  25046. team_id: {
  25047. required: true,
  25048. type: "integer"
  25049. }
  25050. },
  25051. url: "/teams/:team_id/repos"
  25052. },
  25053. listReposInOrg: {
  25054. method: "GET",
  25055. params: {
  25056. org: {
  25057. required: true,
  25058. type: "string"
  25059. },
  25060. page: {
  25061. type: "integer"
  25062. },
  25063. per_page: {
  25064. type: "integer"
  25065. },
  25066. team_slug: {
  25067. required: true,
  25068. type: "string"
  25069. }
  25070. },
  25071. url: "/orgs/:org/teams/:team_slug/repos"
  25072. },
  25073. listReposLegacy: {
  25074. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  25075. method: "GET",
  25076. params: {
  25077. page: {
  25078. type: "integer"
  25079. },
  25080. per_page: {
  25081. type: "integer"
  25082. },
  25083. team_id: {
  25084. required: true,
  25085. type: "integer"
  25086. }
  25087. },
  25088. url: "/teams/:team_id/repos"
  25089. },
  25090. removeMember: {
  25091. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  25092. method: "DELETE",
  25093. params: {
  25094. team_id: {
  25095. required: true,
  25096. type: "integer"
  25097. },
  25098. username: {
  25099. required: true,
  25100. type: "string"
  25101. }
  25102. },
  25103. url: "/teams/:team_id/members/:username"
  25104. },
  25105. removeMemberLegacy: {
  25106. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  25107. method: "DELETE",
  25108. params: {
  25109. team_id: {
  25110. required: true,
  25111. type: "integer"
  25112. },
  25113. username: {
  25114. required: true,
  25115. type: "string"
  25116. }
  25117. },
  25118. url: "/teams/:team_id/members/:username"
  25119. },
  25120. removeMembership: {
  25121. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  25122. method: "DELETE",
  25123. params: {
  25124. team_id: {
  25125. required: true,
  25126. type: "integer"
  25127. },
  25128. username: {
  25129. required: true,
  25130. type: "string"
  25131. }
  25132. },
  25133. url: "/teams/:team_id/memberships/:username"
  25134. },
  25135. removeMembershipInOrg: {
  25136. method: "DELETE",
  25137. params: {
  25138. org: {
  25139. required: true,
  25140. type: "string"
  25141. },
  25142. team_slug: {
  25143. required: true,
  25144. type: "string"
  25145. },
  25146. username: {
  25147. required: true,
  25148. type: "string"
  25149. }
  25150. },
  25151. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  25152. },
  25153. removeMembershipLegacy: {
  25154. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  25155. method: "DELETE",
  25156. params: {
  25157. team_id: {
  25158. required: true,
  25159. type: "integer"
  25160. },
  25161. username: {
  25162. required: true,
  25163. type: "string"
  25164. }
  25165. },
  25166. url: "/teams/:team_id/memberships/:username"
  25167. },
  25168. removeProject: {
  25169. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  25170. method: "DELETE",
  25171. params: {
  25172. project_id: {
  25173. required: true,
  25174. type: "integer"
  25175. },
  25176. team_id: {
  25177. required: true,
  25178. type: "integer"
  25179. }
  25180. },
  25181. url: "/teams/:team_id/projects/:project_id"
  25182. },
  25183. removeProjectInOrg: {
  25184. method: "DELETE",
  25185. params: {
  25186. org: {
  25187. required: true,
  25188. type: "string"
  25189. },
  25190. project_id: {
  25191. required: true,
  25192. type: "integer"
  25193. },
  25194. team_slug: {
  25195. required: true,
  25196. type: "string"
  25197. }
  25198. },
  25199. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25200. },
  25201. removeProjectLegacy: {
  25202. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  25203. method: "DELETE",
  25204. params: {
  25205. project_id: {
  25206. required: true,
  25207. type: "integer"
  25208. },
  25209. team_id: {
  25210. required: true,
  25211. type: "integer"
  25212. }
  25213. },
  25214. url: "/teams/:team_id/projects/:project_id"
  25215. },
  25216. removeRepo: {
  25217. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25218. method: "DELETE",
  25219. params: {
  25220. owner: {
  25221. required: true,
  25222. type: "string"
  25223. },
  25224. repo: {
  25225. required: true,
  25226. type: "string"
  25227. },
  25228. team_id: {
  25229. required: true,
  25230. type: "integer"
  25231. }
  25232. },
  25233. url: "/teams/:team_id/repos/:owner/:repo"
  25234. },
  25235. removeRepoInOrg: {
  25236. method: "DELETE",
  25237. params: {
  25238. org: {
  25239. required: true,
  25240. type: "string"
  25241. },
  25242. owner: {
  25243. required: true,
  25244. type: "string"
  25245. },
  25246. repo: {
  25247. required: true,
  25248. type: "string"
  25249. },
  25250. team_slug: {
  25251. required: true,
  25252. type: "string"
  25253. }
  25254. },
  25255. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25256. },
  25257. removeRepoLegacy: {
  25258. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25259. method: "DELETE",
  25260. params: {
  25261. owner: {
  25262. required: true,
  25263. type: "string"
  25264. },
  25265. repo: {
  25266. required: true,
  25267. type: "string"
  25268. },
  25269. team_id: {
  25270. required: true,
  25271. type: "integer"
  25272. }
  25273. },
  25274. url: "/teams/:team_id/repos/:owner/:repo"
  25275. },
  25276. reviewProject: {
  25277. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25278. headers: {
  25279. accept: "application/vnd.github.inertia-preview+json"
  25280. },
  25281. method: "GET",
  25282. params: {
  25283. project_id: {
  25284. required: true,
  25285. type: "integer"
  25286. },
  25287. team_id: {
  25288. required: true,
  25289. type: "integer"
  25290. }
  25291. },
  25292. url: "/teams/:team_id/projects/:project_id"
  25293. },
  25294. reviewProjectInOrg: {
  25295. headers: {
  25296. accept: "application/vnd.github.inertia-preview+json"
  25297. },
  25298. method: "GET",
  25299. params: {
  25300. org: {
  25301. required: true,
  25302. type: "string"
  25303. },
  25304. project_id: {
  25305. required: true,
  25306. type: "integer"
  25307. },
  25308. team_slug: {
  25309. required: true,
  25310. type: "string"
  25311. }
  25312. },
  25313. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25314. },
  25315. reviewProjectLegacy: {
  25316. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25317. headers: {
  25318. accept: "application/vnd.github.inertia-preview+json"
  25319. },
  25320. method: "GET",
  25321. params: {
  25322. project_id: {
  25323. required: true,
  25324. type: "integer"
  25325. },
  25326. team_id: {
  25327. required: true,
  25328. type: "integer"
  25329. }
  25330. },
  25331. url: "/teams/:team_id/projects/:project_id"
  25332. },
  25333. update: {
  25334. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25335. method: "PATCH",
  25336. params: {
  25337. description: {
  25338. type: "string"
  25339. },
  25340. name: {
  25341. required: true,
  25342. type: "string"
  25343. },
  25344. parent_team_id: {
  25345. type: "integer"
  25346. },
  25347. permission: {
  25348. enum: ["pull", "push", "admin"],
  25349. type: "string"
  25350. },
  25351. privacy: {
  25352. enum: ["secret", "closed"],
  25353. type: "string"
  25354. },
  25355. team_id: {
  25356. required: true,
  25357. type: "integer"
  25358. }
  25359. },
  25360. url: "/teams/:team_id"
  25361. },
  25362. updateDiscussion: {
  25363. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25364. method: "PATCH",
  25365. params: {
  25366. body: {
  25367. type: "string"
  25368. },
  25369. discussion_number: {
  25370. required: true,
  25371. type: "integer"
  25372. },
  25373. team_id: {
  25374. required: true,
  25375. type: "integer"
  25376. },
  25377. title: {
  25378. type: "string"
  25379. }
  25380. },
  25381. url: "/teams/:team_id/discussions/:discussion_number"
  25382. },
  25383. updateDiscussionComment: {
  25384. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25385. method: "PATCH",
  25386. params: {
  25387. body: {
  25388. required: true,
  25389. type: "string"
  25390. },
  25391. comment_number: {
  25392. required: true,
  25393. type: "integer"
  25394. },
  25395. discussion_number: {
  25396. required: true,
  25397. type: "integer"
  25398. },
  25399. team_id: {
  25400. required: true,
  25401. type: "integer"
  25402. }
  25403. },
  25404. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25405. },
  25406. updateDiscussionCommentInOrg: {
  25407. method: "PATCH",
  25408. params: {
  25409. body: {
  25410. required: true,
  25411. type: "string"
  25412. },
  25413. comment_number: {
  25414. required: true,
  25415. type: "integer"
  25416. },
  25417. discussion_number: {
  25418. required: true,
  25419. type: "integer"
  25420. },
  25421. org: {
  25422. required: true,
  25423. type: "string"
  25424. },
  25425. team_slug: {
  25426. required: true,
  25427. type: "string"
  25428. }
  25429. },
  25430. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25431. },
  25432. updateDiscussionCommentLegacy: {
  25433. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25434. method: "PATCH",
  25435. params: {
  25436. body: {
  25437. required: true,
  25438. type: "string"
  25439. },
  25440. comment_number: {
  25441. required: true,
  25442. type: "integer"
  25443. },
  25444. discussion_number: {
  25445. required: true,
  25446. type: "integer"
  25447. },
  25448. team_id: {
  25449. required: true,
  25450. type: "integer"
  25451. }
  25452. },
  25453. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25454. },
  25455. updateDiscussionInOrg: {
  25456. method: "PATCH",
  25457. params: {
  25458. body: {
  25459. type: "string"
  25460. },
  25461. discussion_number: {
  25462. required: true,
  25463. type: "integer"
  25464. },
  25465. org: {
  25466. required: true,
  25467. type: "string"
  25468. },
  25469. team_slug: {
  25470. required: true,
  25471. type: "string"
  25472. },
  25473. title: {
  25474. type: "string"
  25475. }
  25476. },
  25477. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25478. },
  25479. updateDiscussionLegacy: {
  25480. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25481. method: "PATCH",
  25482. params: {
  25483. body: {
  25484. type: "string"
  25485. },
  25486. discussion_number: {
  25487. required: true,
  25488. type: "integer"
  25489. },
  25490. team_id: {
  25491. required: true,
  25492. type: "integer"
  25493. },
  25494. title: {
  25495. type: "string"
  25496. }
  25497. },
  25498. url: "/teams/:team_id/discussions/:discussion_number"
  25499. },
  25500. updateInOrg: {
  25501. method: "PATCH",
  25502. params: {
  25503. description: {
  25504. type: "string"
  25505. },
  25506. name: {
  25507. required: true,
  25508. type: "string"
  25509. },
  25510. org: {
  25511. required: true,
  25512. type: "string"
  25513. },
  25514. parent_team_id: {
  25515. type: "integer"
  25516. },
  25517. permission: {
  25518. enum: ["pull", "push", "admin"],
  25519. type: "string"
  25520. },
  25521. privacy: {
  25522. enum: ["secret", "closed"],
  25523. type: "string"
  25524. },
  25525. team_slug: {
  25526. required: true,
  25527. type: "string"
  25528. }
  25529. },
  25530. url: "/orgs/:org/teams/:team_slug"
  25531. },
  25532. updateLegacy: {
  25533. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25534. method: "PATCH",
  25535. params: {
  25536. description: {
  25537. type: "string"
  25538. },
  25539. name: {
  25540. required: true,
  25541. type: "string"
  25542. },
  25543. parent_team_id: {
  25544. type: "integer"
  25545. },
  25546. permission: {
  25547. enum: ["pull", "push", "admin"],
  25548. type: "string"
  25549. },
  25550. privacy: {
  25551. enum: ["secret", "closed"],
  25552. type: "string"
  25553. },
  25554. team_id: {
  25555. required: true,
  25556. type: "integer"
  25557. }
  25558. },
  25559. url: "/teams/:team_id"
  25560. }
  25561. },
  25562. users: {
  25563. addEmails: {
  25564. method: "POST",
  25565. params: {
  25566. emails: {
  25567. required: true,
  25568. type: "string[]"
  25569. }
  25570. },
  25571. url: "/user/emails"
  25572. },
  25573. block: {
  25574. method: "PUT",
  25575. params: {
  25576. username: {
  25577. required: true,
  25578. type: "string"
  25579. }
  25580. },
  25581. url: "/user/blocks/:username"
  25582. },
  25583. checkBlocked: {
  25584. method: "GET",
  25585. params: {
  25586. username: {
  25587. required: true,
  25588. type: "string"
  25589. }
  25590. },
  25591. url: "/user/blocks/:username"
  25592. },
  25593. checkFollowing: {
  25594. method: "GET",
  25595. params: {
  25596. username: {
  25597. required: true,
  25598. type: "string"
  25599. }
  25600. },
  25601. url: "/user/following/:username"
  25602. },
  25603. checkFollowingForUser: {
  25604. method: "GET",
  25605. params: {
  25606. target_user: {
  25607. required: true,
  25608. type: "string"
  25609. },
  25610. username: {
  25611. required: true,
  25612. type: "string"
  25613. }
  25614. },
  25615. url: "/users/:username/following/:target_user"
  25616. },
  25617. createGpgKey: {
  25618. method: "POST",
  25619. params: {
  25620. armored_public_key: {
  25621. type: "string"
  25622. }
  25623. },
  25624. url: "/user/gpg_keys"
  25625. },
  25626. createPublicKey: {
  25627. method: "POST",
  25628. params: {
  25629. key: {
  25630. type: "string"
  25631. },
  25632. title: {
  25633. type: "string"
  25634. }
  25635. },
  25636. url: "/user/keys"
  25637. },
  25638. deleteEmails: {
  25639. method: "DELETE",
  25640. params: {
  25641. emails: {
  25642. required: true,
  25643. type: "string[]"
  25644. }
  25645. },
  25646. url: "/user/emails"
  25647. },
  25648. deleteGpgKey: {
  25649. method: "DELETE",
  25650. params: {
  25651. gpg_key_id: {
  25652. required: true,
  25653. type: "integer"
  25654. }
  25655. },
  25656. url: "/user/gpg_keys/:gpg_key_id"
  25657. },
  25658. deletePublicKey: {
  25659. method: "DELETE",
  25660. params: {
  25661. key_id: {
  25662. required: true,
  25663. type: "integer"
  25664. }
  25665. },
  25666. url: "/user/keys/:key_id"
  25667. },
  25668. follow: {
  25669. method: "PUT",
  25670. params: {
  25671. username: {
  25672. required: true,
  25673. type: "string"
  25674. }
  25675. },
  25676. url: "/user/following/:username"
  25677. },
  25678. getAuthenticated: {
  25679. method: "GET",
  25680. params: {},
  25681. url: "/user"
  25682. },
  25683. getByUsername: {
  25684. method: "GET",
  25685. params: {
  25686. username: {
  25687. required: true,
  25688. type: "string"
  25689. }
  25690. },
  25691. url: "/users/:username"
  25692. },
  25693. getContextForUser: {
  25694. method: "GET",
  25695. params: {
  25696. subject_id: {
  25697. type: "string"
  25698. },
  25699. subject_type: {
  25700. enum: ["organization", "repository", "issue", "pull_request"],
  25701. type: "string"
  25702. },
  25703. username: {
  25704. required: true,
  25705. type: "string"
  25706. }
  25707. },
  25708. url: "/users/:username/hovercard"
  25709. },
  25710. getGpgKey: {
  25711. method: "GET",
  25712. params: {
  25713. gpg_key_id: {
  25714. required: true,
  25715. type: "integer"
  25716. }
  25717. },
  25718. url: "/user/gpg_keys/:gpg_key_id"
  25719. },
  25720. getPublicKey: {
  25721. method: "GET",
  25722. params: {
  25723. key_id: {
  25724. required: true,
  25725. type: "integer"
  25726. }
  25727. },
  25728. url: "/user/keys/:key_id"
  25729. },
  25730. list: {
  25731. method: "GET",
  25732. params: {
  25733. page: {
  25734. type: "integer"
  25735. },
  25736. per_page: {
  25737. type: "integer"
  25738. },
  25739. since: {
  25740. type: "string"
  25741. }
  25742. },
  25743. url: "/users"
  25744. },
  25745. listBlocked: {
  25746. method: "GET",
  25747. params: {},
  25748. url: "/user/blocks"
  25749. },
  25750. listEmails: {
  25751. method: "GET",
  25752. params: {
  25753. page: {
  25754. type: "integer"
  25755. },
  25756. per_page: {
  25757. type: "integer"
  25758. }
  25759. },
  25760. url: "/user/emails"
  25761. },
  25762. listFollowersForAuthenticatedUser: {
  25763. method: "GET",
  25764. params: {
  25765. page: {
  25766. type: "integer"
  25767. },
  25768. per_page: {
  25769. type: "integer"
  25770. }
  25771. },
  25772. url: "/user/followers"
  25773. },
  25774. listFollowersForUser: {
  25775. method: "GET",
  25776. params: {
  25777. page: {
  25778. type: "integer"
  25779. },
  25780. per_page: {
  25781. type: "integer"
  25782. },
  25783. username: {
  25784. required: true,
  25785. type: "string"
  25786. }
  25787. },
  25788. url: "/users/:username/followers"
  25789. },
  25790. listFollowingForAuthenticatedUser: {
  25791. method: "GET",
  25792. params: {
  25793. page: {
  25794. type: "integer"
  25795. },
  25796. per_page: {
  25797. type: "integer"
  25798. }
  25799. },
  25800. url: "/user/following"
  25801. },
  25802. listFollowingForUser: {
  25803. method: "GET",
  25804. params: {
  25805. page: {
  25806. type: "integer"
  25807. },
  25808. per_page: {
  25809. type: "integer"
  25810. },
  25811. username: {
  25812. required: true,
  25813. type: "string"
  25814. }
  25815. },
  25816. url: "/users/:username/following"
  25817. },
  25818. listGpgKeys: {
  25819. method: "GET",
  25820. params: {
  25821. page: {
  25822. type: "integer"
  25823. },
  25824. per_page: {
  25825. type: "integer"
  25826. }
  25827. },
  25828. url: "/user/gpg_keys"
  25829. },
  25830. listGpgKeysForUser: {
  25831. method: "GET",
  25832. params: {
  25833. page: {
  25834. type: "integer"
  25835. },
  25836. per_page: {
  25837. type: "integer"
  25838. },
  25839. username: {
  25840. required: true,
  25841. type: "string"
  25842. }
  25843. },
  25844. url: "/users/:username/gpg_keys"
  25845. },
  25846. listPublicEmails: {
  25847. method: "GET",
  25848. params: {
  25849. page: {
  25850. type: "integer"
  25851. },
  25852. per_page: {
  25853. type: "integer"
  25854. }
  25855. },
  25856. url: "/user/public_emails"
  25857. },
  25858. listPublicKeys: {
  25859. method: "GET",
  25860. params: {
  25861. page: {
  25862. type: "integer"
  25863. },
  25864. per_page: {
  25865. type: "integer"
  25866. }
  25867. },
  25868. url: "/user/keys"
  25869. },
  25870. listPublicKeysForUser: {
  25871. method: "GET",
  25872. params: {
  25873. page: {
  25874. type: "integer"
  25875. },
  25876. per_page: {
  25877. type: "integer"
  25878. },
  25879. username: {
  25880. required: true,
  25881. type: "string"
  25882. }
  25883. },
  25884. url: "/users/:username/keys"
  25885. },
  25886. togglePrimaryEmailVisibility: {
  25887. method: "PATCH",
  25888. params: {
  25889. email: {
  25890. required: true,
  25891. type: "string"
  25892. },
  25893. visibility: {
  25894. required: true,
  25895. type: "string"
  25896. }
  25897. },
  25898. url: "/user/email/visibility"
  25899. },
  25900. unblock: {
  25901. method: "DELETE",
  25902. params: {
  25903. username: {
  25904. required: true,
  25905. type: "string"
  25906. }
  25907. },
  25908. url: "/user/blocks/:username"
  25909. },
  25910. unfollow: {
  25911. method: "DELETE",
  25912. params: {
  25913. username: {
  25914. required: true,
  25915. type: "string"
  25916. }
  25917. },
  25918. url: "/user/following/:username"
  25919. },
  25920. updateAuthenticated: {
  25921. method: "PATCH",
  25922. params: {
  25923. bio: {
  25924. type: "string"
  25925. },
  25926. blog: {
  25927. type: "string"
  25928. },
  25929. company: {
  25930. type: "string"
  25931. },
  25932. email: {
  25933. type: "string"
  25934. },
  25935. hireable: {
  25936. type: "boolean"
  25937. },
  25938. location: {
  25939. type: "string"
  25940. },
  25941. name: {
  25942. type: "string"
  25943. }
  25944. },
  25945. url: "/user"
  25946. }
  25947. }
  25948. };
  25949. const VERSION = "2.4.0";
  25950. function registerEndpoints(octokit, routes) {
  25951. Object.keys(routes).forEach(namespaceName => {
  25952. if (!octokit[namespaceName]) {
  25953. octokit[namespaceName] = {};
  25954. }
  25955. Object.keys(routes[namespaceName]).forEach(apiName => {
  25956. const apiOptions = routes[namespaceName][apiName];
  25957. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25958. if (typeof apiOptions[key] !== "undefined") {
  25959. map[key] = apiOptions[key];
  25960. }
  25961. return map;
  25962. }, {});
  25963. endpointDefaults.request = {
  25964. validate: apiOptions.params
  25965. };
  25966. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25967. // Not the most elegant solution, but we don’t want to move deprecation
  25968. // logic into octokit/endpoint.js as it’s out of scope
  25969. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25970. if (hasDeprecatedParam) {
  25971. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25972. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25973. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25974. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25975. }
  25976. if (apiOptions.deprecated) {
  25977. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25978. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25979. octokit[namespaceName][apiName] = request;
  25980. return request.apply(null, arguments);
  25981. }, request);
  25982. return;
  25983. }
  25984. octokit[namespaceName][apiName] = request;
  25985. });
  25986. });
  25987. }
  25988. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25989. const patchedMethod = options => {
  25990. options = Object.assign({}, options);
  25991. Object.keys(options).forEach(key => {
  25992. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25993. const aliasKey = apiOptions.params[key].alias;
  25994. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25995. if (!(aliasKey in options)) {
  25996. options[aliasKey] = options[key];
  25997. }
  25998. delete options[key];
  25999. }
  26000. });
  26001. return method(options);
  26002. };
  26003. Object.keys(method).forEach(key => {
  26004. patchedMethod[key] = method[key];
  26005. });
  26006. return patchedMethod;
  26007. }
  26008. /**
  26009. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  26010. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  26011. * done, we will remove the registerEndpoints methods and return the methods
  26012. * directly as with the other plugins. At that point we will also remove the
  26013. * legacy workarounds and deprecations.
  26014. *
  26015. * See the plan at
  26016. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  26017. */
  26018. function restEndpointMethods(octokit) {
  26019. // @ts-ignore
  26020. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  26021. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  26022. // See https://github.com/octokit/rest.js/pull/1134
  26023. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  26024. Object.defineProperty(octokit, deprecatedScope, {
  26025. get() {
  26026. octokit.log.warn( // @ts-ignore
  26027. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  26028. return octokit[scope];
  26029. }
  26030. });
  26031. });
  26032. return {};
  26033. }
  26034. restEndpointMethods.VERSION = VERSION;
  26035. exports.restEndpointMethods = restEndpointMethods;
  26036. //# sourceMappingURL=index.js.map
  26037. /***/ }),
  26038. /***/ 850:
  26039. /***/ (function(module, __unusedexports, __webpack_require__) {
  26040. module.exports = paginationMethodsPlugin
  26041. function paginationMethodsPlugin (octokit) {
  26042. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  26043. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  26044. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  26045. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  26046. octokit.hasFirstPage = __webpack_require__(536)
  26047. octokit.hasLastPage = __webpack_require__(336)
  26048. octokit.hasNextPage = __webpack_require__(929)
  26049. octokit.hasPreviousPage = __webpack_require__(558)
  26050. }
  26051. /***/ }),
  26052. /***/ 854:
  26053. /***/ (function(module) {
  26054. /**
  26055. * lodash (Custom Build) <https://lodash.com/>
  26056. * Build: `lodash modularize exports="npm" -o ./`
  26057. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  26058. * Released under MIT license <https://lodash.com/license>
  26059. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  26060. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  26061. */
  26062. /** Used as the `TypeError` message for "Functions" methods. */
  26063. var FUNC_ERROR_TEXT = 'Expected a function';
  26064. /** Used to stand-in for `undefined` hash values. */
  26065. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  26066. /** Used as references for various `Number` constants. */
  26067. var INFINITY = 1 / 0;
  26068. /** `Object#toString` result references. */
  26069. var funcTag = '[object Function]',
  26070. genTag = '[object GeneratorFunction]',
  26071. symbolTag = '[object Symbol]';
  26072. /** Used to match property names within property paths. */
  26073. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  26074. reIsPlainProp = /^\w*$/,
  26075. reLeadingDot = /^\./,
  26076. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  26077. /**
  26078. * Used to match `RegExp`
  26079. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  26080. */
  26081. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  26082. /** Used to match backslashes in property paths. */
  26083. var reEscapeChar = /\\(\\)?/g;
  26084. /** Used to detect host constructors (Safari). */
  26085. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  26086. /** Detect free variable `global` from Node.js. */
  26087. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  26088. /** Detect free variable `self`. */
  26089. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  26090. /** Used as a reference to the global object. */
  26091. var root = freeGlobal || freeSelf || Function('return this')();
  26092. /**
  26093. * Gets the value at `key` of `object`.
  26094. *
  26095. * @private
  26096. * @param {Object} [object] The object to query.
  26097. * @param {string} key The key of the property to get.
  26098. * @returns {*} Returns the property value.
  26099. */
  26100. function getValue(object, key) {
  26101. return object == null ? undefined : object[key];
  26102. }
  26103. /**
  26104. * Checks if `value` is a host object in IE < 9.
  26105. *
  26106. * @private
  26107. * @param {*} value The value to check.
  26108. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  26109. */
  26110. function isHostObject(value) {
  26111. // Many host objects are `Object` objects that can coerce to strings
  26112. // despite having improperly defined `toString` methods.
  26113. var result = false;
  26114. if (value != null && typeof value.toString != 'function') {
  26115. try {
  26116. result = !!(value + '');
  26117. } catch (e) {}
  26118. }
  26119. return result;
  26120. }
  26121. /** Used for built-in method references. */
  26122. var arrayProto = Array.prototype,
  26123. funcProto = Function.prototype,
  26124. objectProto = Object.prototype;
  26125. /** Used to detect overreaching core-js shims. */
  26126. var coreJsData = root['__core-js_shared__'];
  26127. /** Used to detect methods masquerading as native. */
  26128. var maskSrcKey = (function() {
  26129. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  26130. return uid ? ('Symbol(src)_1.' + uid) : '';
  26131. }());
  26132. /** Used to resolve the decompiled source of functions. */
  26133. var funcToString = funcProto.toString;
  26134. /** Used to check objects for own properties. */
  26135. var hasOwnProperty = objectProto.hasOwnProperty;
  26136. /**
  26137. * Used to resolve the
  26138. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  26139. * of values.
  26140. */
  26141. var objectToString = objectProto.toString;
  26142. /** Used to detect if a method is native. */
  26143. var reIsNative = RegExp('^' +
  26144. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  26145. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  26146. );
  26147. /** Built-in value references. */
  26148. var Symbol = root.Symbol,
  26149. splice = arrayProto.splice;
  26150. /* Built-in method references that are verified to be native. */
  26151. var Map = getNative(root, 'Map'),
  26152. nativeCreate = getNative(Object, 'create');
  26153. /** Used to convert symbols to primitives and strings. */
  26154. var symbolProto = Symbol ? Symbol.prototype : undefined,
  26155. symbolToString = symbolProto ? symbolProto.toString : undefined;
  26156. /**
  26157. * Creates a hash object.
  26158. *
  26159. * @private
  26160. * @constructor
  26161. * @param {Array} [entries] The key-value pairs to cache.
  26162. */
  26163. function Hash(entries) {
  26164. var index = -1,
  26165. length = entries ? entries.length : 0;
  26166. this.clear();
  26167. while (++index < length) {
  26168. var entry = entries[index];
  26169. this.set(entry[0], entry[1]);
  26170. }
  26171. }
  26172. /**
  26173. * Removes all key-value entries from the hash.
  26174. *
  26175. * @private
  26176. * @name clear
  26177. * @memberOf Hash
  26178. */
  26179. function hashClear() {
  26180. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  26181. }
  26182. /**
  26183. * Removes `key` and its value from the hash.
  26184. *
  26185. * @private
  26186. * @name delete
  26187. * @memberOf Hash
  26188. * @param {Object} hash The hash to modify.
  26189. * @param {string} key The key of the value to remove.
  26190. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26191. */
  26192. function hashDelete(key) {
  26193. return this.has(key) && delete this.__data__[key];
  26194. }
  26195. /**
  26196. * Gets the hash value for `key`.
  26197. *
  26198. * @private
  26199. * @name get
  26200. * @memberOf Hash
  26201. * @param {string} key The key of the value to get.
  26202. * @returns {*} Returns the entry value.
  26203. */
  26204. function hashGet(key) {
  26205. var data = this.__data__;
  26206. if (nativeCreate) {
  26207. var result = data[key];
  26208. return result === HASH_UNDEFINED ? undefined : result;
  26209. }
  26210. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  26211. }
  26212. /**
  26213. * Checks if a hash value for `key` exists.
  26214. *
  26215. * @private
  26216. * @name has
  26217. * @memberOf Hash
  26218. * @param {string} key The key of the entry to check.
  26219. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26220. */
  26221. function hashHas(key) {
  26222. var data = this.__data__;
  26223. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26224. }
  26225. /**
  26226. * Sets the hash `key` to `value`.
  26227. *
  26228. * @private
  26229. * @name set
  26230. * @memberOf Hash
  26231. * @param {string} key The key of the value to set.
  26232. * @param {*} value The value to set.
  26233. * @returns {Object} Returns the hash instance.
  26234. */
  26235. function hashSet(key, value) {
  26236. var data = this.__data__;
  26237. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26238. return this;
  26239. }
  26240. // Add methods to `Hash`.
  26241. Hash.prototype.clear = hashClear;
  26242. Hash.prototype['delete'] = hashDelete;
  26243. Hash.prototype.get = hashGet;
  26244. Hash.prototype.has = hashHas;
  26245. Hash.prototype.set = hashSet;
  26246. /**
  26247. * Creates an list cache object.
  26248. *
  26249. * @private
  26250. * @constructor
  26251. * @param {Array} [entries] The key-value pairs to cache.
  26252. */
  26253. function ListCache(entries) {
  26254. var index = -1,
  26255. length = entries ? entries.length : 0;
  26256. this.clear();
  26257. while (++index < length) {
  26258. var entry = entries[index];
  26259. this.set(entry[0], entry[1]);
  26260. }
  26261. }
  26262. /**
  26263. * Removes all key-value entries from the list cache.
  26264. *
  26265. * @private
  26266. * @name clear
  26267. * @memberOf ListCache
  26268. */
  26269. function listCacheClear() {
  26270. this.__data__ = [];
  26271. }
  26272. /**
  26273. * Removes `key` and its value from the list cache.
  26274. *
  26275. * @private
  26276. * @name delete
  26277. * @memberOf ListCache
  26278. * @param {string} key The key of the value to remove.
  26279. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26280. */
  26281. function listCacheDelete(key) {
  26282. var data = this.__data__,
  26283. index = assocIndexOf(data, key);
  26284. if (index < 0) {
  26285. return false;
  26286. }
  26287. var lastIndex = data.length - 1;
  26288. if (index == lastIndex) {
  26289. data.pop();
  26290. } else {
  26291. splice.call(data, index, 1);
  26292. }
  26293. return true;
  26294. }
  26295. /**
  26296. * Gets the list cache value for `key`.
  26297. *
  26298. * @private
  26299. * @name get
  26300. * @memberOf ListCache
  26301. * @param {string} key The key of the value to get.
  26302. * @returns {*} Returns the entry value.
  26303. */
  26304. function listCacheGet(key) {
  26305. var data = this.__data__,
  26306. index = assocIndexOf(data, key);
  26307. return index < 0 ? undefined : data[index][1];
  26308. }
  26309. /**
  26310. * Checks if a list cache value for `key` exists.
  26311. *
  26312. * @private
  26313. * @name has
  26314. * @memberOf ListCache
  26315. * @param {string} key The key of the entry to check.
  26316. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26317. */
  26318. function listCacheHas(key) {
  26319. return assocIndexOf(this.__data__, key) > -1;
  26320. }
  26321. /**
  26322. * Sets the list cache `key` to `value`.
  26323. *
  26324. * @private
  26325. * @name set
  26326. * @memberOf ListCache
  26327. * @param {string} key The key of the value to set.
  26328. * @param {*} value The value to set.
  26329. * @returns {Object} Returns the list cache instance.
  26330. */
  26331. function listCacheSet(key, value) {
  26332. var data = this.__data__,
  26333. index = assocIndexOf(data, key);
  26334. if (index < 0) {
  26335. data.push([key, value]);
  26336. } else {
  26337. data[index][1] = value;
  26338. }
  26339. return this;
  26340. }
  26341. // Add methods to `ListCache`.
  26342. ListCache.prototype.clear = listCacheClear;
  26343. ListCache.prototype['delete'] = listCacheDelete;
  26344. ListCache.prototype.get = listCacheGet;
  26345. ListCache.prototype.has = listCacheHas;
  26346. ListCache.prototype.set = listCacheSet;
  26347. /**
  26348. * Creates a map cache object to store key-value pairs.
  26349. *
  26350. * @private
  26351. * @constructor
  26352. * @param {Array} [entries] The key-value pairs to cache.
  26353. */
  26354. function MapCache(entries) {
  26355. var index = -1,
  26356. length = entries ? entries.length : 0;
  26357. this.clear();
  26358. while (++index < length) {
  26359. var entry = entries[index];
  26360. this.set(entry[0], entry[1]);
  26361. }
  26362. }
  26363. /**
  26364. * Removes all key-value entries from the map.
  26365. *
  26366. * @private
  26367. * @name clear
  26368. * @memberOf MapCache
  26369. */
  26370. function mapCacheClear() {
  26371. this.__data__ = {
  26372. 'hash': new Hash,
  26373. 'map': new (Map || ListCache),
  26374. 'string': new Hash
  26375. };
  26376. }
  26377. /**
  26378. * Removes `key` and its value from the map.
  26379. *
  26380. * @private
  26381. * @name delete
  26382. * @memberOf MapCache
  26383. * @param {string} key The key of the value to remove.
  26384. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26385. */
  26386. function mapCacheDelete(key) {
  26387. return getMapData(this, key)['delete'](key);
  26388. }
  26389. /**
  26390. * Gets the map value for `key`.
  26391. *
  26392. * @private
  26393. * @name get
  26394. * @memberOf MapCache
  26395. * @param {string} key The key of the value to get.
  26396. * @returns {*} Returns the entry value.
  26397. */
  26398. function mapCacheGet(key) {
  26399. return getMapData(this, key).get(key);
  26400. }
  26401. /**
  26402. * Checks if a map value for `key` exists.
  26403. *
  26404. * @private
  26405. * @name has
  26406. * @memberOf MapCache
  26407. * @param {string} key The key of the entry to check.
  26408. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26409. */
  26410. function mapCacheHas(key) {
  26411. return getMapData(this, key).has(key);
  26412. }
  26413. /**
  26414. * Sets the map `key` to `value`.
  26415. *
  26416. * @private
  26417. * @name set
  26418. * @memberOf MapCache
  26419. * @param {string} key The key of the value to set.
  26420. * @param {*} value The value to set.
  26421. * @returns {Object} Returns the map cache instance.
  26422. */
  26423. function mapCacheSet(key, value) {
  26424. getMapData(this, key).set(key, value);
  26425. return this;
  26426. }
  26427. // Add methods to `MapCache`.
  26428. MapCache.prototype.clear = mapCacheClear;
  26429. MapCache.prototype['delete'] = mapCacheDelete;
  26430. MapCache.prototype.get = mapCacheGet;
  26431. MapCache.prototype.has = mapCacheHas;
  26432. MapCache.prototype.set = mapCacheSet;
  26433. /**
  26434. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26435. *
  26436. * @private
  26437. * @param {Array} array The array to inspect.
  26438. * @param {*} key The key to search for.
  26439. * @returns {number} Returns the index of the matched value, else `-1`.
  26440. */
  26441. function assocIndexOf(array, key) {
  26442. var length = array.length;
  26443. while (length--) {
  26444. if (eq(array[length][0], key)) {
  26445. return length;
  26446. }
  26447. }
  26448. return -1;
  26449. }
  26450. /**
  26451. * The base implementation of `_.get` without support for default values.
  26452. *
  26453. * @private
  26454. * @param {Object} object The object to query.
  26455. * @param {Array|string} path The path of the property to get.
  26456. * @returns {*} Returns the resolved value.
  26457. */
  26458. function baseGet(object, path) {
  26459. path = isKey(path, object) ? [path] : castPath(path);
  26460. var index = 0,
  26461. length = path.length;
  26462. while (object != null && index < length) {
  26463. object = object[toKey(path[index++])];
  26464. }
  26465. return (index && index == length) ? object : undefined;
  26466. }
  26467. /**
  26468. * The base implementation of `_.isNative` without bad shim checks.
  26469. *
  26470. * @private
  26471. * @param {*} value The value to check.
  26472. * @returns {boolean} Returns `true` if `value` is a native function,
  26473. * else `false`.
  26474. */
  26475. function baseIsNative(value) {
  26476. if (!isObject(value) || isMasked(value)) {
  26477. return false;
  26478. }
  26479. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26480. return pattern.test(toSource(value));
  26481. }
  26482. /**
  26483. * The base implementation of `_.toString` which doesn't convert nullish
  26484. * values to empty strings.
  26485. *
  26486. * @private
  26487. * @param {*} value The value to process.
  26488. * @returns {string} Returns the string.
  26489. */
  26490. function baseToString(value) {
  26491. // Exit early for strings to avoid a performance hit in some environments.
  26492. if (typeof value == 'string') {
  26493. return value;
  26494. }
  26495. if (isSymbol(value)) {
  26496. return symbolToString ? symbolToString.call(value) : '';
  26497. }
  26498. var result = (value + '');
  26499. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26500. }
  26501. /**
  26502. * Casts `value` to a path array if it's not one.
  26503. *
  26504. * @private
  26505. * @param {*} value The value to inspect.
  26506. * @returns {Array} Returns the cast property path array.
  26507. */
  26508. function castPath(value) {
  26509. return isArray(value) ? value : stringToPath(value);
  26510. }
  26511. /**
  26512. * Gets the data for `map`.
  26513. *
  26514. * @private
  26515. * @param {Object} map The map to query.
  26516. * @param {string} key The reference key.
  26517. * @returns {*} Returns the map data.
  26518. */
  26519. function getMapData(map, key) {
  26520. var data = map.__data__;
  26521. return isKeyable(key)
  26522. ? data[typeof key == 'string' ? 'string' : 'hash']
  26523. : data.map;
  26524. }
  26525. /**
  26526. * Gets the native function at `key` of `object`.
  26527. *
  26528. * @private
  26529. * @param {Object} object The object to query.
  26530. * @param {string} key The key of the method to get.
  26531. * @returns {*} Returns the function if it's native, else `undefined`.
  26532. */
  26533. function getNative(object, key) {
  26534. var value = getValue(object, key);
  26535. return baseIsNative(value) ? value : undefined;
  26536. }
  26537. /**
  26538. * Checks if `value` is a property name and not a property path.
  26539. *
  26540. * @private
  26541. * @param {*} value The value to check.
  26542. * @param {Object} [object] The object to query keys on.
  26543. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26544. */
  26545. function isKey(value, object) {
  26546. if (isArray(value)) {
  26547. return false;
  26548. }
  26549. var type = typeof value;
  26550. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26551. value == null || isSymbol(value)) {
  26552. return true;
  26553. }
  26554. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26555. (object != null && value in Object(object));
  26556. }
  26557. /**
  26558. * Checks if `value` is suitable for use as unique object key.
  26559. *
  26560. * @private
  26561. * @param {*} value The value to check.
  26562. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26563. */
  26564. function isKeyable(value) {
  26565. var type = typeof value;
  26566. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26567. ? (value !== '__proto__')
  26568. : (value === null);
  26569. }
  26570. /**
  26571. * Checks if `func` has its source masked.
  26572. *
  26573. * @private
  26574. * @param {Function} func The function to check.
  26575. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26576. */
  26577. function isMasked(func) {
  26578. return !!maskSrcKey && (maskSrcKey in func);
  26579. }
  26580. /**
  26581. * Converts `string` to a property path array.
  26582. *
  26583. * @private
  26584. * @param {string} string The string to convert.
  26585. * @returns {Array} Returns the property path array.
  26586. */
  26587. var stringToPath = memoize(function(string) {
  26588. string = toString(string);
  26589. var result = [];
  26590. if (reLeadingDot.test(string)) {
  26591. result.push('');
  26592. }
  26593. string.replace(rePropName, function(match, number, quote, string) {
  26594. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26595. });
  26596. return result;
  26597. });
  26598. /**
  26599. * Converts `value` to a string key if it's not a string or symbol.
  26600. *
  26601. * @private
  26602. * @param {*} value The value to inspect.
  26603. * @returns {string|symbol} Returns the key.
  26604. */
  26605. function toKey(value) {
  26606. if (typeof value == 'string' || isSymbol(value)) {
  26607. return value;
  26608. }
  26609. var result = (value + '');
  26610. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26611. }
  26612. /**
  26613. * Converts `func` to its source code.
  26614. *
  26615. * @private
  26616. * @param {Function} func The function to process.
  26617. * @returns {string} Returns the source code.
  26618. */
  26619. function toSource(func) {
  26620. if (func != null) {
  26621. try {
  26622. return funcToString.call(func);
  26623. } catch (e) {}
  26624. try {
  26625. return (func + '');
  26626. } catch (e) {}
  26627. }
  26628. return '';
  26629. }
  26630. /**
  26631. * Creates a function that memoizes the result of `func`. If `resolver` is
  26632. * provided, it determines the cache key for storing the result based on the
  26633. * arguments provided to the memoized function. By default, the first argument
  26634. * provided to the memoized function is used as the map cache key. The `func`
  26635. * is invoked with the `this` binding of the memoized function.
  26636. *
  26637. * **Note:** The cache is exposed as the `cache` property on the memoized
  26638. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26639. * constructor with one whose instances implement the
  26640. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26641. * method interface of `delete`, `get`, `has`, and `set`.
  26642. *
  26643. * @static
  26644. * @memberOf _
  26645. * @since 0.1.0
  26646. * @category Function
  26647. * @param {Function} func The function to have its output memoized.
  26648. * @param {Function} [resolver] The function to resolve the cache key.
  26649. * @returns {Function} Returns the new memoized function.
  26650. * @example
  26651. *
  26652. * var object = { 'a': 1, 'b': 2 };
  26653. * var other = { 'c': 3, 'd': 4 };
  26654. *
  26655. * var values = _.memoize(_.values);
  26656. * values(object);
  26657. * // => [1, 2]
  26658. *
  26659. * values(other);
  26660. * // => [3, 4]
  26661. *
  26662. * object.a = 2;
  26663. * values(object);
  26664. * // => [1, 2]
  26665. *
  26666. * // Modify the result cache.
  26667. * values.cache.set(object, ['a', 'b']);
  26668. * values(object);
  26669. * // => ['a', 'b']
  26670. *
  26671. * // Replace `_.memoize.Cache`.
  26672. * _.memoize.Cache = WeakMap;
  26673. */
  26674. function memoize(func, resolver) {
  26675. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26676. throw new TypeError(FUNC_ERROR_TEXT);
  26677. }
  26678. var memoized = function() {
  26679. var args = arguments,
  26680. key = resolver ? resolver.apply(this, args) : args[0],
  26681. cache = memoized.cache;
  26682. if (cache.has(key)) {
  26683. return cache.get(key);
  26684. }
  26685. var result = func.apply(this, args);
  26686. memoized.cache = cache.set(key, result);
  26687. return result;
  26688. };
  26689. memoized.cache = new (memoize.Cache || MapCache);
  26690. return memoized;
  26691. }
  26692. // Assign cache to `_.memoize`.
  26693. memoize.Cache = MapCache;
  26694. /**
  26695. * Performs a
  26696. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26697. * comparison between two values to determine if they are equivalent.
  26698. *
  26699. * @static
  26700. * @memberOf _
  26701. * @since 4.0.0
  26702. * @category Lang
  26703. * @param {*} value The value to compare.
  26704. * @param {*} other The other value to compare.
  26705. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26706. * @example
  26707. *
  26708. * var object = { 'a': 1 };
  26709. * var other = { 'a': 1 };
  26710. *
  26711. * _.eq(object, object);
  26712. * // => true
  26713. *
  26714. * _.eq(object, other);
  26715. * // => false
  26716. *
  26717. * _.eq('a', 'a');
  26718. * // => true
  26719. *
  26720. * _.eq('a', Object('a'));
  26721. * // => false
  26722. *
  26723. * _.eq(NaN, NaN);
  26724. * // => true
  26725. */
  26726. function eq(value, other) {
  26727. return value === other || (value !== value && other !== other);
  26728. }
  26729. /**
  26730. * Checks if `value` is classified as an `Array` object.
  26731. *
  26732. * @static
  26733. * @memberOf _
  26734. * @since 0.1.0
  26735. * @category Lang
  26736. * @param {*} value The value to check.
  26737. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26738. * @example
  26739. *
  26740. * _.isArray([1, 2, 3]);
  26741. * // => true
  26742. *
  26743. * _.isArray(document.body.children);
  26744. * // => false
  26745. *
  26746. * _.isArray('abc');
  26747. * // => false
  26748. *
  26749. * _.isArray(_.noop);
  26750. * // => false
  26751. */
  26752. var isArray = Array.isArray;
  26753. /**
  26754. * Checks if `value` is classified as a `Function` object.
  26755. *
  26756. * @static
  26757. * @memberOf _
  26758. * @since 0.1.0
  26759. * @category Lang
  26760. * @param {*} value The value to check.
  26761. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26762. * @example
  26763. *
  26764. * _.isFunction(_);
  26765. * // => true
  26766. *
  26767. * _.isFunction(/abc/);
  26768. * // => false
  26769. */
  26770. function isFunction(value) {
  26771. // The use of `Object#toString` avoids issues with the `typeof` operator
  26772. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26773. var tag = isObject(value) ? objectToString.call(value) : '';
  26774. return tag == funcTag || tag == genTag;
  26775. }
  26776. /**
  26777. * Checks if `value` is the
  26778. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26779. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26780. *
  26781. * @static
  26782. * @memberOf _
  26783. * @since 0.1.0
  26784. * @category Lang
  26785. * @param {*} value The value to check.
  26786. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26787. * @example
  26788. *
  26789. * _.isObject({});
  26790. * // => true
  26791. *
  26792. * _.isObject([1, 2, 3]);
  26793. * // => true
  26794. *
  26795. * _.isObject(_.noop);
  26796. * // => true
  26797. *
  26798. * _.isObject(null);
  26799. * // => false
  26800. */
  26801. function isObject(value) {
  26802. var type = typeof value;
  26803. return !!value && (type == 'object' || type == 'function');
  26804. }
  26805. /**
  26806. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26807. * and has a `typeof` result of "object".
  26808. *
  26809. * @static
  26810. * @memberOf _
  26811. * @since 4.0.0
  26812. * @category Lang
  26813. * @param {*} value The value to check.
  26814. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26815. * @example
  26816. *
  26817. * _.isObjectLike({});
  26818. * // => true
  26819. *
  26820. * _.isObjectLike([1, 2, 3]);
  26821. * // => true
  26822. *
  26823. * _.isObjectLike(_.noop);
  26824. * // => false
  26825. *
  26826. * _.isObjectLike(null);
  26827. * // => false
  26828. */
  26829. function isObjectLike(value) {
  26830. return !!value && typeof value == 'object';
  26831. }
  26832. /**
  26833. * Checks if `value` is classified as a `Symbol` primitive or object.
  26834. *
  26835. * @static
  26836. * @memberOf _
  26837. * @since 4.0.0
  26838. * @category Lang
  26839. * @param {*} value The value to check.
  26840. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26841. * @example
  26842. *
  26843. * _.isSymbol(Symbol.iterator);
  26844. * // => true
  26845. *
  26846. * _.isSymbol('abc');
  26847. * // => false
  26848. */
  26849. function isSymbol(value) {
  26850. return typeof value == 'symbol' ||
  26851. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26852. }
  26853. /**
  26854. * Converts `value` to a string. An empty string is returned for `null`
  26855. * and `undefined` values. The sign of `-0` is preserved.
  26856. *
  26857. * @static
  26858. * @memberOf _
  26859. * @since 4.0.0
  26860. * @category Lang
  26861. * @param {*} value The value to process.
  26862. * @returns {string} Returns the string.
  26863. * @example
  26864. *
  26865. * _.toString(null);
  26866. * // => ''
  26867. *
  26868. * _.toString(-0);
  26869. * // => '-0'
  26870. *
  26871. * _.toString([1, 2, 3]);
  26872. * // => '1,2,3'
  26873. */
  26874. function toString(value) {
  26875. return value == null ? '' : baseToString(value);
  26876. }
  26877. /**
  26878. * Gets the value at `path` of `object`. If the resolved value is
  26879. * `undefined`, the `defaultValue` is returned in its place.
  26880. *
  26881. * @static
  26882. * @memberOf _
  26883. * @since 3.7.0
  26884. * @category Object
  26885. * @param {Object} object The object to query.
  26886. * @param {Array|string} path The path of the property to get.
  26887. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26888. * @returns {*} Returns the resolved value.
  26889. * @example
  26890. *
  26891. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26892. *
  26893. * _.get(object, 'a[0].b.c');
  26894. * // => 3
  26895. *
  26896. * _.get(object, ['a', '0', 'b', 'c']);
  26897. * // => 3
  26898. *
  26899. * _.get(object, 'a.b.c', 'default');
  26900. * // => 'default'
  26901. */
  26902. function get(object, path, defaultValue) {
  26903. var result = object == null ? undefined : baseGet(object, path);
  26904. return result === undefined ? defaultValue : result;
  26905. }
  26906. module.exports = get;
  26907. /***/ }),
  26908. /***/ 855:
  26909. /***/ (function(module, __unusedexports, __webpack_require__) {
  26910. module.exports = registerPlugin;
  26911. const factory = __webpack_require__(47);
  26912. function registerPlugin(plugins, pluginFunction) {
  26913. return factory(
  26914. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26915. );
  26916. }
  26917. /***/ }),
  26918. /***/ 856:
  26919. /***/ (function(module, __unusedexports, __webpack_require__) {
  26920. module.exports = __webpack_require__(141);
  26921. /***/ }),
  26922. /***/ 863:
  26923. /***/ (function(module, __unusedexports, __webpack_require__) {
  26924. module.exports = authenticationBeforeRequest;
  26925. const btoa = __webpack_require__(675);
  26926. const withAuthorizationPrefix = __webpack_require__(143);
  26927. function authenticationBeforeRequest(state, options) {
  26928. if (typeof state.auth === "string") {
  26929. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26930. return;
  26931. }
  26932. if (state.auth.username) {
  26933. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26934. options.headers.authorization = `Basic ${hash}`;
  26935. if (state.otp) {
  26936. options.headers["x-github-otp"] = state.otp;
  26937. }
  26938. return;
  26939. }
  26940. if (state.auth.clientId) {
  26941. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26942. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26943. // URL though: `/applications/:client_id/tokens/:access_token`.
  26944. //
  26945. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26946. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26947. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26948. //
  26949. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26950. // as well as "/applications/123/tokens/token456"
  26951. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26952. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26953. options.headers.authorization = `Basic ${hash}`;
  26954. return;
  26955. }
  26956. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26957. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26958. return;
  26959. }
  26960. return Promise.resolve()
  26961. .then(() => {
  26962. return state.auth();
  26963. })
  26964. .then(authorization => {
  26965. options.headers.authorization = withAuthorizationPrefix(authorization);
  26966. });
  26967. }
  26968. /***/ }),
  26969. /***/ 866:
  26970. /***/ (function(module, __unusedexports, __webpack_require__) {
  26971. "use strict";
  26972. var shebangRegex = __webpack_require__(816);
  26973. module.exports = function (str) {
  26974. var match = str.match(shebangRegex);
  26975. if (!match) {
  26976. return null;
  26977. }
  26978. var arr = match[0].replace(/#! ?/, '').split(' ');
  26979. var bin = arr[0].split('/').pop();
  26980. var arg = arr[1];
  26981. return (bin === 'env' ?
  26982. arg :
  26983. bin + (arg ? ' ' + arg : '')
  26984. );
  26985. };
  26986. /***/ }),
  26987. /***/ 874:
  26988. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26989. "use strict";
  26990. // Copyright (c) Microsoft. All rights reserved.
  26991. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26992. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26993. return new (P || (P = Promise))(function (resolve, reject) {
  26994. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26995. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26996. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26997. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26998. });
  26999. };
  27000. Object.defineProperty(exports, "__esModule", { value: true });
  27001. const url = __webpack_require__(835);
  27002. const http = __webpack_require__(605);
  27003. const https = __webpack_require__(34);
  27004. let fs;
  27005. let tunnel;
  27006. var HttpCodes;
  27007. (function (HttpCodes) {
  27008. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  27009. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  27010. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  27011. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  27012. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  27013. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  27014. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  27015. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  27016. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  27017. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  27018. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  27019. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  27020. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  27021. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  27022. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  27023. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  27024. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  27025. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  27026. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  27027. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  27028. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  27029. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  27030. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  27031. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  27032. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  27033. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  27034. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  27035. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  27036. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  27037. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  27038. const ExponentialBackoffCeiling = 10;
  27039. const ExponentialBackoffTimeSlice = 5;
  27040. class HttpClientResponse {
  27041. constructor(message) {
  27042. this.message = message;
  27043. }
  27044. readBody() {
  27045. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  27046. let output = '';
  27047. this.message.on('data', (chunk) => {
  27048. output += chunk;
  27049. });
  27050. this.message.on('end', () => {
  27051. resolve(output);
  27052. });
  27053. }));
  27054. }
  27055. }
  27056. exports.HttpClientResponse = HttpClientResponse;
  27057. function isHttps(requestUrl) {
  27058. let parsedUrl = url.parse(requestUrl);
  27059. return parsedUrl.protocol === 'https:';
  27060. }
  27061. exports.isHttps = isHttps;
  27062. var EnvironmentVariables;
  27063. (function (EnvironmentVariables) {
  27064. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  27065. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  27066. })(EnvironmentVariables || (EnvironmentVariables = {}));
  27067. class HttpClient {
  27068. constructor(userAgent, handlers, requestOptions) {
  27069. this._ignoreSslError = false;
  27070. this._allowRedirects = true;
  27071. this._maxRedirects = 50;
  27072. this._allowRetries = false;
  27073. this._maxRetries = 1;
  27074. this._keepAlive = false;
  27075. this._disposed = false;
  27076. this.userAgent = userAgent;
  27077. this.handlers = handlers || [];
  27078. this.requestOptions = requestOptions;
  27079. if (requestOptions) {
  27080. if (requestOptions.ignoreSslError != null) {
  27081. this._ignoreSslError = requestOptions.ignoreSslError;
  27082. }
  27083. this._socketTimeout = requestOptions.socketTimeout;
  27084. this._httpProxy = requestOptions.proxy;
  27085. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  27086. this._httpProxyBypassHosts = [];
  27087. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  27088. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  27089. });
  27090. }
  27091. this._certConfig = requestOptions.cert;
  27092. if (this._certConfig) {
  27093. // If using cert, need fs
  27094. fs = __webpack_require__(747);
  27095. // cache the cert content into memory, so we don't have to read it from disk every time
  27096. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  27097. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  27098. }
  27099. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  27100. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  27101. }
  27102. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  27103. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  27104. }
  27105. }
  27106. if (requestOptions.allowRedirects != null) {
  27107. this._allowRedirects = requestOptions.allowRedirects;
  27108. }
  27109. if (requestOptions.maxRedirects != null) {
  27110. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  27111. }
  27112. if (requestOptions.keepAlive != null) {
  27113. this._keepAlive = requestOptions.keepAlive;
  27114. }
  27115. if (requestOptions.allowRetries != null) {
  27116. this._allowRetries = requestOptions.allowRetries;
  27117. }
  27118. if (requestOptions.maxRetries != null) {
  27119. this._maxRetries = requestOptions.maxRetries;
  27120. }
  27121. }
  27122. }
  27123. options(requestUrl, additionalHeaders) {
  27124. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  27125. }
  27126. get(requestUrl, additionalHeaders) {
  27127. return this.request('GET', requestUrl, null, additionalHeaders || {});
  27128. }
  27129. del(requestUrl, additionalHeaders) {
  27130. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  27131. }
  27132. post(requestUrl, data, additionalHeaders) {
  27133. return this.request('POST', requestUrl, data, additionalHeaders || {});
  27134. }
  27135. patch(requestUrl, data, additionalHeaders) {
  27136. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  27137. }
  27138. put(requestUrl, data, additionalHeaders) {
  27139. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  27140. }
  27141. head(requestUrl, additionalHeaders) {
  27142. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  27143. }
  27144. sendStream(verb, requestUrl, stream, additionalHeaders) {
  27145. return this.request(verb, requestUrl, stream, additionalHeaders);
  27146. }
  27147. /**
  27148. * Makes a raw http request.
  27149. * All other methods such as get, post, patch, and request ultimately call this.
  27150. * Prefer get, del, post and patch
  27151. */
  27152. request(verb, requestUrl, data, headers) {
  27153. return __awaiter(this, void 0, void 0, function* () {
  27154. if (this._disposed) {
  27155. throw new Error("Client has already been disposed.");
  27156. }
  27157. let info = this._prepareRequest(verb, requestUrl, headers);
  27158. // Only perform retries on reads since writes may not be idempotent.
  27159. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  27160. let numTries = 0;
  27161. let response;
  27162. while (numTries < maxTries) {
  27163. response = yield this.requestRaw(info, data);
  27164. // Check if it's an authentication challenge
  27165. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  27166. let authenticationHandler;
  27167. for (let i = 0; i < this.handlers.length; i++) {
  27168. if (this.handlers[i].canHandleAuthentication(response)) {
  27169. authenticationHandler = this.handlers[i];
  27170. break;
  27171. }
  27172. }
  27173. if (authenticationHandler) {
  27174. return authenticationHandler.handleAuthentication(this, info, data);
  27175. }
  27176. else {
  27177. // We have received an unauthorized response but have no handlers to handle it.
  27178. // Let the response return to the caller.
  27179. return response;
  27180. }
  27181. }
  27182. let redirectsRemaining = this._maxRedirects;
  27183. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  27184. && this._allowRedirects
  27185. && redirectsRemaining > 0) {
  27186. const redirectUrl = response.message.headers["location"];
  27187. if (!redirectUrl) {
  27188. // if there's no location to redirect to, we won't
  27189. break;
  27190. }
  27191. // we need to finish reading the response before reassigning response
  27192. // which will leak the open socket.
  27193. yield response.readBody();
  27194. // let's make the request with the new redirectUrl
  27195. info = this._prepareRequest(verb, redirectUrl, headers);
  27196. response = yield this.requestRaw(info, data);
  27197. redirectsRemaining--;
  27198. }
  27199. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  27200. // If not a retry code, return immediately instead of retrying
  27201. return response;
  27202. }
  27203. numTries += 1;
  27204. if (numTries < maxTries) {
  27205. yield response.readBody();
  27206. yield this._performExponentialBackoff(numTries);
  27207. }
  27208. }
  27209. return response;
  27210. });
  27211. }
  27212. /**
  27213. * Needs to be called if keepAlive is set to true in request options.
  27214. */
  27215. dispose() {
  27216. if (this._agent) {
  27217. this._agent.destroy();
  27218. }
  27219. this._disposed = true;
  27220. }
  27221. /**
  27222. * Raw request.
  27223. * @param info
  27224. * @param data
  27225. */
  27226. requestRaw(info, data) {
  27227. return new Promise((resolve, reject) => {
  27228. let callbackForResult = function (err, res) {
  27229. if (err) {
  27230. reject(err);
  27231. }
  27232. resolve(res);
  27233. };
  27234. this.requestRawWithCallback(info, data, callbackForResult);
  27235. });
  27236. }
  27237. /**
  27238. * Raw request with callback.
  27239. * @param info
  27240. * @param data
  27241. * @param onResult
  27242. */
  27243. requestRawWithCallback(info, data, onResult) {
  27244. let socket;
  27245. let isDataString = typeof (data) === 'string';
  27246. if (typeof (data) === 'string') {
  27247. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27248. }
  27249. let callbackCalled = false;
  27250. let handleResult = (err, res) => {
  27251. if (!callbackCalled) {
  27252. callbackCalled = true;
  27253. onResult(err, res);
  27254. }
  27255. };
  27256. let req = info.httpModule.request(info.options, (msg) => {
  27257. let res = new HttpClientResponse(msg);
  27258. handleResult(null, res);
  27259. });
  27260. req.on('socket', (sock) => {
  27261. socket = sock;
  27262. });
  27263. // If we ever get disconnected, we want the socket to timeout eventually
  27264. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27265. if (socket) {
  27266. socket.end();
  27267. }
  27268. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27269. });
  27270. req.on('error', function (err) {
  27271. // err has statusCode property
  27272. // res should have headers
  27273. handleResult(err, null);
  27274. });
  27275. if (data && typeof (data) === 'string') {
  27276. req.write(data, 'utf8');
  27277. }
  27278. if (data && typeof (data) !== 'string') {
  27279. data.on('close', function () {
  27280. req.end();
  27281. });
  27282. data.pipe(req);
  27283. }
  27284. else {
  27285. req.end();
  27286. }
  27287. }
  27288. _prepareRequest(method, requestUrl, headers) {
  27289. const info = {};
  27290. info.parsedUrl = url.parse(requestUrl);
  27291. const usingSsl = info.parsedUrl.protocol === 'https:';
  27292. info.httpModule = usingSsl ? https : http;
  27293. const defaultPort = usingSsl ? 443 : 80;
  27294. info.options = {};
  27295. info.options.host = info.parsedUrl.hostname;
  27296. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27297. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27298. info.options.method = method;
  27299. info.options.headers = this._mergeHeaders(headers);
  27300. info.options.headers["user-agent"] = this.userAgent;
  27301. info.options.agent = this._getAgent(requestUrl);
  27302. // gives handlers an opportunity to participate
  27303. if (this.handlers && !this._isPresigned(requestUrl)) {
  27304. this.handlers.forEach((handler) => {
  27305. handler.prepareRequest(info.options);
  27306. });
  27307. }
  27308. return info;
  27309. }
  27310. _isPresigned(requestUrl) {
  27311. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27312. const patterns = this.requestOptions.presignedUrlPatterns;
  27313. for (let i = 0; i < patterns.length; i++) {
  27314. if (requestUrl.match(patterns[i])) {
  27315. return true;
  27316. }
  27317. }
  27318. }
  27319. return false;
  27320. }
  27321. _mergeHeaders(headers) {
  27322. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27323. if (this.requestOptions && this.requestOptions.headers) {
  27324. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27325. }
  27326. return lowercaseKeys(headers || {});
  27327. }
  27328. _getAgent(requestUrl) {
  27329. let agent;
  27330. let proxy = this._getProxy(requestUrl);
  27331. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27332. if (this._keepAlive && useProxy) {
  27333. agent = this._proxyAgent;
  27334. }
  27335. if (this._keepAlive && !useProxy) {
  27336. agent = this._agent;
  27337. }
  27338. // if agent is already assigned use that agent.
  27339. if (!!agent) {
  27340. return agent;
  27341. }
  27342. let parsedUrl = url.parse(requestUrl);
  27343. const usingSsl = parsedUrl.protocol === 'https:';
  27344. let maxSockets = 100;
  27345. if (!!this.requestOptions) {
  27346. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27347. }
  27348. if (useProxy) {
  27349. // If using proxy, need tunnel
  27350. if (!tunnel) {
  27351. tunnel = __webpack_require__(856);
  27352. }
  27353. const agentOptions = {
  27354. maxSockets: maxSockets,
  27355. keepAlive: this._keepAlive,
  27356. proxy: {
  27357. proxyAuth: proxy.proxyAuth,
  27358. host: proxy.proxyUrl.hostname,
  27359. port: proxy.proxyUrl.port
  27360. },
  27361. };
  27362. let tunnelAgent;
  27363. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27364. if (usingSsl) {
  27365. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27366. }
  27367. else {
  27368. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27369. }
  27370. agent = tunnelAgent(agentOptions);
  27371. this._proxyAgent = agent;
  27372. }
  27373. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27374. if (this._keepAlive && !agent) {
  27375. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27376. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27377. this._agent = agent;
  27378. }
  27379. // if not using private agent and tunnel agent isn't setup then use global agent
  27380. if (!agent) {
  27381. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27382. }
  27383. if (usingSsl && this._ignoreSslError) {
  27384. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27385. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27386. // we have to cast it to any and change it directly
  27387. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27388. }
  27389. if (usingSsl && this._certConfig) {
  27390. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27391. }
  27392. return agent;
  27393. }
  27394. _getProxy(requestUrl) {
  27395. const parsedUrl = url.parse(requestUrl);
  27396. let usingSsl = parsedUrl.protocol === 'https:';
  27397. let proxyConfig = this._httpProxy;
  27398. // fallback to http_proxy and https_proxy env
  27399. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27400. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27401. if (!proxyConfig) {
  27402. if (https_proxy && usingSsl) {
  27403. proxyConfig = {
  27404. proxyUrl: https_proxy
  27405. };
  27406. }
  27407. else if (http_proxy) {
  27408. proxyConfig = {
  27409. proxyUrl: http_proxy
  27410. };
  27411. }
  27412. }
  27413. let proxyUrl;
  27414. let proxyAuth;
  27415. if (proxyConfig) {
  27416. if (proxyConfig.proxyUrl.length > 0) {
  27417. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27418. }
  27419. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27420. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27421. }
  27422. }
  27423. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27424. }
  27425. _isBypassProxy(requestUrl) {
  27426. if (!this._httpProxyBypassHosts) {
  27427. return false;
  27428. }
  27429. let bypass = false;
  27430. this._httpProxyBypassHosts.forEach(bypassHost => {
  27431. if (bypassHost.test(requestUrl)) {
  27432. bypass = true;
  27433. }
  27434. });
  27435. return bypass;
  27436. }
  27437. _performExponentialBackoff(retryNumber) {
  27438. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27439. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27440. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27441. }
  27442. }
  27443. exports.HttpClient = HttpClient;
  27444. /***/ }),
  27445. /***/ 881:
  27446. /***/ (function(module) {
  27447. "use strict";
  27448. const isWin = process.platform === 'win32';
  27449. function notFoundError(original, syscall) {
  27450. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27451. code: 'ENOENT',
  27452. errno: 'ENOENT',
  27453. syscall: `${syscall} ${original.command}`,
  27454. path: original.command,
  27455. spawnargs: original.args,
  27456. });
  27457. }
  27458. function hookChildProcess(cp, parsed) {
  27459. if (!isWin) {
  27460. return;
  27461. }
  27462. const originalEmit = cp.emit;
  27463. cp.emit = function (name, arg1) {
  27464. // If emitting "exit" event and exit code is 1, we need to check if
  27465. // the command exists and emit an "error" instead
  27466. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27467. if (name === 'exit') {
  27468. const err = verifyENOENT(arg1, parsed, 'spawn');
  27469. if (err) {
  27470. return originalEmit.call(cp, 'error', err);
  27471. }
  27472. }
  27473. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27474. };
  27475. }
  27476. function verifyENOENT(status, parsed) {
  27477. if (isWin && status === 1 && !parsed.file) {
  27478. return notFoundError(parsed.original, 'spawn');
  27479. }
  27480. return null;
  27481. }
  27482. function verifyENOENTSync(status, parsed) {
  27483. if (isWin && status === 1 && !parsed.file) {
  27484. return notFoundError(parsed.original, 'spawnSync');
  27485. }
  27486. return null;
  27487. }
  27488. module.exports = {
  27489. hookChildProcess,
  27490. verifyENOENT,
  27491. verifyENOENTSync,
  27492. notFoundError,
  27493. };
  27494. /***/ }),
  27495. /***/ 883:
  27496. /***/ (function(module) {
  27497. /**
  27498. * lodash (Custom Build) <https://lodash.com/>
  27499. * Build: `lodash modularize exports="npm" -o ./`
  27500. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27501. * Released under MIT license <https://lodash.com/license>
  27502. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27503. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27504. */
  27505. /** Used as the `TypeError` message for "Functions" methods. */
  27506. var FUNC_ERROR_TEXT = 'Expected a function';
  27507. /** Used to stand-in for `undefined` hash values. */
  27508. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27509. /** Used as references for various `Number` constants. */
  27510. var INFINITY = 1 / 0,
  27511. MAX_SAFE_INTEGER = 9007199254740991;
  27512. /** `Object#toString` result references. */
  27513. var funcTag = '[object Function]',
  27514. genTag = '[object GeneratorFunction]',
  27515. symbolTag = '[object Symbol]';
  27516. /** Used to match property names within property paths. */
  27517. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27518. reIsPlainProp = /^\w*$/,
  27519. reLeadingDot = /^\./,
  27520. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27521. /**
  27522. * Used to match `RegExp`
  27523. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27524. */
  27525. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27526. /** Used to match backslashes in property paths. */
  27527. var reEscapeChar = /\\(\\)?/g;
  27528. /** Used to detect host constructors (Safari). */
  27529. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27530. /** Used to detect unsigned integer values. */
  27531. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27532. /** Detect free variable `global` from Node.js. */
  27533. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27534. /** Detect free variable `self`. */
  27535. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27536. /** Used as a reference to the global object. */
  27537. var root = freeGlobal || freeSelf || Function('return this')();
  27538. /**
  27539. * Gets the value at `key` of `object`.
  27540. *
  27541. * @private
  27542. * @param {Object} [object] The object to query.
  27543. * @param {string} key The key of the property to get.
  27544. * @returns {*} Returns the property value.
  27545. */
  27546. function getValue(object, key) {
  27547. return object == null ? undefined : object[key];
  27548. }
  27549. /**
  27550. * Checks if `value` is a host object in IE < 9.
  27551. *
  27552. * @private
  27553. * @param {*} value The value to check.
  27554. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27555. */
  27556. function isHostObject(value) {
  27557. // Many host objects are `Object` objects that can coerce to strings
  27558. // despite having improperly defined `toString` methods.
  27559. var result = false;
  27560. if (value != null && typeof value.toString != 'function') {
  27561. try {
  27562. result = !!(value + '');
  27563. } catch (e) {}
  27564. }
  27565. return result;
  27566. }
  27567. /** Used for built-in method references. */
  27568. var arrayProto = Array.prototype,
  27569. funcProto = Function.prototype,
  27570. objectProto = Object.prototype;
  27571. /** Used to detect overreaching core-js shims. */
  27572. var coreJsData = root['__core-js_shared__'];
  27573. /** Used to detect methods masquerading as native. */
  27574. var maskSrcKey = (function() {
  27575. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27576. return uid ? ('Symbol(src)_1.' + uid) : '';
  27577. }());
  27578. /** Used to resolve the decompiled source of functions. */
  27579. var funcToString = funcProto.toString;
  27580. /** Used to check objects for own properties. */
  27581. var hasOwnProperty = objectProto.hasOwnProperty;
  27582. /**
  27583. * Used to resolve the
  27584. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27585. * of values.
  27586. */
  27587. var objectToString = objectProto.toString;
  27588. /** Used to detect if a method is native. */
  27589. var reIsNative = RegExp('^' +
  27590. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27591. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27592. );
  27593. /** Built-in value references. */
  27594. var Symbol = root.Symbol,
  27595. splice = arrayProto.splice;
  27596. /* Built-in method references that are verified to be native. */
  27597. var Map = getNative(root, 'Map'),
  27598. nativeCreate = getNative(Object, 'create');
  27599. /** Used to convert symbols to primitives and strings. */
  27600. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27601. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27602. /**
  27603. * Creates a hash object.
  27604. *
  27605. * @private
  27606. * @constructor
  27607. * @param {Array} [entries] The key-value pairs to cache.
  27608. */
  27609. function Hash(entries) {
  27610. var index = -1,
  27611. length = entries ? entries.length : 0;
  27612. this.clear();
  27613. while (++index < length) {
  27614. var entry = entries[index];
  27615. this.set(entry[0], entry[1]);
  27616. }
  27617. }
  27618. /**
  27619. * Removes all key-value entries from the hash.
  27620. *
  27621. * @private
  27622. * @name clear
  27623. * @memberOf Hash
  27624. */
  27625. function hashClear() {
  27626. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27627. }
  27628. /**
  27629. * Removes `key` and its value from the hash.
  27630. *
  27631. * @private
  27632. * @name delete
  27633. * @memberOf Hash
  27634. * @param {Object} hash The hash to modify.
  27635. * @param {string} key The key of the value to remove.
  27636. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27637. */
  27638. function hashDelete(key) {
  27639. return this.has(key) && delete this.__data__[key];
  27640. }
  27641. /**
  27642. * Gets the hash value for `key`.
  27643. *
  27644. * @private
  27645. * @name get
  27646. * @memberOf Hash
  27647. * @param {string} key The key of the value to get.
  27648. * @returns {*} Returns the entry value.
  27649. */
  27650. function hashGet(key) {
  27651. var data = this.__data__;
  27652. if (nativeCreate) {
  27653. var result = data[key];
  27654. return result === HASH_UNDEFINED ? undefined : result;
  27655. }
  27656. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27657. }
  27658. /**
  27659. * Checks if a hash value for `key` exists.
  27660. *
  27661. * @private
  27662. * @name has
  27663. * @memberOf Hash
  27664. * @param {string} key The key of the entry to check.
  27665. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27666. */
  27667. function hashHas(key) {
  27668. var data = this.__data__;
  27669. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27670. }
  27671. /**
  27672. * Sets the hash `key` to `value`.
  27673. *
  27674. * @private
  27675. * @name set
  27676. * @memberOf Hash
  27677. * @param {string} key The key of the value to set.
  27678. * @param {*} value The value to set.
  27679. * @returns {Object} Returns the hash instance.
  27680. */
  27681. function hashSet(key, value) {
  27682. var data = this.__data__;
  27683. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27684. return this;
  27685. }
  27686. // Add methods to `Hash`.
  27687. Hash.prototype.clear = hashClear;
  27688. Hash.prototype['delete'] = hashDelete;
  27689. Hash.prototype.get = hashGet;
  27690. Hash.prototype.has = hashHas;
  27691. Hash.prototype.set = hashSet;
  27692. /**
  27693. * Creates an list cache object.
  27694. *
  27695. * @private
  27696. * @constructor
  27697. * @param {Array} [entries] The key-value pairs to cache.
  27698. */
  27699. function ListCache(entries) {
  27700. var index = -1,
  27701. length = entries ? entries.length : 0;
  27702. this.clear();
  27703. while (++index < length) {
  27704. var entry = entries[index];
  27705. this.set(entry[0], entry[1]);
  27706. }
  27707. }
  27708. /**
  27709. * Removes all key-value entries from the list cache.
  27710. *
  27711. * @private
  27712. * @name clear
  27713. * @memberOf ListCache
  27714. */
  27715. function listCacheClear() {
  27716. this.__data__ = [];
  27717. }
  27718. /**
  27719. * Removes `key` and its value from the list cache.
  27720. *
  27721. * @private
  27722. * @name delete
  27723. * @memberOf ListCache
  27724. * @param {string} key The key of the value to remove.
  27725. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27726. */
  27727. function listCacheDelete(key) {
  27728. var data = this.__data__,
  27729. index = assocIndexOf(data, key);
  27730. if (index < 0) {
  27731. return false;
  27732. }
  27733. var lastIndex = data.length - 1;
  27734. if (index == lastIndex) {
  27735. data.pop();
  27736. } else {
  27737. splice.call(data, index, 1);
  27738. }
  27739. return true;
  27740. }
  27741. /**
  27742. * Gets the list cache value for `key`.
  27743. *
  27744. * @private
  27745. * @name get
  27746. * @memberOf ListCache
  27747. * @param {string} key The key of the value to get.
  27748. * @returns {*} Returns the entry value.
  27749. */
  27750. function listCacheGet(key) {
  27751. var data = this.__data__,
  27752. index = assocIndexOf(data, key);
  27753. return index < 0 ? undefined : data[index][1];
  27754. }
  27755. /**
  27756. * Checks if a list cache value for `key` exists.
  27757. *
  27758. * @private
  27759. * @name has
  27760. * @memberOf ListCache
  27761. * @param {string} key The key of the entry to check.
  27762. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27763. */
  27764. function listCacheHas(key) {
  27765. return assocIndexOf(this.__data__, key) > -1;
  27766. }
  27767. /**
  27768. * Sets the list cache `key` to `value`.
  27769. *
  27770. * @private
  27771. * @name set
  27772. * @memberOf ListCache
  27773. * @param {string} key The key of the value to set.
  27774. * @param {*} value The value to set.
  27775. * @returns {Object} Returns the list cache instance.
  27776. */
  27777. function listCacheSet(key, value) {
  27778. var data = this.__data__,
  27779. index = assocIndexOf(data, key);
  27780. if (index < 0) {
  27781. data.push([key, value]);
  27782. } else {
  27783. data[index][1] = value;
  27784. }
  27785. return this;
  27786. }
  27787. // Add methods to `ListCache`.
  27788. ListCache.prototype.clear = listCacheClear;
  27789. ListCache.prototype['delete'] = listCacheDelete;
  27790. ListCache.prototype.get = listCacheGet;
  27791. ListCache.prototype.has = listCacheHas;
  27792. ListCache.prototype.set = listCacheSet;
  27793. /**
  27794. * Creates a map cache object to store key-value pairs.
  27795. *
  27796. * @private
  27797. * @constructor
  27798. * @param {Array} [entries] The key-value pairs to cache.
  27799. */
  27800. function MapCache(entries) {
  27801. var index = -1,
  27802. length = entries ? entries.length : 0;
  27803. this.clear();
  27804. while (++index < length) {
  27805. var entry = entries[index];
  27806. this.set(entry[0], entry[1]);
  27807. }
  27808. }
  27809. /**
  27810. * Removes all key-value entries from the map.
  27811. *
  27812. * @private
  27813. * @name clear
  27814. * @memberOf MapCache
  27815. */
  27816. function mapCacheClear() {
  27817. this.__data__ = {
  27818. 'hash': new Hash,
  27819. 'map': new (Map || ListCache),
  27820. 'string': new Hash
  27821. };
  27822. }
  27823. /**
  27824. * Removes `key` and its value from the map.
  27825. *
  27826. * @private
  27827. * @name delete
  27828. * @memberOf MapCache
  27829. * @param {string} key The key of the value to remove.
  27830. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27831. */
  27832. function mapCacheDelete(key) {
  27833. return getMapData(this, key)['delete'](key);
  27834. }
  27835. /**
  27836. * Gets the map value for `key`.
  27837. *
  27838. * @private
  27839. * @name get
  27840. * @memberOf MapCache
  27841. * @param {string} key The key of the value to get.
  27842. * @returns {*} Returns the entry value.
  27843. */
  27844. function mapCacheGet(key) {
  27845. return getMapData(this, key).get(key);
  27846. }
  27847. /**
  27848. * Checks if a map value for `key` exists.
  27849. *
  27850. * @private
  27851. * @name has
  27852. * @memberOf MapCache
  27853. * @param {string} key The key of the entry to check.
  27854. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27855. */
  27856. function mapCacheHas(key) {
  27857. return getMapData(this, key).has(key);
  27858. }
  27859. /**
  27860. * Sets the map `key` to `value`.
  27861. *
  27862. * @private
  27863. * @name set
  27864. * @memberOf MapCache
  27865. * @param {string} key The key of the value to set.
  27866. * @param {*} value The value to set.
  27867. * @returns {Object} Returns the map cache instance.
  27868. */
  27869. function mapCacheSet(key, value) {
  27870. getMapData(this, key).set(key, value);
  27871. return this;
  27872. }
  27873. // Add methods to `MapCache`.
  27874. MapCache.prototype.clear = mapCacheClear;
  27875. MapCache.prototype['delete'] = mapCacheDelete;
  27876. MapCache.prototype.get = mapCacheGet;
  27877. MapCache.prototype.has = mapCacheHas;
  27878. MapCache.prototype.set = mapCacheSet;
  27879. /**
  27880. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27881. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27882. * for equality comparisons.
  27883. *
  27884. * @private
  27885. * @param {Object} object The object to modify.
  27886. * @param {string} key The key of the property to assign.
  27887. * @param {*} value The value to assign.
  27888. */
  27889. function assignValue(object, key, value) {
  27890. var objValue = object[key];
  27891. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27892. (value === undefined && !(key in object))) {
  27893. object[key] = value;
  27894. }
  27895. }
  27896. /**
  27897. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27898. *
  27899. * @private
  27900. * @param {Array} array The array to inspect.
  27901. * @param {*} key The key to search for.
  27902. * @returns {number} Returns the index of the matched value, else `-1`.
  27903. */
  27904. function assocIndexOf(array, key) {
  27905. var length = array.length;
  27906. while (length--) {
  27907. if (eq(array[length][0], key)) {
  27908. return length;
  27909. }
  27910. }
  27911. return -1;
  27912. }
  27913. /**
  27914. * The base implementation of `_.isNative` without bad shim checks.
  27915. *
  27916. * @private
  27917. * @param {*} value The value to check.
  27918. * @returns {boolean} Returns `true` if `value` is a native function,
  27919. * else `false`.
  27920. */
  27921. function baseIsNative(value) {
  27922. if (!isObject(value) || isMasked(value)) {
  27923. return false;
  27924. }
  27925. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27926. return pattern.test(toSource(value));
  27927. }
  27928. /**
  27929. * The base implementation of `_.set`.
  27930. *
  27931. * @private
  27932. * @param {Object} object The object to modify.
  27933. * @param {Array|string} path The path of the property to set.
  27934. * @param {*} value The value to set.
  27935. * @param {Function} [customizer] The function to customize path creation.
  27936. * @returns {Object} Returns `object`.
  27937. */
  27938. function baseSet(object, path, value, customizer) {
  27939. if (!isObject(object)) {
  27940. return object;
  27941. }
  27942. path = isKey(path, object) ? [path] : castPath(path);
  27943. var index = -1,
  27944. length = path.length,
  27945. lastIndex = length - 1,
  27946. nested = object;
  27947. while (nested != null && ++index < length) {
  27948. var key = toKey(path[index]),
  27949. newValue = value;
  27950. if (index != lastIndex) {
  27951. var objValue = nested[key];
  27952. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27953. if (newValue === undefined) {
  27954. newValue = isObject(objValue)
  27955. ? objValue
  27956. : (isIndex(path[index + 1]) ? [] : {});
  27957. }
  27958. }
  27959. assignValue(nested, key, newValue);
  27960. nested = nested[key];
  27961. }
  27962. return object;
  27963. }
  27964. /**
  27965. * The base implementation of `_.toString` which doesn't convert nullish
  27966. * values to empty strings.
  27967. *
  27968. * @private
  27969. * @param {*} value The value to process.
  27970. * @returns {string} Returns the string.
  27971. */
  27972. function baseToString(value) {
  27973. // Exit early for strings to avoid a performance hit in some environments.
  27974. if (typeof value == 'string') {
  27975. return value;
  27976. }
  27977. if (isSymbol(value)) {
  27978. return symbolToString ? symbolToString.call(value) : '';
  27979. }
  27980. var result = (value + '');
  27981. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27982. }
  27983. /**
  27984. * Casts `value` to a path array if it's not one.
  27985. *
  27986. * @private
  27987. * @param {*} value The value to inspect.
  27988. * @returns {Array} Returns the cast property path array.
  27989. */
  27990. function castPath(value) {
  27991. return isArray(value) ? value : stringToPath(value);
  27992. }
  27993. /**
  27994. * Gets the data for `map`.
  27995. *
  27996. * @private
  27997. * @param {Object} map The map to query.
  27998. * @param {string} key The reference key.
  27999. * @returns {*} Returns the map data.
  28000. */
  28001. function getMapData(map, key) {
  28002. var data = map.__data__;
  28003. return isKeyable(key)
  28004. ? data[typeof key == 'string' ? 'string' : 'hash']
  28005. : data.map;
  28006. }
  28007. /**
  28008. * Gets the native function at `key` of `object`.
  28009. *
  28010. * @private
  28011. * @param {Object} object The object to query.
  28012. * @param {string} key The key of the method to get.
  28013. * @returns {*} Returns the function if it's native, else `undefined`.
  28014. */
  28015. function getNative(object, key) {
  28016. var value = getValue(object, key);
  28017. return baseIsNative(value) ? value : undefined;
  28018. }
  28019. /**
  28020. * Checks if `value` is a valid array-like index.
  28021. *
  28022. * @private
  28023. * @param {*} value The value to check.
  28024. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  28025. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  28026. */
  28027. function isIndex(value, length) {
  28028. length = length == null ? MAX_SAFE_INTEGER : length;
  28029. return !!length &&
  28030. (typeof value == 'number' || reIsUint.test(value)) &&
  28031. (value > -1 && value % 1 == 0 && value < length);
  28032. }
  28033. /**
  28034. * Checks if `value` is a property name and not a property path.
  28035. *
  28036. * @private
  28037. * @param {*} value The value to check.
  28038. * @param {Object} [object] The object to query keys on.
  28039. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  28040. */
  28041. function isKey(value, object) {
  28042. if (isArray(value)) {
  28043. return false;
  28044. }
  28045. var type = typeof value;
  28046. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  28047. value == null || isSymbol(value)) {
  28048. return true;
  28049. }
  28050. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  28051. (object != null && value in Object(object));
  28052. }
  28053. /**
  28054. * Checks if `value` is suitable for use as unique object key.
  28055. *
  28056. * @private
  28057. * @param {*} value The value to check.
  28058. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  28059. */
  28060. function isKeyable(value) {
  28061. var type = typeof value;
  28062. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  28063. ? (value !== '__proto__')
  28064. : (value === null);
  28065. }
  28066. /**
  28067. * Checks if `func` has its source masked.
  28068. *
  28069. * @private
  28070. * @param {Function} func The function to check.
  28071. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  28072. */
  28073. function isMasked(func) {
  28074. return !!maskSrcKey && (maskSrcKey in func);
  28075. }
  28076. /**
  28077. * Converts `string` to a property path array.
  28078. *
  28079. * @private
  28080. * @param {string} string The string to convert.
  28081. * @returns {Array} Returns the property path array.
  28082. */
  28083. var stringToPath = memoize(function(string) {
  28084. string = toString(string);
  28085. var result = [];
  28086. if (reLeadingDot.test(string)) {
  28087. result.push('');
  28088. }
  28089. string.replace(rePropName, function(match, number, quote, string) {
  28090. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  28091. });
  28092. return result;
  28093. });
  28094. /**
  28095. * Converts `value` to a string key if it's not a string or symbol.
  28096. *
  28097. * @private
  28098. * @param {*} value The value to inspect.
  28099. * @returns {string|symbol} Returns the key.
  28100. */
  28101. function toKey(value) {
  28102. if (typeof value == 'string' || isSymbol(value)) {
  28103. return value;
  28104. }
  28105. var result = (value + '');
  28106. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  28107. }
  28108. /**
  28109. * Converts `func` to its source code.
  28110. *
  28111. * @private
  28112. * @param {Function} func The function to process.
  28113. * @returns {string} Returns the source code.
  28114. */
  28115. function toSource(func) {
  28116. if (func != null) {
  28117. try {
  28118. return funcToString.call(func);
  28119. } catch (e) {}
  28120. try {
  28121. return (func + '');
  28122. } catch (e) {}
  28123. }
  28124. return '';
  28125. }
  28126. /**
  28127. * Creates a function that memoizes the result of `func`. If `resolver` is
  28128. * provided, it determines the cache key for storing the result based on the
  28129. * arguments provided to the memoized function. By default, the first argument
  28130. * provided to the memoized function is used as the map cache key. The `func`
  28131. * is invoked with the `this` binding of the memoized function.
  28132. *
  28133. * **Note:** The cache is exposed as the `cache` property on the memoized
  28134. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28135. * constructor with one whose instances implement the
  28136. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28137. * method interface of `delete`, `get`, `has`, and `set`.
  28138. *
  28139. * @static
  28140. * @memberOf _
  28141. * @since 0.1.0
  28142. * @category Function
  28143. * @param {Function} func The function to have its output memoized.
  28144. * @param {Function} [resolver] The function to resolve the cache key.
  28145. * @returns {Function} Returns the new memoized function.
  28146. * @example
  28147. *
  28148. * var object = { 'a': 1, 'b': 2 };
  28149. * var other = { 'c': 3, 'd': 4 };
  28150. *
  28151. * var values = _.memoize(_.values);
  28152. * values(object);
  28153. * // => [1, 2]
  28154. *
  28155. * values(other);
  28156. * // => [3, 4]
  28157. *
  28158. * object.a = 2;
  28159. * values(object);
  28160. * // => [1, 2]
  28161. *
  28162. * // Modify the result cache.
  28163. * values.cache.set(object, ['a', 'b']);
  28164. * values(object);
  28165. * // => ['a', 'b']
  28166. *
  28167. * // Replace `_.memoize.Cache`.
  28168. * _.memoize.Cache = WeakMap;
  28169. */
  28170. function memoize(func, resolver) {
  28171. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  28172. throw new TypeError(FUNC_ERROR_TEXT);
  28173. }
  28174. var memoized = function() {
  28175. var args = arguments,
  28176. key = resolver ? resolver.apply(this, args) : args[0],
  28177. cache = memoized.cache;
  28178. if (cache.has(key)) {
  28179. return cache.get(key);
  28180. }
  28181. var result = func.apply(this, args);
  28182. memoized.cache = cache.set(key, result);
  28183. return result;
  28184. };
  28185. memoized.cache = new (memoize.Cache || MapCache);
  28186. return memoized;
  28187. }
  28188. // Assign cache to `_.memoize`.
  28189. memoize.Cache = MapCache;
  28190. /**
  28191. * Performs a
  28192. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28193. * comparison between two values to determine if they are equivalent.
  28194. *
  28195. * @static
  28196. * @memberOf _
  28197. * @since 4.0.0
  28198. * @category Lang
  28199. * @param {*} value The value to compare.
  28200. * @param {*} other The other value to compare.
  28201. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28202. * @example
  28203. *
  28204. * var object = { 'a': 1 };
  28205. * var other = { 'a': 1 };
  28206. *
  28207. * _.eq(object, object);
  28208. * // => true
  28209. *
  28210. * _.eq(object, other);
  28211. * // => false
  28212. *
  28213. * _.eq('a', 'a');
  28214. * // => true
  28215. *
  28216. * _.eq('a', Object('a'));
  28217. * // => false
  28218. *
  28219. * _.eq(NaN, NaN);
  28220. * // => true
  28221. */
  28222. function eq(value, other) {
  28223. return value === other || (value !== value && other !== other);
  28224. }
  28225. /**
  28226. * Checks if `value` is classified as an `Array` object.
  28227. *
  28228. * @static
  28229. * @memberOf _
  28230. * @since 0.1.0
  28231. * @category Lang
  28232. * @param {*} value The value to check.
  28233. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28234. * @example
  28235. *
  28236. * _.isArray([1, 2, 3]);
  28237. * // => true
  28238. *
  28239. * _.isArray(document.body.children);
  28240. * // => false
  28241. *
  28242. * _.isArray('abc');
  28243. * // => false
  28244. *
  28245. * _.isArray(_.noop);
  28246. * // => false
  28247. */
  28248. var isArray = Array.isArray;
  28249. /**
  28250. * Checks if `value` is classified as a `Function` object.
  28251. *
  28252. * @static
  28253. * @memberOf _
  28254. * @since 0.1.0
  28255. * @category Lang
  28256. * @param {*} value The value to check.
  28257. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28258. * @example
  28259. *
  28260. * _.isFunction(_);
  28261. * // => true
  28262. *
  28263. * _.isFunction(/abc/);
  28264. * // => false
  28265. */
  28266. function isFunction(value) {
  28267. // The use of `Object#toString` avoids issues with the `typeof` operator
  28268. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28269. var tag = isObject(value) ? objectToString.call(value) : '';
  28270. return tag == funcTag || tag == genTag;
  28271. }
  28272. /**
  28273. * Checks if `value` is the
  28274. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28275. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28276. *
  28277. * @static
  28278. * @memberOf _
  28279. * @since 0.1.0
  28280. * @category Lang
  28281. * @param {*} value The value to check.
  28282. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28283. * @example
  28284. *
  28285. * _.isObject({});
  28286. * // => true
  28287. *
  28288. * _.isObject([1, 2, 3]);
  28289. * // => true
  28290. *
  28291. * _.isObject(_.noop);
  28292. * // => true
  28293. *
  28294. * _.isObject(null);
  28295. * // => false
  28296. */
  28297. function isObject(value) {
  28298. var type = typeof value;
  28299. return !!value && (type == 'object' || type == 'function');
  28300. }
  28301. /**
  28302. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28303. * and has a `typeof` result of "object".
  28304. *
  28305. * @static
  28306. * @memberOf _
  28307. * @since 4.0.0
  28308. * @category Lang
  28309. * @param {*} value The value to check.
  28310. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28311. * @example
  28312. *
  28313. * _.isObjectLike({});
  28314. * // => true
  28315. *
  28316. * _.isObjectLike([1, 2, 3]);
  28317. * // => true
  28318. *
  28319. * _.isObjectLike(_.noop);
  28320. * // => false
  28321. *
  28322. * _.isObjectLike(null);
  28323. * // => false
  28324. */
  28325. function isObjectLike(value) {
  28326. return !!value && typeof value == 'object';
  28327. }
  28328. /**
  28329. * Checks if `value` is classified as a `Symbol` primitive or object.
  28330. *
  28331. * @static
  28332. * @memberOf _
  28333. * @since 4.0.0
  28334. * @category Lang
  28335. * @param {*} value The value to check.
  28336. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28337. * @example
  28338. *
  28339. * _.isSymbol(Symbol.iterator);
  28340. * // => true
  28341. *
  28342. * _.isSymbol('abc');
  28343. * // => false
  28344. */
  28345. function isSymbol(value) {
  28346. return typeof value == 'symbol' ||
  28347. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28348. }
  28349. /**
  28350. * Converts `value` to a string. An empty string is returned for `null`
  28351. * and `undefined` values. The sign of `-0` is preserved.
  28352. *
  28353. * @static
  28354. * @memberOf _
  28355. * @since 4.0.0
  28356. * @category Lang
  28357. * @param {*} value The value to process.
  28358. * @returns {string} Returns the string.
  28359. * @example
  28360. *
  28361. * _.toString(null);
  28362. * // => ''
  28363. *
  28364. * _.toString(-0);
  28365. * // => '-0'
  28366. *
  28367. * _.toString([1, 2, 3]);
  28368. * // => '1,2,3'
  28369. */
  28370. function toString(value) {
  28371. return value == null ? '' : baseToString(value);
  28372. }
  28373. /**
  28374. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28375. * it's created. Arrays are created for missing index properties while objects
  28376. * are created for all other missing properties. Use `_.setWith` to customize
  28377. * `path` creation.
  28378. *
  28379. * **Note:** This method mutates `object`.
  28380. *
  28381. * @static
  28382. * @memberOf _
  28383. * @since 3.7.0
  28384. * @category Object
  28385. * @param {Object} object The object to modify.
  28386. * @param {Array|string} path The path of the property to set.
  28387. * @param {*} value The value to set.
  28388. * @returns {Object} Returns `object`.
  28389. * @example
  28390. *
  28391. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28392. *
  28393. * _.set(object, 'a[0].b.c', 4);
  28394. * console.log(object.a[0].b.c);
  28395. * // => 4
  28396. *
  28397. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28398. * console.log(object.x[0].y.z);
  28399. * // => 5
  28400. */
  28401. function set(object, path, value) {
  28402. return object == null ? object : baseSet(object, path, value);
  28403. }
  28404. module.exports = set;
  28405. /***/ }),
  28406. /***/ 898:
  28407. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28408. "use strict";
  28409. Object.defineProperty(exports, '__esModule', { value: true });
  28410. var request = __webpack_require__(753);
  28411. var universalUserAgent = __webpack_require__(796);
  28412. const VERSION = "4.3.1";
  28413. class GraphqlError extends Error {
  28414. constructor(request, response) {
  28415. const message = response.data.errors[0].message;
  28416. super(message);
  28417. Object.assign(this, response.data);
  28418. this.name = "GraphqlError";
  28419. this.request = request; // Maintains proper stack trace (only available on V8)
  28420. /* istanbul ignore next */
  28421. if (Error.captureStackTrace) {
  28422. Error.captureStackTrace(this, this.constructor);
  28423. }
  28424. }
  28425. }
  28426. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28427. function graphql(request, query, options) {
  28428. options = typeof query === "string" ? options = Object.assign({
  28429. query
  28430. }, options) : options = query;
  28431. const requestOptions = Object.keys(options).reduce((result, key) => {
  28432. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28433. result[key] = options[key];
  28434. return result;
  28435. }
  28436. if (!result.variables) {
  28437. result.variables = {};
  28438. }
  28439. result.variables[key] = options[key];
  28440. return result;
  28441. }, {});
  28442. return request(requestOptions).then(response => {
  28443. if (response.data.errors) {
  28444. throw new GraphqlError(requestOptions, {
  28445. data: response.data
  28446. });
  28447. }
  28448. return response.data.data;
  28449. });
  28450. }
  28451. function withDefaults(request$1, newDefaults) {
  28452. const newRequest = request$1.defaults(newDefaults);
  28453. const newApi = (query, options) => {
  28454. return graphql(newRequest, query, options);
  28455. };
  28456. return Object.assign(newApi, {
  28457. defaults: withDefaults.bind(null, newRequest),
  28458. endpoint: request.request.endpoint
  28459. });
  28460. }
  28461. const graphql$1 = withDefaults(request.request, {
  28462. headers: {
  28463. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28464. },
  28465. method: "POST",
  28466. url: "/graphql"
  28467. });
  28468. function withCustomRequest(customRequest) {
  28469. return withDefaults(customRequest, {
  28470. method: "POST",
  28471. url: "/graphql"
  28472. });
  28473. }
  28474. exports.graphql = graphql$1;
  28475. exports.withCustomRequest = withCustomRequest;
  28476. //# sourceMappingURL=index.js.map
  28477. /***/ }),
  28478. /***/ 916:
  28479. /***/ (function(__unusedmodule, exports) {
  28480. "use strict";
  28481. Object.defineProperty(exports, '__esModule', { value: true });
  28482. const VERSION = "1.0.0";
  28483. /**
  28484. * @param octokit Octokit instance
  28485. * @param options Options passed to Octokit constructor
  28486. */
  28487. function requestLog(octokit) {
  28488. octokit.hook.wrap("request", (request, options) => {
  28489. octokit.log.debug("request", options);
  28490. const start = Date.now();
  28491. const requestOptions = octokit.request.endpoint.parse(options);
  28492. const path = requestOptions.url.replace(options.baseUrl, "");
  28493. return request(options).then(response => {
  28494. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28495. return response;
  28496. }).catch(error => {
  28497. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28498. throw error;
  28499. });
  28500. });
  28501. }
  28502. requestLog.VERSION = VERSION;
  28503. exports.requestLog = requestLog;
  28504. //# sourceMappingURL=index.js.map
  28505. /***/ }),
  28506. /***/ 929:
  28507. /***/ (function(module, __unusedexports, __webpack_require__) {
  28508. module.exports = hasNextPage
  28509. const deprecate = __webpack_require__(370)
  28510. const getPageLinks = __webpack_require__(577)
  28511. function hasNextPage (link) {
  28512. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28513. return getPageLinks(link).next
  28514. }
  28515. /***/ }),
  28516. /***/ 948:
  28517. /***/ (function(module) {
  28518. "use strict";
  28519. /**
  28520. * Tries to execute a function and discards any error that occurs.
  28521. * @param {Function} fn - Function that might or might not throw an error.
  28522. * @returns {?*} Return-value of the function when no error occurred.
  28523. */
  28524. module.exports = function(fn) {
  28525. try { return fn() } catch (e) {}
  28526. }
  28527. /***/ }),
  28528. /***/ 950:
  28529. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28530. "use strict";
  28531. Object.defineProperty(exports, "__esModule", { value: true });
  28532. const url = __webpack_require__(835);
  28533. function getProxyUrl(reqUrl) {
  28534. let usingSsl = reqUrl.protocol === 'https:';
  28535. let proxyUrl;
  28536. if (checkBypass(reqUrl)) {
  28537. return proxyUrl;
  28538. }
  28539. let proxyVar;
  28540. if (usingSsl) {
  28541. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28542. }
  28543. else {
  28544. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28545. }
  28546. if (proxyVar) {
  28547. proxyUrl = url.parse(proxyVar);
  28548. }
  28549. return proxyUrl;
  28550. }
  28551. exports.getProxyUrl = getProxyUrl;
  28552. function checkBypass(reqUrl) {
  28553. if (!reqUrl.hostname) {
  28554. return false;
  28555. }
  28556. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28557. if (!noProxy) {
  28558. return false;
  28559. }
  28560. // Determine the request port
  28561. let reqPort;
  28562. if (reqUrl.port) {
  28563. reqPort = Number(reqUrl.port);
  28564. }
  28565. else if (reqUrl.protocol === 'http:') {
  28566. reqPort = 80;
  28567. }
  28568. else if (reqUrl.protocol === 'https:') {
  28569. reqPort = 443;
  28570. }
  28571. // Format the request hostname and hostname with port
  28572. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28573. if (typeof reqPort === 'number') {
  28574. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28575. }
  28576. // Compare request host against noproxy
  28577. for (let upperNoProxyItem of noProxy
  28578. .split(',')
  28579. .map(x => x.trim().toUpperCase())
  28580. .filter(x => x)) {
  28581. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28582. return true;
  28583. }
  28584. }
  28585. return false;
  28586. }
  28587. exports.checkBypass = checkBypass;
  28588. /***/ }),
  28589. /***/ 954:
  28590. /***/ (function(module) {
  28591. module.exports = validateAuth;
  28592. function validateAuth(auth) {
  28593. if (typeof auth === "string") {
  28594. return;
  28595. }
  28596. if (typeof auth === "function") {
  28597. return;
  28598. }
  28599. if (auth.username && auth.password) {
  28600. return;
  28601. }
  28602. if (auth.clientId && auth.clientSecret) {
  28603. return;
  28604. }
  28605. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28606. }
  28607. /***/ }),
  28608. /***/ 955:
  28609. /***/ (function(module, __unusedexports, __webpack_require__) {
  28610. "use strict";
  28611. const path = __webpack_require__(622);
  28612. const childProcess = __webpack_require__(129);
  28613. const crossSpawn = __webpack_require__(20);
  28614. const stripEof = __webpack_require__(768);
  28615. const npmRunPath = __webpack_require__(621);
  28616. const isStream = __webpack_require__(323);
  28617. const _getStream = __webpack_require__(145);
  28618. const pFinally = __webpack_require__(697);
  28619. const onExit = __webpack_require__(260);
  28620. const errname = __webpack_require__(427);
  28621. const stdio = __webpack_require__(168);
  28622. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28623. function handleArgs(cmd, args, opts) {
  28624. let parsed;
  28625. opts = Object.assign({
  28626. extendEnv: true,
  28627. env: {}
  28628. }, opts);
  28629. if (opts.extendEnv) {
  28630. opts.env = Object.assign({}, process.env, opts.env);
  28631. }
  28632. if (opts.__winShell === true) {
  28633. delete opts.__winShell;
  28634. parsed = {
  28635. command: cmd,
  28636. args,
  28637. options: opts,
  28638. file: cmd,
  28639. original: {
  28640. cmd,
  28641. args
  28642. }
  28643. };
  28644. } else {
  28645. parsed = crossSpawn._parse(cmd, args, opts);
  28646. }
  28647. opts = Object.assign({
  28648. maxBuffer: TEN_MEGABYTES,
  28649. buffer: true,
  28650. stripEof: true,
  28651. preferLocal: true,
  28652. localDir: parsed.options.cwd || process.cwd(),
  28653. encoding: 'utf8',
  28654. reject: true,
  28655. cleanup: true
  28656. }, parsed.options);
  28657. opts.stdio = stdio(opts);
  28658. if (opts.preferLocal) {
  28659. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28660. }
  28661. if (opts.detached) {
  28662. // #115
  28663. opts.cleanup = false;
  28664. }
  28665. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28666. // #116
  28667. parsed.args.unshift('/q');
  28668. }
  28669. return {
  28670. cmd: parsed.command,
  28671. args: parsed.args,
  28672. opts,
  28673. parsed
  28674. };
  28675. }
  28676. function handleInput(spawned, input) {
  28677. if (input === null || input === undefined) {
  28678. return;
  28679. }
  28680. if (isStream(input)) {
  28681. input.pipe(spawned.stdin);
  28682. } else {
  28683. spawned.stdin.end(input);
  28684. }
  28685. }
  28686. function handleOutput(opts, val) {
  28687. if (val && opts.stripEof) {
  28688. val = stripEof(val);
  28689. }
  28690. return val;
  28691. }
  28692. function handleShell(fn, cmd, opts) {
  28693. let file = '/bin/sh';
  28694. let args = ['-c', cmd];
  28695. opts = Object.assign({}, opts);
  28696. if (process.platform === 'win32') {
  28697. opts.__winShell = true;
  28698. file = process.env.comspec || 'cmd.exe';
  28699. args = ['/s', '/c', `"${cmd}"`];
  28700. opts.windowsVerbatimArguments = true;
  28701. }
  28702. if (opts.shell) {
  28703. file = opts.shell;
  28704. delete opts.shell;
  28705. }
  28706. return fn(file, args, opts);
  28707. }
  28708. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28709. if (!process[stream]) {
  28710. return null;
  28711. }
  28712. let ret;
  28713. if (!buffer) {
  28714. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28715. ret = new Promise((resolve, reject) => {
  28716. process[stream]
  28717. .once('end', resolve)
  28718. .once('error', reject);
  28719. });
  28720. } else if (encoding) {
  28721. ret = _getStream(process[stream], {
  28722. encoding,
  28723. maxBuffer
  28724. });
  28725. } else {
  28726. ret = _getStream.buffer(process[stream], {maxBuffer});
  28727. }
  28728. return ret.catch(err => {
  28729. err.stream = stream;
  28730. err.message = `${stream} ${err.message}`;
  28731. throw err;
  28732. });
  28733. }
  28734. function makeError(result, options) {
  28735. const {stdout, stderr} = result;
  28736. let err = result.error;
  28737. const {code, signal} = result;
  28738. const {parsed, joinedCmd} = options;
  28739. const timedOut = options.timedOut || false;
  28740. if (!err) {
  28741. let output = '';
  28742. if (Array.isArray(parsed.opts.stdio)) {
  28743. if (parsed.opts.stdio[2] !== 'inherit') {
  28744. output += output.length > 0 ? stderr : `\n${stderr}`;
  28745. }
  28746. if (parsed.opts.stdio[1] !== 'inherit') {
  28747. output += `\n${stdout}`;
  28748. }
  28749. } else if (parsed.opts.stdio !== 'inherit') {
  28750. output = `\n${stderr}${stdout}`;
  28751. }
  28752. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28753. err.code = code < 0 ? errname(code) : code;
  28754. }
  28755. err.stdout = stdout;
  28756. err.stderr = stderr;
  28757. err.failed = true;
  28758. err.signal = signal || null;
  28759. err.cmd = joinedCmd;
  28760. err.timedOut = timedOut;
  28761. return err;
  28762. }
  28763. function joinCmd(cmd, args) {
  28764. let joinedCmd = cmd;
  28765. if (Array.isArray(args) && args.length > 0) {
  28766. joinedCmd += ' ' + args.join(' ');
  28767. }
  28768. return joinedCmd;
  28769. }
  28770. module.exports = (cmd, args, opts) => {
  28771. const parsed = handleArgs(cmd, args, opts);
  28772. const {encoding, buffer, maxBuffer} = parsed.opts;
  28773. const joinedCmd = joinCmd(cmd, args);
  28774. let spawned;
  28775. try {
  28776. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28777. } catch (err) {
  28778. return Promise.reject(err);
  28779. }
  28780. let removeExitHandler;
  28781. if (parsed.opts.cleanup) {
  28782. removeExitHandler = onExit(() => {
  28783. spawned.kill();
  28784. });
  28785. }
  28786. let timeoutId = null;
  28787. let timedOut = false;
  28788. const cleanup = () => {
  28789. if (timeoutId) {
  28790. clearTimeout(timeoutId);
  28791. timeoutId = null;
  28792. }
  28793. if (removeExitHandler) {
  28794. removeExitHandler();
  28795. }
  28796. };
  28797. if (parsed.opts.timeout > 0) {
  28798. timeoutId = setTimeout(() => {
  28799. timeoutId = null;
  28800. timedOut = true;
  28801. spawned.kill(parsed.opts.killSignal);
  28802. }, parsed.opts.timeout);
  28803. }
  28804. const processDone = new Promise(resolve => {
  28805. spawned.on('exit', (code, signal) => {
  28806. cleanup();
  28807. resolve({code, signal});
  28808. });
  28809. spawned.on('error', err => {
  28810. cleanup();
  28811. resolve({error: err});
  28812. });
  28813. if (spawned.stdin) {
  28814. spawned.stdin.on('error', err => {
  28815. cleanup();
  28816. resolve({error: err});
  28817. });
  28818. }
  28819. });
  28820. function destroy() {
  28821. if (spawned.stdout) {
  28822. spawned.stdout.destroy();
  28823. }
  28824. if (spawned.stderr) {
  28825. spawned.stderr.destroy();
  28826. }
  28827. }
  28828. const handlePromise = () => pFinally(Promise.all([
  28829. processDone,
  28830. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28831. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28832. ]).then(arr => {
  28833. const result = arr[0];
  28834. result.stdout = arr[1];
  28835. result.stderr = arr[2];
  28836. if (result.error || result.code !== 0 || result.signal !== null) {
  28837. const err = makeError(result, {
  28838. joinedCmd,
  28839. parsed,
  28840. timedOut
  28841. });
  28842. // TODO: missing some timeout logic for killed
  28843. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28844. // err.killed = spawned.killed || killed;
  28845. err.killed = err.killed || spawned.killed;
  28846. if (!parsed.opts.reject) {
  28847. return err;
  28848. }
  28849. throw err;
  28850. }
  28851. return {
  28852. stdout: handleOutput(parsed.opts, result.stdout),
  28853. stderr: handleOutput(parsed.opts, result.stderr),
  28854. code: 0,
  28855. failed: false,
  28856. killed: false,
  28857. signal: null,
  28858. cmd: joinedCmd,
  28859. timedOut: false
  28860. };
  28861. }), destroy);
  28862. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28863. handleInput(spawned, parsed.opts.input);
  28864. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28865. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28866. return spawned;
  28867. };
  28868. // TODO: set `stderr: 'ignore'` when that option is implemented
  28869. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28870. // TODO: set `stdout: 'ignore'` when that option is implemented
  28871. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28872. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28873. module.exports.sync = (cmd, args, opts) => {
  28874. const parsed = handleArgs(cmd, args, opts);
  28875. const joinedCmd = joinCmd(cmd, args);
  28876. if (isStream(parsed.opts.input)) {
  28877. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28878. }
  28879. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28880. result.code = result.status;
  28881. if (result.error || result.status !== 0 || result.signal !== null) {
  28882. const err = makeError(result, {
  28883. joinedCmd,
  28884. parsed
  28885. });
  28886. if (!parsed.opts.reject) {
  28887. return err;
  28888. }
  28889. throw err;
  28890. }
  28891. return {
  28892. stdout: handleOutput(parsed.opts, result.stdout),
  28893. stderr: handleOutput(parsed.opts, result.stderr),
  28894. code: 0,
  28895. failed: false,
  28896. signal: null,
  28897. cmd: joinedCmd,
  28898. timedOut: false
  28899. };
  28900. };
  28901. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28902. /***/ }),
  28903. /***/ 966:
  28904. /***/ (function(module, __unusedexports, __webpack_require__) {
  28905. "use strict";
  28906. const {PassThrough} = __webpack_require__(413);
  28907. module.exports = options => {
  28908. options = Object.assign({}, options);
  28909. const {array} = options;
  28910. let {encoding} = options;
  28911. const buffer = encoding === 'buffer';
  28912. let objectMode = false;
  28913. if (array) {
  28914. objectMode = !(encoding || buffer);
  28915. } else {
  28916. encoding = encoding || 'utf8';
  28917. }
  28918. if (buffer) {
  28919. encoding = null;
  28920. }
  28921. let len = 0;
  28922. const ret = [];
  28923. const stream = new PassThrough({objectMode});
  28924. if (encoding) {
  28925. stream.setEncoding(encoding);
  28926. }
  28927. stream.on('data', chunk => {
  28928. ret.push(chunk);
  28929. if (objectMode) {
  28930. len = ret.length;
  28931. } else {
  28932. len += chunk.length;
  28933. }
  28934. });
  28935. stream.getBufferedValue = () => {
  28936. if (array) {
  28937. return ret;
  28938. }
  28939. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28940. };
  28941. stream.getBufferedLength = () => len;
  28942. return stream;
  28943. };
  28944. /***/ }),
  28945. /***/ 969:
  28946. /***/ (function(module, __unusedexports, __webpack_require__) {
  28947. var wrappy = __webpack_require__(11)
  28948. module.exports = wrappy(once)
  28949. module.exports.strict = wrappy(onceStrict)
  28950. once.proto = once(function () {
  28951. Object.defineProperty(Function.prototype, 'once', {
  28952. value: function () {
  28953. return once(this)
  28954. },
  28955. configurable: true
  28956. })
  28957. Object.defineProperty(Function.prototype, 'onceStrict', {
  28958. value: function () {
  28959. return onceStrict(this)
  28960. },
  28961. configurable: true
  28962. })
  28963. })
  28964. function once (fn) {
  28965. var f = function () {
  28966. if (f.called) return f.value
  28967. f.called = true
  28968. return f.value = fn.apply(this, arguments)
  28969. }
  28970. f.called = false
  28971. return f
  28972. }
  28973. function onceStrict (fn) {
  28974. var f = function () {
  28975. if (f.called)
  28976. throw new Error(f.onceError)
  28977. f.called = true
  28978. return f.value = fn.apply(this, arguments)
  28979. }
  28980. var name = fn.name || 'Function wrapped with `once`'
  28981. f.onceError = name + " shouldn't be called more than once"
  28982. f.called = false
  28983. return f
  28984. }
  28985. /***/ }),
  28986. /***/ 986:
  28987. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28988. "use strict";
  28989. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28990. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28991. return new (P || (P = Promise))(function (resolve, reject) {
  28992. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28993. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28994. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28995. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28996. });
  28997. };
  28998. Object.defineProperty(exports, "__esModule", { value: true });
  28999. const tr = __webpack_require__(9);
  29000. /**
  29001. * Exec a command.
  29002. * Output will be streamed to the live console.
  29003. * Returns promise with return code
  29004. *
  29005. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  29006. * @param args optional arguments for tool. Escaping is handled by the lib.
  29007. * @param options optional exec options. See ExecOptions
  29008. * @returns Promise<number> exit code
  29009. */
  29010. function exec(commandLine, args, options) {
  29011. return __awaiter(this, void 0, void 0, function* () {
  29012. const commandArgs = tr.argStringToArray(commandLine);
  29013. if (commandArgs.length === 0) {
  29014. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  29015. }
  29016. // Path to tool to execute should be first arg
  29017. const toolPath = commandArgs[0];
  29018. args = commandArgs.slice(1).concat(args || []);
  29019. const runner = new tr.ToolRunner(toolPath, args, options);
  29020. return runner.exec();
  29021. });
  29022. }
  29023. exports.exec = exec;
  29024. //# sourceMappingURL=exec.js.map
  29025. /***/ }),
  29026. /***/ 991:
  29027. /***/ (function(module, __unusedexports, __webpack_require__) {
  29028. module.exports = authenticationRequestError;
  29029. const { RequestError } = __webpack_require__(497);
  29030. function authenticationRequestError(state, error, options) {
  29031. if (!error.headers) throw error;
  29032. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  29033. // handle "2FA required" error only
  29034. if (error.status !== 401 || !otpRequired) {
  29035. throw error;
  29036. }
  29037. if (
  29038. error.status === 401 &&
  29039. otpRequired &&
  29040. error.request &&
  29041. error.request.headers["x-github-otp"]
  29042. ) {
  29043. if (state.otp) {
  29044. delete state.otp; // no longer valid, request again
  29045. } else {
  29046. throw new RequestError(
  29047. "Invalid one-time password for two-factor authentication",
  29048. 401,
  29049. {
  29050. headers: error.headers,
  29051. request: options
  29052. }
  29053. );
  29054. }
  29055. }
  29056. if (typeof state.auth.on2fa !== "function") {
  29057. throw new RequestError(
  29058. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  29059. 401,
  29060. {
  29061. headers: error.headers,
  29062. request: options
  29063. }
  29064. );
  29065. }
  29066. return Promise.resolve()
  29067. .then(() => {
  29068. return state.auth.on2fa();
  29069. })
  29070. .then(oneTimePassword => {
  29071. const newOptions = Object.assign(options, {
  29072. headers: Object.assign(options.headers, {
  29073. "x-github-otp": oneTimePassword
  29074. })
  29075. });
  29076. return state.octokit.request(newOptions).then(response => {
  29077. // If OTP still valid, then persist it for following requests
  29078. state.otp = oneTimePassword;
  29079. return response;
  29080. });
  29081. });
  29082. }
  29083. /***/ })
  29084. /******/ });