index.js 811 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ var threw = true;
  23. /******/ try {
  24. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  25. /******/ threw = false;
  26. /******/ } finally {
  27. /******/ if(threw) delete installedModules[moduleId];
  28. /******/ }
  29. /******/
  30. /******/ // Flag the module as loaded
  31. /******/ module.l = true;
  32. /******/
  33. /******/ // Return the exports of the module
  34. /******/ return module.exports;
  35. /******/ }
  36. /******/
  37. /******/
  38. /******/ __webpack_require__.ab = __dirname + "/";
  39. /******/
  40. /******/ // the startup function
  41. /******/ function startup() {
  42. /******/ // Load entry module and return exports
  43. /******/ return __webpack_require__(109);
  44. /******/ };
  45. /******/
  46. /******/ // run startup
  47. /******/ return startup();
  48. /******/ })
  49. /************************************************************************/
  50. /******/ ({
  51. /***/ 1:
  52. /***/ (function(module, __unusedexports, __webpack_require__) {
  53. module.exports = isexe
  54. isexe.sync = sync
  55. var fs = __webpack_require__(747)
  56. function checkPathExt (path, options) {
  57. var pathext = options.pathExt !== undefined ?
  58. options.pathExt : process.env.PATHEXT
  59. if (!pathext) {
  60. return true
  61. }
  62. pathext = pathext.split(';')
  63. if (pathext.indexOf('') !== -1) {
  64. return true
  65. }
  66. for (var i = 0; i < pathext.length; i++) {
  67. var p = pathext[i].toLowerCase()
  68. if (p && path.substr(-p.length).toLowerCase() === p) {
  69. return true
  70. }
  71. }
  72. return false
  73. }
  74. function checkStat (stat, path, options) {
  75. if (!stat.isSymbolicLink() && !stat.isFile()) {
  76. return false
  77. }
  78. return checkPathExt(path, options)
  79. }
  80. function isexe (path, options, cb) {
  81. fs.stat(path, function (er, stat) {
  82. cb(er, er ? false : checkStat(stat, path, options))
  83. })
  84. }
  85. function sync (path, options) {
  86. return checkStat(fs.statSync(path), path, options)
  87. }
  88. /***/ }),
  89. /***/ 16:
  90. /***/ (function(module) {
  91. module.exports = require("tls");
  92. /***/ }),
  93. /***/ 30:
  94. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  95. "use strict";
  96. Object.defineProperty(exports, '__esModule', { value: true });
  97. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  98. var osName = _interopDefault(__webpack_require__(760));
  99. function getUserAgent() {
  100. try {
  101. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  102. } catch (error) {
  103. if (/wmic os get Caption/.test(error.message)) {
  104. return "Windows <version undetectable>";
  105. }
  106. throw error;
  107. }
  108. }
  109. exports.getUserAgent = getUserAgent;
  110. //# sourceMappingURL=index.js.map
  111. /***/ }),
  112. /***/ 32:
  113. /***/ (function(module, __unusedexports, __webpack_require__) {
  114. "use strict";
  115. var shebangRegex = __webpack_require__(638);
  116. module.exports = function (str) {
  117. var match = str.match(shebangRegex);
  118. if (!match) {
  119. return null;
  120. }
  121. var arr = match[0].replace(/#! ?/, '').split(' ');
  122. var bin = arr[0].split('/').pop();
  123. var arg = arr[1];
  124. return (bin === 'env' ?
  125. arg :
  126. bin + (arg ? ' ' + arg : '')
  127. );
  128. };
  129. /***/ }),
  130. /***/ 44:
  131. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  132. "use strict";
  133. Object.defineProperty(exports, '__esModule', { value: true });
  134. var deprecation = __webpack_require__(932);
  135. var endpointsByScope = {
  136. actions: {
  137. cancelWorkflowRun: {
  138. method: "POST",
  139. params: {
  140. owner: {
  141. required: true,
  142. type: "string"
  143. },
  144. repo: {
  145. required: true,
  146. type: "string"
  147. },
  148. run_id: {
  149. required: true,
  150. type: "integer"
  151. }
  152. },
  153. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  154. },
  155. createOrUpdateSecretForRepo: {
  156. method: "PUT",
  157. params: {
  158. encrypted_value: {
  159. type: "string"
  160. },
  161. key_id: {
  162. type: "string"
  163. },
  164. name: {
  165. required: true,
  166. type: "string"
  167. },
  168. owner: {
  169. required: true,
  170. type: "string"
  171. },
  172. repo: {
  173. required: true,
  174. type: "string"
  175. }
  176. },
  177. url: "/repos/:owner/:repo/actions/secrets/:name"
  178. },
  179. createRegistrationToken: {
  180. method: "POST",
  181. params: {
  182. owner: {
  183. required: true,
  184. type: "string"
  185. },
  186. repo: {
  187. required: true,
  188. type: "string"
  189. }
  190. },
  191. url: "/repos/:owner/:repo/actions/runners/registration-token"
  192. },
  193. createRemoveToken: {
  194. method: "POST",
  195. params: {
  196. owner: {
  197. required: true,
  198. type: "string"
  199. },
  200. repo: {
  201. required: true,
  202. type: "string"
  203. }
  204. },
  205. url: "/repos/:owner/:repo/actions/runners/remove-token"
  206. },
  207. deleteArtifact: {
  208. method: "DELETE",
  209. params: {
  210. artifact_id: {
  211. required: true,
  212. type: "integer"
  213. },
  214. owner: {
  215. required: true,
  216. type: "string"
  217. },
  218. repo: {
  219. required: true,
  220. type: "string"
  221. }
  222. },
  223. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  224. },
  225. deleteSecretFromRepo: {
  226. method: "DELETE",
  227. params: {
  228. name: {
  229. required: true,
  230. type: "string"
  231. },
  232. owner: {
  233. required: true,
  234. type: "string"
  235. },
  236. repo: {
  237. required: true,
  238. type: "string"
  239. }
  240. },
  241. url: "/repos/:owner/:repo/actions/secrets/:name"
  242. },
  243. downloadArtifact: {
  244. method: "GET",
  245. params: {
  246. archive_format: {
  247. required: true,
  248. type: "string"
  249. },
  250. artifact_id: {
  251. required: true,
  252. type: "integer"
  253. },
  254. owner: {
  255. required: true,
  256. type: "string"
  257. },
  258. repo: {
  259. required: true,
  260. type: "string"
  261. }
  262. },
  263. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  264. },
  265. getArtifact: {
  266. method: "GET",
  267. params: {
  268. artifact_id: {
  269. required: true,
  270. type: "integer"
  271. },
  272. owner: {
  273. required: true,
  274. type: "string"
  275. },
  276. repo: {
  277. required: true,
  278. type: "string"
  279. }
  280. },
  281. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  282. },
  283. getPublicKey: {
  284. method: "GET",
  285. params: {
  286. owner: {
  287. required: true,
  288. type: "string"
  289. },
  290. repo: {
  291. required: true,
  292. type: "string"
  293. }
  294. },
  295. url: "/repos/:owner/:repo/actions/secrets/public-key"
  296. },
  297. getSecret: {
  298. method: "GET",
  299. params: {
  300. name: {
  301. required: true,
  302. type: "string"
  303. },
  304. owner: {
  305. required: true,
  306. type: "string"
  307. },
  308. page: {
  309. type: "integer"
  310. },
  311. per_page: {
  312. type: "integer"
  313. },
  314. repo: {
  315. required: true,
  316. type: "string"
  317. }
  318. },
  319. url: "/repos/:owner/:repo/actions/secrets/:name"
  320. },
  321. getSelfHostedRunner: {
  322. method: "GET",
  323. params: {
  324. owner: {
  325. required: true,
  326. type: "string"
  327. },
  328. repo: {
  329. required: true,
  330. type: "string"
  331. },
  332. runner_id: {
  333. required: true,
  334. type: "integer"
  335. }
  336. },
  337. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  338. },
  339. getWorkflow: {
  340. method: "GET",
  341. params: {
  342. owner: {
  343. required: true,
  344. type: "string"
  345. },
  346. repo: {
  347. required: true,
  348. type: "string"
  349. },
  350. workflow_id: {
  351. required: true,
  352. type: "integer"
  353. }
  354. },
  355. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  356. },
  357. getWorkflowJob: {
  358. method: "GET",
  359. params: {
  360. job_id: {
  361. required: true,
  362. type: "integer"
  363. },
  364. owner: {
  365. required: true,
  366. type: "string"
  367. },
  368. repo: {
  369. required: true,
  370. type: "string"
  371. }
  372. },
  373. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  374. },
  375. getWorkflowRun: {
  376. method: "GET",
  377. params: {
  378. owner: {
  379. required: true,
  380. type: "string"
  381. },
  382. repo: {
  383. required: true,
  384. type: "string"
  385. },
  386. run_id: {
  387. required: true,
  388. type: "integer"
  389. }
  390. },
  391. url: "/repos/:owner/:repo/actions/runs/:run_id"
  392. },
  393. listDownloadsForSelfHostedRunnerApplication: {
  394. method: "GET",
  395. params: {
  396. owner: {
  397. required: true,
  398. type: "string"
  399. },
  400. repo: {
  401. required: true,
  402. type: "string"
  403. }
  404. },
  405. url: "/repos/:owner/:repo/actions/runners/downloads"
  406. },
  407. listJobsForWorkflowRun: {
  408. method: "GET",
  409. params: {
  410. owner: {
  411. required: true,
  412. type: "string"
  413. },
  414. page: {
  415. type: "integer"
  416. },
  417. per_page: {
  418. type: "integer"
  419. },
  420. repo: {
  421. required: true,
  422. type: "string"
  423. },
  424. run_id: {
  425. required: true,
  426. type: "integer"
  427. }
  428. },
  429. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  430. },
  431. listRepoWorkflowRuns: {
  432. method: "GET",
  433. params: {
  434. actor: {
  435. type: "string"
  436. },
  437. branch: {
  438. type: "string"
  439. },
  440. event: {
  441. type: "string"
  442. },
  443. owner: {
  444. required: true,
  445. type: "string"
  446. },
  447. page: {
  448. type: "integer"
  449. },
  450. per_page: {
  451. type: "integer"
  452. },
  453. repo: {
  454. required: true,
  455. type: "string"
  456. },
  457. status: {
  458. enum: ["completed", "status", "conclusion"],
  459. type: "string"
  460. }
  461. },
  462. url: "/repos/:owner/:repo/actions/runs"
  463. },
  464. listRepoWorkflows: {
  465. method: "GET",
  466. params: {
  467. owner: {
  468. required: true,
  469. type: "string"
  470. },
  471. page: {
  472. type: "integer"
  473. },
  474. per_page: {
  475. type: "integer"
  476. },
  477. repo: {
  478. required: true,
  479. type: "string"
  480. }
  481. },
  482. url: "/repos/:owner/:repo/actions/workflows"
  483. },
  484. listSecretsForRepo: {
  485. method: "GET",
  486. params: {
  487. owner: {
  488. required: true,
  489. type: "string"
  490. },
  491. page: {
  492. type: "integer"
  493. },
  494. per_page: {
  495. type: "integer"
  496. },
  497. repo: {
  498. required: true,
  499. type: "string"
  500. }
  501. },
  502. url: "/repos/:owner/:repo/actions/secrets"
  503. },
  504. listSelfHostedRunnersForRepo: {
  505. method: "GET",
  506. params: {
  507. owner: {
  508. required: true,
  509. type: "string"
  510. },
  511. page: {
  512. type: "integer"
  513. },
  514. per_page: {
  515. type: "integer"
  516. },
  517. repo: {
  518. required: true,
  519. type: "string"
  520. }
  521. },
  522. url: "/repos/:owner/:repo/actions/runners"
  523. },
  524. listWorkflowJobLogs: {
  525. method: "GET",
  526. params: {
  527. job_id: {
  528. required: true,
  529. type: "integer"
  530. },
  531. owner: {
  532. required: true,
  533. type: "string"
  534. },
  535. page: {
  536. type: "integer"
  537. },
  538. per_page: {
  539. type: "integer"
  540. },
  541. repo: {
  542. required: true,
  543. type: "string"
  544. }
  545. },
  546. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  547. },
  548. listWorkflowRunArtifacts: {
  549. method: "GET",
  550. params: {
  551. owner: {
  552. required: true,
  553. type: "string"
  554. },
  555. page: {
  556. type: "integer"
  557. },
  558. per_page: {
  559. type: "integer"
  560. },
  561. repo: {
  562. required: true,
  563. type: "string"
  564. },
  565. run_id: {
  566. required: true,
  567. type: "integer"
  568. }
  569. },
  570. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  571. },
  572. listWorkflowRunLogs: {
  573. method: "GET",
  574. params: {
  575. owner: {
  576. required: true,
  577. type: "string"
  578. },
  579. page: {
  580. type: "integer"
  581. },
  582. per_page: {
  583. type: "integer"
  584. },
  585. repo: {
  586. required: true,
  587. type: "string"
  588. },
  589. run_id: {
  590. required: true,
  591. type: "integer"
  592. }
  593. },
  594. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  595. },
  596. listWorkflowRuns: {
  597. method: "GET",
  598. params: {
  599. actor: {
  600. type: "string"
  601. },
  602. branch: {
  603. type: "string"
  604. },
  605. event: {
  606. type: "string"
  607. },
  608. owner: {
  609. required: true,
  610. type: "string"
  611. },
  612. page: {
  613. type: "integer"
  614. },
  615. per_page: {
  616. type: "integer"
  617. },
  618. repo: {
  619. required: true,
  620. type: "string"
  621. },
  622. status: {
  623. enum: ["completed", "status", "conclusion"],
  624. type: "string"
  625. },
  626. workflow_id: {
  627. required: true,
  628. type: "integer"
  629. }
  630. },
  631. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  632. },
  633. reRunWorkflow: {
  634. method: "POST",
  635. params: {
  636. owner: {
  637. required: true,
  638. type: "string"
  639. },
  640. repo: {
  641. required: true,
  642. type: "string"
  643. },
  644. run_id: {
  645. required: true,
  646. type: "integer"
  647. }
  648. },
  649. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  650. },
  651. removeSelfHostedRunner: {
  652. method: "DELETE",
  653. params: {
  654. owner: {
  655. required: true,
  656. type: "string"
  657. },
  658. repo: {
  659. required: true,
  660. type: "string"
  661. },
  662. runner_id: {
  663. required: true,
  664. type: "integer"
  665. }
  666. },
  667. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  668. }
  669. },
  670. activity: {
  671. checkStarringRepo: {
  672. method: "GET",
  673. params: {
  674. owner: {
  675. required: true,
  676. type: "string"
  677. },
  678. repo: {
  679. required: true,
  680. type: "string"
  681. }
  682. },
  683. url: "/user/starred/:owner/:repo"
  684. },
  685. deleteRepoSubscription: {
  686. method: "DELETE",
  687. params: {
  688. owner: {
  689. required: true,
  690. type: "string"
  691. },
  692. repo: {
  693. required: true,
  694. type: "string"
  695. }
  696. },
  697. url: "/repos/:owner/:repo/subscription"
  698. },
  699. deleteThreadSubscription: {
  700. method: "DELETE",
  701. params: {
  702. thread_id: {
  703. required: true,
  704. type: "integer"
  705. }
  706. },
  707. url: "/notifications/threads/:thread_id/subscription"
  708. },
  709. getRepoSubscription: {
  710. method: "GET",
  711. params: {
  712. owner: {
  713. required: true,
  714. type: "string"
  715. },
  716. repo: {
  717. required: true,
  718. type: "string"
  719. }
  720. },
  721. url: "/repos/:owner/:repo/subscription"
  722. },
  723. getThread: {
  724. method: "GET",
  725. params: {
  726. thread_id: {
  727. required: true,
  728. type: "integer"
  729. }
  730. },
  731. url: "/notifications/threads/:thread_id"
  732. },
  733. getThreadSubscription: {
  734. method: "GET",
  735. params: {
  736. thread_id: {
  737. required: true,
  738. type: "integer"
  739. }
  740. },
  741. url: "/notifications/threads/:thread_id/subscription"
  742. },
  743. listEventsForOrg: {
  744. method: "GET",
  745. params: {
  746. org: {
  747. required: true,
  748. type: "string"
  749. },
  750. page: {
  751. type: "integer"
  752. },
  753. per_page: {
  754. type: "integer"
  755. },
  756. username: {
  757. required: true,
  758. type: "string"
  759. }
  760. },
  761. url: "/users/:username/events/orgs/:org"
  762. },
  763. listEventsForUser: {
  764. method: "GET",
  765. params: {
  766. page: {
  767. type: "integer"
  768. },
  769. per_page: {
  770. type: "integer"
  771. },
  772. username: {
  773. required: true,
  774. type: "string"
  775. }
  776. },
  777. url: "/users/:username/events"
  778. },
  779. listFeeds: {
  780. method: "GET",
  781. params: {},
  782. url: "/feeds"
  783. },
  784. listNotifications: {
  785. method: "GET",
  786. params: {
  787. all: {
  788. type: "boolean"
  789. },
  790. before: {
  791. type: "string"
  792. },
  793. page: {
  794. type: "integer"
  795. },
  796. participating: {
  797. type: "boolean"
  798. },
  799. per_page: {
  800. type: "integer"
  801. },
  802. since: {
  803. type: "string"
  804. }
  805. },
  806. url: "/notifications"
  807. },
  808. listNotificationsForRepo: {
  809. method: "GET",
  810. params: {
  811. all: {
  812. type: "boolean"
  813. },
  814. before: {
  815. type: "string"
  816. },
  817. owner: {
  818. required: true,
  819. type: "string"
  820. },
  821. page: {
  822. type: "integer"
  823. },
  824. participating: {
  825. type: "boolean"
  826. },
  827. per_page: {
  828. type: "integer"
  829. },
  830. repo: {
  831. required: true,
  832. type: "string"
  833. },
  834. since: {
  835. type: "string"
  836. }
  837. },
  838. url: "/repos/:owner/:repo/notifications"
  839. },
  840. listPublicEvents: {
  841. method: "GET",
  842. params: {
  843. page: {
  844. type: "integer"
  845. },
  846. per_page: {
  847. type: "integer"
  848. }
  849. },
  850. url: "/events"
  851. },
  852. listPublicEventsForOrg: {
  853. method: "GET",
  854. params: {
  855. org: {
  856. required: true,
  857. type: "string"
  858. },
  859. page: {
  860. type: "integer"
  861. },
  862. per_page: {
  863. type: "integer"
  864. }
  865. },
  866. url: "/orgs/:org/events"
  867. },
  868. listPublicEventsForRepoNetwork: {
  869. method: "GET",
  870. params: {
  871. owner: {
  872. required: true,
  873. type: "string"
  874. },
  875. page: {
  876. type: "integer"
  877. },
  878. per_page: {
  879. type: "integer"
  880. },
  881. repo: {
  882. required: true,
  883. type: "string"
  884. }
  885. },
  886. url: "/networks/:owner/:repo/events"
  887. },
  888. listPublicEventsForUser: {
  889. method: "GET",
  890. params: {
  891. page: {
  892. type: "integer"
  893. },
  894. per_page: {
  895. type: "integer"
  896. },
  897. username: {
  898. required: true,
  899. type: "string"
  900. }
  901. },
  902. url: "/users/:username/events/public"
  903. },
  904. listReceivedEventsForUser: {
  905. method: "GET",
  906. params: {
  907. page: {
  908. type: "integer"
  909. },
  910. per_page: {
  911. type: "integer"
  912. },
  913. username: {
  914. required: true,
  915. type: "string"
  916. }
  917. },
  918. url: "/users/:username/received_events"
  919. },
  920. listReceivedPublicEventsForUser: {
  921. method: "GET",
  922. params: {
  923. page: {
  924. type: "integer"
  925. },
  926. per_page: {
  927. type: "integer"
  928. },
  929. username: {
  930. required: true,
  931. type: "string"
  932. }
  933. },
  934. url: "/users/:username/received_events/public"
  935. },
  936. listRepoEvents: {
  937. method: "GET",
  938. params: {
  939. owner: {
  940. required: true,
  941. type: "string"
  942. },
  943. page: {
  944. type: "integer"
  945. },
  946. per_page: {
  947. type: "integer"
  948. },
  949. repo: {
  950. required: true,
  951. type: "string"
  952. }
  953. },
  954. url: "/repos/:owner/:repo/events"
  955. },
  956. listReposStarredByAuthenticatedUser: {
  957. method: "GET",
  958. params: {
  959. direction: {
  960. enum: ["asc", "desc"],
  961. type: "string"
  962. },
  963. page: {
  964. type: "integer"
  965. },
  966. per_page: {
  967. type: "integer"
  968. },
  969. sort: {
  970. enum: ["created", "updated"],
  971. type: "string"
  972. }
  973. },
  974. url: "/user/starred"
  975. },
  976. listReposStarredByUser: {
  977. method: "GET",
  978. params: {
  979. direction: {
  980. enum: ["asc", "desc"],
  981. type: "string"
  982. },
  983. page: {
  984. type: "integer"
  985. },
  986. per_page: {
  987. type: "integer"
  988. },
  989. sort: {
  990. enum: ["created", "updated"],
  991. type: "string"
  992. },
  993. username: {
  994. required: true,
  995. type: "string"
  996. }
  997. },
  998. url: "/users/:username/starred"
  999. },
  1000. listReposWatchedByUser: {
  1001. method: "GET",
  1002. params: {
  1003. page: {
  1004. type: "integer"
  1005. },
  1006. per_page: {
  1007. type: "integer"
  1008. },
  1009. username: {
  1010. required: true,
  1011. type: "string"
  1012. }
  1013. },
  1014. url: "/users/:username/subscriptions"
  1015. },
  1016. listStargazersForRepo: {
  1017. method: "GET",
  1018. params: {
  1019. owner: {
  1020. required: true,
  1021. type: "string"
  1022. },
  1023. page: {
  1024. type: "integer"
  1025. },
  1026. per_page: {
  1027. type: "integer"
  1028. },
  1029. repo: {
  1030. required: true,
  1031. type: "string"
  1032. }
  1033. },
  1034. url: "/repos/:owner/:repo/stargazers"
  1035. },
  1036. listWatchedReposForAuthenticatedUser: {
  1037. method: "GET",
  1038. params: {
  1039. page: {
  1040. type: "integer"
  1041. },
  1042. per_page: {
  1043. type: "integer"
  1044. }
  1045. },
  1046. url: "/user/subscriptions"
  1047. },
  1048. listWatchersForRepo: {
  1049. method: "GET",
  1050. params: {
  1051. owner: {
  1052. required: true,
  1053. type: "string"
  1054. },
  1055. page: {
  1056. type: "integer"
  1057. },
  1058. per_page: {
  1059. type: "integer"
  1060. },
  1061. repo: {
  1062. required: true,
  1063. type: "string"
  1064. }
  1065. },
  1066. url: "/repos/:owner/:repo/subscribers"
  1067. },
  1068. markAsRead: {
  1069. method: "PUT",
  1070. params: {
  1071. last_read_at: {
  1072. type: "string"
  1073. }
  1074. },
  1075. url: "/notifications"
  1076. },
  1077. markNotificationsAsReadForRepo: {
  1078. method: "PUT",
  1079. params: {
  1080. last_read_at: {
  1081. type: "string"
  1082. },
  1083. owner: {
  1084. required: true,
  1085. type: "string"
  1086. },
  1087. repo: {
  1088. required: true,
  1089. type: "string"
  1090. }
  1091. },
  1092. url: "/repos/:owner/:repo/notifications"
  1093. },
  1094. markThreadAsRead: {
  1095. method: "PATCH",
  1096. params: {
  1097. thread_id: {
  1098. required: true,
  1099. type: "integer"
  1100. }
  1101. },
  1102. url: "/notifications/threads/:thread_id"
  1103. },
  1104. setRepoSubscription: {
  1105. method: "PUT",
  1106. params: {
  1107. ignored: {
  1108. type: "boolean"
  1109. },
  1110. owner: {
  1111. required: true,
  1112. type: "string"
  1113. },
  1114. repo: {
  1115. required: true,
  1116. type: "string"
  1117. },
  1118. subscribed: {
  1119. type: "boolean"
  1120. }
  1121. },
  1122. url: "/repos/:owner/:repo/subscription"
  1123. },
  1124. setThreadSubscription: {
  1125. method: "PUT",
  1126. params: {
  1127. ignored: {
  1128. type: "boolean"
  1129. },
  1130. thread_id: {
  1131. required: true,
  1132. type: "integer"
  1133. }
  1134. },
  1135. url: "/notifications/threads/:thread_id/subscription"
  1136. },
  1137. starRepo: {
  1138. method: "PUT",
  1139. params: {
  1140. owner: {
  1141. required: true,
  1142. type: "string"
  1143. },
  1144. repo: {
  1145. required: true,
  1146. type: "string"
  1147. }
  1148. },
  1149. url: "/user/starred/:owner/:repo"
  1150. },
  1151. unstarRepo: {
  1152. method: "DELETE",
  1153. params: {
  1154. owner: {
  1155. required: true,
  1156. type: "string"
  1157. },
  1158. repo: {
  1159. required: true,
  1160. type: "string"
  1161. }
  1162. },
  1163. url: "/user/starred/:owner/:repo"
  1164. }
  1165. },
  1166. apps: {
  1167. addRepoToInstallation: {
  1168. headers: {
  1169. accept: "application/vnd.github.machine-man-preview+json"
  1170. },
  1171. method: "PUT",
  1172. params: {
  1173. installation_id: {
  1174. required: true,
  1175. type: "integer"
  1176. },
  1177. repository_id: {
  1178. required: true,
  1179. type: "integer"
  1180. }
  1181. },
  1182. url: "/user/installations/:installation_id/repositories/:repository_id"
  1183. },
  1184. checkAccountIsAssociatedWithAny: {
  1185. method: "GET",
  1186. params: {
  1187. account_id: {
  1188. required: true,
  1189. type: "integer"
  1190. }
  1191. },
  1192. url: "/marketplace_listing/accounts/:account_id"
  1193. },
  1194. checkAccountIsAssociatedWithAnyStubbed: {
  1195. method: "GET",
  1196. params: {
  1197. account_id: {
  1198. required: true,
  1199. type: "integer"
  1200. }
  1201. },
  1202. url: "/marketplace_listing/stubbed/accounts/:account_id"
  1203. },
  1204. checkAuthorization: {
  1205. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  1206. method: "GET",
  1207. params: {
  1208. access_token: {
  1209. required: true,
  1210. type: "string"
  1211. },
  1212. client_id: {
  1213. required: true,
  1214. type: "string"
  1215. }
  1216. },
  1217. url: "/applications/:client_id/tokens/:access_token"
  1218. },
  1219. checkToken: {
  1220. headers: {
  1221. accept: "application/vnd.github.doctor-strange-preview+json"
  1222. },
  1223. method: "POST",
  1224. params: {
  1225. access_token: {
  1226. type: "string"
  1227. },
  1228. client_id: {
  1229. required: true,
  1230. type: "string"
  1231. }
  1232. },
  1233. url: "/applications/:client_id/token"
  1234. },
  1235. createContentAttachment: {
  1236. headers: {
  1237. accept: "application/vnd.github.corsair-preview+json"
  1238. },
  1239. method: "POST",
  1240. params: {
  1241. body: {
  1242. required: true,
  1243. type: "string"
  1244. },
  1245. content_reference_id: {
  1246. required: true,
  1247. type: "integer"
  1248. },
  1249. title: {
  1250. required: true,
  1251. type: "string"
  1252. }
  1253. },
  1254. url: "/content_references/:content_reference_id/attachments"
  1255. },
  1256. createFromManifest: {
  1257. headers: {
  1258. accept: "application/vnd.github.fury-preview+json"
  1259. },
  1260. method: "POST",
  1261. params: {
  1262. code: {
  1263. required: true,
  1264. type: "string"
  1265. }
  1266. },
  1267. url: "/app-manifests/:code/conversions"
  1268. },
  1269. createInstallationToken: {
  1270. headers: {
  1271. accept: "application/vnd.github.machine-man-preview+json"
  1272. },
  1273. method: "POST",
  1274. params: {
  1275. installation_id: {
  1276. required: true,
  1277. type: "integer"
  1278. },
  1279. permissions: {
  1280. type: "object"
  1281. },
  1282. repository_ids: {
  1283. type: "integer[]"
  1284. }
  1285. },
  1286. url: "/app/installations/:installation_id/access_tokens"
  1287. },
  1288. deleteAuthorization: {
  1289. headers: {
  1290. accept: "application/vnd.github.doctor-strange-preview+json"
  1291. },
  1292. method: "DELETE",
  1293. params: {
  1294. access_token: {
  1295. type: "string"
  1296. },
  1297. client_id: {
  1298. required: true,
  1299. type: "string"
  1300. }
  1301. },
  1302. url: "/applications/:client_id/grant"
  1303. },
  1304. deleteInstallation: {
  1305. headers: {
  1306. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  1307. },
  1308. method: "DELETE",
  1309. params: {
  1310. installation_id: {
  1311. required: true,
  1312. type: "integer"
  1313. }
  1314. },
  1315. url: "/app/installations/:installation_id"
  1316. },
  1317. deleteToken: {
  1318. headers: {
  1319. accept: "application/vnd.github.doctor-strange-preview+json"
  1320. },
  1321. method: "DELETE",
  1322. params: {
  1323. access_token: {
  1324. type: "string"
  1325. },
  1326. client_id: {
  1327. required: true,
  1328. type: "string"
  1329. }
  1330. },
  1331. url: "/applications/:client_id/token"
  1332. },
  1333. findOrgInstallation: {
  1334. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  1335. headers: {
  1336. accept: "application/vnd.github.machine-man-preview+json"
  1337. },
  1338. method: "GET",
  1339. params: {
  1340. org: {
  1341. required: true,
  1342. type: "string"
  1343. }
  1344. },
  1345. url: "/orgs/:org/installation"
  1346. },
  1347. findRepoInstallation: {
  1348. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  1349. headers: {
  1350. accept: "application/vnd.github.machine-man-preview+json"
  1351. },
  1352. method: "GET",
  1353. params: {
  1354. owner: {
  1355. required: true,
  1356. type: "string"
  1357. },
  1358. repo: {
  1359. required: true,
  1360. type: "string"
  1361. }
  1362. },
  1363. url: "/repos/:owner/:repo/installation"
  1364. },
  1365. findUserInstallation: {
  1366. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  1367. headers: {
  1368. accept: "application/vnd.github.machine-man-preview+json"
  1369. },
  1370. method: "GET",
  1371. params: {
  1372. username: {
  1373. required: true,
  1374. type: "string"
  1375. }
  1376. },
  1377. url: "/users/:username/installation"
  1378. },
  1379. getAuthenticated: {
  1380. headers: {
  1381. accept: "application/vnd.github.machine-man-preview+json"
  1382. },
  1383. method: "GET",
  1384. params: {},
  1385. url: "/app"
  1386. },
  1387. getBySlug: {
  1388. headers: {
  1389. accept: "application/vnd.github.machine-man-preview+json"
  1390. },
  1391. method: "GET",
  1392. params: {
  1393. app_slug: {
  1394. required: true,
  1395. type: "string"
  1396. }
  1397. },
  1398. url: "/apps/:app_slug"
  1399. },
  1400. getInstallation: {
  1401. headers: {
  1402. accept: "application/vnd.github.machine-man-preview+json"
  1403. },
  1404. method: "GET",
  1405. params: {
  1406. installation_id: {
  1407. required: true,
  1408. type: "integer"
  1409. }
  1410. },
  1411. url: "/app/installations/:installation_id"
  1412. },
  1413. getOrgInstallation: {
  1414. headers: {
  1415. accept: "application/vnd.github.machine-man-preview+json"
  1416. },
  1417. method: "GET",
  1418. params: {
  1419. org: {
  1420. required: true,
  1421. type: "string"
  1422. }
  1423. },
  1424. url: "/orgs/:org/installation"
  1425. },
  1426. getRepoInstallation: {
  1427. headers: {
  1428. accept: "application/vnd.github.machine-man-preview+json"
  1429. },
  1430. method: "GET",
  1431. params: {
  1432. owner: {
  1433. required: true,
  1434. type: "string"
  1435. },
  1436. repo: {
  1437. required: true,
  1438. type: "string"
  1439. }
  1440. },
  1441. url: "/repos/:owner/:repo/installation"
  1442. },
  1443. getUserInstallation: {
  1444. headers: {
  1445. accept: "application/vnd.github.machine-man-preview+json"
  1446. },
  1447. method: "GET",
  1448. params: {
  1449. username: {
  1450. required: true,
  1451. type: "string"
  1452. }
  1453. },
  1454. url: "/users/:username/installation"
  1455. },
  1456. listAccountsUserOrOrgOnPlan: {
  1457. method: "GET",
  1458. params: {
  1459. direction: {
  1460. enum: ["asc", "desc"],
  1461. type: "string"
  1462. },
  1463. page: {
  1464. type: "integer"
  1465. },
  1466. per_page: {
  1467. type: "integer"
  1468. },
  1469. plan_id: {
  1470. required: true,
  1471. type: "integer"
  1472. },
  1473. sort: {
  1474. enum: ["created", "updated"],
  1475. type: "string"
  1476. }
  1477. },
  1478. url: "/marketplace_listing/plans/:plan_id/accounts"
  1479. },
  1480. listAccountsUserOrOrgOnPlanStubbed: {
  1481. method: "GET",
  1482. params: {
  1483. direction: {
  1484. enum: ["asc", "desc"],
  1485. type: "string"
  1486. },
  1487. page: {
  1488. type: "integer"
  1489. },
  1490. per_page: {
  1491. type: "integer"
  1492. },
  1493. plan_id: {
  1494. required: true,
  1495. type: "integer"
  1496. },
  1497. sort: {
  1498. enum: ["created", "updated"],
  1499. type: "string"
  1500. }
  1501. },
  1502. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  1503. },
  1504. listInstallationReposForAuthenticatedUser: {
  1505. headers: {
  1506. accept: "application/vnd.github.machine-man-preview+json"
  1507. },
  1508. method: "GET",
  1509. params: {
  1510. installation_id: {
  1511. required: true,
  1512. type: "integer"
  1513. },
  1514. page: {
  1515. type: "integer"
  1516. },
  1517. per_page: {
  1518. type: "integer"
  1519. }
  1520. },
  1521. url: "/user/installations/:installation_id/repositories"
  1522. },
  1523. listInstallations: {
  1524. headers: {
  1525. accept: "application/vnd.github.machine-man-preview+json"
  1526. },
  1527. method: "GET",
  1528. params: {
  1529. page: {
  1530. type: "integer"
  1531. },
  1532. per_page: {
  1533. type: "integer"
  1534. }
  1535. },
  1536. url: "/app/installations"
  1537. },
  1538. listInstallationsForAuthenticatedUser: {
  1539. headers: {
  1540. accept: "application/vnd.github.machine-man-preview+json"
  1541. },
  1542. method: "GET",
  1543. params: {
  1544. page: {
  1545. type: "integer"
  1546. },
  1547. per_page: {
  1548. type: "integer"
  1549. }
  1550. },
  1551. url: "/user/installations"
  1552. },
  1553. listMarketplacePurchasesForAuthenticatedUser: {
  1554. method: "GET",
  1555. params: {
  1556. page: {
  1557. type: "integer"
  1558. },
  1559. per_page: {
  1560. type: "integer"
  1561. }
  1562. },
  1563. url: "/user/marketplace_purchases"
  1564. },
  1565. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  1566. method: "GET",
  1567. params: {
  1568. page: {
  1569. type: "integer"
  1570. },
  1571. per_page: {
  1572. type: "integer"
  1573. }
  1574. },
  1575. url: "/user/marketplace_purchases/stubbed"
  1576. },
  1577. listPlans: {
  1578. method: "GET",
  1579. params: {
  1580. page: {
  1581. type: "integer"
  1582. },
  1583. per_page: {
  1584. type: "integer"
  1585. }
  1586. },
  1587. url: "/marketplace_listing/plans"
  1588. },
  1589. listPlansStubbed: {
  1590. method: "GET",
  1591. params: {
  1592. page: {
  1593. type: "integer"
  1594. },
  1595. per_page: {
  1596. type: "integer"
  1597. }
  1598. },
  1599. url: "/marketplace_listing/stubbed/plans"
  1600. },
  1601. listRepos: {
  1602. headers: {
  1603. accept: "application/vnd.github.machine-man-preview+json"
  1604. },
  1605. method: "GET",
  1606. params: {
  1607. page: {
  1608. type: "integer"
  1609. },
  1610. per_page: {
  1611. type: "integer"
  1612. }
  1613. },
  1614. url: "/installation/repositories"
  1615. },
  1616. removeRepoFromInstallation: {
  1617. headers: {
  1618. accept: "application/vnd.github.machine-man-preview+json"
  1619. },
  1620. method: "DELETE",
  1621. params: {
  1622. installation_id: {
  1623. required: true,
  1624. type: "integer"
  1625. },
  1626. repository_id: {
  1627. required: true,
  1628. type: "integer"
  1629. }
  1630. },
  1631. url: "/user/installations/:installation_id/repositories/:repository_id"
  1632. },
  1633. resetAuthorization: {
  1634. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  1635. method: "POST",
  1636. params: {
  1637. access_token: {
  1638. required: true,
  1639. type: "string"
  1640. },
  1641. client_id: {
  1642. required: true,
  1643. type: "string"
  1644. }
  1645. },
  1646. url: "/applications/:client_id/tokens/:access_token"
  1647. },
  1648. resetToken: {
  1649. headers: {
  1650. accept: "application/vnd.github.doctor-strange-preview+json"
  1651. },
  1652. method: "PATCH",
  1653. params: {
  1654. access_token: {
  1655. type: "string"
  1656. },
  1657. client_id: {
  1658. required: true,
  1659. type: "string"
  1660. }
  1661. },
  1662. url: "/applications/:client_id/token"
  1663. },
  1664. revokeAuthorizationForApplication: {
  1665. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  1666. method: "DELETE",
  1667. params: {
  1668. access_token: {
  1669. required: true,
  1670. type: "string"
  1671. },
  1672. client_id: {
  1673. required: true,
  1674. type: "string"
  1675. }
  1676. },
  1677. url: "/applications/:client_id/tokens/:access_token"
  1678. },
  1679. revokeGrantForApplication: {
  1680. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  1681. method: "DELETE",
  1682. params: {
  1683. access_token: {
  1684. required: true,
  1685. type: "string"
  1686. },
  1687. client_id: {
  1688. required: true,
  1689. type: "string"
  1690. }
  1691. },
  1692. url: "/applications/:client_id/grants/:access_token"
  1693. },
  1694. revokeInstallationToken: {
  1695. headers: {
  1696. accept: "application/vnd.github.gambit-preview+json"
  1697. },
  1698. method: "DELETE",
  1699. params: {},
  1700. url: "/installation/token"
  1701. }
  1702. },
  1703. checks: {
  1704. create: {
  1705. headers: {
  1706. accept: "application/vnd.github.antiope-preview+json"
  1707. },
  1708. method: "POST",
  1709. params: {
  1710. actions: {
  1711. type: "object[]"
  1712. },
  1713. "actions[].description": {
  1714. required: true,
  1715. type: "string"
  1716. },
  1717. "actions[].identifier": {
  1718. required: true,
  1719. type: "string"
  1720. },
  1721. "actions[].label": {
  1722. required: true,
  1723. type: "string"
  1724. },
  1725. completed_at: {
  1726. type: "string"
  1727. },
  1728. conclusion: {
  1729. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  1730. type: "string"
  1731. },
  1732. details_url: {
  1733. type: "string"
  1734. },
  1735. external_id: {
  1736. type: "string"
  1737. },
  1738. head_sha: {
  1739. required: true,
  1740. type: "string"
  1741. },
  1742. name: {
  1743. required: true,
  1744. type: "string"
  1745. },
  1746. output: {
  1747. type: "object"
  1748. },
  1749. "output.annotations": {
  1750. type: "object[]"
  1751. },
  1752. "output.annotations[].annotation_level": {
  1753. enum: ["notice", "warning", "failure"],
  1754. required: true,
  1755. type: "string"
  1756. },
  1757. "output.annotations[].end_column": {
  1758. type: "integer"
  1759. },
  1760. "output.annotations[].end_line": {
  1761. required: true,
  1762. type: "integer"
  1763. },
  1764. "output.annotations[].message": {
  1765. required: true,
  1766. type: "string"
  1767. },
  1768. "output.annotations[].path": {
  1769. required: true,
  1770. type: "string"
  1771. },
  1772. "output.annotations[].raw_details": {
  1773. type: "string"
  1774. },
  1775. "output.annotations[].start_column": {
  1776. type: "integer"
  1777. },
  1778. "output.annotations[].start_line": {
  1779. required: true,
  1780. type: "integer"
  1781. },
  1782. "output.annotations[].title": {
  1783. type: "string"
  1784. },
  1785. "output.images": {
  1786. type: "object[]"
  1787. },
  1788. "output.images[].alt": {
  1789. required: true,
  1790. type: "string"
  1791. },
  1792. "output.images[].caption": {
  1793. type: "string"
  1794. },
  1795. "output.images[].image_url": {
  1796. required: true,
  1797. type: "string"
  1798. },
  1799. "output.summary": {
  1800. required: true,
  1801. type: "string"
  1802. },
  1803. "output.text": {
  1804. type: "string"
  1805. },
  1806. "output.title": {
  1807. required: true,
  1808. type: "string"
  1809. },
  1810. owner: {
  1811. required: true,
  1812. type: "string"
  1813. },
  1814. repo: {
  1815. required: true,
  1816. type: "string"
  1817. },
  1818. started_at: {
  1819. type: "string"
  1820. },
  1821. status: {
  1822. enum: ["queued", "in_progress", "completed"],
  1823. type: "string"
  1824. }
  1825. },
  1826. url: "/repos/:owner/:repo/check-runs"
  1827. },
  1828. createSuite: {
  1829. headers: {
  1830. accept: "application/vnd.github.antiope-preview+json"
  1831. },
  1832. method: "POST",
  1833. params: {
  1834. head_sha: {
  1835. required: true,
  1836. type: "string"
  1837. },
  1838. owner: {
  1839. required: true,
  1840. type: "string"
  1841. },
  1842. repo: {
  1843. required: true,
  1844. type: "string"
  1845. }
  1846. },
  1847. url: "/repos/:owner/:repo/check-suites"
  1848. },
  1849. get: {
  1850. headers: {
  1851. accept: "application/vnd.github.antiope-preview+json"
  1852. },
  1853. method: "GET",
  1854. params: {
  1855. check_run_id: {
  1856. required: true,
  1857. type: "integer"
  1858. },
  1859. owner: {
  1860. required: true,
  1861. type: "string"
  1862. },
  1863. repo: {
  1864. required: true,
  1865. type: "string"
  1866. }
  1867. },
  1868. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  1869. },
  1870. getSuite: {
  1871. headers: {
  1872. accept: "application/vnd.github.antiope-preview+json"
  1873. },
  1874. method: "GET",
  1875. params: {
  1876. check_suite_id: {
  1877. required: true,
  1878. type: "integer"
  1879. },
  1880. owner: {
  1881. required: true,
  1882. type: "string"
  1883. },
  1884. repo: {
  1885. required: true,
  1886. type: "string"
  1887. }
  1888. },
  1889. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  1890. },
  1891. listAnnotations: {
  1892. headers: {
  1893. accept: "application/vnd.github.antiope-preview+json"
  1894. },
  1895. method: "GET",
  1896. params: {
  1897. check_run_id: {
  1898. required: true,
  1899. type: "integer"
  1900. },
  1901. owner: {
  1902. required: true,
  1903. type: "string"
  1904. },
  1905. page: {
  1906. type: "integer"
  1907. },
  1908. per_page: {
  1909. type: "integer"
  1910. },
  1911. repo: {
  1912. required: true,
  1913. type: "string"
  1914. }
  1915. },
  1916. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  1917. },
  1918. listForRef: {
  1919. headers: {
  1920. accept: "application/vnd.github.antiope-preview+json"
  1921. },
  1922. method: "GET",
  1923. params: {
  1924. check_name: {
  1925. type: "string"
  1926. },
  1927. filter: {
  1928. enum: ["latest", "all"],
  1929. type: "string"
  1930. },
  1931. owner: {
  1932. required: true,
  1933. type: "string"
  1934. },
  1935. page: {
  1936. type: "integer"
  1937. },
  1938. per_page: {
  1939. type: "integer"
  1940. },
  1941. ref: {
  1942. required: true,
  1943. type: "string"
  1944. },
  1945. repo: {
  1946. required: true,
  1947. type: "string"
  1948. },
  1949. status: {
  1950. enum: ["queued", "in_progress", "completed"],
  1951. type: "string"
  1952. }
  1953. },
  1954. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  1955. },
  1956. listForSuite: {
  1957. headers: {
  1958. accept: "application/vnd.github.antiope-preview+json"
  1959. },
  1960. method: "GET",
  1961. params: {
  1962. check_name: {
  1963. type: "string"
  1964. },
  1965. check_suite_id: {
  1966. required: true,
  1967. type: "integer"
  1968. },
  1969. filter: {
  1970. enum: ["latest", "all"],
  1971. type: "string"
  1972. },
  1973. owner: {
  1974. required: true,
  1975. type: "string"
  1976. },
  1977. page: {
  1978. type: "integer"
  1979. },
  1980. per_page: {
  1981. type: "integer"
  1982. },
  1983. repo: {
  1984. required: true,
  1985. type: "string"
  1986. },
  1987. status: {
  1988. enum: ["queued", "in_progress", "completed"],
  1989. type: "string"
  1990. }
  1991. },
  1992. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  1993. },
  1994. listSuitesForRef: {
  1995. headers: {
  1996. accept: "application/vnd.github.antiope-preview+json"
  1997. },
  1998. method: "GET",
  1999. params: {
  2000. app_id: {
  2001. type: "integer"
  2002. },
  2003. check_name: {
  2004. type: "string"
  2005. },
  2006. owner: {
  2007. required: true,
  2008. type: "string"
  2009. },
  2010. page: {
  2011. type: "integer"
  2012. },
  2013. per_page: {
  2014. type: "integer"
  2015. },
  2016. ref: {
  2017. required: true,
  2018. type: "string"
  2019. },
  2020. repo: {
  2021. required: true,
  2022. type: "string"
  2023. }
  2024. },
  2025. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  2026. },
  2027. rerequestSuite: {
  2028. headers: {
  2029. accept: "application/vnd.github.antiope-preview+json"
  2030. },
  2031. method: "POST",
  2032. params: {
  2033. check_suite_id: {
  2034. required: true,
  2035. type: "integer"
  2036. },
  2037. owner: {
  2038. required: true,
  2039. type: "string"
  2040. },
  2041. repo: {
  2042. required: true,
  2043. type: "string"
  2044. }
  2045. },
  2046. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  2047. },
  2048. setSuitesPreferences: {
  2049. headers: {
  2050. accept: "application/vnd.github.antiope-preview+json"
  2051. },
  2052. method: "PATCH",
  2053. params: {
  2054. auto_trigger_checks: {
  2055. type: "object[]"
  2056. },
  2057. "auto_trigger_checks[].app_id": {
  2058. required: true,
  2059. type: "integer"
  2060. },
  2061. "auto_trigger_checks[].setting": {
  2062. required: true,
  2063. type: "boolean"
  2064. },
  2065. owner: {
  2066. required: true,
  2067. type: "string"
  2068. },
  2069. repo: {
  2070. required: true,
  2071. type: "string"
  2072. }
  2073. },
  2074. url: "/repos/:owner/:repo/check-suites/preferences"
  2075. },
  2076. update: {
  2077. headers: {
  2078. accept: "application/vnd.github.antiope-preview+json"
  2079. },
  2080. method: "PATCH",
  2081. params: {
  2082. actions: {
  2083. type: "object[]"
  2084. },
  2085. "actions[].description": {
  2086. required: true,
  2087. type: "string"
  2088. },
  2089. "actions[].identifier": {
  2090. required: true,
  2091. type: "string"
  2092. },
  2093. "actions[].label": {
  2094. required: true,
  2095. type: "string"
  2096. },
  2097. check_run_id: {
  2098. required: true,
  2099. type: "integer"
  2100. },
  2101. completed_at: {
  2102. type: "string"
  2103. },
  2104. conclusion: {
  2105. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  2106. type: "string"
  2107. },
  2108. details_url: {
  2109. type: "string"
  2110. },
  2111. external_id: {
  2112. type: "string"
  2113. },
  2114. name: {
  2115. type: "string"
  2116. },
  2117. output: {
  2118. type: "object"
  2119. },
  2120. "output.annotations": {
  2121. type: "object[]"
  2122. },
  2123. "output.annotations[].annotation_level": {
  2124. enum: ["notice", "warning", "failure"],
  2125. required: true,
  2126. type: "string"
  2127. },
  2128. "output.annotations[].end_column": {
  2129. type: "integer"
  2130. },
  2131. "output.annotations[].end_line": {
  2132. required: true,
  2133. type: "integer"
  2134. },
  2135. "output.annotations[].message": {
  2136. required: true,
  2137. type: "string"
  2138. },
  2139. "output.annotations[].path": {
  2140. required: true,
  2141. type: "string"
  2142. },
  2143. "output.annotations[].raw_details": {
  2144. type: "string"
  2145. },
  2146. "output.annotations[].start_column": {
  2147. type: "integer"
  2148. },
  2149. "output.annotations[].start_line": {
  2150. required: true,
  2151. type: "integer"
  2152. },
  2153. "output.annotations[].title": {
  2154. type: "string"
  2155. },
  2156. "output.images": {
  2157. type: "object[]"
  2158. },
  2159. "output.images[].alt": {
  2160. required: true,
  2161. type: "string"
  2162. },
  2163. "output.images[].caption": {
  2164. type: "string"
  2165. },
  2166. "output.images[].image_url": {
  2167. required: true,
  2168. type: "string"
  2169. },
  2170. "output.summary": {
  2171. required: true,
  2172. type: "string"
  2173. },
  2174. "output.text": {
  2175. type: "string"
  2176. },
  2177. "output.title": {
  2178. type: "string"
  2179. },
  2180. owner: {
  2181. required: true,
  2182. type: "string"
  2183. },
  2184. repo: {
  2185. required: true,
  2186. type: "string"
  2187. },
  2188. started_at: {
  2189. type: "string"
  2190. },
  2191. status: {
  2192. enum: ["queued", "in_progress", "completed"],
  2193. type: "string"
  2194. }
  2195. },
  2196. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  2197. }
  2198. },
  2199. codesOfConduct: {
  2200. getConductCode: {
  2201. headers: {
  2202. accept: "application/vnd.github.scarlet-witch-preview+json"
  2203. },
  2204. method: "GET",
  2205. params: {
  2206. key: {
  2207. required: true,
  2208. type: "string"
  2209. }
  2210. },
  2211. url: "/codes_of_conduct/:key"
  2212. },
  2213. getForRepo: {
  2214. headers: {
  2215. accept: "application/vnd.github.scarlet-witch-preview+json"
  2216. },
  2217. method: "GET",
  2218. params: {
  2219. owner: {
  2220. required: true,
  2221. type: "string"
  2222. },
  2223. repo: {
  2224. required: true,
  2225. type: "string"
  2226. }
  2227. },
  2228. url: "/repos/:owner/:repo/community/code_of_conduct"
  2229. },
  2230. listConductCodes: {
  2231. headers: {
  2232. accept: "application/vnd.github.scarlet-witch-preview+json"
  2233. },
  2234. method: "GET",
  2235. params: {},
  2236. url: "/codes_of_conduct"
  2237. }
  2238. },
  2239. emojis: {
  2240. get: {
  2241. method: "GET",
  2242. params: {},
  2243. url: "/emojis"
  2244. }
  2245. },
  2246. gists: {
  2247. checkIsStarred: {
  2248. method: "GET",
  2249. params: {
  2250. gist_id: {
  2251. required: true,
  2252. type: "string"
  2253. }
  2254. },
  2255. url: "/gists/:gist_id/star"
  2256. },
  2257. create: {
  2258. method: "POST",
  2259. params: {
  2260. description: {
  2261. type: "string"
  2262. },
  2263. files: {
  2264. required: true,
  2265. type: "object"
  2266. },
  2267. "files.content": {
  2268. type: "string"
  2269. },
  2270. public: {
  2271. type: "boolean"
  2272. }
  2273. },
  2274. url: "/gists"
  2275. },
  2276. createComment: {
  2277. method: "POST",
  2278. params: {
  2279. body: {
  2280. required: true,
  2281. type: "string"
  2282. },
  2283. gist_id: {
  2284. required: true,
  2285. type: "string"
  2286. }
  2287. },
  2288. url: "/gists/:gist_id/comments"
  2289. },
  2290. delete: {
  2291. method: "DELETE",
  2292. params: {
  2293. gist_id: {
  2294. required: true,
  2295. type: "string"
  2296. }
  2297. },
  2298. url: "/gists/:gist_id"
  2299. },
  2300. deleteComment: {
  2301. method: "DELETE",
  2302. params: {
  2303. comment_id: {
  2304. required: true,
  2305. type: "integer"
  2306. },
  2307. gist_id: {
  2308. required: true,
  2309. type: "string"
  2310. }
  2311. },
  2312. url: "/gists/:gist_id/comments/:comment_id"
  2313. },
  2314. fork: {
  2315. method: "POST",
  2316. params: {
  2317. gist_id: {
  2318. required: true,
  2319. type: "string"
  2320. }
  2321. },
  2322. url: "/gists/:gist_id/forks"
  2323. },
  2324. get: {
  2325. method: "GET",
  2326. params: {
  2327. gist_id: {
  2328. required: true,
  2329. type: "string"
  2330. }
  2331. },
  2332. url: "/gists/:gist_id"
  2333. },
  2334. getComment: {
  2335. method: "GET",
  2336. params: {
  2337. comment_id: {
  2338. required: true,
  2339. type: "integer"
  2340. },
  2341. gist_id: {
  2342. required: true,
  2343. type: "string"
  2344. }
  2345. },
  2346. url: "/gists/:gist_id/comments/:comment_id"
  2347. },
  2348. getRevision: {
  2349. method: "GET",
  2350. params: {
  2351. gist_id: {
  2352. required: true,
  2353. type: "string"
  2354. },
  2355. sha: {
  2356. required: true,
  2357. type: "string"
  2358. }
  2359. },
  2360. url: "/gists/:gist_id/:sha"
  2361. },
  2362. list: {
  2363. method: "GET",
  2364. params: {
  2365. page: {
  2366. type: "integer"
  2367. },
  2368. per_page: {
  2369. type: "integer"
  2370. },
  2371. since: {
  2372. type: "string"
  2373. }
  2374. },
  2375. url: "/gists"
  2376. },
  2377. listComments: {
  2378. method: "GET",
  2379. params: {
  2380. gist_id: {
  2381. required: true,
  2382. type: "string"
  2383. },
  2384. page: {
  2385. type: "integer"
  2386. },
  2387. per_page: {
  2388. type: "integer"
  2389. }
  2390. },
  2391. url: "/gists/:gist_id/comments"
  2392. },
  2393. listCommits: {
  2394. method: "GET",
  2395. params: {
  2396. gist_id: {
  2397. required: true,
  2398. type: "string"
  2399. },
  2400. page: {
  2401. type: "integer"
  2402. },
  2403. per_page: {
  2404. type: "integer"
  2405. }
  2406. },
  2407. url: "/gists/:gist_id/commits"
  2408. },
  2409. listForks: {
  2410. method: "GET",
  2411. params: {
  2412. gist_id: {
  2413. required: true,
  2414. type: "string"
  2415. },
  2416. page: {
  2417. type: "integer"
  2418. },
  2419. per_page: {
  2420. type: "integer"
  2421. }
  2422. },
  2423. url: "/gists/:gist_id/forks"
  2424. },
  2425. listPublic: {
  2426. method: "GET",
  2427. params: {
  2428. page: {
  2429. type: "integer"
  2430. },
  2431. per_page: {
  2432. type: "integer"
  2433. },
  2434. since: {
  2435. type: "string"
  2436. }
  2437. },
  2438. url: "/gists/public"
  2439. },
  2440. listPublicForUser: {
  2441. method: "GET",
  2442. params: {
  2443. page: {
  2444. type: "integer"
  2445. },
  2446. per_page: {
  2447. type: "integer"
  2448. },
  2449. since: {
  2450. type: "string"
  2451. },
  2452. username: {
  2453. required: true,
  2454. type: "string"
  2455. }
  2456. },
  2457. url: "/users/:username/gists"
  2458. },
  2459. listStarred: {
  2460. method: "GET",
  2461. params: {
  2462. page: {
  2463. type: "integer"
  2464. },
  2465. per_page: {
  2466. type: "integer"
  2467. },
  2468. since: {
  2469. type: "string"
  2470. }
  2471. },
  2472. url: "/gists/starred"
  2473. },
  2474. star: {
  2475. method: "PUT",
  2476. params: {
  2477. gist_id: {
  2478. required: true,
  2479. type: "string"
  2480. }
  2481. },
  2482. url: "/gists/:gist_id/star"
  2483. },
  2484. unstar: {
  2485. method: "DELETE",
  2486. params: {
  2487. gist_id: {
  2488. required: true,
  2489. type: "string"
  2490. }
  2491. },
  2492. url: "/gists/:gist_id/star"
  2493. },
  2494. update: {
  2495. method: "PATCH",
  2496. params: {
  2497. description: {
  2498. type: "string"
  2499. },
  2500. files: {
  2501. type: "object"
  2502. },
  2503. "files.content": {
  2504. type: "string"
  2505. },
  2506. "files.filename": {
  2507. type: "string"
  2508. },
  2509. gist_id: {
  2510. required: true,
  2511. type: "string"
  2512. }
  2513. },
  2514. url: "/gists/:gist_id"
  2515. },
  2516. updateComment: {
  2517. method: "PATCH",
  2518. params: {
  2519. body: {
  2520. required: true,
  2521. type: "string"
  2522. },
  2523. comment_id: {
  2524. required: true,
  2525. type: "integer"
  2526. },
  2527. gist_id: {
  2528. required: true,
  2529. type: "string"
  2530. }
  2531. },
  2532. url: "/gists/:gist_id/comments/:comment_id"
  2533. }
  2534. },
  2535. git: {
  2536. createBlob: {
  2537. method: "POST",
  2538. params: {
  2539. content: {
  2540. required: true,
  2541. type: "string"
  2542. },
  2543. encoding: {
  2544. type: "string"
  2545. },
  2546. owner: {
  2547. required: true,
  2548. type: "string"
  2549. },
  2550. repo: {
  2551. required: true,
  2552. type: "string"
  2553. }
  2554. },
  2555. url: "/repos/:owner/:repo/git/blobs"
  2556. },
  2557. createCommit: {
  2558. method: "POST",
  2559. params: {
  2560. author: {
  2561. type: "object"
  2562. },
  2563. "author.date": {
  2564. type: "string"
  2565. },
  2566. "author.email": {
  2567. type: "string"
  2568. },
  2569. "author.name": {
  2570. type: "string"
  2571. },
  2572. committer: {
  2573. type: "object"
  2574. },
  2575. "committer.date": {
  2576. type: "string"
  2577. },
  2578. "committer.email": {
  2579. type: "string"
  2580. },
  2581. "committer.name": {
  2582. type: "string"
  2583. },
  2584. message: {
  2585. required: true,
  2586. type: "string"
  2587. },
  2588. owner: {
  2589. required: true,
  2590. type: "string"
  2591. },
  2592. parents: {
  2593. required: true,
  2594. type: "string[]"
  2595. },
  2596. repo: {
  2597. required: true,
  2598. type: "string"
  2599. },
  2600. signature: {
  2601. type: "string"
  2602. },
  2603. tree: {
  2604. required: true,
  2605. type: "string"
  2606. }
  2607. },
  2608. url: "/repos/:owner/:repo/git/commits"
  2609. },
  2610. createRef: {
  2611. method: "POST",
  2612. params: {
  2613. owner: {
  2614. required: true,
  2615. type: "string"
  2616. },
  2617. ref: {
  2618. required: true,
  2619. type: "string"
  2620. },
  2621. repo: {
  2622. required: true,
  2623. type: "string"
  2624. },
  2625. sha: {
  2626. required: true,
  2627. type: "string"
  2628. }
  2629. },
  2630. url: "/repos/:owner/:repo/git/refs"
  2631. },
  2632. createTag: {
  2633. method: "POST",
  2634. params: {
  2635. message: {
  2636. required: true,
  2637. type: "string"
  2638. },
  2639. object: {
  2640. required: true,
  2641. type: "string"
  2642. },
  2643. owner: {
  2644. required: true,
  2645. type: "string"
  2646. },
  2647. repo: {
  2648. required: true,
  2649. type: "string"
  2650. },
  2651. tag: {
  2652. required: true,
  2653. type: "string"
  2654. },
  2655. tagger: {
  2656. type: "object"
  2657. },
  2658. "tagger.date": {
  2659. type: "string"
  2660. },
  2661. "tagger.email": {
  2662. type: "string"
  2663. },
  2664. "tagger.name": {
  2665. type: "string"
  2666. },
  2667. type: {
  2668. enum: ["commit", "tree", "blob"],
  2669. required: true,
  2670. type: "string"
  2671. }
  2672. },
  2673. url: "/repos/:owner/:repo/git/tags"
  2674. },
  2675. createTree: {
  2676. method: "POST",
  2677. params: {
  2678. base_tree: {
  2679. type: "string"
  2680. },
  2681. owner: {
  2682. required: true,
  2683. type: "string"
  2684. },
  2685. repo: {
  2686. required: true,
  2687. type: "string"
  2688. },
  2689. tree: {
  2690. required: true,
  2691. type: "object[]"
  2692. },
  2693. "tree[].content": {
  2694. type: "string"
  2695. },
  2696. "tree[].mode": {
  2697. enum: ["100644", "100755", "040000", "160000", "120000"],
  2698. type: "string"
  2699. },
  2700. "tree[].path": {
  2701. type: "string"
  2702. },
  2703. "tree[].sha": {
  2704. allowNull: true,
  2705. type: "string"
  2706. },
  2707. "tree[].type": {
  2708. enum: ["blob", "tree", "commit"],
  2709. type: "string"
  2710. }
  2711. },
  2712. url: "/repos/:owner/:repo/git/trees"
  2713. },
  2714. deleteRef: {
  2715. method: "DELETE",
  2716. params: {
  2717. owner: {
  2718. required: true,
  2719. type: "string"
  2720. },
  2721. ref: {
  2722. required: true,
  2723. type: "string"
  2724. },
  2725. repo: {
  2726. required: true,
  2727. type: "string"
  2728. }
  2729. },
  2730. url: "/repos/:owner/:repo/git/refs/:ref"
  2731. },
  2732. getBlob: {
  2733. method: "GET",
  2734. params: {
  2735. file_sha: {
  2736. required: true,
  2737. type: "string"
  2738. },
  2739. owner: {
  2740. required: true,
  2741. type: "string"
  2742. },
  2743. repo: {
  2744. required: true,
  2745. type: "string"
  2746. }
  2747. },
  2748. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  2749. },
  2750. getCommit: {
  2751. method: "GET",
  2752. params: {
  2753. commit_sha: {
  2754. required: true,
  2755. type: "string"
  2756. },
  2757. owner: {
  2758. required: true,
  2759. type: "string"
  2760. },
  2761. repo: {
  2762. required: true,
  2763. type: "string"
  2764. }
  2765. },
  2766. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  2767. },
  2768. getRef: {
  2769. method: "GET",
  2770. params: {
  2771. owner: {
  2772. required: true,
  2773. type: "string"
  2774. },
  2775. ref: {
  2776. required: true,
  2777. type: "string"
  2778. },
  2779. repo: {
  2780. required: true,
  2781. type: "string"
  2782. }
  2783. },
  2784. url: "/repos/:owner/:repo/git/ref/:ref"
  2785. },
  2786. getTag: {
  2787. method: "GET",
  2788. params: {
  2789. owner: {
  2790. required: true,
  2791. type: "string"
  2792. },
  2793. repo: {
  2794. required: true,
  2795. type: "string"
  2796. },
  2797. tag_sha: {
  2798. required: true,
  2799. type: "string"
  2800. }
  2801. },
  2802. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  2803. },
  2804. getTree: {
  2805. method: "GET",
  2806. params: {
  2807. owner: {
  2808. required: true,
  2809. type: "string"
  2810. },
  2811. recursive: {
  2812. enum: ["1"],
  2813. type: "integer"
  2814. },
  2815. repo: {
  2816. required: true,
  2817. type: "string"
  2818. },
  2819. tree_sha: {
  2820. required: true,
  2821. type: "string"
  2822. }
  2823. },
  2824. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  2825. },
  2826. listMatchingRefs: {
  2827. method: "GET",
  2828. params: {
  2829. owner: {
  2830. required: true,
  2831. type: "string"
  2832. },
  2833. page: {
  2834. type: "integer"
  2835. },
  2836. per_page: {
  2837. type: "integer"
  2838. },
  2839. ref: {
  2840. required: true,
  2841. type: "string"
  2842. },
  2843. repo: {
  2844. required: true,
  2845. type: "string"
  2846. }
  2847. },
  2848. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  2849. },
  2850. listRefs: {
  2851. method: "GET",
  2852. params: {
  2853. namespace: {
  2854. type: "string"
  2855. },
  2856. owner: {
  2857. required: true,
  2858. type: "string"
  2859. },
  2860. page: {
  2861. type: "integer"
  2862. },
  2863. per_page: {
  2864. type: "integer"
  2865. },
  2866. repo: {
  2867. required: true,
  2868. type: "string"
  2869. }
  2870. },
  2871. url: "/repos/:owner/:repo/git/refs/:namespace"
  2872. },
  2873. updateRef: {
  2874. method: "PATCH",
  2875. params: {
  2876. force: {
  2877. type: "boolean"
  2878. },
  2879. owner: {
  2880. required: true,
  2881. type: "string"
  2882. },
  2883. ref: {
  2884. required: true,
  2885. type: "string"
  2886. },
  2887. repo: {
  2888. required: true,
  2889. type: "string"
  2890. },
  2891. sha: {
  2892. required: true,
  2893. type: "string"
  2894. }
  2895. },
  2896. url: "/repos/:owner/:repo/git/refs/:ref"
  2897. }
  2898. },
  2899. gitignore: {
  2900. getTemplate: {
  2901. method: "GET",
  2902. params: {
  2903. name: {
  2904. required: true,
  2905. type: "string"
  2906. }
  2907. },
  2908. url: "/gitignore/templates/:name"
  2909. },
  2910. listTemplates: {
  2911. method: "GET",
  2912. params: {},
  2913. url: "/gitignore/templates"
  2914. }
  2915. },
  2916. interactions: {
  2917. addOrUpdateRestrictionsForOrg: {
  2918. headers: {
  2919. accept: "application/vnd.github.sombra-preview+json"
  2920. },
  2921. method: "PUT",
  2922. params: {
  2923. limit: {
  2924. enum: ["existing_users", "contributors_only", "collaborators_only"],
  2925. required: true,
  2926. type: "string"
  2927. },
  2928. org: {
  2929. required: true,
  2930. type: "string"
  2931. }
  2932. },
  2933. url: "/orgs/:org/interaction-limits"
  2934. },
  2935. addOrUpdateRestrictionsForRepo: {
  2936. headers: {
  2937. accept: "application/vnd.github.sombra-preview+json"
  2938. },
  2939. method: "PUT",
  2940. params: {
  2941. limit: {
  2942. enum: ["existing_users", "contributors_only", "collaborators_only"],
  2943. required: true,
  2944. type: "string"
  2945. },
  2946. owner: {
  2947. required: true,
  2948. type: "string"
  2949. },
  2950. repo: {
  2951. required: true,
  2952. type: "string"
  2953. }
  2954. },
  2955. url: "/repos/:owner/:repo/interaction-limits"
  2956. },
  2957. getRestrictionsForOrg: {
  2958. headers: {
  2959. accept: "application/vnd.github.sombra-preview+json"
  2960. },
  2961. method: "GET",
  2962. params: {
  2963. org: {
  2964. required: true,
  2965. type: "string"
  2966. }
  2967. },
  2968. url: "/orgs/:org/interaction-limits"
  2969. },
  2970. getRestrictionsForRepo: {
  2971. headers: {
  2972. accept: "application/vnd.github.sombra-preview+json"
  2973. },
  2974. method: "GET",
  2975. params: {
  2976. owner: {
  2977. required: true,
  2978. type: "string"
  2979. },
  2980. repo: {
  2981. required: true,
  2982. type: "string"
  2983. }
  2984. },
  2985. url: "/repos/:owner/:repo/interaction-limits"
  2986. },
  2987. removeRestrictionsForOrg: {
  2988. headers: {
  2989. accept: "application/vnd.github.sombra-preview+json"
  2990. },
  2991. method: "DELETE",
  2992. params: {
  2993. org: {
  2994. required: true,
  2995. type: "string"
  2996. }
  2997. },
  2998. url: "/orgs/:org/interaction-limits"
  2999. },
  3000. removeRestrictionsForRepo: {
  3001. headers: {
  3002. accept: "application/vnd.github.sombra-preview+json"
  3003. },
  3004. method: "DELETE",
  3005. params: {
  3006. owner: {
  3007. required: true,
  3008. type: "string"
  3009. },
  3010. repo: {
  3011. required: true,
  3012. type: "string"
  3013. }
  3014. },
  3015. url: "/repos/:owner/:repo/interaction-limits"
  3016. }
  3017. },
  3018. issues: {
  3019. addAssignees: {
  3020. method: "POST",
  3021. params: {
  3022. assignees: {
  3023. type: "string[]"
  3024. },
  3025. issue_number: {
  3026. required: true,
  3027. type: "integer"
  3028. },
  3029. number: {
  3030. alias: "issue_number",
  3031. deprecated: true,
  3032. type: "integer"
  3033. },
  3034. owner: {
  3035. required: true,
  3036. type: "string"
  3037. },
  3038. repo: {
  3039. required: true,
  3040. type: "string"
  3041. }
  3042. },
  3043. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  3044. },
  3045. addLabels: {
  3046. method: "POST",
  3047. params: {
  3048. issue_number: {
  3049. required: true,
  3050. type: "integer"
  3051. },
  3052. labels: {
  3053. required: true,
  3054. type: "string[]"
  3055. },
  3056. number: {
  3057. alias: "issue_number",
  3058. deprecated: true,
  3059. type: "integer"
  3060. },
  3061. owner: {
  3062. required: true,
  3063. type: "string"
  3064. },
  3065. repo: {
  3066. required: true,
  3067. type: "string"
  3068. }
  3069. },
  3070. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  3071. },
  3072. checkAssignee: {
  3073. method: "GET",
  3074. params: {
  3075. assignee: {
  3076. required: true,
  3077. type: "string"
  3078. },
  3079. owner: {
  3080. required: true,
  3081. type: "string"
  3082. },
  3083. repo: {
  3084. required: true,
  3085. type: "string"
  3086. }
  3087. },
  3088. url: "/repos/:owner/:repo/assignees/:assignee"
  3089. },
  3090. create: {
  3091. method: "POST",
  3092. params: {
  3093. assignee: {
  3094. type: "string"
  3095. },
  3096. assignees: {
  3097. type: "string[]"
  3098. },
  3099. body: {
  3100. type: "string"
  3101. },
  3102. labels: {
  3103. type: "string[]"
  3104. },
  3105. milestone: {
  3106. type: "integer"
  3107. },
  3108. owner: {
  3109. required: true,
  3110. type: "string"
  3111. },
  3112. repo: {
  3113. required: true,
  3114. type: "string"
  3115. },
  3116. title: {
  3117. required: true,
  3118. type: "string"
  3119. }
  3120. },
  3121. url: "/repos/:owner/:repo/issues"
  3122. },
  3123. createComment: {
  3124. method: "POST",
  3125. params: {
  3126. body: {
  3127. required: true,
  3128. type: "string"
  3129. },
  3130. issue_number: {
  3131. required: true,
  3132. type: "integer"
  3133. },
  3134. number: {
  3135. alias: "issue_number",
  3136. deprecated: true,
  3137. type: "integer"
  3138. },
  3139. owner: {
  3140. required: true,
  3141. type: "string"
  3142. },
  3143. repo: {
  3144. required: true,
  3145. type: "string"
  3146. }
  3147. },
  3148. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  3149. },
  3150. createLabel: {
  3151. method: "POST",
  3152. params: {
  3153. color: {
  3154. required: true,
  3155. type: "string"
  3156. },
  3157. description: {
  3158. type: "string"
  3159. },
  3160. name: {
  3161. required: true,
  3162. type: "string"
  3163. },
  3164. owner: {
  3165. required: true,
  3166. type: "string"
  3167. },
  3168. repo: {
  3169. required: true,
  3170. type: "string"
  3171. }
  3172. },
  3173. url: "/repos/:owner/:repo/labels"
  3174. },
  3175. createMilestone: {
  3176. method: "POST",
  3177. params: {
  3178. description: {
  3179. type: "string"
  3180. },
  3181. due_on: {
  3182. type: "string"
  3183. },
  3184. owner: {
  3185. required: true,
  3186. type: "string"
  3187. },
  3188. repo: {
  3189. required: true,
  3190. type: "string"
  3191. },
  3192. state: {
  3193. enum: ["open", "closed"],
  3194. type: "string"
  3195. },
  3196. title: {
  3197. required: true,
  3198. type: "string"
  3199. }
  3200. },
  3201. url: "/repos/:owner/:repo/milestones"
  3202. },
  3203. deleteComment: {
  3204. method: "DELETE",
  3205. params: {
  3206. comment_id: {
  3207. required: true,
  3208. type: "integer"
  3209. },
  3210. owner: {
  3211. required: true,
  3212. type: "string"
  3213. },
  3214. repo: {
  3215. required: true,
  3216. type: "string"
  3217. }
  3218. },
  3219. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  3220. },
  3221. deleteLabel: {
  3222. method: "DELETE",
  3223. params: {
  3224. name: {
  3225. required: true,
  3226. type: "string"
  3227. },
  3228. owner: {
  3229. required: true,
  3230. type: "string"
  3231. },
  3232. repo: {
  3233. required: true,
  3234. type: "string"
  3235. }
  3236. },
  3237. url: "/repos/:owner/:repo/labels/:name"
  3238. },
  3239. deleteMilestone: {
  3240. method: "DELETE",
  3241. params: {
  3242. milestone_number: {
  3243. required: true,
  3244. type: "integer"
  3245. },
  3246. number: {
  3247. alias: "milestone_number",
  3248. deprecated: true,
  3249. type: "integer"
  3250. },
  3251. owner: {
  3252. required: true,
  3253. type: "string"
  3254. },
  3255. repo: {
  3256. required: true,
  3257. type: "string"
  3258. }
  3259. },
  3260. url: "/repos/:owner/:repo/milestones/:milestone_number"
  3261. },
  3262. get: {
  3263. method: "GET",
  3264. params: {
  3265. issue_number: {
  3266. required: true,
  3267. type: "integer"
  3268. },
  3269. number: {
  3270. alias: "issue_number",
  3271. deprecated: true,
  3272. type: "integer"
  3273. },
  3274. owner: {
  3275. required: true,
  3276. type: "string"
  3277. },
  3278. repo: {
  3279. required: true,
  3280. type: "string"
  3281. }
  3282. },
  3283. url: "/repos/:owner/:repo/issues/:issue_number"
  3284. },
  3285. getComment: {
  3286. method: "GET",
  3287. params: {
  3288. comment_id: {
  3289. required: true,
  3290. type: "integer"
  3291. },
  3292. owner: {
  3293. required: true,
  3294. type: "string"
  3295. },
  3296. repo: {
  3297. required: true,
  3298. type: "string"
  3299. }
  3300. },
  3301. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  3302. },
  3303. getEvent: {
  3304. method: "GET",
  3305. params: {
  3306. event_id: {
  3307. required: true,
  3308. type: "integer"
  3309. },
  3310. owner: {
  3311. required: true,
  3312. type: "string"
  3313. },
  3314. repo: {
  3315. required: true,
  3316. type: "string"
  3317. }
  3318. },
  3319. url: "/repos/:owner/:repo/issues/events/:event_id"
  3320. },
  3321. getLabel: {
  3322. method: "GET",
  3323. params: {
  3324. name: {
  3325. required: true,
  3326. type: "string"
  3327. },
  3328. owner: {
  3329. required: true,
  3330. type: "string"
  3331. },
  3332. repo: {
  3333. required: true,
  3334. type: "string"
  3335. }
  3336. },
  3337. url: "/repos/:owner/:repo/labels/:name"
  3338. },
  3339. getMilestone: {
  3340. method: "GET",
  3341. params: {
  3342. milestone_number: {
  3343. required: true,
  3344. type: "integer"
  3345. },
  3346. number: {
  3347. alias: "milestone_number",
  3348. deprecated: true,
  3349. type: "integer"
  3350. },
  3351. owner: {
  3352. required: true,
  3353. type: "string"
  3354. },
  3355. repo: {
  3356. required: true,
  3357. type: "string"
  3358. }
  3359. },
  3360. url: "/repos/:owner/:repo/milestones/:milestone_number"
  3361. },
  3362. list: {
  3363. method: "GET",
  3364. params: {
  3365. direction: {
  3366. enum: ["asc", "desc"],
  3367. type: "string"
  3368. },
  3369. filter: {
  3370. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  3371. type: "string"
  3372. },
  3373. labels: {
  3374. type: "string"
  3375. },
  3376. page: {
  3377. type: "integer"
  3378. },
  3379. per_page: {
  3380. type: "integer"
  3381. },
  3382. since: {
  3383. type: "string"
  3384. },
  3385. sort: {
  3386. enum: ["created", "updated", "comments"],
  3387. type: "string"
  3388. },
  3389. state: {
  3390. enum: ["open", "closed", "all"],
  3391. type: "string"
  3392. }
  3393. },
  3394. url: "/issues"
  3395. },
  3396. listAssignees: {
  3397. method: "GET",
  3398. params: {
  3399. owner: {
  3400. required: true,
  3401. type: "string"
  3402. },
  3403. page: {
  3404. type: "integer"
  3405. },
  3406. per_page: {
  3407. type: "integer"
  3408. },
  3409. repo: {
  3410. required: true,
  3411. type: "string"
  3412. }
  3413. },
  3414. url: "/repos/:owner/:repo/assignees"
  3415. },
  3416. listComments: {
  3417. method: "GET",
  3418. params: {
  3419. issue_number: {
  3420. required: true,
  3421. type: "integer"
  3422. },
  3423. number: {
  3424. alias: "issue_number",
  3425. deprecated: true,
  3426. type: "integer"
  3427. },
  3428. owner: {
  3429. required: true,
  3430. type: "string"
  3431. },
  3432. page: {
  3433. type: "integer"
  3434. },
  3435. per_page: {
  3436. type: "integer"
  3437. },
  3438. repo: {
  3439. required: true,
  3440. type: "string"
  3441. },
  3442. since: {
  3443. type: "string"
  3444. }
  3445. },
  3446. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  3447. },
  3448. listCommentsForRepo: {
  3449. method: "GET",
  3450. params: {
  3451. direction: {
  3452. enum: ["asc", "desc"],
  3453. type: "string"
  3454. },
  3455. owner: {
  3456. required: true,
  3457. type: "string"
  3458. },
  3459. repo: {
  3460. required: true,
  3461. type: "string"
  3462. },
  3463. since: {
  3464. type: "string"
  3465. },
  3466. sort: {
  3467. enum: ["created", "updated"],
  3468. type: "string"
  3469. }
  3470. },
  3471. url: "/repos/:owner/:repo/issues/comments"
  3472. },
  3473. listEvents: {
  3474. method: "GET",
  3475. params: {
  3476. issue_number: {
  3477. required: true,
  3478. type: "integer"
  3479. },
  3480. number: {
  3481. alias: "issue_number",
  3482. deprecated: true,
  3483. type: "integer"
  3484. },
  3485. owner: {
  3486. required: true,
  3487. type: "string"
  3488. },
  3489. page: {
  3490. type: "integer"
  3491. },
  3492. per_page: {
  3493. type: "integer"
  3494. },
  3495. repo: {
  3496. required: true,
  3497. type: "string"
  3498. }
  3499. },
  3500. url: "/repos/:owner/:repo/issues/:issue_number/events"
  3501. },
  3502. listEventsForRepo: {
  3503. method: "GET",
  3504. params: {
  3505. owner: {
  3506. required: true,
  3507. type: "string"
  3508. },
  3509. page: {
  3510. type: "integer"
  3511. },
  3512. per_page: {
  3513. type: "integer"
  3514. },
  3515. repo: {
  3516. required: true,
  3517. type: "string"
  3518. }
  3519. },
  3520. url: "/repos/:owner/:repo/issues/events"
  3521. },
  3522. listEventsForTimeline: {
  3523. headers: {
  3524. accept: "application/vnd.github.mockingbird-preview+json"
  3525. },
  3526. method: "GET",
  3527. params: {
  3528. issue_number: {
  3529. required: true,
  3530. type: "integer"
  3531. },
  3532. number: {
  3533. alias: "issue_number",
  3534. deprecated: true,
  3535. type: "integer"
  3536. },
  3537. owner: {
  3538. required: true,
  3539. type: "string"
  3540. },
  3541. page: {
  3542. type: "integer"
  3543. },
  3544. per_page: {
  3545. type: "integer"
  3546. },
  3547. repo: {
  3548. required: true,
  3549. type: "string"
  3550. }
  3551. },
  3552. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  3553. },
  3554. listForAuthenticatedUser: {
  3555. method: "GET",
  3556. params: {
  3557. direction: {
  3558. enum: ["asc", "desc"],
  3559. type: "string"
  3560. },
  3561. filter: {
  3562. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  3563. type: "string"
  3564. },
  3565. labels: {
  3566. type: "string"
  3567. },
  3568. page: {
  3569. type: "integer"
  3570. },
  3571. per_page: {
  3572. type: "integer"
  3573. },
  3574. since: {
  3575. type: "string"
  3576. },
  3577. sort: {
  3578. enum: ["created", "updated", "comments"],
  3579. type: "string"
  3580. },
  3581. state: {
  3582. enum: ["open", "closed", "all"],
  3583. type: "string"
  3584. }
  3585. },
  3586. url: "/user/issues"
  3587. },
  3588. listForOrg: {
  3589. method: "GET",
  3590. params: {
  3591. direction: {
  3592. enum: ["asc", "desc"],
  3593. type: "string"
  3594. },
  3595. filter: {
  3596. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  3597. type: "string"
  3598. },
  3599. labels: {
  3600. type: "string"
  3601. },
  3602. org: {
  3603. required: true,
  3604. type: "string"
  3605. },
  3606. page: {
  3607. type: "integer"
  3608. },
  3609. per_page: {
  3610. type: "integer"
  3611. },
  3612. since: {
  3613. type: "string"
  3614. },
  3615. sort: {
  3616. enum: ["created", "updated", "comments"],
  3617. type: "string"
  3618. },
  3619. state: {
  3620. enum: ["open", "closed", "all"],
  3621. type: "string"
  3622. }
  3623. },
  3624. url: "/orgs/:org/issues"
  3625. },
  3626. listForRepo: {
  3627. method: "GET",
  3628. params: {
  3629. assignee: {
  3630. type: "string"
  3631. },
  3632. creator: {
  3633. type: "string"
  3634. },
  3635. direction: {
  3636. enum: ["asc", "desc"],
  3637. type: "string"
  3638. },
  3639. labels: {
  3640. type: "string"
  3641. },
  3642. mentioned: {
  3643. type: "string"
  3644. },
  3645. milestone: {
  3646. type: "string"
  3647. },
  3648. owner: {
  3649. required: true,
  3650. type: "string"
  3651. },
  3652. page: {
  3653. type: "integer"
  3654. },
  3655. per_page: {
  3656. type: "integer"
  3657. },
  3658. repo: {
  3659. required: true,
  3660. type: "string"
  3661. },
  3662. since: {
  3663. type: "string"
  3664. },
  3665. sort: {
  3666. enum: ["created", "updated", "comments"],
  3667. type: "string"
  3668. },
  3669. state: {
  3670. enum: ["open", "closed", "all"],
  3671. type: "string"
  3672. }
  3673. },
  3674. url: "/repos/:owner/:repo/issues"
  3675. },
  3676. listLabelsForMilestone: {
  3677. method: "GET",
  3678. params: {
  3679. milestone_number: {
  3680. required: true,
  3681. type: "integer"
  3682. },
  3683. number: {
  3684. alias: "milestone_number",
  3685. deprecated: true,
  3686. type: "integer"
  3687. },
  3688. owner: {
  3689. required: true,
  3690. type: "string"
  3691. },
  3692. page: {
  3693. type: "integer"
  3694. },
  3695. per_page: {
  3696. type: "integer"
  3697. },
  3698. repo: {
  3699. required: true,
  3700. type: "string"
  3701. }
  3702. },
  3703. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  3704. },
  3705. listLabelsForRepo: {
  3706. method: "GET",
  3707. params: {
  3708. owner: {
  3709. required: true,
  3710. type: "string"
  3711. },
  3712. page: {
  3713. type: "integer"
  3714. },
  3715. per_page: {
  3716. type: "integer"
  3717. },
  3718. repo: {
  3719. required: true,
  3720. type: "string"
  3721. }
  3722. },
  3723. url: "/repos/:owner/:repo/labels"
  3724. },
  3725. listLabelsOnIssue: {
  3726. method: "GET",
  3727. params: {
  3728. issue_number: {
  3729. required: true,
  3730. type: "integer"
  3731. },
  3732. number: {
  3733. alias: "issue_number",
  3734. deprecated: true,
  3735. type: "integer"
  3736. },
  3737. owner: {
  3738. required: true,
  3739. type: "string"
  3740. },
  3741. page: {
  3742. type: "integer"
  3743. },
  3744. per_page: {
  3745. type: "integer"
  3746. },
  3747. repo: {
  3748. required: true,
  3749. type: "string"
  3750. }
  3751. },
  3752. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  3753. },
  3754. listMilestonesForRepo: {
  3755. method: "GET",
  3756. params: {
  3757. direction: {
  3758. enum: ["asc", "desc"],
  3759. type: "string"
  3760. },
  3761. owner: {
  3762. required: true,
  3763. type: "string"
  3764. },
  3765. page: {
  3766. type: "integer"
  3767. },
  3768. per_page: {
  3769. type: "integer"
  3770. },
  3771. repo: {
  3772. required: true,
  3773. type: "string"
  3774. },
  3775. sort: {
  3776. enum: ["due_on", "completeness"],
  3777. type: "string"
  3778. },
  3779. state: {
  3780. enum: ["open", "closed", "all"],
  3781. type: "string"
  3782. }
  3783. },
  3784. url: "/repos/:owner/:repo/milestones"
  3785. },
  3786. lock: {
  3787. method: "PUT",
  3788. params: {
  3789. issue_number: {
  3790. required: true,
  3791. type: "integer"
  3792. },
  3793. lock_reason: {
  3794. enum: ["off-topic", "too heated", "resolved", "spam"],
  3795. type: "string"
  3796. },
  3797. number: {
  3798. alias: "issue_number",
  3799. deprecated: true,
  3800. type: "integer"
  3801. },
  3802. owner: {
  3803. required: true,
  3804. type: "string"
  3805. },
  3806. repo: {
  3807. required: true,
  3808. type: "string"
  3809. }
  3810. },
  3811. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  3812. },
  3813. removeAssignees: {
  3814. method: "DELETE",
  3815. params: {
  3816. assignees: {
  3817. type: "string[]"
  3818. },
  3819. issue_number: {
  3820. required: true,
  3821. type: "integer"
  3822. },
  3823. number: {
  3824. alias: "issue_number",
  3825. deprecated: true,
  3826. type: "integer"
  3827. },
  3828. owner: {
  3829. required: true,
  3830. type: "string"
  3831. },
  3832. repo: {
  3833. required: true,
  3834. type: "string"
  3835. }
  3836. },
  3837. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  3838. },
  3839. removeLabel: {
  3840. method: "DELETE",
  3841. params: {
  3842. issue_number: {
  3843. required: true,
  3844. type: "integer"
  3845. },
  3846. name: {
  3847. required: true,
  3848. type: "string"
  3849. },
  3850. number: {
  3851. alias: "issue_number",
  3852. deprecated: true,
  3853. type: "integer"
  3854. },
  3855. owner: {
  3856. required: true,
  3857. type: "string"
  3858. },
  3859. repo: {
  3860. required: true,
  3861. type: "string"
  3862. }
  3863. },
  3864. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  3865. },
  3866. removeLabels: {
  3867. method: "DELETE",
  3868. params: {
  3869. issue_number: {
  3870. required: true,
  3871. type: "integer"
  3872. },
  3873. number: {
  3874. alias: "issue_number",
  3875. deprecated: true,
  3876. type: "integer"
  3877. },
  3878. owner: {
  3879. required: true,
  3880. type: "string"
  3881. },
  3882. repo: {
  3883. required: true,
  3884. type: "string"
  3885. }
  3886. },
  3887. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  3888. },
  3889. replaceLabels: {
  3890. method: "PUT",
  3891. params: {
  3892. issue_number: {
  3893. required: true,
  3894. type: "integer"
  3895. },
  3896. labels: {
  3897. type: "string[]"
  3898. },
  3899. number: {
  3900. alias: "issue_number",
  3901. deprecated: true,
  3902. type: "integer"
  3903. },
  3904. owner: {
  3905. required: true,
  3906. type: "string"
  3907. },
  3908. repo: {
  3909. required: true,
  3910. type: "string"
  3911. }
  3912. },
  3913. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  3914. },
  3915. unlock: {
  3916. method: "DELETE",
  3917. params: {
  3918. issue_number: {
  3919. required: true,
  3920. type: "integer"
  3921. },
  3922. number: {
  3923. alias: "issue_number",
  3924. deprecated: true,
  3925. type: "integer"
  3926. },
  3927. owner: {
  3928. required: true,
  3929. type: "string"
  3930. },
  3931. repo: {
  3932. required: true,
  3933. type: "string"
  3934. }
  3935. },
  3936. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  3937. },
  3938. update: {
  3939. method: "PATCH",
  3940. params: {
  3941. assignee: {
  3942. type: "string"
  3943. },
  3944. assignees: {
  3945. type: "string[]"
  3946. },
  3947. body: {
  3948. type: "string"
  3949. },
  3950. issue_number: {
  3951. required: true,
  3952. type: "integer"
  3953. },
  3954. labels: {
  3955. type: "string[]"
  3956. },
  3957. milestone: {
  3958. allowNull: true,
  3959. type: "integer"
  3960. },
  3961. number: {
  3962. alias: "issue_number",
  3963. deprecated: true,
  3964. type: "integer"
  3965. },
  3966. owner: {
  3967. required: true,
  3968. type: "string"
  3969. },
  3970. repo: {
  3971. required: true,
  3972. type: "string"
  3973. },
  3974. state: {
  3975. enum: ["open", "closed"],
  3976. type: "string"
  3977. },
  3978. title: {
  3979. type: "string"
  3980. }
  3981. },
  3982. url: "/repos/:owner/:repo/issues/:issue_number"
  3983. },
  3984. updateComment: {
  3985. method: "PATCH",
  3986. params: {
  3987. body: {
  3988. required: true,
  3989. type: "string"
  3990. },
  3991. comment_id: {
  3992. required: true,
  3993. type: "integer"
  3994. },
  3995. owner: {
  3996. required: true,
  3997. type: "string"
  3998. },
  3999. repo: {
  4000. required: true,
  4001. type: "string"
  4002. }
  4003. },
  4004. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  4005. },
  4006. updateLabel: {
  4007. method: "PATCH",
  4008. params: {
  4009. color: {
  4010. type: "string"
  4011. },
  4012. current_name: {
  4013. required: true,
  4014. type: "string"
  4015. },
  4016. description: {
  4017. type: "string"
  4018. },
  4019. name: {
  4020. type: "string"
  4021. },
  4022. owner: {
  4023. required: true,
  4024. type: "string"
  4025. },
  4026. repo: {
  4027. required: true,
  4028. type: "string"
  4029. }
  4030. },
  4031. url: "/repos/:owner/:repo/labels/:current_name"
  4032. },
  4033. updateMilestone: {
  4034. method: "PATCH",
  4035. params: {
  4036. description: {
  4037. type: "string"
  4038. },
  4039. due_on: {
  4040. type: "string"
  4041. },
  4042. milestone_number: {
  4043. required: true,
  4044. type: "integer"
  4045. },
  4046. number: {
  4047. alias: "milestone_number",
  4048. deprecated: true,
  4049. type: "integer"
  4050. },
  4051. owner: {
  4052. required: true,
  4053. type: "string"
  4054. },
  4055. repo: {
  4056. required: true,
  4057. type: "string"
  4058. },
  4059. state: {
  4060. enum: ["open", "closed"],
  4061. type: "string"
  4062. },
  4063. title: {
  4064. type: "string"
  4065. }
  4066. },
  4067. url: "/repos/:owner/:repo/milestones/:milestone_number"
  4068. }
  4069. },
  4070. licenses: {
  4071. get: {
  4072. method: "GET",
  4073. params: {
  4074. license: {
  4075. required: true,
  4076. type: "string"
  4077. }
  4078. },
  4079. url: "/licenses/:license"
  4080. },
  4081. getForRepo: {
  4082. method: "GET",
  4083. params: {
  4084. owner: {
  4085. required: true,
  4086. type: "string"
  4087. },
  4088. repo: {
  4089. required: true,
  4090. type: "string"
  4091. }
  4092. },
  4093. url: "/repos/:owner/:repo/license"
  4094. },
  4095. list: {
  4096. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  4097. method: "GET",
  4098. params: {},
  4099. url: "/licenses"
  4100. },
  4101. listCommonlyUsed: {
  4102. method: "GET",
  4103. params: {},
  4104. url: "/licenses"
  4105. }
  4106. },
  4107. markdown: {
  4108. render: {
  4109. method: "POST",
  4110. params: {
  4111. context: {
  4112. type: "string"
  4113. },
  4114. mode: {
  4115. enum: ["markdown", "gfm"],
  4116. type: "string"
  4117. },
  4118. text: {
  4119. required: true,
  4120. type: "string"
  4121. }
  4122. },
  4123. url: "/markdown"
  4124. },
  4125. renderRaw: {
  4126. headers: {
  4127. "content-type": "text/plain; charset=utf-8"
  4128. },
  4129. method: "POST",
  4130. params: {
  4131. data: {
  4132. mapTo: "data",
  4133. required: true,
  4134. type: "string"
  4135. }
  4136. },
  4137. url: "/markdown/raw"
  4138. }
  4139. },
  4140. meta: {
  4141. get: {
  4142. method: "GET",
  4143. params: {},
  4144. url: "/meta"
  4145. }
  4146. },
  4147. migrations: {
  4148. cancelImport: {
  4149. method: "DELETE",
  4150. params: {
  4151. owner: {
  4152. required: true,
  4153. type: "string"
  4154. },
  4155. repo: {
  4156. required: true,
  4157. type: "string"
  4158. }
  4159. },
  4160. url: "/repos/:owner/:repo/import"
  4161. },
  4162. deleteArchiveForAuthenticatedUser: {
  4163. headers: {
  4164. accept: "application/vnd.github.wyandotte-preview+json"
  4165. },
  4166. method: "DELETE",
  4167. params: {
  4168. migration_id: {
  4169. required: true,
  4170. type: "integer"
  4171. }
  4172. },
  4173. url: "/user/migrations/:migration_id/archive"
  4174. },
  4175. deleteArchiveForOrg: {
  4176. headers: {
  4177. accept: "application/vnd.github.wyandotte-preview+json"
  4178. },
  4179. method: "DELETE",
  4180. params: {
  4181. migration_id: {
  4182. required: true,
  4183. type: "integer"
  4184. },
  4185. org: {
  4186. required: true,
  4187. type: "string"
  4188. }
  4189. },
  4190. url: "/orgs/:org/migrations/:migration_id/archive"
  4191. },
  4192. downloadArchiveForOrg: {
  4193. headers: {
  4194. accept: "application/vnd.github.wyandotte-preview+json"
  4195. },
  4196. method: "GET",
  4197. params: {
  4198. migration_id: {
  4199. required: true,
  4200. type: "integer"
  4201. },
  4202. org: {
  4203. required: true,
  4204. type: "string"
  4205. }
  4206. },
  4207. url: "/orgs/:org/migrations/:migration_id/archive"
  4208. },
  4209. getArchiveForAuthenticatedUser: {
  4210. headers: {
  4211. accept: "application/vnd.github.wyandotte-preview+json"
  4212. },
  4213. method: "GET",
  4214. params: {
  4215. migration_id: {
  4216. required: true,
  4217. type: "integer"
  4218. }
  4219. },
  4220. url: "/user/migrations/:migration_id/archive"
  4221. },
  4222. getArchiveForOrg: {
  4223. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  4224. headers: {
  4225. accept: "application/vnd.github.wyandotte-preview+json"
  4226. },
  4227. method: "GET",
  4228. params: {
  4229. migration_id: {
  4230. required: true,
  4231. type: "integer"
  4232. },
  4233. org: {
  4234. required: true,
  4235. type: "string"
  4236. }
  4237. },
  4238. url: "/orgs/:org/migrations/:migration_id/archive"
  4239. },
  4240. getCommitAuthors: {
  4241. method: "GET",
  4242. params: {
  4243. owner: {
  4244. required: true,
  4245. type: "string"
  4246. },
  4247. repo: {
  4248. required: true,
  4249. type: "string"
  4250. },
  4251. since: {
  4252. type: "string"
  4253. }
  4254. },
  4255. url: "/repos/:owner/:repo/import/authors"
  4256. },
  4257. getImportProgress: {
  4258. method: "GET",
  4259. params: {
  4260. owner: {
  4261. required: true,
  4262. type: "string"
  4263. },
  4264. repo: {
  4265. required: true,
  4266. type: "string"
  4267. }
  4268. },
  4269. url: "/repos/:owner/:repo/import"
  4270. },
  4271. getLargeFiles: {
  4272. method: "GET",
  4273. params: {
  4274. owner: {
  4275. required: true,
  4276. type: "string"
  4277. },
  4278. repo: {
  4279. required: true,
  4280. type: "string"
  4281. }
  4282. },
  4283. url: "/repos/:owner/:repo/import/large_files"
  4284. },
  4285. getStatusForAuthenticatedUser: {
  4286. headers: {
  4287. accept: "application/vnd.github.wyandotte-preview+json"
  4288. },
  4289. method: "GET",
  4290. params: {
  4291. migration_id: {
  4292. required: true,
  4293. type: "integer"
  4294. }
  4295. },
  4296. url: "/user/migrations/:migration_id"
  4297. },
  4298. getStatusForOrg: {
  4299. headers: {
  4300. accept: "application/vnd.github.wyandotte-preview+json"
  4301. },
  4302. method: "GET",
  4303. params: {
  4304. migration_id: {
  4305. required: true,
  4306. type: "integer"
  4307. },
  4308. org: {
  4309. required: true,
  4310. type: "string"
  4311. }
  4312. },
  4313. url: "/orgs/:org/migrations/:migration_id"
  4314. },
  4315. listForAuthenticatedUser: {
  4316. headers: {
  4317. accept: "application/vnd.github.wyandotte-preview+json"
  4318. },
  4319. method: "GET",
  4320. params: {
  4321. page: {
  4322. type: "integer"
  4323. },
  4324. per_page: {
  4325. type: "integer"
  4326. }
  4327. },
  4328. url: "/user/migrations"
  4329. },
  4330. listForOrg: {
  4331. headers: {
  4332. accept: "application/vnd.github.wyandotte-preview+json"
  4333. },
  4334. method: "GET",
  4335. params: {
  4336. org: {
  4337. required: true,
  4338. type: "string"
  4339. },
  4340. page: {
  4341. type: "integer"
  4342. },
  4343. per_page: {
  4344. type: "integer"
  4345. }
  4346. },
  4347. url: "/orgs/:org/migrations"
  4348. },
  4349. listReposForOrg: {
  4350. headers: {
  4351. accept: "application/vnd.github.wyandotte-preview+json"
  4352. },
  4353. method: "GET",
  4354. params: {
  4355. migration_id: {
  4356. required: true,
  4357. type: "integer"
  4358. },
  4359. org: {
  4360. required: true,
  4361. type: "string"
  4362. },
  4363. page: {
  4364. type: "integer"
  4365. },
  4366. per_page: {
  4367. type: "integer"
  4368. }
  4369. },
  4370. url: "/orgs/:org/migrations/:migration_id/repositories"
  4371. },
  4372. listReposForUser: {
  4373. headers: {
  4374. accept: "application/vnd.github.wyandotte-preview+json"
  4375. },
  4376. method: "GET",
  4377. params: {
  4378. migration_id: {
  4379. required: true,
  4380. type: "integer"
  4381. },
  4382. page: {
  4383. type: "integer"
  4384. },
  4385. per_page: {
  4386. type: "integer"
  4387. }
  4388. },
  4389. url: "/user/:migration_id/repositories"
  4390. },
  4391. mapCommitAuthor: {
  4392. method: "PATCH",
  4393. params: {
  4394. author_id: {
  4395. required: true,
  4396. type: "integer"
  4397. },
  4398. email: {
  4399. type: "string"
  4400. },
  4401. name: {
  4402. type: "string"
  4403. },
  4404. owner: {
  4405. required: true,
  4406. type: "string"
  4407. },
  4408. repo: {
  4409. required: true,
  4410. type: "string"
  4411. }
  4412. },
  4413. url: "/repos/:owner/:repo/import/authors/:author_id"
  4414. },
  4415. setLfsPreference: {
  4416. method: "PATCH",
  4417. params: {
  4418. owner: {
  4419. required: true,
  4420. type: "string"
  4421. },
  4422. repo: {
  4423. required: true,
  4424. type: "string"
  4425. },
  4426. use_lfs: {
  4427. enum: ["opt_in", "opt_out"],
  4428. required: true,
  4429. type: "string"
  4430. }
  4431. },
  4432. url: "/repos/:owner/:repo/import/lfs"
  4433. },
  4434. startForAuthenticatedUser: {
  4435. method: "POST",
  4436. params: {
  4437. exclude_attachments: {
  4438. type: "boolean"
  4439. },
  4440. lock_repositories: {
  4441. type: "boolean"
  4442. },
  4443. repositories: {
  4444. required: true,
  4445. type: "string[]"
  4446. }
  4447. },
  4448. url: "/user/migrations"
  4449. },
  4450. startForOrg: {
  4451. method: "POST",
  4452. params: {
  4453. exclude_attachments: {
  4454. type: "boolean"
  4455. },
  4456. lock_repositories: {
  4457. type: "boolean"
  4458. },
  4459. org: {
  4460. required: true,
  4461. type: "string"
  4462. },
  4463. repositories: {
  4464. required: true,
  4465. type: "string[]"
  4466. }
  4467. },
  4468. url: "/orgs/:org/migrations"
  4469. },
  4470. startImport: {
  4471. method: "PUT",
  4472. params: {
  4473. owner: {
  4474. required: true,
  4475. type: "string"
  4476. },
  4477. repo: {
  4478. required: true,
  4479. type: "string"
  4480. },
  4481. tfvc_project: {
  4482. type: "string"
  4483. },
  4484. vcs: {
  4485. enum: ["subversion", "git", "mercurial", "tfvc"],
  4486. type: "string"
  4487. },
  4488. vcs_password: {
  4489. type: "string"
  4490. },
  4491. vcs_url: {
  4492. required: true,
  4493. type: "string"
  4494. },
  4495. vcs_username: {
  4496. type: "string"
  4497. }
  4498. },
  4499. url: "/repos/:owner/:repo/import"
  4500. },
  4501. unlockRepoForAuthenticatedUser: {
  4502. headers: {
  4503. accept: "application/vnd.github.wyandotte-preview+json"
  4504. },
  4505. method: "DELETE",
  4506. params: {
  4507. migration_id: {
  4508. required: true,
  4509. type: "integer"
  4510. },
  4511. repo_name: {
  4512. required: true,
  4513. type: "string"
  4514. }
  4515. },
  4516. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  4517. },
  4518. unlockRepoForOrg: {
  4519. headers: {
  4520. accept: "application/vnd.github.wyandotte-preview+json"
  4521. },
  4522. method: "DELETE",
  4523. params: {
  4524. migration_id: {
  4525. required: true,
  4526. type: "integer"
  4527. },
  4528. org: {
  4529. required: true,
  4530. type: "string"
  4531. },
  4532. repo_name: {
  4533. required: true,
  4534. type: "string"
  4535. }
  4536. },
  4537. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  4538. },
  4539. updateImport: {
  4540. method: "PATCH",
  4541. params: {
  4542. owner: {
  4543. required: true,
  4544. type: "string"
  4545. },
  4546. repo: {
  4547. required: true,
  4548. type: "string"
  4549. },
  4550. vcs_password: {
  4551. type: "string"
  4552. },
  4553. vcs_username: {
  4554. type: "string"
  4555. }
  4556. },
  4557. url: "/repos/:owner/:repo/import"
  4558. }
  4559. },
  4560. oauthAuthorizations: {
  4561. checkAuthorization: {
  4562. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  4563. method: "GET",
  4564. params: {
  4565. access_token: {
  4566. required: true,
  4567. type: "string"
  4568. },
  4569. client_id: {
  4570. required: true,
  4571. type: "string"
  4572. }
  4573. },
  4574. url: "/applications/:client_id/tokens/:access_token"
  4575. },
  4576. createAuthorization: {
  4577. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  4578. method: "POST",
  4579. params: {
  4580. client_id: {
  4581. type: "string"
  4582. },
  4583. client_secret: {
  4584. type: "string"
  4585. },
  4586. fingerprint: {
  4587. type: "string"
  4588. },
  4589. note: {
  4590. required: true,
  4591. type: "string"
  4592. },
  4593. note_url: {
  4594. type: "string"
  4595. },
  4596. scopes: {
  4597. type: "string[]"
  4598. }
  4599. },
  4600. url: "/authorizations"
  4601. },
  4602. deleteAuthorization: {
  4603. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  4604. method: "DELETE",
  4605. params: {
  4606. authorization_id: {
  4607. required: true,
  4608. type: "integer"
  4609. }
  4610. },
  4611. url: "/authorizations/:authorization_id"
  4612. },
  4613. deleteGrant: {
  4614. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  4615. method: "DELETE",
  4616. params: {
  4617. grant_id: {
  4618. required: true,
  4619. type: "integer"
  4620. }
  4621. },
  4622. url: "/applications/grants/:grant_id"
  4623. },
  4624. getAuthorization: {
  4625. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  4626. method: "GET",
  4627. params: {
  4628. authorization_id: {
  4629. required: true,
  4630. type: "integer"
  4631. }
  4632. },
  4633. url: "/authorizations/:authorization_id"
  4634. },
  4635. getGrant: {
  4636. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  4637. method: "GET",
  4638. params: {
  4639. grant_id: {
  4640. required: true,
  4641. type: "integer"
  4642. }
  4643. },
  4644. url: "/applications/grants/:grant_id"
  4645. },
  4646. getOrCreateAuthorizationForApp: {
  4647. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  4648. method: "PUT",
  4649. params: {
  4650. client_id: {
  4651. required: true,
  4652. type: "string"
  4653. },
  4654. client_secret: {
  4655. required: true,
  4656. type: "string"
  4657. },
  4658. fingerprint: {
  4659. type: "string"
  4660. },
  4661. note: {
  4662. type: "string"
  4663. },
  4664. note_url: {
  4665. type: "string"
  4666. },
  4667. scopes: {
  4668. type: "string[]"
  4669. }
  4670. },
  4671. url: "/authorizations/clients/:client_id"
  4672. },
  4673. getOrCreateAuthorizationForAppAndFingerprint: {
  4674. 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",
  4675. method: "PUT",
  4676. params: {
  4677. client_id: {
  4678. required: true,
  4679. type: "string"
  4680. },
  4681. client_secret: {
  4682. required: true,
  4683. type: "string"
  4684. },
  4685. fingerprint: {
  4686. required: true,
  4687. type: "string"
  4688. },
  4689. note: {
  4690. type: "string"
  4691. },
  4692. note_url: {
  4693. type: "string"
  4694. },
  4695. scopes: {
  4696. type: "string[]"
  4697. }
  4698. },
  4699. url: "/authorizations/clients/:client_id/:fingerprint"
  4700. },
  4701. getOrCreateAuthorizationForAppFingerprint: {
  4702. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  4703. method: "PUT",
  4704. params: {
  4705. client_id: {
  4706. required: true,
  4707. type: "string"
  4708. },
  4709. client_secret: {
  4710. required: true,
  4711. type: "string"
  4712. },
  4713. fingerprint: {
  4714. required: true,
  4715. type: "string"
  4716. },
  4717. note: {
  4718. type: "string"
  4719. },
  4720. note_url: {
  4721. type: "string"
  4722. },
  4723. scopes: {
  4724. type: "string[]"
  4725. }
  4726. },
  4727. url: "/authorizations/clients/:client_id/:fingerprint"
  4728. },
  4729. listAuthorizations: {
  4730. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  4731. method: "GET",
  4732. params: {
  4733. page: {
  4734. type: "integer"
  4735. },
  4736. per_page: {
  4737. type: "integer"
  4738. }
  4739. },
  4740. url: "/authorizations"
  4741. },
  4742. listGrants: {
  4743. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  4744. method: "GET",
  4745. params: {
  4746. page: {
  4747. type: "integer"
  4748. },
  4749. per_page: {
  4750. type: "integer"
  4751. }
  4752. },
  4753. url: "/applications/grants"
  4754. },
  4755. resetAuthorization: {
  4756. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  4757. method: "POST",
  4758. params: {
  4759. access_token: {
  4760. required: true,
  4761. type: "string"
  4762. },
  4763. client_id: {
  4764. required: true,
  4765. type: "string"
  4766. }
  4767. },
  4768. url: "/applications/:client_id/tokens/:access_token"
  4769. },
  4770. revokeAuthorizationForApplication: {
  4771. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  4772. method: "DELETE",
  4773. params: {
  4774. access_token: {
  4775. required: true,
  4776. type: "string"
  4777. },
  4778. client_id: {
  4779. required: true,
  4780. type: "string"
  4781. }
  4782. },
  4783. url: "/applications/:client_id/tokens/:access_token"
  4784. },
  4785. revokeGrantForApplication: {
  4786. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  4787. method: "DELETE",
  4788. params: {
  4789. access_token: {
  4790. required: true,
  4791. type: "string"
  4792. },
  4793. client_id: {
  4794. required: true,
  4795. type: "string"
  4796. }
  4797. },
  4798. url: "/applications/:client_id/grants/:access_token"
  4799. },
  4800. updateAuthorization: {
  4801. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  4802. method: "PATCH",
  4803. params: {
  4804. add_scopes: {
  4805. type: "string[]"
  4806. },
  4807. authorization_id: {
  4808. required: true,
  4809. type: "integer"
  4810. },
  4811. fingerprint: {
  4812. type: "string"
  4813. },
  4814. note: {
  4815. type: "string"
  4816. },
  4817. note_url: {
  4818. type: "string"
  4819. },
  4820. remove_scopes: {
  4821. type: "string[]"
  4822. },
  4823. scopes: {
  4824. type: "string[]"
  4825. }
  4826. },
  4827. url: "/authorizations/:authorization_id"
  4828. }
  4829. },
  4830. orgs: {
  4831. addOrUpdateMembership: {
  4832. method: "PUT",
  4833. params: {
  4834. org: {
  4835. required: true,
  4836. type: "string"
  4837. },
  4838. role: {
  4839. enum: ["admin", "member"],
  4840. type: "string"
  4841. },
  4842. username: {
  4843. required: true,
  4844. type: "string"
  4845. }
  4846. },
  4847. url: "/orgs/:org/memberships/:username"
  4848. },
  4849. blockUser: {
  4850. method: "PUT",
  4851. params: {
  4852. org: {
  4853. required: true,
  4854. type: "string"
  4855. },
  4856. username: {
  4857. required: true,
  4858. type: "string"
  4859. }
  4860. },
  4861. url: "/orgs/:org/blocks/:username"
  4862. },
  4863. checkBlockedUser: {
  4864. method: "GET",
  4865. params: {
  4866. org: {
  4867. required: true,
  4868. type: "string"
  4869. },
  4870. username: {
  4871. required: true,
  4872. type: "string"
  4873. }
  4874. },
  4875. url: "/orgs/:org/blocks/:username"
  4876. },
  4877. checkMembership: {
  4878. method: "GET",
  4879. params: {
  4880. org: {
  4881. required: true,
  4882. type: "string"
  4883. },
  4884. username: {
  4885. required: true,
  4886. type: "string"
  4887. }
  4888. },
  4889. url: "/orgs/:org/members/:username"
  4890. },
  4891. checkPublicMembership: {
  4892. method: "GET",
  4893. params: {
  4894. org: {
  4895. required: true,
  4896. type: "string"
  4897. },
  4898. username: {
  4899. required: true,
  4900. type: "string"
  4901. }
  4902. },
  4903. url: "/orgs/:org/public_members/:username"
  4904. },
  4905. concealMembership: {
  4906. method: "DELETE",
  4907. params: {
  4908. org: {
  4909. required: true,
  4910. type: "string"
  4911. },
  4912. username: {
  4913. required: true,
  4914. type: "string"
  4915. }
  4916. },
  4917. url: "/orgs/:org/public_members/:username"
  4918. },
  4919. convertMemberToOutsideCollaborator: {
  4920. method: "PUT",
  4921. params: {
  4922. org: {
  4923. required: true,
  4924. type: "string"
  4925. },
  4926. username: {
  4927. required: true,
  4928. type: "string"
  4929. }
  4930. },
  4931. url: "/orgs/:org/outside_collaborators/:username"
  4932. },
  4933. createHook: {
  4934. method: "POST",
  4935. params: {
  4936. active: {
  4937. type: "boolean"
  4938. },
  4939. config: {
  4940. required: true,
  4941. type: "object"
  4942. },
  4943. "config.content_type": {
  4944. type: "string"
  4945. },
  4946. "config.insecure_ssl": {
  4947. type: "string"
  4948. },
  4949. "config.secret": {
  4950. type: "string"
  4951. },
  4952. "config.url": {
  4953. required: true,
  4954. type: "string"
  4955. },
  4956. events: {
  4957. type: "string[]"
  4958. },
  4959. name: {
  4960. required: true,
  4961. type: "string"
  4962. },
  4963. org: {
  4964. required: true,
  4965. type: "string"
  4966. }
  4967. },
  4968. url: "/orgs/:org/hooks"
  4969. },
  4970. createInvitation: {
  4971. method: "POST",
  4972. params: {
  4973. email: {
  4974. type: "string"
  4975. },
  4976. invitee_id: {
  4977. type: "integer"
  4978. },
  4979. org: {
  4980. required: true,
  4981. type: "string"
  4982. },
  4983. role: {
  4984. enum: ["admin", "direct_member", "billing_manager"],
  4985. type: "string"
  4986. },
  4987. team_ids: {
  4988. type: "integer[]"
  4989. }
  4990. },
  4991. url: "/orgs/:org/invitations"
  4992. },
  4993. deleteHook: {
  4994. method: "DELETE",
  4995. params: {
  4996. hook_id: {
  4997. required: true,
  4998. type: "integer"
  4999. },
  5000. org: {
  5001. required: true,
  5002. type: "string"
  5003. }
  5004. },
  5005. url: "/orgs/:org/hooks/:hook_id"
  5006. },
  5007. get: {
  5008. method: "GET",
  5009. params: {
  5010. org: {
  5011. required: true,
  5012. type: "string"
  5013. }
  5014. },
  5015. url: "/orgs/:org"
  5016. },
  5017. getHook: {
  5018. method: "GET",
  5019. params: {
  5020. hook_id: {
  5021. required: true,
  5022. type: "integer"
  5023. },
  5024. org: {
  5025. required: true,
  5026. type: "string"
  5027. }
  5028. },
  5029. url: "/orgs/:org/hooks/:hook_id"
  5030. },
  5031. getMembership: {
  5032. method: "GET",
  5033. params: {
  5034. org: {
  5035. required: true,
  5036. type: "string"
  5037. },
  5038. username: {
  5039. required: true,
  5040. type: "string"
  5041. }
  5042. },
  5043. url: "/orgs/:org/memberships/:username"
  5044. },
  5045. getMembershipForAuthenticatedUser: {
  5046. method: "GET",
  5047. params: {
  5048. org: {
  5049. required: true,
  5050. type: "string"
  5051. }
  5052. },
  5053. url: "/user/memberships/orgs/:org"
  5054. },
  5055. list: {
  5056. method: "GET",
  5057. params: {
  5058. page: {
  5059. type: "integer"
  5060. },
  5061. per_page: {
  5062. type: "integer"
  5063. },
  5064. since: {
  5065. type: "integer"
  5066. }
  5067. },
  5068. url: "/organizations"
  5069. },
  5070. listBlockedUsers: {
  5071. method: "GET",
  5072. params: {
  5073. org: {
  5074. required: true,
  5075. type: "string"
  5076. }
  5077. },
  5078. url: "/orgs/:org/blocks"
  5079. },
  5080. listForAuthenticatedUser: {
  5081. method: "GET",
  5082. params: {
  5083. page: {
  5084. type: "integer"
  5085. },
  5086. per_page: {
  5087. type: "integer"
  5088. }
  5089. },
  5090. url: "/user/orgs"
  5091. },
  5092. listForUser: {
  5093. method: "GET",
  5094. params: {
  5095. page: {
  5096. type: "integer"
  5097. },
  5098. per_page: {
  5099. type: "integer"
  5100. },
  5101. username: {
  5102. required: true,
  5103. type: "string"
  5104. }
  5105. },
  5106. url: "/users/:username/orgs"
  5107. },
  5108. listHooks: {
  5109. method: "GET",
  5110. params: {
  5111. org: {
  5112. required: true,
  5113. type: "string"
  5114. },
  5115. page: {
  5116. type: "integer"
  5117. },
  5118. per_page: {
  5119. type: "integer"
  5120. }
  5121. },
  5122. url: "/orgs/:org/hooks"
  5123. },
  5124. listInstallations: {
  5125. headers: {
  5126. accept: "application/vnd.github.machine-man-preview+json"
  5127. },
  5128. method: "GET",
  5129. params: {
  5130. org: {
  5131. required: true,
  5132. type: "string"
  5133. },
  5134. page: {
  5135. type: "integer"
  5136. },
  5137. per_page: {
  5138. type: "integer"
  5139. }
  5140. },
  5141. url: "/orgs/:org/installations"
  5142. },
  5143. listInvitationTeams: {
  5144. method: "GET",
  5145. params: {
  5146. invitation_id: {
  5147. required: true,
  5148. type: "integer"
  5149. },
  5150. org: {
  5151. required: true,
  5152. type: "string"
  5153. },
  5154. page: {
  5155. type: "integer"
  5156. },
  5157. per_page: {
  5158. type: "integer"
  5159. }
  5160. },
  5161. url: "/orgs/:org/invitations/:invitation_id/teams"
  5162. },
  5163. listMembers: {
  5164. method: "GET",
  5165. params: {
  5166. filter: {
  5167. enum: ["2fa_disabled", "all"],
  5168. type: "string"
  5169. },
  5170. org: {
  5171. required: true,
  5172. type: "string"
  5173. },
  5174. page: {
  5175. type: "integer"
  5176. },
  5177. per_page: {
  5178. type: "integer"
  5179. },
  5180. role: {
  5181. enum: ["all", "admin", "member"],
  5182. type: "string"
  5183. }
  5184. },
  5185. url: "/orgs/:org/members"
  5186. },
  5187. listMemberships: {
  5188. method: "GET",
  5189. params: {
  5190. page: {
  5191. type: "integer"
  5192. },
  5193. per_page: {
  5194. type: "integer"
  5195. },
  5196. state: {
  5197. enum: ["active", "pending"],
  5198. type: "string"
  5199. }
  5200. },
  5201. url: "/user/memberships/orgs"
  5202. },
  5203. listOutsideCollaborators: {
  5204. method: "GET",
  5205. params: {
  5206. filter: {
  5207. enum: ["2fa_disabled", "all"],
  5208. type: "string"
  5209. },
  5210. org: {
  5211. required: true,
  5212. type: "string"
  5213. },
  5214. page: {
  5215. type: "integer"
  5216. },
  5217. per_page: {
  5218. type: "integer"
  5219. }
  5220. },
  5221. url: "/orgs/:org/outside_collaborators"
  5222. },
  5223. listPendingInvitations: {
  5224. method: "GET",
  5225. params: {
  5226. org: {
  5227. required: true,
  5228. type: "string"
  5229. },
  5230. page: {
  5231. type: "integer"
  5232. },
  5233. per_page: {
  5234. type: "integer"
  5235. }
  5236. },
  5237. url: "/orgs/:org/invitations"
  5238. },
  5239. listPublicMembers: {
  5240. method: "GET",
  5241. params: {
  5242. org: {
  5243. required: true,
  5244. type: "string"
  5245. },
  5246. page: {
  5247. type: "integer"
  5248. },
  5249. per_page: {
  5250. type: "integer"
  5251. }
  5252. },
  5253. url: "/orgs/:org/public_members"
  5254. },
  5255. pingHook: {
  5256. method: "POST",
  5257. params: {
  5258. hook_id: {
  5259. required: true,
  5260. type: "integer"
  5261. },
  5262. org: {
  5263. required: true,
  5264. type: "string"
  5265. }
  5266. },
  5267. url: "/orgs/:org/hooks/:hook_id/pings"
  5268. },
  5269. publicizeMembership: {
  5270. method: "PUT",
  5271. params: {
  5272. org: {
  5273. required: true,
  5274. type: "string"
  5275. },
  5276. username: {
  5277. required: true,
  5278. type: "string"
  5279. }
  5280. },
  5281. url: "/orgs/:org/public_members/:username"
  5282. },
  5283. removeMember: {
  5284. method: "DELETE",
  5285. params: {
  5286. org: {
  5287. required: true,
  5288. type: "string"
  5289. },
  5290. username: {
  5291. required: true,
  5292. type: "string"
  5293. }
  5294. },
  5295. url: "/orgs/:org/members/:username"
  5296. },
  5297. removeMembership: {
  5298. method: "DELETE",
  5299. params: {
  5300. org: {
  5301. required: true,
  5302. type: "string"
  5303. },
  5304. username: {
  5305. required: true,
  5306. type: "string"
  5307. }
  5308. },
  5309. url: "/orgs/:org/memberships/:username"
  5310. },
  5311. removeOutsideCollaborator: {
  5312. method: "DELETE",
  5313. params: {
  5314. org: {
  5315. required: true,
  5316. type: "string"
  5317. },
  5318. username: {
  5319. required: true,
  5320. type: "string"
  5321. }
  5322. },
  5323. url: "/orgs/:org/outside_collaborators/:username"
  5324. },
  5325. unblockUser: {
  5326. method: "DELETE",
  5327. params: {
  5328. org: {
  5329. required: true,
  5330. type: "string"
  5331. },
  5332. username: {
  5333. required: true,
  5334. type: "string"
  5335. }
  5336. },
  5337. url: "/orgs/:org/blocks/:username"
  5338. },
  5339. update: {
  5340. method: "PATCH",
  5341. params: {
  5342. billing_email: {
  5343. type: "string"
  5344. },
  5345. company: {
  5346. type: "string"
  5347. },
  5348. default_repository_permission: {
  5349. enum: ["read", "write", "admin", "none"],
  5350. type: "string"
  5351. },
  5352. description: {
  5353. type: "string"
  5354. },
  5355. email: {
  5356. type: "string"
  5357. },
  5358. has_organization_projects: {
  5359. type: "boolean"
  5360. },
  5361. has_repository_projects: {
  5362. type: "boolean"
  5363. },
  5364. location: {
  5365. type: "string"
  5366. },
  5367. members_allowed_repository_creation_type: {
  5368. enum: ["all", "private", "none"],
  5369. type: "string"
  5370. },
  5371. members_can_create_internal_repositories: {
  5372. type: "boolean"
  5373. },
  5374. members_can_create_private_repositories: {
  5375. type: "boolean"
  5376. },
  5377. members_can_create_public_repositories: {
  5378. type: "boolean"
  5379. },
  5380. members_can_create_repositories: {
  5381. type: "boolean"
  5382. },
  5383. name: {
  5384. type: "string"
  5385. },
  5386. org: {
  5387. required: true,
  5388. type: "string"
  5389. }
  5390. },
  5391. url: "/orgs/:org"
  5392. },
  5393. updateHook: {
  5394. method: "PATCH",
  5395. params: {
  5396. active: {
  5397. type: "boolean"
  5398. },
  5399. config: {
  5400. type: "object"
  5401. },
  5402. "config.content_type": {
  5403. type: "string"
  5404. },
  5405. "config.insecure_ssl": {
  5406. type: "string"
  5407. },
  5408. "config.secret": {
  5409. type: "string"
  5410. },
  5411. "config.url": {
  5412. required: true,
  5413. type: "string"
  5414. },
  5415. events: {
  5416. type: "string[]"
  5417. },
  5418. hook_id: {
  5419. required: true,
  5420. type: "integer"
  5421. },
  5422. org: {
  5423. required: true,
  5424. type: "string"
  5425. }
  5426. },
  5427. url: "/orgs/:org/hooks/:hook_id"
  5428. },
  5429. updateMembership: {
  5430. method: "PATCH",
  5431. params: {
  5432. org: {
  5433. required: true,
  5434. type: "string"
  5435. },
  5436. state: {
  5437. enum: ["active"],
  5438. required: true,
  5439. type: "string"
  5440. }
  5441. },
  5442. url: "/user/memberships/orgs/:org"
  5443. }
  5444. },
  5445. projects: {
  5446. addCollaborator: {
  5447. headers: {
  5448. accept: "application/vnd.github.inertia-preview+json"
  5449. },
  5450. method: "PUT",
  5451. params: {
  5452. permission: {
  5453. enum: ["read", "write", "admin"],
  5454. type: "string"
  5455. },
  5456. project_id: {
  5457. required: true,
  5458. type: "integer"
  5459. },
  5460. username: {
  5461. required: true,
  5462. type: "string"
  5463. }
  5464. },
  5465. url: "/projects/:project_id/collaborators/:username"
  5466. },
  5467. createCard: {
  5468. headers: {
  5469. accept: "application/vnd.github.inertia-preview+json"
  5470. },
  5471. method: "POST",
  5472. params: {
  5473. column_id: {
  5474. required: true,
  5475. type: "integer"
  5476. },
  5477. content_id: {
  5478. type: "integer"
  5479. },
  5480. content_type: {
  5481. type: "string"
  5482. },
  5483. note: {
  5484. type: "string"
  5485. }
  5486. },
  5487. url: "/projects/columns/:column_id/cards"
  5488. },
  5489. createColumn: {
  5490. headers: {
  5491. accept: "application/vnd.github.inertia-preview+json"
  5492. },
  5493. method: "POST",
  5494. params: {
  5495. name: {
  5496. required: true,
  5497. type: "string"
  5498. },
  5499. project_id: {
  5500. required: true,
  5501. type: "integer"
  5502. }
  5503. },
  5504. url: "/projects/:project_id/columns"
  5505. },
  5506. createForAuthenticatedUser: {
  5507. headers: {
  5508. accept: "application/vnd.github.inertia-preview+json"
  5509. },
  5510. method: "POST",
  5511. params: {
  5512. body: {
  5513. type: "string"
  5514. },
  5515. name: {
  5516. required: true,
  5517. type: "string"
  5518. }
  5519. },
  5520. url: "/user/projects"
  5521. },
  5522. createForOrg: {
  5523. headers: {
  5524. accept: "application/vnd.github.inertia-preview+json"
  5525. },
  5526. method: "POST",
  5527. params: {
  5528. body: {
  5529. type: "string"
  5530. },
  5531. name: {
  5532. required: true,
  5533. type: "string"
  5534. },
  5535. org: {
  5536. required: true,
  5537. type: "string"
  5538. }
  5539. },
  5540. url: "/orgs/:org/projects"
  5541. },
  5542. createForRepo: {
  5543. headers: {
  5544. accept: "application/vnd.github.inertia-preview+json"
  5545. },
  5546. method: "POST",
  5547. params: {
  5548. body: {
  5549. type: "string"
  5550. },
  5551. name: {
  5552. required: true,
  5553. type: "string"
  5554. },
  5555. owner: {
  5556. required: true,
  5557. type: "string"
  5558. },
  5559. repo: {
  5560. required: true,
  5561. type: "string"
  5562. }
  5563. },
  5564. url: "/repos/:owner/:repo/projects"
  5565. },
  5566. delete: {
  5567. headers: {
  5568. accept: "application/vnd.github.inertia-preview+json"
  5569. },
  5570. method: "DELETE",
  5571. params: {
  5572. project_id: {
  5573. required: true,
  5574. type: "integer"
  5575. }
  5576. },
  5577. url: "/projects/:project_id"
  5578. },
  5579. deleteCard: {
  5580. headers: {
  5581. accept: "application/vnd.github.inertia-preview+json"
  5582. },
  5583. method: "DELETE",
  5584. params: {
  5585. card_id: {
  5586. required: true,
  5587. type: "integer"
  5588. }
  5589. },
  5590. url: "/projects/columns/cards/:card_id"
  5591. },
  5592. deleteColumn: {
  5593. headers: {
  5594. accept: "application/vnd.github.inertia-preview+json"
  5595. },
  5596. method: "DELETE",
  5597. params: {
  5598. column_id: {
  5599. required: true,
  5600. type: "integer"
  5601. }
  5602. },
  5603. url: "/projects/columns/:column_id"
  5604. },
  5605. get: {
  5606. headers: {
  5607. accept: "application/vnd.github.inertia-preview+json"
  5608. },
  5609. method: "GET",
  5610. params: {
  5611. project_id: {
  5612. required: true,
  5613. type: "integer"
  5614. }
  5615. },
  5616. url: "/projects/:project_id"
  5617. },
  5618. getCard: {
  5619. headers: {
  5620. accept: "application/vnd.github.inertia-preview+json"
  5621. },
  5622. method: "GET",
  5623. params: {
  5624. card_id: {
  5625. required: true,
  5626. type: "integer"
  5627. }
  5628. },
  5629. url: "/projects/columns/cards/:card_id"
  5630. },
  5631. getColumn: {
  5632. headers: {
  5633. accept: "application/vnd.github.inertia-preview+json"
  5634. },
  5635. method: "GET",
  5636. params: {
  5637. column_id: {
  5638. required: true,
  5639. type: "integer"
  5640. }
  5641. },
  5642. url: "/projects/columns/:column_id"
  5643. },
  5644. listCards: {
  5645. headers: {
  5646. accept: "application/vnd.github.inertia-preview+json"
  5647. },
  5648. method: "GET",
  5649. params: {
  5650. archived_state: {
  5651. enum: ["all", "archived", "not_archived"],
  5652. type: "string"
  5653. },
  5654. column_id: {
  5655. required: true,
  5656. type: "integer"
  5657. },
  5658. page: {
  5659. type: "integer"
  5660. },
  5661. per_page: {
  5662. type: "integer"
  5663. }
  5664. },
  5665. url: "/projects/columns/:column_id/cards"
  5666. },
  5667. listCollaborators: {
  5668. headers: {
  5669. accept: "application/vnd.github.inertia-preview+json"
  5670. },
  5671. method: "GET",
  5672. params: {
  5673. affiliation: {
  5674. enum: ["outside", "direct", "all"],
  5675. type: "string"
  5676. },
  5677. page: {
  5678. type: "integer"
  5679. },
  5680. per_page: {
  5681. type: "integer"
  5682. },
  5683. project_id: {
  5684. required: true,
  5685. type: "integer"
  5686. }
  5687. },
  5688. url: "/projects/:project_id/collaborators"
  5689. },
  5690. listColumns: {
  5691. headers: {
  5692. accept: "application/vnd.github.inertia-preview+json"
  5693. },
  5694. method: "GET",
  5695. params: {
  5696. page: {
  5697. type: "integer"
  5698. },
  5699. per_page: {
  5700. type: "integer"
  5701. },
  5702. project_id: {
  5703. required: true,
  5704. type: "integer"
  5705. }
  5706. },
  5707. url: "/projects/:project_id/columns"
  5708. },
  5709. listForOrg: {
  5710. headers: {
  5711. accept: "application/vnd.github.inertia-preview+json"
  5712. },
  5713. method: "GET",
  5714. params: {
  5715. org: {
  5716. required: true,
  5717. type: "string"
  5718. },
  5719. page: {
  5720. type: "integer"
  5721. },
  5722. per_page: {
  5723. type: "integer"
  5724. },
  5725. state: {
  5726. enum: ["open", "closed", "all"],
  5727. type: "string"
  5728. }
  5729. },
  5730. url: "/orgs/:org/projects"
  5731. },
  5732. listForRepo: {
  5733. headers: {
  5734. accept: "application/vnd.github.inertia-preview+json"
  5735. },
  5736. method: "GET",
  5737. params: {
  5738. owner: {
  5739. required: true,
  5740. type: "string"
  5741. },
  5742. page: {
  5743. type: "integer"
  5744. },
  5745. per_page: {
  5746. type: "integer"
  5747. },
  5748. repo: {
  5749. required: true,
  5750. type: "string"
  5751. },
  5752. state: {
  5753. enum: ["open", "closed", "all"],
  5754. type: "string"
  5755. }
  5756. },
  5757. url: "/repos/:owner/:repo/projects"
  5758. },
  5759. listForUser: {
  5760. headers: {
  5761. accept: "application/vnd.github.inertia-preview+json"
  5762. },
  5763. method: "GET",
  5764. params: {
  5765. page: {
  5766. type: "integer"
  5767. },
  5768. per_page: {
  5769. type: "integer"
  5770. },
  5771. state: {
  5772. enum: ["open", "closed", "all"],
  5773. type: "string"
  5774. },
  5775. username: {
  5776. required: true,
  5777. type: "string"
  5778. }
  5779. },
  5780. url: "/users/:username/projects"
  5781. },
  5782. moveCard: {
  5783. headers: {
  5784. accept: "application/vnd.github.inertia-preview+json"
  5785. },
  5786. method: "POST",
  5787. params: {
  5788. card_id: {
  5789. required: true,
  5790. type: "integer"
  5791. },
  5792. column_id: {
  5793. type: "integer"
  5794. },
  5795. position: {
  5796. required: true,
  5797. type: "string",
  5798. validation: "^(top|bottom|after:\\d+)$"
  5799. }
  5800. },
  5801. url: "/projects/columns/cards/:card_id/moves"
  5802. },
  5803. moveColumn: {
  5804. headers: {
  5805. accept: "application/vnd.github.inertia-preview+json"
  5806. },
  5807. method: "POST",
  5808. params: {
  5809. column_id: {
  5810. required: true,
  5811. type: "integer"
  5812. },
  5813. position: {
  5814. required: true,
  5815. type: "string",
  5816. validation: "^(first|last|after:\\d+)$"
  5817. }
  5818. },
  5819. url: "/projects/columns/:column_id/moves"
  5820. },
  5821. removeCollaborator: {
  5822. headers: {
  5823. accept: "application/vnd.github.inertia-preview+json"
  5824. },
  5825. method: "DELETE",
  5826. params: {
  5827. project_id: {
  5828. required: true,
  5829. type: "integer"
  5830. },
  5831. username: {
  5832. required: true,
  5833. type: "string"
  5834. }
  5835. },
  5836. url: "/projects/:project_id/collaborators/:username"
  5837. },
  5838. reviewUserPermissionLevel: {
  5839. headers: {
  5840. accept: "application/vnd.github.inertia-preview+json"
  5841. },
  5842. method: "GET",
  5843. params: {
  5844. project_id: {
  5845. required: true,
  5846. type: "integer"
  5847. },
  5848. username: {
  5849. required: true,
  5850. type: "string"
  5851. }
  5852. },
  5853. url: "/projects/:project_id/collaborators/:username/permission"
  5854. },
  5855. update: {
  5856. headers: {
  5857. accept: "application/vnd.github.inertia-preview+json"
  5858. },
  5859. method: "PATCH",
  5860. params: {
  5861. body: {
  5862. type: "string"
  5863. },
  5864. name: {
  5865. type: "string"
  5866. },
  5867. organization_permission: {
  5868. type: "string"
  5869. },
  5870. private: {
  5871. type: "boolean"
  5872. },
  5873. project_id: {
  5874. required: true,
  5875. type: "integer"
  5876. },
  5877. state: {
  5878. enum: ["open", "closed"],
  5879. type: "string"
  5880. }
  5881. },
  5882. url: "/projects/:project_id"
  5883. },
  5884. updateCard: {
  5885. headers: {
  5886. accept: "application/vnd.github.inertia-preview+json"
  5887. },
  5888. method: "PATCH",
  5889. params: {
  5890. archived: {
  5891. type: "boolean"
  5892. },
  5893. card_id: {
  5894. required: true,
  5895. type: "integer"
  5896. },
  5897. note: {
  5898. type: "string"
  5899. }
  5900. },
  5901. url: "/projects/columns/cards/:card_id"
  5902. },
  5903. updateColumn: {
  5904. headers: {
  5905. accept: "application/vnd.github.inertia-preview+json"
  5906. },
  5907. method: "PATCH",
  5908. params: {
  5909. column_id: {
  5910. required: true,
  5911. type: "integer"
  5912. },
  5913. name: {
  5914. required: true,
  5915. type: "string"
  5916. }
  5917. },
  5918. url: "/projects/columns/:column_id"
  5919. }
  5920. },
  5921. pulls: {
  5922. checkIfMerged: {
  5923. method: "GET",
  5924. params: {
  5925. number: {
  5926. alias: "pull_number",
  5927. deprecated: true,
  5928. type: "integer"
  5929. },
  5930. owner: {
  5931. required: true,
  5932. type: "string"
  5933. },
  5934. pull_number: {
  5935. required: true,
  5936. type: "integer"
  5937. },
  5938. repo: {
  5939. required: true,
  5940. type: "string"
  5941. }
  5942. },
  5943. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  5944. },
  5945. create: {
  5946. method: "POST",
  5947. params: {
  5948. base: {
  5949. required: true,
  5950. type: "string"
  5951. },
  5952. body: {
  5953. type: "string"
  5954. },
  5955. draft: {
  5956. type: "boolean"
  5957. },
  5958. head: {
  5959. required: true,
  5960. type: "string"
  5961. },
  5962. maintainer_can_modify: {
  5963. type: "boolean"
  5964. },
  5965. owner: {
  5966. required: true,
  5967. type: "string"
  5968. },
  5969. repo: {
  5970. required: true,
  5971. type: "string"
  5972. },
  5973. title: {
  5974. required: true,
  5975. type: "string"
  5976. }
  5977. },
  5978. url: "/repos/:owner/:repo/pulls"
  5979. },
  5980. createComment: {
  5981. method: "POST",
  5982. params: {
  5983. body: {
  5984. required: true,
  5985. type: "string"
  5986. },
  5987. commit_id: {
  5988. required: true,
  5989. type: "string"
  5990. },
  5991. in_reply_to: {
  5992. deprecated: true,
  5993. 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.",
  5994. type: "integer"
  5995. },
  5996. line: {
  5997. type: "integer"
  5998. },
  5999. number: {
  6000. alias: "pull_number",
  6001. deprecated: true,
  6002. type: "integer"
  6003. },
  6004. owner: {
  6005. required: true,
  6006. type: "string"
  6007. },
  6008. path: {
  6009. required: true,
  6010. type: "string"
  6011. },
  6012. position: {
  6013. type: "integer"
  6014. },
  6015. pull_number: {
  6016. required: true,
  6017. type: "integer"
  6018. },
  6019. repo: {
  6020. required: true,
  6021. type: "string"
  6022. },
  6023. side: {
  6024. enum: ["LEFT", "RIGHT"],
  6025. type: "string"
  6026. },
  6027. start_line: {
  6028. type: "integer"
  6029. },
  6030. start_side: {
  6031. enum: ["LEFT", "RIGHT", "side"],
  6032. type: "string"
  6033. }
  6034. },
  6035. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  6036. },
  6037. createCommentReply: {
  6038. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  6039. method: "POST",
  6040. params: {
  6041. body: {
  6042. required: true,
  6043. type: "string"
  6044. },
  6045. commit_id: {
  6046. required: true,
  6047. type: "string"
  6048. },
  6049. in_reply_to: {
  6050. deprecated: true,
  6051. 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.",
  6052. type: "integer"
  6053. },
  6054. line: {
  6055. type: "integer"
  6056. },
  6057. number: {
  6058. alias: "pull_number",
  6059. deprecated: true,
  6060. type: "integer"
  6061. },
  6062. owner: {
  6063. required: true,
  6064. type: "string"
  6065. },
  6066. path: {
  6067. required: true,
  6068. type: "string"
  6069. },
  6070. position: {
  6071. type: "integer"
  6072. },
  6073. pull_number: {
  6074. required: true,
  6075. type: "integer"
  6076. },
  6077. repo: {
  6078. required: true,
  6079. type: "string"
  6080. },
  6081. side: {
  6082. enum: ["LEFT", "RIGHT"],
  6083. type: "string"
  6084. },
  6085. start_line: {
  6086. type: "integer"
  6087. },
  6088. start_side: {
  6089. enum: ["LEFT", "RIGHT", "side"],
  6090. type: "string"
  6091. }
  6092. },
  6093. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  6094. },
  6095. createFromIssue: {
  6096. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  6097. method: "POST",
  6098. params: {
  6099. base: {
  6100. required: true,
  6101. type: "string"
  6102. },
  6103. draft: {
  6104. type: "boolean"
  6105. },
  6106. head: {
  6107. required: true,
  6108. type: "string"
  6109. },
  6110. issue: {
  6111. required: true,
  6112. type: "integer"
  6113. },
  6114. maintainer_can_modify: {
  6115. type: "boolean"
  6116. },
  6117. owner: {
  6118. required: true,
  6119. type: "string"
  6120. },
  6121. repo: {
  6122. required: true,
  6123. type: "string"
  6124. }
  6125. },
  6126. url: "/repos/:owner/:repo/pulls"
  6127. },
  6128. createReview: {
  6129. method: "POST",
  6130. params: {
  6131. body: {
  6132. type: "string"
  6133. },
  6134. comments: {
  6135. type: "object[]"
  6136. },
  6137. "comments[].body": {
  6138. required: true,
  6139. type: "string"
  6140. },
  6141. "comments[].path": {
  6142. required: true,
  6143. type: "string"
  6144. },
  6145. "comments[].position": {
  6146. required: true,
  6147. type: "integer"
  6148. },
  6149. commit_id: {
  6150. type: "string"
  6151. },
  6152. event: {
  6153. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  6154. type: "string"
  6155. },
  6156. number: {
  6157. alias: "pull_number",
  6158. deprecated: true,
  6159. type: "integer"
  6160. },
  6161. owner: {
  6162. required: true,
  6163. type: "string"
  6164. },
  6165. pull_number: {
  6166. required: true,
  6167. type: "integer"
  6168. },
  6169. repo: {
  6170. required: true,
  6171. type: "string"
  6172. }
  6173. },
  6174. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  6175. },
  6176. createReviewCommentReply: {
  6177. method: "POST",
  6178. params: {
  6179. body: {
  6180. required: true,
  6181. type: "string"
  6182. },
  6183. comment_id: {
  6184. required: true,
  6185. type: "integer"
  6186. },
  6187. owner: {
  6188. required: true,
  6189. type: "string"
  6190. },
  6191. pull_number: {
  6192. required: true,
  6193. type: "integer"
  6194. },
  6195. repo: {
  6196. required: true,
  6197. type: "string"
  6198. }
  6199. },
  6200. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  6201. },
  6202. createReviewRequest: {
  6203. method: "POST",
  6204. params: {
  6205. number: {
  6206. alias: "pull_number",
  6207. deprecated: true,
  6208. type: "integer"
  6209. },
  6210. owner: {
  6211. required: true,
  6212. type: "string"
  6213. },
  6214. pull_number: {
  6215. required: true,
  6216. type: "integer"
  6217. },
  6218. repo: {
  6219. required: true,
  6220. type: "string"
  6221. },
  6222. reviewers: {
  6223. type: "string[]"
  6224. },
  6225. team_reviewers: {
  6226. type: "string[]"
  6227. }
  6228. },
  6229. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  6230. },
  6231. deleteComment: {
  6232. method: "DELETE",
  6233. params: {
  6234. comment_id: {
  6235. required: true,
  6236. type: "integer"
  6237. },
  6238. owner: {
  6239. required: true,
  6240. type: "string"
  6241. },
  6242. repo: {
  6243. required: true,
  6244. type: "string"
  6245. }
  6246. },
  6247. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  6248. },
  6249. deletePendingReview: {
  6250. method: "DELETE",
  6251. params: {
  6252. number: {
  6253. alias: "pull_number",
  6254. deprecated: true,
  6255. type: "integer"
  6256. },
  6257. owner: {
  6258. required: true,
  6259. type: "string"
  6260. },
  6261. pull_number: {
  6262. required: true,
  6263. type: "integer"
  6264. },
  6265. repo: {
  6266. required: true,
  6267. type: "string"
  6268. },
  6269. review_id: {
  6270. required: true,
  6271. type: "integer"
  6272. }
  6273. },
  6274. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  6275. },
  6276. deleteReviewRequest: {
  6277. method: "DELETE",
  6278. params: {
  6279. number: {
  6280. alias: "pull_number",
  6281. deprecated: true,
  6282. type: "integer"
  6283. },
  6284. owner: {
  6285. required: true,
  6286. type: "string"
  6287. },
  6288. pull_number: {
  6289. required: true,
  6290. type: "integer"
  6291. },
  6292. repo: {
  6293. required: true,
  6294. type: "string"
  6295. },
  6296. reviewers: {
  6297. type: "string[]"
  6298. },
  6299. team_reviewers: {
  6300. type: "string[]"
  6301. }
  6302. },
  6303. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  6304. },
  6305. dismissReview: {
  6306. method: "PUT",
  6307. params: {
  6308. message: {
  6309. required: true,
  6310. type: "string"
  6311. },
  6312. number: {
  6313. alias: "pull_number",
  6314. deprecated: true,
  6315. type: "integer"
  6316. },
  6317. owner: {
  6318. required: true,
  6319. type: "string"
  6320. },
  6321. pull_number: {
  6322. required: true,
  6323. type: "integer"
  6324. },
  6325. repo: {
  6326. required: true,
  6327. type: "string"
  6328. },
  6329. review_id: {
  6330. required: true,
  6331. type: "integer"
  6332. }
  6333. },
  6334. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  6335. },
  6336. get: {
  6337. method: "GET",
  6338. params: {
  6339. number: {
  6340. alias: "pull_number",
  6341. deprecated: true,
  6342. type: "integer"
  6343. },
  6344. owner: {
  6345. required: true,
  6346. type: "string"
  6347. },
  6348. pull_number: {
  6349. required: true,
  6350. type: "integer"
  6351. },
  6352. repo: {
  6353. required: true,
  6354. type: "string"
  6355. }
  6356. },
  6357. url: "/repos/:owner/:repo/pulls/:pull_number"
  6358. },
  6359. getComment: {
  6360. method: "GET",
  6361. params: {
  6362. comment_id: {
  6363. required: true,
  6364. type: "integer"
  6365. },
  6366. owner: {
  6367. required: true,
  6368. type: "string"
  6369. },
  6370. repo: {
  6371. required: true,
  6372. type: "string"
  6373. }
  6374. },
  6375. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  6376. },
  6377. getCommentsForReview: {
  6378. method: "GET",
  6379. params: {
  6380. number: {
  6381. alias: "pull_number",
  6382. deprecated: true,
  6383. type: "integer"
  6384. },
  6385. owner: {
  6386. required: true,
  6387. type: "string"
  6388. },
  6389. page: {
  6390. type: "integer"
  6391. },
  6392. per_page: {
  6393. type: "integer"
  6394. },
  6395. pull_number: {
  6396. required: true,
  6397. type: "integer"
  6398. },
  6399. repo: {
  6400. required: true,
  6401. type: "string"
  6402. },
  6403. review_id: {
  6404. required: true,
  6405. type: "integer"
  6406. }
  6407. },
  6408. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  6409. },
  6410. getReview: {
  6411. method: "GET",
  6412. params: {
  6413. number: {
  6414. alias: "pull_number",
  6415. deprecated: true,
  6416. type: "integer"
  6417. },
  6418. owner: {
  6419. required: true,
  6420. type: "string"
  6421. },
  6422. pull_number: {
  6423. required: true,
  6424. type: "integer"
  6425. },
  6426. repo: {
  6427. required: true,
  6428. type: "string"
  6429. },
  6430. review_id: {
  6431. required: true,
  6432. type: "integer"
  6433. }
  6434. },
  6435. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  6436. },
  6437. list: {
  6438. method: "GET",
  6439. params: {
  6440. base: {
  6441. type: "string"
  6442. },
  6443. direction: {
  6444. enum: ["asc", "desc"],
  6445. type: "string"
  6446. },
  6447. head: {
  6448. type: "string"
  6449. },
  6450. owner: {
  6451. required: true,
  6452. type: "string"
  6453. },
  6454. page: {
  6455. type: "integer"
  6456. },
  6457. per_page: {
  6458. type: "integer"
  6459. },
  6460. repo: {
  6461. required: true,
  6462. type: "string"
  6463. },
  6464. sort: {
  6465. enum: ["created", "updated", "popularity", "long-running"],
  6466. type: "string"
  6467. },
  6468. state: {
  6469. enum: ["open", "closed", "all"],
  6470. type: "string"
  6471. }
  6472. },
  6473. url: "/repos/:owner/:repo/pulls"
  6474. },
  6475. listComments: {
  6476. method: "GET",
  6477. params: {
  6478. direction: {
  6479. enum: ["asc", "desc"],
  6480. type: "string"
  6481. },
  6482. number: {
  6483. alias: "pull_number",
  6484. deprecated: true,
  6485. type: "integer"
  6486. },
  6487. owner: {
  6488. required: true,
  6489. type: "string"
  6490. },
  6491. page: {
  6492. type: "integer"
  6493. },
  6494. per_page: {
  6495. type: "integer"
  6496. },
  6497. pull_number: {
  6498. required: true,
  6499. type: "integer"
  6500. },
  6501. repo: {
  6502. required: true,
  6503. type: "string"
  6504. },
  6505. since: {
  6506. type: "string"
  6507. },
  6508. sort: {
  6509. enum: ["created", "updated"],
  6510. type: "string"
  6511. }
  6512. },
  6513. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  6514. },
  6515. listCommentsForRepo: {
  6516. method: "GET",
  6517. params: {
  6518. direction: {
  6519. enum: ["asc", "desc"],
  6520. type: "string"
  6521. },
  6522. owner: {
  6523. required: true,
  6524. type: "string"
  6525. },
  6526. page: {
  6527. type: "integer"
  6528. },
  6529. per_page: {
  6530. type: "integer"
  6531. },
  6532. repo: {
  6533. required: true,
  6534. type: "string"
  6535. },
  6536. since: {
  6537. type: "string"
  6538. },
  6539. sort: {
  6540. enum: ["created", "updated"],
  6541. type: "string"
  6542. }
  6543. },
  6544. url: "/repos/:owner/:repo/pulls/comments"
  6545. },
  6546. listCommits: {
  6547. method: "GET",
  6548. params: {
  6549. number: {
  6550. alias: "pull_number",
  6551. deprecated: true,
  6552. type: "integer"
  6553. },
  6554. owner: {
  6555. required: true,
  6556. type: "string"
  6557. },
  6558. page: {
  6559. type: "integer"
  6560. },
  6561. per_page: {
  6562. type: "integer"
  6563. },
  6564. pull_number: {
  6565. required: true,
  6566. type: "integer"
  6567. },
  6568. repo: {
  6569. required: true,
  6570. type: "string"
  6571. }
  6572. },
  6573. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  6574. },
  6575. listFiles: {
  6576. method: "GET",
  6577. params: {
  6578. number: {
  6579. alias: "pull_number",
  6580. deprecated: true,
  6581. type: "integer"
  6582. },
  6583. owner: {
  6584. required: true,
  6585. type: "string"
  6586. },
  6587. page: {
  6588. type: "integer"
  6589. },
  6590. per_page: {
  6591. type: "integer"
  6592. },
  6593. pull_number: {
  6594. required: true,
  6595. type: "integer"
  6596. },
  6597. repo: {
  6598. required: true,
  6599. type: "string"
  6600. }
  6601. },
  6602. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  6603. },
  6604. listReviewRequests: {
  6605. method: "GET",
  6606. params: {
  6607. number: {
  6608. alias: "pull_number",
  6609. deprecated: true,
  6610. type: "integer"
  6611. },
  6612. owner: {
  6613. required: true,
  6614. type: "string"
  6615. },
  6616. page: {
  6617. type: "integer"
  6618. },
  6619. per_page: {
  6620. type: "integer"
  6621. },
  6622. pull_number: {
  6623. required: true,
  6624. type: "integer"
  6625. },
  6626. repo: {
  6627. required: true,
  6628. type: "string"
  6629. }
  6630. },
  6631. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  6632. },
  6633. listReviews: {
  6634. method: "GET",
  6635. params: {
  6636. number: {
  6637. alias: "pull_number",
  6638. deprecated: true,
  6639. type: "integer"
  6640. },
  6641. owner: {
  6642. required: true,
  6643. type: "string"
  6644. },
  6645. page: {
  6646. type: "integer"
  6647. },
  6648. per_page: {
  6649. type: "integer"
  6650. },
  6651. pull_number: {
  6652. required: true,
  6653. type: "integer"
  6654. },
  6655. repo: {
  6656. required: true,
  6657. type: "string"
  6658. }
  6659. },
  6660. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  6661. },
  6662. merge: {
  6663. method: "PUT",
  6664. params: {
  6665. commit_message: {
  6666. type: "string"
  6667. },
  6668. commit_title: {
  6669. type: "string"
  6670. },
  6671. merge_method: {
  6672. enum: ["merge", "squash", "rebase"],
  6673. type: "string"
  6674. },
  6675. number: {
  6676. alias: "pull_number",
  6677. deprecated: true,
  6678. type: "integer"
  6679. },
  6680. owner: {
  6681. required: true,
  6682. type: "string"
  6683. },
  6684. pull_number: {
  6685. required: true,
  6686. type: "integer"
  6687. },
  6688. repo: {
  6689. required: true,
  6690. type: "string"
  6691. },
  6692. sha: {
  6693. type: "string"
  6694. }
  6695. },
  6696. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  6697. },
  6698. submitReview: {
  6699. method: "POST",
  6700. params: {
  6701. body: {
  6702. type: "string"
  6703. },
  6704. event: {
  6705. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  6706. required: true,
  6707. type: "string"
  6708. },
  6709. number: {
  6710. alias: "pull_number",
  6711. deprecated: true,
  6712. type: "integer"
  6713. },
  6714. owner: {
  6715. required: true,
  6716. type: "string"
  6717. },
  6718. pull_number: {
  6719. required: true,
  6720. type: "integer"
  6721. },
  6722. repo: {
  6723. required: true,
  6724. type: "string"
  6725. },
  6726. review_id: {
  6727. required: true,
  6728. type: "integer"
  6729. }
  6730. },
  6731. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  6732. },
  6733. update: {
  6734. method: "PATCH",
  6735. params: {
  6736. base: {
  6737. type: "string"
  6738. },
  6739. body: {
  6740. type: "string"
  6741. },
  6742. maintainer_can_modify: {
  6743. type: "boolean"
  6744. },
  6745. number: {
  6746. alias: "pull_number",
  6747. deprecated: true,
  6748. type: "integer"
  6749. },
  6750. owner: {
  6751. required: true,
  6752. type: "string"
  6753. },
  6754. pull_number: {
  6755. required: true,
  6756. type: "integer"
  6757. },
  6758. repo: {
  6759. required: true,
  6760. type: "string"
  6761. },
  6762. state: {
  6763. enum: ["open", "closed"],
  6764. type: "string"
  6765. },
  6766. title: {
  6767. type: "string"
  6768. }
  6769. },
  6770. url: "/repos/:owner/:repo/pulls/:pull_number"
  6771. },
  6772. updateBranch: {
  6773. headers: {
  6774. accept: "application/vnd.github.lydian-preview+json"
  6775. },
  6776. method: "PUT",
  6777. params: {
  6778. expected_head_sha: {
  6779. type: "string"
  6780. },
  6781. owner: {
  6782. required: true,
  6783. type: "string"
  6784. },
  6785. pull_number: {
  6786. required: true,
  6787. type: "integer"
  6788. },
  6789. repo: {
  6790. required: true,
  6791. type: "string"
  6792. }
  6793. },
  6794. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  6795. },
  6796. updateComment: {
  6797. method: "PATCH",
  6798. params: {
  6799. body: {
  6800. required: true,
  6801. type: "string"
  6802. },
  6803. comment_id: {
  6804. required: true,
  6805. type: "integer"
  6806. },
  6807. owner: {
  6808. required: true,
  6809. type: "string"
  6810. },
  6811. repo: {
  6812. required: true,
  6813. type: "string"
  6814. }
  6815. },
  6816. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  6817. },
  6818. updateReview: {
  6819. method: "PUT",
  6820. params: {
  6821. body: {
  6822. required: true,
  6823. type: "string"
  6824. },
  6825. number: {
  6826. alias: "pull_number",
  6827. deprecated: true,
  6828. type: "integer"
  6829. },
  6830. owner: {
  6831. required: true,
  6832. type: "string"
  6833. },
  6834. pull_number: {
  6835. required: true,
  6836. type: "integer"
  6837. },
  6838. repo: {
  6839. required: true,
  6840. type: "string"
  6841. },
  6842. review_id: {
  6843. required: true,
  6844. type: "integer"
  6845. }
  6846. },
  6847. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  6848. }
  6849. },
  6850. rateLimit: {
  6851. get: {
  6852. method: "GET",
  6853. params: {},
  6854. url: "/rate_limit"
  6855. }
  6856. },
  6857. reactions: {
  6858. createForCommitComment: {
  6859. headers: {
  6860. accept: "application/vnd.github.squirrel-girl-preview+json"
  6861. },
  6862. method: "POST",
  6863. params: {
  6864. comment_id: {
  6865. required: true,
  6866. type: "integer"
  6867. },
  6868. content: {
  6869. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  6870. required: true,
  6871. type: "string"
  6872. },
  6873. owner: {
  6874. required: true,
  6875. type: "string"
  6876. },
  6877. repo: {
  6878. required: true,
  6879. type: "string"
  6880. }
  6881. },
  6882. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  6883. },
  6884. createForIssue: {
  6885. headers: {
  6886. accept: "application/vnd.github.squirrel-girl-preview+json"
  6887. },
  6888. method: "POST",
  6889. params: {
  6890. content: {
  6891. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  6892. required: true,
  6893. type: "string"
  6894. },
  6895. issue_number: {
  6896. required: true,
  6897. type: "integer"
  6898. },
  6899. number: {
  6900. alias: "issue_number",
  6901. deprecated: true,
  6902. type: "integer"
  6903. },
  6904. owner: {
  6905. required: true,
  6906. type: "string"
  6907. },
  6908. repo: {
  6909. required: true,
  6910. type: "string"
  6911. }
  6912. },
  6913. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  6914. },
  6915. createForIssueComment: {
  6916. headers: {
  6917. accept: "application/vnd.github.squirrel-girl-preview+json"
  6918. },
  6919. method: "POST",
  6920. params: {
  6921. comment_id: {
  6922. required: true,
  6923. type: "integer"
  6924. },
  6925. content: {
  6926. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  6927. required: true,
  6928. type: "string"
  6929. },
  6930. owner: {
  6931. required: true,
  6932. type: "string"
  6933. },
  6934. repo: {
  6935. required: true,
  6936. type: "string"
  6937. }
  6938. },
  6939. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  6940. },
  6941. createForPullRequestReviewComment: {
  6942. headers: {
  6943. accept: "application/vnd.github.squirrel-girl-preview+json"
  6944. },
  6945. method: "POST",
  6946. params: {
  6947. comment_id: {
  6948. required: true,
  6949. type: "integer"
  6950. },
  6951. content: {
  6952. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  6953. required: true,
  6954. type: "string"
  6955. },
  6956. owner: {
  6957. required: true,
  6958. type: "string"
  6959. },
  6960. repo: {
  6961. required: true,
  6962. type: "string"
  6963. }
  6964. },
  6965. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  6966. },
  6967. createForTeamDiscussion: {
  6968. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  6969. headers: {
  6970. accept: "application/vnd.github.squirrel-girl-preview+json"
  6971. },
  6972. method: "POST",
  6973. params: {
  6974. content: {
  6975. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  6976. required: true,
  6977. type: "string"
  6978. },
  6979. discussion_number: {
  6980. required: true,
  6981. type: "integer"
  6982. },
  6983. team_id: {
  6984. required: true,
  6985. type: "integer"
  6986. }
  6987. },
  6988. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  6989. },
  6990. createForTeamDiscussionComment: {
  6991. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  6992. headers: {
  6993. accept: "application/vnd.github.squirrel-girl-preview+json"
  6994. },
  6995. method: "POST",
  6996. params: {
  6997. comment_number: {
  6998. required: true,
  6999. type: "integer"
  7000. },
  7001. content: {
  7002. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7003. required: true,
  7004. type: "string"
  7005. },
  7006. discussion_number: {
  7007. required: true,
  7008. type: "integer"
  7009. },
  7010. team_id: {
  7011. required: true,
  7012. type: "integer"
  7013. }
  7014. },
  7015. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  7016. },
  7017. createForTeamDiscussionCommentInOrg: {
  7018. headers: {
  7019. accept: "application/vnd.github.squirrel-girl-preview+json"
  7020. },
  7021. method: "POST",
  7022. params: {
  7023. comment_number: {
  7024. required: true,
  7025. type: "integer"
  7026. },
  7027. content: {
  7028. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7029. required: true,
  7030. type: "string"
  7031. },
  7032. discussion_number: {
  7033. required: true,
  7034. type: "integer"
  7035. },
  7036. org: {
  7037. required: true,
  7038. type: "string"
  7039. },
  7040. team_slug: {
  7041. required: true,
  7042. type: "string"
  7043. }
  7044. },
  7045. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  7046. },
  7047. createForTeamDiscussionCommentLegacy: {
  7048. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  7049. headers: {
  7050. accept: "application/vnd.github.squirrel-girl-preview+json"
  7051. },
  7052. method: "POST",
  7053. params: {
  7054. comment_number: {
  7055. required: true,
  7056. type: "integer"
  7057. },
  7058. content: {
  7059. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7060. required: true,
  7061. type: "string"
  7062. },
  7063. discussion_number: {
  7064. required: true,
  7065. type: "integer"
  7066. },
  7067. team_id: {
  7068. required: true,
  7069. type: "integer"
  7070. }
  7071. },
  7072. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  7073. },
  7074. createForTeamDiscussionInOrg: {
  7075. headers: {
  7076. accept: "application/vnd.github.squirrel-girl-preview+json"
  7077. },
  7078. method: "POST",
  7079. params: {
  7080. content: {
  7081. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7082. required: true,
  7083. type: "string"
  7084. },
  7085. discussion_number: {
  7086. required: true,
  7087. type: "integer"
  7088. },
  7089. org: {
  7090. required: true,
  7091. type: "string"
  7092. },
  7093. team_slug: {
  7094. required: true,
  7095. type: "string"
  7096. }
  7097. },
  7098. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  7099. },
  7100. createForTeamDiscussionLegacy: {
  7101. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  7102. headers: {
  7103. accept: "application/vnd.github.squirrel-girl-preview+json"
  7104. },
  7105. method: "POST",
  7106. params: {
  7107. content: {
  7108. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7109. required: true,
  7110. type: "string"
  7111. },
  7112. discussion_number: {
  7113. required: true,
  7114. type: "integer"
  7115. },
  7116. team_id: {
  7117. required: true,
  7118. type: "integer"
  7119. }
  7120. },
  7121. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  7122. },
  7123. delete: {
  7124. headers: {
  7125. accept: "application/vnd.github.squirrel-girl-preview+json"
  7126. },
  7127. method: "DELETE",
  7128. params: {
  7129. reaction_id: {
  7130. required: true,
  7131. type: "integer"
  7132. }
  7133. },
  7134. url: "/reactions/:reaction_id"
  7135. },
  7136. listForCommitComment: {
  7137. headers: {
  7138. accept: "application/vnd.github.squirrel-girl-preview+json"
  7139. },
  7140. method: "GET",
  7141. params: {
  7142. comment_id: {
  7143. required: true,
  7144. type: "integer"
  7145. },
  7146. content: {
  7147. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7148. type: "string"
  7149. },
  7150. owner: {
  7151. required: true,
  7152. type: "string"
  7153. },
  7154. page: {
  7155. type: "integer"
  7156. },
  7157. per_page: {
  7158. type: "integer"
  7159. },
  7160. repo: {
  7161. required: true,
  7162. type: "string"
  7163. }
  7164. },
  7165. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  7166. },
  7167. listForIssue: {
  7168. headers: {
  7169. accept: "application/vnd.github.squirrel-girl-preview+json"
  7170. },
  7171. method: "GET",
  7172. params: {
  7173. content: {
  7174. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7175. type: "string"
  7176. },
  7177. issue_number: {
  7178. required: true,
  7179. type: "integer"
  7180. },
  7181. number: {
  7182. alias: "issue_number",
  7183. deprecated: true,
  7184. type: "integer"
  7185. },
  7186. owner: {
  7187. required: true,
  7188. type: "string"
  7189. },
  7190. page: {
  7191. type: "integer"
  7192. },
  7193. per_page: {
  7194. type: "integer"
  7195. },
  7196. repo: {
  7197. required: true,
  7198. type: "string"
  7199. }
  7200. },
  7201. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  7202. },
  7203. listForIssueComment: {
  7204. headers: {
  7205. accept: "application/vnd.github.squirrel-girl-preview+json"
  7206. },
  7207. method: "GET",
  7208. params: {
  7209. comment_id: {
  7210. required: true,
  7211. type: "integer"
  7212. },
  7213. content: {
  7214. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7215. type: "string"
  7216. },
  7217. owner: {
  7218. required: true,
  7219. type: "string"
  7220. },
  7221. page: {
  7222. type: "integer"
  7223. },
  7224. per_page: {
  7225. type: "integer"
  7226. },
  7227. repo: {
  7228. required: true,
  7229. type: "string"
  7230. }
  7231. },
  7232. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  7233. },
  7234. listForPullRequestReviewComment: {
  7235. headers: {
  7236. accept: "application/vnd.github.squirrel-girl-preview+json"
  7237. },
  7238. method: "GET",
  7239. params: {
  7240. comment_id: {
  7241. required: true,
  7242. type: "integer"
  7243. },
  7244. content: {
  7245. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7246. type: "string"
  7247. },
  7248. owner: {
  7249. required: true,
  7250. type: "string"
  7251. },
  7252. page: {
  7253. type: "integer"
  7254. },
  7255. per_page: {
  7256. type: "integer"
  7257. },
  7258. repo: {
  7259. required: true,
  7260. type: "string"
  7261. }
  7262. },
  7263. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  7264. },
  7265. listForTeamDiscussion: {
  7266. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  7267. headers: {
  7268. accept: "application/vnd.github.squirrel-girl-preview+json"
  7269. },
  7270. method: "GET",
  7271. params: {
  7272. content: {
  7273. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7274. type: "string"
  7275. },
  7276. discussion_number: {
  7277. required: true,
  7278. type: "integer"
  7279. },
  7280. page: {
  7281. type: "integer"
  7282. },
  7283. per_page: {
  7284. type: "integer"
  7285. },
  7286. team_id: {
  7287. required: true,
  7288. type: "integer"
  7289. }
  7290. },
  7291. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  7292. },
  7293. listForTeamDiscussionComment: {
  7294. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  7295. headers: {
  7296. accept: "application/vnd.github.squirrel-girl-preview+json"
  7297. },
  7298. method: "GET",
  7299. params: {
  7300. comment_number: {
  7301. required: true,
  7302. type: "integer"
  7303. },
  7304. content: {
  7305. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7306. type: "string"
  7307. },
  7308. discussion_number: {
  7309. required: true,
  7310. type: "integer"
  7311. },
  7312. page: {
  7313. type: "integer"
  7314. },
  7315. per_page: {
  7316. type: "integer"
  7317. },
  7318. team_id: {
  7319. required: true,
  7320. type: "integer"
  7321. }
  7322. },
  7323. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  7324. },
  7325. listForTeamDiscussionCommentInOrg: {
  7326. headers: {
  7327. accept: "application/vnd.github.squirrel-girl-preview+json"
  7328. },
  7329. method: "GET",
  7330. params: {
  7331. comment_number: {
  7332. required: true,
  7333. type: "integer"
  7334. },
  7335. content: {
  7336. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7337. type: "string"
  7338. },
  7339. discussion_number: {
  7340. required: true,
  7341. type: "integer"
  7342. },
  7343. org: {
  7344. required: true,
  7345. type: "string"
  7346. },
  7347. page: {
  7348. type: "integer"
  7349. },
  7350. per_page: {
  7351. type: "integer"
  7352. },
  7353. team_slug: {
  7354. required: true,
  7355. type: "string"
  7356. }
  7357. },
  7358. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  7359. },
  7360. listForTeamDiscussionCommentLegacy: {
  7361. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  7362. headers: {
  7363. accept: "application/vnd.github.squirrel-girl-preview+json"
  7364. },
  7365. method: "GET",
  7366. params: {
  7367. comment_number: {
  7368. required: true,
  7369. type: "integer"
  7370. },
  7371. content: {
  7372. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7373. type: "string"
  7374. },
  7375. discussion_number: {
  7376. required: true,
  7377. type: "integer"
  7378. },
  7379. page: {
  7380. type: "integer"
  7381. },
  7382. per_page: {
  7383. type: "integer"
  7384. },
  7385. team_id: {
  7386. required: true,
  7387. type: "integer"
  7388. }
  7389. },
  7390. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  7391. },
  7392. listForTeamDiscussionInOrg: {
  7393. headers: {
  7394. accept: "application/vnd.github.squirrel-girl-preview+json"
  7395. },
  7396. method: "GET",
  7397. params: {
  7398. content: {
  7399. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7400. type: "string"
  7401. },
  7402. discussion_number: {
  7403. required: true,
  7404. type: "integer"
  7405. },
  7406. org: {
  7407. required: true,
  7408. type: "string"
  7409. },
  7410. page: {
  7411. type: "integer"
  7412. },
  7413. per_page: {
  7414. type: "integer"
  7415. },
  7416. team_slug: {
  7417. required: true,
  7418. type: "string"
  7419. }
  7420. },
  7421. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  7422. },
  7423. listForTeamDiscussionLegacy: {
  7424. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  7425. headers: {
  7426. accept: "application/vnd.github.squirrel-girl-preview+json"
  7427. },
  7428. method: "GET",
  7429. params: {
  7430. content: {
  7431. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  7432. type: "string"
  7433. },
  7434. discussion_number: {
  7435. required: true,
  7436. type: "integer"
  7437. },
  7438. page: {
  7439. type: "integer"
  7440. },
  7441. per_page: {
  7442. type: "integer"
  7443. },
  7444. team_id: {
  7445. required: true,
  7446. type: "integer"
  7447. }
  7448. },
  7449. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  7450. }
  7451. },
  7452. repos: {
  7453. acceptInvitation: {
  7454. method: "PATCH",
  7455. params: {
  7456. invitation_id: {
  7457. required: true,
  7458. type: "integer"
  7459. }
  7460. },
  7461. url: "/user/repository_invitations/:invitation_id"
  7462. },
  7463. addCollaborator: {
  7464. method: "PUT",
  7465. params: {
  7466. owner: {
  7467. required: true,
  7468. type: "string"
  7469. },
  7470. permission: {
  7471. enum: ["pull", "push", "admin"],
  7472. type: "string"
  7473. },
  7474. repo: {
  7475. required: true,
  7476. type: "string"
  7477. },
  7478. username: {
  7479. required: true,
  7480. type: "string"
  7481. }
  7482. },
  7483. url: "/repos/:owner/:repo/collaborators/:username"
  7484. },
  7485. addDeployKey: {
  7486. method: "POST",
  7487. params: {
  7488. key: {
  7489. required: true,
  7490. type: "string"
  7491. },
  7492. owner: {
  7493. required: true,
  7494. type: "string"
  7495. },
  7496. read_only: {
  7497. type: "boolean"
  7498. },
  7499. repo: {
  7500. required: true,
  7501. type: "string"
  7502. },
  7503. title: {
  7504. type: "string"
  7505. }
  7506. },
  7507. url: "/repos/:owner/:repo/keys"
  7508. },
  7509. addProtectedBranchAdminEnforcement: {
  7510. method: "POST",
  7511. params: {
  7512. branch: {
  7513. required: true,
  7514. type: "string"
  7515. },
  7516. owner: {
  7517. required: true,
  7518. type: "string"
  7519. },
  7520. repo: {
  7521. required: true,
  7522. type: "string"
  7523. }
  7524. },
  7525. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  7526. },
  7527. addProtectedBranchAppRestrictions: {
  7528. method: "POST",
  7529. params: {
  7530. apps: {
  7531. mapTo: "data",
  7532. required: true,
  7533. type: "string[]"
  7534. },
  7535. branch: {
  7536. required: true,
  7537. type: "string"
  7538. },
  7539. owner: {
  7540. required: true,
  7541. type: "string"
  7542. },
  7543. repo: {
  7544. required: true,
  7545. type: "string"
  7546. }
  7547. },
  7548. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  7549. },
  7550. addProtectedBranchRequiredSignatures: {
  7551. headers: {
  7552. accept: "application/vnd.github.zzzax-preview+json"
  7553. },
  7554. method: "POST",
  7555. params: {
  7556. branch: {
  7557. required: true,
  7558. type: "string"
  7559. },
  7560. owner: {
  7561. required: true,
  7562. type: "string"
  7563. },
  7564. repo: {
  7565. required: true,
  7566. type: "string"
  7567. }
  7568. },
  7569. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  7570. },
  7571. addProtectedBranchRequiredStatusChecksContexts: {
  7572. method: "POST",
  7573. params: {
  7574. branch: {
  7575. required: true,
  7576. type: "string"
  7577. },
  7578. contexts: {
  7579. mapTo: "data",
  7580. required: true,
  7581. type: "string[]"
  7582. },
  7583. owner: {
  7584. required: true,
  7585. type: "string"
  7586. },
  7587. repo: {
  7588. required: true,
  7589. type: "string"
  7590. }
  7591. },
  7592. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  7593. },
  7594. addProtectedBranchTeamRestrictions: {
  7595. method: "POST",
  7596. params: {
  7597. branch: {
  7598. required: true,
  7599. type: "string"
  7600. },
  7601. owner: {
  7602. required: true,
  7603. type: "string"
  7604. },
  7605. repo: {
  7606. required: true,
  7607. type: "string"
  7608. },
  7609. teams: {
  7610. mapTo: "data",
  7611. required: true,
  7612. type: "string[]"
  7613. }
  7614. },
  7615. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  7616. },
  7617. addProtectedBranchUserRestrictions: {
  7618. method: "POST",
  7619. params: {
  7620. branch: {
  7621. required: true,
  7622. type: "string"
  7623. },
  7624. owner: {
  7625. required: true,
  7626. type: "string"
  7627. },
  7628. repo: {
  7629. required: true,
  7630. type: "string"
  7631. },
  7632. users: {
  7633. mapTo: "data",
  7634. required: true,
  7635. type: "string[]"
  7636. }
  7637. },
  7638. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  7639. },
  7640. checkCollaborator: {
  7641. method: "GET",
  7642. params: {
  7643. owner: {
  7644. required: true,
  7645. type: "string"
  7646. },
  7647. repo: {
  7648. required: true,
  7649. type: "string"
  7650. },
  7651. username: {
  7652. required: true,
  7653. type: "string"
  7654. }
  7655. },
  7656. url: "/repos/:owner/:repo/collaborators/:username"
  7657. },
  7658. checkVulnerabilityAlerts: {
  7659. headers: {
  7660. accept: "application/vnd.github.dorian-preview+json"
  7661. },
  7662. method: "GET",
  7663. params: {
  7664. owner: {
  7665. required: true,
  7666. type: "string"
  7667. },
  7668. repo: {
  7669. required: true,
  7670. type: "string"
  7671. }
  7672. },
  7673. url: "/repos/:owner/:repo/vulnerability-alerts"
  7674. },
  7675. compareCommits: {
  7676. method: "GET",
  7677. params: {
  7678. base: {
  7679. required: true,
  7680. type: "string"
  7681. },
  7682. head: {
  7683. required: true,
  7684. type: "string"
  7685. },
  7686. owner: {
  7687. required: true,
  7688. type: "string"
  7689. },
  7690. repo: {
  7691. required: true,
  7692. type: "string"
  7693. }
  7694. },
  7695. url: "/repos/:owner/:repo/compare/:base...:head"
  7696. },
  7697. createCommitComment: {
  7698. method: "POST",
  7699. params: {
  7700. body: {
  7701. required: true,
  7702. type: "string"
  7703. },
  7704. commit_sha: {
  7705. required: true,
  7706. type: "string"
  7707. },
  7708. line: {
  7709. type: "integer"
  7710. },
  7711. owner: {
  7712. required: true,
  7713. type: "string"
  7714. },
  7715. path: {
  7716. type: "string"
  7717. },
  7718. position: {
  7719. type: "integer"
  7720. },
  7721. repo: {
  7722. required: true,
  7723. type: "string"
  7724. },
  7725. sha: {
  7726. alias: "commit_sha",
  7727. deprecated: true,
  7728. type: "string"
  7729. }
  7730. },
  7731. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  7732. },
  7733. createDeployment: {
  7734. method: "POST",
  7735. params: {
  7736. auto_merge: {
  7737. type: "boolean"
  7738. },
  7739. description: {
  7740. type: "string"
  7741. },
  7742. environment: {
  7743. type: "string"
  7744. },
  7745. owner: {
  7746. required: true,
  7747. type: "string"
  7748. },
  7749. payload: {
  7750. type: "string"
  7751. },
  7752. production_environment: {
  7753. type: "boolean"
  7754. },
  7755. ref: {
  7756. required: true,
  7757. type: "string"
  7758. },
  7759. repo: {
  7760. required: true,
  7761. type: "string"
  7762. },
  7763. required_contexts: {
  7764. type: "string[]"
  7765. },
  7766. task: {
  7767. type: "string"
  7768. },
  7769. transient_environment: {
  7770. type: "boolean"
  7771. }
  7772. },
  7773. url: "/repos/:owner/:repo/deployments"
  7774. },
  7775. createDeploymentStatus: {
  7776. method: "POST",
  7777. params: {
  7778. auto_inactive: {
  7779. type: "boolean"
  7780. },
  7781. deployment_id: {
  7782. required: true,
  7783. type: "integer"
  7784. },
  7785. description: {
  7786. type: "string"
  7787. },
  7788. environment: {
  7789. enum: ["production", "staging", "qa"],
  7790. type: "string"
  7791. },
  7792. environment_url: {
  7793. type: "string"
  7794. },
  7795. log_url: {
  7796. type: "string"
  7797. },
  7798. owner: {
  7799. required: true,
  7800. type: "string"
  7801. },
  7802. repo: {
  7803. required: true,
  7804. type: "string"
  7805. },
  7806. state: {
  7807. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  7808. required: true,
  7809. type: "string"
  7810. },
  7811. target_url: {
  7812. type: "string"
  7813. }
  7814. },
  7815. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  7816. },
  7817. createDispatchEvent: {
  7818. method: "POST",
  7819. params: {
  7820. client_payload: {
  7821. type: "object"
  7822. },
  7823. event_type: {
  7824. type: "string"
  7825. },
  7826. owner: {
  7827. required: true,
  7828. type: "string"
  7829. },
  7830. repo: {
  7831. required: true,
  7832. type: "string"
  7833. }
  7834. },
  7835. url: "/repos/:owner/:repo/dispatches"
  7836. },
  7837. createFile: {
  7838. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  7839. method: "PUT",
  7840. params: {
  7841. author: {
  7842. type: "object"
  7843. },
  7844. "author.email": {
  7845. required: true,
  7846. type: "string"
  7847. },
  7848. "author.name": {
  7849. required: true,
  7850. type: "string"
  7851. },
  7852. branch: {
  7853. type: "string"
  7854. },
  7855. committer: {
  7856. type: "object"
  7857. },
  7858. "committer.email": {
  7859. required: true,
  7860. type: "string"
  7861. },
  7862. "committer.name": {
  7863. required: true,
  7864. type: "string"
  7865. },
  7866. content: {
  7867. required: true,
  7868. type: "string"
  7869. },
  7870. message: {
  7871. required: true,
  7872. type: "string"
  7873. },
  7874. owner: {
  7875. required: true,
  7876. type: "string"
  7877. },
  7878. path: {
  7879. required: true,
  7880. type: "string"
  7881. },
  7882. repo: {
  7883. required: true,
  7884. type: "string"
  7885. },
  7886. sha: {
  7887. type: "string"
  7888. }
  7889. },
  7890. url: "/repos/:owner/:repo/contents/:path"
  7891. },
  7892. createForAuthenticatedUser: {
  7893. method: "POST",
  7894. params: {
  7895. allow_merge_commit: {
  7896. type: "boolean"
  7897. },
  7898. allow_rebase_merge: {
  7899. type: "boolean"
  7900. },
  7901. allow_squash_merge: {
  7902. type: "boolean"
  7903. },
  7904. auto_init: {
  7905. type: "boolean"
  7906. },
  7907. delete_branch_on_merge: {
  7908. type: "boolean"
  7909. },
  7910. description: {
  7911. type: "string"
  7912. },
  7913. gitignore_template: {
  7914. type: "string"
  7915. },
  7916. has_issues: {
  7917. type: "boolean"
  7918. },
  7919. has_projects: {
  7920. type: "boolean"
  7921. },
  7922. has_wiki: {
  7923. type: "boolean"
  7924. },
  7925. homepage: {
  7926. type: "string"
  7927. },
  7928. is_template: {
  7929. type: "boolean"
  7930. },
  7931. license_template: {
  7932. type: "string"
  7933. },
  7934. name: {
  7935. required: true,
  7936. type: "string"
  7937. },
  7938. private: {
  7939. type: "boolean"
  7940. },
  7941. team_id: {
  7942. type: "integer"
  7943. },
  7944. visibility: {
  7945. enum: ["public", "private", "visibility", "internal"],
  7946. type: "string"
  7947. }
  7948. },
  7949. url: "/user/repos"
  7950. },
  7951. createFork: {
  7952. method: "POST",
  7953. params: {
  7954. organization: {
  7955. type: "string"
  7956. },
  7957. owner: {
  7958. required: true,
  7959. type: "string"
  7960. },
  7961. repo: {
  7962. required: true,
  7963. type: "string"
  7964. }
  7965. },
  7966. url: "/repos/:owner/:repo/forks"
  7967. },
  7968. createHook: {
  7969. method: "POST",
  7970. params: {
  7971. active: {
  7972. type: "boolean"
  7973. },
  7974. config: {
  7975. required: true,
  7976. type: "object"
  7977. },
  7978. "config.content_type": {
  7979. type: "string"
  7980. },
  7981. "config.insecure_ssl": {
  7982. type: "string"
  7983. },
  7984. "config.secret": {
  7985. type: "string"
  7986. },
  7987. "config.url": {
  7988. required: true,
  7989. type: "string"
  7990. },
  7991. events: {
  7992. type: "string[]"
  7993. },
  7994. name: {
  7995. type: "string"
  7996. },
  7997. owner: {
  7998. required: true,
  7999. type: "string"
  8000. },
  8001. repo: {
  8002. required: true,
  8003. type: "string"
  8004. }
  8005. },
  8006. url: "/repos/:owner/:repo/hooks"
  8007. },
  8008. createInOrg: {
  8009. method: "POST",
  8010. params: {
  8011. allow_merge_commit: {
  8012. type: "boolean"
  8013. },
  8014. allow_rebase_merge: {
  8015. type: "boolean"
  8016. },
  8017. allow_squash_merge: {
  8018. type: "boolean"
  8019. },
  8020. auto_init: {
  8021. type: "boolean"
  8022. },
  8023. delete_branch_on_merge: {
  8024. type: "boolean"
  8025. },
  8026. description: {
  8027. type: "string"
  8028. },
  8029. gitignore_template: {
  8030. type: "string"
  8031. },
  8032. has_issues: {
  8033. type: "boolean"
  8034. },
  8035. has_projects: {
  8036. type: "boolean"
  8037. },
  8038. has_wiki: {
  8039. type: "boolean"
  8040. },
  8041. homepage: {
  8042. type: "string"
  8043. },
  8044. is_template: {
  8045. type: "boolean"
  8046. },
  8047. license_template: {
  8048. type: "string"
  8049. },
  8050. name: {
  8051. required: true,
  8052. type: "string"
  8053. },
  8054. org: {
  8055. required: true,
  8056. type: "string"
  8057. },
  8058. private: {
  8059. type: "boolean"
  8060. },
  8061. team_id: {
  8062. type: "integer"
  8063. },
  8064. visibility: {
  8065. enum: ["public", "private", "visibility", "internal"],
  8066. type: "string"
  8067. }
  8068. },
  8069. url: "/orgs/:org/repos"
  8070. },
  8071. createOrUpdateFile: {
  8072. method: "PUT",
  8073. params: {
  8074. author: {
  8075. type: "object"
  8076. },
  8077. "author.email": {
  8078. required: true,
  8079. type: "string"
  8080. },
  8081. "author.name": {
  8082. required: true,
  8083. type: "string"
  8084. },
  8085. branch: {
  8086. type: "string"
  8087. },
  8088. committer: {
  8089. type: "object"
  8090. },
  8091. "committer.email": {
  8092. required: true,
  8093. type: "string"
  8094. },
  8095. "committer.name": {
  8096. required: true,
  8097. type: "string"
  8098. },
  8099. content: {
  8100. required: true,
  8101. type: "string"
  8102. },
  8103. message: {
  8104. required: true,
  8105. type: "string"
  8106. },
  8107. owner: {
  8108. required: true,
  8109. type: "string"
  8110. },
  8111. path: {
  8112. required: true,
  8113. type: "string"
  8114. },
  8115. repo: {
  8116. required: true,
  8117. type: "string"
  8118. },
  8119. sha: {
  8120. type: "string"
  8121. }
  8122. },
  8123. url: "/repos/:owner/:repo/contents/:path"
  8124. },
  8125. createRelease: {
  8126. method: "POST",
  8127. params: {
  8128. body: {
  8129. type: "string"
  8130. },
  8131. draft: {
  8132. type: "boolean"
  8133. },
  8134. name: {
  8135. type: "string"
  8136. },
  8137. owner: {
  8138. required: true,
  8139. type: "string"
  8140. },
  8141. prerelease: {
  8142. type: "boolean"
  8143. },
  8144. repo: {
  8145. required: true,
  8146. type: "string"
  8147. },
  8148. tag_name: {
  8149. required: true,
  8150. type: "string"
  8151. },
  8152. target_commitish: {
  8153. type: "string"
  8154. }
  8155. },
  8156. url: "/repos/:owner/:repo/releases"
  8157. },
  8158. createStatus: {
  8159. method: "POST",
  8160. params: {
  8161. context: {
  8162. type: "string"
  8163. },
  8164. description: {
  8165. type: "string"
  8166. },
  8167. owner: {
  8168. required: true,
  8169. type: "string"
  8170. },
  8171. repo: {
  8172. required: true,
  8173. type: "string"
  8174. },
  8175. sha: {
  8176. required: true,
  8177. type: "string"
  8178. },
  8179. state: {
  8180. enum: ["error", "failure", "pending", "success"],
  8181. required: true,
  8182. type: "string"
  8183. },
  8184. target_url: {
  8185. type: "string"
  8186. }
  8187. },
  8188. url: "/repos/:owner/:repo/statuses/:sha"
  8189. },
  8190. createUsingTemplate: {
  8191. headers: {
  8192. accept: "application/vnd.github.baptiste-preview+json"
  8193. },
  8194. method: "POST",
  8195. params: {
  8196. description: {
  8197. type: "string"
  8198. },
  8199. name: {
  8200. required: true,
  8201. type: "string"
  8202. },
  8203. owner: {
  8204. type: "string"
  8205. },
  8206. private: {
  8207. type: "boolean"
  8208. },
  8209. template_owner: {
  8210. required: true,
  8211. type: "string"
  8212. },
  8213. template_repo: {
  8214. required: true,
  8215. type: "string"
  8216. }
  8217. },
  8218. url: "/repos/:template_owner/:template_repo/generate"
  8219. },
  8220. declineInvitation: {
  8221. method: "DELETE",
  8222. params: {
  8223. invitation_id: {
  8224. required: true,
  8225. type: "integer"
  8226. }
  8227. },
  8228. url: "/user/repository_invitations/:invitation_id"
  8229. },
  8230. delete: {
  8231. method: "DELETE",
  8232. params: {
  8233. owner: {
  8234. required: true,
  8235. type: "string"
  8236. },
  8237. repo: {
  8238. required: true,
  8239. type: "string"
  8240. }
  8241. },
  8242. url: "/repos/:owner/:repo"
  8243. },
  8244. deleteCommitComment: {
  8245. method: "DELETE",
  8246. params: {
  8247. comment_id: {
  8248. required: true,
  8249. type: "integer"
  8250. },
  8251. owner: {
  8252. required: true,
  8253. type: "string"
  8254. },
  8255. repo: {
  8256. required: true,
  8257. type: "string"
  8258. }
  8259. },
  8260. url: "/repos/:owner/:repo/comments/:comment_id"
  8261. },
  8262. deleteDownload: {
  8263. method: "DELETE",
  8264. params: {
  8265. download_id: {
  8266. required: true,
  8267. type: "integer"
  8268. },
  8269. owner: {
  8270. required: true,
  8271. type: "string"
  8272. },
  8273. repo: {
  8274. required: true,
  8275. type: "string"
  8276. }
  8277. },
  8278. url: "/repos/:owner/:repo/downloads/:download_id"
  8279. },
  8280. deleteFile: {
  8281. method: "DELETE",
  8282. params: {
  8283. author: {
  8284. type: "object"
  8285. },
  8286. "author.email": {
  8287. type: "string"
  8288. },
  8289. "author.name": {
  8290. type: "string"
  8291. },
  8292. branch: {
  8293. type: "string"
  8294. },
  8295. committer: {
  8296. type: "object"
  8297. },
  8298. "committer.email": {
  8299. type: "string"
  8300. },
  8301. "committer.name": {
  8302. type: "string"
  8303. },
  8304. message: {
  8305. required: true,
  8306. type: "string"
  8307. },
  8308. owner: {
  8309. required: true,
  8310. type: "string"
  8311. },
  8312. path: {
  8313. required: true,
  8314. type: "string"
  8315. },
  8316. repo: {
  8317. required: true,
  8318. type: "string"
  8319. },
  8320. sha: {
  8321. required: true,
  8322. type: "string"
  8323. }
  8324. },
  8325. url: "/repos/:owner/:repo/contents/:path"
  8326. },
  8327. deleteHook: {
  8328. method: "DELETE",
  8329. params: {
  8330. hook_id: {
  8331. required: true,
  8332. type: "integer"
  8333. },
  8334. owner: {
  8335. required: true,
  8336. type: "string"
  8337. },
  8338. repo: {
  8339. required: true,
  8340. type: "string"
  8341. }
  8342. },
  8343. url: "/repos/:owner/:repo/hooks/:hook_id"
  8344. },
  8345. deleteInvitation: {
  8346. method: "DELETE",
  8347. params: {
  8348. invitation_id: {
  8349. required: true,
  8350. type: "integer"
  8351. },
  8352. owner: {
  8353. required: true,
  8354. type: "string"
  8355. },
  8356. repo: {
  8357. required: true,
  8358. type: "string"
  8359. }
  8360. },
  8361. url: "/repos/:owner/:repo/invitations/:invitation_id"
  8362. },
  8363. deleteRelease: {
  8364. method: "DELETE",
  8365. params: {
  8366. owner: {
  8367. required: true,
  8368. type: "string"
  8369. },
  8370. release_id: {
  8371. required: true,
  8372. type: "integer"
  8373. },
  8374. repo: {
  8375. required: true,
  8376. type: "string"
  8377. }
  8378. },
  8379. url: "/repos/:owner/:repo/releases/:release_id"
  8380. },
  8381. deleteReleaseAsset: {
  8382. method: "DELETE",
  8383. params: {
  8384. asset_id: {
  8385. required: true,
  8386. type: "integer"
  8387. },
  8388. owner: {
  8389. required: true,
  8390. type: "string"
  8391. },
  8392. repo: {
  8393. required: true,
  8394. type: "string"
  8395. }
  8396. },
  8397. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  8398. },
  8399. disableAutomatedSecurityFixes: {
  8400. headers: {
  8401. accept: "application/vnd.github.london-preview+json"
  8402. },
  8403. method: "DELETE",
  8404. params: {
  8405. owner: {
  8406. required: true,
  8407. type: "string"
  8408. },
  8409. repo: {
  8410. required: true,
  8411. type: "string"
  8412. }
  8413. },
  8414. url: "/repos/:owner/:repo/automated-security-fixes"
  8415. },
  8416. disablePagesSite: {
  8417. headers: {
  8418. accept: "application/vnd.github.switcheroo-preview+json"
  8419. },
  8420. method: "DELETE",
  8421. params: {
  8422. owner: {
  8423. required: true,
  8424. type: "string"
  8425. },
  8426. repo: {
  8427. required: true,
  8428. type: "string"
  8429. }
  8430. },
  8431. url: "/repos/:owner/:repo/pages"
  8432. },
  8433. disableVulnerabilityAlerts: {
  8434. headers: {
  8435. accept: "application/vnd.github.dorian-preview+json"
  8436. },
  8437. method: "DELETE",
  8438. params: {
  8439. owner: {
  8440. required: true,
  8441. type: "string"
  8442. },
  8443. repo: {
  8444. required: true,
  8445. type: "string"
  8446. }
  8447. },
  8448. url: "/repos/:owner/:repo/vulnerability-alerts"
  8449. },
  8450. enableAutomatedSecurityFixes: {
  8451. headers: {
  8452. accept: "application/vnd.github.london-preview+json"
  8453. },
  8454. method: "PUT",
  8455. params: {
  8456. owner: {
  8457. required: true,
  8458. type: "string"
  8459. },
  8460. repo: {
  8461. required: true,
  8462. type: "string"
  8463. }
  8464. },
  8465. url: "/repos/:owner/:repo/automated-security-fixes"
  8466. },
  8467. enablePagesSite: {
  8468. headers: {
  8469. accept: "application/vnd.github.switcheroo-preview+json"
  8470. },
  8471. method: "POST",
  8472. params: {
  8473. owner: {
  8474. required: true,
  8475. type: "string"
  8476. },
  8477. repo: {
  8478. required: true,
  8479. type: "string"
  8480. },
  8481. source: {
  8482. type: "object"
  8483. },
  8484. "source.branch": {
  8485. enum: ["master", "gh-pages"],
  8486. type: "string"
  8487. },
  8488. "source.path": {
  8489. type: "string"
  8490. }
  8491. },
  8492. url: "/repos/:owner/:repo/pages"
  8493. },
  8494. enableVulnerabilityAlerts: {
  8495. headers: {
  8496. accept: "application/vnd.github.dorian-preview+json"
  8497. },
  8498. method: "PUT",
  8499. params: {
  8500. owner: {
  8501. required: true,
  8502. type: "string"
  8503. },
  8504. repo: {
  8505. required: true,
  8506. type: "string"
  8507. }
  8508. },
  8509. url: "/repos/:owner/:repo/vulnerability-alerts"
  8510. },
  8511. get: {
  8512. method: "GET",
  8513. params: {
  8514. owner: {
  8515. required: true,
  8516. type: "string"
  8517. },
  8518. repo: {
  8519. required: true,
  8520. type: "string"
  8521. }
  8522. },
  8523. url: "/repos/:owner/:repo"
  8524. },
  8525. getAppsWithAccessToProtectedBranch: {
  8526. method: "GET",
  8527. params: {
  8528. branch: {
  8529. required: true,
  8530. type: "string"
  8531. },
  8532. owner: {
  8533. required: true,
  8534. type: "string"
  8535. },
  8536. repo: {
  8537. required: true,
  8538. type: "string"
  8539. }
  8540. },
  8541. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  8542. },
  8543. getArchiveLink: {
  8544. method: "GET",
  8545. params: {
  8546. archive_format: {
  8547. required: true,
  8548. type: "string"
  8549. },
  8550. owner: {
  8551. required: true,
  8552. type: "string"
  8553. },
  8554. ref: {
  8555. required: true,
  8556. type: "string"
  8557. },
  8558. repo: {
  8559. required: true,
  8560. type: "string"
  8561. }
  8562. },
  8563. url: "/repos/:owner/:repo/:archive_format/:ref"
  8564. },
  8565. getBranch: {
  8566. method: "GET",
  8567. params: {
  8568. branch: {
  8569. required: true,
  8570. type: "string"
  8571. },
  8572. owner: {
  8573. required: true,
  8574. type: "string"
  8575. },
  8576. repo: {
  8577. required: true,
  8578. type: "string"
  8579. }
  8580. },
  8581. url: "/repos/:owner/:repo/branches/:branch"
  8582. },
  8583. getBranchProtection: {
  8584. method: "GET",
  8585. params: {
  8586. branch: {
  8587. required: true,
  8588. type: "string"
  8589. },
  8590. owner: {
  8591. required: true,
  8592. type: "string"
  8593. },
  8594. repo: {
  8595. required: true,
  8596. type: "string"
  8597. }
  8598. },
  8599. url: "/repos/:owner/:repo/branches/:branch/protection"
  8600. },
  8601. getClones: {
  8602. method: "GET",
  8603. params: {
  8604. owner: {
  8605. required: true,
  8606. type: "string"
  8607. },
  8608. per: {
  8609. enum: ["day", "week"],
  8610. type: "string"
  8611. },
  8612. repo: {
  8613. required: true,
  8614. type: "string"
  8615. }
  8616. },
  8617. url: "/repos/:owner/:repo/traffic/clones"
  8618. },
  8619. getCodeFrequencyStats: {
  8620. method: "GET",
  8621. params: {
  8622. owner: {
  8623. required: true,
  8624. type: "string"
  8625. },
  8626. repo: {
  8627. required: true,
  8628. type: "string"
  8629. }
  8630. },
  8631. url: "/repos/:owner/:repo/stats/code_frequency"
  8632. },
  8633. getCollaboratorPermissionLevel: {
  8634. method: "GET",
  8635. params: {
  8636. owner: {
  8637. required: true,
  8638. type: "string"
  8639. },
  8640. repo: {
  8641. required: true,
  8642. type: "string"
  8643. },
  8644. username: {
  8645. required: true,
  8646. type: "string"
  8647. }
  8648. },
  8649. url: "/repos/:owner/:repo/collaborators/:username/permission"
  8650. },
  8651. getCombinedStatusForRef: {
  8652. method: "GET",
  8653. params: {
  8654. owner: {
  8655. required: true,
  8656. type: "string"
  8657. },
  8658. ref: {
  8659. required: true,
  8660. type: "string"
  8661. },
  8662. repo: {
  8663. required: true,
  8664. type: "string"
  8665. }
  8666. },
  8667. url: "/repos/:owner/:repo/commits/:ref/status"
  8668. },
  8669. getCommit: {
  8670. method: "GET",
  8671. params: {
  8672. commit_sha: {
  8673. alias: "ref",
  8674. deprecated: true,
  8675. type: "string"
  8676. },
  8677. owner: {
  8678. required: true,
  8679. type: "string"
  8680. },
  8681. ref: {
  8682. required: true,
  8683. type: "string"
  8684. },
  8685. repo: {
  8686. required: true,
  8687. type: "string"
  8688. },
  8689. sha: {
  8690. alias: "ref",
  8691. deprecated: true,
  8692. type: "string"
  8693. }
  8694. },
  8695. url: "/repos/:owner/:repo/commits/:ref"
  8696. },
  8697. getCommitActivityStats: {
  8698. method: "GET",
  8699. params: {
  8700. owner: {
  8701. required: true,
  8702. type: "string"
  8703. },
  8704. repo: {
  8705. required: true,
  8706. type: "string"
  8707. }
  8708. },
  8709. url: "/repos/:owner/:repo/stats/commit_activity"
  8710. },
  8711. getCommitComment: {
  8712. method: "GET",
  8713. params: {
  8714. comment_id: {
  8715. required: true,
  8716. type: "integer"
  8717. },
  8718. owner: {
  8719. required: true,
  8720. type: "string"
  8721. },
  8722. repo: {
  8723. required: true,
  8724. type: "string"
  8725. }
  8726. },
  8727. url: "/repos/:owner/:repo/comments/:comment_id"
  8728. },
  8729. getCommitRefSha: {
  8730. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  8731. headers: {
  8732. accept: "application/vnd.github.v3.sha"
  8733. },
  8734. method: "GET",
  8735. params: {
  8736. owner: {
  8737. required: true,
  8738. type: "string"
  8739. },
  8740. ref: {
  8741. required: true,
  8742. type: "string"
  8743. },
  8744. repo: {
  8745. required: true,
  8746. type: "string"
  8747. }
  8748. },
  8749. url: "/repos/:owner/:repo/commits/:ref"
  8750. },
  8751. getContents: {
  8752. method: "GET",
  8753. params: {
  8754. owner: {
  8755. required: true,
  8756. type: "string"
  8757. },
  8758. path: {
  8759. required: true,
  8760. type: "string"
  8761. },
  8762. ref: {
  8763. type: "string"
  8764. },
  8765. repo: {
  8766. required: true,
  8767. type: "string"
  8768. }
  8769. },
  8770. url: "/repos/:owner/:repo/contents/:path"
  8771. },
  8772. getContributorsStats: {
  8773. method: "GET",
  8774. params: {
  8775. owner: {
  8776. required: true,
  8777. type: "string"
  8778. },
  8779. repo: {
  8780. required: true,
  8781. type: "string"
  8782. }
  8783. },
  8784. url: "/repos/:owner/:repo/stats/contributors"
  8785. },
  8786. getDeployKey: {
  8787. method: "GET",
  8788. params: {
  8789. key_id: {
  8790. required: true,
  8791. type: "integer"
  8792. },
  8793. owner: {
  8794. required: true,
  8795. type: "string"
  8796. },
  8797. repo: {
  8798. required: true,
  8799. type: "string"
  8800. }
  8801. },
  8802. url: "/repos/:owner/:repo/keys/:key_id"
  8803. },
  8804. getDeployment: {
  8805. method: "GET",
  8806. params: {
  8807. deployment_id: {
  8808. required: true,
  8809. type: "integer"
  8810. },
  8811. owner: {
  8812. required: true,
  8813. type: "string"
  8814. },
  8815. repo: {
  8816. required: true,
  8817. type: "string"
  8818. }
  8819. },
  8820. url: "/repos/:owner/:repo/deployments/:deployment_id"
  8821. },
  8822. getDeploymentStatus: {
  8823. method: "GET",
  8824. params: {
  8825. deployment_id: {
  8826. required: true,
  8827. type: "integer"
  8828. },
  8829. owner: {
  8830. required: true,
  8831. type: "string"
  8832. },
  8833. repo: {
  8834. required: true,
  8835. type: "string"
  8836. },
  8837. status_id: {
  8838. required: true,
  8839. type: "integer"
  8840. }
  8841. },
  8842. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  8843. },
  8844. getDownload: {
  8845. method: "GET",
  8846. params: {
  8847. download_id: {
  8848. required: true,
  8849. type: "integer"
  8850. },
  8851. owner: {
  8852. required: true,
  8853. type: "string"
  8854. },
  8855. repo: {
  8856. required: true,
  8857. type: "string"
  8858. }
  8859. },
  8860. url: "/repos/:owner/:repo/downloads/:download_id"
  8861. },
  8862. getHook: {
  8863. method: "GET",
  8864. params: {
  8865. hook_id: {
  8866. required: true,
  8867. type: "integer"
  8868. },
  8869. owner: {
  8870. required: true,
  8871. type: "string"
  8872. },
  8873. repo: {
  8874. required: true,
  8875. type: "string"
  8876. }
  8877. },
  8878. url: "/repos/:owner/:repo/hooks/:hook_id"
  8879. },
  8880. getLatestPagesBuild: {
  8881. method: "GET",
  8882. params: {
  8883. owner: {
  8884. required: true,
  8885. type: "string"
  8886. },
  8887. repo: {
  8888. required: true,
  8889. type: "string"
  8890. }
  8891. },
  8892. url: "/repos/:owner/:repo/pages/builds/latest"
  8893. },
  8894. getLatestRelease: {
  8895. method: "GET",
  8896. params: {
  8897. owner: {
  8898. required: true,
  8899. type: "string"
  8900. },
  8901. repo: {
  8902. required: true,
  8903. type: "string"
  8904. }
  8905. },
  8906. url: "/repos/:owner/:repo/releases/latest"
  8907. },
  8908. getPages: {
  8909. method: "GET",
  8910. params: {
  8911. owner: {
  8912. required: true,
  8913. type: "string"
  8914. },
  8915. repo: {
  8916. required: true,
  8917. type: "string"
  8918. }
  8919. },
  8920. url: "/repos/:owner/:repo/pages"
  8921. },
  8922. getPagesBuild: {
  8923. method: "GET",
  8924. params: {
  8925. build_id: {
  8926. required: true,
  8927. type: "integer"
  8928. },
  8929. owner: {
  8930. required: true,
  8931. type: "string"
  8932. },
  8933. repo: {
  8934. required: true,
  8935. type: "string"
  8936. }
  8937. },
  8938. url: "/repos/:owner/:repo/pages/builds/:build_id"
  8939. },
  8940. getParticipationStats: {
  8941. method: "GET",
  8942. params: {
  8943. owner: {
  8944. required: true,
  8945. type: "string"
  8946. },
  8947. repo: {
  8948. required: true,
  8949. type: "string"
  8950. }
  8951. },
  8952. url: "/repos/:owner/:repo/stats/participation"
  8953. },
  8954. getProtectedBranchAdminEnforcement: {
  8955. method: "GET",
  8956. params: {
  8957. branch: {
  8958. required: true,
  8959. type: "string"
  8960. },
  8961. owner: {
  8962. required: true,
  8963. type: "string"
  8964. },
  8965. repo: {
  8966. required: true,
  8967. type: "string"
  8968. }
  8969. },
  8970. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  8971. },
  8972. getProtectedBranchPullRequestReviewEnforcement: {
  8973. method: "GET",
  8974. params: {
  8975. branch: {
  8976. required: true,
  8977. type: "string"
  8978. },
  8979. owner: {
  8980. required: true,
  8981. type: "string"
  8982. },
  8983. repo: {
  8984. required: true,
  8985. type: "string"
  8986. }
  8987. },
  8988. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  8989. },
  8990. getProtectedBranchRequiredSignatures: {
  8991. headers: {
  8992. accept: "application/vnd.github.zzzax-preview+json"
  8993. },
  8994. method: "GET",
  8995. params: {
  8996. branch: {
  8997. required: true,
  8998. type: "string"
  8999. },
  9000. owner: {
  9001. required: true,
  9002. type: "string"
  9003. },
  9004. repo: {
  9005. required: true,
  9006. type: "string"
  9007. }
  9008. },
  9009. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  9010. },
  9011. getProtectedBranchRequiredStatusChecks: {
  9012. method: "GET",
  9013. params: {
  9014. branch: {
  9015. required: true,
  9016. type: "string"
  9017. },
  9018. owner: {
  9019. required: true,
  9020. type: "string"
  9021. },
  9022. repo: {
  9023. required: true,
  9024. type: "string"
  9025. }
  9026. },
  9027. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  9028. },
  9029. getProtectedBranchRestrictions: {
  9030. method: "GET",
  9031. params: {
  9032. branch: {
  9033. required: true,
  9034. type: "string"
  9035. },
  9036. owner: {
  9037. required: true,
  9038. type: "string"
  9039. },
  9040. repo: {
  9041. required: true,
  9042. type: "string"
  9043. }
  9044. },
  9045. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  9046. },
  9047. getPunchCardStats: {
  9048. method: "GET",
  9049. params: {
  9050. owner: {
  9051. required: true,
  9052. type: "string"
  9053. },
  9054. repo: {
  9055. required: true,
  9056. type: "string"
  9057. }
  9058. },
  9059. url: "/repos/:owner/:repo/stats/punch_card"
  9060. },
  9061. getReadme: {
  9062. method: "GET",
  9063. params: {
  9064. owner: {
  9065. required: true,
  9066. type: "string"
  9067. },
  9068. ref: {
  9069. type: "string"
  9070. },
  9071. repo: {
  9072. required: true,
  9073. type: "string"
  9074. }
  9075. },
  9076. url: "/repos/:owner/:repo/readme"
  9077. },
  9078. getRelease: {
  9079. method: "GET",
  9080. params: {
  9081. owner: {
  9082. required: true,
  9083. type: "string"
  9084. },
  9085. release_id: {
  9086. required: true,
  9087. type: "integer"
  9088. },
  9089. repo: {
  9090. required: true,
  9091. type: "string"
  9092. }
  9093. },
  9094. url: "/repos/:owner/:repo/releases/:release_id"
  9095. },
  9096. getReleaseAsset: {
  9097. method: "GET",
  9098. params: {
  9099. asset_id: {
  9100. required: true,
  9101. type: "integer"
  9102. },
  9103. owner: {
  9104. required: true,
  9105. type: "string"
  9106. },
  9107. repo: {
  9108. required: true,
  9109. type: "string"
  9110. }
  9111. },
  9112. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  9113. },
  9114. getReleaseByTag: {
  9115. method: "GET",
  9116. params: {
  9117. owner: {
  9118. required: true,
  9119. type: "string"
  9120. },
  9121. repo: {
  9122. required: true,
  9123. type: "string"
  9124. },
  9125. tag: {
  9126. required: true,
  9127. type: "string"
  9128. }
  9129. },
  9130. url: "/repos/:owner/:repo/releases/tags/:tag"
  9131. },
  9132. getTeamsWithAccessToProtectedBranch: {
  9133. method: "GET",
  9134. params: {
  9135. branch: {
  9136. required: true,
  9137. type: "string"
  9138. },
  9139. owner: {
  9140. required: true,
  9141. type: "string"
  9142. },
  9143. repo: {
  9144. required: true,
  9145. type: "string"
  9146. }
  9147. },
  9148. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  9149. },
  9150. getTopPaths: {
  9151. method: "GET",
  9152. params: {
  9153. owner: {
  9154. required: true,
  9155. type: "string"
  9156. },
  9157. repo: {
  9158. required: true,
  9159. type: "string"
  9160. }
  9161. },
  9162. url: "/repos/:owner/:repo/traffic/popular/paths"
  9163. },
  9164. getTopReferrers: {
  9165. method: "GET",
  9166. params: {
  9167. owner: {
  9168. required: true,
  9169. type: "string"
  9170. },
  9171. repo: {
  9172. required: true,
  9173. type: "string"
  9174. }
  9175. },
  9176. url: "/repos/:owner/:repo/traffic/popular/referrers"
  9177. },
  9178. getUsersWithAccessToProtectedBranch: {
  9179. method: "GET",
  9180. params: {
  9181. branch: {
  9182. required: true,
  9183. type: "string"
  9184. },
  9185. owner: {
  9186. required: true,
  9187. type: "string"
  9188. },
  9189. repo: {
  9190. required: true,
  9191. type: "string"
  9192. }
  9193. },
  9194. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  9195. },
  9196. getViews: {
  9197. method: "GET",
  9198. params: {
  9199. owner: {
  9200. required: true,
  9201. type: "string"
  9202. },
  9203. per: {
  9204. enum: ["day", "week"],
  9205. type: "string"
  9206. },
  9207. repo: {
  9208. required: true,
  9209. type: "string"
  9210. }
  9211. },
  9212. url: "/repos/:owner/:repo/traffic/views"
  9213. },
  9214. list: {
  9215. method: "GET",
  9216. params: {
  9217. affiliation: {
  9218. type: "string"
  9219. },
  9220. direction: {
  9221. enum: ["asc", "desc"],
  9222. type: "string"
  9223. },
  9224. page: {
  9225. type: "integer"
  9226. },
  9227. per_page: {
  9228. type: "integer"
  9229. },
  9230. sort: {
  9231. enum: ["created", "updated", "pushed", "full_name"],
  9232. type: "string"
  9233. },
  9234. type: {
  9235. enum: ["all", "owner", "public", "private", "member"],
  9236. type: "string"
  9237. },
  9238. visibility: {
  9239. enum: ["all", "public", "private"],
  9240. type: "string"
  9241. }
  9242. },
  9243. url: "/user/repos"
  9244. },
  9245. listAppsWithAccessToProtectedBranch: {
  9246. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  9247. method: "GET",
  9248. params: {
  9249. branch: {
  9250. required: true,
  9251. type: "string"
  9252. },
  9253. owner: {
  9254. required: true,
  9255. type: "string"
  9256. },
  9257. repo: {
  9258. required: true,
  9259. type: "string"
  9260. }
  9261. },
  9262. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  9263. },
  9264. listAssetsForRelease: {
  9265. method: "GET",
  9266. params: {
  9267. owner: {
  9268. required: true,
  9269. type: "string"
  9270. },
  9271. page: {
  9272. type: "integer"
  9273. },
  9274. per_page: {
  9275. type: "integer"
  9276. },
  9277. release_id: {
  9278. required: true,
  9279. type: "integer"
  9280. },
  9281. repo: {
  9282. required: true,
  9283. type: "string"
  9284. }
  9285. },
  9286. url: "/repos/:owner/:repo/releases/:release_id/assets"
  9287. },
  9288. listBranches: {
  9289. method: "GET",
  9290. params: {
  9291. owner: {
  9292. required: true,
  9293. type: "string"
  9294. },
  9295. page: {
  9296. type: "integer"
  9297. },
  9298. per_page: {
  9299. type: "integer"
  9300. },
  9301. protected: {
  9302. type: "boolean"
  9303. },
  9304. repo: {
  9305. required: true,
  9306. type: "string"
  9307. }
  9308. },
  9309. url: "/repos/:owner/:repo/branches"
  9310. },
  9311. listBranchesForHeadCommit: {
  9312. headers: {
  9313. accept: "application/vnd.github.groot-preview+json"
  9314. },
  9315. method: "GET",
  9316. params: {
  9317. commit_sha: {
  9318. required: true,
  9319. type: "string"
  9320. },
  9321. owner: {
  9322. required: true,
  9323. type: "string"
  9324. },
  9325. repo: {
  9326. required: true,
  9327. type: "string"
  9328. }
  9329. },
  9330. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  9331. },
  9332. listCollaborators: {
  9333. method: "GET",
  9334. params: {
  9335. affiliation: {
  9336. enum: ["outside", "direct", "all"],
  9337. type: "string"
  9338. },
  9339. owner: {
  9340. required: true,
  9341. type: "string"
  9342. },
  9343. page: {
  9344. type: "integer"
  9345. },
  9346. per_page: {
  9347. type: "integer"
  9348. },
  9349. repo: {
  9350. required: true,
  9351. type: "string"
  9352. }
  9353. },
  9354. url: "/repos/:owner/:repo/collaborators"
  9355. },
  9356. listCommentsForCommit: {
  9357. method: "GET",
  9358. params: {
  9359. commit_sha: {
  9360. required: true,
  9361. type: "string"
  9362. },
  9363. owner: {
  9364. required: true,
  9365. type: "string"
  9366. },
  9367. page: {
  9368. type: "integer"
  9369. },
  9370. per_page: {
  9371. type: "integer"
  9372. },
  9373. ref: {
  9374. alias: "commit_sha",
  9375. deprecated: true,
  9376. type: "string"
  9377. },
  9378. repo: {
  9379. required: true,
  9380. type: "string"
  9381. }
  9382. },
  9383. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  9384. },
  9385. listCommitComments: {
  9386. method: "GET",
  9387. params: {
  9388. owner: {
  9389. required: true,
  9390. type: "string"
  9391. },
  9392. page: {
  9393. type: "integer"
  9394. },
  9395. per_page: {
  9396. type: "integer"
  9397. },
  9398. repo: {
  9399. required: true,
  9400. type: "string"
  9401. }
  9402. },
  9403. url: "/repos/:owner/:repo/comments"
  9404. },
  9405. listCommits: {
  9406. method: "GET",
  9407. params: {
  9408. author: {
  9409. type: "string"
  9410. },
  9411. owner: {
  9412. required: true,
  9413. type: "string"
  9414. },
  9415. page: {
  9416. type: "integer"
  9417. },
  9418. path: {
  9419. type: "string"
  9420. },
  9421. per_page: {
  9422. type: "integer"
  9423. },
  9424. repo: {
  9425. required: true,
  9426. type: "string"
  9427. },
  9428. sha: {
  9429. type: "string"
  9430. },
  9431. since: {
  9432. type: "string"
  9433. },
  9434. until: {
  9435. type: "string"
  9436. }
  9437. },
  9438. url: "/repos/:owner/:repo/commits"
  9439. },
  9440. listContributors: {
  9441. method: "GET",
  9442. params: {
  9443. anon: {
  9444. type: "string"
  9445. },
  9446. owner: {
  9447. required: true,
  9448. type: "string"
  9449. },
  9450. page: {
  9451. type: "integer"
  9452. },
  9453. per_page: {
  9454. type: "integer"
  9455. },
  9456. repo: {
  9457. required: true,
  9458. type: "string"
  9459. }
  9460. },
  9461. url: "/repos/:owner/:repo/contributors"
  9462. },
  9463. listDeployKeys: {
  9464. method: "GET",
  9465. params: {
  9466. owner: {
  9467. required: true,
  9468. type: "string"
  9469. },
  9470. page: {
  9471. type: "integer"
  9472. },
  9473. per_page: {
  9474. type: "integer"
  9475. },
  9476. repo: {
  9477. required: true,
  9478. type: "string"
  9479. }
  9480. },
  9481. url: "/repos/:owner/:repo/keys"
  9482. },
  9483. listDeploymentStatuses: {
  9484. method: "GET",
  9485. params: {
  9486. deployment_id: {
  9487. required: true,
  9488. type: "integer"
  9489. },
  9490. owner: {
  9491. required: true,
  9492. type: "string"
  9493. },
  9494. page: {
  9495. type: "integer"
  9496. },
  9497. per_page: {
  9498. type: "integer"
  9499. },
  9500. repo: {
  9501. required: true,
  9502. type: "string"
  9503. }
  9504. },
  9505. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  9506. },
  9507. listDeployments: {
  9508. method: "GET",
  9509. params: {
  9510. environment: {
  9511. type: "string"
  9512. },
  9513. owner: {
  9514. required: true,
  9515. type: "string"
  9516. },
  9517. page: {
  9518. type: "integer"
  9519. },
  9520. per_page: {
  9521. type: "integer"
  9522. },
  9523. ref: {
  9524. type: "string"
  9525. },
  9526. repo: {
  9527. required: true,
  9528. type: "string"
  9529. },
  9530. sha: {
  9531. type: "string"
  9532. },
  9533. task: {
  9534. type: "string"
  9535. }
  9536. },
  9537. url: "/repos/:owner/:repo/deployments"
  9538. },
  9539. listDownloads: {
  9540. method: "GET",
  9541. params: {
  9542. owner: {
  9543. required: true,
  9544. type: "string"
  9545. },
  9546. page: {
  9547. type: "integer"
  9548. },
  9549. per_page: {
  9550. type: "integer"
  9551. },
  9552. repo: {
  9553. required: true,
  9554. type: "string"
  9555. }
  9556. },
  9557. url: "/repos/:owner/:repo/downloads"
  9558. },
  9559. listForOrg: {
  9560. method: "GET",
  9561. params: {
  9562. direction: {
  9563. enum: ["asc", "desc"],
  9564. type: "string"
  9565. },
  9566. org: {
  9567. required: true,
  9568. type: "string"
  9569. },
  9570. page: {
  9571. type: "integer"
  9572. },
  9573. per_page: {
  9574. type: "integer"
  9575. },
  9576. sort: {
  9577. enum: ["created", "updated", "pushed", "full_name"],
  9578. type: "string"
  9579. },
  9580. type: {
  9581. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  9582. type: "string"
  9583. }
  9584. },
  9585. url: "/orgs/:org/repos"
  9586. },
  9587. listForUser: {
  9588. method: "GET",
  9589. params: {
  9590. direction: {
  9591. enum: ["asc", "desc"],
  9592. type: "string"
  9593. },
  9594. page: {
  9595. type: "integer"
  9596. },
  9597. per_page: {
  9598. type: "integer"
  9599. },
  9600. sort: {
  9601. enum: ["created", "updated", "pushed", "full_name"],
  9602. type: "string"
  9603. },
  9604. type: {
  9605. enum: ["all", "owner", "member"],
  9606. type: "string"
  9607. },
  9608. username: {
  9609. required: true,
  9610. type: "string"
  9611. }
  9612. },
  9613. url: "/users/:username/repos"
  9614. },
  9615. listForks: {
  9616. method: "GET",
  9617. params: {
  9618. owner: {
  9619. required: true,
  9620. type: "string"
  9621. },
  9622. page: {
  9623. type: "integer"
  9624. },
  9625. per_page: {
  9626. type: "integer"
  9627. },
  9628. repo: {
  9629. required: true,
  9630. type: "string"
  9631. },
  9632. sort: {
  9633. enum: ["newest", "oldest", "stargazers"],
  9634. type: "string"
  9635. }
  9636. },
  9637. url: "/repos/:owner/:repo/forks"
  9638. },
  9639. listHooks: {
  9640. method: "GET",
  9641. params: {
  9642. owner: {
  9643. required: true,
  9644. type: "string"
  9645. },
  9646. page: {
  9647. type: "integer"
  9648. },
  9649. per_page: {
  9650. type: "integer"
  9651. },
  9652. repo: {
  9653. required: true,
  9654. type: "string"
  9655. }
  9656. },
  9657. url: "/repos/:owner/:repo/hooks"
  9658. },
  9659. listInvitations: {
  9660. method: "GET",
  9661. params: {
  9662. owner: {
  9663. required: true,
  9664. type: "string"
  9665. },
  9666. page: {
  9667. type: "integer"
  9668. },
  9669. per_page: {
  9670. type: "integer"
  9671. },
  9672. repo: {
  9673. required: true,
  9674. type: "string"
  9675. }
  9676. },
  9677. url: "/repos/:owner/:repo/invitations"
  9678. },
  9679. listInvitationsForAuthenticatedUser: {
  9680. method: "GET",
  9681. params: {
  9682. page: {
  9683. type: "integer"
  9684. },
  9685. per_page: {
  9686. type: "integer"
  9687. }
  9688. },
  9689. url: "/user/repository_invitations"
  9690. },
  9691. listLanguages: {
  9692. method: "GET",
  9693. params: {
  9694. owner: {
  9695. required: true,
  9696. type: "string"
  9697. },
  9698. repo: {
  9699. required: true,
  9700. type: "string"
  9701. }
  9702. },
  9703. url: "/repos/:owner/:repo/languages"
  9704. },
  9705. listPagesBuilds: {
  9706. method: "GET",
  9707. params: {
  9708. owner: {
  9709. required: true,
  9710. type: "string"
  9711. },
  9712. page: {
  9713. type: "integer"
  9714. },
  9715. per_page: {
  9716. type: "integer"
  9717. },
  9718. repo: {
  9719. required: true,
  9720. type: "string"
  9721. }
  9722. },
  9723. url: "/repos/:owner/:repo/pages/builds"
  9724. },
  9725. listProtectedBranchRequiredStatusChecksContexts: {
  9726. method: "GET",
  9727. params: {
  9728. branch: {
  9729. required: true,
  9730. type: "string"
  9731. },
  9732. owner: {
  9733. required: true,
  9734. type: "string"
  9735. },
  9736. repo: {
  9737. required: true,
  9738. type: "string"
  9739. }
  9740. },
  9741. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  9742. },
  9743. listProtectedBranchTeamRestrictions: {
  9744. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  9745. method: "GET",
  9746. params: {
  9747. branch: {
  9748. required: true,
  9749. type: "string"
  9750. },
  9751. owner: {
  9752. required: true,
  9753. type: "string"
  9754. },
  9755. repo: {
  9756. required: true,
  9757. type: "string"
  9758. }
  9759. },
  9760. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  9761. },
  9762. listProtectedBranchUserRestrictions: {
  9763. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  9764. method: "GET",
  9765. params: {
  9766. branch: {
  9767. required: true,
  9768. type: "string"
  9769. },
  9770. owner: {
  9771. required: true,
  9772. type: "string"
  9773. },
  9774. repo: {
  9775. required: true,
  9776. type: "string"
  9777. }
  9778. },
  9779. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  9780. },
  9781. listPublic: {
  9782. method: "GET",
  9783. params: {
  9784. page: {
  9785. type: "integer"
  9786. },
  9787. per_page: {
  9788. type: "integer"
  9789. },
  9790. since: {
  9791. type: "integer"
  9792. }
  9793. },
  9794. url: "/repositories"
  9795. },
  9796. listPullRequestsAssociatedWithCommit: {
  9797. headers: {
  9798. accept: "application/vnd.github.groot-preview+json"
  9799. },
  9800. method: "GET",
  9801. params: {
  9802. commit_sha: {
  9803. required: true,
  9804. type: "string"
  9805. },
  9806. owner: {
  9807. required: true,
  9808. type: "string"
  9809. },
  9810. page: {
  9811. type: "integer"
  9812. },
  9813. per_page: {
  9814. type: "integer"
  9815. },
  9816. repo: {
  9817. required: true,
  9818. type: "string"
  9819. }
  9820. },
  9821. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  9822. },
  9823. listReleases: {
  9824. method: "GET",
  9825. params: {
  9826. owner: {
  9827. required: true,
  9828. type: "string"
  9829. },
  9830. page: {
  9831. type: "integer"
  9832. },
  9833. per_page: {
  9834. type: "integer"
  9835. },
  9836. repo: {
  9837. required: true,
  9838. type: "string"
  9839. }
  9840. },
  9841. url: "/repos/:owner/:repo/releases"
  9842. },
  9843. listStatusesForRef: {
  9844. method: "GET",
  9845. params: {
  9846. owner: {
  9847. required: true,
  9848. type: "string"
  9849. },
  9850. page: {
  9851. type: "integer"
  9852. },
  9853. per_page: {
  9854. type: "integer"
  9855. },
  9856. ref: {
  9857. required: true,
  9858. type: "string"
  9859. },
  9860. repo: {
  9861. required: true,
  9862. type: "string"
  9863. }
  9864. },
  9865. url: "/repos/:owner/:repo/commits/:ref/statuses"
  9866. },
  9867. listTags: {
  9868. method: "GET",
  9869. params: {
  9870. owner: {
  9871. required: true,
  9872. type: "string"
  9873. },
  9874. page: {
  9875. type: "integer"
  9876. },
  9877. per_page: {
  9878. type: "integer"
  9879. },
  9880. repo: {
  9881. required: true,
  9882. type: "string"
  9883. }
  9884. },
  9885. url: "/repos/:owner/:repo/tags"
  9886. },
  9887. listTeams: {
  9888. method: "GET",
  9889. params: {
  9890. owner: {
  9891. required: true,
  9892. type: "string"
  9893. },
  9894. page: {
  9895. type: "integer"
  9896. },
  9897. per_page: {
  9898. type: "integer"
  9899. },
  9900. repo: {
  9901. required: true,
  9902. type: "string"
  9903. }
  9904. },
  9905. url: "/repos/:owner/:repo/teams"
  9906. },
  9907. listTeamsWithAccessToProtectedBranch: {
  9908. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  9909. method: "GET",
  9910. params: {
  9911. branch: {
  9912. required: true,
  9913. type: "string"
  9914. },
  9915. owner: {
  9916. required: true,
  9917. type: "string"
  9918. },
  9919. repo: {
  9920. required: true,
  9921. type: "string"
  9922. }
  9923. },
  9924. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  9925. },
  9926. listTopics: {
  9927. headers: {
  9928. accept: "application/vnd.github.mercy-preview+json"
  9929. },
  9930. method: "GET",
  9931. params: {
  9932. owner: {
  9933. required: true,
  9934. type: "string"
  9935. },
  9936. repo: {
  9937. required: true,
  9938. type: "string"
  9939. }
  9940. },
  9941. url: "/repos/:owner/:repo/topics"
  9942. },
  9943. listUsersWithAccessToProtectedBranch: {
  9944. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  9945. method: "GET",
  9946. params: {
  9947. branch: {
  9948. required: true,
  9949. type: "string"
  9950. },
  9951. owner: {
  9952. required: true,
  9953. type: "string"
  9954. },
  9955. repo: {
  9956. required: true,
  9957. type: "string"
  9958. }
  9959. },
  9960. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  9961. },
  9962. merge: {
  9963. method: "POST",
  9964. params: {
  9965. base: {
  9966. required: true,
  9967. type: "string"
  9968. },
  9969. commit_message: {
  9970. type: "string"
  9971. },
  9972. head: {
  9973. required: true,
  9974. type: "string"
  9975. },
  9976. owner: {
  9977. required: true,
  9978. type: "string"
  9979. },
  9980. repo: {
  9981. required: true,
  9982. type: "string"
  9983. }
  9984. },
  9985. url: "/repos/:owner/:repo/merges"
  9986. },
  9987. pingHook: {
  9988. method: "POST",
  9989. params: {
  9990. hook_id: {
  9991. required: true,
  9992. type: "integer"
  9993. },
  9994. owner: {
  9995. required: true,
  9996. type: "string"
  9997. },
  9998. repo: {
  9999. required: true,
  10000. type: "string"
  10001. }
  10002. },
  10003. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  10004. },
  10005. removeBranchProtection: {
  10006. method: "DELETE",
  10007. params: {
  10008. branch: {
  10009. required: true,
  10010. type: "string"
  10011. },
  10012. owner: {
  10013. required: true,
  10014. type: "string"
  10015. },
  10016. repo: {
  10017. required: true,
  10018. type: "string"
  10019. }
  10020. },
  10021. url: "/repos/:owner/:repo/branches/:branch/protection"
  10022. },
  10023. removeCollaborator: {
  10024. method: "DELETE",
  10025. params: {
  10026. owner: {
  10027. required: true,
  10028. type: "string"
  10029. },
  10030. repo: {
  10031. required: true,
  10032. type: "string"
  10033. },
  10034. username: {
  10035. required: true,
  10036. type: "string"
  10037. }
  10038. },
  10039. url: "/repos/:owner/:repo/collaborators/:username"
  10040. },
  10041. removeDeployKey: {
  10042. method: "DELETE",
  10043. params: {
  10044. key_id: {
  10045. required: true,
  10046. type: "integer"
  10047. },
  10048. owner: {
  10049. required: true,
  10050. type: "string"
  10051. },
  10052. repo: {
  10053. required: true,
  10054. type: "string"
  10055. }
  10056. },
  10057. url: "/repos/:owner/:repo/keys/:key_id"
  10058. },
  10059. removeProtectedBranchAdminEnforcement: {
  10060. method: "DELETE",
  10061. params: {
  10062. branch: {
  10063. required: true,
  10064. type: "string"
  10065. },
  10066. owner: {
  10067. required: true,
  10068. type: "string"
  10069. },
  10070. repo: {
  10071. required: true,
  10072. type: "string"
  10073. }
  10074. },
  10075. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  10076. },
  10077. removeProtectedBranchAppRestrictions: {
  10078. method: "DELETE",
  10079. params: {
  10080. apps: {
  10081. mapTo: "data",
  10082. required: true,
  10083. type: "string[]"
  10084. },
  10085. branch: {
  10086. required: true,
  10087. type: "string"
  10088. },
  10089. owner: {
  10090. required: true,
  10091. type: "string"
  10092. },
  10093. repo: {
  10094. required: true,
  10095. type: "string"
  10096. }
  10097. },
  10098. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  10099. },
  10100. removeProtectedBranchPullRequestReviewEnforcement: {
  10101. method: "DELETE",
  10102. params: {
  10103. branch: {
  10104. required: true,
  10105. type: "string"
  10106. },
  10107. owner: {
  10108. required: true,
  10109. type: "string"
  10110. },
  10111. repo: {
  10112. required: true,
  10113. type: "string"
  10114. }
  10115. },
  10116. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  10117. },
  10118. removeProtectedBranchRequiredSignatures: {
  10119. headers: {
  10120. accept: "application/vnd.github.zzzax-preview+json"
  10121. },
  10122. method: "DELETE",
  10123. params: {
  10124. branch: {
  10125. required: true,
  10126. type: "string"
  10127. },
  10128. owner: {
  10129. required: true,
  10130. type: "string"
  10131. },
  10132. repo: {
  10133. required: true,
  10134. type: "string"
  10135. }
  10136. },
  10137. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  10138. },
  10139. removeProtectedBranchRequiredStatusChecks: {
  10140. method: "DELETE",
  10141. params: {
  10142. branch: {
  10143. required: true,
  10144. type: "string"
  10145. },
  10146. owner: {
  10147. required: true,
  10148. type: "string"
  10149. },
  10150. repo: {
  10151. required: true,
  10152. type: "string"
  10153. }
  10154. },
  10155. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  10156. },
  10157. removeProtectedBranchRequiredStatusChecksContexts: {
  10158. method: "DELETE",
  10159. params: {
  10160. branch: {
  10161. required: true,
  10162. type: "string"
  10163. },
  10164. contexts: {
  10165. mapTo: "data",
  10166. required: true,
  10167. type: "string[]"
  10168. },
  10169. owner: {
  10170. required: true,
  10171. type: "string"
  10172. },
  10173. repo: {
  10174. required: true,
  10175. type: "string"
  10176. }
  10177. },
  10178. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  10179. },
  10180. removeProtectedBranchRestrictions: {
  10181. method: "DELETE",
  10182. params: {
  10183. branch: {
  10184. required: true,
  10185. type: "string"
  10186. },
  10187. owner: {
  10188. required: true,
  10189. type: "string"
  10190. },
  10191. repo: {
  10192. required: true,
  10193. type: "string"
  10194. }
  10195. },
  10196. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  10197. },
  10198. removeProtectedBranchTeamRestrictions: {
  10199. method: "DELETE",
  10200. params: {
  10201. branch: {
  10202. required: true,
  10203. type: "string"
  10204. },
  10205. owner: {
  10206. required: true,
  10207. type: "string"
  10208. },
  10209. repo: {
  10210. required: true,
  10211. type: "string"
  10212. },
  10213. teams: {
  10214. mapTo: "data",
  10215. required: true,
  10216. type: "string[]"
  10217. }
  10218. },
  10219. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  10220. },
  10221. removeProtectedBranchUserRestrictions: {
  10222. method: "DELETE",
  10223. params: {
  10224. branch: {
  10225. required: true,
  10226. type: "string"
  10227. },
  10228. owner: {
  10229. required: true,
  10230. type: "string"
  10231. },
  10232. repo: {
  10233. required: true,
  10234. type: "string"
  10235. },
  10236. users: {
  10237. mapTo: "data",
  10238. required: true,
  10239. type: "string[]"
  10240. }
  10241. },
  10242. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  10243. },
  10244. replaceProtectedBranchAppRestrictions: {
  10245. method: "PUT",
  10246. params: {
  10247. apps: {
  10248. mapTo: "data",
  10249. required: true,
  10250. type: "string[]"
  10251. },
  10252. branch: {
  10253. required: true,
  10254. type: "string"
  10255. },
  10256. owner: {
  10257. required: true,
  10258. type: "string"
  10259. },
  10260. repo: {
  10261. required: true,
  10262. type: "string"
  10263. }
  10264. },
  10265. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  10266. },
  10267. replaceProtectedBranchRequiredStatusChecksContexts: {
  10268. method: "PUT",
  10269. params: {
  10270. branch: {
  10271. required: true,
  10272. type: "string"
  10273. },
  10274. contexts: {
  10275. mapTo: "data",
  10276. required: true,
  10277. type: "string[]"
  10278. },
  10279. owner: {
  10280. required: true,
  10281. type: "string"
  10282. },
  10283. repo: {
  10284. required: true,
  10285. type: "string"
  10286. }
  10287. },
  10288. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  10289. },
  10290. replaceProtectedBranchTeamRestrictions: {
  10291. method: "PUT",
  10292. params: {
  10293. branch: {
  10294. required: true,
  10295. type: "string"
  10296. },
  10297. owner: {
  10298. required: true,
  10299. type: "string"
  10300. },
  10301. repo: {
  10302. required: true,
  10303. type: "string"
  10304. },
  10305. teams: {
  10306. mapTo: "data",
  10307. required: true,
  10308. type: "string[]"
  10309. }
  10310. },
  10311. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  10312. },
  10313. replaceProtectedBranchUserRestrictions: {
  10314. method: "PUT",
  10315. params: {
  10316. branch: {
  10317. required: true,
  10318. type: "string"
  10319. },
  10320. owner: {
  10321. required: true,
  10322. type: "string"
  10323. },
  10324. repo: {
  10325. required: true,
  10326. type: "string"
  10327. },
  10328. users: {
  10329. mapTo: "data",
  10330. required: true,
  10331. type: "string[]"
  10332. }
  10333. },
  10334. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  10335. },
  10336. replaceTopics: {
  10337. headers: {
  10338. accept: "application/vnd.github.mercy-preview+json"
  10339. },
  10340. method: "PUT",
  10341. params: {
  10342. names: {
  10343. required: true,
  10344. type: "string[]"
  10345. },
  10346. owner: {
  10347. required: true,
  10348. type: "string"
  10349. },
  10350. repo: {
  10351. required: true,
  10352. type: "string"
  10353. }
  10354. },
  10355. url: "/repos/:owner/:repo/topics"
  10356. },
  10357. requestPageBuild: {
  10358. method: "POST",
  10359. params: {
  10360. owner: {
  10361. required: true,
  10362. type: "string"
  10363. },
  10364. repo: {
  10365. required: true,
  10366. type: "string"
  10367. }
  10368. },
  10369. url: "/repos/:owner/:repo/pages/builds"
  10370. },
  10371. retrieveCommunityProfileMetrics: {
  10372. method: "GET",
  10373. params: {
  10374. owner: {
  10375. required: true,
  10376. type: "string"
  10377. },
  10378. repo: {
  10379. required: true,
  10380. type: "string"
  10381. }
  10382. },
  10383. url: "/repos/:owner/:repo/community/profile"
  10384. },
  10385. testPushHook: {
  10386. method: "POST",
  10387. params: {
  10388. hook_id: {
  10389. required: true,
  10390. type: "integer"
  10391. },
  10392. owner: {
  10393. required: true,
  10394. type: "string"
  10395. },
  10396. repo: {
  10397. required: true,
  10398. type: "string"
  10399. }
  10400. },
  10401. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  10402. },
  10403. transfer: {
  10404. method: "POST",
  10405. params: {
  10406. new_owner: {
  10407. type: "string"
  10408. },
  10409. owner: {
  10410. required: true,
  10411. type: "string"
  10412. },
  10413. repo: {
  10414. required: true,
  10415. type: "string"
  10416. },
  10417. team_ids: {
  10418. type: "integer[]"
  10419. }
  10420. },
  10421. url: "/repos/:owner/:repo/transfer"
  10422. },
  10423. update: {
  10424. method: "PATCH",
  10425. params: {
  10426. allow_merge_commit: {
  10427. type: "boolean"
  10428. },
  10429. allow_rebase_merge: {
  10430. type: "boolean"
  10431. },
  10432. allow_squash_merge: {
  10433. type: "boolean"
  10434. },
  10435. archived: {
  10436. type: "boolean"
  10437. },
  10438. default_branch: {
  10439. type: "string"
  10440. },
  10441. delete_branch_on_merge: {
  10442. type: "boolean"
  10443. },
  10444. description: {
  10445. type: "string"
  10446. },
  10447. has_issues: {
  10448. type: "boolean"
  10449. },
  10450. has_projects: {
  10451. type: "boolean"
  10452. },
  10453. has_wiki: {
  10454. type: "boolean"
  10455. },
  10456. homepage: {
  10457. type: "string"
  10458. },
  10459. is_template: {
  10460. type: "boolean"
  10461. },
  10462. name: {
  10463. type: "string"
  10464. },
  10465. owner: {
  10466. required: true,
  10467. type: "string"
  10468. },
  10469. private: {
  10470. type: "boolean"
  10471. },
  10472. repo: {
  10473. required: true,
  10474. type: "string"
  10475. },
  10476. visibility: {
  10477. enum: ["public", "private", "visibility", "internal"],
  10478. type: "string"
  10479. }
  10480. },
  10481. url: "/repos/:owner/:repo"
  10482. },
  10483. updateBranchProtection: {
  10484. method: "PUT",
  10485. params: {
  10486. allow_deletions: {
  10487. type: "boolean"
  10488. },
  10489. allow_force_pushes: {
  10490. allowNull: true,
  10491. type: "boolean"
  10492. },
  10493. branch: {
  10494. required: true,
  10495. type: "string"
  10496. },
  10497. enforce_admins: {
  10498. allowNull: true,
  10499. required: true,
  10500. type: "boolean"
  10501. },
  10502. owner: {
  10503. required: true,
  10504. type: "string"
  10505. },
  10506. repo: {
  10507. required: true,
  10508. type: "string"
  10509. },
  10510. required_linear_history: {
  10511. type: "boolean"
  10512. },
  10513. required_pull_request_reviews: {
  10514. allowNull: true,
  10515. required: true,
  10516. type: "object"
  10517. },
  10518. "required_pull_request_reviews.dismiss_stale_reviews": {
  10519. type: "boolean"
  10520. },
  10521. "required_pull_request_reviews.dismissal_restrictions": {
  10522. type: "object"
  10523. },
  10524. "required_pull_request_reviews.dismissal_restrictions.teams": {
  10525. type: "string[]"
  10526. },
  10527. "required_pull_request_reviews.dismissal_restrictions.users": {
  10528. type: "string[]"
  10529. },
  10530. "required_pull_request_reviews.require_code_owner_reviews": {
  10531. type: "boolean"
  10532. },
  10533. "required_pull_request_reviews.required_approving_review_count": {
  10534. type: "integer"
  10535. },
  10536. required_status_checks: {
  10537. allowNull: true,
  10538. required: true,
  10539. type: "object"
  10540. },
  10541. "required_status_checks.contexts": {
  10542. required: true,
  10543. type: "string[]"
  10544. },
  10545. "required_status_checks.strict": {
  10546. required: true,
  10547. type: "boolean"
  10548. },
  10549. restrictions: {
  10550. allowNull: true,
  10551. required: true,
  10552. type: "object"
  10553. },
  10554. "restrictions.apps": {
  10555. type: "string[]"
  10556. },
  10557. "restrictions.teams": {
  10558. required: true,
  10559. type: "string[]"
  10560. },
  10561. "restrictions.users": {
  10562. required: true,
  10563. type: "string[]"
  10564. }
  10565. },
  10566. url: "/repos/:owner/:repo/branches/:branch/protection"
  10567. },
  10568. updateCommitComment: {
  10569. method: "PATCH",
  10570. params: {
  10571. body: {
  10572. required: true,
  10573. type: "string"
  10574. },
  10575. comment_id: {
  10576. required: true,
  10577. type: "integer"
  10578. },
  10579. owner: {
  10580. required: true,
  10581. type: "string"
  10582. },
  10583. repo: {
  10584. required: true,
  10585. type: "string"
  10586. }
  10587. },
  10588. url: "/repos/:owner/:repo/comments/:comment_id"
  10589. },
  10590. updateFile: {
  10591. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  10592. method: "PUT",
  10593. params: {
  10594. author: {
  10595. type: "object"
  10596. },
  10597. "author.email": {
  10598. required: true,
  10599. type: "string"
  10600. },
  10601. "author.name": {
  10602. required: true,
  10603. type: "string"
  10604. },
  10605. branch: {
  10606. type: "string"
  10607. },
  10608. committer: {
  10609. type: "object"
  10610. },
  10611. "committer.email": {
  10612. required: true,
  10613. type: "string"
  10614. },
  10615. "committer.name": {
  10616. required: true,
  10617. type: "string"
  10618. },
  10619. content: {
  10620. required: true,
  10621. type: "string"
  10622. },
  10623. message: {
  10624. required: true,
  10625. type: "string"
  10626. },
  10627. owner: {
  10628. required: true,
  10629. type: "string"
  10630. },
  10631. path: {
  10632. required: true,
  10633. type: "string"
  10634. },
  10635. repo: {
  10636. required: true,
  10637. type: "string"
  10638. },
  10639. sha: {
  10640. type: "string"
  10641. }
  10642. },
  10643. url: "/repos/:owner/:repo/contents/:path"
  10644. },
  10645. updateHook: {
  10646. method: "PATCH",
  10647. params: {
  10648. active: {
  10649. type: "boolean"
  10650. },
  10651. add_events: {
  10652. type: "string[]"
  10653. },
  10654. config: {
  10655. type: "object"
  10656. },
  10657. "config.content_type": {
  10658. type: "string"
  10659. },
  10660. "config.insecure_ssl": {
  10661. type: "string"
  10662. },
  10663. "config.secret": {
  10664. type: "string"
  10665. },
  10666. "config.url": {
  10667. required: true,
  10668. type: "string"
  10669. },
  10670. events: {
  10671. type: "string[]"
  10672. },
  10673. hook_id: {
  10674. required: true,
  10675. type: "integer"
  10676. },
  10677. owner: {
  10678. required: true,
  10679. type: "string"
  10680. },
  10681. remove_events: {
  10682. type: "string[]"
  10683. },
  10684. repo: {
  10685. required: true,
  10686. type: "string"
  10687. }
  10688. },
  10689. url: "/repos/:owner/:repo/hooks/:hook_id"
  10690. },
  10691. updateInformationAboutPagesSite: {
  10692. method: "PUT",
  10693. params: {
  10694. cname: {
  10695. type: "string"
  10696. },
  10697. owner: {
  10698. required: true,
  10699. type: "string"
  10700. },
  10701. repo: {
  10702. required: true,
  10703. type: "string"
  10704. },
  10705. source: {
  10706. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  10707. type: "string"
  10708. }
  10709. },
  10710. url: "/repos/:owner/:repo/pages"
  10711. },
  10712. updateInvitation: {
  10713. method: "PATCH",
  10714. params: {
  10715. invitation_id: {
  10716. required: true,
  10717. type: "integer"
  10718. },
  10719. owner: {
  10720. required: true,
  10721. type: "string"
  10722. },
  10723. permissions: {
  10724. enum: ["read", "write", "admin"],
  10725. type: "string"
  10726. },
  10727. repo: {
  10728. required: true,
  10729. type: "string"
  10730. }
  10731. },
  10732. url: "/repos/:owner/:repo/invitations/:invitation_id"
  10733. },
  10734. updateProtectedBranchPullRequestReviewEnforcement: {
  10735. method: "PATCH",
  10736. params: {
  10737. branch: {
  10738. required: true,
  10739. type: "string"
  10740. },
  10741. dismiss_stale_reviews: {
  10742. type: "boolean"
  10743. },
  10744. dismissal_restrictions: {
  10745. type: "object"
  10746. },
  10747. "dismissal_restrictions.teams": {
  10748. type: "string[]"
  10749. },
  10750. "dismissal_restrictions.users": {
  10751. type: "string[]"
  10752. },
  10753. owner: {
  10754. required: true,
  10755. type: "string"
  10756. },
  10757. repo: {
  10758. required: true,
  10759. type: "string"
  10760. },
  10761. require_code_owner_reviews: {
  10762. type: "boolean"
  10763. },
  10764. required_approving_review_count: {
  10765. type: "integer"
  10766. }
  10767. },
  10768. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  10769. },
  10770. updateProtectedBranchRequiredStatusChecks: {
  10771. method: "PATCH",
  10772. params: {
  10773. branch: {
  10774. required: true,
  10775. type: "string"
  10776. },
  10777. contexts: {
  10778. type: "string[]"
  10779. },
  10780. owner: {
  10781. required: true,
  10782. type: "string"
  10783. },
  10784. repo: {
  10785. required: true,
  10786. type: "string"
  10787. },
  10788. strict: {
  10789. type: "boolean"
  10790. }
  10791. },
  10792. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  10793. },
  10794. updateRelease: {
  10795. method: "PATCH",
  10796. params: {
  10797. body: {
  10798. type: "string"
  10799. },
  10800. draft: {
  10801. type: "boolean"
  10802. },
  10803. name: {
  10804. type: "string"
  10805. },
  10806. owner: {
  10807. required: true,
  10808. type: "string"
  10809. },
  10810. prerelease: {
  10811. type: "boolean"
  10812. },
  10813. release_id: {
  10814. required: true,
  10815. type: "integer"
  10816. },
  10817. repo: {
  10818. required: true,
  10819. type: "string"
  10820. },
  10821. tag_name: {
  10822. type: "string"
  10823. },
  10824. target_commitish: {
  10825. type: "string"
  10826. }
  10827. },
  10828. url: "/repos/:owner/:repo/releases/:release_id"
  10829. },
  10830. updateReleaseAsset: {
  10831. method: "PATCH",
  10832. params: {
  10833. asset_id: {
  10834. required: true,
  10835. type: "integer"
  10836. },
  10837. label: {
  10838. type: "string"
  10839. },
  10840. name: {
  10841. type: "string"
  10842. },
  10843. owner: {
  10844. required: true,
  10845. type: "string"
  10846. },
  10847. repo: {
  10848. required: true,
  10849. type: "string"
  10850. }
  10851. },
  10852. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  10853. },
  10854. uploadReleaseAsset: {
  10855. method: "POST",
  10856. params: {
  10857. data: {
  10858. mapTo: "data",
  10859. required: true,
  10860. type: "string | object"
  10861. },
  10862. file: {
  10863. alias: "data",
  10864. deprecated: true,
  10865. type: "string | object"
  10866. },
  10867. headers: {
  10868. required: true,
  10869. type: "object"
  10870. },
  10871. "headers.content-length": {
  10872. required: true,
  10873. type: "integer"
  10874. },
  10875. "headers.content-type": {
  10876. required: true,
  10877. type: "string"
  10878. },
  10879. label: {
  10880. type: "string"
  10881. },
  10882. name: {
  10883. required: true,
  10884. type: "string"
  10885. },
  10886. url: {
  10887. required: true,
  10888. type: "string"
  10889. }
  10890. },
  10891. url: ":url"
  10892. }
  10893. },
  10894. search: {
  10895. code: {
  10896. method: "GET",
  10897. params: {
  10898. order: {
  10899. enum: ["desc", "asc"],
  10900. type: "string"
  10901. },
  10902. page: {
  10903. type: "integer"
  10904. },
  10905. per_page: {
  10906. type: "integer"
  10907. },
  10908. q: {
  10909. required: true,
  10910. type: "string"
  10911. },
  10912. sort: {
  10913. enum: ["indexed"],
  10914. type: "string"
  10915. }
  10916. },
  10917. url: "/search/code"
  10918. },
  10919. commits: {
  10920. headers: {
  10921. accept: "application/vnd.github.cloak-preview+json"
  10922. },
  10923. method: "GET",
  10924. params: {
  10925. order: {
  10926. enum: ["desc", "asc"],
  10927. type: "string"
  10928. },
  10929. page: {
  10930. type: "integer"
  10931. },
  10932. per_page: {
  10933. type: "integer"
  10934. },
  10935. q: {
  10936. required: true,
  10937. type: "string"
  10938. },
  10939. sort: {
  10940. enum: ["author-date", "committer-date"],
  10941. type: "string"
  10942. }
  10943. },
  10944. url: "/search/commits"
  10945. },
  10946. issues: {
  10947. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  10948. method: "GET",
  10949. params: {
  10950. order: {
  10951. enum: ["desc", "asc"],
  10952. type: "string"
  10953. },
  10954. page: {
  10955. type: "integer"
  10956. },
  10957. per_page: {
  10958. type: "integer"
  10959. },
  10960. q: {
  10961. required: true,
  10962. type: "string"
  10963. },
  10964. sort: {
  10965. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  10966. type: "string"
  10967. }
  10968. },
  10969. url: "/search/issues"
  10970. },
  10971. issuesAndPullRequests: {
  10972. method: "GET",
  10973. params: {
  10974. order: {
  10975. enum: ["desc", "asc"],
  10976. type: "string"
  10977. },
  10978. page: {
  10979. type: "integer"
  10980. },
  10981. per_page: {
  10982. type: "integer"
  10983. },
  10984. q: {
  10985. required: true,
  10986. type: "string"
  10987. },
  10988. sort: {
  10989. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  10990. type: "string"
  10991. }
  10992. },
  10993. url: "/search/issues"
  10994. },
  10995. labels: {
  10996. method: "GET",
  10997. params: {
  10998. order: {
  10999. enum: ["desc", "asc"],
  11000. type: "string"
  11001. },
  11002. q: {
  11003. required: true,
  11004. type: "string"
  11005. },
  11006. repository_id: {
  11007. required: true,
  11008. type: "integer"
  11009. },
  11010. sort: {
  11011. enum: ["created", "updated"],
  11012. type: "string"
  11013. }
  11014. },
  11015. url: "/search/labels"
  11016. },
  11017. repos: {
  11018. method: "GET",
  11019. params: {
  11020. order: {
  11021. enum: ["desc", "asc"],
  11022. type: "string"
  11023. },
  11024. page: {
  11025. type: "integer"
  11026. },
  11027. per_page: {
  11028. type: "integer"
  11029. },
  11030. q: {
  11031. required: true,
  11032. type: "string"
  11033. },
  11034. sort: {
  11035. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  11036. type: "string"
  11037. }
  11038. },
  11039. url: "/search/repositories"
  11040. },
  11041. topics: {
  11042. method: "GET",
  11043. params: {
  11044. q: {
  11045. required: true,
  11046. type: "string"
  11047. }
  11048. },
  11049. url: "/search/topics"
  11050. },
  11051. users: {
  11052. method: "GET",
  11053. params: {
  11054. order: {
  11055. enum: ["desc", "asc"],
  11056. type: "string"
  11057. },
  11058. page: {
  11059. type: "integer"
  11060. },
  11061. per_page: {
  11062. type: "integer"
  11063. },
  11064. q: {
  11065. required: true,
  11066. type: "string"
  11067. },
  11068. sort: {
  11069. enum: ["followers", "repositories", "joined"],
  11070. type: "string"
  11071. }
  11072. },
  11073. url: "/search/users"
  11074. }
  11075. },
  11076. teams: {
  11077. addMember: {
  11078. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  11079. method: "PUT",
  11080. params: {
  11081. team_id: {
  11082. required: true,
  11083. type: "integer"
  11084. },
  11085. username: {
  11086. required: true,
  11087. type: "string"
  11088. }
  11089. },
  11090. url: "/teams/:team_id/members/:username"
  11091. },
  11092. addMemberLegacy: {
  11093. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  11094. method: "PUT",
  11095. params: {
  11096. team_id: {
  11097. required: true,
  11098. type: "integer"
  11099. },
  11100. username: {
  11101. required: true,
  11102. type: "string"
  11103. }
  11104. },
  11105. url: "/teams/:team_id/members/:username"
  11106. },
  11107. addOrUpdateMembership: {
  11108. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  11109. method: "PUT",
  11110. params: {
  11111. role: {
  11112. enum: ["member", "maintainer"],
  11113. type: "string"
  11114. },
  11115. team_id: {
  11116. required: true,
  11117. type: "integer"
  11118. },
  11119. username: {
  11120. required: true,
  11121. type: "string"
  11122. }
  11123. },
  11124. url: "/teams/:team_id/memberships/:username"
  11125. },
  11126. addOrUpdateMembershipInOrg: {
  11127. method: "PUT",
  11128. params: {
  11129. org: {
  11130. required: true,
  11131. type: "string"
  11132. },
  11133. role: {
  11134. enum: ["member", "maintainer"],
  11135. type: "string"
  11136. },
  11137. team_slug: {
  11138. required: true,
  11139. type: "string"
  11140. },
  11141. username: {
  11142. required: true,
  11143. type: "string"
  11144. }
  11145. },
  11146. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  11147. },
  11148. addOrUpdateMembershipLegacy: {
  11149. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  11150. method: "PUT",
  11151. params: {
  11152. role: {
  11153. enum: ["member", "maintainer"],
  11154. type: "string"
  11155. },
  11156. team_id: {
  11157. required: true,
  11158. type: "integer"
  11159. },
  11160. username: {
  11161. required: true,
  11162. type: "string"
  11163. }
  11164. },
  11165. url: "/teams/:team_id/memberships/:username"
  11166. },
  11167. addOrUpdateProject: {
  11168. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  11169. headers: {
  11170. accept: "application/vnd.github.inertia-preview+json"
  11171. },
  11172. method: "PUT",
  11173. params: {
  11174. permission: {
  11175. enum: ["read", "write", "admin"],
  11176. type: "string"
  11177. },
  11178. project_id: {
  11179. required: true,
  11180. type: "integer"
  11181. },
  11182. team_id: {
  11183. required: true,
  11184. type: "integer"
  11185. }
  11186. },
  11187. url: "/teams/:team_id/projects/:project_id"
  11188. },
  11189. addOrUpdateProjectInOrg: {
  11190. headers: {
  11191. accept: "application/vnd.github.inertia-preview+json"
  11192. },
  11193. method: "PUT",
  11194. params: {
  11195. org: {
  11196. required: true,
  11197. type: "string"
  11198. },
  11199. permission: {
  11200. enum: ["read", "write", "admin"],
  11201. type: "string"
  11202. },
  11203. project_id: {
  11204. required: true,
  11205. type: "integer"
  11206. },
  11207. team_slug: {
  11208. required: true,
  11209. type: "string"
  11210. }
  11211. },
  11212. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  11213. },
  11214. addOrUpdateProjectLegacy: {
  11215. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  11216. headers: {
  11217. accept: "application/vnd.github.inertia-preview+json"
  11218. },
  11219. method: "PUT",
  11220. params: {
  11221. permission: {
  11222. enum: ["read", "write", "admin"],
  11223. type: "string"
  11224. },
  11225. project_id: {
  11226. required: true,
  11227. type: "integer"
  11228. },
  11229. team_id: {
  11230. required: true,
  11231. type: "integer"
  11232. }
  11233. },
  11234. url: "/teams/:team_id/projects/:project_id"
  11235. },
  11236. addOrUpdateRepo: {
  11237. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  11238. method: "PUT",
  11239. params: {
  11240. owner: {
  11241. required: true,
  11242. type: "string"
  11243. },
  11244. permission: {
  11245. enum: ["pull", "push", "admin"],
  11246. type: "string"
  11247. },
  11248. repo: {
  11249. required: true,
  11250. type: "string"
  11251. },
  11252. team_id: {
  11253. required: true,
  11254. type: "integer"
  11255. }
  11256. },
  11257. url: "/teams/:team_id/repos/:owner/:repo"
  11258. },
  11259. addOrUpdateRepoInOrg: {
  11260. method: "PUT",
  11261. params: {
  11262. org: {
  11263. required: true,
  11264. type: "string"
  11265. },
  11266. owner: {
  11267. required: true,
  11268. type: "string"
  11269. },
  11270. permission: {
  11271. enum: ["pull", "push", "admin"],
  11272. type: "string"
  11273. },
  11274. repo: {
  11275. required: true,
  11276. type: "string"
  11277. },
  11278. team_slug: {
  11279. required: true,
  11280. type: "string"
  11281. }
  11282. },
  11283. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  11284. },
  11285. addOrUpdateRepoLegacy: {
  11286. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  11287. method: "PUT",
  11288. params: {
  11289. owner: {
  11290. required: true,
  11291. type: "string"
  11292. },
  11293. permission: {
  11294. enum: ["pull", "push", "admin"],
  11295. type: "string"
  11296. },
  11297. repo: {
  11298. required: true,
  11299. type: "string"
  11300. },
  11301. team_id: {
  11302. required: true,
  11303. type: "integer"
  11304. }
  11305. },
  11306. url: "/teams/:team_id/repos/:owner/:repo"
  11307. },
  11308. checkManagesRepo: {
  11309. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  11310. method: "GET",
  11311. params: {
  11312. owner: {
  11313. required: true,
  11314. type: "string"
  11315. },
  11316. repo: {
  11317. required: true,
  11318. type: "string"
  11319. },
  11320. team_id: {
  11321. required: true,
  11322. type: "integer"
  11323. }
  11324. },
  11325. url: "/teams/:team_id/repos/:owner/:repo"
  11326. },
  11327. checkManagesRepoInOrg: {
  11328. method: "GET",
  11329. params: {
  11330. org: {
  11331. required: true,
  11332. type: "string"
  11333. },
  11334. owner: {
  11335. required: true,
  11336. type: "string"
  11337. },
  11338. repo: {
  11339. required: true,
  11340. type: "string"
  11341. },
  11342. team_slug: {
  11343. required: true,
  11344. type: "string"
  11345. }
  11346. },
  11347. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  11348. },
  11349. checkManagesRepoLegacy: {
  11350. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  11351. method: "GET",
  11352. params: {
  11353. owner: {
  11354. required: true,
  11355. type: "string"
  11356. },
  11357. repo: {
  11358. required: true,
  11359. type: "string"
  11360. },
  11361. team_id: {
  11362. required: true,
  11363. type: "integer"
  11364. }
  11365. },
  11366. url: "/teams/:team_id/repos/:owner/:repo"
  11367. },
  11368. create: {
  11369. method: "POST",
  11370. params: {
  11371. description: {
  11372. type: "string"
  11373. },
  11374. maintainers: {
  11375. type: "string[]"
  11376. },
  11377. name: {
  11378. required: true,
  11379. type: "string"
  11380. },
  11381. org: {
  11382. required: true,
  11383. type: "string"
  11384. },
  11385. parent_team_id: {
  11386. type: "integer"
  11387. },
  11388. permission: {
  11389. enum: ["pull", "push", "admin"],
  11390. type: "string"
  11391. },
  11392. privacy: {
  11393. enum: ["secret", "closed"],
  11394. type: "string"
  11395. },
  11396. repo_names: {
  11397. type: "string[]"
  11398. }
  11399. },
  11400. url: "/orgs/:org/teams"
  11401. },
  11402. createDiscussion: {
  11403. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  11404. method: "POST",
  11405. params: {
  11406. body: {
  11407. required: true,
  11408. type: "string"
  11409. },
  11410. private: {
  11411. type: "boolean"
  11412. },
  11413. team_id: {
  11414. required: true,
  11415. type: "integer"
  11416. },
  11417. title: {
  11418. required: true,
  11419. type: "string"
  11420. }
  11421. },
  11422. url: "/teams/:team_id/discussions"
  11423. },
  11424. createDiscussionComment: {
  11425. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  11426. method: "POST",
  11427. params: {
  11428. body: {
  11429. required: true,
  11430. type: "string"
  11431. },
  11432. discussion_number: {
  11433. required: true,
  11434. type: "integer"
  11435. },
  11436. team_id: {
  11437. required: true,
  11438. type: "integer"
  11439. }
  11440. },
  11441. url: "/teams/:team_id/discussions/:discussion_number/comments"
  11442. },
  11443. createDiscussionCommentInOrg: {
  11444. method: "POST",
  11445. params: {
  11446. body: {
  11447. required: true,
  11448. type: "string"
  11449. },
  11450. discussion_number: {
  11451. required: true,
  11452. type: "integer"
  11453. },
  11454. org: {
  11455. required: true,
  11456. type: "string"
  11457. },
  11458. team_slug: {
  11459. required: true,
  11460. type: "string"
  11461. }
  11462. },
  11463. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  11464. },
  11465. createDiscussionCommentLegacy: {
  11466. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  11467. method: "POST",
  11468. params: {
  11469. body: {
  11470. required: true,
  11471. type: "string"
  11472. },
  11473. discussion_number: {
  11474. required: true,
  11475. type: "integer"
  11476. },
  11477. team_id: {
  11478. required: true,
  11479. type: "integer"
  11480. }
  11481. },
  11482. url: "/teams/:team_id/discussions/:discussion_number/comments"
  11483. },
  11484. createDiscussionInOrg: {
  11485. method: "POST",
  11486. params: {
  11487. body: {
  11488. required: true,
  11489. type: "string"
  11490. },
  11491. org: {
  11492. required: true,
  11493. type: "string"
  11494. },
  11495. private: {
  11496. type: "boolean"
  11497. },
  11498. team_slug: {
  11499. required: true,
  11500. type: "string"
  11501. },
  11502. title: {
  11503. required: true,
  11504. type: "string"
  11505. }
  11506. },
  11507. url: "/orgs/:org/teams/:team_slug/discussions"
  11508. },
  11509. createDiscussionLegacy: {
  11510. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  11511. method: "POST",
  11512. params: {
  11513. body: {
  11514. required: true,
  11515. type: "string"
  11516. },
  11517. private: {
  11518. type: "boolean"
  11519. },
  11520. team_id: {
  11521. required: true,
  11522. type: "integer"
  11523. },
  11524. title: {
  11525. required: true,
  11526. type: "string"
  11527. }
  11528. },
  11529. url: "/teams/:team_id/discussions"
  11530. },
  11531. delete: {
  11532. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  11533. method: "DELETE",
  11534. params: {
  11535. team_id: {
  11536. required: true,
  11537. type: "integer"
  11538. }
  11539. },
  11540. url: "/teams/:team_id"
  11541. },
  11542. deleteDiscussion: {
  11543. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  11544. method: "DELETE",
  11545. params: {
  11546. discussion_number: {
  11547. required: true,
  11548. type: "integer"
  11549. },
  11550. team_id: {
  11551. required: true,
  11552. type: "integer"
  11553. }
  11554. },
  11555. url: "/teams/:team_id/discussions/:discussion_number"
  11556. },
  11557. deleteDiscussionComment: {
  11558. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  11559. method: "DELETE",
  11560. params: {
  11561. comment_number: {
  11562. required: true,
  11563. type: "integer"
  11564. },
  11565. discussion_number: {
  11566. required: true,
  11567. type: "integer"
  11568. },
  11569. team_id: {
  11570. required: true,
  11571. type: "integer"
  11572. }
  11573. },
  11574. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  11575. },
  11576. deleteDiscussionCommentInOrg: {
  11577. method: "DELETE",
  11578. params: {
  11579. comment_number: {
  11580. required: true,
  11581. type: "integer"
  11582. },
  11583. discussion_number: {
  11584. required: true,
  11585. type: "integer"
  11586. },
  11587. org: {
  11588. required: true,
  11589. type: "string"
  11590. },
  11591. team_slug: {
  11592. required: true,
  11593. type: "string"
  11594. }
  11595. },
  11596. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  11597. },
  11598. deleteDiscussionCommentLegacy: {
  11599. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  11600. method: "DELETE",
  11601. params: {
  11602. comment_number: {
  11603. required: true,
  11604. type: "integer"
  11605. },
  11606. discussion_number: {
  11607. required: true,
  11608. type: "integer"
  11609. },
  11610. team_id: {
  11611. required: true,
  11612. type: "integer"
  11613. }
  11614. },
  11615. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  11616. },
  11617. deleteDiscussionInOrg: {
  11618. method: "DELETE",
  11619. params: {
  11620. discussion_number: {
  11621. required: true,
  11622. type: "integer"
  11623. },
  11624. org: {
  11625. required: true,
  11626. type: "string"
  11627. },
  11628. team_slug: {
  11629. required: true,
  11630. type: "string"
  11631. }
  11632. },
  11633. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  11634. },
  11635. deleteDiscussionLegacy: {
  11636. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  11637. method: "DELETE",
  11638. params: {
  11639. discussion_number: {
  11640. required: true,
  11641. type: "integer"
  11642. },
  11643. team_id: {
  11644. required: true,
  11645. type: "integer"
  11646. }
  11647. },
  11648. url: "/teams/:team_id/discussions/:discussion_number"
  11649. },
  11650. deleteInOrg: {
  11651. method: "DELETE",
  11652. params: {
  11653. org: {
  11654. required: true,
  11655. type: "string"
  11656. },
  11657. team_slug: {
  11658. required: true,
  11659. type: "string"
  11660. }
  11661. },
  11662. url: "/orgs/:org/teams/:team_slug"
  11663. },
  11664. deleteLegacy: {
  11665. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  11666. method: "DELETE",
  11667. params: {
  11668. team_id: {
  11669. required: true,
  11670. type: "integer"
  11671. }
  11672. },
  11673. url: "/teams/:team_id"
  11674. },
  11675. get: {
  11676. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  11677. method: "GET",
  11678. params: {
  11679. team_id: {
  11680. required: true,
  11681. type: "integer"
  11682. }
  11683. },
  11684. url: "/teams/:team_id"
  11685. },
  11686. getByName: {
  11687. method: "GET",
  11688. params: {
  11689. org: {
  11690. required: true,
  11691. type: "string"
  11692. },
  11693. team_slug: {
  11694. required: true,
  11695. type: "string"
  11696. }
  11697. },
  11698. url: "/orgs/:org/teams/:team_slug"
  11699. },
  11700. getDiscussion: {
  11701. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  11702. method: "GET",
  11703. params: {
  11704. discussion_number: {
  11705. required: true,
  11706. type: "integer"
  11707. },
  11708. team_id: {
  11709. required: true,
  11710. type: "integer"
  11711. }
  11712. },
  11713. url: "/teams/:team_id/discussions/:discussion_number"
  11714. },
  11715. getDiscussionComment: {
  11716. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  11717. method: "GET",
  11718. params: {
  11719. comment_number: {
  11720. required: true,
  11721. type: "integer"
  11722. },
  11723. discussion_number: {
  11724. required: true,
  11725. type: "integer"
  11726. },
  11727. team_id: {
  11728. required: true,
  11729. type: "integer"
  11730. }
  11731. },
  11732. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  11733. },
  11734. getDiscussionCommentInOrg: {
  11735. method: "GET",
  11736. params: {
  11737. comment_number: {
  11738. required: true,
  11739. type: "integer"
  11740. },
  11741. discussion_number: {
  11742. required: true,
  11743. type: "integer"
  11744. },
  11745. org: {
  11746. required: true,
  11747. type: "string"
  11748. },
  11749. team_slug: {
  11750. required: true,
  11751. type: "string"
  11752. }
  11753. },
  11754. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  11755. },
  11756. getDiscussionCommentLegacy: {
  11757. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  11758. method: "GET",
  11759. params: {
  11760. comment_number: {
  11761. required: true,
  11762. type: "integer"
  11763. },
  11764. discussion_number: {
  11765. required: true,
  11766. type: "integer"
  11767. },
  11768. team_id: {
  11769. required: true,
  11770. type: "integer"
  11771. }
  11772. },
  11773. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  11774. },
  11775. getDiscussionInOrg: {
  11776. method: "GET",
  11777. params: {
  11778. discussion_number: {
  11779. required: true,
  11780. type: "integer"
  11781. },
  11782. org: {
  11783. required: true,
  11784. type: "string"
  11785. },
  11786. team_slug: {
  11787. required: true,
  11788. type: "string"
  11789. }
  11790. },
  11791. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  11792. },
  11793. getDiscussionLegacy: {
  11794. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  11795. method: "GET",
  11796. params: {
  11797. discussion_number: {
  11798. required: true,
  11799. type: "integer"
  11800. },
  11801. team_id: {
  11802. required: true,
  11803. type: "integer"
  11804. }
  11805. },
  11806. url: "/teams/:team_id/discussions/:discussion_number"
  11807. },
  11808. getLegacy: {
  11809. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  11810. method: "GET",
  11811. params: {
  11812. team_id: {
  11813. required: true,
  11814. type: "integer"
  11815. }
  11816. },
  11817. url: "/teams/:team_id"
  11818. },
  11819. getMember: {
  11820. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  11821. method: "GET",
  11822. params: {
  11823. team_id: {
  11824. required: true,
  11825. type: "integer"
  11826. },
  11827. username: {
  11828. required: true,
  11829. type: "string"
  11830. }
  11831. },
  11832. url: "/teams/:team_id/members/:username"
  11833. },
  11834. getMemberLegacy: {
  11835. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  11836. method: "GET",
  11837. params: {
  11838. team_id: {
  11839. required: true,
  11840. type: "integer"
  11841. },
  11842. username: {
  11843. required: true,
  11844. type: "string"
  11845. }
  11846. },
  11847. url: "/teams/:team_id/members/:username"
  11848. },
  11849. getMembership: {
  11850. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  11851. method: "GET",
  11852. params: {
  11853. team_id: {
  11854. required: true,
  11855. type: "integer"
  11856. },
  11857. username: {
  11858. required: true,
  11859. type: "string"
  11860. }
  11861. },
  11862. url: "/teams/:team_id/memberships/:username"
  11863. },
  11864. getMembershipInOrg: {
  11865. method: "GET",
  11866. params: {
  11867. org: {
  11868. required: true,
  11869. type: "string"
  11870. },
  11871. team_slug: {
  11872. required: true,
  11873. type: "string"
  11874. },
  11875. username: {
  11876. required: true,
  11877. type: "string"
  11878. }
  11879. },
  11880. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  11881. },
  11882. getMembershipLegacy: {
  11883. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  11884. method: "GET",
  11885. params: {
  11886. team_id: {
  11887. required: true,
  11888. type: "integer"
  11889. },
  11890. username: {
  11891. required: true,
  11892. type: "string"
  11893. }
  11894. },
  11895. url: "/teams/:team_id/memberships/:username"
  11896. },
  11897. list: {
  11898. method: "GET",
  11899. params: {
  11900. org: {
  11901. required: true,
  11902. type: "string"
  11903. },
  11904. page: {
  11905. type: "integer"
  11906. },
  11907. per_page: {
  11908. type: "integer"
  11909. }
  11910. },
  11911. url: "/orgs/:org/teams"
  11912. },
  11913. listChild: {
  11914. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  11915. method: "GET",
  11916. params: {
  11917. page: {
  11918. type: "integer"
  11919. },
  11920. per_page: {
  11921. type: "integer"
  11922. },
  11923. team_id: {
  11924. required: true,
  11925. type: "integer"
  11926. }
  11927. },
  11928. url: "/teams/:team_id/teams"
  11929. },
  11930. listChildInOrg: {
  11931. method: "GET",
  11932. params: {
  11933. org: {
  11934. required: true,
  11935. type: "string"
  11936. },
  11937. page: {
  11938. type: "integer"
  11939. },
  11940. per_page: {
  11941. type: "integer"
  11942. },
  11943. team_slug: {
  11944. required: true,
  11945. type: "string"
  11946. }
  11947. },
  11948. url: "/orgs/:org/teams/:team_slug/teams"
  11949. },
  11950. listChildLegacy: {
  11951. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  11952. method: "GET",
  11953. params: {
  11954. page: {
  11955. type: "integer"
  11956. },
  11957. per_page: {
  11958. type: "integer"
  11959. },
  11960. team_id: {
  11961. required: true,
  11962. type: "integer"
  11963. }
  11964. },
  11965. url: "/teams/:team_id/teams"
  11966. },
  11967. listDiscussionComments: {
  11968. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  11969. method: "GET",
  11970. params: {
  11971. direction: {
  11972. enum: ["asc", "desc"],
  11973. type: "string"
  11974. },
  11975. discussion_number: {
  11976. required: true,
  11977. type: "integer"
  11978. },
  11979. page: {
  11980. type: "integer"
  11981. },
  11982. per_page: {
  11983. type: "integer"
  11984. },
  11985. team_id: {
  11986. required: true,
  11987. type: "integer"
  11988. }
  11989. },
  11990. url: "/teams/:team_id/discussions/:discussion_number/comments"
  11991. },
  11992. listDiscussionCommentsInOrg: {
  11993. method: "GET",
  11994. params: {
  11995. direction: {
  11996. enum: ["asc", "desc"],
  11997. type: "string"
  11998. },
  11999. discussion_number: {
  12000. required: true,
  12001. type: "integer"
  12002. },
  12003. org: {
  12004. required: true,
  12005. type: "string"
  12006. },
  12007. page: {
  12008. type: "integer"
  12009. },
  12010. per_page: {
  12011. type: "integer"
  12012. },
  12013. team_slug: {
  12014. required: true,
  12015. type: "string"
  12016. }
  12017. },
  12018. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  12019. },
  12020. listDiscussionCommentsLegacy: {
  12021. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  12022. method: "GET",
  12023. params: {
  12024. direction: {
  12025. enum: ["asc", "desc"],
  12026. type: "string"
  12027. },
  12028. discussion_number: {
  12029. required: true,
  12030. type: "integer"
  12031. },
  12032. page: {
  12033. type: "integer"
  12034. },
  12035. per_page: {
  12036. type: "integer"
  12037. },
  12038. team_id: {
  12039. required: true,
  12040. type: "integer"
  12041. }
  12042. },
  12043. url: "/teams/:team_id/discussions/:discussion_number/comments"
  12044. },
  12045. listDiscussions: {
  12046. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  12047. method: "GET",
  12048. params: {
  12049. direction: {
  12050. enum: ["asc", "desc"],
  12051. type: "string"
  12052. },
  12053. page: {
  12054. type: "integer"
  12055. },
  12056. per_page: {
  12057. type: "integer"
  12058. },
  12059. team_id: {
  12060. required: true,
  12061. type: "integer"
  12062. }
  12063. },
  12064. url: "/teams/:team_id/discussions"
  12065. },
  12066. listDiscussionsInOrg: {
  12067. method: "GET",
  12068. params: {
  12069. direction: {
  12070. enum: ["asc", "desc"],
  12071. type: "string"
  12072. },
  12073. org: {
  12074. required: true,
  12075. type: "string"
  12076. },
  12077. page: {
  12078. type: "integer"
  12079. },
  12080. per_page: {
  12081. type: "integer"
  12082. },
  12083. team_slug: {
  12084. required: true,
  12085. type: "string"
  12086. }
  12087. },
  12088. url: "/orgs/:org/teams/:team_slug/discussions"
  12089. },
  12090. listDiscussionsLegacy: {
  12091. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  12092. method: "GET",
  12093. params: {
  12094. direction: {
  12095. enum: ["asc", "desc"],
  12096. type: "string"
  12097. },
  12098. page: {
  12099. type: "integer"
  12100. },
  12101. per_page: {
  12102. type: "integer"
  12103. },
  12104. team_id: {
  12105. required: true,
  12106. type: "integer"
  12107. }
  12108. },
  12109. url: "/teams/:team_id/discussions"
  12110. },
  12111. listForAuthenticatedUser: {
  12112. method: "GET",
  12113. params: {
  12114. page: {
  12115. type: "integer"
  12116. },
  12117. per_page: {
  12118. type: "integer"
  12119. }
  12120. },
  12121. url: "/user/teams"
  12122. },
  12123. listMembers: {
  12124. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  12125. method: "GET",
  12126. params: {
  12127. page: {
  12128. type: "integer"
  12129. },
  12130. per_page: {
  12131. type: "integer"
  12132. },
  12133. role: {
  12134. enum: ["member", "maintainer", "all"],
  12135. type: "string"
  12136. },
  12137. team_id: {
  12138. required: true,
  12139. type: "integer"
  12140. }
  12141. },
  12142. url: "/teams/:team_id/members"
  12143. },
  12144. listMembersInOrg: {
  12145. method: "GET",
  12146. params: {
  12147. org: {
  12148. required: true,
  12149. type: "string"
  12150. },
  12151. page: {
  12152. type: "integer"
  12153. },
  12154. per_page: {
  12155. type: "integer"
  12156. },
  12157. role: {
  12158. enum: ["member", "maintainer", "all"],
  12159. type: "string"
  12160. },
  12161. team_slug: {
  12162. required: true,
  12163. type: "string"
  12164. }
  12165. },
  12166. url: "/orgs/:org/teams/:team_slug/members"
  12167. },
  12168. listMembersLegacy: {
  12169. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  12170. method: "GET",
  12171. params: {
  12172. page: {
  12173. type: "integer"
  12174. },
  12175. per_page: {
  12176. type: "integer"
  12177. },
  12178. role: {
  12179. enum: ["member", "maintainer", "all"],
  12180. type: "string"
  12181. },
  12182. team_id: {
  12183. required: true,
  12184. type: "integer"
  12185. }
  12186. },
  12187. url: "/teams/:team_id/members"
  12188. },
  12189. listPendingInvitations: {
  12190. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  12191. method: "GET",
  12192. params: {
  12193. page: {
  12194. type: "integer"
  12195. },
  12196. per_page: {
  12197. type: "integer"
  12198. },
  12199. team_id: {
  12200. required: true,
  12201. type: "integer"
  12202. }
  12203. },
  12204. url: "/teams/:team_id/invitations"
  12205. },
  12206. listPendingInvitationsInOrg: {
  12207. method: "GET",
  12208. params: {
  12209. org: {
  12210. required: true,
  12211. type: "string"
  12212. },
  12213. page: {
  12214. type: "integer"
  12215. },
  12216. per_page: {
  12217. type: "integer"
  12218. },
  12219. team_slug: {
  12220. required: true,
  12221. type: "string"
  12222. }
  12223. },
  12224. url: "/orgs/:org/teams/:team_slug/invitations"
  12225. },
  12226. listPendingInvitationsLegacy: {
  12227. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  12228. method: "GET",
  12229. params: {
  12230. page: {
  12231. type: "integer"
  12232. },
  12233. per_page: {
  12234. type: "integer"
  12235. },
  12236. team_id: {
  12237. required: true,
  12238. type: "integer"
  12239. }
  12240. },
  12241. url: "/teams/:team_id/invitations"
  12242. },
  12243. listProjects: {
  12244. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  12245. headers: {
  12246. accept: "application/vnd.github.inertia-preview+json"
  12247. },
  12248. method: "GET",
  12249. params: {
  12250. page: {
  12251. type: "integer"
  12252. },
  12253. per_page: {
  12254. type: "integer"
  12255. },
  12256. team_id: {
  12257. required: true,
  12258. type: "integer"
  12259. }
  12260. },
  12261. url: "/teams/:team_id/projects"
  12262. },
  12263. listProjectsInOrg: {
  12264. headers: {
  12265. accept: "application/vnd.github.inertia-preview+json"
  12266. },
  12267. method: "GET",
  12268. params: {
  12269. org: {
  12270. required: true,
  12271. type: "string"
  12272. },
  12273. page: {
  12274. type: "integer"
  12275. },
  12276. per_page: {
  12277. type: "integer"
  12278. },
  12279. team_slug: {
  12280. required: true,
  12281. type: "string"
  12282. }
  12283. },
  12284. url: "/orgs/:org/teams/:team_slug/projects"
  12285. },
  12286. listProjectsLegacy: {
  12287. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  12288. headers: {
  12289. accept: "application/vnd.github.inertia-preview+json"
  12290. },
  12291. method: "GET",
  12292. params: {
  12293. page: {
  12294. type: "integer"
  12295. },
  12296. per_page: {
  12297. type: "integer"
  12298. },
  12299. team_id: {
  12300. required: true,
  12301. type: "integer"
  12302. }
  12303. },
  12304. url: "/teams/:team_id/projects"
  12305. },
  12306. listRepos: {
  12307. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  12308. method: "GET",
  12309. params: {
  12310. page: {
  12311. type: "integer"
  12312. },
  12313. per_page: {
  12314. type: "integer"
  12315. },
  12316. team_id: {
  12317. required: true,
  12318. type: "integer"
  12319. }
  12320. },
  12321. url: "/teams/:team_id/repos"
  12322. },
  12323. listReposInOrg: {
  12324. method: "GET",
  12325. params: {
  12326. org: {
  12327. required: true,
  12328. type: "string"
  12329. },
  12330. page: {
  12331. type: "integer"
  12332. },
  12333. per_page: {
  12334. type: "integer"
  12335. },
  12336. team_slug: {
  12337. required: true,
  12338. type: "string"
  12339. }
  12340. },
  12341. url: "/orgs/:org/teams/:team_slug/repos"
  12342. },
  12343. listReposLegacy: {
  12344. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  12345. method: "GET",
  12346. params: {
  12347. page: {
  12348. type: "integer"
  12349. },
  12350. per_page: {
  12351. type: "integer"
  12352. },
  12353. team_id: {
  12354. required: true,
  12355. type: "integer"
  12356. }
  12357. },
  12358. url: "/teams/:team_id/repos"
  12359. },
  12360. removeMember: {
  12361. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  12362. method: "DELETE",
  12363. params: {
  12364. team_id: {
  12365. required: true,
  12366. type: "integer"
  12367. },
  12368. username: {
  12369. required: true,
  12370. type: "string"
  12371. }
  12372. },
  12373. url: "/teams/:team_id/members/:username"
  12374. },
  12375. removeMemberLegacy: {
  12376. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  12377. method: "DELETE",
  12378. params: {
  12379. team_id: {
  12380. required: true,
  12381. type: "integer"
  12382. },
  12383. username: {
  12384. required: true,
  12385. type: "string"
  12386. }
  12387. },
  12388. url: "/teams/:team_id/members/:username"
  12389. },
  12390. removeMembership: {
  12391. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  12392. method: "DELETE",
  12393. params: {
  12394. team_id: {
  12395. required: true,
  12396. type: "integer"
  12397. },
  12398. username: {
  12399. required: true,
  12400. type: "string"
  12401. }
  12402. },
  12403. url: "/teams/:team_id/memberships/:username"
  12404. },
  12405. removeMembershipInOrg: {
  12406. method: "DELETE",
  12407. params: {
  12408. org: {
  12409. required: true,
  12410. type: "string"
  12411. },
  12412. team_slug: {
  12413. required: true,
  12414. type: "string"
  12415. },
  12416. username: {
  12417. required: true,
  12418. type: "string"
  12419. }
  12420. },
  12421. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  12422. },
  12423. removeMembershipLegacy: {
  12424. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  12425. method: "DELETE",
  12426. params: {
  12427. team_id: {
  12428. required: true,
  12429. type: "integer"
  12430. },
  12431. username: {
  12432. required: true,
  12433. type: "string"
  12434. }
  12435. },
  12436. url: "/teams/:team_id/memberships/:username"
  12437. },
  12438. removeProject: {
  12439. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  12440. method: "DELETE",
  12441. params: {
  12442. project_id: {
  12443. required: true,
  12444. type: "integer"
  12445. },
  12446. team_id: {
  12447. required: true,
  12448. type: "integer"
  12449. }
  12450. },
  12451. url: "/teams/:team_id/projects/:project_id"
  12452. },
  12453. removeProjectInOrg: {
  12454. method: "DELETE",
  12455. params: {
  12456. org: {
  12457. required: true,
  12458. type: "string"
  12459. },
  12460. project_id: {
  12461. required: true,
  12462. type: "integer"
  12463. },
  12464. team_slug: {
  12465. required: true,
  12466. type: "string"
  12467. }
  12468. },
  12469. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  12470. },
  12471. removeProjectLegacy: {
  12472. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  12473. method: "DELETE",
  12474. params: {
  12475. project_id: {
  12476. required: true,
  12477. type: "integer"
  12478. },
  12479. team_id: {
  12480. required: true,
  12481. type: "integer"
  12482. }
  12483. },
  12484. url: "/teams/:team_id/projects/:project_id"
  12485. },
  12486. removeRepo: {
  12487. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  12488. method: "DELETE",
  12489. params: {
  12490. owner: {
  12491. required: true,
  12492. type: "string"
  12493. },
  12494. repo: {
  12495. required: true,
  12496. type: "string"
  12497. },
  12498. team_id: {
  12499. required: true,
  12500. type: "integer"
  12501. }
  12502. },
  12503. url: "/teams/:team_id/repos/:owner/:repo"
  12504. },
  12505. removeRepoInOrg: {
  12506. method: "DELETE",
  12507. params: {
  12508. org: {
  12509. required: true,
  12510. type: "string"
  12511. },
  12512. owner: {
  12513. required: true,
  12514. type: "string"
  12515. },
  12516. repo: {
  12517. required: true,
  12518. type: "string"
  12519. },
  12520. team_slug: {
  12521. required: true,
  12522. type: "string"
  12523. }
  12524. },
  12525. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  12526. },
  12527. removeRepoLegacy: {
  12528. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  12529. method: "DELETE",
  12530. params: {
  12531. owner: {
  12532. required: true,
  12533. type: "string"
  12534. },
  12535. repo: {
  12536. required: true,
  12537. type: "string"
  12538. },
  12539. team_id: {
  12540. required: true,
  12541. type: "integer"
  12542. }
  12543. },
  12544. url: "/teams/:team_id/repos/:owner/:repo"
  12545. },
  12546. reviewProject: {
  12547. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  12548. headers: {
  12549. accept: "application/vnd.github.inertia-preview+json"
  12550. },
  12551. method: "GET",
  12552. params: {
  12553. project_id: {
  12554. required: true,
  12555. type: "integer"
  12556. },
  12557. team_id: {
  12558. required: true,
  12559. type: "integer"
  12560. }
  12561. },
  12562. url: "/teams/:team_id/projects/:project_id"
  12563. },
  12564. reviewProjectInOrg: {
  12565. headers: {
  12566. accept: "application/vnd.github.inertia-preview+json"
  12567. },
  12568. method: "GET",
  12569. params: {
  12570. org: {
  12571. required: true,
  12572. type: "string"
  12573. },
  12574. project_id: {
  12575. required: true,
  12576. type: "integer"
  12577. },
  12578. team_slug: {
  12579. required: true,
  12580. type: "string"
  12581. }
  12582. },
  12583. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  12584. },
  12585. reviewProjectLegacy: {
  12586. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  12587. headers: {
  12588. accept: "application/vnd.github.inertia-preview+json"
  12589. },
  12590. method: "GET",
  12591. params: {
  12592. project_id: {
  12593. required: true,
  12594. type: "integer"
  12595. },
  12596. team_id: {
  12597. required: true,
  12598. type: "integer"
  12599. }
  12600. },
  12601. url: "/teams/:team_id/projects/:project_id"
  12602. },
  12603. update: {
  12604. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  12605. method: "PATCH",
  12606. params: {
  12607. description: {
  12608. type: "string"
  12609. },
  12610. name: {
  12611. required: true,
  12612. type: "string"
  12613. },
  12614. parent_team_id: {
  12615. type: "integer"
  12616. },
  12617. permission: {
  12618. enum: ["pull", "push", "admin"],
  12619. type: "string"
  12620. },
  12621. privacy: {
  12622. enum: ["secret", "closed"],
  12623. type: "string"
  12624. },
  12625. team_id: {
  12626. required: true,
  12627. type: "integer"
  12628. }
  12629. },
  12630. url: "/teams/:team_id"
  12631. },
  12632. updateDiscussion: {
  12633. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  12634. method: "PATCH",
  12635. params: {
  12636. body: {
  12637. type: "string"
  12638. },
  12639. discussion_number: {
  12640. required: true,
  12641. type: "integer"
  12642. },
  12643. team_id: {
  12644. required: true,
  12645. type: "integer"
  12646. },
  12647. title: {
  12648. type: "string"
  12649. }
  12650. },
  12651. url: "/teams/:team_id/discussions/:discussion_number"
  12652. },
  12653. updateDiscussionComment: {
  12654. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  12655. method: "PATCH",
  12656. params: {
  12657. body: {
  12658. required: true,
  12659. type: "string"
  12660. },
  12661. comment_number: {
  12662. required: true,
  12663. type: "integer"
  12664. },
  12665. discussion_number: {
  12666. required: true,
  12667. type: "integer"
  12668. },
  12669. team_id: {
  12670. required: true,
  12671. type: "integer"
  12672. }
  12673. },
  12674. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  12675. },
  12676. updateDiscussionCommentInOrg: {
  12677. method: "PATCH",
  12678. params: {
  12679. body: {
  12680. required: true,
  12681. type: "string"
  12682. },
  12683. comment_number: {
  12684. required: true,
  12685. type: "integer"
  12686. },
  12687. discussion_number: {
  12688. required: true,
  12689. type: "integer"
  12690. },
  12691. org: {
  12692. required: true,
  12693. type: "string"
  12694. },
  12695. team_slug: {
  12696. required: true,
  12697. type: "string"
  12698. }
  12699. },
  12700. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  12701. },
  12702. updateDiscussionCommentLegacy: {
  12703. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  12704. method: "PATCH",
  12705. params: {
  12706. body: {
  12707. required: true,
  12708. type: "string"
  12709. },
  12710. comment_number: {
  12711. required: true,
  12712. type: "integer"
  12713. },
  12714. discussion_number: {
  12715. required: true,
  12716. type: "integer"
  12717. },
  12718. team_id: {
  12719. required: true,
  12720. type: "integer"
  12721. }
  12722. },
  12723. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  12724. },
  12725. updateDiscussionInOrg: {
  12726. method: "PATCH",
  12727. params: {
  12728. body: {
  12729. type: "string"
  12730. },
  12731. discussion_number: {
  12732. required: true,
  12733. type: "integer"
  12734. },
  12735. org: {
  12736. required: true,
  12737. type: "string"
  12738. },
  12739. team_slug: {
  12740. required: true,
  12741. type: "string"
  12742. },
  12743. title: {
  12744. type: "string"
  12745. }
  12746. },
  12747. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  12748. },
  12749. updateDiscussionLegacy: {
  12750. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  12751. method: "PATCH",
  12752. params: {
  12753. body: {
  12754. type: "string"
  12755. },
  12756. discussion_number: {
  12757. required: true,
  12758. type: "integer"
  12759. },
  12760. team_id: {
  12761. required: true,
  12762. type: "integer"
  12763. },
  12764. title: {
  12765. type: "string"
  12766. }
  12767. },
  12768. url: "/teams/:team_id/discussions/:discussion_number"
  12769. },
  12770. updateInOrg: {
  12771. method: "PATCH",
  12772. params: {
  12773. description: {
  12774. type: "string"
  12775. },
  12776. name: {
  12777. required: true,
  12778. type: "string"
  12779. },
  12780. org: {
  12781. required: true,
  12782. type: "string"
  12783. },
  12784. parent_team_id: {
  12785. type: "integer"
  12786. },
  12787. permission: {
  12788. enum: ["pull", "push", "admin"],
  12789. type: "string"
  12790. },
  12791. privacy: {
  12792. enum: ["secret", "closed"],
  12793. type: "string"
  12794. },
  12795. team_slug: {
  12796. required: true,
  12797. type: "string"
  12798. }
  12799. },
  12800. url: "/orgs/:org/teams/:team_slug"
  12801. },
  12802. updateLegacy: {
  12803. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  12804. method: "PATCH",
  12805. params: {
  12806. description: {
  12807. type: "string"
  12808. },
  12809. name: {
  12810. required: true,
  12811. type: "string"
  12812. },
  12813. parent_team_id: {
  12814. type: "integer"
  12815. },
  12816. permission: {
  12817. enum: ["pull", "push", "admin"],
  12818. type: "string"
  12819. },
  12820. privacy: {
  12821. enum: ["secret", "closed"],
  12822. type: "string"
  12823. },
  12824. team_id: {
  12825. required: true,
  12826. type: "integer"
  12827. }
  12828. },
  12829. url: "/teams/:team_id"
  12830. }
  12831. },
  12832. users: {
  12833. addEmails: {
  12834. method: "POST",
  12835. params: {
  12836. emails: {
  12837. required: true,
  12838. type: "string[]"
  12839. }
  12840. },
  12841. url: "/user/emails"
  12842. },
  12843. block: {
  12844. method: "PUT",
  12845. params: {
  12846. username: {
  12847. required: true,
  12848. type: "string"
  12849. }
  12850. },
  12851. url: "/user/blocks/:username"
  12852. },
  12853. checkBlocked: {
  12854. method: "GET",
  12855. params: {
  12856. username: {
  12857. required: true,
  12858. type: "string"
  12859. }
  12860. },
  12861. url: "/user/blocks/:username"
  12862. },
  12863. checkFollowing: {
  12864. method: "GET",
  12865. params: {
  12866. username: {
  12867. required: true,
  12868. type: "string"
  12869. }
  12870. },
  12871. url: "/user/following/:username"
  12872. },
  12873. checkFollowingForUser: {
  12874. method: "GET",
  12875. params: {
  12876. target_user: {
  12877. required: true,
  12878. type: "string"
  12879. },
  12880. username: {
  12881. required: true,
  12882. type: "string"
  12883. }
  12884. },
  12885. url: "/users/:username/following/:target_user"
  12886. },
  12887. createGpgKey: {
  12888. method: "POST",
  12889. params: {
  12890. armored_public_key: {
  12891. type: "string"
  12892. }
  12893. },
  12894. url: "/user/gpg_keys"
  12895. },
  12896. createPublicKey: {
  12897. method: "POST",
  12898. params: {
  12899. key: {
  12900. type: "string"
  12901. },
  12902. title: {
  12903. type: "string"
  12904. }
  12905. },
  12906. url: "/user/keys"
  12907. },
  12908. deleteEmails: {
  12909. method: "DELETE",
  12910. params: {
  12911. emails: {
  12912. required: true,
  12913. type: "string[]"
  12914. }
  12915. },
  12916. url: "/user/emails"
  12917. },
  12918. deleteGpgKey: {
  12919. method: "DELETE",
  12920. params: {
  12921. gpg_key_id: {
  12922. required: true,
  12923. type: "integer"
  12924. }
  12925. },
  12926. url: "/user/gpg_keys/:gpg_key_id"
  12927. },
  12928. deletePublicKey: {
  12929. method: "DELETE",
  12930. params: {
  12931. key_id: {
  12932. required: true,
  12933. type: "integer"
  12934. }
  12935. },
  12936. url: "/user/keys/:key_id"
  12937. },
  12938. follow: {
  12939. method: "PUT",
  12940. params: {
  12941. username: {
  12942. required: true,
  12943. type: "string"
  12944. }
  12945. },
  12946. url: "/user/following/:username"
  12947. },
  12948. getAuthenticated: {
  12949. method: "GET",
  12950. params: {},
  12951. url: "/user"
  12952. },
  12953. getByUsername: {
  12954. method: "GET",
  12955. params: {
  12956. username: {
  12957. required: true,
  12958. type: "string"
  12959. }
  12960. },
  12961. url: "/users/:username"
  12962. },
  12963. getContextForUser: {
  12964. method: "GET",
  12965. params: {
  12966. subject_id: {
  12967. type: "string"
  12968. },
  12969. subject_type: {
  12970. enum: ["organization", "repository", "issue", "pull_request"],
  12971. type: "string"
  12972. },
  12973. username: {
  12974. required: true,
  12975. type: "string"
  12976. }
  12977. },
  12978. url: "/users/:username/hovercard"
  12979. },
  12980. getGpgKey: {
  12981. method: "GET",
  12982. params: {
  12983. gpg_key_id: {
  12984. required: true,
  12985. type: "integer"
  12986. }
  12987. },
  12988. url: "/user/gpg_keys/:gpg_key_id"
  12989. },
  12990. getPublicKey: {
  12991. method: "GET",
  12992. params: {
  12993. key_id: {
  12994. required: true,
  12995. type: "integer"
  12996. }
  12997. },
  12998. url: "/user/keys/:key_id"
  12999. },
  13000. list: {
  13001. method: "GET",
  13002. params: {
  13003. page: {
  13004. type: "integer"
  13005. },
  13006. per_page: {
  13007. type: "integer"
  13008. },
  13009. since: {
  13010. type: "string"
  13011. }
  13012. },
  13013. url: "/users"
  13014. },
  13015. listBlocked: {
  13016. method: "GET",
  13017. params: {},
  13018. url: "/user/blocks"
  13019. },
  13020. listEmails: {
  13021. method: "GET",
  13022. params: {
  13023. page: {
  13024. type: "integer"
  13025. },
  13026. per_page: {
  13027. type: "integer"
  13028. }
  13029. },
  13030. url: "/user/emails"
  13031. },
  13032. listFollowersForAuthenticatedUser: {
  13033. method: "GET",
  13034. params: {
  13035. page: {
  13036. type: "integer"
  13037. },
  13038. per_page: {
  13039. type: "integer"
  13040. }
  13041. },
  13042. url: "/user/followers"
  13043. },
  13044. listFollowersForUser: {
  13045. method: "GET",
  13046. params: {
  13047. page: {
  13048. type: "integer"
  13049. },
  13050. per_page: {
  13051. type: "integer"
  13052. },
  13053. username: {
  13054. required: true,
  13055. type: "string"
  13056. }
  13057. },
  13058. url: "/users/:username/followers"
  13059. },
  13060. listFollowingForAuthenticatedUser: {
  13061. method: "GET",
  13062. params: {
  13063. page: {
  13064. type: "integer"
  13065. },
  13066. per_page: {
  13067. type: "integer"
  13068. }
  13069. },
  13070. url: "/user/following"
  13071. },
  13072. listFollowingForUser: {
  13073. method: "GET",
  13074. params: {
  13075. page: {
  13076. type: "integer"
  13077. },
  13078. per_page: {
  13079. type: "integer"
  13080. },
  13081. username: {
  13082. required: true,
  13083. type: "string"
  13084. }
  13085. },
  13086. url: "/users/:username/following"
  13087. },
  13088. listGpgKeys: {
  13089. method: "GET",
  13090. params: {
  13091. page: {
  13092. type: "integer"
  13093. },
  13094. per_page: {
  13095. type: "integer"
  13096. }
  13097. },
  13098. url: "/user/gpg_keys"
  13099. },
  13100. listGpgKeysForUser: {
  13101. method: "GET",
  13102. params: {
  13103. page: {
  13104. type: "integer"
  13105. },
  13106. per_page: {
  13107. type: "integer"
  13108. },
  13109. username: {
  13110. required: true,
  13111. type: "string"
  13112. }
  13113. },
  13114. url: "/users/:username/gpg_keys"
  13115. },
  13116. listPublicEmails: {
  13117. method: "GET",
  13118. params: {
  13119. page: {
  13120. type: "integer"
  13121. },
  13122. per_page: {
  13123. type: "integer"
  13124. }
  13125. },
  13126. url: "/user/public_emails"
  13127. },
  13128. listPublicKeys: {
  13129. method: "GET",
  13130. params: {
  13131. page: {
  13132. type: "integer"
  13133. },
  13134. per_page: {
  13135. type: "integer"
  13136. }
  13137. },
  13138. url: "/user/keys"
  13139. },
  13140. listPublicKeysForUser: {
  13141. method: "GET",
  13142. params: {
  13143. page: {
  13144. type: "integer"
  13145. },
  13146. per_page: {
  13147. type: "integer"
  13148. },
  13149. username: {
  13150. required: true,
  13151. type: "string"
  13152. }
  13153. },
  13154. url: "/users/:username/keys"
  13155. },
  13156. togglePrimaryEmailVisibility: {
  13157. method: "PATCH",
  13158. params: {
  13159. email: {
  13160. required: true,
  13161. type: "string"
  13162. },
  13163. visibility: {
  13164. required: true,
  13165. type: "string"
  13166. }
  13167. },
  13168. url: "/user/email/visibility"
  13169. },
  13170. unblock: {
  13171. method: "DELETE",
  13172. params: {
  13173. username: {
  13174. required: true,
  13175. type: "string"
  13176. }
  13177. },
  13178. url: "/user/blocks/:username"
  13179. },
  13180. unfollow: {
  13181. method: "DELETE",
  13182. params: {
  13183. username: {
  13184. required: true,
  13185. type: "string"
  13186. }
  13187. },
  13188. url: "/user/following/:username"
  13189. },
  13190. updateAuthenticated: {
  13191. method: "PATCH",
  13192. params: {
  13193. bio: {
  13194. type: "string"
  13195. },
  13196. blog: {
  13197. type: "string"
  13198. },
  13199. company: {
  13200. type: "string"
  13201. },
  13202. email: {
  13203. type: "string"
  13204. },
  13205. hireable: {
  13206. type: "boolean"
  13207. },
  13208. location: {
  13209. type: "string"
  13210. },
  13211. name: {
  13212. type: "string"
  13213. }
  13214. },
  13215. url: "/user"
  13216. }
  13217. }
  13218. };
  13219. const VERSION = "2.4.0";
  13220. function registerEndpoints(octokit, routes) {
  13221. Object.keys(routes).forEach(namespaceName => {
  13222. if (!octokit[namespaceName]) {
  13223. octokit[namespaceName] = {};
  13224. }
  13225. Object.keys(routes[namespaceName]).forEach(apiName => {
  13226. const apiOptions = routes[namespaceName][apiName];
  13227. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  13228. if (typeof apiOptions[key] !== "undefined") {
  13229. map[key] = apiOptions[key];
  13230. }
  13231. return map;
  13232. }, {});
  13233. endpointDefaults.request = {
  13234. validate: apiOptions.params
  13235. };
  13236. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  13237. // Not the most elegant solution, but we don’t want to move deprecation
  13238. // logic into octokit/endpoint.js as it’s out of scope
  13239. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  13240. if (hasDeprecatedParam) {
  13241. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  13242. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  13243. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  13244. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  13245. }
  13246. if (apiOptions.deprecated) {
  13247. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  13248. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  13249. octokit[namespaceName][apiName] = request;
  13250. return request.apply(null, arguments);
  13251. }, request);
  13252. return;
  13253. }
  13254. octokit[namespaceName][apiName] = request;
  13255. });
  13256. });
  13257. }
  13258. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  13259. const patchedMethod = options => {
  13260. options = Object.assign({}, options);
  13261. Object.keys(options).forEach(key => {
  13262. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  13263. const aliasKey = apiOptions.params[key].alias;
  13264. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  13265. if (!(aliasKey in options)) {
  13266. options[aliasKey] = options[key];
  13267. }
  13268. delete options[key];
  13269. }
  13270. });
  13271. return method(options);
  13272. };
  13273. Object.keys(method).forEach(key => {
  13274. patchedMethod[key] = method[key];
  13275. });
  13276. return patchedMethod;
  13277. }
  13278. /**
  13279. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  13280. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  13281. * done, we will remove the registerEndpoints methods and return the methods
  13282. * directly as with the other plugins. At that point we will also remove the
  13283. * legacy workarounds and deprecations.
  13284. *
  13285. * See the plan at
  13286. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  13287. */
  13288. function restEndpointMethods(octokit) {
  13289. // @ts-ignore
  13290. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  13291. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  13292. // See https://github.com/octokit/rest.js/pull/1134
  13293. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  13294. Object.defineProperty(octokit, deprecatedScope, {
  13295. get() {
  13296. octokit.log.warn( // @ts-ignore
  13297. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  13298. return octokit[scope];
  13299. }
  13300. });
  13301. });
  13302. return {};
  13303. }
  13304. restEndpointMethods.VERSION = VERSION;
  13305. exports.restEndpointMethods = restEndpointMethods;
  13306. //# sourceMappingURL=index.js.map
  13307. /***/ }),
  13308. /***/ 48:
  13309. /***/ (function(module) {
  13310. "use strict";
  13311. // See http://www.robvanderwoude.com/escapechars.php
  13312. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  13313. function escapeCommand(arg) {
  13314. // Escape meta chars
  13315. arg = arg.replace(metaCharsRegExp, '^$1');
  13316. return arg;
  13317. }
  13318. function escapeArgument(arg, doubleEscapeMetaChars) {
  13319. // Convert to string
  13320. arg = `${arg}`;
  13321. // Algorithm below is based on https://qntm.org/cmd
  13322. // Sequence of backslashes followed by a double quote:
  13323. // double up all the backslashes and escape the double quote
  13324. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  13325. // Sequence of backslashes followed by the end of the string
  13326. // (which will become a double quote later):
  13327. // double up all the backslashes
  13328. arg = arg.replace(/(\\*)$/, '$1$1');
  13329. // All other backslashes occur literally
  13330. // Quote the whole thing:
  13331. arg = `"${arg}"`;
  13332. // Escape meta chars
  13333. arg = arg.replace(metaCharsRegExp, '^$1');
  13334. // Double escape meta chars if necessary
  13335. if (doubleEscapeMetaChars) {
  13336. arg = arg.replace(metaCharsRegExp, '^$1');
  13337. }
  13338. return arg;
  13339. }
  13340. module.exports.command = escapeCommand;
  13341. module.exports.argument = escapeArgument;
  13342. /***/ }),
  13343. /***/ 53:
  13344. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13345. "use strict";
  13346. Object.defineProperty(exports, "__esModule", { value: true });
  13347. const fs_1 = __webpack_require__(747);
  13348. const os_1 = __webpack_require__(87);
  13349. class Context {
  13350. /**
  13351. * Hydrate the context from the environment
  13352. */
  13353. constructor() {
  13354. this.payload = {};
  13355. if (process.env.GITHUB_EVENT_PATH) {
  13356. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  13357. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  13358. }
  13359. else {
  13360. const path = process.env.GITHUB_EVENT_PATH;
  13361. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  13362. }
  13363. }
  13364. this.eventName = process.env.GITHUB_EVENT_NAME;
  13365. this.sha = process.env.GITHUB_SHA;
  13366. this.ref = process.env.GITHUB_REF;
  13367. this.workflow = process.env.GITHUB_WORKFLOW;
  13368. this.action = process.env.GITHUB_ACTION;
  13369. this.actor = process.env.GITHUB_ACTOR;
  13370. }
  13371. get issue() {
  13372. const payload = this.payload;
  13373. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  13374. }
  13375. get repo() {
  13376. if (process.env.GITHUB_REPOSITORY) {
  13377. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  13378. return { owner, repo };
  13379. }
  13380. if (this.payload.repository) {
  13381. return {
  13382. owner: this.payload.repository.owner.login,
  13383. repo: this.payload.repository.name
  13384. };
  13385. }
  13386. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  13387. }
  13388. }
  13389. exports.Context = Context;
  13390. //# sourceMappingURL=context.js.map
  13391. /***/ }),
  13392. /***/ 58:
  13393. /***/ (function(module) {
  13394. module.exports = class HttpError extends Error {
  13395. constructor (message, code, headers) {
  13396. super(message)
  13397. // Maintains proper stack trace (only available on V8)
  13398. /* istanbul ignore next */
  13399. if (Error.captureStackTrace) {
  13400. Error.captureStackTrace(this, this.constructor)
  13401. }
  13402. this.name = 'HttpError'
  13403. this.code = code
  13404. this.headers = headers
  13405. }
  13406. }
  13407. /***/ }),
  13408. /***/ 72:
  13409. /***/ (function(module, __unusedexports, __webpack_require__) {
  13410. module.exports = paginationMethodsPlugin
  13411. function paginationMethodsPlugin (octokit) {
  13412. octokit.getFirstPage = __webpack_require__(242).bind(null, octokit)
  13413. octokit.getLastPage = __webpack_require__(203).bind(null, octokit)
  13414. octokit.getNextPage = __webpack_require__(655).bind(null, octokit)
  13415. octokit.getPreviousPage = __webpack_require__(178).bind(null, octokit)
  13416. octokit.hasFirstPage = __webpack_require__(631)
  13417. octokit.hasLastPage = __webpack_require__(286)
  13418. octokit.hasNextPage = __webpack_require__(500)
  13419. octokit.hasPreviousPage = __webpack_require__(996)
  13420. }
  13421. /***/ }),
  13422. /***/ 87:
  13423. /***/ (function(module) {
  13424. module.exports = require("os");
  13425. /***/ }),
  13426. /***/ 101:
  13427. /***/ (function(module) {
  13428. "use strict";
  13429. const isWin = process.platform === 'win32';
  13430. function notFoundError(original, syscall) {
  13431. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13432. code: 'ENOENT',
  13433. errno: 'ENOENT',
  13434. syscall: `${syscall} ${original.command}`,
  13435. path: original.command,
  13436. spawnargs: original.args,
  13437. });
  13438. }
  13439. function hookChildProcess(cp, parsed) {
  13440. if (!isWin) {
  13441. return;
  13442. }
  13443. const originalEmit = cp.emit;
  13444. cp.emit = function (name, arg1) {
  13445. // If emitting "exit" event and exit code is 1, we need to check if
  13446. // the command exists and emit an "error" instead
  13447. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13448. if (name === 'exit') {
  13449. const err = verifyENOENT(arg1, parsed, 'spawn');
  13450. if (err) {
  13451. return originalEmit.call(cp, 'error', err);
  13452. }
  13453. }
  13454. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13455. };
  13456. }
  13457. function verifyENOENT(status, parsed) {
  13458. if (isWin && status === 1 && !parsed.file) {
  13459. return notFoundError(parsed.original, 'spawn');
  13460. }
  13461. return null;
  13462. }
  13463. function verifyENOENTSync(status, parsed) {
  13464. if (isWin && status === 1 && !parsed.file) {
  13465. return notFoundError(parsed.original, 'spawnSync');
  13466. }
  13467. return null;
  13468. }
  13469. module.exports = {
  13470. hookChildProcess,
  13471. verifyENOENT,
  13472. verifyENOENTSync,
  13473. notFoundError,
  13474. };
  13475. /***/ }),
  13476. /***/ 109:
  13477. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13478. "use strict";
  13479. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13480. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13481. return new (P || (P = Promise))(function (resolve, reject) {
  13482. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13483. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13484. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13485. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13486. });
  13487. };
  13488. var __importStar = (this && this.__importStar) || function (mod) {
  13489. if (mod && mod.__esModule) return mod;
  13490. var result = {};
  13491. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  13492. result["default"] = mod;
  13493. return result;
  13494. };
  13495. Object.defineProperty(exports, "__esModule", { value: true });
  13496. const core = __importStar(__webpack_require__(186));
  13497. const coreCommand = __importStar(__webpack_require__(351));
  13498. const gitSourceProvider = __importStar(__webpack_require__(210));
  13499. const inputHelper = __importStar(__webpack_require__(480));
  13500. const path = __importStar(__webpack_require__(622));
  13501. const stateHelper = __importStar(__webpack_require__(647));
  13502. function run() {
  13503. return __awaiter(this, void 0, void 0, function* () {
  13504. try {
  13505. const sourceSettings = inputHelper.getInputs();
  13506. try {
  13507. // Register problem matcher
  13508. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  13509. // Get sources
  13510. yield gitSourceProvider.getSource(sourceSettings);
  13511. }
  13512. finally {
  13513. // Unregister problem matcher
  13514. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  13515. }
  13516. }
  13517. catch (error) {
  13518. core.setFailed(error.message);
  13519. }
  13520. });
  13521. }
  13522. function cleanup() {
  13523. return __awaiter(this, void 0, void 0, function* () {
  13524. try {
  13525. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  13526. }
  13527. catch (error) {
  13528. core.warning(error.message);
  13529. }
  13530. });
  13531. }
  13532. // Main
  13533. if (!stateHelper.IsPost) {
  13534. run();
  13535. }
  13536. // Post
  13537. else {
  13538. cleanup();
  13539. }
  13540. /***/ }),
  13541. /***/ 120:
  13542. /***/ (function(__unusedmodule, exports) {
  13543. "use strict";
  13544. Object.defineProperty(exports, "__esModule", { value: true });
  13545. function escape(value) {
  13546. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  13547. return `\\${x}`;
  13548. });
  13549. }
  13550. exports.escape = escape;
  13551. /***/ }),
  13552. /***/ 126:
  13553. /***/ (function(module, __unusedexports, __webpack_require__) {
  13554. var fs = __webpack_require__(747)
  13555. var core
  13556. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  13557. core = __webpack_require__(1)
  13558. } else {
  13559. core = __webpack_require__(728)
  13560. }
  13561. module.exports = isexe
  13562. isexe.sync = sync
  13563. function isexe (path, options, cb) {
  13564. if (typeof options === 'function') {
  13565. cb = options
  13566. options = {}
  13567. }
  13568. if (!cb) {
  13569. if (typeof Promise !== 'function') {
  13570. throw new TypeError('callback not provided')
  13571. }
  13572. return new Promise(function (resolve, reject) {
  13573. isexe(path, options || {}, function (er, is) {
  13574. if (er) {
  13575. reject(er)
  13576. } else {
  13577. resolve(is)
  13578. }
  13579. })
  13580. })
  13581. }
  13582. core(path, options || {}, function (er, is) {
  13583. // ignore EACCES because that just means we aren't allowed to run it
  13584. if (er) {
  13585. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  13586. er = null
  13587. is = false
  13588. }
  13589. }
  13590. cb(er, is)
  13591. })
  13592. }
  13593. function sync (path, options) {
  13594. // my kingdom for a filtered catch
  13595. try {
  13596. return core.sync(path, options || {})
  13597. } catch (er) {
  13598. if (options && options.ignoreErrors || er.code === 'EACCES') {
  13599. return false
  13600. } else {
  13601. throw er
  13602. }
  13603. }
  13604. }
  13605. /***/ }),
  13606. /***/ 129:
  13607. /***/ (function(module) {
  13608. module.exports = require("child_process");
  13609. /***/ }),
  13610. /***/ 132:
  13611. /***/ (function(module, __unusedexports, __webpack_require__) {
  13612. "use strict";
  13613. module.exports = validate;
  13614. const { RequestError } = __webpack_require__(239);
  13615. const get = __webpack_require__(197);
  13616. const set = __webpack_require__(552);
  13617. function validate(octokit, options) {
  13618. if (!options.request.validate) {
  13619. return;
  13620. }
  13621. const { validate: params } = options.request;
  13622. Object.keys(params).forEach(parameterName => {
  13623. const parameter = get(params, parameterName);
  13624. const expectedType = parameter.type;
  13625. let parentParameterName;
  13626. let parentValue;
  13627. let parentParamIsPresent = true;
  13628. let parentParameterIsArray = false;
  13629. if (/\./.test(parameterName)) {
  13630. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  13631. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  13632. if (parentParameterIsArray) {
  13633. parentParameterName = parentParameterName.slice(0, -2);
  13634. }
  13635. parentValue = get(options, parentParameterName);
  13636. parentParamIsPresent =
  13637. parentParameterName === "headers" ||
  13638. (typeof parentValue === "object" && parentValue !== null);
  13639. }
  13640. const values = parentParameterIsArray
  13641. ? (get(options, parentParameterName) || []).map(
  13642. value => value[parameterName.split(/\./).pop()]
  13643. )
  13644. : [get(options, parameterName)];
  13645. values.forEach((value, i) => {
  13646. const valueIsPresent = typeof value !== "undefined";
  13647. const valueIsNull = value === null;
  13648. const currentParameterName = parentParameterIsArray
  13649. ? parameterName.replace(/\[\]/, `[${i}]`)
  13650. : parameterName;
  13651. if (!parameter.required && !valueIsPresent) {
  13652. return;
  13653. }
  13654. // if the parent parameter is of type object but allows null
  13655. // then the child parameters can be ignored
  13656. if (!parentParamIsPresent) {
  13657. return;
  13658. }
  13659. if (parameter.allowNull && valueIsNull) {
  13660. return;
  13661. }
  13662. if (!parameter.allowNull && valueIsNull) {
  13663. throw new RequestError(
  13664. `'${currentParameterName}' cannot be null`,
  13665. 400,
  13666. {
  13667. request: options
  13668. }
  13669. );
  13670. }
  13671. if (parameter.required && !valueIsPresent) {
  13672. throw new RequestError(
  13673. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  13674. value
  13675. )}`,
  13676. 400,
  13677. {
  13678. request: options
  13679. }
  13680. );
  13681. }
  13682. // parse to integer before checking for enum
  13683. // so that string "1" will match enum with number 1
  13684. if (expectedType === "integer") {
  13685. const unparsedValue = value;
  13686. value = parseInt(value, 10);
  13687. if (isNaN(value)) {
  13688. throw new RequestError(
  13689. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  13690. unparsedValue
  13691. )} is NaN`,
  13692. 400,
  13693. {
  13694. request: options
  13695. }
  13696. );
  13697. }
  13698. }
  13699. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  13700. throw new RequestError(
  13701. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  13702. value
  13703. )}`,
  13704. 400,
  13705. {
  13706. request: options
  13707. }
  13708. );
  13709. }
  13710. if (parameter.validation) {
  13711. const regex = new RegExp(parameter.validation);
  13712. if (!regex.test(value)) {
  13713. throw new RequestError(
  13714. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  13715. value
  13716. )}`,
  13717. 400,
  13718. {
  13719. request: options
  13720. }
  13721. );
  13722. }
  13723. }
  13724. if (expectedType === "object" && typeof value === "string") {
  13725. try {
  13726. value = JSON.parse(value);
  13727. } catch (exception) {
  13728. throw new RequestError(
  13729. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  13730. value
  13731. )}`,
  13732. 400,
  13733. {
  13734. request: options
  13735. }
  13736. );
  13737. }
  13738. }
  13739. set(options, parameter.mapTo || currentParameterName, value);
  13740. });
  13741. });
  13742. return options;
  13743. }
  13744. /***/ }),
  13745. /***/ 138:
  13746. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13747. "use strict";
  13748. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13749. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13750. return new (P || (P = Promise))(function (resolve, reject) {
  13751. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13752. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13753. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13754. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13755. });
  13756. };
  13757. var __importStar = (this && this.__importStar) || function (mod) {
  13758. if (mod && mod.__esModule) return mod;
  13759. var result = {};
  13760. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  13761. result["default"] = mod;
  13762. return result;
  13763. };
  13764. var __importDefault = (this && this.__importDefault) || function (mod) {
  13765. return (mod && mod.__esModule) ? mod : { "default": mod };
  13766. };
  13767. Object.defineProperty(exports, "__esModule", { value: true });
  13768. const assert = __importStar(__webpack_require__(357));
  13769. const core = __importStar(__webpack_require__(186));
  13770. const fs = __importStar(__webpack_require__(747));
  13771. const github = __importStar(__webpack_require__(438));
  13772. const io = __importStar(__webpack_require__(436));
  13773. const path = __importStar(__webpack_require__(622));
  13774. const retryHelper = __importStar(__webpack_require__(155));
  13775. const toolCache = __importStar(__webpack_require__(784));
  13776. const v4_1 = __importDefault(__webpack_require__(824));
  13777. const IS_WINDOWS = process.platform === 'win32';
  13778. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  13779. return __awaiter(this, void 0, void 0, function* () {
  13780. // Determine the default branch
  13781. if (!ref && !commit) {
  13782. core.info('Determining the default branch');
  13783. ref = yield getDefaultBranch(authToken, owner, repo);
  13784. }
  13785. // Download the archive
  13786. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  13787. core.info('Downloading the archive');
  13788. return yield downloadArchive(authToken, owner, repo, ref, commit);
  13789. }));
  13790. // Write archive to disk
  13791. core.info('Writing archive to disk');
  13792. const uniqueId = v4_1.default();
  13793. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  13794. yield fs.promises.writeFile(archivePath, archiveData);
  13795. archiveData = Buffer.from(''); // Free memory
  13796. // Extract archive
  13797. core.info('Extracting the archive');
  13798. const extractPath = path.join(repositoryPath, uniqueId);
  13799. yield io.mkdirP(extractPath);
  13800. if (IS_WINDOWS) {
  13801. yield toolCache.extractZip(archivePath, extractPath);
  13802. }
  13803. else {
  13804. yield toolCache.extractTar(archivePath, extractPath);
  13805. }
  13806. io.rmRF(archivePath);
  13807. // Determine the path of the repository content. The archive contains
  13808. // a top-level folder and the repository content is inside.
  13809. const archiveFileNames = yield fs.promises.readdir(extractPath);
  13810. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  13811. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  13812. core.info(`Resolved version ${archiveVersion}`);
  13813. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  13814. // Move the files
  13815. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  13816. const sourcePath = path.join(tempRepositoryPath, fileName);
  13817. const targetPath = path.join(repositoryPath, fileName);
  13818. if (IS_WINDOWS) {
  13819. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  13820. }
  13821. else {
  13822. yield io.mv(sourcePath, targetPath);
  13823. }
  13824. }
  13825. io.rmRF(extractPath);
  13826. });
  13827. }
  13828. exports.downloadRepository = downloadRepository;
  13829. /**
  13830. * Looks up the default branch name
  13831. */
  13832. function getDefaultBranch(authToken, owner, repo) {
  13833. return __awaiter(this, void 0, void 0, function* () {
  13834. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  13835. core.info('Retrieving the default branch name');
  13836. const octokit = new github.GitHub(authToken);
  13837. let result;
  13838. try {
  13839. // Get the default branch from the repo info
  13840. const response = yield octokit.repos.get({ owner, repo });
  13841. result = response.data.default_branch;
  13842. assert.ok(result, 'default_branch cannot be empty');
  13843. }
  13844. catch (err) {
  13845. // Handle .wiki repo
  13846. if (err['status'] === 404 && repo.toUpperCase().endsWith('.WIKI')) {
  13847. result = 'master';
  13848. }
  13849. // Otherwise error
  13850. else {
  13851. throw err;
  13852. }
  13853. }
  13854. // Print the default branch
  13855. core.info(`Default branch '${result}'`);
  13856. // Prefix with 'refs/heads'
  13857. if (!result.startsWith('refs/')) {
  13858. result = `refs/heads/${result}`;
  13859. }
  13860. return result;
  13861. }));
  13862. });
  13863. }
  13864. exports.getDefaultBranch = getDefaultBranch;
  13865. function downloadArchive(authToken, owner, repo, ref, commit) {
  13866. return __awaiter(this, void 0, void 0, function* () {
  13867. const octokit = new github.GitHub(authToken);
  13868. const params = {
  13869. owner: owner,
  13870. repo: repo,
  13871. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  13872. ref: commit || ref
  13873. };
  13874. const response = yield octokit.repos.getArchiveLink(params);
  13875. if (response.status != 200) {
  13876. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  13877. }
  13878. return Buffer.from(response.data); // response.data is ArrayBuffer
  13879. });
  13880. }
  13881. /***/ }),
  13882. /***/ 142:
  13883. /***/ (function(__unusedmodule, exports) {
  13884. "use strict";
  13885. Object.defineProperty(exports, "__esModule", { value: true });
  13886. class GitVersion {
  13887. /**
  13888. * Used for comparing the version of git and git-lfs against the minimum required version
  13889. * @param version the version string, e.g. 1.2 or 1.2.3
  13890. */
  13891. constructor(version) {
  13892. this.major = NaN;
  13893. this.minor = NaN;
  13894. this.patch = NaN;
  13895. if (version) {
  13896. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  13897. if (match) {
  13898. this.major = Number(match[1]);
  13899. this.minor = Number(match[2]);
  13900. if (match[4]) {
  13901. this.patch = Number(match[4]);
  13902. }
  13903. }
  13904. }
  13905. }
  13906. /**
  13907. * Compares the instance against a minimum required version
  13908. * @param minimum Minimum version
  13909. */
  13910. checkMinimum(minimum) {
  13911. if (!minimum.isValid()) {
  13912. throw new Error('Arg minimum is not a valid version');
  13913. }
  13914. // Major is insufficient
  13915. if (this.major < minimum.major) {
  13916. return false;
  13917. }
  13918. // Major is equal
  13919. if (this.major === minimum.major) {
  13920. // Minor is insufficient
  13921. if (this.minor < minimum.minor) {
  13922. return false;
  13923. }
  13924. // Minor is equal
  13925. if (this.minor === minimum.minor) {
  13926. // Patch is insufficient
  13927. if (this.patch && this.patch < (minimum.patch || 0)) {
  13928. return false;
  13929. }
  13930. }
  13931. }
  13932. return true;
  13933. }
  13934. /**
  13935. * Indicates whether the instance was constructed from a valid version string
  13936. */
  13937. isValid() {
  13938. return !isNaN(this.major);
  13939. }
  13940. /**
  13941. * Returns the version as a string, e.g. 1.2 or 1.2.3
  13942. */
  13943. toString() {
  13944. let result = '';
  13945. if (this.isValid()) {
  13946. result = `${this.major}.${this.minor}`;
  13947. if (!isNaN(this.patch)) {
  13948. result += `.${this.patch}`;
  13949. }
  13950. }
  13951. return result;
  13952. }
  13953. }
  13954. exports.GitVersion = GitVersion;
  13955. /***/ }),
  13956. /***/ 153:
  13957. /***/ (function(module, __unusedexports, __webpack_require__) {
  13958. module.exports = __webpack_require__(406);
  13959. /***/ }),
  13960. /***/ 155:
  13961. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13962. "use strict";
  13963. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13964. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13965. return new (P || (P = Promise))(function (resolve, reject) {
  13966. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13967. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13968. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13969. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13970. });
  13971. };
  13972. var __importStar = (this && this.__importStar) || function (mod) {
  13973. if (mod && mod.__esModule) return mod;
  13974. var result = {};
  13975. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  13976. result["default"] = mod;
  13977. return result;
  13978. };
  13979. Object.defineProperty(exports, "__esModule", { value: true });
  13980. const core = __importStar(__webpack_require__(186));
  13981. const defaultMaxAttempts = 3;
  13982. const defaultMinSeconds = 10;
  13983. const defaultMaxSeconds = 20;
  13984. class RetryHelper {
  13985. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  13986. this.maxAttempts = maxAttempts;
  13987. this.minSeconds = Math.floor(minSeconds);
  13988. this.maxSeconds = Math.floor(maxSeconds);
  13989. if (this.minSeconds > this.maxSeconds) {
  13990. throw new Error('min seconds should be less than or equal to max seconds');
  13991. }
  13992. }
  13993. execute(action) {
  13994. return __awaiter(this, void 0, void 0, function* () {
  13995. let attempt = 1;
  13996. while (attempt < this.maxAttempts) {
  13997. // Try
  13998. try {
  13999. return yield action();
  14000. }
  14001. catch (err) {
  14002. core.info(err.message);
  14003. }
  14004. // Sleep
  14005. const seconds = this.getSleepAmount();
  14006. core.info(`Waiting ${seconds} seconds before trying again`);
  14007. yield this.sleep(seconds);
  14008. attempt++;
  14009. }
  14010. // Last attempt
  14011. return yield action();
  14012. });
  14013. }
  14014. getSleepAmount() {
  14015. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  14016. this.minSeconds);
  14017. }
  14018. sleep(seconds) {
  14019. return __awaiter(this, void 0, void 0, function* () {
  14020. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  14021. });
  14022. }
  14023. }
  14024. exports.RetryHelper = RetryHelper;
  14025. function execute(action) {
  14026. return __awaiter(this, void 0, void 0, function* () {
  14027. const retryHelper = new RetryHelper();
  14028. return yield retryHelper.execute(action);
  14029. });
  14030. }
  14031. exports.execute = execute;
  14032. /***/ }),
  14033. /***/ 159:
  14034. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14035. "use strict";
  14036. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  14037. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  14038. return new (P || (P = Promise))(function (resolve, reject) {
  14039. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  14040. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  14041. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  14042. step((generator = generator.apply(thisArg, _arguments || [])).next());
  14043. });
  14044. };
  14045. Object.defineProperty(exports, "__esModule", { value: true });
  14046. const os = __webpack_require__(87);
  14047. const events = __webpack_require__(614);
  14048. const child = __webpack_require__(129);
  14049. /* eslint-disable @typescript-eslint/unbound-method */
  14050. const IS_WINDOWS = process.platform === 'win32';
  14051. /*
  14052. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  14053. */
  14054. class ToolRunner extends events.EventEmitter {
  14055. constructor(toolPath, args, options) {
  14056. super();
  14057. if (!toolPath) {
  14058. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  14059. }
  14060. this.toolPath = toolPath;
  14061. this.args = args || [];
  14062. this.options = options || {};
  14063. }
  14064. _debug(message) {
  14065. if (this.options.listeners && this.options.listeners.debug) {
  14066. this.options.listeners.debug(message);
  14067. }
  14068. }
  14069. _getCommandString(options, noPrefix) {
  14070. const toolPath = this._getSpawnFileName();
  14071. const args = this._getSpawnArgs(options);
  14072. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  14073. if (IS_WINDOWS) {
  14074. // Windows + cmd file
  14075. if (this._isCmdFile()) {
  14076. cmd += toolPath;
  14077. for (const a of args) {
  14078. cmd += ` ${a}`;
  14079. }
  14080. }
  14081. // Windows + verbatim
  14082. else if (options.windowsVerbatimArguments) {
  14083. cmd += `"${toolPath}"`;
  14084. for (const a of args) {
  14085. cmd += ` ${a}`;
  14086. }
  14087. }
  14088. // Windows (regular)
  14089. else {
  14090. cmd += this._windowsQuoteCmdArg(toolPath);
  14091. for (const a of args) {
  14092. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  14093. }
  14094. }
  14095. }
  14096. else {
  14097. // OSX/Linux - this can likely be improved with some form of quoting.
  14098. // creating processes on Unix is fundamentally different than Windows.
  14099. // on Unix, execvp() takes an arg array.
  14100. cmd += toolPath;
  14101. for (const a of args) {
  14102. cmd += ` ${a}`;
  14103. }
  14104. }
  14105. return cmd;
  14106. }
  14107. _processLineBuffer(data, strBuffer, onLine) {
  14108. try {
  14109. let s = strBuffer + data.toString();
  14110. let n = s.indexOf(os.EOL);
  14111. while (n > -1) {
  14112. const line = s.substring(0, n);
  14113. onLine(line);
  14114. // the rest of the string ...
  14115. s = s.substring(n + os.EOL.length);
  14116. n = s.indexOf(os.EOL);
  14117. }
  14118. strBuffer = s;
  14119. }
  14120. catch (err) {
  14121. // streaming lines to console is best effort. Don't fail a build.
  14122. this._debug(`error processing line. Failed with error ${err}`);
  14123. }
  14124. }
  14125. _getSpawnFileName() {
  14126. if (IS_WINDOWS) {
  14127. if (this._isCmdFile()) {
  14128. return process.env['COMSPEC'] || 'cmd.exe';
  14129. }
  14130. }
  14131. return this.toolPath;
  14132. }
  14133. _getSpawnArgs(options) {
  14134. if (IS_WINDOWS) {
  14135. if (this._isCmdFile()) {
  14136. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  14137. for (const a of this.args) {
  14138. argline += ' ';
  14139. argline += options.windowsVerbatimArguments
  14140. ? a
  14141. : this._windowsQuoteCmdArg(a);
  14142. }
  14143. argline += '"';
  14144. return [argline];
  14145. }
  14146. }
  14147. return this.args;
  14148. }
  14149. _endsWith(str, end) {
  14150. return str.endsWith(end);
  14151. }
  14152. _isCmdFile() {
  14153. const upperToolPath = this.toolPath.toUpperCase();
  14154. return (this._endsWith(upperToolPath, '.CMD') ||
  14155. this._endsWith(upperToolPath, '.BAT'));
  14156. }
  14157. _windowsQuoteCmdArg(arg) {
  14158. // for .exe, apply the normal quoting rules that libuv applies
  14159. if (!this._isCmdFile()) {
  14160. return this._uvQuoteCmdArg(arg);
  14161. }
  14162. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  14163. // the libuv rules are generic and are not designed specifically for cmd.exe
  14164. // command line parser.
  14165. //
  14166. // for a detailed description of the cmd.exe command line parser, refer to
  14167. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  14168. // need quotes for empty arg
  14169. if (!arg) {
  14170. return '""';
  14171. }
  14172. // determine whether the arg needs to be quoted
  14173. const cmdSpecialChars = [
  14174. ' ',
  14175. '\t',
  14176. '&',
  14177. '(',
  14178. ')',
  14179. '[',
  14180. ']',
  14181. '{',
  14182. '}',
  14183. '^',
  14184. '=',
  14185. ';',
  14186. '!',
  14187. "'",
  14188. '+',
  14189. ',',
  14190. '`',
  14191. '~',
  14192. '|',
  14193. '<',
  14194. '>',
  14195. '"'
  14196. ];
  14197. let needsQuotes = false;
  14198. for (const char of arg) {
  14199. if (cmdSpecialChars.some(x => x === char)) {
  14200. needsQuotes = true;
  14201. break;
  14202. }
  14203. }
  14204. // short-circuit if quotes not needed
  14205. if (!needsQuotes) {
  14206. return arg;
  14207. }
  14208. // the following quoting rules are very similar to the rules that by libuv applies.
  14209. //
  14210. // 1) wrap the string in quotes
  14211. //
  14212. // 2) double-up quotes - i.e. " => ""
  14213. //
  14214. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  14215. // doesn't work well with a cmd.exe command line.
  14216. //
  14217. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  14218. // for example, the command line:
  14219. // foo.exe "myarg:""my val"""
  14220. // is parsed by a .NET console app into an arg array:
  14221. // [ "myarg:\"my val\"" ]
  14222. // which is the same end result when applying libuv quoting rules. although the actual
  14223. // command line from libuv quoting rules would look like:
  14224. // foo.exe "myarg:\"my val\""
  14225. //
  14226. // 3) double-up slashes that precede a quote,
  14227. // e.g. hello \world => "hello \world"
  14228. // hello\"world => "hello\\""world"
  14229. // hello\\"world => "hello\\\\""world"
  14230. // hello world\ => "hello world\\"
  14231. //
  14232. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  14233. // the reasons for including this as a .cmd quoting rule are:
  14234. //
  14235. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  14236. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  14237. //
  14238. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  14239. // haven't heard any complaints about that aspect.
  14240. //
  14241. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  14242. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  14243. // by using %%.
  14244. //
  14245. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  14246. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  14247. //
  14248. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  14249. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  14250. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  14251. // to an external program.
  14252. //
  14253. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  14254. // % can be escaped within a .cmd file.
  14255. let reverse = '"';
  14256. let quoteHit = true;
  14257. for (let i = arg.length; i > 0; i--) {
  14258. // walk the string in reverse
  14259. reverse += arg[i - 1];
  14260. if (quoteHit && arg[i - 1] === '\\') {
  14261. reverse += '\\'; // double the slash
  14262. }
  14263. else if (arg[i - 1] === '"') {
  14264. quoteHit = true;
  14265. reverse += '"'; // double the quote
  14266. }
  14267. else {
  14268. quoteHit = false;
  14269. }
  14270. }
  14271. reverse += '"';
  14272. return reverse
  14273. .split('')
  14274. .reverse()
  14275. .join('');
  14276. }
  14277. _uvQuoteCmdArg(arg) {
  14278. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  14279. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  14280. // is used.
  14281. //
  14282. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  14283. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  14284. // pasting copyright notice from Node within this function:
  14285. //
  14286. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  14287. //
  14288. // Permission is hereby granted, free of charge, to any person obtaining a copy
  14289. // of this software and associated documentation files (the "Software"), to
  14290. // deal in the Software without restriction, including without limitation the
  14291. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  14292. // sell copies of the Software, and to permit persons to whom the Software is
  14293. // furnished to do so, subject to the following conditions:
  14294. //
  14295. // The above copyright notice and this permission notice shall be included in
  14296. // all copies or substantial portions of the Software.
  14297. //
  14298. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14299. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14300. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14301. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14302. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  14303. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  14304. // IN THE SOFTWARE.
  14305. if (!arg) {
  14306. // Need double quotation for empty argument
  14307. return '""';
  14308. }
  14309. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  14310. // No quotation needed
  14311. return arg;
  14312. }
  14313. if (!arg.includes('"') && !arg.includes('\\')) {
  14314. // No embedded double quotes or backslashes, so I can just wrap
  14315. // quote marks around the whole thing.
  14316. return `"${arg}"`;
  14317. }
  14318. // Expected input/output:
  14319. // input : hello"world
  14320. // output: "hello\"world"
  14321. // input : hello""world
  14322. // output: "hello\"\"world"
  14323. // input : hello\world
  14324. // output: hello\world
  14325. // input : hello\\world
  14326. // output: hello\\world
  14327. // input : hello\"world
  14328. // output: "hello\\\"world"
  14329. // input : hello\\"world
  14330. // output: "hello\\\\\"world"
  14331. // input : hello world\
  14332. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  14333. // but it appears the comment is wrong, it should be "hello world\\"
  14334. let reverse = '"';
  14335. let quoteHit = true;
  14336. for (let i = arg.length; i > 0; i--) {
  14337. // walk the string in reverse
  14338. reverse += arg[i - 1];
  14339. if (quoteHit && arg[i - 1] === '\\') {
  14340. reverse += '\\';
  14341. }
  14342. else if (arg[i - 1] === '"') {
  14343. quoteHit = true;
  14344. reverse += '\\';
  14345. }
  14346. else {
  14347. quoteHit = false;
  14348. }
  14349. }
  14350. reverse += '"';
  14351. return reverse
  14352. .split('')
  14353. .reverse()
  14354. .join('');
  14355. }
  14356. _cloneExecOptions(options) {
  14357. options = options || {};
  14358. const result = {
  14359. cwd: options.cwd || process.cwd(),
  14360. env: options.env || process.env,
  14361. silent: options.silent || false,
  14362. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  14363. failOnStdErr: options.failOnStdErr || false,
  14364. ignoreReturnCode: options.ignoreReturnCode || false,
  14365. delay: options.delay || 10000
  14366. };
  14367. result.outStream = options.outStream || process.stdout;
  14368. result.errStream = options.errStream || process.stderr;
  14369. return result;
  14370. }
  14371. _getSpawnOptions(options, toolPath) {
  14372. options = options || {};
  14373. const result = {};
  14374. result.cwd = options.cwd;
  14375. result.env = options.env;
  14376. result['windowsVerbatimArguments'] =
  14377. options.windowsVerbatimArguments || this._isCmdFile();
  14378. if (options.windowsVerbatimArguments) {
  14379. result.argv0 = `"${toolPath}"`;
  14380. }
  14381. return result;
  14382. }
  14383. /**
  14384. * Exec a tool.
  14385. * Output will be streamed to the live console.
  14386. * Returns promise with return code
  14387. *
  14388. * @param tool path to tool to exec
  14389. * @param options optional exec options. See ExecOptions
  14390. * @returns number
  14391. */
  14392. exec() {
  14393. return __awaiter(this, void 0, void 0, function* () {
  14394. return new Promise((resolve, reject) => {
  14395. this._debug(`exec tool: ${this.toolPath}`);
  14396. this._debug('arguments:');
  14397. for (const arg of this.args) {
  14398. this._debug(` ${arg}`);
  14399. }
  14400. const optionsNonNull = this._cloneExecOptions(this.options);
  14401. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  14402. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  14403. }
  14404. const state = new ExecState(optionsNonNull, this.toolPath);
  14405. state.on('debug', (message) => {
  14406. this._debug(message);
  14407. });
  14408. const fileName = this._getSpawnFileName();
  14409. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  14410. const stdbuffer = '';
  14411. if (cp.stdout) {
  14412. cp.stdout.on('data', (data) => {
  14413. if (this.options.listeners && this.options.listeners.stdout) {
  14414. this.options.listeners.stdout(data);
  14415. }
  14416. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  14417. optionsNonNull.outStream.write(data);
  14418. }
  14419. this._processLineBuffer(data, stdbuffer, (line) => {
  14420. if (this.options.listeners && this.options.listeners.stdline) {
  14421. this.options.listeners.stdline(line);
  14422. }
  14423. });
  14424. });
  14425. }
  14426. const errbuffer = '';
  14427. if (cp.stderr) {
  14428. cp.stderr.on('data', (data) => {
  14429. state.processStderr = true;
  14430. if (this.options.listeners && this.options.listeners.stderr) {
  14431. this.options.listeners.stderr(data);
  14432. }
  14433. if (!optionsNonNull.silent &&
  14434. optionsNonNull.errStream &&
  14435. optionsNonNull.outStream) {
  14436. const s = optionsNonNull.failOnStdErr
  14437. ? optionsNonNull.errStream
  14438. : optionsNonNull.outStream;
  14439. s.write(data);
  14440. }
  14441. this._processLineBuffer(data, errbuffer, (line) => {
  14442. if (this.options.listeners && this.options.listeners.errline) {
  14443. this.options.listeners.errline(line);
  14444. }
  14445. });
  14446. });
  14447. }
  14448. cp.on('error', (err) => {
  14449. state.processError = err.message;
  14450. state.processExited = true;
  14451. state.processClosed = true;
  14452. state.CheckComplete();
  14453. });
  14454. cp.on('exit', (code) => {
  14455. state.processExitCode = code;
  14456. state.processExited = true;
  14457. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  14458. state.CheckComplete();
  14459. });
  14460. cp.on('close', (code) => {
  14461. state.processExitCode = code;
  14462. state.processExited = true;
  14463. state.processClosed = true;
  14464. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  14465. state.CheckComplete();
  14466. });
  14467. state.on('done', (error, exitCode) => {
  14468. if (stdbuffer.length > 0) {
  14469. this.emit('stdline', stdbuffer);
  14470. }
  14471. if (errbuffer.length > 0) {
  14472. this.emit('errline', errbuffer);
  14473. }
  14474. cp.removeAllListeners();
  14475. if (error) {
  14476. reject(error);
  14477. }
  14478. else {
  14479. resolve(exitCode);
  14480. }
  14481. });
  14482. });
  14483. });
  14484. }
  14485. }
  14486. exports.ToolRunner = ToolRunner;
  14487. /**
  14488. * Convert an arg string to an array of args. Handles escaping
  14489. *
  14490. * @param argString string of arguments
  14491. * @returns string[] array of arguments
  14492. */
  14493. function argStringToArray(argString) {
  14494. const args = [];
  14495. let inQuotes = false;
  14496. let escaped = false;
  14497. let arg = '';
  14498. function append(c) {
  14499. // we only escape double quotes.
  14500. if (escaped && c !== '"') {
  14501. arg += '\\';
  14502. }
  14503. arg += c;
  14504. escaped = false;
  14505. }
  14506. for (let i = 0; i < argString.length; i++) {
  14507. const c = argString.charAt(i);
  14508. if (c === '"') {
  14509. if (!escaped) {
  14510. inQuotes = !inQuotes;
  14511. }
  14512. else {
  14513. append(c);
  14514. }
  14515. continue;
  14516. }
  14517. if (c === '\\' && escaped) {
  14518. append(c);
  14519. continue;
  14520. }
  14521. if (c === '\\' && inQuotes) {
  14522. escaped = true;
  14523. continue;
  14524. }
  14525. if (c === ' ' && !inQuotes) {
  14526. if (arg.length > 0) {
  14527. args.push(arg);
  14528. arg = '';
  14529. }
  14530. continue;
  14531. }
  14532. append(c);
  14533. }
  14534. if (arg.length > 0) {
  14535. args.push(arg.trim());
  14536. }
  14537. return args;
  14538. }
  14539. exports.argStringToArray = argStringToArray;
  14540. class ExecState extends events.EventEmitter {
  14541. constructor(options, toolPath) {
  14542. super();
  14543. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  14544. this.processError = '';
  14545. this.processExitCode = 0;
  14546. this.processExited = false; // tracks whether the process has exited
  14547. this.processStderr = false; // tracks whether stderr was written to
  14548. this.delay = 10000; // 10 seconds
  14549. this.done = false;
  14550. this.timeout = null;
  14551. if (!toolPath) {
  14552. throw new Error('toolPath must not be empty');
  14553. }
  14554. this.options = options;
  14555. this.toolPath = toolPath;
  14556. if (options.delay) {
  14557. this.delay = options.delay;
  14558. }
  14559. }
  14560. CheckComplete() {
  14561. if (this.done) {
  14562. return;
  14563. }
  14564. if (this.processClosed) {
  14565. this._setResult();
  14566. }
  14567. else if (this.processExited) {
  14568. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  14569. }
  14570. }
  14571. _debug(message) {
  14572. this.emit('debug', message);
  14573. }
  14574. _setResult() {
  14575. // determine whether there is an error
  14576. let error;
  14577. if (this.processExited) {
  14578. if (this.processError) {
  14579. 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}`);
  14580. }
  14581. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  14582. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  14583. }
  14584. else if (this.processStderr && this.options.failOnStdErr) {
  14585. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  14586. }
  14587. }
  14588. // clear the timeout
  14589. if (this.timeout) {
  14590. clearTimeout(this.timeout);
  14591. this.timeout = null;
  14592. }
  14593. this.done = true;
  14594. this.emit('done', error, this.processExitCode);
  14595. }
  14596. static HandleTimeout(state) {
  14597. if (state.done) {
  14598. return;
  14599. }
  14600. if (!state.processClosed && state.processExited) {
  14601. const message = `The STDIO streams did not close within ${state.delay /
  14602. 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.`;
  14603. state._debug(message);
  14604. }
  14605. state._setResult();
  14606. }
  14607. }
  14608. //# sourceMappingURL=toolrunner.js.map
  14609. /***/ }),
  14610. /***/ 166:
  14611. /***/ (function(module) {
  14612. "use strict";
  14613. const alias = ['stdin', 'stdout', 'stderr'];
  14614. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  14615. module.exports = opts => {
  14616. if (!opts) {
  14617. return null;
  14618. }
  14619. if (opts.stdio && hasAlias(opts)) {
  14620. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  14621. }
  14622. if (typeof opts.stdio === 'string') {
  14623. return opts.stdio;
  14624. }
  14625. const stdio = opts.stdio || [];
  14626. if (!Array.isArray(stdio)) {
  14627. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  14628. }
  14629. const result = [];
  14630. const len = Math.max(stdio.length, alias.length);
  14631. for (let i = 0; i < len; i++) {
  14632. let value = null;
  14633. if (stdio[i] !== undefined) {
  14634. value = stdio[i];
  14635. } else if (opts[alias[i]] !== undefined) {
  14636. value = opts[alias[i]];
  14637. }
  14638. result[i] = value;
  14639. }
  14640. return result;
  14641. };
  14642. /***/ }),
  14643. /***/ 178:
  14644. /***/ (function(module, __unusedexports, __webpack_require__) {
  14645. module.exports = getPreviousPage
  14646. const getPage = __webpack_require__(604)
  14647. function getPreviousPage (octokit, link, headers) {
  14648. return getPage(octokit, link, 'prev', headers)
  14649. }
  14650. /***/ }),
  14651. /***/ 186:
  14652. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14653. "use strict";
  14654. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  14655. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  14656. return new (P || (P = Promise))(function (resolve, reject) {
  14657. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  14658. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  14659. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  14660. step((generator = generator.apply(thisArg, _arguments || [])).next());
  14661. });
  14662. };
  14663. Object.defineProperty(exports, "__esModule", { value: true });
  14664. const command_1 = __webpack_require__(351);
  14665. const os = __webpack_require__(87);
  14666. const path = __webpack_require__(622);
  14667. /**
  14668. * The code to exit an action
  14669. */
  14670. var ExitCode;
  14671. (function (ExitCode) {
  14672. /**
  14673. * A code indicating that the action was successful
  14674. */
  14675. ExitCode[ExitCode["Success"] = 0] = "Success";
  14676. /**
  14677. * A code indicating that the action was a failure
  14678. */
  14679. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  14680. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  14681. //-----------------------------------------------------------------------
  14682. // Variables
  14683. //-----------------------------------------------------------------------
  14684. /**
  14685. * Sets env variable for this action and future actions in the job
  14686. * @param name the name of the variable to set
  14687. * @param val the value of the variable
  14688. */
  14689. function exportVariable(name, val) {
  14690. process.env[name] = val;
  14691. command_1.issueCommand('set-env', { name }, val);
  14692. }
  14693. exports.exportVariable = exportVariable;
  14694. /**
  14695. * Registers a secret which will get masked from logs
  14696. * @param secret value of the secret
  14697. */
  14698. function setSecret(secret) {
  14699. command_1.issueCommand('add-mask', {}, secret);
  14700. }
  14701. exports.setSecret = setSecret;
  14702. /**
  14703. * Prepends inputPath to the PATH (for this action and future actions)
  14704. * @param inputPath
  14705. */
  14706. function addPath(inputPath) {
  14707. command_1.issueCommand('add-path', {}, inputPath);
  14708. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  14709. }
  14710. exports.addPath = addPath;
  14711. /**
  14712. * Gets the value of an input. The value is also trimmed.
  14713. *
  14714. * @param name name of the input to get
  14715. * @param options optional. See InputOptions.
  14716. * @returns string
  14717. */
  14718. function getInput(name, options) {
  14719. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  14720. if (options && options.required && !val) {
  14721. throw new Error(`Input required and not supplied: ${name}`);
  14722. }
  14723. return val.trim();
  14724. }
  14725. exports.getInput = getInput;
  14726. /**
  14727. * Sets the value of an output.
  14728. *
  14729. * @param name name of the output to set
  14730. * @param value value to store
  14731. */
  14732. function setOutput(name, value) {
  14733. command_1.issueCommand('set-output', { name }, value);
  14734. }
  14735. exports.setOutput = setOutput;
  14736. //-----------------------------------------------------------------------
  14737. // Results
  14738. //-----------------------------------------------------------------------
  14739. /**
  14740. * Sets the action status to failed.
  14741. * When the action exits it will be with an exit code of 1
  14742. * @param message add error issue message
  14743. */
  14744. function setFailed(message) {
  14745. process.exitCode = ExitCode.Failure;
  14746. error(message);
  14747. }
  14748. exports.setFailed = setFailed;
  14749. //-----------------------------------------------------------------------
  14750. // Logging Commands
  14751. //-----------------------------------------------------------------------
  14752. /**
  14753. * Writes debug message to user log
  14754. * @param message debug message
  14755. */
  14756. function debug(message) {
  14757. command_1.issueCommand('debug', {}, message);
  14758. }
  14759. exports.debug = debug;
  14760. /**
  14761. * Adds an error issue
  14762. * @param message error issue message
  14763. */
  14764. function error(message) {
  14765. command_1.issue('error', message);
  14766. }
  14767. exports.error = error;
  14768. /**
  14769. * Adds an warning issue
  14770. * @param message warning issue message
  14771. */
  14772. function warning(message) {
  14773. command_1.issue('warning', message);
  14774. }
  14775. exports.warning = warning;
  14776. /**
  14777. * Writes info to log with console.log.
  14778. * @param message info message
  14779. */
  14780. function info(message) {
  14781. process.stdout.write(message + os.EOL);
  14782. }
  14783. exports.info = info;
  14784. /**
  14785. * Begin an output group.
  14786. *
  14787. * Output until the next `groupEnd` will be foldable in this group
  14788. *
  14789. * @param name The name of the output group
  14790. */
  14791. function startGroup(name) {
  14792. command_1.issue('group', name);
  14793. }
  14794. exports.startGroup = startGroup;
  14795. /**
  14796. * End an output group.
  14797. */
  14798. function endGroup() {
  14799. command_1.issue('endgroup');
  14800. }
  14801. exports.endGroup = endGroup;
  14802. /**
  14803. * Wrap an asynchronous function call in a group.
  14804. *
  14805. * Returns the same type as the function itself.
  14806. *
  14807. * @param name The name of the group
  14808. * @param fn The function to wrap in the group
  14809. */
  14810. function group(name, fn) {
  14811. return __awaiter(this, void 0, void 0, function* () {
  14812. startGroup(name);
  14813. let result;
  14814. try {
  14815. result = yield fn();
  14816. }
  14817. finally {
  14818. endGroup();
  14819. }
  14820. return result;
  14821. });
  14822. }
  14823. exports.group = group;
  14824. //# sourceMappingURL=core.js.map
  14825. /***/ }),
  14826. /***/ 191:
  14827. /***/ (function(module) {
  14828. module.exports = deprecate
  14829. const loggedMessages = {}
  14830. function deprecate (message) {
  14831. if (loggedMessages[message]) {
  14832. return
  14833. }
  14834. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  14835. loggedMessages[message] = 1
  14836. }
  14837. /***/ }),
  14838. /***/ 193:
  14839. /***/ (function(__unusedmodule, exports) {
  14840. "use strict";
  14841. Object.defineProperty(exports, '__esModule', { value: true });
  14842. const VERSION = "1.1.2";
  14843. /**
  14844. * Some “list” response that can be paginated have a different response structure
  14845. *
  14846. * They have a `total_count` key in the response (search also has `incomplete_results`,
  14847. * /installation/repositories also has `repository_selection`), as well as a key with
  14848. * the list of the items which name varies from endpoint to endpoint:
  14849. *
  14850. * - https://developer.github.com/v3/search/#example (key `items`)
  14851. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  14852. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  14853. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  14854. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  14855. *
  14856. * Octokit normalizes these responses so that paginated results are always returned following
  14857. * the same structure. One challenge is that if the list response has only one page, no Link
  14858. * header is provided, so this header alone is not sufficient to check wether a response is
  14859. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  14860. * paths has to be added in order to normalize the response. We cannot check for the total_count
  14861. * property because it also exists in the response of Get the combined status for a specific ref.
  14862. */
  14863. 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))?([^/]|$)/];
  14864. function normalizePaginatedListResponse(octokit, url, response) {
  14865. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  14866. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  14867. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  14868. // to retrieve the same information.
  14869. const incompleteResults = response.data.incomplete_results;
  14870. const repositorySelection = response.data.repository_selection;
  14871. const totalCount = response.data.total_count;
  14872. delete response.data.incomplete_results;
  14873. delete response.data.repository_selection;
  14874. delete response.data.total_count;
  14875. const namespaceKey = Object.keys(response.data)[0];
  14876. const data = response.data[namespaceKey];
  14877. response.data = data;
  14878. if (typeof incompleteResults !== "undefined") {
  14879. response.data.incomplete_results = incompleteResults;
  14880. }
  14881. if (typeof repositorySelection !== "undefined") {
  14882. response.data.repository_selection = repositorySelection;
  14883. }
  14884. response.data.total_count = totalCount;
  14885. Object.defineProperty(response.data, namespaceKey, {
  14886. get() {
  14887. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  14888. return Array.from(data);
  14889. }
  14890. });
  14891. }
  14892. function iterator(octokit, route, parameters) {
  14893. const options = octokit.request.endpoint(route, parameters);
  14894. const method = options.method;
  14895. const headers = options.headers;
  14896. let url = options.url;
  14897. return {
  14898. [Symbol.asyncIterator]: () => ({
  14899. next() {
  14900. if (!url) {
  14901. return Promise.resolve({
  14902. done: true
  14903. });
  14904. }
  14905. return octokit.request({
  14906. method,
  14907. url,
  14908. headers
  14909. }).then(response => {
  14910. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  14911. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  14912. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  14913. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  14914. return {
  14915. value: response
  14916. };
  14917. });
  14918. }
  14919. })
  14920. };
  14921. }
  14922. function paginate(octokit, route, parameters, mapFn) {
  14923. if (typeof parameters === "function") {
  14924. mapFn = parameters;
  14925. parameters = undefined;
  14926. }
  14927. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  14928. }
  14929. function gather(octokit, results, iterator, mapFn) {
  14930. return iterator.next().then(result => {
  14931. if (result.done) {
  14932. return results;
  14933. }
  14934. let earlyExit = false;
  14935. function done() {
  14936. earlyExit = true;
  14937. }
  14938. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  14939. if (earlyExit) {
  14940. return results;
  14941. }
  14942. return gather(octokit, results, iterator, mapFn);
  14943. });
  14944. }
  14945. /**
  14946. * @param octokit Octokit instance
  14947. * @param options Options passed to Octokit constructor
  14948. */
  14949. function paginateRest(octokit) {
  14950. return {
  14951. paginate: Object.assign(paginate.bind(null, octokit), {
  14952. iterator: iterator.bind(null, octokit)
  14953. })
  14954. };
  14955. }
  14956. paginateRest.VERSION = VERSION;
  14957. exports.paginateRest = paginateRest;
  14958. //# sourceMappingURL=index.js.map
  14959. /***/ }),
  14960. /***/ 197:
  14961. /***/ (function(module) {
  14962. /**
  14963. * lodash (Custom Build) <https://lodash.com/>
  14964. * Build: `lodash modularize exports="npm" -o ./`
  14965. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  14966. * Released under MIT license <https://lodash.com/license>
  14967. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  14968. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  14969. */
  14970. /** Used as the `TypeError` message for "Functions" methods. */
  14971. var FUNC_ERROR_TEXT = 'Expected a function';
  14972. /** Used to stand-in for `undefined` hash values. */
  14973. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  14974. /** Used as references for various `Number` constants. */
  14975. var INFINITY = 1 / 0;
  14976. /** `Object#toString` result references. */
  14977. var funcTag = '[object Function]',
  14978. genTag = '[object GeneratorFunction]',
  14979. symbolTag = '[object Symbol]';
  14980. /** Used to match property names within property paths. */
  14981. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  14982. reIsPlainProp = /^\w*$/,
  14983. reLeadingDot = /^\./,
  14984. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  14985. /**
  14986. * Used to match `RegExp`
  14987. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  14988. */
  14989. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  14990. /** Used to match backslashes in property paths. */
  14991. var reEscapeChar = /\\(\\)?/g;
  14992. /** Used to detect host constructors (Safari). */
  14993. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  14994. /** Detect free variable `global` from Node.js. */
  14995. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  14996. /** Detect free variable `self`. */
  14997. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  14998. /** Used as a reference to the global object. */
  14999. var root = freeGlobal || freeSelf || Function('return this')();
  15000. /**
  15001. * Gets the value at `key` of `object`.
  15002. *
  15003. * @private
  15004. * @param {Object} [object] The object to query.
  15005. * @param {string} key The key of the property to get.
  15006. * @returns {*} Returns the property value.
  15007. */
  15008. function getValue(object, key) {
  15009. return object == null ? undefined : object[key];
  15010. }
  15011. /**
  15012. * Checks if `value` is a host object in IE < 9.
  15013. *
  15014. * @private
  15015. * @param {*} value The value to check.
  15016. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  15017. */
  15018. function isHostObject(value) {
  15019. // Many host objects are `Object` objects that can coerce to strings
  15020. // despite having improperly defined `toString` methods.
  15021. var result = false;
  15022. if (value != null && typeof value.toString != 'function') {
  15023. try {
  15024. result = !!(value + '');
  15025. } catch (e) {}
  15026. }
  15027. return result;
  15028. }
  15029. /** Used for built-in method references. */
  15030. var arrayProto = Array.prototype,
  15031. funcProto = Function.prototype,
  15032. objectProto = Object.prototype;
  15033. /** Used to detect overreaching core-js shims. */
  15034. var coreJsData = root['__core-js_shared__'];
  15035. /** Used to detect methods masquerading as native. */
  15036. var maskSrcKey = (function() {
  15037. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  15038. return uid ? ('Symbol(src)_1.' + uid) : '';
  15039. }());
  15040. /** Used to resolve the decompiled source of functions. */
  15041. var funcToString = funcProto.toString;
  15042. /** Used to check objects for own properties. */
  15043. var hasOwnProperty = objectProto.hasOwnProperty;
  15044. /**
  15045. * Used to resolve the
  15046. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  15047. * of values.
  15048. */
  15049. var objectToString = objectProto.toString;
  15050. /** Used to detect if a method is native. */
  15051. var reIsNative = RegExp('^' +
  15052. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  15053. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  15054. );
  15055. /** Built-in value references. */
  15056. var Symbol = root.Symbol,
  15057. splice = arrayProto.splice;
  15058. /* Built-in method references that are verified to be native. */
  15059. var Map = getNative(root, 'Map'),
  15060. nativeCreate = getNative(Object, 'create');
  15061. /** Used to convert symbols to primitives and strings. */
  15062. var symbolProto = Symbol ? Symbol.prototype : undefined,
  15063. symbolToString = symbolProto ? symbolProto.toString : undefined;
  15064. /**
  15065. * Creates a hash object.
  15066. *
  15067. * @private
  15068. * @constructor
  15069. * @param {Array} [entries] The key-value pairs to cache.
  15070. */
  15071. function Hash(entries) {
  15072. var index = -1,
  15073. length = entries ? entries.length : 0;
  15074. this.clear();
  15075. while (++index < length) {
  15076. var entry = entries[index];
  15077. this.set(entry[0], entry[1]);
  15078. }
  15079. }
  15080. /**
  15081. * Removes all key-value entries from the hash.
  15082. *
  15083. * @private
  15084. * @name clear
  15085. * @memberOf Hash
  15086. */
  15087. function hashClear() {
  15088. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  15089. }
  15090. /**
  15091. * Removes `key` and its value from the hash.
  15092. *
  15093. * @private
  15094. * @name delete
  15095. * @memberOf Hash
  15096. * @param {Object} hash The hash to modify.
  15097. * @param {string} key The key of the value to remove.
  15098. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  15099. */
  15100. function hashDelete(key) {
  15101. return this.has(key) && delete this.__data__[key];
  15102. }
  15103. /**
  15104. * Gets the hash value for `key`.
  15105. *
  15106. * @private
  15107. * @name get
  15108. * @memberOf Hash
  15109. * @param {string} key The key of the value to get.
  15110. * @returns {*} Returns the entry value.
  15111. */
  15112. function hashGet(key) {
  15113. var data = this.__data__;
  15114. if (nativeCreate) {
  15115. var result = data[key];
  15116. return result === HASH_UNDEFINED ? undefined : result;
  15117. }
  15118. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  15119. }
  15120. /**
  15121. * Checks if a hash value for `key` exists.
  15122. *
  15123. * @private
  15124. * @name has
  15125. * @memberOf Hash
  15126. * @param {string} key The key of the entry to check.
  15127. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  15128. */
  15129. function hashHas(key) {
  15130. var data = this.__data__;
  15131. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  15132. }
  15133. /**
  15134. * Sets the hash `key` to `value`.
  15135. *
  15136. * @private
  15137. * @name set
  15138. * @memberOf Hash
  15139. * @param {string} key The key of the value to set.
  15140. * @param {*} value The value to set.
  15141. * @returns {Object} Returns the hash instance.
  15142. */
  15143. function hashSet(key, value) {
  15144. var data = this.__data__;
  15145. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  15146. return this;
  15147. }
  15148. // Add methods to `Hash`.
  15149. Hash.prototype.clear = hashClear;
  15150. Hash.prototype['delete'] = hashDelete;
  15151. Hash.prototype.get = hashGet;
  15152. Hash.prototype.has = hashHas;
  15153. Hash.prototype.set = hashSet;
  15154. /**
  15155. * Creates an list cache object.
  15156. *
  15157. * @private
  15158. * @constructor
  15159. * @param {Array} [entries] The key-value pairs to cache.
  15160. */
  15161. function ListCache(entries) {
  15162. var index = -1,
  15163. length = entries ? entries.length : 0;
  15164. this.clear();
  15165. while (++index < length) {
  15166. var entry = entries[index];
  15167. this.set(entry[0], entry[1]);
  15168. }
  15169. }
  15170. /**
  15171. * Removes all key-value entries from the list cache.
  15172. *
  15173. * @private
  15174. * @name clear
  15175. * @memberOf ListCache
  15176. */
  15177. function listCacheClear() {
  15178. this.__data__ = [];
  15179. }
  15180. /**
  15181. * Removes `key` and its value from the list cache.
  15182. *
  15183. * @private
  15184. * @name delete
  15185. * @memberOf ListCache
  15186. * @param {string} key The key of the value to remove.
  15187. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  15188. */
  15189. function listCacheDelete(key) {
  15190. var data = this.__data__,
  15191. index = assocIndexOf(data, key);
  15192. if (index < 0) {
  15193. return false;
  15194. }
  15195. var lastIndex = data.length - 1;
  15196. if (index == lastIndex) {
  15197. data.pop();
  15198. } else {
  15199. splice.call(data, index, 1);
  15200. }
  15201. return true;
  15202. }
  15203. /**
  15204. * Gets the list cache value for `key`.
  15205. *
  15206. * @private
  15207. * @name get
  15208. * @memberOf ListCache
  15209. * @param {string} key The key of the value to get.
  15210. * @returns {*} Returns the entry value.
  15211. */
  15212. function listCacheGet(key) {
  15213. var data = this.__data__,
  15214. index = assocIndexOf(data, key);
  15215. return index < 0 ? undefined : data[index][1];
  15216. }
  15217. /**
  15218. * Checks if a list cache value for `key` exists.
  15219. *
  15220. * @private
  15221. * @name has
  15222. * @memberOf ListCache
  15223. * @param {string} key The key of the entry to check.
  15224. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  15225. */
  15226. function listCacheHas(key) {
  15227. return assocIndexOf(this.__data__, key) > -1;
  15228. }
  15229. /**
  15230. * Sets the list cache `key` to `value`.
  15231. *
  15232. * @private
  15233. * @name set
  15234. * @memberOf ListCache
  15235. * @param {string} key The key of the value to set.
  15236. * @param {*} value The value to set.
  15237. * @returns {Object} Returns the list cache instance.
  15238. */
  15239. function listCacheSet(key, value) {
  15240. var data = this.__data__,
  15241. index = assocIndexOf(data, key);
  15242. if (index < 0) {
  15243. data.push([key, value]);
  15244. } else {
  15245. data[index][1] = value;
  15246. }
  15247. return this;
  15248. }
  15249. // Add methods to `ListCache`.
  15250. ListCache.prototype.clear = listCacheClear;
  15251. ListCache.prototype['delete'] = listCacheDelete;
  15252. ListCache.prototype.get = listCacheGet;
  15253. ListCache.prototype.has = listCacheHas;
  15254. ListCache.prototype.set = listCacheSet;
  15255. /**
  15256. * Creates a map cache object to store key-value pairs.
  15257. *
  15258. * @private
  15259. * @constructor
  15260. * @param {Array} [entries] The key-value pairs to cache.
  15261. */
  15262. function MapCache(entries) {
  15263. var index = -1,
  15264. length = entries ? entries.length : 0;
  15265. this.clear();
  15266. while (++index < length) {
  15267. var entry = entries[index];
  15268. this.set(entry[0], entry[1]);
  15269. }
  15270. }
  15271. /**
  15272. * Removes all key-value entries from the map.
  15273. *
  15274. * @private
  15275. * @name clear
  15276. * @memberOf MapCache
  15277. */
  15278. function mapCacheClear() {
  15279. this.__data__ = {
  15280. 'hash': new Hash,
  15281. 'map': new (Map || ListCache),
  15282. 'string': new Hash
  15283. };
  15284. }
  15285. /**
  15286. * Removes `key` and its value from the map.
  15287. *
  15288. * @private
  15289. * @name delete
  15290. * @memberOf MapCache
  15291. * @param {string} key The key of the value to remove.
  15292. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  15293. */
  15294. function mapCacheDelete(key) {
  15295. return getMapData(this, key)['delete'](key);
  15296. }
  15297. /**
  15298. * Gets the map value for `key`.
  15299. *
  15300. * @private
  15301. * @name get
  15302. * @memberOf MapCache
  15303. * @param {string} key The key of the value to get.
  15304. * @returns {*} Returns the entry value.
  15305. */
  15306. function mapCacheGet(key) {
  15307. return getMapData(this, key).get(key);
  15308. }
  15309. /**
  15310. * Checks if a map value for `key` exists.
  15311. *
  15312. * @private
  15313. * @name has
  15314. * @memberOf MapCache
  15315. * @param {string} key The key of the entry to check.
  15316. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  15317. */
  15318. function mapCacheHas(key) {
  15319. return getMapData(this, key).has(key);
  15320. }
  15321. /**
  15322. * Sets the map `key` to `value`.
  15323. *
  15324. * @private
  15325. * @name set
  15326. * @memberOf MapCache
  15327. * @param {string} key The key of the value to set.
  15328. * @param {*} value The value to set.
  15329. * @returns {Object} Returns the map cache instance.
  15330. */
  15331. function mapCacheSet(key, value) {
  15332. getMapData(this, key).set(key, value);
  15333. return this;
  15334. }
  15335. // Add methods to `MapCache`.
  15336. MapCache.prototype.clear = mapCacheClear;
  15337. MapCache.prototype['delete'] = mapCacheDelete;
  15338. MapCache.prototype.get = mapCacheGet;
  15339. MapCache.prototype.has = mapCacheHas;
  15340. MapCache.prototype.set = mapCacheSet;
  15341. /**
  15342. * Gets the index at which the `key` is found in `array` of key-value pairs.
  15343. *
  15344. * @private
  15345. * @param {Array} array The array to inspect.
  15346. * @param {*} key The key to search for.
  15347. * @returns {number} Returns the index of the matched value, else `-1`.
  15348. */
  15349. function assocIndexOf(array, key) {
  15350. var length = array.length;
  15351. while (length--) {
  15352. if (eq(array[length][0], key)) {
  15353. return length;
  15354. }
  15355. }
  15356. return -1;
  15357. }
  15358. /**
  15359. * The base implementation of `_.get` without support for default values.
  15360. *
  15361. * @private
  15362. * @param {Object} object The object to query.
  15363. * @param {Array|string} path The path of the property to get.
  15364. * @returns {*} Returns the resolved value.
  15365. */
  15366. function baseGet(object, path) {
  15367. path = isKey(path, object) ? [path] : castPath(path);
  15368. var index = 0,
  15369. length = path.length;
  15370. while (object != null && index < length) {
  15371. object = object[toKey(path[index++])];
  15372. }
  15373. return (index && index == length) ? object : undefined;
  15374. }
  15375. /**
  15376. * The base implementation of `_.isNative` without bad shim checks.
  15377. *
  15378. * @private
  15379. * @param {*} value The value to check.
  15380. * @returns {boolean} Returns `true` if `value` is a native function,
  15381. * else `false`.
  15382. */
  15383. function baseIsNative(value) {
  15384. if (!isObject(value) || isMasked(value)) {
  15385. return false;
  15386. }
  15387. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  15388. return pattern.test(toSource(value));
  15389. }
  15390. /**
  15391. * The base implementation of `_.toString` which doesn't convert nullish
  15392. * values to empty strings.
  15393. *
  15394. * @private
  15395. * @param {*} value The value to process.
  15396. * @returns {string} Returns the string.
  15397. */
  15398. function baseToString(value) {
  15399. // Exit early for strings to avoid a performance hit in some environments.
  15400. if (typeof value == 'string') {
  15401. return value;
  15402. }
  15403. if (isSymbol(value)) {
  15404. return symbolToString ? symbolToString.call(value) : '';
  15405. }
  15406. var result = (value + '');
  15407. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  15408. }
  15409. /**
  15410. * Casts `value` to a path array if it's not one.
  15411. *
  15412. * @private
  15413. * @param {*} value The value to inspect.
  15414. * @returns {Array} Returns the cast property path array.
  15415. */
  15416. function castPath(value) {
  15417. return isArray(value) ? value : stringToPath(value);
  15418. }
  15419. /**
  15420. * Gets the data for `map`.
  15421. *
  15422. * @private
  15423. * @param {Object} map The map to query.
  15424. * @param {string} key The reference key.
  15425. * @returns {*} Returns the map data.
  15426. */
  15427. function getMapData(map, key) {
  15428. var data = map.__data__;
  15429. return isKeyable(key)
  15430. ? data[typeof key == 'string' ? 'string' : 'hash']
  15431. : data.map;
  15432. }
  15433. /**
  15434. * Gets the native function at `key` of `object`.
  15435. *
  15436. * @private
  15437. * @param {Object} object The object to query.
  15438. * @param {string} key The key of the method to get.
  15439. * @returns {*} Returns the function if it's native, else `undefined`.
  15440. */
  15441. function getNative(object, key) {
  15442. var value = getValue(object, key);
  15443. return baseIsNative(value) ? value : undefined;
  15444. }
  15445. /**
  15446. * Checks if `value` is a property name and not a property path.
  15447. *
  15448. * @private
  15449. * @param {*} value The value to check.
  15450. * @param {Object} [object] The object to query keys on.
  15451. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  15452. */
  15453. function isKey(value, object) {
  15454. if (isArray(value)) {
  15455. return false;
  15456. }
  15457. var type = typeof value;
  15458. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  15459. value == null || isSymbol(value)) {
  15460. return true;
  15461. }
  15462. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  15463. (object != null && value in Object(object));
  15464. }
  15465. /**
  15466. * Checks if `value` is suitable for use as unique object key.
  15467. *
  15468. * @private
  15469. * @param {*} value The value to check.
  15470. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  15471. */
  15472. function isKeyable(value) {
  15473. var type = typeof value;
  15474. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  15475. ? (value !== '__proto__')
  15476. : (value === null);
  15477. }
  15478. /**
  15479. * Checks if `func` has its source masked.
  15480. *
  15481. * @private
  15482. * @param {Function} func The function to check.
  15483. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  15484. */
  15485. function isMasked(func) {
  15486. return !!maskSrcKey && (maskSrcKey in func);
  15487. }
  15488. /**
  15489. * Converts `string` to a property path array.
  15490. *
  15491. * @private
  15492. * @param {string} string The string to convert.
  15493. * @returns {Array} Returns the property path array.
  15494. */
  15495. var stringToPath = memoize(function(string) {
  15496. string = toString(string);
  15497. var result = [];
  15498. if (reLeadingDot.test(string)) {
  15499. result.push('');
  15500. }
  15501. string.replace(rePropName, function(match, number, quote, string) {
  15502. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  15503. });
  15504. return result;
  15505. });
  15506. /**
  15507. * Converts `value` to a string key if it's not a string or symbol.
  15508. *
  15509. * @private
  15510. * @param {*} value The value to inspect.
  15511. * @returns {string|symbol} Returns the key.
  15512. */
  15513. function toKey(value) {
  15514. if (typeof value == 'string' || isSymbol(value)) {
  15515. return value;
  15516. }
  15517. var result = (value + '');
  15518. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  15519. }
  15520. /**
  15521. * Converts `func` to its source code.
  15522. *
  15523. * @private
  15524. * @param {Function} func The function to process.
  15525. * @returns {string} Returns the source code.
  15526. */
  15527. function toSource(func) {
  15528. if (func != null) {
  15529. try {
  15530. return funcToString.call(func);
  15531. } catch (e) {}
  15532. try {
  15533. return (func + '');
  15534. } catch (e) {}
  15535. }
  15536. return '';
  15537. }
  15538. /**
  15539. * Creates a function that memoizes the result of `func`. If `resolver` is
  15540. * provided, it determines the cache key for storing the result based on the
  15541. * arguments provided to the memoized function. By default, the first argument
  15542. * provided to the memoized function is used as the map cache key. The `func`
  15543. * is invoked with the `this` binding of the memoized function.
  15544. *
  15545. * **Note:** The cache is exposed as the `cache` property on the memoized
  15546. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  15547. * constructor with one whose instances implement the
  15548. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  15549. * method interface of `delete`, `get`, `has`, and `set`.
  15550. *
  15551. * @static
  15552. * @memberOf _
  15553. * @since 0.1.0
  15554. * @category Function
  15555. * @param {Function} func The function to have its output memoized.
  15556. * @param {Function} [resolver] The function to resolve the cache key.
  15557. * @returns {Function} Returns the new memoized function.
  15558. * @example
  15559. *
  15560. * var object = { 'a': 1, 'b': 2 };
  15561. * var other = { 'c': 3, 'd': 4 };
  15562. *
  15563. * var values = _.memoize(_.values);
  15564. * values(object);
  15565. * // => [1, 2]
  15566. *
  15567. * values(other);
  15568. * // => [3, 4]
  15569. *
  15570. * object.a = 2;
  15571. * values(object);
  15572. * // => [1, 2]
  15573. *
  15574. * // Modify the result cache.
  15575. * values.cache.set(object, ['a', 'b']);
  15576. * values(object);
  15577. * // => ['a', 'b']
  15578. *
  15579. * // Replace `_.memoize.Cache`.
  15580. * _.memoize.Cache = WeakMap;
  15581. */
  15582. function memoize(func, resolver) {
  15583. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  15584. throw new TypeError(FUNC_ERROR_TEXT);
  15585. }
  15586. var memoized = function() {
  15587. var args = arguments,
  15588. key = resolver ? resolver.apply(this, args) : args[0],
  15589. cache = memoized.cache;
  15590. if (cache.has(key)) {
  15591. return cache.get(key);
  15592. }
  15593. var result = func.apply(this, args);
  15594. memoized.cache = cache.set(key, result);
  15595. return result;
  15596. };
  15597. memoized.cache = new (memoize.Cache || MapCache);
  15598. return memoized;
  15599. }
  15600. // Assign cache to `_.memoize`.
  15601. memoize.Cache = MapCache;
  15602. /**
  15603. * Performs a
  15604. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  15605. * comparison between two values to determine if they are equivalent.
  15606. *
  15607. * @static
  15608. * @memberOf _
  15609. * @since 4.0.0
  15610. * @category Lang
  15611. * @param {*} value The value to compare.
  15612. * @param {*} other The other value to compare.
  15613. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  15614. * @example
  15615. *
  15616. * var object = { 'a': 1 };
  15617. * var other = { 'a': 1 };
  15618. *
  15619. * _.eq(object, object);
  15620. * // => true
  15621. *
  15622. * _.eq(object, other);
  15623. * // => false
  15624. *
  15625. * _.eq('a', 'a');
  15626. * // => true
  15627. *
  15628. * _.eq('a', Object('a'));
  15629. * // => false
  15630. *
  15631. * _.eq(NaN, NaN);
  15632. * // => true
  15633. */
  15634. function eq(value, other) {
  15635. return value === other || (value !== value && other !== other);
  15636. }
  15637. /**
  15638. * Checks if `value` is classified as an `Array` object.
  15639. *
  15640. * @static
  15641. * @memberOf _
  15642. * @since 0.1.0
  15643. * @category Lang
  15644. * @param {*} value The value to check.
  15645. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  15646. * @example
  15647. *
  15648. * _.isArray([1, 2, 3]);
  15649. * // => true
  15650. *
  15651. * _.isArray(document.body.children);
  15652. * // => false
  15653. *
  15654. * _.isArray('abc');
  15655. * // => false
  15656. *
  15657. * _.isArray(_.noop);
  15658. * // => false
  15659. */
  15660. var isArray = Array.isArray;
  15661. /**
  15662. * Checks if `value` is classified as a `Function` object.
  15663. *
  15664. * @static
  15665. * @memberOf _
  15666. * @since 0.1.0
  15667. * @category Lang
  15668. * @param {*} value The value to check.
  15669. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  15670. * @example
  15671. *
  15672. * _.isFunction(_);
  15673. * // => true
  15674. *
  15675. * _.isFunction(/abc/);
  15676. * // => false
  15677. */
  15678. function isFunction(value) {
  15679. // The use of `Object#toString` avoids issues with the `typeof` operator
  15680. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  15681. var tag = isObject(value) ? objectToString.call(value) : '';
  15682. return tag == funcTag || tag == genTag;
  15683. }
  15684. /**
  15685. * Checks if `value` is the
  15686. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  15687. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  15688. *
  15689. * @static
  15690. * @memberOf _
  15691. * @since 0.1.0
  15692. * @category Lang
  15693. * @param {*} value The value to check.
  15694. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  15695. * @example
  15696. *
  15697. * _.isObject({});
  15698. * // => true
  15699. *
  15700. * _.isObject([1, 2, 3]);
  15701. * // => true
  15702. *
  15703. * _.isObject(_.noop);
  15704. * // => true
  15705. *
  15706. * _.isObject(null);
  15707. * // => false
  15708. */
  15709. function isObject(value) {
  15710. var type = typeof value;
  15711. return !!value && (type == 'object' || type == 'function');
  15712. }
  15713. /**
  15714. * Checks if `value` is object-like. A value is object-like if it's not `null`
  15715. * and has a `typeof` result of "object".
  15716. *
  15717. * @static
  15718. * @memberOf _
  15719. * @since 4.0.0
  15720. * @category Lang
  15721. * @param {*} value The value to check.
  15722. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  15723. * @example
  15724. *
  15725. * _.isObjectLike({});
  15726. * // => true
  15727. *
  15728. * _.isObjectLike([1, 2, 3]);
  15729. * // => true
  15730. *
  15731. * _.isObjectLike(_.noop);
  15732. * // => false
  15733. *
  15734. * _.isObjectLike(null);
  15735. * // => false
  15736. */
  15737. function isObjectLike(value) {
  15738. return !!value && typeof value == 'object';
  15739. }
  15740. /**
  15741. * Checks if `value` is classified as a `Symbol` primitive or object.
  15742. *
  15743. * @static
  15744. * @memberOf _
  15745. * @since 4.0.0
  15746. * @category Lang
  15747. * @param {*} value The value to check.
  15748. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  15749. * @example
  15750. *
  15751. * _.isSymbol(Symbol.iterator);
  15752. * // => true
  15753. *
  15754. * _.isSymbol('abc');
  15755. * // => false
  15756. */
  15757. function isSymbol(value) {
  15758. return typeof value == 'symbol' ||
  15759. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  15760. }
  15761. /**
  15762. * Converts `value` to a string. An empty string is returned for `null`
  15763. * and `undefined` values. The sign of `-0` is preserved.
  15764. *
  15765. * @static
  15766. * @memberOf _
  15767. * @since 4.0.0
  15768. * @category Lang
  15769. * @param {*} value The value to process.
  15770. * @returns {string} Returns the string.
  15771. * @example
  15772. *
  15773. * _.toString(null);
  15774. * // => ''
  15775. *
  15776. * _.toString(-0);
  15777. * // => '-0'
  15778. *
  15779. * _.toString([1, 2, 3]);
  15780. * // => '1,2,3'
  15781. */
  15782. function toString(value) {
  15783. return value == null ? '' : baseToString(value);
  15784. }
  15785. /**
  15786. * Gets the value at `path` of `object`. If the resolved value is
  15787. * `undefined`, the `defaultValue` is returned in its place.
  15788. *
  15789. * @static
  15790. * @memberOf _
  15791. * @since 3.7.0
  15792. * @category Object
  15793. * @param {Object} object The object to query.
  15794. * @param {Array|string} path The path of the property to get.
  15795. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  15796. * @returns {*} Returns the resolved value.
  15797. * @example
  15798. *
  15799. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  15800. *
  15801. * _.get(object, 'a[0].b.c');
  15802. * // => 3
  15803. *
  15804. * _.get(object, ['a', '0', 'b', 'c']);
  15805. * // => 3
  15806. *
  15807. * _.get(object, 'a.b.c', 'default');
  15808. * // => 'default'
  15809. */
  15810. function get(object, path, defaultValue) {
  15811. var result = object == null ? undefined : baseGet(object, path);
  15812. return result === undefined ? defaultValue : result;
  15813. }
  15814. module.exports = get;
  15815. /***/ }),
  15816. /***/ 203:
  15817. /***/ (function(module, __unusedexports, __webpack_require__) {
  15818. module.exports = getLastPage
  15819. const getPage = __webpack_require__(604)
  15820. function getLastPage (octokit, link, headers) {
  15821. return getPage(octokit, link, 'last', headers)
  15822. }
  15823. /***/ }),
  15824. /***/ 205:
  15825. /***/ (function(module, __unusedexports, __webpack_require__) {
  15826. var once = __webpack_require__(223);
  15827. var noop = function() {};
  15828. var isRequest = function(stream) {
  15829. return stream.setHeader && typeof stream.abort === 'function';
  15830. };
  15831. var isChildProcess = function(stream) {
  15832. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  15833. };
  15834. var eos = function(stream, opts, callback) {
  15835. if (typeof opts === 'function') return eos(stream, null, opts);
  15836. if (!opts) opts = {};
  15837. callback = once(callback || noop);
  15838. var ws = stream._writableState;
  15839. var rs = stream._readableState;
  15840. var readable = opts.readable || (opts.readable !== false && stream.readable);
  15841. var writable = opts.writable || (opts.writable !== false && stream.writable);
  15842. var cancelled = false;
  15843. var onlegacyfinish = function() {
  15844. if (!stream.writable) onfinish();
  15845. };
  15846. var onfinish = function() {
  15847. writable = false;
  15848. if (!readable) callback.call(stream);
  15849. };
  15850. var onend = function() {
  15851. readable = false;
  15852. if (!writable) callback.call(stream);
  15853. };
  15854. var onexit = function(exitCode) {
  15855. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  15856. };
  15857. var onerror = function(err) {
  15858. callback.call(stream, err);
  15859. };
  15860. var onclose = function() {
  15861. process.nextTick(onclosenexttick);
  15862. };
  15863. var onclosenexttick = function() {
  15864. if (cancelled) return;
  15865. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  15866. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  15867. };
  15868. var onrequest = function() {
  15869. stream.req.on('finish', onfinish);
  15870. };
  15871. if (isRequest(stream)) {
  15872. stream.on('complete', onfinish);
  15873. stream.on('abort', onclose);
  15874. if (stream.req) onrequest();
  15875. else stream.on('request', onrequest);
  15876. } else if (writable && !ws) { // legacy streams
  15877. stream.on('end', onlegacyfinish);
  15878. stream.on('close', onlegacyfinish);
  15879. }
  15880. if (isChildProcess(stream)) stream.on('exit', onexit);
  15881. stream.on('end', onend);
  15882. stream.on('finish', onfinish);
  15883. if (opts.error !== false) stream.on('error', onerror);
  15884. stream.on('close', onclose);
  15885. return function() {
  15886. cancelled = true;
  15887. stream.removeListener('complete', onfinish);
  15888. stream.removeListener('abort', onclose);
  15889. stream.removeListener('request', onrequest);
  15890. if (stream.req) stream.req.removeListener('finish', onfinish);
  15891. stream.removeListener('end', onlegacyfinish);
  15892. stream.removeListener('close', onlegacyfinish);
  15893. stream.removeListener('finish', onfinish);
  15894. stream.removeListener('exit', onexit);
  15895. stream.removeListener('end', onend);
  15896. stream.removeListener('error', onerror);
  15897. stream.removeListener('close', onclose);
  15898. };
  15899. };
  15900. module.exports = eos;
  15901. /***/ }),
  15902. /***/ 207:
  15903. /***/ (function(module, __unusedexports, __webpack_require__) {
  15904. module.exports = which
  15905. which.sync = whichSync
  15906. var isWindows = process.platform === 'win32' ||
  15907. process.env.OSTYPE === 'cygwin' ||
  15908. process.env.OSTYPE === 'msys'
  15909. var path = __webpack_require__(622)
  15910. var COLON = isWindows ? ';' : ':'
  15911. var isexe = __webpack_require__(126)
  15912. function getNotFoundError (cmd) {
  15913. var er = new Error('not found: ' + cmd)
  15914. er.code = 'ENOENT'
  15915. return er
  15916. }
  15917. function getPathInfo (cmd, opt) {
  15918. var colon = opt.colon || COLON
  15919. var pathEnv = opt.path || process.env.PATH || ''
  15920. var pathExt = ['']
  15921. pathEnv = pathEnv.split(colon)
  15922. var pathExtExe = ''
  15923. if (isWindows) {
  15924. pathEnv.unshift(process.cwd())
  15925. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  15926. pathExt = pathExtExe.split(colon)
  15927. // Always test the cmd itself first. isexe will check to make sure
  15928. // it's found in the pathExt set.
  15929. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  15930. pathExt.unshift('')
  15931. }
  15932. // If it has a slash, then we don't bother searching the pathenv.
  15933. // just check the file itself, and that's it.
  15934. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  15935. pathEnv = ['']
  15936. return {
  15937. env: pathEnv,
  15938. ext: pathExt,
  15939. extExe: pathExtExe
  15940. }
  15941. }
  15942. function which (cmd, opt, cb) {
  15943. if (typeof opt === 'function') {
  15944. cb = opt
  15945. opt = {}
  15946. }
  15947. var info = getPathInfo(cmd, opt)
  15948. var pathEnv = info.env
  15949. var pathExt = info.ext
  15950. var pathExtExe = info.extExe
  15951. var found = []
  15952. ;(function F (i, l) {
  15953. if (i === l) {
  15954. if (opt.all && found.length)
  15955. return cb(null, found)
  15956. else
  15957. return cb(getNotFoundError(cmd))
  15958. }
  15959. var pathPart = pathEnv[i]
  15960. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  15961. pathPart = pathPart.slice(1, -1)
  15962. var p = path.join(pathPart, cmd)
  15963. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  15964. p = cmd.slice(0, 2) + p
  15965. }
  15966. ;(function E (ii, ll) {
  15967. if (ii === ll) return F(i + 1, l)
  15968. var ext = pathExt[ii]
  15969. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  15970. if (!er && is) {
  15971. if (opt.all)
  15972. found.push(p + ext)
  15973. else
  15974. return cb(null, p + ext)
  15975. }
  15976. return E(ii + 1, ll)
  15977. })
  15978. })(0, pathExt.length)
  15979. })(0, pathEnv.length)
  15980. }
  15981. function whichSync (cmd, opt) {
  15982. opt = opt || {}
  15983. var info = getPathInfo(cmd, opt)
  15984. var pathEnv = info.env
  15985. var pathExt = info.ext
  15986. var pathExtExe = info.extExe
  15987. var found = []
  15988. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  15989. var pathPart = pathEnv[i]
  15990. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  15991. pathPart = pathPart.slice(1, -1)
  15992. var p = path.join(pathPart, cmd)
  15993. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  15994. p = cmd.slice(0, 2) + p
  15995. }
  15996. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  15997. var cur = p + pathExt[j]
  15998. var is
  15999. try {
  16000. is = isexe.sync(cur, { pathExt: pathExtExe })
  16001. if (is) {
  16002. if (opt.all)
  16003. found.push(cur)
  16004. else
  16005. return cur
  16006. }
  16007. } catch (ex) {}
  16008. }
  16009. }
  16010. if (opt.all && found.length)
  16011. return found
  16012. if (opt.nothrow)
  16013. return null
  16014. throw getNotFoundError(cmd)
  16015. }
  16016. /***/ }),
  16017. /***/ 210:
  16018. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  16019. "use strict";
  16020. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  16021. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  16022. return new (P || (P = Promise))(function (resolve, reject) {
  16023. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16024. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16025. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  16026. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16027. });
  16028. };
  16029. var __importStar = (this && this.__importStar) || function (mod) {
  16030. if (mod && mod.__esModule) return mod;
  16031. var result = {};
  16032. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16033. result["default"] = mod;
  16034. return result;
  16035. };
  16036. Object.defineProperty(exports, "__esModule", { value: true });
  16037. const core = __importStar(__webpack_require__(186));
  16038. const fsHelper = __importStar(__webpack_require__(219));
  16039. const gitAuthHelper = __importStar(__webpack_require__(565));
  16040. const gitCommandManager = __importStar(__webpack_require__(738));
  16041. const gitDirectoryHelper = __importStar(__webpack_require__(609));
  16042. const githubApiHelper = __importStar(__webpack_require__(138));
  16043. const io = __importStar(__webpack_require__(436));
  16044. const path = __importStar(__webpack_require__(622));
  16045. const refHelper = __importStar(__webpack_require__(601));
  16046. const stateHelper = __importStar(__webpack_require__(647));
  16047. const urlHelper = __importStar(__webpack_require__(437));
  16048. function getSource(settings) {
  16049. return __awaiter(this, void 0, void 0, function* () {
  16050. // Repository URL
  16051. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  16052. const repositoryUrl = urlHelper.getFetchUrl(settings);
  16053. // Remove conflicting file path
  16054. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  16055. yield io.rmRF(settings.repositoryPath);
  16056. }
  16057. // Create directory
  16058. let isExisting = true;
  16059. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  16060. isExisting = false;
  16061. yield io.mkdirP(settings.repositoryPath);
  16062. }
  16063. // Git command manager
  16064. core.startGroup('Getting Git version info');
  16065. const git = yield getGitCommandManager(settings);
  16066. core.endGroup();
  16067. // Prepare existing directory, otherwise recreate
  16068. if (isExisting) {
  16069. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  16070. }
  16071. if (!git) {
  16072. // Downloading using REST API
  16073. core.info(`The repository will be downloaded using the GitHub REST API`);
  16074. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  16075. if (settings.submodules) {
  16076. 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.`);
  16077. }
  16078. else if (settings.sshKey) {
  16079. 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.`);
  16080. }
  16081. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  16082. return;
  16083. }
  16084. // Save state for POST action
  16085. stateHelper.setRepositoryPath(settings.repositoryPath);
  16086. // Initialize the repository
  16087. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  16088. core.startGroup('Initializing the repository');
  16089. yield git.init();
  16090. yield git.remoteAdd('origin', repositoryUrl);
  16091. core.endGroup();
  16092. }
  16093. // Disable automatic garbage collection
  16094. core.startGroup('Disabling automatic garbage collection');
  16095. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  16096. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  16097. }
  16098. core.endGroup();
  16099. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  16100. try {
  16101. // Configure auth
  16102. core.startGroup('Setting up auth');
  16103. yield authHelper.configureAuth();
  16104. core.endGroup();
  16105. // Determine the default branch
  16106. if (!settings.ref && !settings.commit) {
  16107. core.startGroup('Determining the default branch');
  16108. if (settings.sshKey) {
  16109. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  16110. }
  16111. else {
  16112. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  16113. }
  16114. core.endGroup();
  16115. }
  16116. // LFS install
  16117. if (settings.lfs) {
  16118. yield git.lfsInstall();
  16119. }
  16120. // Fetch
  16121. core.startGroup('Fetching the repository');
  16122. if (settings.fetchDepth <= 0) {
  16123. // Fetch all branches and tags
  16124. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  16125. yield git.fetch(refSpec);
  16126. // When all history is fetched, the ref we're interested in may have moved to a different
  16127. // commit (push or force push). If so, fetch again with a targeted refspec.
  16128. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  16129. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  16130. yield git.fetch(refSpec);
  16131. }
  16132. }
  16133. else {
  16134. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  16135. yield git.fetch(refSpec, settings.fetchDepth);
  16136. }
  16137. core.endGroup();
  16138. // Checkout info
  16139. core.startGroup('Determining the checkout info');
  16140. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  16141. core.endGroup();
  16142. // LFS fetch
  16143. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  16144. // Explicit lfs fetch will fetch lfs objects in parallel.
  16145. if (settings.lfs) {
  16146. core.startGroup('Fetching LFS objects');
  16147. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  16148. core.endGroup();
  16149. }
  16150. // Checkout
  16151. core.startGroup('Checking out the ref');
  16152. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  16153. core.endGroup();
  16154. // Submodules
  16155. if (settings.submodules) {
  16156. try {
  16157. // Temporarily override global config
  16158. core.startGroup('Setting up auth for fetching submodules');
  16159. yield authHelper.configureGlobalAuth();
  16160. core.endGroup();
  16161. // Checkout submodules
  16162. core.startGroup('Fetching submodules');
  16163. yield git.submoduleSync(settings.nestedSubmodules);
  16164. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  16165. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  16166. core.endGroup();
  16167. // Persist credentials
  16168. if (settings.persistCredentials) {
  16169. core.startGroup('Persisting credentials for submodules');
  16170. yield authHelper.configureSubmoduleAuth();
  16171. core.endGroup();
  16172. }
  16173. }
  16174. finally {
  16175. // Remove temporary global config override
  16176. yield authHelper.removeGlobalAuth();
  16177. }
  16178. }
  16179. // Dump some info about the checked out commit
  16180. const commitInfo = yield git.log1();
  16181. // Check for incorrect pull request merge commit
  16182. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  16183. }
  16184. finally {
  16185. // Remove auth
  16186. if (!settings.persistCredentials) {
  16187. core.startGroup('Removing auth');
  16188. yield authHelper.removeAuth();
  16189. core.endGroup();
  16190. }
  16191. }
  16192. });
  16193. }
  16194. exports.getSource = getSource;
  16195. function cleanup(repositoryPath) {
  16196. return __awaiter(this, void 0, void 0, function* () {
  16197. // Repo exists?
  16198. if (!repositoryPath ||
  16199. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  16200. return;
  16201. }
  16202. let git;
  16203. try {
  16204. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  16205. }
  16206. catch (_a) {
  16207. return;
  16208. }
  16209. // Remove auth
  16210. const authHelper = gitAuthHelper.createAuthHelper(git);
  16211. yield authHelper.removeAuth();
  16212. });
  16213. }
  16214. exports.cleanup = cleanup;
  16215. function getGitCommandManager(settings) {
  16216. return __awaiter(this, void 0, void 0, function* () {
  16217. core.info(`Working directory is '${settings.repositoryPath}'`);
  16218. try {
  16219. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  16220. }
  16221. catch (err) {
  16222. // Git is required for LFS
  16223. if (settings.lfs) {
  16224. throw err;
  16225. }
  16226. // Otherwise fallback to REST API
  16227. return undefined;
  16228. }
  16229. });
  16230. }
  16231. /***/ }),
  16232. /***/ 211:
  16233. /***/ (function(module) {
  16234. module.exports = require("https");
  16235. /***/ }),
  16236. /***/ 216:
  16237. /***/ (function(module) {
  16238. /**
  16239. * lodash (Custom Build) <https://lodash.com/>
  16240. * Build: `lodash modularize exports="npm" -o ./`
  16241. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  16242. * Released under MIT license <https://lodash.com/license>
  16243. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  16244. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  16245. */
  16246. /** Used as the size to enable large array optimizations. */
  16247. var LARGE_ARRAY_SIZE = 200;
  16248. /** Used to stand-in for `undefined` hash values. */
  16249. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  16250. /** Used as references for various `Number` constants. */
  16251. var INFINITY = 1 / 0;
  16252. /** `Object#toString` result references. */
  16253. var funcTag = '[object Function]',
  16254. genTag = '[object GeneratorFunction]';
  16255. /**
  16256. * Used to match `RegExp`
  16257. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  16258. */
  16259. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  16260. /** Used to detect host constructors (Safari). */
  16261. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  16262. /** Detect free variable `global` from Node.js. */
  16263. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  16264. /** Detect free variable `self`. */
  16265. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  16266. /** Used as a reference to the global object. */
  16267. var root = freeGlobal || freeSelf || Function('return this')();
  16268. /**
  16269. * A specialized version of `_.includes` for arrays without support for
  16270. * specifying an index to search from.
  16271. *
  16272. * @private
  16273. * @param {Array} [array] The array to inspect.
  16274. * @param {*} target The value to search for.
  16275. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  16276. */
  16277. function arrayIncludes(array, value) {
  16278. var length = array ? array.length : 0;
  16279. return !!length && baseIndexOf(array, value, 0) > -1;
  16280. }
  16281. /**
  16282. * This function is like `arrayIncludes` except that it accepts a comparator.
  16283. *
  16284. * @private
  16285. * @param {Array} [array] The array to inspect.
  16286. * @param {*} target The value to search for.
  16287. * @param {Function} comparator The comparator invoked per element.
  16288. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  16289. */
  16290. function arrayIncludesWith(array, value, comparator) {
  16291. var index = -1,
  16292. length = array ? array.length : 0;
  16293. while (++index < length) {
  16294. if (comparator(value, array[index])) {
  16295. return true;
  16296. }
  16297. }
  16298. return false;
  16299. }
  16300. /**
  16301. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  16302. * support for iteratee shorthands.
  16303. *
  16304. * @private
  16305. * @param {Array} array The array to inspect.
  16306. * @param {Function} predicate The function invoked per iteration.
  16307. * @param {number} fromIndex The index to search from.
  16308. * @param {boolean} [fromRight] Specify iterating from right to left.
  16309. * @returns {number} Returns the index of the matched value, else `-1`.
  16310. */
  16311. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  16312. var length = array.length,
  16313. index = fromIndex + (fromRight ? 1 : -1);
  16314. while ((fromRight ? index-- : ++index < length)) {
  16315. if (predicate(array[index], index, array)) {
  16316. return index;
  16317. }
  16318. }
  16319. return -1;
  16320. }
  16321. /**
  16322. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  16323. *
  16324. * @private
  16325. * @param {Array} array The array to inspect.
  16326. * @param {*} value The value to search for.
  16327. * @param {number} fromIndex The index to search from.
  16328. * @returns {number} Returns the index of the matched value, else `-1`.
  16329. */
  16330. function baseIndexOf(array, value, fromIndex) {
  16331. if (value !== value) {
  16332. return baseFindIndex(array, baseIsNaN, fromIndex);
  16333. }
  16334. var index = fromIndex - 1,
  16335. length = array.length;
  16336. while (++index < length) {
  16337. if (array[index] === value) {
  16338. return index;
  16339. }
  16340. }
  16341. return -1;
  16342. }
  16343. /**
  16344. * The base implementation of `_.isNaN` without support for number objects.
  16345. *
  16346. * @private
  16347. * @param {*} value The value to check.
  16348. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  16349. */
  16350. function baseIsNaN(value) {
  16351. return value !== value;
  16352. }
  16353. /**
  16354. * Checks if a cache value for `key` exists.
  16355. *
  16356. * @private
  16357. * @param {Object} cache The cache to query.
  16358. * @param {string} key The key of the entry to check.
  16359. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  16360. */
  16361. function cacheHas(cache, key) {
  16362. return cache.has(key);
  16363. }
  16364. /**
  16365. * Gets the value at `key` of `object`.
  16366. *
  16367. * @private
  16368. * @param {Object} [object] The object to query.
  16369. * @param {string} key The key of the property to get.
  16370. * @returns {*} Returns the property value.
  16371. */
  16372. function getValue(object, key) {
  16373. return object == null ? undefined : object[key];
  16374. }
  16375. /**
  16376. * Checks if `value` is a host object in IE < 9.
  16377. *
  16378. * @private
  16379. * @param {*} value The value to check.
  16380. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  16381. */
  16382. function isHostObject(value) {
  16383. // Many host objects are `Object` objects that can coerce to strings
  16384. // despite having improperly defined `toString` methods.
  16385. var result = false;
  16386. if (value != null && typeof value.toString != 'function') {
  16387. try {
  16388. result = !!(value + '');
  16389. } catch (e) {}
  16390. }
  16391. return result;
  16392. }
  16393. /**
  16394. * Converts `set` to an array of its values.
  16395. *
  16396. * @private
  16397. * @param {Object} set The set to convert.
  16398. * @returns {Array} Returns the values.
  16399. */
  16400. function setToArray(set) {
  16401. var index = -1,
  16402. result = Array(set.size);
  16403. set.forEach(function(value) {
  16404. result[++index] = value;
  16405. });
  16406. return result;
  16407. }
  16408. /** Used for built-in method references. */
  16409. var arrayProto = Array.prototype,
  16410. funcProto = Function.prototype,
  16411. objectProto = Object.prototype;
  16412. /** Used to detect overreaching core-js shims. */
  16413. var coreJsData = root['__core-js_shared__'];
  16414. /** Used to detect methods masquerading as native. */
  16415. var maskSrcKey = (function() {
  16416. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  16417. return uid ? ('Symbol(src)_1.' + uid) : '';
  16418. }());
  16419. /** Used to resolve the decompiled source of functions. */
  16420. var funcToString = funcProto.toString;
  16421. /** Used to check objects for own properties. */
  16422. var hasOwnProperty = objectProto.hasOwnProperty;
  16423. /**
  16424. * Used to resolve the
  16425. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  16426. * of values.
  16427. */
  16428. var objectToString = objectProto.toString;
  16429. /** Used to detect if a method is native. */
  16430. var reIsNative = RegExp('^' +
  16431. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  16432. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  16433. );
  16434. /** Built-in value references. */
  16435. var splice = arrayProto.splice;
  16436. /* Built-in method references that are verified to be native. */
  16437. var Map = getNative(root, 'Map'),
  16438. Set = getNative(root, 'Set'),
  16439. nativeCreate = getNative(Object, 'create');
  16440. /**
  16441. * Creates a hash object.
  16442. *
  16443. * @private
  16444. * @constructor
  16445. * @param {Array} [entries] The key-value pairs to cache.
  16446. */
  16447. function Hash(entries) {
  16448. var index = -1,
  16449. length = entries ? entries.length : 0;
  16450. this.clear();
  16451. while (++index < length) {
  16452. var entry = entries[index];
  16453. this.set(entry[0], entry[1]);
  16454. }
  16455. }
  16456. /**
  16457. * Removes all key-value entries from the hash.
  16458. *
  16459. * @private
  16460. * @name clear
  16461. * @memberOf Hash
  16462. */
  16463. function hashClear() {
  16464. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  16465. }
  16466. /**
  16467. * Removes `key` and its value from the hash.
  16468. *
  16469. * @private
  16470. * @name delete
  16471. * @memberOf Hash
  16472. * @param {Object} hash The hash to modify.
  16473. * @param {string} key The key of the value to remove.
  16474. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  16475. */
  16476. function hashDelete(key) {
  16477. return this.has(key) && delete this.__data__[key];
  16478. }
  16479. /**
  16480. * Gets the hash value for `key`.
  16481. *
  16482. * @private
  16483. * @name get
  16484. * @memberOf Hash
  16485. * @param {string} key The key of the value to get.
  16486. * @returns {*} Returns the entry value.
  16487. */
  16488. function hashGet(key) {
  16489. var data = this.__data__;
  16490. if (nativeCreate) {
  16491. var result = data[key];
  16492. return result === HASH_UNDEFINED ? undefined : result;
  16493. }
  16494. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  16495. }
  16496. /**
  16497. * Checks if a hash value for `key` exists.
  16498. *
  16499. * @private
  16500. * @name has
  16501. * @memberOf Hash
  16502. * @param {string} key The key of the entry to check.
  16503. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  16504. */
  16505. function hashHas(key) {
  16506. var data = this.__data__;
  16507. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  16508. }
  16509. /**
  16510. * Sets the hash `key` to `value`.
  16511. *
  16512. * @private
  16513. * @name set
  16514. * @memberOf Hash
  16515. * @param {string} key The key of the value to set.
  16516. * @param {*} value The value to set.
  16517. * @returns {Object} Returns the hash instance.
  16518. */
  16519. function hashSet(key, value) {
  16520. var data = this.__data__;
  16521. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  16522. return this;
  16523. }
  16524. // Add methods to `Hash`.
  16525. Hash.prototype.clear = hashClear;
  16526. Hash.prototype['delete'] = hashDelete;
  16527. Hash.prototype.get = hashGet;
  16528. Hash.prototype.has = hashHas;
  16529. Hash.prototype.set = hashSet;
  16530. /**
  16531. * Creates an list cache object.
  16532. *
  16533. * @private
  16534. * @constructor
  16535. * @param {Array} [entries] The key-value pairs to cache.
  16536. */
  16537. function ListCache(entries) {
  16538. var index = -1,
  16539. length = entries ? entries.length : 0;
  16540. this.clear();
  16541. while (++index < length) {
  16542. var entry = entries[index];
  16543. this.set(entry[0], entry[1]);
  16544. }
  16545. }
  16546. /**
  16547. * Removes all key-value entries from the list cache.
  16548. *
  16549. * @private
  16550. * @name clear
  16551. * @memberOf ListCache
  16552. */
  16553. function listCacheClear() {
  16554. this.__data__ = [];
  16555. }
  16556. /**
  16557. * Removes `key` and its value from the list cache.
  16558. *
  16559. * @private
  16560. * @name delete
  16561. * @memberOf ListCache
  16562. * @param {string} key The key of the value to remove.
  16563. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  16564. */
  16565. function listCacheDelete(key) {
  16566. var data = this.__data__,
  16567. index = assocIndexOf(data, key);
  16568. if (index < 0) {
  16569. return false;
  16570. }
  16571. var lastIndex = data.length - 1;
  16572. if (index == lastIndex) {
  16573. data.pop();
  16574. } else {
  16575. splice.call(data, index, 1);
  16576. }
  16577. return true;
  16578. }
  16579. /**
  16580. * Gets the list cache value for `key`.
  16581. *
  16582. * @private
  16583. * @name get
  16584. * @memberOf ListCache
  16585. * @param {string} key The key of the value to get.
  16586. * @returns {*} Returns the entry value.
  16587. */
  16588. function listCacheGet(key) {
  16589. var data = this.__data__,
  16590. index = assocIndexOf(data, key);
  16591. return index < 0 ? undefined : data[index][1];
  16592. }
  16593. /**
  16594. * Checks if a list cache value for `key` exists.
  16595. *
  16596. * @private
  16597. * @name has
  16598. * @memberOf ListCache
  16599. * @param {string} key The key of the entry to check.
  16600. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  16601. */
  16602. function listCacheHas(key) {
  16603. return assocIndexOf(this.__data__, key) > -1;
  16604. }
  16605. /**
  16606. * Sets the list cache `key` to `value`.
  16607. *
  16608. * @private
  16609. * @name set
  16610. * @memberOf ListCache
  16611. * @param {string} key The key of the value to set.
  16612. * @param {*} value The value to set.
  16613. * @returns {Object} Returns the list cache instance.
  16614. */
  16615. function listCacheSet(key, value) {
  16616. var data = this.__data__,
  16617. index = assocIndexOf(data, key);
  16618. if (index < 0) {
  16619. data.push([key, value]);
  16620. } else {
  16621. data[index][1] = value;
  16622. }
  16623. return this;
  16624. }
  16625. // Add methods to `ListCache`.
  16626. ListCache.prototype.clear = listCacheClear;
  16627. ListCache.prototype['delete'] = listCacheDelete;
  16628. ListCache.prototype.get = listCacheGet;
  16629. ListCache.prototype.has = listCacheHas;
  16630. ListCache.prototype.set = listCacheSet;
  16631. /**
  16632. * Creates a map cache object to store key-value pairs.
  16633. *
  16634. * @private
  16635. * @constructor
  16636. * @param {Array} [entries] The key-value pairs to cache.
  16637. */
  16638. function MapCache(entries) {
  16639. var index = -1,
  16640. length = entries ? entries.length : 0;
  16641. this.clear();
  16642. while (++index < length) {
  16643. var entry = entries[index];
  16644. this.set(entry[0], entry[1]);
  16645. }
  16646. }
  16647. /**
  16648. * Removes all key-value entries from the map.
  16649. *
  16650. * @private
  16651. * @name clear
  16652. * @memberOf MapCache
  16653. */
  16654. function mapCacheClear() {
  16655. this.__data__ = {
  16656. 'hash': new Hash,
  16657. 'map': new (Map || ListCache),
  16658. 'string': new Hash
  16659. };
  16660. }
  16661. /**
  16662. * Removes `key` and its value from the map.
  16663. *
  16664. * @private
  16665. * @name delete
  16666. * @memberOf MapCache
  16667. * @param {string} key The key of the value to remove.
  16668. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  16669. */
  16670. function mapCacheDelete(key) {
  16671. return getMapData(this, key)['delete'](key);
  16672. }
  16673. /**
  16674. * Gets the map value for `key`.
  16675. *
  16676. * @private
  16677. * @name get
  16678. * @memberOf MapCache
  16679. * @param {string} key The key of the value to get.
  16680. * @returns {*} Returns the entry value.
  16681. */
  16682. function mapCacheGet(key) {
  16683. return getMapData(this, key).get(key);
  16684. }
  16685. /**
  16686. * Checks if a map value for `key` exists.
  16687. *
  16688. * @private
  16689. * @name has
  16690. * @memberOf MapCache
  16691. * @param {string} key The key of the entry to check.
  16692. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  16693. */
  16694. function mapCacheHas(key) {
  16695. return getMapData(this, key).has(key);
  16696. }
  16697. /**
  16698. * Sets the map `key` to `value`.
  16699. *
  16700. * @private
  16701. * @name set
  16702. * @memberOf MapCache
  16703. * @param {string} key The key of the value to set.
  16704. * @param {*} value The value to set.
  16705. * @returns {Object} Returns the map cache instance.
  16706. */
  16707. function mapCacheSet(key, value) {
  16708. getMapData(this, key).set(key, value);
  16709. return this;
  16710. }
  16711. // Add methods to `MapCache`.
  16712. MapCache.prototype.clear = mapCacheClear;
  16713. MapCache.prototype['delete'] = mapCacheDelete;
  16714. MapCache.prototype.get = mapCacheGet;
  16715. MapCache.prototype.has = mapCacheHas;
  16716. MapCache.prototype.set = mapCacheSet;
  16717. /**
  16718. *
  16719. * Creates an array cache object to store unique values.
  16720. *
  16721. * @private
  16722. * @constructor
  16723. * @param {Array} [values] The values to cache.
  16724. */
  16725. function SetCache(values) {
  16726. var index = -1,
  16727. length = values ? values.length : 0;
  16728. this.__data__ = new MapCache;
  16729. while (++index < length) {
  16730. this.add(values[index]);
  16731. }
  16732. }
  16733. /**
  16734. * Adds `value` to the array cache.
  16735. *
  16736. * @private
  16737. * @name add
  16738. * @memberOf SetCache
  16739. * @alias push
  16740. * @param {*} value The value to cache.
  16741. * @returns {Object} Returns the cache instance.
  16742. */
  16743. function setCacheAdd(value) {
  16744. this.__data__.set(value, HASH_UNDEFINED);
  16745. return this;
  16746. }
  16747. /**
  16748. * Checks if `value` is in the array cache.
  16749. *
  16750. * @private
  16751. * @name has
  16752. * @memberOf SetCache
  16753. * @param {*} value The value to search for.
  16754. * @returns {number} Returns `true` if `value` is found, else `false`.
  16755. */
  16756. function setCacheHas(value) {
  16757. return this.__data__.has(value);
  16758. }
  16759. // Add methods to `SetCache`.
  16760. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  16761. SetCache.prototype.has = setCacheHas;
  16762. /**
  16763. * Gets the index at which the `key` is found in `array` of key-value pairs.
  16764. *
  16765. * @private
  16766. * @param {Array} array The array to inspect.
  16767. * @param {*} key The key to search for.
  16768. * @returns {number} Returns the index of the matched value, else `-1`.
  16769. */
  16770. function assocIndexOf(array, key) {
  16771. var length = array.length;
  16772. while (length--) {
  16773. if (eq(array[length][0], key)) {
  16774. return length;
  16775. }
  16776. }
  16777. return -1;
  16778. }
  16779. /**
  16780. * The base implementation of `_.isNative` without bad shim checks.
  16781. *
  16782. * @private
  16783. * @param {*} value The value to check.
  16784. * @returns {boolean} Returns `true` if `value` is a native function,
  16785. * else `false`.
  16786. */
  16787. function baseIsNative(value) {
  16788. if (!isObject(value) || isMasked(value)) {
  16789. return false;
  16790. }
  16791. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  16792. return pattern.test(toSource(value));
  16793. }
  16794. /**
  16795. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  16796. *
  16797. * @private
  16798. * @param {Array} array The array to inspect.
  16799. * @param {Function} [iteratee] The iteratee invoked per element.
  16800. * @param {Function} [comparator] The comparator invoked per element.
  16801. * @returns {Array} Returns the new duplicate free array.
  16802. */
  16803. function baseUniq(array, iteratee, comparator) {
  16804. var index = -1,
  16805. includes = arrayIncludes,
  16806. length = array.length,
  16807. isCommon = true,
  16808. result = [],
  16809. seen = result;
  16810. if (comparator) {
  16811. isCommon = false;
  16812. includes = arrayIncludesWith;
  16813. }
  16814. else if (length >= LARGE_ARRAY_SIZE) {
  16815. var set = iteratee ? null : createSet(array);
  16816. if (set) {
  16817. return setToArray(set);
  16818. }
  16819. isCommon = false;
  16820. includes = cacheHas;
  16821. seen = new SetCache;
  16822. }
  16823. else {
  16824. seen = iteratee ? [] : result;
  16825. }
  16826. outer:
  16827. while (++index < length) {
  16828. var value = array[index],
  16829. computed = iteratee ? iteratee(value) : value;
  16830. value = (comparator || value !== 0) ? value : 0;
  16831. if (isCommon && computed === computed) {
  16832. var seenIndex = seen.length;
  16833. while (seenIndex--) {
  16834. if (seen[seenIndex] === computed) {
  16835. continue outer;
  16836. }
  16837. }
  16838. if (iteratee) {
  16839. seen.push(computed);
  16840. }
  16841. result.push(value);
  16842. }
  16843. else if (!includes(seen, computed, comparator)) {
  16844. if (seen !== result) {
  16845. seen.push(computed);
  16846. }
  16847. result.push(value);
  16848. }
  16849. }
  16850. return result;
  16851. }
  16852. /**
  16853. * Creates a set object of `values`.
  16854. *
  16855. * @private
  16856. * @param {Array} values The values to add to the set.
  16857. * @returns {Object} Returns the new set.
  16858. */
  16859. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  16860. return new Set(values);
  16861. };
  16862. /**
  16863. * Gets the data for `map`.
  16864. *
  16865. * @private
  16866. * @param {Object} map The map to query.
  16867. * @param {string} key The reference key.
  16868. * @returns {*} Returns the map data.
  16869. */
  16870. function getMapData(map, key) {
  16871. var data = map.__data__;
  16872. return isKeyable(key)
  16873. ? data[typeof key == 'string' ? 'string' : 'hash']
  16874. : data.map;
  16875. }
  16876. /**
  16877. * Gets the native function at `key` of `object`.
  16878. *
  16879. * @private
  16880. * @param {Object} object The object to query.
  16881. * @param {string} key The key of the method to get.
  16882. * @returns {*} Returns the function if it's native, else `undefined`.
  16883. */
  16884. function getNative(object, key) {
  16885. var value = getValue(object, key);
  16886. return baseIsNative(value) ? value : undefined;
  16887. }
  16888. /**
  16889. * Checks if `value` is suitable for use as unique object key.
  16890. *
  16891. * @private
  16892. * @param {*} value The value to check.
  16893. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  16894. */
  16895. function isKeyable(value) {
  16896. var type = typeof value;
  16897. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  16898. ? (value !== '__proto__')
  16899. : (value === null);
  16900. }
  16901. /**
  16902. * Checks if `func` has its source masked.
  16903. *
  16904. * @private
  16905. * @param {Function} func The function to check.
  16906. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  16907. */
  16908. function isMasked(func) {
  16909. return !!maskSrcKey && (maskSrcKey in func);
  16910. }
  16911. /**
  16912. * Converts `func` to its source code.
  16913. *
  16914. * @private
  16915. * @param {Function} func The function to process.
  16916. * @returns {string} Returns the source code.
  16917. */
  16918. function toSource(func) {
  16919. if (func != null) {
  16920. try {
  16921. return funcToString.call(func);
  16922. } catch (e) {}
  16923. try {
  16924. return (func + '');
  16925. } catch (e) {}
  16926. }
  16927. return '';
  16928. }
  16929. /**
  16930. * Creates a duplicate-free version of an array, using
  16931. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  16932. * for equality comparisons, in which only the first occurrence of each
  16933. * element is kept.
  16934. *
  16935. * @static
  16936. * @memberOf _
  16937. * @since 0.1.0
  16938. * @category Array
  16939. * @param {Array} array The array to inspect.
  16940. * @returns {Array} Returns the new duplicate free array.
  16941. * @example
  16942. *
  16943. * _.uniq([2, 1, 2]);
  16944. * // => [2, 1]
  16945. */
  16946. function uniq(array) {
  16947. return (array && array.length)
  16948. ? baseUniq(array)
  16949. : [];
  16950. }
  16951. /**
  16952. * Performs a
  16953. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  16954. * comparison between two values to determine if they are equivalent.
  16955. *
  16956. * @static
  16957. * @memberOf _
  16958. * @since 4.0.0
  16959. * @category Lang
  16960. * @param {*} value The value to compare.
  16961. * @param {*} other The other value to compare.
  16962. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  16963. * @example
  16964. *
  16965. * var object = { 'a': 1 };
  16966. * var other = { 'a': 1 };
  16967. *
  16968. * _.eq(object, object);
  16969. * // => true
  16970. *
  16971. * _.eq(object, other);
  16972. * // => false
  16973. *
  16974. * _.eq('a', 'a');
  16975. * // => true
  16976. *
  16977. * _.eq('a', Object('a'));
  16978. * // => false
  16979. *
  16980. * _.eq(NaN, NaN);
  16981. * // => true
  16982. */
  16983. function eq(value, other) {
  16984. return value === other || (value !== value && other !== other);
  16985. }
  16986. /**
  16987. * Checks if `value` is classified as a `Function` object.
  16988. *
  16989. * @static
  16990. * @memberOf _
  16991. * @since 0.1.0
  16992. * @category Lang
  16993. * @param {*} value The value to check.
  16994. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  16995. * @example
  16996. *
  16997. * _.isFunction(_);
  16998. * // => true
  16999. *
  17000. * _.isFunction(/abc/);
  17001. * // => false
  17002. */
  17003. function isFunction(value) {
  17004. // The use of `Object#toString` avoids issues with the `typeof` operator
  17005. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  17006. var tag = isObject(value) ? objectToString.call(value) : '';
  17007. return tag == funcTag || tag == genTag;
  17008. }
  17009. /**
  17010. * Checks if `value` is the
  17011. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  17012. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  17013. *
  17014. * @static
  17015. * @memberOf _
  17016. * @since 0.1.0
  17017. * @category Lang
  17018. * @param {*} value The value to check.
  17019. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  17020. * @example
  17021. *
  17022. * _.isObject({});
  17023. * // => true
  17024. *
  17025. * _.isObject([1, 2, 3]);
  17026. * // => true
  17027. *
  17028. * _.isObject(_.noop);
  17029. * // => true
  17030. *
  17031. * _.isObject(null);
  17032. * // => false
  17033. */
  17034. function isObject(value) {
  17035. var type = typeof value;
  17036. return !!value && (type == 'object' || type == 'function');
  17037. }
  17038. /**
  17039. * This method returns `undefined`.
  17040. *
  17041. * @static
  17042. * @memberOf _
  17043. * @since 2.3.0
  17044. * @category Util
  17045. * @example
  17046. *
  17047. * _.times(2, _.noop);
  17048. * // => [undefined, undefined]
  17049. */
  17050. function noop() {
  17051. // No operation performed.
  17052. }
  17053. module.exports = uniq;
  17054. /***/ }),
  17055. /***/ 217:
  17056. /***/ (function(module, __unusedexports, __webpack_require__) {
  17057. module.exports = authenticationRequestError;
  17058. const { RequestError } = __webpack_require__(239);
  17059. function authenticationRequestError(state, error, options) {
  17060. if (!error.headers) throw error;
  17061. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  17062. // handle "2FA required" error only
  17063. if (error.status !== 401 || !otpRequired) {
  17064. throw error;
  17065. }
  17066. if (
  17067. error.status === 401 &&
  17068. otpRequired &&
  17069. error.request &&
  17070. error.request.headers["x-github-otp"]
  17071. ) {
  17072. if (state.otp) {
  17073. delete state.otp; // no longer valid, request again
  17074. } else {
  17075. throw new RequestError(
  17076. "Invalid one-time password for two-factor authentication",
  17077. 401,
  17078. {
  17079. headers: error.headers,
  17080. request: options
  17081. }
  17082. );
  17083. }
  17084. }
  17085. if (typeof state.auth.on2fa !== "function") {
  17086. throw new RequestError(
  17087. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  17088. 401,
  17089. {
  17090. headers: error.headers,
  17091. request: options
  17092. }
  17093. );
  17094. }
  17095. return Promise.resolve()
  17096. .then(() => {
  17097. return state.auth.on2fa();
  17098. })
  17099. .then(oneTimePassword => {
  17100. const newOptions = Object.assign(options, {
  17101. headers: Object.assign(options.headers, {
  17102. "x-github-otp": oneTimePassword
  17103. })
  17104. });
  17105. return state.octokit.request(newOptions).then(response => {
  17106. // If OTP still valid, then persist it for following requests
  17107. state.otp = oneTimePassword;
  17108. return response;
  17109. });
  17110. });
  17111. }
  17112. /***/ }),
  17113. /***/ 219:
  17114. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  17115. "use strict";
  17116. var __importStar = (this && this.__importStar) || function (mod) {
  17117. if (mod && mod.__esModule) return mod;
  17118. var result = {};
  17119. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17120. result["default"] = mod;
  17121. return result;
  17122. };
  17123. Object.defineProperty(exports, "__esModule", { value: true });
  17124. const fs = __importStar(__webpack_require__(747));
  17125. function directoryExistsSync(path, required) {
  17126. if (!path) {
  17127. throw new Error("Arg 'path' must not be empty");
  17128. }
  17129. let stats;
  17130. try {
  17131. stats = fs.statSync(path);
  17132. }
  17133. catch (error) {
  17134. if (error.code === 'ENOENT') {
  17135. if (!required) {
  17136. return false;
  17137. }
  17138. throw new Error(`Directory '${path}' does not exist`);
  17139. }
  17140. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  17141. }
  17142. if (stats.isDirectory()) {
  17143. return true;
  17144. }
  17145. else if (!required) {
  17146. return false;
  17147. }
  17148. throw new Error(`Directory '${path}' does not exist`);
  17149. }
  17150. exports.directoryExistsSync = directoryExistsSync;
  17151. function existsSync(path) {
  17152. if (!path) {
  17153. throw new Error("Arg 'path' must not be empty");
  17154. }
  17155. try {
  17156. fs.statSync(path);
  17157. }
  17158. catch (error) {
  17159. if (error.code === 'ENOENT') {
  17160. return false;
  17161. }
  17162. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  17163. }
  17164. return true;
  17165. }
  17166. exports.existsSync = existsSync;
  17167. function fileExistsSync(path) {
  17168. if (!path) {
  17169. throw new Error("Arg 'path' must not be empty");
  17170. }
  17171. let stats;
  17172. try {
  17173. stats = fs.statSync(path);
  17174. }
  17175. catch (error) {
  17176. if (error.code === 'ENOENT') {
  17177. return false;
  17178. }
  17179. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  17180. }
  17181. if (!stats.isDirectory()) {
  17182. return true;
  17183. }
  17184. return false;
  17185. }
  17186. exports.fileExistsSync = fileExistsSync;
  17187. /***/ }),
  17188. /***/ 223:
  17189. /***/ (function(module, __unusedexports, __webpack_require__) {
  17190. var wrappy = __webpack_require__(940)
  17191. module.exports = wrappy(once)
  17192. module.exports.strict = wrappy(onceStrict)
  17193. once.proto = once(function () {
  17194. Object.defineProperty(Function.prototype, 'once', {
  17195. value: function () {
  17196. return once(this)
  17197. },
  17198. configurable: true
  17199. })
  17200. Object.defineProperty(Function.prototype, 'onceStrict', {
  17201. value: function () {
  17202. return onceStrict(this)
  17203. },
  17204. configurable: true
  17205. })
  17206. })
  17207. function once (fn) {
  17208. var f = function () {
  17209. if (f.called) return f.value
  17210. f.called = true
  17211. return f.value = fn.apply(this, arguments)
  17212. }
  17213. f.called = false
  17214. return f
  17215. }
  17216. function onceStrict (fn) {
  17217. var f = function () {
  17218. if (f.called)
  17219. throw new Error(f.onceError)
  17220. f.called = true
  17221. return f.value = fn.apply(this, arguments)
  17222. }
  17223. var name = fn.name || 'Function wrapped with `once`'
  17224. f.onceError = name + " shouldn't be called more than once"
  17225. f.called = false
  17226. return f
  17227. }
  17228. /***/ }),
  17229. /***/ 224:
  17230. /***/ (function(module) {
  17231. module.exports = function atob(str) {
  17232. return Buffer.from(str, 'base64').toString('binary')
  17233. }
  17234. /***/ }),
  17235. /***/ 234:
  17236. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  17237. "use strict";
  17238. Object.defineProperty(exports, '__esModule', { value: true });
  17239. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  17240. var endpoint = __webpack_require__(440);
  17241. var universalUserAgent = __webpack_require__(441);
  17242. var isPlainObject = _interopDefault(__webpack_require__(840));
  17243. var nodeFetch = _interopDefault(__webpack_require__(419));
  17244. var requestError = __webpack_require__(537);
  17245. const VERSION = "5.4.2";
  17246. function getBufferResponse(response) {
  17247. return response.arrayBuffer();
  17248. }
  17249. function fetchWrapper(requestOptions) {
  17250. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  17251. requestOptions.body = JSON.stringify(requestOptions.body);
  17252. }
  17253. let headers = {};
  17254. let status;
  17255. let url;
  17256. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  17257. return fetch(requestOptions.url, Object.assign({
  17258. method: requestOptions.method,
  17259. body: requestOptions.body,
  17260. headers: requestOptions.headers,
  17261. redirect: requestOptions.redirect
  17262. }, requestOptions.request)).then(response => {
  17263. url = response.url;
  17264. status = response.status;
  17265. for (const keyAndValue of response.headers) {
  17266. headers[keyAndValue[0]] = keyAndValue[1];
  17267. }
  17268. if (status === 204 || status === 205) {
  17269. return;
  17270. } // GitHub API returns 200 for HEAD requests
  17271. if (requestOptions.method === "HEAD") {
  17272. if (status < 400) {
  17273. return;
  17274. }
  17275. throw new requestError.RequestError(response.statusText, status, {
  17276. headers,
  17277. request: requestOptions
  17278. });
  17279. }
  17280. if (status === 304) {
  17281. throw new requestError.RequestError("Not modified", status, {
  17282. headers,
  17283. request: requestOptions
  17284. });
  17285. }
  17286. if (status >= 400) {
  17287. return response.text().then(message => {
  17288. const error = new requestError.RequestError(message, status, {
  17289. headers,
  17290. request: requestOptions
  17291. });
  17292. try {
  17293. let responseBody = JSON.parse(error.message);
  17294. Object.assign(error, responseBody);
  17295. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  17296. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  17297. } catch (e) {// ignore, see octokit/rest.js#684
  17298. }
  17299. throw error;
  17300. });
  17301. }
  17302. const contentType = response.headers.get("content-type");
  17303. if (/application\/json/.test(contentType)) {
  17304. return response.json();
  17305. }
  17306. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  17307. return response.text();
  17308. }
  17309. return getBufferResponse(response);
  17310. }).then(data => {
  17311. return {
  17312. status,
  17313. url,
  17314. headers,
  17315. data
  17316. };
  17317. }).catch(error => {
  17318. if (error instanceof requestError.RequestError) {
  17319. throw error;
  17320. }
  17321. throw new requestError.RequestError(error.message, 500, {
  17322. headers,
  17323. request: requestOptions
  17324. });
  17325. });
  17326. }
  17327. function withDefaults(oldEndpoint, newDefaults) {
  17328. const endpoint = oldEndpoint.defaults(newDefaults);
  17329. const newApi = function (route, parameters) {
  17330. const endpointOptions = endpoint.merge(route, parameters);
  17331. if (!endpointOptions.request || !endpointOptions.request.hook) {
  17332. return fetchWrapper(endpoint.parse(endpointOptions));
  17333. }
  17334. const request = (route, parameters) => {
  17335. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  17336. };
  17337. Object.assign(request, {
  17338. endpoint,
  17339. defaults: withDefaults.bind(null, endpoint)
  17340. });
  17341. return endpointOptions.request.hook(request, endpointOptions);
  17342. };
  17343. return Object.assign(newApi, {
  17344. endpoint,
  17345. defaults: withDefaults.bind(null, endpoint)
  17346. });
  17347. }
  17348. const request = withDefaults(endpoint.endpoint, {
  17349. headers: {
  17350. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  17351. }
  17352. });
  17353. exports.request = request;
  17354. //# sourceMappingURL=index.js.map
  17355. /***/ }),
  17356. /***/ 239:
  17357. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  17358. "use strict";
  17359. Object.defineProperty(exports, '__esModule', { value: true });
  17360. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  17361. var deprecation = __webpack_require__(932);
  17362. var once = _interopDefault(__webpack_require__(223));
  17363. const logOnce = once(deprecation => console.warn(deprecation));
  17364. /**
  17365. * Error with extra properties to help with debugging
  17366. */
  17367. class RequestError extends Error {
  17368. constructor(message, statusCode, options) {
  17369. super(message); // Maintains proper stack trace (only available on V8)
  17370. /* istanbul ignore next */
  17371. if (Error.captureStackTrace) {
  17372. Error.captureStackTrace(this, this.constructor);
  17373. }
  17374. this.name = "HttpError";
  17375. this.status = statusCode;
  17376. Object.defineProperty(this, "code", {
  17377. get() {
  17378. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  17379. return statusCode;
  17380. }
  17381. });
  17382. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  17383. const requestCopy = Object.assign({}, options.request);
  17384. if (options.request.headers.authorization) {
  17385. requestCopy.headers = Object.assign({}, options.request.headers, {
  17386. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  17387. });
  17388. }
  17389. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  17390. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  17391. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  17392. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  17393. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  17394. this.request = requestCopy;
  17395. }
  17396. }
  17397. exports.RequestError = RequestError;
  17398. //# sourceMappingURL=index.js.map
  17399. /***/ }),
  17400. /***/ 242:
  17401. /***/ (function(module, __unusedexports, __webpack_require__) {
  17402. module.exports = getFirstPage
  17403. const getPage = __webpack_require__(604)
  17404. function getFirstPage (octokit, link, headers) {
  17405. return getPage(octokit, link, 'first', headers)
  17406. }
  17407. /***/ }),
  17408. /***/ 252:
  17409. /***/ (function(module, __unusedexports, __webpack_require__) {
  17410. "use strict";
  17411. const fs = __webpack_require__(747);
  17412. const shebangCommand = __webpack_require__(32);
  17413. function readShebang(command) {
  17414. // Read the first 150 bytes from the file
  17415. const size = 150;
  17416. let buffer;
  17417. if (Buffer.alloc) {
  17418. // Node.js v4.5+ / v5.10+
  17419. buffer = Buffer.alloc(size);
  17420. } else {
  17421. // Old Node.js API
  17422. buffer = new Buffer(size);
  17423. buffer.fill(0); // zero-fill
  17424. }
  17425. let fd;
  17426. try {
  17427. fd = fs.openSync(command, 'r');
  17428. fs.readSync(fd, buffer, 0, size, 0);
  17429. fs.closeSync(fd);
  17430. } catch (e) { /* Empty */ }
  17431. // Attempt to extract shebang (null is returned if not a shebang)
  17432. return shebangCommand(buffer.toString());
  17433. }
  17434. module.exports = readShebang;
  17435. /***/ }),
  17436. /***/ 274:
  17437. /***/ (function(module, __unusedexports, __webpack_require__) {
  17438. "use strict";
  17439. const path = __webpack_require__(622);
  17440. const which = __webpack_require__(207);
  17441. const pathKey = __webpack_require__(539)();
  17442. function resolveCommandAttempt(parsed, withoutPathExt) {
  17443. const cwd = process.cwd();
  17444. const hasCustomCwd = parsed.options.cwd != null;
  17445. // If a custom `cwd` was specified, we need to change the process cwd
  17446. // because `which` will do stat calls but does not support a custom cwd
  17447. if (hasCustomCwd) {
  17448. try {
  17449. process.chdir(parsed.options.cwd);
  17450. } catch (err) {
  17451. /* Empty */
  17452. }
  17453. }
  17454. let resolved;
  17455. try {
  17456. resolved = which.sync(parsed.command, {
  17457. path: (parsed.options.env || process.env)[pathKey],
  17458. pathExt: withoutPathExt ? path.delimiter : undefined,
  17459. });
  17460. } catch (e) {
  17461. /* Empty */
  17462. } finally {
  17463. process.chdir(cwd);
  17464. }
  17465. // If we successfully resolved, ensure that an absolute path is returned
  17466. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  17467. if (resolved) {
  17468. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  17469. }
  17470. return resolved;
  17471. }
  17472. function resolveCommand(parsed) {
  17473. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  17474. }
  17475. module.exports = resolveCommand;
  17476. /***/ }),
  17477. /***/ 275:
  17478. /***/ (function(module, __unusedexports, __webpack_require__) {
  17479. module.exports = authenticationRequestError;
  17480. const { RequestError } = __webpack_require__(239);
  17481. function authenticationRequestError(state, error, options) {
  17482. /* istanbul ignore next */
  17483. if (!error.headers) throw error;
  17484. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  17485. // handle "2FA required" error only
  17486. if (error.status !== 401 || !otpRequired) {
  17487. throw error;
  17488. }
  17489. if (
  17490. error.status === 401 &&
  17491. otpRequired &&
  17492. error.request &&
  17493. error.request.headers["x-github-otp"]
  17494. ) {
  17495. throw new RequestError(
  17496. "Invalid one-time password for two-factor authentication",
  17497. 401,
  17498. {
  17499. headers: error.headers,
  17500. request: options
  17501. }
  17502. );
  17503. }
  17504. if (typeof state.auth.on2fa !== "function") {
  17505. throw new RequestError(
  17506. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  17507. 401,
  17508. {
  17509. headers: error.headers,
  17510. request: options
  17511. }
  17512. );
  17513. }
  17514. return Promise.resolve()
  17515. .then(() => {
  17516. return state.auth.on2fa();
  17517. })
  17518. .then(oneTimePassword => {
  17519. const newOptions = Object.assign(options, {
  17520. headers: Object.assign(
  17521. { "x-github-otp": oneTimePassword },
  17522. options.headers
  17523. )
  17524. });
  17525. return state.octokit.request(newOptions);
  17526. });
  17527. }
  17528. /***/ }),
  17529. /***/ 286:
  17530. /***/ (function(module, __unusedexports, __webpack_require__) {
  17531. module.exports = hasLastPage
  17532. const deprecate = __webpack_require__(191)
  17533. const getPageLinks = __webpack_require__(889)
  17534. function hasLastPage (link) {
  17535. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  17536. return getPageLinks(link).last
  17537. }
  17538. /***/ }),
  17539. /***/ 292:
  17540. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  17541. "use strict";
  17542. Object.defineProperty(exports, '__esModule', { value: true });
  17543. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  17544. var osName = _interopDefault(__webpack_require__(760));
  17545. function getUserAgent() {
  17546. try {
  17547. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  17548. } catch (error) {
  17549. if (/wmic os get Caption/.test(error.message)) {
  17550. return "Windows <version undetectable>";
  17551. }
  17552. return "<environment undetectable>";
  17553. }
  17554. }
  17555. exports.getUserAgent = getUserAgent;
  17556. //# sourceMappingURL=index.js.map
  17557. /***/ }),
  17558. /***/ 294:
  17559. /***/ (function(module, __unusedexports, __webpack_require__) {
  17560. module.exports = __webpack_require__(651);
  17561. /***/ }),
  17562. /***/ 320:
  17563. /***/ (function(module, __unusedexports, __webpack_require__) {
  17564. module.exports = factory;
  17565. const Octokit = __webpack_require__(823);
  17566. const registerPlugin = __webpack_require__(826);
  17567. function factory(plugins) {
  17568. const Api = Octokit.bind(null, plugins || []);
  17569. Api.plugin = registerPlugin.bind(null, plugins || []);
  17570. return Api;
  17571. }
  17572. /***/ }),
  17573. /***/ 330:
  17574. /***/ (function(module) {
  17575. "use strict";
  17576. module.exports = (promise, onFinally) => {
  17577. onFinally = onFinally || (() => {});
  17578. return promise.then(
  17579. val => new Promise(resolve => {
  17580. resolve(onFinally());
  17581. }).then(() => val),
  17582. err => new Promise(resolve => {
  17583. resolve(onFinally());
  17584. }).then(() => {
  17585. throw err;
  17586. })
  17587. );
  17588. };
  17589. /***/ }),
  17590. /***/ 334:
  17591. /***/ (function(__unusedmodule, exports) {
  17592. "use strict";
  17593. Object.defineProperty(exports, '__esModule', { value: true });
  17594. async function auth(token) {
  17595. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  17596. return {
  17597. type: "token",
  17598. token: token,
  17599. tokenType
  17600. };
  17601. }
  17602. /**
  17603. * Prefix token for usage in the Authorization header
  17604. *
  17605. * @param token OAuth token or JSON Web Token
  17606. */
  17607. function withAuthorizationPrefix(token) {
  17608. if (token.split(/\./).length === 3) {
  17609. return `bearer ${token}`;
  17610. }
  17611. return `token ${token}`;
  17612. }
  17613. async function hook(token, request, route, parameters) {
  17614. const endpoint = request.endpoint.merge(route, parameters);
  17615. endpoint.headers.authorization = withAuthorizationPrefix(token);
  17616. return request(endpoint);
  17617. }
  17618. const createTokenAuth = function createTokenAuth(token) {
  17619. if (!token) {
  17620. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  17621. }
  17622. if (typeof token !== "string") {
  17623. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  17624. }
  17625. token = token.replace(/^(token|bearer) +/i, "");
  17626. return Object.assign(auth.bind(null, token), {
  17627. hook: hook.bind(null, token)
  17628. });
  17629. };
  17630. exports.createTokenAuth = createTokenAuth;
  17631. //# sourceMappingURL=index.js.map
  17632. /***/ }),
  17633. /***/ 341:
  17634. /***/ (function(module, __unusedexports, __webpack_require__) {
  17635. var once = __webpack_require__(223)
  17636. var eos = __webpack_require__(205)
  17637. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  17638. var noop = function () {}
  17639. var ancient = /^v?\.0/.test(process.version)
  17640. var isFn = function (fn) {
  17641. return typeof fn === 'function'
  17642. }
  17643. var isFS = function (stream) {
  17644. if (!ancient) return false // newer node version do not need to care about fs is a special way
  17645. if (!fs) return false // browser
  17646. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  17647. }
  17648. var isRequest = function (stream) {
  17649. return stream.setHeader && isFn(stream.abort)
  17650. }
  17651. var destroyer = function (stream, reading, writing, callback) {
  17652. callback = once(callback)
  17653. var closed = false
  17654. stream.on('close', function () {
  17655. closed = true
  17656. })
  17657. eos(stream, {readable: reading, writable: writing}, function (err) {
  17658. if (err) return callback(err)
  17659. closed = true
  17660. callback()
  17661. })
  17662. var destroyed = false
  17663. return function (err) {
  17664. if (closed) return
  17665. if (destroyed) return
  17666. destroyed = true
  17667. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  17668. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  17669. if (isFn(stream.destroy)) return stream.destroy()
  17670. callback(err || new Error('stream was destroyed'))
  17671. }
  17672. }
  17673. var call = function (fn) {
  17674. fn()
  17675. }
  17676. var pipe = function (from, to) {
  17677. return from.pipe(to)
  17678. }
  17679. var pump = function () {
  17680. var streams = Array.prototype.slice.call(arguments)
  17681. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  17682. if (Array.isArray(streams[0])) streams = streams[0]
  17683. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  17684. var error
  17685. var destroys = streams.map(function (stream, i) {
  17686. var reading = i < streams.length - 1
  17687. var writing = i > 0
  17688. return destroyer(stream, reading, writing, function (err) {
  17689. if (!error) error = err
  17690. if (err) destroys.forEach(call)
  17691. if (reading) return
  17692. destroys.forEach(call)
  17693. callback(error)
  17694. })
  17695. })
  17696. return streams.reduce(pipe)
  17697. }
  17698. module.exports = pump
  17699. /***/ }),
  17700. /***/ 351:
  17701. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  17702. "use strict";
  17703. Object.defineProperty(exports, "__esModule", { value: true });
  17704. const os = __webpack_require__(87);
  17705. /**
  17706. * Commands
  17707. *
  17708. * Command Format:
  17709. * ##[name key=value;key=value]message
  17710. *
  17711. * Examples:
  17712. * ##[warning]This is the user warning message
  17713. * ##[set-secret name=mypassword]definitelyNotAPassword!
  17714. */
  17715. function issueCommand(command, properties, message) {
  17716. const cmd = new Command(command, properties, message);
  17717. process.stdout.write(cmd.toString() + os.EOL);
  17718. }
  17719. exports.issueCommand = issueCommand;
  17720. function issue(name, message = '') {
  17721. issueCommand(name, {}, message);
  17722. }
  17723. exports.issue = issue;
  17724. const CMD_STRING = '::';
  17725. class Command {
  17726. constructor(command, properties, message) {
  17727. if (!command) {
  17728. command = 'missing.command';
  17729. }
  17730. this.command = command;
  17731. this.properties = properties;
  17732. this.message = message;
  17733. }
  17734. toString() {
  17735. let cmdStr = CMD_STRING + this.command;
  17736. if (this.properties && Object.keys(this.properties).length > 0) {
  17737. cmdStr += ' ';
  17738. for (const key in this.properties) {
  17739. if (this.properties.hasOwnProperty(key)) {
  17740. const val = this.properties[key];
  17741. if (val) {
  17742. // safely append the val - avoid blowing up when attempting to
  17743. // call .replace() if message is not a string for some reason
  17744. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  17745. }
  17746. }
  17747. }
  17748. }
  17749. cmdStr += CMD_STRING;
  17750. // safely append the message - avoid blowing up when attempting to
  17751. // call .replace() if message is not a string for some reason
  17752. const message = `${this.message || ''}`;
  17753. cmdStr += escapeData(message);
  17754. return cmdStr;
  17755. }
  17756. }
  17757. function escapeData(s) {
  17758. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  17759. }
  17760. function escape(s) {
  17761. return s
  17762. .replace(/\r/g, '%0D')
  17763. .replace(/\n/g, '%0A')
  17764. .replace(/]/g, '%5D')
  17765. .replace(/;/g, '%3B');
  17766. }
  17767. //# sourceMappingURL=command.js.map
  17768. /***/ }),
  17769. /***/ 357:
  17770. /***/ (function(module) {
  17771. module.exports = require("assert");
  17772. /***/ }),
  17773. /***/ 358:
  17774. /***/ (function(module) {
  17775. module.exports = function btoa(str) {
  17776. return new Buffer(str).toString('base64')
  17777. }
  17778. /***/ }),
  17779. /***/ 406:
  17780. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  17781. "use strict";
  17782. var net = __webpack_require__(937);
  17783. var tls = __webpack_require__(16);
  17784. var http = __webpack_require__(605);
  17785. var https = __webpack_require__(211);
  17786. var events = __webpack_require__(614);
  17787. var assert = __webpack_require__(357);
  17788. var util = __webpack_require__(669);
  17789. exports.httpOverHttp = httpOverHttp;
  17790. exports.httpsOverHttp = httpsOverHttp;
  17791. exports.httpOverHttps = httpOverHttps;
  17792. exports.httpsOverHttps = httpsOverHttps;
  17793. function httpOverHttp(options) {
  17794. var agent = new TunnelingAgent(options);
  17795. agent.request = http.request;
  17796. return agent;
  17797. }
  17798. function httpsOverHttp(options) {
  17799. var agent = new TunnelingAgent(options);
  17800. agent.request = http.request;
  17801. agent.createSocket = createSecureSocket;
  17802. agent.defaultPort = 443;
  17803. return agent;
  17804. }
  17805. function httpOverHttps(options) {
  17806. var agent = new TunnelingAgent(options);
  17807. agent.request = https.request;
  17808. return agent;
  17809. }
  17810. function httpsOverHttps(options) {
  17811. var agent = new TunnelingAgent(options);
  17812. agent.request = https.request;
  17813. agent.createSocket = createSecureSocket;
  17814. agent.defaultPort = 443;
  17815. return agent;
  17816. }
  17817. function TunnelingAgent(options) {
  17818. var self = this;
  17819. self.options = options || {};
  17820. self.proxyOptions = self.options.proxy || {};
  17821. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  17822. self.requests = [];
  17823. self.sockets = [];
  17824. self.on('free', function onFree(socket, host, port, localAddress) {
  17825. var options = toOptions(host, port, localAddress);
  17826. for (var i = 0, len = self.requests.length; i < len; ++i) {
  17827. var pending = self.requests[i];
  17828. if (pending.host === options.host && pending.port === options.port) {
  17829. // Detect the request to connect same origin server,
  17830. // reuse the connection.
  17831. self.requests.splice(i, 1);
  17832. pending.request.onSocket(socket);
  17833. return;
  17834. }
  17835. }
  17836. socket.destroy();
  17837. self.removeSocket(socket);
  17838. });
  17839. }
  17840. util.inherits(TunnelingAgent, events.EventEmitter);
  17841. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  17842. var self = this;
  17843. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  17844. if (self.sockets.length >= this.maxSockets) {
  17845. // We are over limit so we'll add it to the queue.
  17846. self.requests.push(options);
  17847. return;
  17848. }
  17849. // If we are under maxSockets create a new one.
  17850. self.createSocket(options, function(socket) {
  17851. socket.on('free', onFree);
  17852. socket.on('close', onCloseOrRemove);
  17853. socket.on('agentRemove', onCloseOrRemove);
  17854. req.onSocket(socket);
  17855. function onFree() {
  17856. self.emit('free', socket, options);
  17857. }
  17858. function onCloseOrRemove(err) {
  17859. self.removeSocket(socket);
  17860. socket.removeListener('free', onFree);
  17861. socket.removeListener('close', onCloseOrRemove);
  17862. socket.removeListener('agentRemove', onCloseOrRemove);
  17863. }
  17864. });
  17865. };
  17866. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  17867. var self = this;
  17868. var placeholder = {};
  17869. self.sockets.push(placeholder);
  17870. var connectOptions = mergeOptions({}, self.proxyOptions, {
  17871. method: 'CONNECT',
  17872. path: options.host + ':' + options.port,
  17873. agent: false,
  17874. headers: {
  17875. host: options.host + ':' + options.port
  17876. }
  17877. });
  17878. if (options.localAddress) {
  17879. connectOptions.localAddress = options.localAddress;
  17880. }
  17881. if (connectOptions.proxyAuth) {
  17882. connectOptions.headers = connectOptions.headers || {};
  17883. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  17884. new Buffer(connectOptions.proxyAuth).toString('base64');
  17885. }
  17886. debug('making CONNECT request');
  17887. var connectReq = self.request(connectOptions);
  17888. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  17889. connectReq.once('response', onResponse); // for v0.6
  17890. connectReq.once('upgrade', onUpgrade); // for v0.6
  17891. connectReq.once('connect', onConnect); // for v0.7 or later
  17892. connectReq.once('error', onError);
  17893. connectReq.end();
  17894. function onResponse(res) {
  17895. // Very hacky. This is necessary to avoid http-parser leaks.
  17896. res.upgrade = true;
  17897. }
  17898. function onUpgrade(res, socket, head) {
  17899. // Hacky.
  17900. process.nextTick(function() {
  17901. onConnect(res, socket, head);
  17902. });
  17903. }
  17904. function onConnect(res, socket, head) {
  17905. connectReq.removeAllListeners();
  17906. socket.removeAllListeners();
  17907. if (res.statusCode !== 200) {
  17908. debug('tunneling socket could not be established, statusCode=%d',
  17909. res.statusCode);
  17910. socket.destroy();
  17911. var error = new Error('tunneling socket could not be established, ' +
  17912. 'statusCode=' + res.statusCode);
  17913. error.code = 'ECONNRESET';
  17914. options.request.emit('error', error);
  17915. self.removeSocket(placeholder);
  17916. return;
  17917. }
  17918. if (head.length > 0) {
  17919. debug('got illegal response body from proxy');
  17920. socket.destroy();
  17921. var error = new Error('got illegal response body from proxy');
  17922. error.code = 'ECONNRESET';
  17923. options.request.emit('error', error);
  17924. self.removeSocket(placeholder);
  17925. return;
  17926. }
  17927. debug('tunneling connection has established');
  17928. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  17929. return cb(socket);
  17930. }
  17931. function onError(cause) {
  17932. connectReq.removeAllListeners();
  17933. debug('tunneling socket could not be established, cause=%s\n',
  17934. cause.message, cause.stack);
  17935. var error = new Error('tunneling socket could not be established, ' +
  17936. 'cause=' + cause.message);
  17937. error.code = 'ECONNRESET';
  17938. options.request.emit('error', error);
  17939. self.removeSocket(placeholder);
  17940. }
  17941. };
  17942. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  17943. var pos = this.sockets.indexOf(socket)
  17944. if (pos === -1) {
  17945. return;
  17946. }
  17947. this.sockets.splice(pos, 1);
  17948. var pending = this.requests.shift();
  17949. if (pending) {
  17950. // If we have pending requests and a socket gets closed a new one
  17951. // needs to be created to take over in the pool for the one that closed.
  17952. this.createSocket(pending, function(socket) {
  17953. pending.request.onSocket(socket);
  17954. });
  17955. }
  17956. };
  17957. function createSecureSocket(options, cb) {
  17958. var self = this;
  17959. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  17960. var hostHeader = options.request.getHeader('host');
  17961. var tlsOptions = mergeOptions({}, self.options, {
  17962. socket: socket,
  17963. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  17964. });
  17965. // 0 is dummy port for v0.6
  17966. var secureSocket = tls.connect(0, tlsOptions);
  17967. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  17968. cb(secureSocket);
  17969. });
  17970. }
  17971. function toOptions(host, port, localAddress) {
  17972. if (typeof host === 'string') { // since v0.10
  17973. return {
  17974. host: host,
  17975. port: port,
  17976. localAddress: localAddress
  17977. };
  17978. }
  17979. return host; // for v0.11 or later
  17980. }
  17981. function mergeOptions(target) {
  17982. for (var i = 1, len = arguments.length; i < len; ++i) {
  17983. var overrides = arguments[i];
  17984. if (typeof overrides === 'object') {
  17985. var keys = Object.keys(overrides);
  17986. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  17987. var k = keys[j];
  17988. if (overrides[k] !== undefined) {
  17989. target[k] = overrides[k];
  17990. }
  17991. }
  17992. }
  17993. }
  17994. return target;
  17995. }
  17996. var debug;
  17997. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  17998. debug = function() {
  17999. var args = Array.prototype.slice.call(arguments);
  18000. if (typeof args[0] === 'string') {
  18001. args[0] = 'TUNNEL: ' + args[0];
  18002. } else {
  18003. args.unshift('TUNNEL:');
  18004. }
  18005. console.error.apply(console, args);
  18006. }
  18007. } else {
  18008. debug = function() {};
  18009. }
  18010. exports.debug = debug; // for test
  18011. /***/ }),
  18012. /***/ 413:
  18013. /***/ (function(module) {
  18014. module.exports = require("stream");
  18015. /***/ }),
  18016. /***/ 417:
  18017. /***/ (function(module) {
  18018. module.exports = require("crypto");
  18019. /***/ }),
  18020. /***/ 419:
  18021. /***/ (function(module, exports, __webpack_require__) {
  18022. "use strict";
  18023. Object.defineProperty(exports, '__esModule', { value: true });
  18024. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  18025. var Stream = _interopDefault(__webpack_require__(413));
  18026. var http = _interopDefault(__webpack_require__(605));
  18027. var Url = _interopDefault(__webpack_require__(835));
  18028. var https = _interopDefault(__webpack_require__(211));
  18029. var zlib = _interopDefault(__webpack_require__(761));
  18030. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  18031. // fix for "Readable" isn't a named export issue
  18032. const Readable = Stream.Readable;
  18033. const BUFFER = Symbol('buffer');
  18034. const TYPE = Symbol('type');
  18035. class Blob {
  18036. constructor() {
  18037. this[TYPE] = '';
  18038. const blobParts = arguments[0];
  18039. const options = arguments[1];
  18040. const buffers = [];
  18041. let size = 0;
  18042. if (blobParts) {
  18043. const a = blobParts;
  18044. const length = Number(a.length);
  18045. for (let i = 0; i < length; i++) {
  18046. const element = a[i];
  18047. let buffer;
  18048. if (element instanceof Buffer) {
  18049. buffer = element;
  18050. } else if (ArrayBuffer.isView(element)) {
  18051. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  18052. } else if (element instanceof ArrayBuffer) {
  18053. buffer = Buffer.from(element);
  18054. } else if (element instanceof Blob) {
  18055. buffer = element[BUFFER];
  18056. } else {
  18057. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  18058. }
  18059. size += buffer.length;
  18060. buffers.push(buffer);
  18061. }
  18062. }
  18063. this[BUFFER] = Buffer.concat(buffers);
  18064. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  18065. if (type && !/[^\u0020-\u007E]/.test(type)) {
  18066. this[TYPE] = type;
  18067. }
  18068. }
  18069. get size() {
  18070. return this[BUFFER].length;
  18071. }
  18072. get type() {
  18073. return this[TYPE];
  18074. }
  18075. text() {
  18076. return Promise.resolve(this[BUFFER].toString());
  18077. }
  18078. arrayBuffer() {
  18079. const buf = this[BUFFER];
  18080. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  18081. return Promise.resolve(ab);
  18082. }
  18083. stream() {
  18084. const readable = new Readable();
  18085. readable._read = function () {};
  18086. readable.push(this[BUFFER]);
  18087. readable.push(null);
  18088. return readable;
  18089. }
  18090. toString() {
  18091. return '[object Blob]';
  18092. }
  18093. slice() {
  18094. const size = this.size;
  18095. const start = arguments[0];
  18096. const end = arguments[1];
  18097. let relativeStart, relativeEnd;
  18098. if (start === undefined) {
  18099. relativeStart = 0;
  18100. } else if (start < 0) {
  18101. relativeStart = Math.max(size + start, 0);
  18102. } else {
  18103. relativeStart = Math.min(start, size);
  18104. }
  18105. if (end === undefined) {
  18106. relativeEnd = size;
  18107. } else if (end < 0) {
  18108. relativeEnd = Math.max(size + end, 0);
  18109. } else {
  18110. relativeEnd = Math.min(end, size);
  18111. }
  18112. const span = Math.max(relativeEnd - relativeStart, 0);
  18113. const buffer = this[BUFFER];
  18114. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  18115. const blob = new Blob([], { type: arguments[2] });
  18116. blob[BUFFER] = slicedBuffer;
  18117. return blob;
  18118. }
  18119. }
  18120. Object.defineProperties(Blob.prototype, {
  18121. size: { enumerable: true },
  18122. type: { enumerable: true },
  18123. slice: { enumerable: true }
  18124. });
  18125. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  18126. value: 'Blob',
  18127. writable: false,
  18128. enumerable: false,
  18129. configurable: true
  18130. });
  18131. /**
  18132. * fetch-error.js
  18133. *
  18134. * FetchError interface for operational errors
  18135. */
  18136. /**
  18137. * Create FetchError instance
  18138. *
  18139. * @param String message Error message for human
  18140. * @param String type Error type for machine
  18141. * @param String systemError For Node.js system error
  18142. * @return FetchError
  18143. */
  18144. function FetchError(message, type, systemError) {
  18145. Error.call(this, message);
  18146. this.message = message;
  18147. this.type = type;
  18148. // when err.type is `system`, err.code contains system error code
  18149. if (systemError) {
  18150. this.code = this.errno = systemError.code;
  18151. }
  18152. // hide custom error implementation details from end-users
  18153. Error.captureStackTrace(this, this.constructor);
  18154. }
  18155. FetchError.prototype = Object.create(Error.prototype);
  18156. FetchError.prototype.constructor = FetchError;
  18157. FetchError.prototype.name = 'FetchError';
  18158. let convert;
  18159. try {
  18160. convert = __webpack_require__(877).convert;
  18161. } catch (e) {}
  18162. const INTERNALS = Symbol('Body internals');
  18163. // fix an issue where "PassThrough" isn't a named export for node <10
  18164. const PassThrough = Stream.PassThrough;
  18165. /**
  18166. * Body mixin
  18167. *
  18168. * Ref: https://fetch.spec.whatwg.org/#body
  18169. *
  18170. * @param Stream body Readable stream
  18171. * @param Object opts Response options
  18172. * @return Void
  18173. */
  18174. function Body(body) {
  18175. var _this = this;
  18176. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  18177. _ref$size = _ref.size;
  18178. let size = _ref$size === undefined ? 0 : _ref$size;
  18179. var _ref$timeout = _ref.timeout;
  18180. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  18181. if (body == null) {
  18182. // body is undefined or null
  18183. body = null;
  18184. } else if (isURLSearchParams(body)) {
  18185. // body is a URLSearchParams
  18186. body = Buffer.from(body.toString());
  18187. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  18188. // body is ArrayBuffer
  18189. body = Buffer.from(body);
  18190. } else if (ArrayBuffer.isView(body)) {
  18191. // body is ArrayBufferView
  18192. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  18193. } else if (body instanceof Stream) ; else {
  18194. // none of the above
  18195. // coerce to string then buffer
  18196. body = Buffer.from(String(body));
  18197. }
  18198. this[INTERNALS] = {
  18199. body,
  18200. disturbed: false,
  18201. error: null
  18202. };
  18203. this.size = size;
  18204. this.timeout = timeout;
  18205. if (body instanceof Stream) {
  18206. body.on('error', function (err) {
  18207. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  18208. _this[INTERNALS].error = error;
  18209. });
  18210. }
  18211. }
  18212. Body.prototype = {
  18213. get body() {
  18214. return this[INTERNALS].body;
  18215. },
  18216. get bodyUsed() {
  18217. return this[INTERNALS].disturbed;
  18218. },
  18219. /**
  18220. * Decode response as ArrayBuffer
  18221. *
  18222. * @return Promise
  18223. */
  18224. arrayBuffer() {
  18225. return consumeBody.call(this).then(function (buf) {
  18226. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  18227. });
  18228. },
  18229. /**
  18230. * Return raw response as Blob
  18231. *
  18232. * @return Promise
  18233. */
  18234. blob() {
  18235. let ct = this.headers && this.headers.get('content-type') || '';
  18236. return consumeBody.call(this).then(function (buf) {
  18237. return Object.assign(
  18238. // Prevent copying
  18239. new Blob([], {
  18240. type: ct.toLowerCase()
  18241. }), {
  18242. [BUFFER]: buf
  18243. });
  18244. });
  18245. },
  18246. /**
  18247. * Decode response as json
  18248. *
  18249. * @return Promise
  18250. */
  18251. json() {
  18252. var _this2 = this;
  18253. return consumeBody.call(this).then(function (buffer) {
  18254. try {
  18255. return JSON.parse(buffer.toString());
  18256. } catch (err) {
  18257. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  18258. }
  18259. });
  18260. },
  18261. /**
  18262. * Decode response as text
  18263. *
  18264. * @return Promise
  18265. */
  18266. text() {
  18267. return consumeBody.call(this).then(function (buffer) {
  18268. return buffer.toString();
  18269. });
  18270. },
  18271. /**
  18272. * Decode response as buffer (non-spec api)
  18273. *
  18274. * @return Promise
  18275. */
  18276. buffer() {
  18277. return consumeBody.call(this);
  18278. },
  18279. /**
  18280. * Decode response as text, while automatically detecting the encoding and
  18281. * trying to decode to UTF-8 (non-spec api)
  18282. *
  18283. * @return Promise
  18284. */
  18285. textConverted() {
  18286. var _this3 = this;
  18287. return consumeBody.call(this).then(function (buffer) {
  18288. return convertBody(buffer, _this3.headers);
  18289. });
  18290. }
  18291. };
  18292. // In browsers, all properties are enumerable.
  18293. Object.defineProperties(Body.prototype, {
  18294. body: { enumerable: true },
  18295. bodyUsed: { enumerable: true },
  18296. arrayBuffer: { enumerable: true },
  18297. blob: { enumerable: true },
  18298. json: { enumerable: true },
  18299. text: { enumerable: true }
  18300. });
  18301. Body.mixIn = function (proto) {
  18302. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  18303. // istanbul ignore else: future proof
  18304. if (!(name in proto)) {
  18305. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  18306. Object.defineProperty(proto, name, desc);
  18307. }
  18308. }
  18309. };
  18310. /**
  18311. * Consume and convert an entire Body to a Buffer.
  18312. *
  18313. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  18314. *
  18315. * @return Promise
  18316. */
  18317. function consumeBody() {
  18318. var _this4 = this;
  18319. if (this[INTERNALS].disturbed) {
  18320. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  18321. }
  18322. this[INTERNALS].disturbed = true;
  18323. if (this[INTERNALS].error) {
  18324. return Body.Promise.reject(this[INTERNALS].error);
  18325. }
  18326. let body = this.body;
  18327. // body is null
  18328. if (body === null) {
  18329. return Body.Promise.resolve(Buffer.alloc(0));
  18330. }
  18331. // body is blob
  18332. if (isBlob(body)) {
  18333. body = body.stream();
  18334. }
  18335. // body is buffer
  18336. if (Buffer.isBuffer(body)) {
  18337. return Body.Promise.resolve(body);
  18338. }
  18339. // istanbul ignore if: should never happen
  18340. if (!(body instanceof Stream)) {
  18341. return Body.Promise.resolve(Buffer.alloc(0));
  18342. }
  18343. // body is stream
  18344. // get ready to actually consume the body
  18345. let accum = [];
  18346. let accumBytes = 0;
  18347. let abort = false;
  18348. return new Body.Promise(function (resolve, reject) {
  18349. let resTimeout;
  18350. // allow timeout on slow response body
  18351. if (_this4.timeout) {
  18352. resTimeout = setTimeout(function () {
  18353. abort = true;
  18354. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  18355. }, _this4.timeout);
  18356. }
  18357. // handle stream errors
  18358. body.on('error', function (err) {
  18359. if (err.name === 'AbortError') {
  18360. // if the request was aborted, reject with this Error
  18361. abort = true;
  18362. reject(err);
  18363. } else {
  18364. // other errors, such as incorrect content-encoding
  18365. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  18366. }
  18367. });
  18368. body.on('data', function (chunk) {
  18369. if (abort || chunk === null) {
  18370. return;
  18371. }
  18372. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  18373. abort = true;
  18374. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  18375. return;
  18376. }
  18377. accumBytes += chunk.length;
  18378. accum.push(chunk);
  18379. });
  18380. body.on('end', function () {
  18381. if (abort) {
  18382. return;
  18383. }
  18384. clearTimeout(resTimeout);
  18385. try {
  18386. resolve(Buffer.concat(accum, accumBytes));
  18387. } catch (err) {
  18388. // handle streams that have accumulated too much data (issue #414)
  18389. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  18390. }
  18391. });
  18392. });
  18393. }
  18394. /**
  18395. * Detect buffer encoding and convert to target encoding
  18396. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  18397. *
  18398. * @param Buffer buffer Incoming buffer
  18399. * @param String encoding Target encoding
  18400. * @return String
  18401. */
  18402. function convertBody(buffer, headers) {
  18403. if (typeof convert !== 'function') {
  18404. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  18405. }
  18406. const ct = headers.get('content-type');
  18407. let charset = 'utf-8';
  18408. let res, str;
  18409. // header
  18410. if (ct) {
  18411. res = /charset=([^;]*)/i.exec(ct);
  18412. }
  18413. // no charset in content type, peek at response body for at most 1024 bytes
  18414. str = buffer.slice(0, 1024).toString();
  18415. // html5
  18416. if (!res && str) {
  18417. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  18418. }
  18419. // html4
  18420. if (!res && str) {
  18421. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  18422. if (res) {
  18423. res = /charset=(.*)/i.exec(res.pop());
  18424. }
  18425. }
  18426. // xml
  18427. if (!res && str) {
  18428. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  18429. }
  18430. // found charset
  18431. if (res) {
  18432. charset = res.pop();
  18433. // prevent decode issues when sites use incorrect encoding
  18434. // ref: https://hsivonen.fi/encoding-menu/
  18435. if (charset === 'gb2312' || charset === 'gbk') {
  18436. charset = 'gb18030';
  18437. }
  18438. }
  18439. // turn raw buffers into a single utf-8 buffer
  18440. return convert(buffer, 'UTF-8', charset).toString();
  18441. }
  18442. /**
  18443. * Detect a URLSearchParams object
  18444. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  18445. *
  18446. * @param Object obj Object to detect by type or brand
  18447. * @return String
  18448. */
  18449. function isURLSearchParams(obj) {
  18450. // Duck-typing as a necessary condition.
  18451. 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') {
  18452. return false;
  18453. }
  18454. // Brand-checking and more duck-typing as optional condition.
  18455. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  18456. }
  18457. /**
  18458. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  18459. * @param {*} obj
  18460. * @return {boolean}
  18461. */
  18462. function isBlob(obj) {
  18463. 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]);
  18464. }
  18465. /**
  18466. * Clone body given Res/Req instance
  18467. *
  18468. * @param Mixed instance Response or Request instance
  18469. * @return Mixed
  18470. */
  18471. function clone(instance) {
  18472. let p1, p2;
  18473. let body = instance.body;
  18474. // don't allow cloning a used body
  18475. if (instance.bodyUsed) {
  18476. throw new Error('cannot clone body after it is used');
  18477. }
  18478. // check that body is a stream and not form-data object
  18479. // note: we can't clone the form-data object without having it as a dependency
  18480. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  18481. // tee instance body
  18482. p1 = new PassThrough();
  18483. p2 = new PassThrough();
  18484. body.pipe(p1);
  18485. body.pipe(p2);
  18486. // set instance body to teed body and return the other teed body
  18487. instance[INTERNALS].body = p1;
  18488. body = p2;
  18489. }
  18490. return body;
  18491. }
  18492. /**
  18493. * Performs the operation "extract a `Content-Type` value from |object|" as
  18494. * specified in the specification:
  18495. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  18496. *
  18497. * This function assumes that instance.body is present.
  18498. *
  18499. * @param Mixed instance Any options.body input
  18500. */
  18501. function extractContentType(body) {
  18502. if (body === null) {
  18503. // body is null
  18504. return null;
  18505. } else if (typeof body === 'string') {
  18506. // body is string
  18507. return 'text/plain;charset=UTF-8';
  18508. } else if (isURLSearchParams(body)) {
  18509. // body is a URLSearchParams
  18510. return 'application/x-www-form-urlencoded;charset=UTF-8';
  18511. } else if (isBlob(body)) {
  18512. // body is blob
  18513. return body.type || null;
  18514. } else if (Buffer.isBuffer(body)) {
  18515. // body is buffer
  18516. return null;
  18517. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  18518. // body is ArrayBuffer
  18519. return null;
  18520. } else if (ArrayBuffer.isView(body)) {
  18521. // body is ArrayBufferView
  18522. return null;
  18523. } else if (typeof body.getBoundary === 'function') {
  18524. // detect form data input from form-data module
  18525. return `multipart/form-data;boundary=${body.getBoundary()}`;
  18526. } else if (body instanceof Stream) {
  18527. // body is stream
  18528. // can't really do much about this
  18529. return null;
  18530. } else {
  18531. // Body constructor defaults other things to string
  18532. return 'text/plain;charset=UTF-8';
  18533. }
  18534. }
  18535. /**
  18536. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  18537. * For us, we have to explicitly get it with a function.
  18538. *
  18539. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  18540. *
  18541. * @param Body instance Instance of Body
  18542. * @return Number? Number of bytes, or null if not possible
  18543. */
  18544. function getTotalBytes(instance) {
  18545. const body = instance.body;
  18546. if (body === null) {
  18547. // body is null
  18548. return 0;
  18549. } else if (isBlob(body)) {
  18550. return body.size;
  18551. } else if (Buffer.isBuffer(body)) {
  18552. // body is buffer
  18553. return body.length;
  18554. } else if (body && typeof body.getLengthSync === 'function') {
  18555. // detect form data input from form-data module
  18556. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  18557. body.hasKnownLength && body.hasKnownLength()) {
  18558. // 2.x
  18559. return body.getLengthSync();
  18560. }
  18561. return null;
  18562. } else {
  18563. // body is stream
  18564. return null;
  18565. }
  18566. }
  18567. /**
  18568. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  18569. *
  18570. * @param Body instance Instance of Body
  18571. * @return Void
  18572. */
  18573. function writeToStream(dest, instance) {
  18574. const body = instance.body;
  18575. if (body === null) {
  18576. // body is null
  18577. dest.end();
  18578. } else if (isBlob(body)) {
  18579. body.stream().pipe(dest);
  18580. } else if (Buffer.isBuffer(body)) {
  18581. // body is buffer
  18582. dest.write(body);
  18583. dest.end();
  18584. } else {
  18585. // body is stream
  18586. body.pipe(dest);
  18587. }
  18588. }
  18589. // expose Promise
  18590. Body.Promise = global.Promise;
  18591. /**
  18592. * headers.js
  18593. *
  18594. * Headers class offers convenient helpers
  18595. */
  18596. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  18597. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  18598. function validateName(name) {
  18599. name = `${name}`;
  18600. if (invalidTokenRegex.test(name) || name === '') {
  18601. throw new TypeError(`${name} is not a legal HTTP header name`);
  18602. }
  18603. }
  18604. function validateValue(value) {
  18605. value = `${value}`;
  18606. if (invalidHeaderCharRegex.test(value)) {
  18607. throw new TypeError(`${value} is not a legal HTTP header value`);
  18608. }
  18609. }
  18610. /**
  18611. * Find the key in the map object given a header name.
  18612. *
  18613. * Returns undefined if not found.
  18614. *
  18615. * @param String name Header name
  18616. * @return String|Undefined
  18617. */
  18618. function find(map, name) {
  18619. name = name.toLowerCase();
  18620. for (const key in map) {
  18621. if (key.toLowerCase() === name) {
  18622. return key;
  18623. }
  18624. }
  18625. return undefined;
  18626. }
  18627. const MAP = Symbol('map');
  18628. class Headers {
  18629. /**
  18630. * Headers class
  18631. *
  18632. * @param Object headers Response headers
  18633. * @return Void
  18634. */
  18635. constructor() {
  18636. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  18637. this[MAP] = Object.create(null);
  18638. if (init instanceof Headers) {
  18639. const rawHeaders = init.raw();
  18640. const headerNames = Object.keys(rawHeaders);
  18641. for (const headerName of headerNames) {
  18642. for (const value of rawHeaders[headerName]) {
  18643. this.append(headerName, value);
  18644. }
  18645. }
  18646. return;
  18647. }
  18648. // We don't worry about converting prop to ByteString here as append()
  18649. // will handle it.
  18650. if (init == null) ; else if (typeof init === 'object') {
  18651. const method = init[Symbol.iterator];
  18652. if (method != null) {
  18653. if (typeof method !== 'function') {
  18654. throw new TypeError('Header pairs must be iterable');
  18655. }
  18656. // sequence<sequence<ByteString>>
  18657. // Note: per spec we have to first exhaust the lists then process them
  18658. const pairs = [];
  18659. for (const pair of init) {
  18660. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  18661. throw new TypeError('Each header pair must be iterable');
  18662. }
  18663. pairs.push(Array.from(pair));
  18664. }
  18665. for (const pair of pairs) {
  18666. if (pair.length !== 2) {
  18667. throw new TypeError('Each header pair must be a name/value tuple');
  18668. }
  18669. this.append(pair[0], pair[1]);
  18670. }
  18671. } else {
  18672. // record<ByteString, ByteString>
  18673. for (const key of Object.keys(init)) {
  18674. const value = init[key];
  18675. this.append(key, value);
  18676. }
  18677. }
  18678. } else {
  18679. throw new TypeError('Provided initializer must be an object');
  18680. }
  18681. }
  18682. /**
  18683. * Return combined header value given name
  18684. *
  18685. * @param String name Header name
  18686. * @return Mixed
  18687. */
  18688. get(name) {
  18689. name = `${name}`;
  18690. validateName(name);
  18691. const key = find(this[MAP], name);
  18692. if (key === undefined) {
  18693. return null;
  18694. }
  18695. return this[MAP][key].join(', ');
  18696. }
  18697. /**
  18698. * Iterate over all headers
  18699. *
  18700. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  18701. * @param Boolean thisArg `this` context for callback function
  18702. * @return Void
  18703. */
  18704. forEach(callback) {
  18705. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  18706. let pairs = getHeaders(this);
  18707. let i = 0;
  18708. while (i < pairs.length) {
  18709. var _pairs$i = pairs[i];
  18710. const name = _pairs$i[0],
  18711. value = _pairs$i[1];
  18712. callback.call(thisArg, value, name, this);
  18713. pairs = getHeaders(this);
  18714. i++;
  18715. }
  18716. }
  18717. /**
  18718. * Overwrite header values given name
  18719. *
  18720. * @param String name Header name
  18721. * @param String value Header value
  18722. * @return Void
  18723. */
  18724. set(name, value) {
  18725. name = `${name}`;
  18726. value = `${value}`;
  18727. validateName(name);
  18728. validateValue(value);
  18729. const key = find(this[MAP], name);
  18730. this[MAP][key !== undefined ? key : name] = [value];
  18731. }
  18732. /**
  18733. * Append a value onto existing header
  18734. *
  18735. * @param String name Header name
  18736. * @param String value Header value
  18737. * @return Void
  18738. */
  18739. append(name, value) {
  18740. name = `${name}`;
  18741. value = `${value}`;
  18742. validateName(name);
  18743. validateValue(value);
  18744. const key = find(this[MAP], name);
  18745. if (key !== undefined) {
  18746. this[MAP][key].push(value);
  18747. } else {
  18748. this[MAP][name] = [value];
  18749. }
  18750. }
  18751. /**
  18752. * Check for header name existence
  18753. *
  18754. * @param String name Header name
  18755. * @return Boolean
  18756. */
  18757. has(name) {
  18758. name = `${name}`;
  18759. validateName(name);
  18760. return find(this[MAP], name) !== undefined;
  18761. }
  18762. /**
  18763. * Delete all header values given name
  18764. *
  18765. * @param String name Header name
  18766. * @return Void
  18767. */
  18768. delete(name) {
  18769. name = `${name}`;
  18770. validateName(name);
  18771. const key = find(this[MAP], name);
  18772. if (key !== undefined) {
  18773. delete this[MAP][key];
  18774. }
  18775. }
  18776. /**
  18777. * Return raw headers (non-spec api)
  18778. *
  18779. * @return Object
  18780. */
  18781. raw() {
  18782. return this[MAP];
  18783. }
  18784. /**
  18785. * Get an iterator on keys.
  18786. *
  18787. * @return Iterator
  18788. */
  18789. keys() {
  18790. return createHeadersIterator(this, 'key');
  18791. }
  18792. /**
  18793. * Get an iterator on values.
  18794. *
  18795. * @return Iterator
  18796. */
  18797. values() {
  18798. return createHeadersIterator(this, 'value');
  18799. }
  18800. /**
  18801. * Get an iterator on entries.
  18802. *
  18803. * This is the default iterator of the Headers object.
  18804. *
  18805. * @return Iterator
  18806. */
  18807. [Symbol.iterator]() {
  18808. return createHeadersIterator(this, 'key+value');
  18809. }
  18810. }
  18811. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  18812. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  18813. value: 'Headers',
  18814. writable: false,
  18815. enumerable: false,
  18816. configurable: true
  18817. });
  18818. Object.defineProperties(Headers.prototype, {
  18819. get: { enumerable: true },
  18820. forEach: { enumerable: true },
  18821. set: { enumerable: true },
  18822. append: { enumerable: true },
  18823. has: { enumerable: true },
  18824. delete: { enumerable: true },
  18825. keys: { enumerable: true },
  18826. values: { enumerable: true },
  18827. entries: { enumerable: true }
  18828. });
  18829. function getHeaders(headers) {
  18830. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  18831. const keys = Object.keys(headers[MAP]).sort();
  18832. return keys.map(kind === 'key' ? function (k) {
  18833. return k.toLowerCase();
  18834. } : kind === 'value' ? function (k) {
  18835. return headers[MAP][k].join(', ');
  18836. } : function (k) {
  18837. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  18838. });
  18839. }
  18840. const INTERNAL = Symbol('internal');
  18841. function createHeadersIterator(target, kind) {
  18842. const iterator = Object.create(HeadersIteratorPrototype);
  18843. iterator[INTERNAL] = {
  18844. target,
  18845. kind,
  18846. index: 0
  18847. };
  18848. return iterator;
  18849. }
  18850. const HeadersIteratorPrototype = Object.setPrototypeOf({
  18851. next() {
  18852. // istanbul ignore if
  18853. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  18854. throw new TypeError('Value of `this` is not a HeadersIterator');
  18855. }
  18856. var _INTERNAL = this[INTERNAL];
  18857. const target = _INTERNAL.target,
  18858. kind = _INTERNAL.kind,
  18859. index = _INTERNAL.index;
  18860. const values = getHeaders(target, kind);
  18861. const len = values.length;
  18862. if (index >= len) {
  18863. return {
  18864. value: undefined,
  18865. done: true
  18866. };
  18867. }
  18868. this[INTERNAL].index = index + 1;
  18869. return {
  18870. value: values[index],
  18871. done: false
  18872. };
  18873. }
  18874. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  18875. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  18876. value: 'HeadersIterator',
  18877. writable: false,
  18878. enumerable: false,
  18879. configurable: true
  18880. });
  18881. /**
  18882. * Export the Headers object in a form that Node.js can consume.
  18883. *
  18884. * @param Headers headers
  18885. * @return Object
  18886. */
  18887. function exportNodeCompatibleHeaders(headers) {
  18888. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  18889. // http.request() only supports string as Host header. This hack makes
  18890. // specifying custom Host header possible.
  18891. const hostHeaderKey = find(headers[MAP], 'Host');
  18892. if (hostHeaderKey !== undefined) {
  18893. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  18894. }
  18895. return obj;
  18896. }
  18897. /**
  18898. * Create a Headers object from an object of headers, ignoring those that do
  18899. * not conform to HTTP grammar productions.
  18900. *
  18901. * @param Object obj Object of headers
  18902. * @return Headers
  18903. */
  18904. function createHeadersLenient(obj) {
  18905. const headers = new Headers();
  18906. for (const name of Object.keys(obj)) {
  18907. if (invalidTokenRegex.test(name)) {
  18908. continue;
  18909. }
  18910. if (Array.isArray(obj[name])) {
  18911. for (const val of obj[name]) {
  18912. if (invalidHeaderCharRegex.test(val)) {
  18913. continue;
  18914. }
  18915. if (headers[MAP][name] === undefined) {
  18916. headers[MAP][name] = [val];
  18917. } else {
  18918. headers[MAP][name].push(val);
  18919. }
  18920. }
  18921. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  18922. headers[MAP][name] = [obj[name]];
  18923. }
  18924. }
  18925. return headers;
  18926. }
  18927. const INTERNALS$1 = Symbol('Response internals');
  18928. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  18929. const STATUS_CODES = http.STATUS_CODES;
  18930. /**
  18931. * Response class
  18932. *
  18933. * @param Stream body Readable stream
  18934. * @param Object opts Response options
  18935. * @return Void
  18936. */
  18937. class Response {
  18938. constructor() {
  18939. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  18940. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18941. Body.call(this, body, opts);
  18942. const status = opts.status || 200;
  18943. const headers = new Headers(opts.headers);
  18944. if (body != null && !headers.has('Content-Type')) {
  18945. const contentType = extractContentType(body);
  18946. if (contentType) {
  18947. headers.append('Content-Type', contentType);
  18948. }
  18949. }
  18950. this[INTERNALS$1] = {
  18951. url: opts.url,
  18952. status,
  18953. statusText: opts.statusText || STATUS_CODES[status],
  18954. headers,
  18955. counter: opts.counter
  18956. };
  18957. }
  18958. get url() {
  18959. return this[INTERNALS$1].url || '';
  18960. }
  18961. get status() {
  18962. return this[INTERNALS$1].status;
  18963. }
  18964. /**
  18965. * Convenience property representing if the request ended normally
  18966. */
  18967. get ok() {
  18968. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  18969. }
  18970. get redirected() {
  18971. return this[INTERNALS$1].counter > 0;
  18972. }
  18973. get statusText() {
  18974. return this[INTERNALS$1].statusText;
  18975. }
  18976. get headers() {
  18977. return this[INTERNALS$1].headers;
  18978. }
  18979. /**
  18980. * Clone this response
  18981. *
  18982. * @return Response
  18983. */
  18984. clone() {
  18985. return new Response(clone(this), {
  18986. url: this.url,
  18987. status: this.status,
  18988. statusText: this.statusText,
  18989. headers: this.headers,
  18990. ok: this.ok,
  18991. redirected: this.redirected
  18992. });
  18993. }
  18994. }
  18995. Body.mixIn(Response.prototype);
  18996. Object.defineProperties(Response.prototype, {
  18997. url: { enumerable: true },
  18998. status: { enumerable: true },
  18999. ok: { enumerable: true },
  19000. redirected: { enumerable: true },
  19001. statusText: { enumerable: true },
  19002. headers: { enumerable: true },
  19003. clone: { enumerable: true }
  19004. });
  19005. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  19006. value: 'Response',
  19007. writable: false,
  19008. enumerable: false,
  19009. configurable: true
  19010. });
  19011. const INTERNALS$2 = Symbol('Request internals');
  19012. // fix an issue where "format", "parse" aren't a named export for node <10
  19013. const parse_url = Url.parse;
  19014. const format_url = Url.format;
  19015. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  19016. /**
  19017. * Check if a value is an instance of Request.
  19018. *
  19019. * @param Mixed input
  19020. * @return Boolean
  19021. */
  19022. function isRequest(input) {
  19023. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  19024. }
  19025. function isAbortSignal(signal) {
  19026. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  19027. return !!(proto && proto.constructor.name === 'AbortSignal');
  19028. }
  19029. /**
  19030. * Request class
  19031. *
  19032. * @param Mixed input Url or Request instance
  19033. * @param Object init Custom options
  19034. * @return Void
  19035. */
  19036. class Request {
  19037. constructor(input) {
  19038. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19039. let parsedURL;
  19040. // normalize input
  19041. if (!isRequest(input)) {
  19042. if (input && input.href) {
  19043. // in order to support Node.js' Url objects; though WHATWG's URL objects
  19044. // will fall into this branch also (since their `toString()` will return
  19045. // `href` property anyway)
  19046. parsedURL = parse_url(input.href);
  19047. } else {
  19048. // coerce input to a string before attempting to parse
  19049. parsedURL = parse_url(`${input}`);
  19050. }
  19051. input = {};
  19052. } else {
  19053. parsedURL = parse_url(input.url);
  19054. }
  19055. let method = init.method || input.method || 'GET';
  19056. method = method.toUpperCase();
  19057. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  19058. throw new TypeError('Request with GET/HEAD method cannot have body');
  19059. }
  19060. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  19061. Body.call(this, inputBody, {
  19062. timeout: init.timeout || input.timeout || 0,
  19063. size: init.size || input.size || 0
  19064. });
  19065. const headers = new Headers(init.headers || input.headers || {});
  19066. if (inputBody != null && !headers.has('Content-Type')) {
  19067. const contentType = extractContentType(inputBody);
  19068. if (contentType) {
  19069. headers.append('Content-Type', contentType);
  19070. }
  19071. }
  19072. let signal = isRequest(input) ? input.signal : null;
  19073. if ('signal' in init) signal = init.signal;
  19074. if (signal != null && !isAbortSignal(signal)) {
  19075. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  19076. }
  19077. this[INTERNALS$2] = {
  19078. method,
  19079. redirect: init.redirect || input.redirect || 'follow',
  19080. headers,
  19081. parsedURL,
  19082. signal
  19083. };
  19084. // node-fetch-only options
  19085. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  19086. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  19087. this.counter = init.counter || input.counter || 0;
  19088. this.agent = init.agent || input.agent;
  19089. }
  19090. get method() {
  19091. return this[INTERNALS$2].method;
  19092. }
  19093. get url() {
  19094. return format_url(this[INTERNALS$2].parsedURL);
  19095. }
  19096. get headers() {
  19097. return this[INTERNALS$2].headers;
  19098. }
  19099. get redirect() {
  19100. return this[INTERNALS$2].redirect;
  19101. }
  19102. get signal() {
  19103. return this[INTERNALS$2].signal;
  19104. }
  19105. /**
  19106. * Clone this request
  19107. *
  19108. * @return Request
  19109. */
  19110. clone() {
  19111. return new Request(this);
  19112. }
  19113. }
  19114. Body.mixIn(Request.prototype);
  19115. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  19116. value: 'Request',
  19117. writable: false,
  19118. enumerable: false,
  19119. configurable: true
  19120. });
  19121. Object.defineProperties(Request.prototype, {
  19122. method: { enumerable: true },
  19123. url: { enumerable: true },
  19124. headers: { enumerable: true },
  19125. redirect: { enumerable: true },
  19126. clone: { enumerable: true },
  19127. signal: { enumerable: true }
  19128. });
  19129. /**
  19130. * Convert a Request to Node.js http request options.
  19131. *
  19132. * @param Request A Request instance
  19133. * @return Object The options object to be passed to http.request
  19134. */
  19135. function getNodeRequestOptions(request) {
  19136. const parsedURL = request[INTERNALS$2].parsedURL;
  19137. const headers = new Headers(request[INTERNALS$2].headers);
  19138. // fetch step 1.3
  19139. if (!headers.has('Accept')) {
  19140. headers.set('Accept', '*/*');
  19141. }
  19142. // Basic fetch
  19143. if (!parsedURL.protocol || !parsedURL.hostname) {
  19144. throw new TypeError('Only absolute URLs are supported');
  19145. }
  19146. if (!/^https?:$/.test(parsedURL.protocol)) {
  19147. throw new TypeError('Only HTTP(S) protocols are supported');
  19148. }
  19149. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  19150. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  19151. }
  19152. // HTTP-network-or-cache fetch steps 2.4-2.7
  19153. let contentLengthValue = null;
  19154. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  19155. contentLengthValue = '0';
  19156. }
  19157. if (request.body != null) {
  19158. const totalBytes = getTotalBytes(request);
  19159. if (typeof totalBytes === 'number') {
  19160. contentLengthValue = String(totalBytes);
  19161. }
  19162. }
  19163. if (contentLengthValue) {
  19164. headers.set('Content-Length', contentLengthValue);
  19165. }
  19166. // HTTP-network-or-cache fetch step 2.11
  19167. if (!headers.has('User-Agent')) {
  19168. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  19169. }
  19170. // HTTP-network-or-cache fetch step 2.15
  19171. if (request.compress && !headers.has('Accept-Encoding')) {
  19172. headers.set('Accept-Encoding', 'gzip,deflate');
  19173. }
  19174. let agent = request.agent;
  19175. if (typeof agent === 'function') {
  19176. agent = agent(parsedURL);
  19177. }
  19178. if (!headers.has('Connection') && !agent) {
  19179. headers.set('Connection', 'close');
  19180. }
  19181. // HTTP-network fetch step 4.2
  19182. // chunked encoding is handled by Node.js
  19183. return Object.assign({}, parsedURL, {
  19184. method: request.method,
  19185. headers: exportNodeCompatibleHeaders(headers),
  19186. agent
  19187. });
  19188. }
  19189. /**
  19190. * abort-error.js
  19191. *
  19192. * AbortError interface for cancelled requests
  19193. */
  19194. /**
  19195. * Create AbortError instance
  19196. *
  19197. * @param String message Error message for human
  19198. * @return AbortError
  19199. */
  19200. function AbortError(message) {
  19201. Error.call(this, message);
  19202. this.type = 'aborted';
  19203. this.message = message;
  19204. // hide custom error implementation details from end-users
  19205. Error.captureStackTrace(this, this.constructor);
  19206. }
  19207. AbortError.prototype = Object.create(Error.prototype);
  19208. AbortError.prototype.constructor = AbortError;
  19209. AbortError.prototype.name = 'AbortError';
  19210. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  19211. const PassThrough$1 = Stream.PassThrough;
  19212. const resolve_url = Url.resolve;
  19213. /**
  19214. * Fetch function
  19215. *
  19216. * @param Mixed url Absolute url or Request instance
  19217. * @param Object opts Fetch options
  19218. * @return Promise
  19219. */
  19220. function fetch(url, opts) {
  19221. // allow custom promise
  19222. if (!fetch.Promise) {
  19223. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  19224. }
  19225. Body.Promise = fetch.Promise;
  19226. // wrap http.request into fetch
  19227. return new fetch.Promise(function (resolve, reject) {
  19228. // build request object
  19229. const request = new Request(url, opts);
  19230. const options = getNodeRequestOptions(request);
  19231. const send = (options.protocol === 'https:' ? https : http).request;
  19232. const signal = request.signal;
  19233. let response = null;
  19234. const abort = function abort() {
  19235. let error = new AbortError('The user aborted a request.');
  19236. reject(error);
  19237. if (request.body && request.body instanceof Stream.Readable) {
  19238. request.body.destroy(error);
  19239. }
  19240. if (!response || !response.body) return;
  19241. response.body.emit('error', error);
  19242. };
  19243. if (signal && signal.aborted) {
  19244. abort();
  19245. return;
  19246. }
  19247. const abortAndFinalize = function abortAndFinalize() {
  19248. abort();
  19249. finalize();
  19250. };
  19251. // send request
  19252. const req = send(options);
  19253. let reqTimeout;
  19254. if (signal) {
  19255. signal.addEventListener('abort', abortAndFinalize);
  19256. }
  19257. function finalize() {
  19258. req.abort();
  19259. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  19260. clearTimeout(reqTimeout);
  19261. }
  19262. if (request.timeout) {
  19263. req.once('socket', function (socket) {
  19264. reqTimeout = setTimeout(function () {
  19265. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  19266. finalize();
  19267. }, request.timeout);
  19268. });
  19269. }
  19270. req.on('error', function (err) {
  19271. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  19272. finalize();
  19273. });
  19274. req.on('response', function (res) {
  19275. clearTimeout(reqTimeout);
  19276. const headers = createHeadersLenient(res.headers);
  19277. // HTTP fetch step 5
  19278. if (fetch.isRedirect(res.statusCode)) {
  19279. // HTTP fetch step 5.2
  19280. const location = headers.get('Location');
  19281. // HTTP fetch step 5.3
  19282. const locationURL = location === null ? null : resolve_url(request.url, location);
  19283. // HTTP fetch step 5.5
  19284. switch (request.redirect) {
  19285. case 'error':
  19286. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  19287. finalize();
  19288. return;
  19289. case 'manual':
  19290. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  19291. if (locationURL !== null) {
  19292. // handle corrupted header
  19293. try {
  19294. headers.set('Location', locationURL);
  19295. } catch (err) {
  19296. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  19297. reject(err);
  19298. }
  19299. }
  19300. break;
  19301. case 'follow':
  19302. // HTTP-redirect fetch step 2
  19303. if (locationURL === null) {
  19304. break;
  19305. }
  19306. // HTTP-redirect fetch step 5
  19307. if (request.counter >= request.follow) {
  19308. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  19309. finalize();
  19310. return;
  19311. }
  19312. // HTTP-redirect fetch step 6 (counter increment)
  19313. // Create a new Request object.
  19314. const requestOpts = {
  19315. headers: new Headers(request.headers),
  19316. follow: request.follow,
  19317. counter: request.counter + 1,
  19318. agent: request.agent,
  19319. compress: request.compress,
  19320. method: request.method,
  19321. body: request.body,
  19322. signal: request.signal,
  19323. timeout: request.timeout
  19324. };
  19325. // HTTP-redirect fetch step 9
  19326. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  19327. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  19328. finalize();
  19329. return;
  19330. }
  19331. // HTTP-redirect fetch step 11
  19332. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  19333. requestOpts.method = 'GET';
  19334. requestOpts.body = undefined;
  19335. requestOpts.headers.delete('content-length');
  19336. }
  19337. // HTTP-redirect fetch step 15
  19338. resolve(fetch(new Request(locationURL, requestOpts)));
  19339. finalize();
  19340. return;
  19341. }
  19342. }
  19343. // prepare response
  19344. res.once('end', function () {
  19345. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  19346. });
  19347. let body = res.pipe(new PassThrough$1());
  19348. const response_options = {
  19349. url: request.url,
  19350. status: res.statusCode,
  19351. statusText: res.statusMessage,
  19352. headers: headers,
  19353. size: request.size,
  19354. timeout: request.timeout,
  19355. counter: request.counter
  19356. };
  19357. // HTTP-network fetch step 12.1.1.3
  19358. const codings = headers.get('Content-Encoding');
  19359. // HTTP-network fetch step 12.1.1.4: handle content codings
  19360. // in following scenarios we ignore compression support
  19361. // 1. compression support is disabled
  19362. // 2. HEAD request
  19363. // 3. no Content-Encoding header
  19364. // 4. no content response (204)
  19365. // 5. content not modified response (304)
  19366. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  19367. response = new Response(body, response_options);
  19368. resolve(response);
  19369. return;
  19370. }
  19371. // For Node v6+
  19372. // Be less strict when decoding compressed responses, since sometimes
  19373. // servers send slightly invalid responses that are still accepted
  19374. // by common browsers.
  19375. // Always using Z_SYNC_FLUSH is what cURL does.
  19376. const zlibOptions = {
  19377. flush: zlib.Z_SYNC_FLUSH,
  19378. finishFlush: zlib.Z_SYNC_FLUSH
  19379. };
  19380. // for gzip
  19381. if (codings == 'gzip' || codings == 'x-gzip') {
  19382. body = body.pipe(zlib.createGunzip(zlibOptions));
  19383. response = new Response(body, response_options);
  19384. resolve(response);
  19385. return;
  19386. }
  19387. // for deflate
  19388. if (codings == 'deflate' || codings == 'x-deflate') {
  19389. // handle the infamous raw deflate response from old servers
  19390. // a hack for old IIS and Apache servers
  19391. const raw = res.pipe(new PassThrough$1());
  19392. raw.once('data', function (chunk) {
  19393. // see http://stackoverflow.com/questions/37519828
  19394. if ((chunk[0] & 0x0F) === 0x08) {
  19395. body = body.pipe(zlib.createInflate());
  19396. } else {
  19397. body = body.pipe(zlib.createInflateRaw());
  19398. }
  19399. response = new Response(body, response_options);
  19400. resolve(response);
  19401. });
  19402. return;
  19403. }
  19404. // for br
  19405. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  19406. body = body.pipe(zlib.createBrotliDecompress());
  19407. response = new Response(body, response_options);
  19408. resolve(response);
  19409. return;
  19410. }
  19411. // otherwise, use response as-is
  19412. response = new Response(body, response_options);
  19413. resolve(response);
  19414. });
  19415. writeToStream(req, request);
  19416. });
  19417. }
  19418. /**
  19419. * Redirect code matching
  19420. *
  19421. * @param Number code Status code
  19422. * @return Boolean
  19423. */
  19424. fetch.isRedirect = function (code) {
  19425. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  19426. };
  19427. // expose Promise
  19428. fetch.Promise = global.Promise;
  19429. module.exports = exports = fetch;
  19430. Object.defineProperty(exports, "__esModule", { value: true });
  19431. exports.default = exports;
  19432. exports.Headers = Headers;
  19433. exports.Request = Request;
  19434. exports.Response = Response;
  19435. exports.FetchError = FetchError;
  19436. /***/ }),
  19437. /***/ 436:
  19438. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  19439. "use strict";
  19440. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  19441. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  19442. return new (P || (P = Promise))(function (resolve, reject) {
  19443. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  19444. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  19445. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  19446. step((generator = generator.apply(thisArg, _arguments || [])).next());
  19447. });
  19448. };
  19449. Object.defineProperty(exports, "__esModule", { value: true });
  19450. const childProcess = __webpack_require__(129);
  19451. const path = __webpack_require__(622);
  19452. const util_1 = __webpack_require__(669);
  19453. const ioUtil = __webpack_require__(962);
  19454. const exec = util_1.promisify(childProcess.exec);
  19455. /**
  19456. * Copies a file or folder.
  19457. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  19458. *
  19459. * @param source source path
  19460. * @param dest destination path
  19461. * @param options optional. See CopyOptions.
  19462. */
  19463. function cp(source, dest, options = {}) {
  19464. return __awaiter(this, void 0, void 0, function* () {
  19465. const { force, recursive } = readCopyOptions(options);
  19466. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  19467. // Dest is an existing file, but not forcing
  19468. if (destStat && destStat.isFile() && !force) {
  19469. return;
  19470. }
  19471. // If dest is an existing directory, should copy inside.
  19472. const newDest = destStat && destStat.isDirectory()
  19473. ? path.join(dest, path.basename(source))
  19474. : dest;
  19475. if (!(yield ioUtil.exists(source))) {
  19476. throw new Error(`no such file or directory: ${source}`);
  19477. }
  19478. const sourceStat = yield ioUtil.stat(source);
  19479. if (sourceStat.isDirectory()) {
  19480. if (!recursive) {
  19481. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  19482. }
  19483. else {
  19484. yield cpDirRecursive(source, newDest, 0, force);
  19485. }
  19486. }
  19487. else {
  19488. if (path.relative(source, newDest) === '') {
  19489. // a file cannot be copied to itself
  19490. throw new Error(`'${newDest}' and '${source}' are the same file`);
  19491. }
  19492. yield copyFile(source, newDest, force);
  19493. }
  19494. });
  19495. }
  19496. exports.cp = cp;
  19497. /**
  19498. * Moves a path.
  19499. *
  19500. * @param source source path
  19501. * @param dest destination path
  19502. * @param options optional. See MoveOptions.
  19503. */
  19504. function mv(source, dest, options = {}) {
  19505. return __awaiter(this, void 0, void 0, function* () {
  19506. if (yield ioUtil.exists(dest)) {
  19507. let destExists = true;
  19508. if (yield ioUtil.isDirectory(dest)) {
  19509. // If dest is directory copy src into dest
  19510. dest = path.join(dest, path.basename(source));
  19511. destExists = yield ioUtil.exists(dest);
  19512. }
  19513. if (destExists) {
  19514. if (options.force == null || options.force) {
  19515. yield rmRF(dest);
  19516. }
  19517. else {
  19518. throw new Error('Destination already exists');
  19519. }
  19520. }
  19521. }
  19522. yield mkdirP(path.dirname(dest));
  19523. yield ioUtil.rename(source, dest);
  19524. });
  19525. }
  19526. exports.mv = mv;
  19527. /**
  19528. * Remove a path recursively with force
  19529. *
  19530. * @param inputPath path to remove
  19531. */
  19532. function rmRF(inputPath) {
  19533. return __awaiter(this, void 0, void 0, function* () {
  19534. if (ioUtil.IS_WINDOWS) {
  19535. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  19536. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  19537. try {
  19538. if (yield ioUtil.isDirectory(inputPath, true)) {
  19539. yield exec(`rd /s /q "${inputPath}"`);
  19540. }
  19541. else {
  19542. yield exec(`del /f /a "${inputPath}"`);
  19543. }
  19544. }
  19545. catch (err) {
  19546. // if you try to delete a file that doesn't exist, desired result is achieved
  19547. // other errors are valid
  19548. if (err.code !== 'ENOENT')
  19549. throw err;
  19550. }
  19551. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  19552. try {
  19553. yield ioUtil.unlink(inputPath);
  19554. }
  19555. catch (err) {
  19556. // if you try to delete a file that doesn't exist, desired result is achieved
  19557. // other errors are valid
  19558. if (err.code !== 'ENOENT')
  19559. throw err;
  19560. }
  19561. }
  19562. else {
  19563. let isDir = false;
  19564. try {
  19565. isDir = yield ioUtil.isDirectory(inputPath);
  19566. }
  19567. catch (err) {
  19568. // if you try to delete a file that doesn't exist, desired result is achieved
  19569. // other errors are valid
  19570. if (err.code !== 'ENOENT')
  19571. throw err;
  19572. return;
  19573. }
  19574. if (isDir) {
  19575. yield exec(`rm -rf "${inputPath}"`);
  19576. }
  19577. else {
  19578. yield ioUtil.unlink(inputPath);
  19579. }
  19580. }
  19581. });
  19582. }
  19583. exports.rmRF = rmRF;
  19584. /**
  19585. * Make a directory. Creates the full path with folders in between
  19586. * Will throw if it fails
  19587. *
  19588. * @param fsPath path to create
  19589. * @returns Promise<void>
  19590. */
  19591. function mkdirP(fsPath) {
  19592. return __awaiter(this, void 0, void 0, function* () {
  19593. yield ioUtil.mkdirP(fsPath);
  19594. });
  19595. }
  19596. exports.mkdirP = mkdirP;
  19597. /**
  19598. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  19599. * If you check and the tool does not exist, it will throw.
  19600. *
  19601. * @param tool name of the tool
  19602. * @param check whether to check if tool exists
  19603. * @returns Promise<string> path to tool
  19604. */
  19605. function which(tool, check) {
  19606. return __awaiter(this, void 0, void 0, function* () {
  19607. if (!tool) {
  19608. throw new Error("parameter 'tool' is required");
  19609. }
  19610. // recursive when check=true
  19611. if (check) {
  19612. const result = yield which(tool, false);
  19613. if (!result) {
  19614. if (ioUtil.IS_WINDOWS) {
  19615. 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.`);
  19616. }
  19617. else {
  19618. 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.`);
  19619. }
  19620. }
  19621. }
  19622. try {
  19623. // build the list of extensions to try
  19624. const extensions = [];
  19625. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  19626. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  19627. if (extension) {
  19628. extensions.push(extension);
  19629. }
  19630. }
  19631. }
  19632. // if it's rooted, return it if exists. otherwise return empty.
  19633. if (ioUtil.isRooted(tool)) {
  19634. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  19635. if (filePath) {
  19636. return filePath;
  19637. }
  19638. return '';
  19639. }
  19640. // if any path separators, return empty
  19641. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  19642. return '';
  19643. }
  19644. // build the list of directories
  19645. //
  19646. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  19647. // it feels like we should not do this. Checking the current directory seems like more of a use
  19648. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  19649. // across platforms.
  19650. const directories = [];
  19651. if (process.env.PATH) {
  19652. for (const p of process.env.PATH.split(path.delimiter)) {
  19653. if (p) {
  19654. directories.push(p);
  19655. }
  19656. }
  19657. }
  19658. // return the first match
  19659. for (const directory of directories) {
  19660. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  19661. if (filePath) {
  19662. return filePath;
  19663. }
  19664. }
  19665. return '';
  19666. }
  19667. catch (err) {
  19668. throw new Error(`which failed with message ${err.message}`);
  19669. }
  19670. });
  19671. }
  19672. exports.which = which;
  19673. function readCopyOptions(options) {
  19674. const force = options.force == null ? true : options.force;
  19675. const recursive = Boolean(options.recursive);
  19676. return { force, recursive };
  19677. }
  19678. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  19679. return __awaiter(this, void 0, void 0, function* () {
  19680. // Ensure there is not a run away recursive copy
  19681. if (currentDepth >= 255)
  19682. return;
  19683. currentDepth++;
  19684. yield mkdirP(destDir);
  19685. const files = yield ioUtil.readdir(sourceDir);
  19686. for (const fileName of files) {
  19687. const srcFile = `${sourceDir}/${fileName}`;
  19688. const destFile = `${destDir}/${fileName}`;
  19689. const srcFileStat = yield ioUtil.lstat(srcFile);
  19690. if (srcFileStat.isDirectory()) {
  19691. // Recurse
  19692. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  19693. }
  19694. else {
  19695. yield copyFile(srcFile, destFile, force);
  19696. }
  19697. }
  19698. // Change the mode for the newly created directory
  19699. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  19700. });
  19701. }
  19702. // Buffered file copy
  19703. function copyFile(srcFile, destFile, force) {
  19704. return __awaiter(this, void 0, void 0, function* () {
  19705. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  19706. // unlink/re-link it
  19707. try {
  19708. yield ioUtil.lstat(destFile);
  19709. yield ioUtil.unlink(destFile);
  19710. }
  19711. catch (e) {
  19712. // Try to override file permission
  19713. if (e.code === 'EPERM') {
  19714. yield ioUtil.chmod(destFile, '0666');
  19715. yield ioUtil.unlink(destFile);
  19716. }
  19717. // other errors = it doesn't exist, no work to do
  19718. }
  19719. // Copy over symlink
  19720. const symlinkFull = yield ioUtil.readlink(srcFile);
  19721. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  19722. }
  19723. else if (!(yield ioUtil.exists(destFile)) || force) {
  19724. yield ioUtil.copyFile(srcFile, destFile);
  19725. }
  19726. });
  19727. }
  19728. //# sourceMappingURL=io.js.map
  19729. /***/ }),
  19730. /***/ 437:
  19731. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  19732. "use strict";
  19733. var __importStar = (this && this.__importStar) || function (mod) {
  19734. if (mod && mod.__esModule) return mod;
  19735. var result = {};
  19736. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  19737. result["default"] = mod;
  19738. return result;
  19739. };
  19740. Object.defineProperty(exports, "__esModule", { value: true });
  19741. const assert = __importStar(__webpack_require__(357));
  19742. const url_1 = __webpack_require__(835);
  19743. function getFetchUrl(settings) {
  19744. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  19745. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  19746. const serviceUrl = getServerUrl();
  19747. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  19748. const encodedName = encodeURIComponent(settings.repositoryName);
  19749. if (settings.sshKey) {
  19750. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  19751. }
  19752. // "origin" is SCHEME://HOSTNAME[:PORT]
  19753. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  19754. }
  19755. exports.getFetchUrl = getFetchUrl;
  19756. function getServerUrl() {
  19757. // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  19758. return new url_1.URL(process.env['GITHUB_SERVER_URL'] ||
  19759. process.env['GITHUB_URL'] ||
  19760. 'https://github.com');
  19761. }
  19762. exports.getServerUrl = getServerUrl;
  19763. /***/ }),
  19764. /***/ 438:
  19765. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  19766. "use strict";
  19767. var __importStar = (this && this.__importStar) || function (mod) {
  19768. if (mod && mod.__esModule) return mod;
  19769. var result = {};
  19770. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  19771. result["default"] = mod;
  19772. return result;
  19773. };
  19774. Object.defineProperty(exports, "__esModule", { value: true });
  19775. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  19776. const graphql_1 = __webpack_require__(467);
  19777. const rest_1 = __webpack_require__(928);
  19778. const Context = __importStar(__webpack_require__(53));
  19779. const httpClient = __importStar(__webpack_require__(925));
  19780. // We need this in order to extend Octokit
  19781. rest_1.Octokit.prototype = new rest_1.Octokit();
  19782. exports.context = new Context.Context();
  19783. class GitHub extends rest_1.Octokit {
  19784. constructor(token, opts) {
  19785. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  19786. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  19787. }
  19788. /**
  19789. * Disambiguates the constructor overload parameters
  19790. */
  19791. static disambiguate(token, opts) {
  19792. return [
  19793. typeof token === 'string' ? token : '',
  19794. typeof token === 'object' ? token : opts || {}
  19795. ];
  19796. }
  19797. static getOctokitOptions(args) {
  19798. const token = args[0];
  19799. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  19800. // Base URL - GHES or Dotcom
  19801. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  19802. // Auth
  19803. const auth = GitHub.getAuthString(token, options);
  19804. if (auth) {
  19805. options.auth = auth;
  19806. }
  19807. // Proxy
  19808. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  19809. if (agent) {
  19810. // Shallow clone - don't mutate the object provided by the caller
  19811. options.request = options.request ? Object.assign({}, options.request) : {};
  19812. // Set the agent
  19813. options.request.agent = agent;
  19814. }
  19815. return options;
  19816. }
  19817. static getGraphQL(args) {
  19818. const defaults = {};
  19819. defaults.baseUrl = this.getGraphQLBaseUrl();
  19820. const token = args[0];
  19821. const options = args[1];
  19822. // Authorization
  19823. const auth = this.getAuthString(token, options);
  19824. if (auth) {
  19825. defaults.headers = {
  19826. authorization: auth
  19827. };
  19828. }
  19829. // Proxy
  19830. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  19831. if (agent) {
  19832. defaults.request = { agent };
  19833. }
  19834. return graphql_1.graphql.defaults(defaults);
  19835. }
  19836. static getAuthString(token, options) {
  19837. // Validate args
  19838. if (!token && !options.auth) {
  19839. throw new Error('Parameter token or opts.auth is required');
  19840. }
  19841. else if (token && options.auth) {
  19842. throw new Error('Parameters token and opts.auth may not both be specified');
  19843. }
  19844. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  19845. }
  19846. static getProxyAgent(destinationUrl, options) {
  19847. var _a;
  19848. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  19849. if (httpClient.getProxyUrl(destinationUrl)) {
  19850. const hc = new httpClient.HttpClient();
  19851. return hc.getAgent(destinationUrl);
  19852. }
  19853. }
  19854. return undefined;
  19855. }
  19856. static getApiBaseUrl() {
  19857. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  19858. }
  19859. static getGraphQLBaseUrl() {
  19860. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  19861. // Shouldn't be a trailing slash, but remove if so
  19862. if (url.endsWith('/')) {
  19863. url = url.substr(0, url.length - 1);
  19864. }
  19865. // Remove trailing "/graphql"
  19866. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  19867. url = url.substr(0, url.length - '/graphql'.length);
  19868. }
  19869. return url;
  19870. }
  19871. }
  19872. exports.GitHub = GitHub;
  19873. //# sourceMappingURL=github.js.map
  19874. /***/ }),
  19875. /***/ 440:
  19876. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  19877. "use strict";
  19878. Object.defineProperty(exports, '__esModule', { value: true });
  19879. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  19880. var isPlainObject = _interopDefault(__webpack_require__(840));
  19881. var universalUserAgent = __webpack_require__(292);
  19882. function lowercaseKeys(object) {
  19883. if (!object) {
  19884. return {};
  19885. }
  19886. return Object.keys(object).reduce((newObj, key) => {
  19887. newObj[key.toLowerCase()] = object[key];
  19888. return newObj;
  19889. }, {});
  19890. }
  19891. function mergeDeep(defaults, options) {
  19892. const result = Object.assign({}, defaults);
  19893. Object.keys(options).forEach(key => {
  19894. if (isPlainObject(options[key])) {
  19895. if (!(key in defaults)) Object.assign(result, {
  19896. [key]: options[key]
  19897. });else result[key] = mergeDeep(defaults[key], options[key]);
  19898. } else {
  19899. Object.assign(result, {
  19900. [key]: options[key]
  19901. });
  19902. }
  19903. });
  19904. return result;
  19905. }
  19906. function merge(defaults, route, options) {
  19907. if (typeof route === "string") {
  19908. let [method, url] = route.split(" ");
  19909. options = Object.assign(url ? {
  19910. method,
  19911. url
  19912. } : {
  19913. url: method
  19914. }, options);
  19915. } else {
  19916. options = Object.assign({}, route);
  19917. } // lowercase header names before merging with defaults to avoid duplicates
  19918. options.headers = lowercaseKeys(options.headers);
  19919. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  19920. if (defaults && defaults.mediaType.previews.length) {
  19921. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  19922. }
  19923. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  19924. return mergedOptions;
  19925. }
  19926. function addQueryParameters(url, parameters) {
  19927. const separator = /\?/.test(url) ? "&" : "?";
  19928. const names = Object.keys(parameters);
  19929. if (names.length === 0) {
  19930. return url;
  19931. }
  19932. return url + separator + names.map(name => {
  19933. if (name === "q") {
  19934. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  19935. }
  19936. return `${name}=${encodeURIComponent(parameters[name])}`;
  19937. }).join("&");
  19938. }
  19939. const urlVariableRegex = /\{[^}]+\}/g;
  19940. function removeNonChars(variableName) {
  19941. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  19942. }
  19943. function extractUrlVariableNames(url) {
  19944. const matches = url.match(urlVariableRegex);
  19945. if (!matches) {
  19946. return [];
  19947. }
  19948. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  19949. }
  19950. function omit(object, keysToOmit) {
  19951. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  19952. obj[key] = object[key];
  19953. return obj;
  19954. }, {});
  19955. }
  19956. // Based on https://github.com/bramstein/url-template, licensed under BSD
  19957. // TODO: create separate package.
  19958. //
  19959. // Copyright (c) 2012-2014, Bram Stein
  19960. // All rights reserved.
  19961. // Redistribution and use in source and binary forms, with or without
  19962. // modification, are permitted provided that the following conditions
  19963. // are met:
  19964. // 1. Redistributions of source code must retain the above copyright
  19965. // notice, this list of conditions and the following disclaimer.
  19966. // 2. Redistributions in binary form must reproduce the above copyright
  19967. // notice, this list of conditions and the following disclaimer in the
  19968. // documentation and/or other materials provided with the distribution.
  19969. // 3. The name of the author may not be used to endorse or promote products
  19970. // derived from this software without specific prior written permission.
  19971. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  19972. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19973. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19974. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  19975. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  19976. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  19977. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  19978. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  19979. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  19980. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  19981. /* istanbul ignore file */
  19982. function encodeReserved(str) {
  19983. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  19984. if (!/%[0-9A-Fa-f]/.test(part)) {
  19985. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  19986. }
  19987. return part;
  19988. }).join("");
  19989. }
  19990. function encodeUnreserved(str) {
  19991. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  19992. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  19993. });
  19994. }
  19995. function encodeValue(operator, value, key) {
  19996. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  19997. if (key) {
  19998. return encodeUnreserved(key) + "=" + value;
  19999. } else {
  20000. return value;
  20001. }
  20002. }
  20003. function isDefined(value) {
  20004. return value !== undefined && value !== null;
  20005. }
  20006. function isKeyOperator(operator) {
  20007. return operator === ";" || operator === "&" || operator === "?";
  20008. }
  20009. function getValues(context, operator, key, modifier) {
  20010. var value = context[key],
  20011. result = [];
  20012. if (isDefined(value) && value !== "") {
  20013. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  20014. value = value.toString();
  20015. if (modifier && modifier !== "*") {
  20016. value = value.substring(0, parseInt(modifier, 10));
  20017. }
  20018. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  20019. } else {
  20020. if (modifier === "*") {
  20021. if (Array.isArray(value)) {
  20022. value.filter(isDefined).forEach(function (value) {
  20023. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  20024. });
  20025. } else {
  20026. Object.keys(value).forEach(function (k) {
  20027. if (isDefined(value[k])) {
  20028. result.push(encodeValue(operator, value[k], k));
  20029. }
  20030. });
  20031. }
  20032. } else {
  20033. const tmp = [];
  20034. if (Array.isArray(value)) {
  20035. value.filter(isDefined).forEach(function (value) {
  20036. tmp.push(encodeValue(operator, value));
  20037. });
  20038. } else {
  20039. Object.keys(value).forEach(function (k) {
  20040. if (isDefined(value[k])) {
  20041. tmp.push(encodeUnreserved(k));
  20042. tmp.push(encodeValue(operator, value[k].toString()));
  20043. }
  20044. });
  20045. }
  20046. if (isKeyOperator(operator)) {
  20047. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  20048. } else if (tmp.length !== 0) {
  20049. result.push(tmp.join(","));
  20050. }
  20051. }
  20052. }
  20053. } else {
  20054. if (operator === ";") {
  20055. if (isDefined(value)) {
  20056. result.push(encodeUnreserved(key));
  20057. }
  20058. } else if (value === "" && (operator === "&" || operator === "?")) {
  20059. result.push(encodeUnreserved(key) + "=");
  20060. } else if (value === "") {
  20061. result.push("");
  20062. }
  20063. }
  20064. return result;
  20065. }
  20066. function parseUrl(template) {
  20067. return {
  20068. expand: expand.bind(null, template)
  20069. };
  20070. }
  20071. function expand(template, context) {
  20072. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  20073. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  20074. if (expression) {
  20075. let operator = "";
  20076. const values = [];
  20077. if (operators.indexOf(expression.charAt(0)) !== -1) {
  20078. operator = expression.charAt(0);
  20079. expression = expression.substr(1);
  20080. }
  20081. expression.split(/,/g).forEach(function (variable) {
  20082. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  20083. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  20084. });
  20085. if (operator && operator !== "+") {
  20086. var separator = ",";
  20087. if (operator === "?") {
  20088. separator = "&";
  20089. } else if (operator !== "#") {
  20090. separator = operator;
  20091. }
  20092. return (values.length !== 0 ? operator : "") + values.join(separator);
  20093. } else {
  20094. return values.join(",");
  20095. }
  20096. } else {
  20097. return encodeReserved(literal);
  20098. }
  20099. });
  20100. }
  20101. function parse(options) {
  20102. // https://fetch.spec.whatwg.org/#methods
  20103. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  20104. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  20105. let headers = Object.assign({}, options.headers);
  20106. let body;
  20107. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  20108. const urlVariableNames = extractUrlVariableNames(url);
  20109. url = parseUrl(url).expand(parameters);
  20110. if (!/^http/.test(url)) {
  20111. url = options.baseUrl + url;
  20112. }
  20113. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  20114. const remainingParameters = omit(parameters, omittedParameters);
  20115. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  20116. if (!isBinaryRequset) {
  20117. if (options.mediaType.format) {
  20118. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  20119. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  20120. }
  20121. if (options.mediaType.previews.length) {
  20122. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  20123. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  20124. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  20125. return `application/vnd.github.${preview}-preview${format}`;
  20126. }).join(",");
  20127. }
  20128. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  20129. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  20130. if (["GET", "HEAD"].includes(method)) {
  20131. url = addQueryParameters(url, remainingParameters);
  20132. } else {
  20133. if ("data" in remainingParameters) {
  20134. body = remainingParameters.data;
  20135. } else {
  20136. if (Object.keys(remainingParameters).length) {
  20137. body = remainingParameters;
  20138. } else {
  20139. headers["content-length"] = 0;
  20140. }
  20141. }
  20142. } // default content-type for JSON if body is set
  20143. if (!headers["content-type"] && typeof body !== "undefined") {
  20144. headers["content-type"] = "application/json; charset=utf-8";
  20145. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  20146. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  20147. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  20148. body = "";
  20149. } // Only return body/request keys if present
  20150. return Object.assign({
  20151. method,
  20152. url,
  20153. headers
  20154. }, typeof body !== "undefined" ? {
  20155. body
  20156. } : null, options.request ? {
  20157. request: options.request
  20158. } : null);
  20159. }
  20160. function endpointWithDefaults(defaults, route, options) {
  20161. return parse(merge(defaults, route, options));
  20162. }
  20163. function withDefaults(oldDefaults, newDefaults) {
  20164. const DEFAULTS = merge(oldDefaults, newDefaults);
  20165. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  20166. return Object.assign(endpoint, {
  20167. DEFAULTS,
  20168. defaults: withDefaults.bind(null, DEFAULTS),
  20169. merge: merge.bind(null, DEFAULTS),
  20170. parse
  20171. });
  20172. }
  20173. const VERSION = "6.0.1";
  20174. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  20175. // So we use RequestParameters and add method as additional required property.
  20176. const DEFAULTS = {
  20177. method: "GET",
  20178. baseUrl: "https://api.github.com",
  20179. headers: {
  20180. accept: "application/vnd.github.v3+json",
  20181. "user-agent": userAgent
  20182. },
  20183. mediaType: {
  20184. format: "",
  20185. previews: []
  20186. }
  20187. };
  20188. const endpoint = withDefaults(null, DEFAULTS);
  20189. exports.endpoint = endpoint;
  20190. //# sourceMappingURL=index.js.map
  20191. /***/ }),
  20192. /***/ 441:
  20193. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20194. "use strict";
  20195. Object.defineProperty(exports, '__esModule', { value: true });
  20196. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  20197. var osName = _interopDefault(__webpack_require__(760));
  20198. function getUserAgent() {
  20199. try {
  20200. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  20201. } catch (error) {
  20202. if (/wmic os get Caption/.test(error.message)) {
  20203. return "Windows <version undetectable>";
  20204. }
  20205. return "<environment undetectable>";
  20206. }
  20207. }
  20208. exports.getUserAgent = getUserAgent;
  20209. //# sourceMappingURL=index.js.map
  20210. /***/ }),
  20211. /***/ 443:
  20212. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20213. "use strict";
  20214. Object.defineProperty(exports, "__esModule", { value: true });
  20215. const url = __webpack_require__(835);
  20216. function getProxyUrl(reqUrl) {
  20217. let usingSsl = reqUrl.protocol === 'https:';
  20218. let proxyUrl;
  20219. if (checkBypass(reqUrl)) {
  20220. return proxyUrl;
  20221. }
  20222. let proxyVar;
  20223. if (usingSsl) {
  20224. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  20225. }
  20226. else {
  20227. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  20228. }
  20229. if (proxyVar) {
  20230. proxyUrl = url.parse(proxyVar);
  20231. }
  20232. return proxyUrl;
  20233. }
  20234. exports.getProxyUrl = getProxyUrl;
  20235. function checkBypass(reqUrl) {
  20236. if (!reqUrl.hostname) {
  20237. return false;
  20238. }
  20239. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  20240. if (!noProxy) {
  20241. return false;
  20242. }
  20243. // Determine the request port
  20244. let reqPort;
  20245. if (reqUrl.port) {
  20246. reqPort = Number(reqUrl.port);
  20247. }
  20248. else if (reqUrl.protocol === 'http:') {
  20249. reqPort = 80;
  20250. }
  20251. else if (reqUrl.protocol === 'https:') {
  20252. reqPort = 443;
  20253. }
  20254. // Format the request hostname and hostname with port
  20255. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  20256. if (typeof reqPort === 'number') {
  20257. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  20258. }
  20259. // Compare request host against noproxy
  20260. for (let upperNoProxyItem of noProxy
  20261. .split(',')
  20262. .map(x => x.trim().toUpperCase())
  20263. .filter(x => x)) {
  20264. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  20265. return true;
  20266. }
  20267. }
  20268. return false;
  20269. }
  20270. exports.checkBypass = checkBypass;
  20271. /***/ }),
  20272. /***/ 447:
  20273. /***/ (function(module, __unusedexports, __webpack_require__) {
  20274. "use strict";
  20275. const path = __webpack_require__(622);
  20276. const childProcess = __webpack_require__(129);
  20277. const crossSpawn = __webpack_require__(746);
  20278. const stripEof = __webpack_require__(774);
  20279. const npmRunPath = __webpack_require__(502);
  20280. const isStream = __webpack_require__(554);
  20281. const _getStream = __webpack_require__(766);
  20282. const pFinally = __webpack_require__(330);
  20283. const onExit = __webpack_require__(931);
  20284. const errname = __webpack_require__(689);
  20285. const stdio = __webpack_require__(166);
  20286. const TEN_MEGABYTES = 1000 * 1000 * 10;
  20287. function handleArgs(cmd, args, opts) {
  20288. let parsed;
  20289. opts = Object.assign({
  20290. extendEnv: true,
  20291. env: {}
  20292. }, opts);
  20293. if (opts.extendEnv) {
  20294. opts.env = Object.assign({}, process.env, opts.env);
  20295. }
  20296. if (opts.__winShell === true) {
  20297. delete opts.__winShell;
  20298. parsed = {
  20299. command: cmd,
  20300. args,
  20301. options: opts,
  20302. file: cmd,
  20303. original: {
  20304. cmd,
  20305. args
  20306. }
  20307. };
  20308. } else {
  20309. parsed = crossSpawn._parse(cmd, args, opts);
  20310. }
  20311. opts = Object.assign({
  20312. maxBuffer: TEN_MEGABYTES,
  20313. buffer: true,
  20314. stripEof: true,
  20315. preferLocal: true,
  20316. localDir: parsed.options.cwd || process.cwd(),
  20317. encoding: 'utf8',
  20318. reject: true,
  20319. cleanup: true
  20320. }, parsed.options);
  20321. opts.stdio = stdio(opts);
  20322. if (opts.preferLocal) {
  20323. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  20324. }
  20325. if (opts.detached) {
  20326. // #115
  20327. opts.cleanup = false;
  20328. }
  20329. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  20330. // #116
  20331. parsed.args.unshift('/q');
  20332. }
  20333. return {
  20334. cmd: parsed.command,
  20335. args: parsed.args,
  20336. opts,
  20337. parsed
  20338. };
  20339. }
  20340. function handleInput(spawned, input) {
  20341. if (input === null || input === undefined) {
  20342. return;
  20343. }
  20344. if (isStream(input)) {
  20345. input.pipe(spawned.stdin);
  20346. } else {
  20347. spawned.stdin.end(input);
  20348. }
  20349. }
  20350. function handleOutput(opts, val) {
  20351. if (val && opts.stripEof) {
  20352. val = stripEof(val);
  20353. }
  20354. return val;
  20355. }
  20356. function handleShell(fn, cmd, opts) {
  20357. let file = '/bin/sh';
  20358. let args = ['-c', cmd];
  20359. opts = Object.assign({}, opts);
  20360. if (process.platform === 'win32') {
  20361. opts.__winShell = true;
  20362. file = process.env.comspec || 'cmd.exe';
  20363. args = ['/s', '/c', `"${cmd}"`];
  20364. opts.windowsVerbatimArguments = true;
  20365. }
  20366. if (opts.shell) {
  20367. file = opts.shell;
  20368. delete opts.shell;
  20369. }
  20370. return fn(file, args, opts);
  20371. }
  20372. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  20373. if (!process[stream]) {
  20374. return null;
  20375. }
  20376. let ret;
  20377. if (!buffer) {
  20378. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  20379. ret = new Promise((resolve, reject) => {
  20380. process[stream]
  20381. .once('end', resolve)
  20382. .once('error', reject);
  20383. });
  20384. } else if (encoding) {
  20385. ret = _getStream(process[stream], {
  20386. encoding,
  20387. maxBuffer
  20388. });
  20389. } else {
  20390. ret = _getStream.buffer(process[stream], {maxBuffer});
  20391. }
  20392. return ret.catch(err => {
  20393. err.stream = stream;
  20394. err.message = `${stream} ${err.message}`;
  20395. throw err;
  20396. });
  20397. }
  20398. function makeError(result, options) {
  20399. const {stdout, stderr} = result;
  20400. let err = result.error;
  20401. const {code, signal} = result;
  20402. const {parsed, joinedCmd} = options;
  20403. const timedOut = options.timedOut || false;
  20404. if (!err) {
  20405. let output = '';
  20406. if (Array.isArray(parsed.opts.stdio)) {
  20407. if (parsed.opts.stdio[2] !== 'inherit') {
  20408. output += output.length > 0 ? stderr : `\n${stderr}`;
  20409. }
  20410. if (parsed.opts.stdio[1] !== 'inherit') {
  20411. output += `\n${stdout}`;
  20412. }
  20413. } else if (parsed.opts.stdio !== 'inherit') {
  20414. output = `\n${stderr}${stdout}`;
  20415. }
  20416. err = new Error(`Command failed: ${joinedCmd}${output}`);
  20417. err.code = code < 0 ? errname(code) : code;
  20418. }
  20419. err.stdout = stdout;
  20420. err.stderr = stderr;
  20421. err.failed = true;
  20422. err.signal = signal || null;
  20423. err.cmd = joinedCmd;
  20424. err.timedOut = timedOut;
  20425. return err;
  20426. }
  20427. function joinCmd(cmd, args) {
  20428. let joinedCmd = cmd;
  20429. if (Array.isArray(args) && args.length > 0) {
  20430. joinedCmd += ' ' + args.join(' ');
  20431. }
  20432. return joinedCmd;
  20433. }
  20434. module.exports = (cmd, args, opts) => {
  20435. const parsed = handleArgs(cmd, args, opts);
  20436. const {encoding, buffer, maxBuffer} = parsed.opts;
  20437. const joinedCmd = joinCmd(cmd, args);
  20438. let spawned;
  20439. try {
  20440. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  20441. } catch (err) {
  20442. return Promise.reject(err);
  20443. }
  20444. let removeExitHandler;
  20445. if (parsed.opts.cleanup) {
  20446. removeExitHandler = onExit(() => {
  20447. spawned.kill();
  20448. });
  20449. }
  20450. let timeoutId = null;
  20451. let timedOut = false;
  20452. const cleanup = () => {
  20453. if (timeoutId) {
  20454. clearTimeout(timeoutId);
  20455. timeoutId = null;
  20456. }
  20457. if (removeExitHandler) {
  20458. removeExitHandler();
  20459. }
  20460. };
  20461. if (parsed.opts.timeout > 0) {
  20462. timeoutId = setTimeout(() => {
  20463. timeoutId = null;
  20464. timedOut = true;
  20465. spawned.kill(parsed.opts.killSignal);
  20466. }, parsed.opts.timeout);
  20467. }
  20468. const processDone = new Promise(resolve => {
  20469. spawned.on('exit', (code, signal) => {
  20470. cleanup();
  20471. resolve({code, signal});
  20472. });
  20473. spawned.on('error', err => {
  20474. cleanup();
  20475. resolve({error: err});
  20476. });
  20477. if (spawned.stdin) {
  20478. spawned.stdin.on('error', err => {
  20479. cleanup();
  20480. resolve({error: err});
  20481. });
  20482. }
  20483. });
  20484. function destroy() {
  20485. if (spawned.stdout) {
  20486. spawned.stdout.destroy();
  20487. }
  20488. if (spawned.stderr) {
  20489. spawned.stderr.destroy();
  20490. }
  20491. }
  20492. const handlePromise = () => pFinally(Promise.all([
  20493. processDone,
  20494. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  20495. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  20496. ]).then(arr => {
  20497. const result = arr[0];
  20498. result.stdout = arr[1];
  20499. result.stderr = arr[2];
  20500. if (result.error || result.code !== 0 || result.signal !== null) {
  20501. const err = makeError(result, {
  20502. joinedCmd,
  20503. parsed,
  20504. timedOut
  20505. });
  20506. // TODO: missing some timeout logic for killed
  20507. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  20508. // err.killed = spawned.killed || killed;
  20509. err.killed = err.killed || spawned.killed;
  20510. if (!parsed.opts.reject) {
  20511. return err;
  20512. }
  20513. throw err;
  20514. }
  20515. return {
  20516. stdout: handleOutput(parsed.opts, result.stdout),
  20517. stderr: handleOutput(parsed.opts, result.stderr),
  20518. code: 0,
  20519. failed: false,
  20520. killed: false,
  20521. signal: null,
  20522. cmd: joinedCmd,
  20523. timedOut: false
  20524. };
  20525. }), destroy);
  20526. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  20527. handleInput(spawned, parsed.opts.input);
  20528. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  20529. spawned.catch = onrejected => handlePromise().catch(onrejected);
  20530. return spawned;
  20531. };
  20532. // TODO: set `stderr: 'ignore'` when that option is implemented
  20533. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  20534. // TODO: set `stdout: 'ignore'` when that option is implemented
  20535. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  20536. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  20537. module.exports.sync = (cmd, args, opts) => {
  20538. const parsed = handleArgs(cmd, args, opts);
  20539. const joinedCmd = joinCmd(cmd, args);
  20540. if (isStream(parsed.opts.input)) {
  20541. throw new TypeError('The `input` option cannot be a stream in sync mode');
  20542. }
  20543. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  20544. result.code = result.status;
  20545. if (result.error || result.status !== 0 || result.signal !== null) {
  20546. const err = makeError(result, {
  20547. joinedCmd,
  20548. parsed
  20549. });
  20550. if (!parsed.opts.reject) {
  20551. return err;
  20552. }
  20553. throw err;
  20554. }
  20555. return {
  20556. stdout: handleOutput(parsed.opts, result.stdout),
  20557. stderr: handleOutput(parsed.opts, result.stderr),
  20558. code: 0,
  20559. failed: false,
  20560. signal: null,
  20561. cmd: joinedCmd,
  20562. timedOut: false
  20563. };
  20564. };
  20565. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  20566. /***/ }),
  20567. /***/ 467:
  20568. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20569. "use strict";
  20570. Object.defineProperty(exports, '__esModule', { value: true });
  20571. var request = __webpack_require__(234);
  20572. var universalUserAgent = __webpack_require__(30);
  20573. const VERSION = "4.3.1";
  20574. class GraphqlError extends Error {
  20575. constructor(request, response) {
  20576. const message = response.data.errors[0].message;
  20577. super(message);
  20578. Object.assign(this, response.data);
  20579. this.name = "GraphqlError";
  20580. this.request = request; // Maintains proper stack trace (only available on V8)
  20581. /* istanbul ignore next */
  20582. if (Error.captureStackTrace) {
  20583. Error.captureStackTrace(this, this.constructor);
  20584. }
  20585. }
  20586. }
  20587. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  20588. function graphql(request, query, options) {
  20589. options = typeof query === "string" ? options = Object.assign({
  20590. query
  20591. }, options) : options = query;
  20592. const requestOptions = Object.keys(options).reduce((result, key) => {
  20593. if (NON_VARIABLE_OPTIONS.includes(key)) {
  20594. result[key] = options[key];
  20595. return result;
  20596. }
  20597. if (!result.variables) {
  20598. result.variables = {};
  20599. }
  20600. result.variables[key] = options[key];
  20601. return result;
  20602. }, {});
  20603. return request(requestOptions).then(response => {
  20604. if (response.data.errors) {
  20605. throw new GraphqlError(requestOptions, {
  20606. data: response.data
  20607. });
  20608. }
  20609. return response.data.data;
  20610. });
  20611. }
  20612. function withDefaults(request$1, newDefaults) {
  20613. const newRequest = request$1.defaults(newDefaults);
  20614. const newApi = (query, options) => {
  20615. return graphql(newRequest, query, options);
  20616. };
  20617. return Object.assign(newApi, {
  20618. defaults: withDefaults.bind(null, newRequest),
  20619. endpoint: request.request.endpoint
  20620. });
  20621. }
  20622. const graphql$1 = withDefaults(request.request, {
  20623. headers: {
  20624. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  20625. },
  20626. method: "POST",
  20627. url: "/graphql"
  20628. });
  20629. function withCustomRequest(customRequest) {
  20630. return withDefaults(customRequest, {
  20631. method: "POST",
  20632. url: "/graphql"
  20633. });
  20634. }
  20635. exports.graphql = graphql$1;
  20636. exports.withCustomRequest = withCustomRequest;
  20637. //# sourceMappingURL=index.js.map
  20638. /***/ }),
  20639. /***/ 480:
  20640. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20641. "use strict";
  20642. var __importStar = (this && this.__importStar) || function (mod) {
  20643. if (mod && mod.__esModule) return mod;
  20644. var result = {};
  20645. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  20646. result["default"] = mod;
  20647. return result;
  20648. };
  20649. Object.defineProperty(exports, "__esModule", { value: true });
  20650. const core = __importStar(__webpack_require__(186));
  20651. const fsHelper = __importStar(__webpack_require__(219));
  20652. const github = __importStar(__webpack_require__(438));
  20653. const path = __importStar(__webpack_require__(622));
  20654. function getInputs() {
  20655. const result = {};
  20656. // GitHub workspace
  20657. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  20658. if (!githubWorkspacePath) {
  20659. throw new Error('GITHUB_WORKSPACE not defined');
  20660. }
  20661. githubWorkspacePath = path.resolve(githubWorkspacePath);
  20662. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  20663. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  20664. // Qualified repository
  20665. const qualifiedRepository = core.getInput('repository') ||
  20666. `${github.context.repo.owner}/${github.context.repo.repo}`;
  20667. core.debug(`qualified repository = '${qualifiedRepository}'`);
  20668. const splitRepository = qualifiedRepository.split('/');
  20669. if (splitRepository.length !== 2 ||
  20670. !splitRepository[0] ||
  20671. !splitRepository[1]) {
  20672. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  20673. }
  20674. result.repositoryOwner = splitRepository[0];
  20675. result.repositoryName = splitRepository[1];
  20676. // Repository path
  20677. result.repositoryPath = core.getInput('path') || '.';
  20678. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  20679. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  20680. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  20681. }
  20682. // Workflow repository?
  20683. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  20684. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  20685. // Source branch, source version
  20686. result.ref = core.getInput('ref');
  20687. if (!result.ref) {
  20688. if (isWorkflowRepository) {
  20689. result.ref = github.context.ref;
  20690. result.commit = github.context.sha;
  20691. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  20692. // the ref is unqualifed like "main" instead of "refs/heads/main".
  20693. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  20694. result.ref = `refs/heads/${result.ref}`;
  20695. }
  20696. }
  20697. }
  20698. // SHA?
  20699. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  20700. result.commit = result.ref;
  20701. result.ref = '';
  20702. }
  20703. core.debug(`ref = '${result.ref}'`);
  20704. core.debug(`commit = '${result.commit}'`);
  20705. // Clean
  20706. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  20707. core.debug(`clean = ${result.clean}`);
  20708. // Fetch depth
  20709. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  20710. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  20711. result.fetchDepth = 0;
  20712. }
  20713. core.debug(`fetch depth = ${result.fetchDepth}`);
  20714. // LFS
  20715. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  20716. core.debug(`lfs = ${result.lfs}`);
  20717. // Submodules
  20718. result.submodules = false;
  20719. result.nestedSubmodules = false;
  20720. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  20721. if (submodulesString == 'RECURSIVE') {
  20722. result.submodules = true;
  20723. result.nestedSubmodules = true;
  20724. }
  20725. else if (submodulesString == 'TRUE') {
  20726. result.submodules = true;
  20727. }
  20728. core.debug(`submodules = ${result.submodules}`);
  20729. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  20730. // Auth token
  20731. result.authToken = core.getInput('token', { required: true });
  20732. // SSH
  20733. result.sshKey = core.getInput('ssh-key');
  20734. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  20735. result.sshStrict =
  20736. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  20737. // Persist credentials
  20738. result.persistCredentials =
  20739. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  20740. return result;
  20741. }
  20742. exports.getInputs = getInputs;
  20743. /***/ }),
  20744. /***/ 493:
  20745. /***/ (function(module, __unusedexports, __webpack_require__) {
  20746. "use strict";
  20747. const os = __webpack_require__(87);
  20748. const nameMap = new Map([
  20749. [19, 'Catalina'],
  20750. [18, 'Mojave'],
  20751. [17, 'High Sierra'],
  20752. [16, 'Sierra'],
  20753. [15, 'El Capitan'],
  20754. [14, 'Yosemite'],
  20755. [13, 'Mavericks'],
  20756. [12, 'Mountain Lion'],
  20757. [11, 'Lion'],
  20758. [10, 'Snow Leopard'],
  20759. [9, 'Leopard'],
  20760. [8, 'Tiger'],
  20761. [7, 'Panther'],
  20762. [6, 'Jaguar'],
  20763. [5, 'Puma']
  20764. ]);
  20765. const macosRelease = release => {
  20766. release = Number((release || os.release()).split('.')[0]);
  20767. return {
  20768. name: nameMap.get(release),
  20769. version: '10.' + (release - 4)
  20770. };
  20771. };
  20772. module.exports = macosRelease;
  20773. // TODO: remove this in the next major version
  20774. module.exports.default = macosRelease;
  20775. /***/ }),
  20776. /***/ 500:
  20777. /***/ (function(module, __unusedexports, __webpack_require__) {
  20778. module.exports = hasNextPage
  20779. const deprecate = __webpack_require__(191)
  20780. const getPageLinks = __webpack_require__(889)
  20781. function hasNextPage (link) {
  20782. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  20783. return getPageLinks(link).next
  20784. }
  20785. /***/ }),
  20786. /***/ 502:
  20787. /***/ (function(module, __unusedexports, __webpack_require__) {
  20788. "use strict";
  20789. const path = __webpack_require__(622);
  20790. const pathKey = __webpack_require__(539);
  20791. module.exports = opts => {
  20792. opts = Object.assign({
  20793. cwd: process.cwd(),
  20794. path: process.env[pathKey()]
  20795. }, opts);
  20796. let prev;
  20797. let pth = path.resolve(opts.cwd);
  20798. const ret = [];
  20799. while (prev !== pth) {
  20800. ret.push(path.join(pth, 'node_modules/.bin'));
  20801. prev = pth;
  20802. pth = path.resolve(pth, '..');
  20803. }
  20804. // ensure the running `node` binary is used
  20805. ret.push(path.dirname(process.execPath));
  20806. return ret.concat(opts.path).join(path.delimiter);
  20807. };
  20808. module.exports.env = opts => {
  20809. opts = Object.assign({
  20810. env: process.env
  20811. }, opts);
  20812. const env = Object.assign({}, opts.env);
  20813. const path = pathKey({env});
  20814. opts.path = env[path];
  20815. env[path] = module.exports(opts);
  20816. return env;
  20817. };
  20818. /***/ }),
  20819. /***/ 514:
  20820. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20821. "use strict";
  20822. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  20823. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  20824. return new (P || (P = Promise))(function (resolve, reject) {
  20825. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  20826. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  20827. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  20828. step((generator = generator.apply(thisArg, _arguments || [])).next());
  20829. });
  20830. };
  20831. Object.defineProperty(exports, "__esModule", { value: true });
  20832. const tr = __webpack_require__(159);
  20833. /**
  20834. * Exec a command.
  20835. * Output will be streamed to the live console.
  20836. * Returns promise with return code
  20837. *
  20838. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  20839. * @param args optional arguments for tool. Escaping is handled by the lib.
  20840. * @param options optional exec options. See ExecOptions
  20841. * @returns Promise<number> exit code
  20842. */
  20843. function exec(commandLine, args, options) {
  20844. return __awaiter(this, void 0, void 0, function* () {
  20845. const commandArgs = tr.argStringToArray(commandLine);
  20846. if (commandArgs.length === 0) {
  20847. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  20848. }
  20849. // Path to tool to execute should be first arg
  20850. const toolPath = commandArgs[0];
  20851. args = commandArgs.slice(1).concat(args || []);
  20852. const runner = new tr.ToolRunner(toolPath, args, options);
  20853. return runner.exec();
  20854. });
  20855. }
  20856. exports.exec = exec;
  20857. //# sourceMappingURL=exec.js.map
  20858. /***/ }),
  20859. /***/ 515:
  20860. /***/ (function(module, __unusedexports, __webpack_require__) {
  20861. "use strict";
  20862. const os = __webpack_require__(87);
  20863. const execa = __webpack_require__(447);
  20864. // Reference: https://www.gaijin.at/en/lstwinver.php
  20865. const names = new Map([
  20866. ['10.0', '10'],
  20867. ['6.3', '8.1'],
  20868. ['6.2', '8'],
  20869. ['6.1', '7'],
  20870. ['6.0', 'Vista'],
  20871. ['5.2', 'Server 2003'],
  20872. ['5.1', 'XP'],
  20873. ['5.0', '2000'],
  20874. ['4.9', 'ME'],
  20875. ['4.1', '98'],
  20876. ['4.0', '95']
  20877. ]);
  20878. const windowsRelease = release => {
  20879. const version = /\d+\.\d/.exec(release || os.release());
  20880. if (release && !version) {
  20881. throw new Error('`release` argument doesn\'t match `n.n`');
  20882. }
  20883. const ver = (version || [])[0];
  20884. // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
  20885. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  20886. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  20887. // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
  20888. // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
  20889. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  20890. let stdout;
  20891. try {
  20892. stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
  20893. } catch (_) {
  20894. stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  20895. }
  20896. const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
  20897. if (year) {
  20898. return `Server ${year}`;
  20899. }
  20900. }
  20901. return names.get(ver);
  20902. };
  20903. module.exports = windowsRelease;
  20904. /***/ }),
  20905. /***/ 537:
  20906. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20907. "use strict";
  20908. Object.defineProperty(exports, '__esModule', { value: true });
  20909. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  20910. var deprecation = __webpack_require__(932);
  20911. var once = _interopDefault(__webpack_require__(223));
  20912. const logOnce = once(deprecation => console.warn(deprecation));
  20913. /**
  20914. * Error with extra properties to help with debugging
  20915. */
  20916. class RequestError extends Error {
  20917. constructor(message, statusCode, options) {
  20918. super(message); // Maintains proper stack trace (only available on V8)
  20919. /* istanbul ignore next */
  20920. if (Error.captureStackTrace) {
  20921. Error.captureStackTrace(this, this.constructor);
  20922. }
  20923. this.name = "HttpError";
  20924. this.status = statusCode;
  20925. Object.defineProperty(this, "code", {
  20926. get() {
  20927. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  20928. return statusCode;
  20929. }
  20930. });
  20931. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  20932. const requestCopy = Object.assign({}, options.request);
  20933. if (options.request.headers.authorization) {
  20934. requestCopy.headers = Object.assign({}, options.request.headers, {
  20935. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  20936. });
  20937. }
  20938. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  20939. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  20940. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  20941. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  20942. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  20943. this.request = requestCopy;
  20944. }
  20945. }
  20946. exports.RequestError = RequestError;
  20947. //# sourceMappingURL=index.js.map
  20948. /***/ }),
  20949. /***/ 538:
  20950. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  20951. "use strict";
  20952. // Copyright (c) Microsoft. All rights reserved.
  20953. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  20954. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  20955. return new (P || (P = Promise))(function (resolve, reject) {
  20956. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  20957. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  20958. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  20959. step((generator = generator.apply(thisArg, _arguments || [])).next());
  20960. });
  20961. };
  20962. Object.defineProperty(exports, "__esModule", { value: true });
  20963. const url = __webpack_require__(835);
  20964. const http = __webpack_require__(605);
  20965. const https = __webpack_require__(211);
  20966. let fs;
  20967. let tunnel;
  20968. var HttpCodes;
  20969. (function (HttpCodes) {
  20970. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  20971. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  20972. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  20973. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  20974. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  20975. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  20976. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  20977. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  20978. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  20979. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  20980. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  20981. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  20982. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  20983. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  20984. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  20985. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  20986. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  20987. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  20988. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  20989. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  20990. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  20991. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  20992. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  20993. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  20994. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  20995. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  20996. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  20997. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  20998. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  20999. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  21000. const ExponentialBackoffCeiling = 10;
  21001. const ExponentialBackoffTimeSlice = 5;
  21002. class HttpClientResponse {
  21003. constructor(message) {
  21004. this.message = message;
  21005. }
  21006. readBody() {
  21007. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  21008. let output = '';
  21009. this.message.on('data', (chunk) => {
  21010. output += chunk;
  21011. });
  21012. this.message.on('end', () => {
  21013. resolve(output);
  21014. });
  21015. }));
  21016. }
  21017. }
  21018. exports.HttpClientResponse = HttpClientResponse;
  21019. function isHttps(requestUrl) {
  21020. let parsedUrl = url.parse(requestUrl);
  21021. return parsedUrl.protocol === 'https:';
  21022. }
  21023. exports.isHttps = isHttps;
  21024. var EnvironmentVariables;
  21025. (function (EnvironmentVariables) {
  21026. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  21027. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  21028. })(EnvironmentVariables || (EnvironmentVariables = {}));
  21029. class HttpClient {
  21030. constructor(userAgent, handlers, requestOptions) {
  21031. this._ignoreSslError = false;
  21032. this._allowRedirects = true;
  21033. this._maxRedirects = 50;
  21034. this._allowRetries = false;
  21035. this._maxRetries = 1;
  21036. this._keepAlive = false;
  21037. this._disposed = false;
  21038. this.userAgent = userAgent;
  21039. this.handlers = handlers || [];
  21040. this.requestOptions = requestOptions;
  21041. if (requestOptions) {
  21042. if (requestOptions.ignoreSslError != null) {
  21043. this._ignoreSslError = requestOptions.ignoreSslError;
  21044. }
  21045. this._socketTimeout = requestOptions.socketTimeout;
  21046. this._httpProxy = requestOptions.proxy;
  21047. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  21048. this._httpProxyBypassHosts = [];
  21049. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  21050. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  21051. });
  21052. }
  21053. this._certConfig = requestOptions.cert;
  21054. if (this._certConfig) {
  21055. // If using cert, need fs
  21056. fs = __webpack_require__(747);
  21057. // cache the cert content into memory, so we don't have to read it from disk every time
  21058. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  21059. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  21060. }
  21061. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  21062. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  21063. }
  21064. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  21065. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  21066. }
  21067. }
  21068. if (requestOptions.allowRedirects != null) {
  21069. this._allowRedirects = requestOptions.allowRedirects;
  21070. }
  21071. if (requestOptions.maxRedirects != null) {
  21072. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  21073. }
  21074. if (requestOptions.keepAlive != null) {
  21075. this._keepAlive = requestOptions.keepAlive;
  21076. }
  21077. if (requestOptions.allowRetries != null) {
  21078. this._allowRetries = requestOptions.allowRetries;
  21079. }
  21080. if (requestOptions.maxRetries != null) {
  21081. this._maxRetries = requestOptions.maxRetries;
  21082. }
  21083. }
  21084. }
  21085. options(requestUrl, additionalHeaders) {
  21086. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  21087. }
  21088. get(requestUrl, additionalHeaders) {
  21089. return this.request('GET', requestUrl, null, additionalHeaders || {});
  21090. }
  21091. del(requestUrl, additionalHeaders) {
  21092. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  21093. }
  21094. post(requestUrl, data, additionalHeaders) {
  21095. return this.request('POST', requestUrl, data, additionalHeaders || {});
  21096. }
  21097. patch(requestUrl, data, additionalHeaders) {
  21098. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  21099. }
  21100. put(requestUrl, data, additionalHeaders) {
  21101. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  21102. }
  21103. head(requestUrl, additionalHeaders) {
  21104. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  21105. }
  21106. sendStream(verb, requestUrl, stream, additionalHeaders) {
  21107. return this.request(verb, requestUrl, stream, additionalHeaders);
  21108. }
  21109. /**
  21110. * Makes a raw http request.
  21111. * All other methods such as get, post, patch, and request ultimately call this.
  21112. * Prefer get, del, post and patch
  21113. */
  21114. request(verb, requestUrl, data, headers) {
  21115. return __awaiter(this, void 0, void 0, function* () {
  21116. if (this._disposed) {
  21117. throw new Error("Client has already been disposed.");
  21118. }
  21119. let info = this._prepareRequest(verb, requestUrl, headers);
  21120. // Only perform retries on reads since writes may not be idempotent.
  21121. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  21122. let numTries = 0;
  21123. let response;
  21124. while (numTries < maxTries) {
  21125. response = yield this.requestRaw(info, data);
  21126. // Check if it's an authentication challenge
  21127. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  21128. let authenticationHandler;
  21129. for (let i = 0; i < this.handlers.length; i++) {
  21130. if (this.handlers[i].canHandleAuthentication(response)) {
  21131. authenticationHandler = this.handlers[i];
  21132. break;
  21133. }
  21134. }
  21135. if (authenticationHandler) {
  21136. return authenticationHandler.handleAuthentication(this, info, data);
  21137. }
  21138. else {
  21139. // We have received an unauthorized response but have no handlers to handle it.
  21140. // Let the response return to the caller.
  21141. return response;
  21142. }
  21143. }
  21144. let redirectsRemaining = this._maxRedirects;
  21145. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  21146. && this._allowRedirects
  21147. && redirectsRemaining > 0) {
  21148. const redirectUrl = response.message.headers["location"];
  21149. if (!redirectUrl) {
  21150. // if there's no location to redirect to, we won't
  21151. break;
  21152. }
  21153. // we need to finish reading the response before reassigning response
  21154. // which will leak the open socket.
  21155. yield response.readBody();
  21156. // let's make the request with the new redirectUrl
  21157. info = this._prepareRequest(verb, redirectUrl, headers);
  21158. response = yield this.requestRaw(info, data);
  21159. redirectsRemaining--;
  21160. }
  21161. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  21162. // If not a retry code, return immediately instead of retrying
  21163. return response;
  21164. }
  21165. numTries += 1;
  21166. if (numTries < maxTries) {
  21167. yield response.readBody();
  21168. yield this._performExponentialBackoff(numTries);
  21169. }
  21170. }
  21171. return response;
  21172. });
  21173. }
  21174. /**
  21175. * Needs to be called if keepAlive is set to true in request options.
  21176. */
  21177. dispose() {
  21178. if (this._agent) {
  21179. this._agent.destroy();
  21180. }
  21181. this._disposed = true;
  21182. }
  21183. /**
  21184. * Raw request.
  21185. * @param info
  21186. * @param data
  21187. */
  21188. requestRaw(info, data) {
  21189. return new Promise((resolve, reject) => {
  21190. let callbackForResult = function (err, res) {
  21191. if (err) {
  21192. reject(err);
  21193. }
  21194. resolve(res);
  21195. };
  21196. this.requestRawWithCallback(info, data, callbackForResult);
  21197. });
  21198. }
  21199. /**
  21200. * Raw request with callback.
  21201. * @param info
  21202. * @param data
  21203. * @param onResult
  21204. */
  21205. requestRawWithCallback(info, data, onResult) {
  21206. let socket;
  21207. let isDataString = typeof (data) === 'string';
  21208. if (typeof (data) === 'string') {
  21209. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  21210. }
  21211. let callbackCalled = false;
  21212. let handleResult = (err, res) => {
  21213. if (!callbackCalled) {
  21214. callbackCalled = true;
  21215. onResult(err, res);
  21216. }
  21217. };
  21218. let req = info.httpModule.request(info.options, (msg) => {
  21219. let res = new HttpClientResponse(msg);
  21220. handleResult(null, res);
  21221. });
  21222. req.on('socket', (sock) => {
  21223. socket = sock;
  21224. });
  21225. // If we ever get disconnected, we want the socket to timeout eventually
  21226. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  21227. if (socket) {
  21228. socket.end();
  21229. }
  21230. handleResult(new Error('Request timeout: ' + info.options.path), null);
  21231. });
  21232. req.on('error', function (err) {
  21233. // err has statusCode property
  21234. // res should have headers
  21235. handleResult(err, null);
  21236. });
  21237. if (data && typeof (data) === 'string') {
  21238. req.write(data, 'utf8');
  21239. }
  21240. if (data && typeof (data) !== 'string') {
  21241. data.on('close', function () {
  21242. req.end();
  21243. });
  21244. data.pipe(req);
  21245. }
  21246. else {
  21247. req.end();
  21248. }
  21249. }
  21250. _prepareRequest(method, requestUrl, headers) {
  21251. const info = {};
  21252. info.parsedUrl = url.parse(requestUrl);
  21253. const usingSsl = info.parsedUrl.protocol === 'https:';
  21254. info.httpModule = usingSsl ? https : http;
  21255. const defaultPort = usingSsl ? 443 : 80;
  21256. info.options = {};
  21257. info.options.host = info.parsedUrl.hostname;
  21258. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  21259. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  21260. info.options.method = method;
  21261. info.options.headers = this._mergeHeaders(headers);
  21262. info.options.headers["user-agent"] = this.userAgent;
  21263. info.options.agent = this._getAgent(requestUrl);
  21264. // gives handlers an opportunity to participate
  21265. if (this.handlers && !this._isPresigned(requestUrl)) {
  21266. this.handlers.forEach((handler) => {
  21267. handler.prepareRequest(info.options);
  21268. });
  21269. }
  21270. return info;
  21271. }
  21272. _isPresigned(requestUrl) {
  21273. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  21274. const patterns = this.requestOptions.presignedUrlPatterns;
  21275. for (let i = 0; i < patterns.length; i++) {
  21276. if (requestUrl.match(patterns[i])) {
  21277. return true;
  21278. }
  21279. }
  21280. }
  21281. return false;
  21282. }
  21283. _mergeHeaders(headers) {
  21284. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  21285. if (this.requestOptions && this.requestOptions.headers) {
  21286. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  21287. }
  21288. return lowercaseKeys(headers || {});
  21289. }
  21290. _getAgent(requestUrl) {
  21291. let agent;
  21292. let proxy = this._getProxy(requestUrl);
  21293. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  21294. if (this._keepAlive && useProxy) {
  21295. agent = this._proxyAgent;
  21296. }
  21297. if (this._keepAlive && !useProxy) {
  21298. agent = this._agent;
  21299. }
  21300. // if agent is already assigned use that agent.
  21301. if (!!agent) {
  21302. return agent;
  21303. }
  21304. let parsedUrl = url.parse(requestUrl);
  21305. const usingSsl = parsedUrl.protocol === 'https:';
  21306. let maxSockets = 100;
  21307. if (!!this.requestOptions) {
  21308. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  21309. }
  21310. if (useProxy) {
  21311. // If using proxy, need tunnel
  21312. if (!tunnel) {
  21313. tunnel = __webpack_require__(294);
  21314. }
  21315. const agentOptions = {
  21316. maxSockets: maxSockets,
  21317. keepAlive: this._keepAlive,
  21318. proxy: {
  21319. proxyAuth: proxy.proxyAuth,
  21320. host: proxy.proxyUrl.hostname,
  21321. port: proxy.proxyUrl.port
  21322. },
  21323. };
  21324. let tunnelAgent;
  21325. const overHttps = proxy.proxyUrl.protocol === 'https:';
  21326. if (usingSsl) {
  21327. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  21328. }
  21329. else {
  21330. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  21331. }
  21332. agent = tunnelAgent(agentOptions);
  21333. this._proxyAgent = agent;
  21334. }
  21335. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  21336. if (this._keepAlive && !agent) {
  21337. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  21338. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  21339. this._agent = agent;
  21340. }
  21341. // if not using private agent and tunnel agent isn't setup then use global agent
  21342. if (!agent) {
  21343. agent = usingSsl ? https.globalAgent : http.globalAgent;
  21344. }
  21345. if (usingSsl && this._ignoreSslError) {
  21346. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  21347. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  21348. // we have to cast it to any and change it directly
  21349. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  21350. }
  21351. if (usingSsl && this._certConfig) {
  21352. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  21353. }
  21354. return agent;
  21355. }
  21356. _getProxy(requestUrl) {
  21357. const parsedUrl = url.parse(requestUrl);
  21358. let usingSsl = parsedUrl.protocol === 'https:';
  21359. let proxyConfig = this._httpProxy;
  21360. // fallback to http_proxy and https_proxy env
  21361. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  21362. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  21363. if (!proxyConfig) {
  21364. if (https_proxy && usingSsl) {
  21365. proxyConfig = {
  21366. proxyUrl: https_proxy
  21367. };
  21368. }
  21369. else if (http_proxy) {
  21370. proxyConfig = {
  21371. proxyUrl: http_proxy
  21372. };
  21373. }
  21374. }
  21375. let proxyUrl;
  21376. let proxyAuth;
  21377. if (proxyConfig) {
  21378. if (proxyConfig.proxyUrl.length > 0) {
  21379. proxyUrl = url.parse(proxyConfig.proxyUrl);
  21380. }
  21381. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  21382. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  21383. }
  21384. }
  21385. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  21386. }
  21387. _isBypassProxy(requestUrl) {
  21388. if (!this._httpProxyBypassHosts) {
  21389. return false;
  21390. }
  21391. let bypass = false;
  21392. this._httpProxyBypassHosts.forEach(bypassHost => {
  21393. if (bypassHost.test(requestUrl)) {
  21394. bypass = true;
  21395. }
  21396. });
  21397. return bypass;
  21398. }
  21399. _performExponentialBackoff(retryNumber) {
  21400. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  21401. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  21402. return new Promise(resolve => setTimeout(() => resolve(), ms));
  21403. }
  21404. }
  21405. exports.HttpClient = HttpClient;
  21406. /***/ }),
  21407. /***/ 539:
  21408. /***/ (function(module) {
  21409. "use strict";
  21410. module.exports = opts => {
  21411. opts = opts || {};
  21412. const env = opts.env || process.env;
  21413. const platform = opts.platform || process.platform;
  21414. if (platform !== 'win32') {
  21415. return 'PATH';
  21416. }
  21417. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  21418. };
  21419. /***/ }),
  21420. /***/ 549:
  21421. /***/ (function(module) {
  21422. module.exports = addHook
  21423. function addHook (state, kind, name, hook) {
  21424. var orig = hook
  21425. if (!state.registry[name]) {
  21426. state.registry[name] = []
  21427. }
  21428. if (kind === 'before') {
  21429. hook = function (method, options) {
  21430. return Promise.resolve()
  21431. .then(orig.bind(null, options))
  21432. .then(method.bind(null, options))
  21433. }
  21434. }
  21435. if (kind === 'after') {
  21436. hook = function (method, options) {
  21437. var result
  21438. return Promise.resolve()
  21439. .then(method.bind(null, options))
  21440. .then(function (result_) {
  21441. result = result_
  21442. return orig(result, options)
  21443. })
  21444. .then(function () {
  21445. return result
  21446. })
  21447. }
  21448. }
  21449. if (kind === 'error') {
  21450. hook = function (method, options) {
  21451. return Promise.resolve()
  21452. .then(method.bind(null, options))
  21453. .catch(function (error) {
  21454. return orig(error, options)
  21455. })
  21456. }
  21457. }
  21458. state.registry[name].push({
  21459. hook: hook,
  21460. orig: orig
  21461. })
  21462. }
  21463. /***/ }),
  21464. /***/ 552:
  21465. /***/ (function(module) {
  21466. /**
  21467. * lodash (Custom Build) <https://lodash.com/>
  21468. * Build: `lodash modularize exports="npm" -o ./`
  21469. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  21470. * Released under MIT license <https://lodash.com/license>
  21471. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  21472. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  21473. */
  21474. /** Used as the `TypeError` message for "Functions" methods. */
  21475. var FUNC_ERROR_TEXT = 'Expected a function';
  21476. /** Used to stand-in for `undefined` hash values. */
  21477. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  21478. /** Used as references for various `Number` constants. */
  21479. var INFINITY = 1 / 0,
  21480. MAX_SAFE_INTEGER = 9007199254740991;
  21481. /** `Object#toString` result references. */
  21482. var funcTag = '[object Function]',
  21483. genTag = '[object GeneratorFunction]',
  21484. symbolTag = '[object Symbol]';
  21485. /** Used to match property names within property paths. */
  21486. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  21487. reIsPlainProp = /^\w*$/,
  21488. reLeadingDot = /^\./,
  21489. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  21490. /**
  21491. * Used to match `RegExp`
  21492. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  21493. */
  21494. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  21495. /** Used to match backslashes in property paths. */
  21496. var reEscapeChar = /\\(\\)?/g;
  21497. /** Used to detect host constructors (Safari). */
  21498. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  21499. /** Used to detect unsigned integer values. */
  21500. var reIsUint = /^(?:0|[1-9]\d*)$/;
  21501. /** Detect free variable `global` from Node.js. */
  21502. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  21503. /** Detect free variable `self`. */
  21504. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  21505. /** Used as a reference to the global object. */
  21506. var root = freeGlobal || freeSelf || Function('return this')();
  21507. /**
  21508. * Gets the value at `key` of `object`.
  21509. *
  21510. * @private
  21511. * @param {Object} [object] The object to query.
  21512. * @param {string} key The key of the property to get.
  21513. * @returns {*} Returns the property value.
  21514. */
  21515. function getValue(object, key) {
  21516. return object == null ? undefined : object[key];
  21517. }
  21518. /**
  21519. * Checks if `value` is a host object in IE < 9.
  21520. *
  21521. * @private
  21522. * @param {*} value The value to check.
  21523. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  21524. */
  21525. function isHostObject(value) {
  21526. // Many host objects are `Object` objects that can coerce to strings
  21527. // despite having improperly defined `toString` methods.
  21528. var result = false;
  21529. if (value != null && typeof value.toString != 'function') {
  21530. try {
  21531. result = !!(value + '');
  21532. } catch (e) {}
  21533. }
  21534. return result;
  21535. }
  21536. /** Used for built-in method references. */
  21537. var arrayProto = Array.prototype,
  21538. funcProto = Function.prototype,
  21539. objectProto = Object.prototype;
  21540. /** Used to detect overreaching core-js shims. */
  21541. var coreJsData = root['__core-js_shared__'];
  21542. /** Used to detect methods masquerading as native. */
  21543. var maskSrcKey = (function() {
  21544. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  21545. return uid ? ('Symbol(src)_1.' + uid) : '';
  21546. }());
  21547. /** Used to resolve the decompiled source of functions. */
  21548. var funcToString = funcProto.toString;
  21549. /** Used to check objects for own properties. */
  21550. var hasOwnProperty = objectProto.hasOwnProperty;
  21551. /**
  21552. * Used to resolve the
  21553. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  21554. * of values.
  21555. */
  21556. var objectToString = objectProto.toString;
  21557. /** Used to detect if a method is native. */
  21558. var reIsNative = RegExp('^' +
  21559. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  21560. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  21561. );
  21562. /** Built-in value references. */
  21563. var Symbol = root.Symbol,
  21564. splice = arrayProto.splice;
  21565. /* Built-in method references that are verified to be native. */
  21566. var Map = getNative(root, 'Map'),
  21567. nativeCreate = getNative(Object, 'create');
  21568. /** Used to convert symbols to primitives and strings. */
  21569. var symbolProto = Symbol ? Symbol.prototype : undefined,
  21570. symbolToString = symbolProto ? symbolProto.toString : undefined;
  21571. /**
  21572. * Creates a hash object.
  21573. *
  21574. * @private
  21575. * @constructor
  21576. * @param {Array} [entries] The key-value pairs to cache.
  21577. */
  21578. function Hash(entries) {
  21579. var index = -1,
  21580. length = entries ? entries.length : 0;
  21581. this.clear();
  21582. while (++index < length) {
  21583. var entry = entries[index];
  21584. this.set(entry[0], entry[1]);
  21585. }
  21586. }
  21587. /**
  21588. * Removes all key-value entries from the hash.
  21589. *
  21590. * @private
  21591. * @name clear
  21592. * @memberOf Hash
  21593. */
  21594. function hashClear() {
  21595. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  21596. }
  21597. /**
  21598. * Removes `key` and its value from the hash.
  21599. *
  21600. * @private
  21601. * @name delete
  21602. * @memberOf Hash
  21603. * @param {Object} hash The hash to modify.
  21604. * @param {string} key The key of the value to remove.
  21605. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21606. */
  21607. function hashDelete(key) {
  21608. return this.has(key) && delete this.__data__[key];
  21609. }
  21610. /**
  21611. * Gets the hash value for `key`.
  21612. *
  21613. * @private
  21614. * @name get
  21615. * @memberOf Hash
  21616. * @param {string} key The key of the value to get.
  21617. * @returns {*} Returns the entry value.
  21618. */
  21619. function hashGet(key) {
  21620. var data = this.__data__;
  21621. if (nativeCreate) {
  21622. var result = data[key];
  21623. return result === HASH_UNDEFINED ? undefined : result;
  21624. }
  21625. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  21626. }
  21627. /**
  21628. * Checks if a hash value for `key` exists.
  21629. *
  21630. * @private
  21631. * @name has
  21632. * @memberOf Hash
  21633. * @param {string} key The key of the entry to check.
  21634. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21635. */
  21636. function hashHas(key) {
  21637. var data = this.__data__;
  21638. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  21639. }
  21640. /**
  21641. * Sets the hash `key` to `value`.
  21642. *
  21643. * @private
  21644. * @name set
  21645. * @memberOf Hash
  21646. * @param {string} key The key of the value to set.
  21647. * @param {*} value The value to set.
  21648. * @returns {Object} Returns the hash instance.
  21649. */
  21650. function hashSet(key, value) {
  21651. var data = this.__data__;
  21652. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  21653. return this;
  21654. }
  21655. // Add methods to `Hash`.
  21656. Hash.prototype.clear = hashClear;
  21657. Hash.prototype['delete'] = hashDelete;
  21658. Hash.prototype.get = hashGet;
  21659. Hash.prototype.has = hashHas;
  21660. Hash.prototype.set = hashSet;
  21661. /**
  21662. * Creates an list cache object.
  21663. *
  21664. * @private
  21665. * @constructor
  21666. * @param {Array} [entries] The key-value pairs to cache.
  21667. */
  21668. function ListCache(entries) {
  21669. var index = -1,
  21670. length = entries ? entries.length : 0;
  21671. this.clear();
  21672. while (++index < length) {
  21673. var entry = entries[index];
  21674. this.set(entry[0], entry[1]);
  21675. }
  21676. }
  21677. /**
  21678. * Removes all key-value entries from the list cache.
  21679. *
  21680. * @private
  21681. * @name clear
  21682. * @memberOf ListCache
  21683. */
  21684. function listCacheClear() {
  21685. this.__data__ = [];
  21686. }
  21687. /**
  21688. * Removes `key` and its value from the list cache.
  21689. *
  21690. * @private
  21691. * @name delete
  21692. * @memberOf ListCache
  21693. * @param {string} key The key of the value to remove.
  21694. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21695. */
  21696. function listCacheDelete(key) {
  21697. var data = this.__data__,
  21698. index = assocIndexOf(data, key);
  21699. if (index < 0) {
  21700. return false;
  21701. }
  21702. var lastIndex = data.length - 1;
  21703. if (index == lastIndex) {
  21704. data.pop();
  21705. } else {
  21706. splice.call(data, index, 1);
  21707. }
  21708. return true;
  21709. }
  21710. /**
  21711. * Gets the list cache value for `key`.
  21712. *
  21713. * @private
  21714. * @name get
  21715. * @memberOf ListCache
  21716. * @param {string} key The key of the value to get.
  21717. * @returns {*} Returns the entry value.
  21718. */
  21719. function listCacheGet(key) {
  21720. var data = this.__data__,
  21721. index = assocIndexOf(data, key);
  21722. return index < 0 ? undefined : data[index][1];
  21723. }
  21724. /**
  21725. * Checks if a list cache value for `key` exists.
  21726. *
  21727. * @private
  21728. * @name has
  21729. * @memberOf ListCache
  21730. * @param {string} key The key of the entry to check.
  21731. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21732. */
  21733. function listCacheHas(key) {
  21734. return assocIndexOf(this.__data__, key) > -1;
  21735. }
  21736. /**
  21737. * Sets the list cache `key` to `value`.
  21738. *
  21739. * @private
  21740. * @name set
  21741. * @memberOf ListCache
  21742. * @param {string} key The key of the value to set.
  21743. * @param {*} value The value to set.
  21744. * @returns {Object} Returns the list cache instance.
  21745. */
  21746. function listCacheSet(key, value) {
  21747. var data = this.__data__,
  21748. index = assocIndexOf(data, key);
  21749. if (index < 0) {
  21750. data.push([key, value]);
  21751. } else {
  21752. data[index][1] = value;
  21753. }
  21754. return this;
  21755. }
  21756. // Add methods to `ListCache`.
  21757. ListCache.prototype.clear = listCacheClear;
  21758. ListCache.prototype['delete'] = listCacheDelete;
  21759. ListCache.prototype.get = listCacheGet;
  21760. ListCache.prototype.has = listCacheHas;
  21761. ListCache.prototype.set = listCacheSet;
  21762. /**
  21763. * Creates a map cache object to store key-value pairs.
  21764. *
  21765. * @private
  21766. * @constructor
  21767. * @param {Array} [entries] The key-value pairs to cache.
  21768. */
  21769. function MapCache(entries) {
  21770. var index = -1,
  21771. length = entries ? entries.length : 0;
  21772. this.clear();
  21773. while (++index < length) {
  21774. var entry = entries[index];
  21775. this.set(entry[0], entry[1]);
  21776. }
  21777. }
  21778. /**
  21779. * Removes all key-value entries from the map.
  21780. *
  21781. * @private
  21782. * @name clear
  21783. * @memberOf MapCache
  21784. */
  21785. function mapCacheClear() {
  21786. this.__data__ = {
  21787. 'hash': new Hash,
  21788. 'map': new (Map || ListCache),
  21789. 'string': new Hash
  21790. };
  21791. }
  21792. /**
  21793. * Removes `key` and its value from the map.
  21794. *
  21795. * @private
  21796. * @name delete
  21797. * @memberOf MapCache
  21798. * @param {string} key The key of the value to remove.
  21799. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21800. */
  21801. function mapCacheDelete(key) {
  21802. return getMapData(this, key)['delete'](key);
  21803. }
  21804. /**
  21805. * Gets the map value for `key`.
  21806. *
  21807. * @private
  21808. * @name get
  21809. * @memberOf MapCache
  21810. * @param {string} key The key of the value to get.
  21811. * @returns {*} Returns the entry value.
  21812. */
  21813. function mapCacheGet(key) {
  21814. return getMapData(this, key).get(key);
  21815. }
  21816. /**
  21817. * Checks if a map value for `key` exists.
  21818. *
  21819. * @private
  21820. * @name has
  21821. * @memberOf MapCache
  21822. * @param {string} key The key of the entry to check.
  21823. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21824. */
  21825. function mapCacheHas(key) {
  21826. return getMapData(this, key).has(key);
  21827. }
  21828. /**
  21829. * Sets the map `key` to `value`.
  21830. *
  21831. * @private
  21832. * @name set
  21833. * @memberOf MapCache
  21834. * @param {string} key The key of the value to set.
  21835. * @param {*} value The value to set.
  21836. * @returns {Object} Returns the map cache instance.
  21837. */
  21838. function mapCacheSet(key, value) {
  21839. getMapData(this, key).set(key, value);
  21840. return this;
  21841. }
  21842. // Add methods to `MapCache`.
  21843. MapCache.prototype.clear = mapCacheClear;
  21844. MapCache.prototype['delete'] = mapCacheDelete;
  21845. MapCache.prototype.get = mapCacheGet;
  21846. MapCache.prototype.has = mapCacheHas;
  21847. MapCache.prototype.set = mapCacheSet;
  21848. /**
  21849. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  21850. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  21851. * for equality comparisons.
  21852. *
  21853. * @private
  21854. * @param {Object} object The object to modify.
  21855. * @param {string} key The key of the property to assign.
  21856. * @param {*} value The value to assign.
  21857. */
  21858. function assignValue(object, key, value) {
  21859. var objValue = object[key];
  21860. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  21861. (value === undefined && !(key in object))) {
  21862. object[key] = value;
  21863. }
  21864. }
  21865. /**
  21866. * Gets the index at which the `key` is found in `array` of key-value pairs.
  21867. *
  21868. * @private
  21869. * @param {Array} array The array to inspect.
  21870. * @param {*} key The key to search for.
  21871. * @returns {number} Returns the index of the matched value, else `-1`.
  21872. */
  21873. function assocIndexOf(array, key) {
  21874. var length = array.length;
  21875. while (length--) {
  21876. if (eq(array[length][0], key)) {
  21877. return length;
  21878. }
  21879. }
  21880. return -1;
  21881. }
  21882. /**
  21883. * The base implementation of `_.isNative` without bad shim checks.
  21884. *
  21885. * @private
  21886. * @param {*} value The value to check.
  21887. * @returns {boolean} Returns `true` if `value` is a native function,
  21888. * else `false`.
  21889. */
  21890. function baseIsNative(value) {
  21891. if (!isObject(value) || isMasked(value)) {
  21892. return false;
  21893. }
  21894. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  21895. return pattern.test(toSource(value));
  21896. }
  21897. /**
  21898. * The base implementation of `_.set`.
  21899. *
  21900. * @private
  21901. * @param {Object} object The object to modify.
  21902. * @param {Array|string} path The path of the property to set.
  21903. * @param {*} value The value to set.
  21904. * @param {Function} [customizer] The function to customize path creation.
  21905. * @returns {Object} Returns `object`.
  21906. */
  21907. function baseSet(object, path, value, customizer) {
  21908. if (!isObject(object)) {
  21909. return object;
  21910. }
  21911. path = isKey(path, object) ? [path] : castPath(path);
  21912. var index = -1,
  21913. length = path.length,
  21914. lastIndex = length - 1,
  21915. nested = object;
  21916. while (nested != null && ++index < length) {
  21917. var key = toKey(path[index]),
  21918. newValue = value;
  21919. if (index != lastIndex) {
  21920. var objValue = nested[key];
  21921. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  21922. if (newValue === undefined) {
  21923. newValue = isObject(objValue)
  21924. ? objValue
  21925. : (isIndex(path[index + 1]) ? [] : {});
  21926. }
  21927. }
  21928. assignValue(nested, key, newValue);
  21929. nested = nested[key];
  21930. }
  21931. return object;
  21932. }
  21933. /**
  21934. * The base implementation of `_.toString` which doesn't convert nullish
  21935. * values to empty strings.
  21936. *
  21937. * @private
  21938. * @param {*} value The value to process.
  21939. * @returns {string} Returns the string.
  21940. */
  21941. function baseToString(value) {
  21942. // Exit early for strings to avoid a performance hit in some environments.
  21943. if (typeof value == 'string') {
  21944. return value;
  21945. }
  21946. if (isSymbol(value)) {
  21947. return symbolToString ? symbolToString.call(value) : '';
  21948. }
  21949. var result = (value + '');
  21950. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  21951. }
  21952. /**
  21953. * Casts `value` to a path array if it's not one.
  21954. *
  21955. * @private
  21956. * @param {*} value The value to inspect.
  21957. * @returns {Array} Returns the cast property path array.
  21958. */
  21959. function castPath(value) {
  21960. return isArray(value) ? value : stringToPath(value);
  21961. }
  21962. /**
  21963. * Gets the data for `map`.
  21964. *
  21965. * @private
  21966. * @param {Object} map The map to query.
  21967. * @param {string} key The reference key.
  21968. * @returns {*} Returns the map data.
  21969. */
  21970. function getMapData(map, key) {
  21971. var data = map.__data__;
  21972. return isKeyable(key)
  21973. ? data[typeof key == 'string' ? 'string' : 'hash']
  21974. : data.map;
  21975. }
  21976. /**
  21977. * Gets the native function at `key` of `object`.
  21978. *
  21979. * @private
  21980. * @param {Object} object The object to query.
  21981. * @param {string} key The key of the method to get.
  21982. * @returns {*} Returns the function if it's native, else `undefined`.
  21983. */
  21984. function getNative(object, key) {
  21985. var value = getValue(object, key);
  21986. return baseIsNative(value) ? value : undefined;
  21987. }
  21988. /**
  21989. * Checks if `value` is a valid array-like index.
  21990. *
  21991. * @private
  21992. * @param {*} value The value to check.
  21993. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  21994. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  21995. */
  21996. function isIndex(value, length) {
  21997. length = length == null ? MAX_SAFE_INTEGER : length;
  21998. return !!length &&
  21999. (typeof value == 'number' || reIsUint.test(value)) &&
  22000. (value > -1 && value % 1 == 0 && value < length);
  22001. }
  22002. /**
  22003. * Checks if `value` is a property name and not a property path.
  22004. *
  22005. * @private
  22006. * @param {*} value The value to check.
  22007. * @param {Object} [object] The object to query keys on.
  22008. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  22009. */
  22010. function isKey(value, object) {
  22011. if (isArray(value)) {
  22012. return false;
  22013. }
  22014. var type = typeof value;
  22015. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  22016. value == null || isSymbol(value)) {
  22017. return true;
  22018. }
  22019. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  22020. (object != null && value in Object(object));
  22021. }
  22022. /**
  22023. * Checks if `value` is suitable for use as unique object key.
  22024. *
  22025. * @private
  22026. * @param {*} value The value to check.
  22027. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  22028. */
  22029. function isKeyable(value) {
  22030. var type = typeof value;
  22031. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  22032. ? (value !== '__proto__')
  22033. : (value === null);
  22034. }
  22035. /**
  22036. * Checks if `func` has its source masked.
  22037. *
  22038. * @private
  22039. * @param {Function} func The function to check.
  22040. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  22041. */
  22042. function isMasked(func) {
  22043. return !!maskSrcKey && (maskSrcKey in func);
  22044. }
  22045. /**
  22046. * Converts `string` to a property path array.
  22047. *
  22048. * @private
  22049. * @param {string} string The string to convert.
  22050. * @returns {Array} Returns the property path array.
  22051. */
  22052. var stringToPath = memoize(function(string) {
  22053. string = toString(string);
  22054. var result = [];
  22055. if (reLeadingDot.test(string)) {
  22056. result.push('');
  22057. }
  22058. string.replace(rePropName, function(match, number, quote, string) {
  22059. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  22060. });
  22061. return result;
  22062. });
  22063. /**
  22064. * Converts `value` to a string key if it's not a string or symbol.
  22065. *
  22066. * @private
  22067. * @param {*} value The value to inspect.
  22068. * @returns {string|symbol} Returns the key.
  22069. */
  22070. function toKey(value) {
  22071. if (typeof value == 'string' || isSymbol(value)) {
  22072. return value;
  22073. }
  22074. var result = (value + '');
  22075. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  22076. }
  22077. /**
  22078. * Converts `func` to its source code.
  22079. *
  22080. * @private
  22081. * @param {Function} func The function to process.
  22082. * @returns {string} Returns the source code.
  22083. */
  22084. function toSource(func) {
  22085. if (func != null) {
  22086. try {
  22087. return funcToString.call(func);
  22088. } catch (e) {}
  22089. try {
  22090. return (func + '');
  22091. } catch (e) {}
  22092. }
  22093. return '';
  22094. }
  22095. /**
  22096. * Creates a function that memoizes the result of `func`. If `resolver` is
  22097. * provided, it determines the cache key for storing the result based on the
  22098. * arguments provided to the memoized function. By default, the first argument
  22099. * provided to the memoized function is used as the map cache key. The `func`
  22100. * is invoked with the `this` binding of the memoized function.
  22101. *
  22102. * **Note:** The cache is exposed as the `cache` property on the memoized
  22103. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  22104. * constructor with one whose instances implement the
  22105. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  22106. * method interface of `delete`, `get`, `has`, and `set`.
  22107. *
  22108. * @static
  22109. * @memberOf _
  22110. * @since 0.1.0
  22111. * @category Function
  22112. * @param {Function} func The function to have its output memoized.
  22113. * @param {Function} [resolver] The function to resolve the cache key.
  22114. * @returns {Function} Returns the new memoized function.
  22115. * @example
  22116. *
  22117. * var object = { 'a': 1, 'b': 2 };
  22118. * var other = { 'c': 3, 'd': 4 };
  22119. *
  22120. * var values = _.memoize(_.values);
  22121. * values(object);
  22122. * // => [1, 2]
  22123. *
  22124. * values(other);
  22125. * // => [3, 4]
  22126. *
  22127. * object.a = 2;
  22128. * values(object);
  22129. * // => [1, 2]
  22130. *
  22131. * // Modify the result cache.
  22132. * values.cache.set(object, ['a', 'b']);
  22133. * values(object);
  22134. * // => ['a', 'b']
  22135. *
  22136. * // Replace `_.memoize.Cache`.
  22137. * _.memoize.Cache = WeakMap;
  22138. */
  22139. function memoize(func, resolver) {
  22140. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  22141. throw new TypeError(FUNC_ERROR_TEXT);
  22142. }
  22143. var memoized = function() {
  22144. var args = arguments,
  22145. key = resolver ? resolver.apply(this, args) : args[0],
  22146. cache = memoized.cache;
  22147. if (cache.has(key)) {
  22148. return cache.get(key);
  22149. }
  22150. var result = func.apply(this, args);
  22151. memoized.cache = cache.set(key, result);
  22152. return result;
  22153. };
  22154. memoized.cache = new (memoize.Cache || MapCache);
  22155. return memoized;
  22156. }
  22157. // Assign cache to `_.memoize`.
  22158. memoize.Cache = MapCache;
  22159. /**
  22160. * Performs a
  22161. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  22162. * comparison between two values to determine if they are equivalent.
  22163. *
  22164. * @static
  22165. * @memberOf _
  22166. * @since 4.0.0
  22167. * @category Lang
  22168. * @param {*} value The value to compare.
  22169. * @param {*} other The other value to compare.
  22170. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  22171. * @example
  22172. *
  22173. * var object = { 'a': 1 };
  22174. * var other = { 'a': 1 };
  22175. *
  22176. * _.eq(object, object);
  22177. * // => true
  22178. *
  22179. * _.eq(object, other);
  22180. * // => false
  22181. *
  22182. * _.eq('a', 'a');
  22183. * // => true
  22184. *
  22185. * _.eq('a', Object('a'));
  22186. * // => false
  22187. *
  22188. * _.eq(NaN, NaN);
  22189. * // => true
  22190. */
  22191. function eq(value, other) {
  22192. return value === other || (value !== value && other !== other);
  22193. }
  22194. /**
  22195. * Checks if `value` is classified as an `Array` object.
  22196. *
  22197. * @static
  22198. * @memberOf _
  22199. * @since 0.1.0
  22200. * @category Lang
  22201. * @param {*} value The value to check.
  22202. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  22203. * @example
  22204. *
  22205. * _.isArray([1, 2, 3]);
  22206. * // => true
  22207. *
  22208. * _.isArray(document.body.children);
  22209. * // => false
  22210. *
  22211. * _.isArray('abc');
  22212. * // => false
  22213. *
  22214. * _.isArray(_.noop);
  22215. * // => false
  22216. */
  22217. var isArray = Array.isArray;
  22218. /**
  22219. * Checks if `value` is classified as a `Function` object.
  22220. *
  22221. * @static
  22222. * @memberOf _
  22223. * @since 0.1.0
  22224. * @category Lang
  22225. * @param {*} value The value to check.
  22226. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  22227. * @example
  22228. *
  22229. * _.isFunction(_);
  22230. * // => true
  22231. *
  22232. * _.isFunction(/abc/);
  22233. * // => false
  22234. */
  22235. function isFunction(value) {
  22236. // The use of `Object#toString` avoids issues with the `typeof` operator
  22237. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  22238. var tag = isObject(value) ? objectToString.call(value) : '';
  22239. return tag == funcTag || tag == genTag;
  22240. }
  22241. /**
  22242. * Checks if `value` is the
  22243. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  22244. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  22245. *
  22246. * @static
  22247. * @memberOf _
  22248. * @since 0.1.0
  22249. * @category Lang
  22250. * @param {*} value The value to check.
  22251. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  22252. * @example
  22253. *
  22254. * _.isObject({});
  22255. * // => true
  22256. *
  22257. * _.isObject([1, 2, 3]);
  22258. * // => true
  22259. *
  22260. * _.isObject(_.noop);
  22261. * // => true
  22262. *
  22263. * _.isObject(null);
  22264. * // => false
  22265. */
  22266. function isObject(value) {
  22267. var type = typeof value;
  22268. return !!value && (type == 'object' || type == 'function');
  22269. }
  22270. /**
  22271. * Checks if `value` is object-like. A value is object-like if it's not `null`
  22272. * and has a `typeof` result of "object".
  22273. *
  22274. * @static
  22275. * @memberOf _
  22276. * @since 4.0.0
  22277. * @category Lang
  22278. * @param {*} value The value to check.
  22279. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  22280. * @example
  22281. *
  22282. * _.isObjectLike({});
  22283. * // => true
  22284. *
  22285. * _.isObjectLike([1, 2, 3]);
  22286. * // => true
  22287. *
  22288. * _.isObjectLike(_.noop);
  22289. * // => false
  22290. *
  22291. * _.isObjectLike(null);
  22292. * // => false
  22293. */
  22294. function isObjectLike(value) {
  22295. return !!value && typeof value == 'object';
  22296. }
  22297. /**
  22298. * Checks if `value` is classified as a `Symbol` primitive or object.
  22299. *
  22300. * @static
  22301. * @memberOf _
  22302. * @since 4.0.0
  22303. * @category Lang
  22304. * @param {*} value The value to check.
  22305. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  22306. * @example
  22307. *
  22308. * _.isSymbol(Symbol.iterator);
  22309. * // => true
  22310. *
  22311. * _.isSymbol('abc');
  22312. * // => false
  22313. */
  22314. function isSymbol(value) {
  22315. return typeof value == 'symbol' ||
  22316. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  22317. }
  22318. /**
  22319. * Converts `value` to a string. An empty string is returned for `null`
  22320. * and `undefined` values. The sign of `-0` is preserved.
  22321. *
  22322. * @static
  22323. * @memberOf _
  22324. * @since 4.0.0
  22325. * @category Lang
  22326. * @param {*} value The value to process.
  22327. * @returns {string} Returns the string.
  22328. * @example
  22329. *
  22330. * _.toString(null);
  22331. * // => ''
  22332. *
  22333. * _.toString(-0);
  22334. * // => '-0'
  22335. *
  22336. * _.toString([1, 2, 3]);
  22337. * // => '1,2,3'
  22338. */
  22339. function toString(value) {
  22340. return value == null ? '' : baseToString(value);
  22341. }
  22342. /**
  22343. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  22344. * it's created. Arrays are created for missing index properties while objects
  22345. * are created for all other missing properties. Use `_.setWith` to customize
  22346. * `path` creation.
  22347. *
  22348. * **Note:** This method mutates `object`.
  22349. *
  22350. * @static
  22351. * @memberOf _
  22352. * @since 3.7.0
  22353. * @category Object
  22354. * @param {Object} object The object to modify.
  22355. * @param {Array|string} path The path of the property to set.
  22356. * @param {*} value The value to set.
  22357. * @returns {Object} Returns `object`.
  22358. * @example
  22359. *
  22360. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  22361. *
  22362. * _.set(object, 'a[0].b.c', 4);
  22363. * console.log(object.a[0].b.c);
  22364. * // => 4
  22365. *
  22366. * _.set(object, ['x', '0', 'y', 'z'], 5);
  22367. * console.log(object.x[0].y.z);
  22368. * // => 5
  22369. */
  22370. function set(object, path, value) {
  22371. return object == null ? object : baseSet(object, path, value);
  22372. }
  22373. module.exports = set;
  22374. /***/ }),
  22375. /***/ 554:
  22376. /***/ (function(module) {
  22377. "use strict";
  22378. var isStream = module.exports = function (stream) {
  22379. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  22380. };
  22381. isStream.writable = function (stream) {
  22382. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  22383. };
  22384. isStream.readable = function (stream) {
  22385. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  22386. };
  22387. isStream.duplex = function (stream) {
  22388. return isStream.writable(stream) && isStream.readable(stream);
  22389. };
  22390. isStream.transform = function (stream) {
  22391. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  22392. };
  22393. /***/ }),
  22394. /***/ 555:
  22395. /***/ (function(module, __unusedexports, __webpack_require__) {
  22396. module.exports = authenticationPlugin;
  22397. const { createTokenAuth } = __webpack_require__(334);
  22398. const { Deprecation } = __webpack_require__(932);
  22399. const once = __webpack_require__(223);
  22400. const beforeRequest = __webpack_require__(733);
  22401. const requestError = __webpack_require__(217);
  22402. const validate = __webpack_require__(997);
  22403. const withAuthorizationPrefix = __webpack_require__(603);
  22404. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  22405. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  22406. function authenticationPlugin(octokit, options) {
  22407. // If `options.authStrategy` is set then use it and pass in `options.auth`
  22408. if (options.authStrategy) {
  22409. const auth = options.authStrategy(options.auth);
  22410. octokit.hook.wrap("request", auth.hook);
  22411. octokit.auth = auth;
  22412. return;
  22413. }
  22414. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  22415. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  22416. if (!options.auth) {
  22417. octokit.auth = () =>
  22418. Promise.resolve({
  22419. type: "unauthenticated"
  22420. });
  22421. return;
  22422. }
  22423. const isBasicAuthString =
  22424. typeof options.auth === "string" &&
  22425. /^basic/.test(withAuthorizationPrefix(options.auth));
  22426. // If only `options.auth` is set to a string, use the default token authentication strategy.
  22427. if (typeof options.auth === "string" && !isBasicAuthString) {
  22428. const auth = createTokenAuth(options.auth);
  22429. octokit.hook.wrap("request", auth.hook);
  22430. octokit.auth = auth;
  22431. return;
  22432. }
  22433. // Otherwise log a deprecation message
  22434. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  22435. ? [
  22436. deprecateAuthBasic,
  22437. '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)'
  22438. ]
  22439. : [
  22440. deprecateAuthObject,
  22441. '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)'
  22442. ];
  22443. deprecationMethod(
  22444. octokit.log,
  22445. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  22446. );
  22447. octokit.auth = () =>
  22448. Promise.resolve({
  22449. type: "deprecated",
  22450. message: deprecationMessapge
  22451. });
  22452. validate(options.auth);
  22453. const state = {
  22454. octokit,
  22455. auth: options.auth
  22456. };
  22457. octokit.hook.before("request", beforeRequest.bind(null, state));
  22458. octokit.hook.error("request", requestError.bind(null, state));
  22459. }
  22460. /***/ }),
  22461. /***/ 560:
  22462. /***/ (function(module) {
  22463. "use strict";
  22464. /**
  22465. * Tries to execute a function and discards any error that occurs.
  22466. * @param {Function} fn - Function that might or might not throw an error.
  22467. * @returns {?*} Return-value of the function when no error occurred.
  22468. */
  22469. module.exports = function(fn) {
  22470. try { return fn() } catch (e) {}
  22471. }
  22472. /***/ }),
  22473. /***/ 562:
  22474. /***/ (function(module, exports) {
  22475. exports = module.exports = SemVer
  22476. var debug
  22477. /* istanbul ignore next */
  22478. if (typeof process === 'object' &&
  22479. process.env &&
  22480. process.env.NODE_DEBUG &&
  22481. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  22482. debug = function () {
  22483. var args = Array.prototype.slice.call(arguments, 0)
  22484. args.unshift('SEMVER')
  22485. console.log.apply(console, args)
  22486. }
  22487. } else {
  22488. debug = function () {}
  22489. }
  22490. // Note: this is the semver.org version of the spec that it implements
  22491. // Not necessarily the package version of this code.
  22492. exports.SEMVER_SPEC_VERSION = '2.0.0'
  22493. var MAX_LENGTH = 256
  22494. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  22495. /* istanbul ignore next */ 9007199254740991
  22496. // Max safe segment length for coercion.
  22497. var MAX_SAFE_COMPONENT_LENGTH = 16
  22498. // The actual regexps go on exports.re
  22499. var re = exports.re = []
  22500. var src = exports.src = []
  22501. var t = exports.tokens = {}
  22502. var R = 0
  22503. function tok (n) {
  22504. t[n] = R++
  22505. }
  22506. // The following Regular Expressions can be used for tokenizing,
  22507. // validating, and parsing SemVer version strings.
  22508. // ## Numeric Identifier
  22509. // A single `0`, or a non-zero digit followed by zero or more digits.
  22510. tok('NUMERICIDENTIFIER')
  22511. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  22512. tok('NUMERICIDENTIFIERLOOSE')
  22513. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  22514. // ## Non-numeric Identifier
  22515. // Zero or more digits, followed by a letter or hyphen, and then zero or
  22516. // more letters, digits, or hyphens.
  22517. tok('NONNUMERICIDENTIFIER')
  22518. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  22519. // ## Main Version
  22520. // Three dot-separated numeric identifiers.
  22521. tok('MAINVERSION')
  22522. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  22523. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  22524. '(' + src[t.NUMERICIDENTIFIER] + ')'
  22525. tok('MAINVERSIONLOOSE')
  22526. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  22527. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  22528. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  22529. // ## Pre-release Version Identifier
  22530. // A numeric identifier, or a non-numeric identifier.
  22531. tok('PRERELEASEIDENTIFIER')
  22532. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  22533. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  22534. tok('PRERELEASEIDENTIFIERLOOSE')
  22535. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  22536. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  22537. // ## Pre-release Version
  22538. // Hyphen, followed by one or more dot-separated pre-release version
  22539. // identifiers.
  22540. tok('PRERELEASE')
  22541. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  22542. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  22543. tok('PRERELEASELOOSE')
  22544. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  22545. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  22546. // ## Build Metadata Identifier
  22547. // Any combination of digits, letters, or hyphens.
  22548. tok('BUILDIDENTIFIER')
  22549. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  22550. // ## Build Metadata
  22551. // Plus sign, followed by one or more period-separated build metadata
  22552. // identifiers.
  22553. tok('BUILD')
  22554. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  22555. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  22556. // ## Full Version String
  22557. // A main version, followed optionally by a pre-release version and
  22558. // build metadata.
  22559. // Note that the only major, minor, patch, and pre-release sections of
  22560. // the version string are capturing groups. The build metadata is not a
  22561. // capturing group, because it should not ever be used in version
  22562. // comparison.
  22563. tok('FULL')
  22564. tok('FULLPLAIN')
  22565. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  22566. src[t.PRERELEASE] + '?' +
  22567. src[t.BUILD] + '?'
  22568. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  22569. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  22570. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  22571. // common in the npm registry.
  22572. tok('LOOSEPLAIN')
  22573. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  22574. src[t.PRERELEASELOOSE] + '?' +
  22575. src[t.BUILD] + '?'
  22576. tok('LOOSE')
  22577. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  22578. tok('GTLT')
  22579. src[t.GTLT] = '((?:<|>)?=?)'
  22580. // Something like "2.*" or "1.2.x".
  22581. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  22582. // Only the first item is strictly required.
  22583. tok('XRANGEIDENTIFIERLOOSE')
  22584. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  22585. tok('XRANGEIDENTIFIER')
  22586. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  22587. tok('XRANGEPLAIN')
  22588. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  22589. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  22590. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  22591. '(?:' + src[t.PRERELEASE] + ')?' +
  22592. src[t.BUILD] + '?' +
  22593. ')?)?'
  22594. tok('XRANGEPLAINLOOSE')
  22595. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  22596. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  22597. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  22598. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  22599. src[t.BUILD] + '?' +
  22600. ')?)?'
  22601. tok('XRANGE')
  22602. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  22603. tok('XRANGELOOSE')
  22604. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  22605. // Coercion.
  22606. // Extract anything that could conceivably be a part of a valid semver
  22607. tok('COERCE')
  22608. src[t.COERCE] = '(^|[^\\d])' +
  22609. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  22610. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  22611. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  22612. '(?:$|[^\\d])'
  22613. tok('COERCERTL')
  22614. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  22615. // Tilde ranges.
  22616. // Meaning is "reasonably at or greater than"
  22617. tok('LONETILDE')
  22618. src[t.LONETILDE] = '(?:~>?)'
  22619. tok('TILDETRIM')
  22620. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  22621. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  22622. var tildeTrimReplace = '$1~'
  22623. tok('TILDE')
  22624. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  22625. tok('TILDELOOSE')
  22626. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  22627. // Caret ranges.
  22628. // Meaning is "at least and backwards compatible with"
  22629. tok('LONECARET')
  22630. src[t.LONECARET] = '(?:\\^)'
  22631. tok('CARETTRIM')
  22632. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  22633. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  22634. var caretTrimReplace = '$1^'
  22635. tok('CARET')
  22636. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  22637. tok('CARETLOOSE')
  22638. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  22639. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  22640. tok('COMPARATORLOOSE')
  22641. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  22642. tok('COMPARATOR')
  22643. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  22644. // An expression to strip any whitespace between the gtlt and the thing
  22645. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  22646. tok('COMPARATORTRIM')
  22647. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  22648. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  22649. // this one has to use the /g flag
  22650. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  22651. var comparatorTrimReplace = '$1$2$3'
  22652. // Something like `1.2.3 - 1.2.4`
  22653. // Note that these all use the loose form, because they'll be
  22654. // checked against either the strict or loose comparator form
  22655. // later.
  22656. tok('HYPHENRANGE')
  22657. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  22658. '\\s+-\\s+' +
  22659. '(' + src[t.XRANGEPLAIN] + ')' +
  22660. '\\s*$'
  22661. tok('HYPHENRANGELOOSE')
  22662. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  22663. '\\s+-\\s+' +
  22664. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  22665. '\\s*$'
  22666. // Star ranges basically just allow anything at all.
  22667. tok('STAR')
  22668. src[t.STAR] = '(<|>)?=?\\s*\\*'
  22669. // Compile to actual regexp objects.
  22670. // All are flag-free, unless they were created above with a flag.
  22671. for (var i = 0; i < R; i++) {
  22672. debug(i, src[i])
  22673. if (!re[i]) {
  22674. re[i] = new RegExp(src[i])
  22675. }
  22676. }
  22677. exports.parse = parse
  22678. function parse (version, options) {
  22679. if (!options || typeof options !== 'object') {
  22680. options = {
  22681. loose: !!options,
  22682. includePrerelease: false
  22683. }
  22684. }
  22685. if (version instanceof SemVer) {
  22686. return version
  22687. }
  22688. if (typeof version !== 'string') {
  22689. return null
  22690. }
  22691. if (version.length > MAX_LENGTH) {
  22692. return null
  22693. }
  22694. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  22695. if (!r.test(version)) {
  22696. return null
  22697. }
  22698. try {
  22699. return new SemVer(version, options)
  22700. } catch (er) {
  22701. return null
  22702. }
  22703. }
  22704. exports.valid = valid
  22705. function valid (version, options) {
  22706. var v = parse(version, options)
  22707. return v ? v.version : null
  22708. }
  22709. exports.clean = clean
  22710. function clean (version, options) {
  22711. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  22712. return s ? s.version : null
  22713. }
  22714. exports.SemVer = SemVer
  22715. function SemVer (version, options) {
  22716. if (!options || typeof options !== 'object') {
  22717. options = {
  22718. loose: !!options,
  22719. includePrerelease: false
  22720. }
  22721. }
  22722. if (version instanceof SemVer) {
  22723. if (version.loose === options.loose) {
  22724. return version
  22725. } else {
  22726. version = version.version
  22727. }
  22728. } else if (typeof version !== 'string') {
  22729. throw new TypeError('Invalid Version: ' + version)
  22730. }
  22731. if (version.length > MAX_LENGTH) {
  22732. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  22733. }
  22734. if (!(this instanceof SemVer)) {
  22735. return new SemVer(version, options)
  22736. }
  22737. debug('SemVer', version, options)
  22738. this.options = options
  22739. this.loose = !!options.loose
  22740. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  22741. if (!m) {
  22742. throw new TypeError('Invalid Version: ' + version)
  22743. }
  22744. this.raw = version
  22745. // these are actually numbers
  22746. this.major = +m[1]
  22747. this.minor = +m[2]
  22748. this.patch = +m[3]
  22749. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  22750. throw new TypeError('Invalid major version')
  22751. }
  22752. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  22753. throw new TypeError('Invalid minor version')
  22754. }
  22755. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  22756. throw new TypeError('Invalid patch version')
  22757. }
  22758. // numberify any prerelease numeric ids
  22759. if (!m[4]) {
  22760. this.prerelease = []
  22761. } else {
  22762. this.prerelease = m[4].split('.').map(function (id) {
  22763. if (/^[0-9]+$/.test(id)) {
  22764. var num = +id
  22765. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  22766. return num
  22767. }
  22768. }
  22769. return id
  22770. })
  22771. }
  22772. this.build = m[5] ? m[5].split('.') : []
  22773. this.format()
  22774. }
  22775. SemVer.prototype.format = function () {
  22776. this.version = this.major + '.' + this.minor + '.' + this.patch
  22777. if (this.prerelease.length) {
  22778. this.version += '-' + this.prerelease.join('.')
  22779. }
  22780. return this.version
  22781. }
  22782. SemVer.prototype.toString = function () {
  22783. return this.version
  22784. }
  22785. SemVer.prototype.compare = function (other) {
  22786. debug('SemVer.compare', this.version, this.options, other)
  22787. if (!(other instanceof SemVer)) {
  22788. other = new SemVer(other, this.options)
  22789. }
  22790. return this.compareMain(other) || this.comparePre(other)
  22791. }
  22792. SemVer.prototype.compareMain = function (other) {
  22793. if (!(other instanceof SemVer)) {
  22794. other = new SemVer(other, this.options)
  22795. }
  22796. return compareIdentifiers(this.major, other.major) ||
  22797. compareIdentifiers(this.minor, other.minor) ||
  22798. compareIdentifiers(this.patch, other.patch)
  22799. }
  22800. SemVer.prototype.comparePre = function (other) {
  22801. if (!(other instanceof SemVer)) {
  22802. other = new SemVer(other, this.options)
  22803. }
  22804. // NOT having a prerelease is > having one
  22805. if (this.prerelease.length && !other.prerelease.length) {
  22806. return -1
  22807. } else if (!this.prerelease.length && other.prerelease.length) {
  22808. return 1
  22809. } else if (!this.prerelease.length && !other.prerelease.length) {
  22810. return 0
  22811. }
  22812. var i = 0
  22813. do {
  22814. var a = this.prerelease[i]
  22815. var b = other.prerelease[i]
  22816. debug('prerelease compare', i, a, b)
  22817. if (a === undefined && b === undefined) {
  22818. return 0
  22819. } else if (b === undefined) {
  22820. return 1
  22821. } else if (a === undefined) {
  22822. return -1
  22823. } else if (a === b) {
  22824. continue
  22825. } else {
  22826. return compareIdentifiers(a, b)
  22827. }
  22828. } while (++i)
  22829. }
  22830. SemVer.prototype.compareBuild = function (other) {
  22831. if (!(other instanceof SemVer)) {
  22832. other = new SemVer(other, this.options)
  22833. }
  22834. var i = 0
  22835. do {
  22836. var a = this.build[i]
  22837. var b = other.build[i]
  22838. debug('prerelease compare', i, a, b)
  22839. if (a === undefined && b === undefined) {
  22840. return 0
  22841. } else if (b === undefined) {
  22842. return 1
  22843. } else if (a === undefined) {
  22844. return -1
  22845. } else if (a === b) {
  22846. continue
  22847. } else {
  22848. return compareIdentifiers(a, b)
  22849. }
  22850. } while (++i)
  22851. }
  22852. // preminor will bump the version up to the next minor release, and immediately
  22853. // down to pre-release. premajor and prepatch work the same way.
  22854. SemVer.prototype.inc = function (release, identifier) {
  22855. switch (release) {
  22856. case 'premajor':
  22857. this.prerelease.length = 0
  22858. this.patch = 0
  22859. this.minor = 0
  22860. this.major++
  22861. this.inc('pre', identifier)
  22862. break
  22863. case 'preminor':
  22864. this.prerelease.length = 0
  22865. this.patch = 0
  22866. this.minor++
  22867. this.inc('pre', identifier)
  22868. break
  22869. case 'prepatch':
  22870. // If this is already a prerelease, it will bump to the next version
  22871. // drop any prereleases that might already exist, since they are not
  22872. // relevant at this point.
  22873. this.prerelease.length = 0
  22874. this.inc('patch', identifier)
  22875. this.inc('pre', identifier)
  22876. break
  22877. // If the input is a non-prerelease version, this acts the same as
  22878. // prepatch.
  22879. case 'prerelease':
  22880. if (this.prerelease.length === 0) {
  22881. this.inc('patch', identifier)
  22882. }
  22883. this.inc('pre', identifier)
  22884. break
  22885. case 'major':
  22886. // If this is a pre-major version, bump up to the same major version.
  22887. // Otherwise increment major.
  22888. // 1.0.0-5 bumps to 1.0.0
  22889. // 1.1.0 bumps to 2.0.0
  22890. if (this.minor !== 0 ||
  22891. this.patch !== 0 ||
  22892. this.prerelease.length === 0) {
  22893. this.major++
  22894. }
  22895. this.minor = 0
  22896. this.patch = 0
  22897. this.prerelease = []
  22898. break
  22899. case 'minor':
  22900. // If this is a pre-minor version, bump up to the same minor version.
  22901. // Otherwise increment minor.
  22902. // 1.2.0-5 bumps to 1.2.0
  22903. // 1.2.1 bumps to 1.3.0
  22904. if (this.patch !== 0 || this.prerelease.length === 0) {
  22905. this.minor++
  22906. }
  22907. this.patch = 0
  22908. this.prerelease = []
  22909. break
  22910. case 'patch':
  22911. // If this is not a pre-release version, it will increment the patch.
  22912. // If it is a pre-release it will bump up to the same patch version.
  22913. // 1.2.0-5 patches to 1.2.0
  22914. // 1.2.0 patches to 1.2.1
  22915. if (this.prerelease.length === 0) {
  22916. this.patch++
  22917. }
  22918. this.prerelease = []
  22919. break
  22920. // This probably shouldn't be used publicly.
  22921. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  22922. case 'pre':
  22923. if (this.prerelease.length === 0) {
  22924. this.prerelease = [0]
  22925. } else {
  22926. var i = this.prerelease.length
  22927. while (--i >= 0) {
  22928. if (typeof this.prerelease[i] === 'number') {
  22929. this.prerelease[i]++
  22930. i = -2
  22931. }
  22932. }
  22933. if (i === -1) {
  22934. // didn't increment anything
  22935. this.prerelease.push(0)
  22936. }
  22937. }
  22938. if (identifier) {
  22939. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  22940. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  22941. if (this.prerelease[0] === identifier) {
  22942. if (isNaN(this.prerelease[1])) {
  22943. this.prerelease = [identifier, 0]
  22944. }
  22945. } else {
  22946. this.prerelease = [identifier, 0]
  22947. }
  22948. }
  22949. break
  22950. default:
  22951. throw new Error('invalid increment argument: ' + release)
  22952. }
  22953. this.format()
  22954. this.raw = this.version
  22955. return this
  22956. }
  22957. exports.inc = inc
  22958. function inc (version, release, loose, identifier) {
  22959. if (typeof (loose) === 'string') {
  22960. identifier = loose
  22961. loose = undefined
  22962. }
  22963. try {
  22964. return new SemVer(version, loose).inc(release, identifier).version
  22965. } catch (er) {
  22966. return null
  22967. }
  22968. }
  22969. exports.diff = diff
  22970. function diff (version1, version2) {
  22971. if (eq(version1, version2)) {
  22972. return null
  22973. } else {
  22974. var v1 = parse(version1)
  22975. var v2 = parse(version2)
  22976. var prefix = ''
  22977. if (v1.prerelease.length || v2.prerelease.length) {
  22978. prefix = 'pre'
  22979. var defaultResult = 'prerelease'
  22980. }
  22981. for (var key in v1) {
  22982. if (key === 'major' || key === 'minor' || key === 'patch') {
  22983. if (v1[key] !== v2[key]) {
  22984. return prefix + key
  22985. }
  22986. }
  22987. }
  22988. return defaultResult // may be undefined
  22989. }
  22990. }
  22991. exports.compareIdentifiers = compareIdentifiers
  22992. var numeric = /^[0-9]+$/
  22993. function compareIdentifiers (a, b) {
  22994. var anum = numeric.test(a)
  22995. var bnum = numeric.test(b)
  22996. if (anum && bnum) {
  22997. a = +a
  22998. b = +b
  22999. }
  23000. return a === b ? 0
  23001. : (anum && !bnum) ? -1
  23002. : (bnum && !anum) ? 1
  23003. : a < b ? -1
  23004. : 1
  23005. }
  23006. exports.rcompareIdentifiers = rcompareIdentifiers
  23007. function rcompareIdentifiers (a, b) {
  23008. return compareIdentifiers(b, a)
  23009. }
  23010. exports.major = major
  23011. function major (a, loose) {
  23012. return new SemVer(a, loose).major
  23013. }
  23014. exports.minor = minor
  23015. function minor (a, loose) {
  23016. return new SemVer(a, loose).minor
  23017. }
  23018. exports.patch = patch
  23019. function patch (a, loose) {
  23020. return new SemVer(a, loose).patch
  23021. }
  23022. exports.compare = compare
  23023. function compare (a, b, loose) {
  23024. return new SemVer(a, loose).compare(new SemVer(b, loose))
  23025. }
  23026. exports.compareLoose = compareLoose
  23027. function compareLoose (a, b) {
  23028. return compare(a, b, true)
  23029. }
  23030. exports.compareBuild = compareBuild
  23031. function compareBuild (a, b, loose) {
  23032. var versionA = new SemVer(a, loose)
  23033. var versionB = new SemVer(b, loose)
  23034. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  23035. }
  23036. exports.rcompare = rcompare
  23037. function rcompare (a, b, loose) {
  23038. return compare(b, a, loose)
  23039. }
  23040. exports.sort = sort
  23041. function sort (list, loose) {
  23042. return list.sort(function (a, b) {
  23043. return exports.compareBuild(a, b, loose)
  23044. })
  23045. }
  23046. exports.rsort = rsort
  23047. function rsort (list, loose) {
  23048. return list.sort(function (a, b) {
  23049. return exports.compareBuild(b, a, loose)
  23050. })
  23051. }
  23052. exports.gt = gt
  23053. function gt (a, b, loose) {
  23054. return compare(a, b, loose) > 0
  23055. }
  23056. exports.lt = lt
  23057. function lt (a, b, loose) {
  23058. return compare(a, b, loose) < 0
  23059. }
  23060. exports.eq = eq
  23061. function eq (a, b, loose) {
  23062. return compare(a, b, loose) === 0
  23063. }
  23064. exports.neq = neq
  23065. function neq (a, b, loose) {
  23066. return compare(a, b, loose) !== 0
  23067. }
  23068. exports.gte = gte
  23069. function gte (a, b, loose) {
  23070. return compare(a, b, loose) >= 0
  23071. }
  23072. exports.lte = lte
  23073. function lte (a, b, loose) {
  23074. return compare(a, b, loose) <= 0
  23075. }
  23076. exports.cmp = cmp
  23077. function cmp (a, op, b, loose) {
  23078. switch (op) {
  23079. case '===':
  23080. if (typeof a === 'object')
  23081. a = a.version
  23082. if (typeof b === 'object')
  23083. b = b.version
  23084. return a === b
  23085. case '!==':
  23086. if (typeof a === 'object')
  23087. a = a.version
  23088. if (typeof b === 'object')
  23089. b = b.version
  23090. return a !== b
  23091. case '':
  23092. case '=':
  23093. case '==':
  23094. return eq(a, b, loose)
  23095. case '!=':
  23096. return neq(a, b, loose)
  23097. case '>':
  23098. return gt(a, b, loose)
  23099. case '>=':
  23100. return gte(a, b, loose)
  23101. case '<':
  23102. return lt(a, b, loose)
  23103. case '<=':
  23104. return lte(a, b, loose)
  23105. default:
  23106. throw new TypeError('Invalid operator: ' + op)
  23107. }
  23108. }
  23109. exports.Comparator = Comparator
  23110. function Comparator (comp, options) {
  23111. if (!options || typeof options !== 'object') {
  23112. options = {
  23113. loose: !!options,
  23114. includePrerelease: false
  23115. }
  23116. }
  23117. if (comp instanceof Comparator) {
  23118. if (comp.loose === !!options.loose) {
  23119. return comp
  23120. } else {
  23121. comp = comp.value
  23122. }
  23123. }
  23124. if (!(this instanceof Comparator)) {
  23125. return new Comparator(comp, options)
  23126. }
  23127. debug('comparator', comp, options)
  23128. this.options = options
  23129. this.loose = !!options.loose
  23130. this.parse(comp)
  23131. if (this.semver === ANY) {
  23132. this.value = ''
  23133. } else {
  23134. this.value = this.operator + this.semver.version
  23135. }
  23136. debug('comp', this)
  23137. }
  23138. var ANY = {}
  23139. Comparator.prototype.parse = function (comp) {
  23140. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  23141. var m = comp.match(r)
  23142. if (!m) {
  23143. throw new TypeError('Invalid comparator: ' + comp)
  23144. }
  23145. this.operator = m[1] !== undefined ? m[1] : ''
  23146. if (this.operator === '=') {
  23147. this.operator = ''
  23148. }
  23149. // if it literally is just '>' or '' then allow anything.
  23150. if (!m[2]) {
  23151. this.semver = ANY
  23152. } else {
  23153. this.semver = new SemVer(m[2], this.options.loose)
  23154. }
  23155. }
  23156. Comparator.prototype.toString = function () {
  23157. return this.value
  23158. }
  23159. Comparator.prototype.test = function (version) {
  23160. debug('Comparator.test', version, this.options.loose)
  23161. if (this.semver === ANY || version === ANY) {
  23162. return true
  23163. }
  23164. if (typeof version === 'string') {
  23165. try {
  23166. version = new SemVer(version, this.options)
  23167. } catch (er) {
  23168. return false
  23169. }
  23170. }
  23171. return cmp(version, this.operator, this.semver, this.options)
  23172. }
  23173. Comparator.prototype.intersects = function (comp, options) {
  23174. if (!(comp instanceof Comparator)) {
  23175. throw new TypeError('a Comparator is required')
  23176. }
  23177. if (!options || typeof options !== 'object') {
  23178. options = {
  23179. loose: !!options,
  23180. includePrerelease: false
  23181. }
  23182. }
  23183. var rangeTmp
  23184. if (this.operator === '') {
  23185. if (this.value === '') {
  23186. return true
  23187. }
  23188. rangeTmp = new Range(comp.value, options)
  23189. return satisfies(this.value, rangeTmp, options)
  23190. } else if (comp.operator === '') {
  23191. if (comp.value === '') {
  23192. return true
  23193. }
  23194. rangeTmp = new Range(this.value, options)
  23195. return satisfies(comp.semver, rangeTmp, options)
  23196. }
  23197. var sameDirectionIncreasing =
  23198. (this.operator === '>=' || this.operator === '>') &&
  23199. (comp.operator === '>=' || comp.operator === '>')
  23200. var sameDirectionDecreasing =
  23201. (this.operator === '<=' || this.operator === '<') &&
  23202. (comp.operator === '<=' || comp.operator === '<')
  23203. var sameSemVer = this.semver.version === comp.semver.version
  23204. var differentDirectionsInclusive =
  23205. (this.operator === '>=' || this.operator === '<=') &&
  23206. (comp.operator === '>=' || comp.operator === '<=')
  23207. var oppositeDirectionsLessThan =
  23208. cmp(this.semver, '<', comp.semver, options) &&
  23209. ((this.operator === '>=' || this.operator === '>') &&
  23210. (comp.operator === '<=' || comp.operator === '<'))
  23211. var oppositeDirectionsGreaterThan =
  23212. cmp(this.semver, '>', comp.semver, options) &&
  23213. ((this.operator === '<=' || this.operator === '<') &&
  23214. (comp.operator === '>=' || comp.operator === '>'))
  23215. return sameDirectionIncreasing || sameDirectionDecreasing ||
  23216. (sameSemVer && differentDirectionsInclusive) ||
  23217. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  23218. }
  23219. exports.Range = Range
  23220. function Range (range, options) {
  23221. if (!options || typeof options !== 'object') {
  23222. options = {
  23223. loose: !!options,
  23224. includePrerelease: false
  23225. }
  23226. }
  23227. if (range instanceof Range) {
  23228. if (range.loose === !!options.loose &&
  23229. range.includePrerelease === !!options.includePrerelease) {
  23230. return range
  23231. } else {
  23232. return new Range(range.raw, options)
  23233. }
  23234. }
  23235. if (range instanceof Comparator) {
  23236. return new Range(range.value, options)
  23237. }
  23238. if (!(this instanceof Range)) {
  23239. return new Range(range, options)
  23240. }
  23241. this.options = options
  23242. this.loose = !!options.loose
  23243. this.includePrerelease = !!options.includePrerelease
  23244. // First, split based on boolean or ||
  23245. this.raw = range
  23246. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  23247. return this.parseRange(range.trim())
  23248. }, this).filter(function (c) {
  23249. // throw out any that are not relevant for whatever reason
  23250. return c.length
  23251. })
  23252. if (!this.set.length) {
  23253. throw new TypeError('Invalid SemVer Range: ' + range)
  23254. }
  23255. this.format()
  23256. }
  23257. Range.prototype.format = function () {
  23258. this.range = this.set.map(function (comps) {
  23259. return comps.join(' ').trim()
  23260. }).join('||').trim()
  23261. return this.range
  23262. }
  23263. Range.prototype.toString = function () {
  23264. return this.range
  23265. }
  23266. Range.prototype.parseRange = function (range) {
  23267. var loose = this.options.loose
  23268. range = range.trim()
  23269. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  23270. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  23271. range = range.replace(hr, hyphenReplace)
  23272. debug('hyphen replace', range)
  23273. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  23274. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  23275. debug('comparator trim', range, re[t.COMPARATORTRIM])
  23276. // `~ 1.2.3` => `~1.2.3`
  23277. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  23278. // `^ 1.2.3` => `^1.2.3`
  23279. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  23280. // normalize spaces
  23281. range = range.split(/\s+/).join(' ')
  23282. // At this point, the range is completely trimmed and
  23283. // ready to be split into comparators.
  23284. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  23285. var set = range.split(' ').map(function (comp) {
  23286. return parseComparator(comp, this.options)
  23287. }, this).join(' ').split(/\s+/)
  23288. if (this.options.loose) {
  23289. // in loose mode, throw out any that are not valid comparators
  23290. set = set.filter(function (comp) {
  23291. return !!comp.match(compRe)
  23292. })
  23293. }
  23294. set = set.map(function (comp) {
  23295. return new Comparator(comp, this.options)
  23296. }, this)
  23297. return set
  23298. }
  23299. Range.prototype.intersects = function (range, options) {
  23300. if (!(range instanceof Range)) {
  23301. throw new TypeError('a Range is required')
  23302. }
  23303. return this.set.some(function (thisComparators) {
  23304. return (
  23305. isSatisfiable(thisComparators, options) &&
  23306. range.set.some(function (rangeComparators) {
  23307. return (
  23308. isSatisfiable(rangeComparators, options) &&
  23309. thisComparators.every(function (thisComparator) {
  23310. return rangeComparators.every(function (rangeComparator) {
  23311. return thisComparator.intersects(rangeComparator, options)
  23312. })
  23313. })
  23314. )
  23315. })
  23316. )
  23317. })
  23318. }
  23319. // take a set of comparators and determine whether there
  23320. // exists a version which can satisfy it
  23321. function isSatisfiable (comparators, options) {
  23322. var result = true
  23323. var remainingComparators = comparators.slice()
  23324. var testComparator = remainingComparators.pop()
  23325. while (result && remainingComparators.length) {
  23326. result = remainingComparators.every(function (otherComparator) {
  23327. return testComparator.intersects(otherComparator, options)
  23328. })
  23329. testComparator = remainingComparators.pop()
  23330. }
  23331. return result
  23332. }
  23333. // Mostly just for testing and legacy API reasons
  23334. exports.toComparators = toComparators
  23335. function toComparators (range, options) {
  23336. return new Range(range, options).set.map(function (comp) {
  23337. return comp.map(function (c) {
  23338. return c.value
  23339. }).join(' ').trim().split(' ')
  23340. })
  23341. }
  23342. // comprised of xranges, tildes, stars, and gtlt's at this point.
  23343. // already replaced the hyphen ranges
  23344. // turn into a set of JUST comparators.
  23345. function parseComparator (comp, options) {
  23346. debug('comp', comp, options)
  23347. comp = replaceCarets(comp, options)
  23348. debug('caret', comp)
  23349. comp = replaceTildes(comp, options)
  23350. debug('tildes', comp)
  23351. comp = replaceXRanges(comp, options)
  23352. debug('xrange', comp)
  23353. comp = replaceStars(comp, options)
  23354. debug('stars', comp)
  23355. return comp
  23356. }
  23357. function isX (id) {
  23358. return !id || id.toLowerCase() === 'x' || id === '*'
  23359. }
  23360. // ~, ~> --> * (any, kinda silly)
  23361. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  23362. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  23363. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  23364. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  23365. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  23366. function replaceTildes (comp, options) {
  23367. return comp.trim().split(/\s+/).map(function (comp) {
  23368. return replaceTilde(comp, options)
  23369. }).join(' ')
  23370. }
  23371. function replaceTilde (comp, options) {
  23372. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  23373. return comp.replace(r, function (_, M, m, p, pr) {
  23374. debug('tilde', comp, _, M, m, p, pr)
  23375. var ret
  23376. if (isX(M)) {
  23377. ret = ''
  23378. } else if (isX(m)) {
  23379. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  23380. } else if (isX(p)) {
  23381. // ~1.2 == >=1.2.0 <1.3.0
  23382. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  23383. } else if (pr) {
  23384. debug('replaceTilde pr', pr)
  23385. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  23386. ' <' + M + '.' + (+m + 1) + '.0'
  23387. } else {
  23388. // ~1.2.3 == >=1.2.3 <1.3.0
  23389. ret = '>=' + M + '.' + m + '.' + p +
  23390. ' <' + M + '.' + (+m + 1) + '.0'
  23391. }
  23392. debug('tilde return', ret)
  23393. return ret
  23394. })
  23395. }
  23396. // ^ --> * (any, kinda silly)
  23397. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  23398. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  23399. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  23400. // ^1.2.3 --> >=1.2.3 <2.0.0
  23401. // ^1.2.0 --> >=1.2.0 <2.0.0
  23402. function replaceCarets (comp, options) {
  23403. return comp.trim().split(/\s+/).map(function (comp) {
  23404. return replaceCaret(comp, options)
  23405. }).join(' ')
  23406. }
  23407. function replaceCaret (comp, options) {
  23408. debug('caret', comp, options)
  23409. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  23410. return comp.replace(r, function (_, M, m, p, pr) {
  23411. debug('caret', comp, _, M, m, p, pr)
  23412. var ret
  23413. if (isX(M)) {
  23414. ret = ''
  23415. } else if (isX(m)) {
  23416. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  23417. } else if (isX(p)) {
  23418. if (M === '0') {
  23419. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  23420. } else {
  23421. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  23422. }
  23423. } else if (pr) {
  23424. debug('replaceCaret pr', pr)
  23425. if (M === '0') {
  23426. if (m === '0') {
  23427. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  23428. ' <' + M + '.' + m + '.' + (+p + 1)
  23429. } else {
  23430. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  23431. ' <' + M + '.' + (+m + 1) + '.0'
  23432. }
  23433. } else {
  23434. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  23435. ' <' + (+M + 1) + '.0.0'
  23436. }
  23437. } else {
  23438. debug('no pr')
  23439. if (M === '0') {
  23440. if (m === '0') {
  23441. ret = '>=' + M + '.' + m + '.' + p +
  23442. ' <' + M + '.' + m + '.' + (+p + 1)
  23443. } else {
  23444. ret = '>=' + M + '.' + m + '.' + p +
  23445. ' <' + M + '.' + (+m + 1) + '.0'
  23446. }
  23447. } else {
  23448. ret = '>=' + M + '.' + m + '.' + p +
  23449. ' <' + (+M + 1) + '.0.0'
  23450. }
  23451. }
  23452. debug('caret return', ret)
  23453. return ret
  23454. })
  23455. }
  23456. function replaceXRanges (comp, options) {
  23457. debug('replaceXRanges', comp, options)
  23458. return comp.split(/\s+/).map(function (comp) {
  23459. return replaceXRange(comp, options)
  23460. }).join(' ')
  23461. }
  23462. function replaceXRange (comp, options) {
  23463. comp = comp.trim()
  23464. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  23465. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  23466. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  23467. var xM = isX(M)
  23468. var xm = xM || isX(m)
  23469. var xp = xm || isX(p)
  23470. var anyX = xp
  23471. if (gtlt === '=' && anyX) {
  23472. gtlt = ''
  23473. }
  23474. // if we're including prereleases in the match, then we need
  23475. // to fix this to -0, the lowest possible prerelease value
  23476. pr = options.includePrerelease ? '-0' : ''
  23477. if (xM) {
  23478. if (gtlt === '>' || gtlt === '<') {
  23479. // nothing is allowed
  23480. ret = '<0.0.0-0'
  23481. } else {
  23482. // nothing is forbidden
  23483. ret = '*'
  23484. }
  23485. } else if (gtlt && anyX) {
  23486. // we know patch is an x, because we have any x at all.
  23487. // replace X with 0
  23488. if (xm) {
  23489. m = 0
  23490. }
  23491. p = 0
  23492. if (gtlt === '>') {
  23493. // >1 => >=2.0.0
  23494. // >1.2 => >=1.3.0
  23495. // >1.2.3 => >= 1.2.4
  23496. gtlt = '>='
  23497. if (xm) {
  23498. M = +M + 1
  23499. m = 0
  23500. p = 0
  23501. } else {
  23502. m = +m + 1
  23503. p = 0
  23504. }
  23505. } else if (gtlt === '<=') {
  23506. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  23507. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  23508. gtlt = '<'
  23509. if (xm) {
  23510. M = +M + 1
  23511. } else {
  23512. m = +m + 1
  23513. }
  23514. }
  23515. ret = gtlt + M + '.' + m + '.' + p + pr
  23516. } else if (xm) {
  23517. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  23518. } else if (xp) {
  23519. ret = '>=' + M + '.' + m + '.0' + pr +
  23520. ' <' + M + '.' + (+m + 1) + '.0' + pr
  23521. }
  23522. debug('xRange return', ret)
  23523. return ret
  23524. })
  23525. }
  23526. // Because * is AND-ed with everything else in the comparator,
  23527. // and '' means "any version", just remove the *s entirely.
  23528. function replaceStars (comp, options) {
  23529. debug('replaceStars', comp, options)
  23530. // Looseness is ignored here. star is always as loose as it gets!
  23531. return comp.trim().replace(re[t.STAR], '')
  23532. }
  23533. // This function is passed to string.replace(re[t.HYPHENRANGE])
  23534. // M, m, patch, prerelease, build
  23535. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  23536. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  23537. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  23538. function hyphenReplace ($0,
  23539. from, fM, fm, fp, fpr, fb,
  23540. to, tM, tm, tp, tpr, tb) {
  23541. if (isX(fM)) {
  23542. from = ''
  23543. } else if (isX(fm)) {
  23544. from = '>=' + fM + '.0.0'
  23545. } else if (isX(fp)) {
  23546. from = '>=' + fM + '.' + fm + '.0'
  23547. } else {
  23548. from = '>=' + from
  23549. }
  23550. if (isX(tM)) {
  23551. to = ''
  23552. } else if (isX(tm)) {
  23553. to = '<' + (+tM + 1) + '.0.0'
  23554. } else if (isX(tp)) {
  23555. to = '<' + tM + '.' + (+tm + 1) + '.0'
  23556. } else if (tpr) {
  23557. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  23558. } else {
  23559. to = '<=' + to
  23560. }
  23561. return (from + ' ' + to).trim()
  23562. }
  23563. // if ANY of the sets match ALL of its comparators, then pass
  23564. Range.prototype.test = function (version) {
  23565. if (!version) {
  23566. return false
  23567. }
  23568. if (typeof version === 'string') {
  23569. try {
  23570. version = new SemVer(version, this.options)
  23571. } catch (er) {
  23572. return false
  23573. }
  23574. }
  23575. for (var i = 0; i < this.set.length; i++) {
  23576. if (testSet(this.set[i], version, this.options)) {
  23577. return true
  23578. }
  23579. }
  23580. return false
  23581. }
  23582. function testSet (set, version, options) {
  23583. for (var i = 0; i < set.length; i++) {
  23584. if (!set[i].test(version)) {
  23585. return false
  23586. }
  23587. }
  23588. if (version.prerelease.length && !options.includePrerelease) {
  23589. // Find the set of versions that are allowed to have prereleases
  23590. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  23591. // That should allow `1.2.3-pr.2` to pass.
  23592. // However, `1.2.4-alpha.notready` should NOT be allowed,
  23593. // even though it's within the range set by the comparators.
  23594. for (i = 0; i < set.length; i++) {
  23595. debug(set[i].semver)
  23596. if (set[i].semver === ANY) {
  23597. continue
  23598. }
  23599. if (set[i].semver.prerelease.length > 0) {
  23600. var allowed = set[i].semver
  23601. if (allowed.major === version.major &&
  23602. allowed.minor === version.minor &&
  23603. allowed.patch === version.patch) {
  23604. return true
  23605. }
  23606. }
  23607. }
  23608. // Version has a -pre, but it's not one of the ones we like.
  23609. return false
  23610. }
  23611. return true
  23612. }
  23613. exports.satisfies = satisfies
  23614. function satisfies (version, range, options) {
  23615. try {
  23616. range = new Range(range, options)
  23617. } catch (er) {
  23618. return false
  23619. }
  23620. return range.test(version)
  23621. }
  23622. exports.maxSatisfying = maxSatisfying
  23623. function maxSatisfying (versions, range, options) {
  23624. var max = null
  23625. var maxSV = null
  23626. try {
  23627. var rangeObj = new Range(range, options)
  23628. } catch (er) {
  23629. return null
  23630. }
  23631. versions.forEach(function (v) {
  23632. if (rangeObj.test(v)) {
  23633. // satisfies(v, range, options)
  23634. if (!max || maxSV.compare(v) === -1) {
  23635. // compare(max, v, true)
  23636. max = v
  23637. maxSV = new SemVer(max, options)
  23638. }
  23639. }
  23640. })
  23641. return max
  23642. }
  23643. exports.minSatisfying = minSatisfying
  23644. function minSatisfying (versions, range, options) {
  23645. var min = null
  23646. var minSV = null
  23647. try {
  23648. var rangeObj = new Range(range, options)
  23649. } catch (er) {
  23650. return null
  23651. }
  23652. versions.forEach(function (v) {
  23653. if (rangeObj.test(v)) {
  23654. // satisfies(v, range, options)
  23655. if (!min || minSV.compare(v) === 1) {
  23656. // compare(min, v, true)
  23657. min = v
  23658. minSV = new SemVer(min, options)
  23659. }
  23660. }
  23661. })
  23662. return min
  23663. }
  23664. exports.minVersion = minVersion
  23665. function minVersion (range, loose) {
  23666. range = new Range(range, loose)
  23667. var minver = new SemVer('0.0.0')
  23668. if (range.test(minver)) {
  23669. return minver
  23670. }
  23671. minver = new SemVer('0.0.0-0')
  23672. if (range.test(minver)) {
  23673. return minver
  23674. }
  23675. minver = null
  23676. for (var i = 0; i < range.set.length; ++i) {
  23677. var comparators = range.set[i]
  23678. comparators.forEach(function (comparator) {
  23679. // Clone to avoid manipulating the comparator's semver object.
  23680. var compver = new SemVer(comparator.semver.version)
  23681. switch (comparator.operator) {
  23682. case '>':
  23683. if (compver.prerelease.length === 0) {
  23684. compver.patch++
  23685. } else {
  23686. compver.prerelease.push(0)
  23687. }
  23688. compver.raw = compver.format()
  23689. /* fallthrough */
  23690. case '':
  23691. case '>=':
  23692. if (!minver || gt(minver, compver)) {
  23693. minver = compver
  23694. }
  23695. break
  23696. case '<':
  23697. case '<=':
  23698. /* Ignore maximum versions */
  23699. break
  23700. /* istanbul ignore next */
  23701. default:
  23702. throw new Error('Unexpected operation: ' + comparator.operator)
  23703. }
  23704. })
  23705. }
  23706. if (minver && range.test(minver)) {
  23707. return minver
  23708. }
  23709. return null
  23710. }
  23711. exports.validRange = validRange
  23712. function validRange (range, options) {
  23713. try {
  23714. // Return '*' instead of '' so that truthiness works.
  23715. // This will throw if it's invalid anyway
  23716. return new Range(range, options).range || '*'
  23717. } catch (er) {
  23718. return null
  23719. }
  23720. }
  23721. // Determine if version is less than all the versions possible in the range
  23722. exports.ltr = ltr
  23723. function ltr (version, range, options) {
  23724. return outside(version, range, '<', options)
  23725. }
  23726. // Determine if version is greater than all the versions possible in the range.
  23727. exports.gtr = gtr
  23728. function gtr (version, range, options) {
  23729. return outside(version, range, '>', options)
  23730. }
  23731. exports.outside = outside
  23732. function outside (version, range, hilo, options) {
  23733. version = new SemVer(version, options)
  23734. range = new Range(range, options)
  23735. var gtfn, ltefn, ltfn, comp, ecomp
  23736. switch (hilo) {
  23737. case '>':
  23738. gtfn = gt
  23739. ltefn = lte
  23740. ltfn = lt
  23741. comp = '>'
  23742. ecomp = '>='
  23743. break
  23744. case '<':
  23745. gtfn = lt
  23746. ltefn = gte
  23747. ltfn = gt
  23748. comp = '<'
  23749. ecomp = '<='
  23750. break
  23751. default:
  23752. throw new TypeError('Must provide a hilo val of "<" or ">"')
  23753. }
  23754. // If it satisifes the range it is not outside
  23755. if (satisfies(version, range, options)) {
  23756. return false
  23757. }
  23758. // From now on, variable terms are as if we're in "gtr" mode.
  23759. // but note that everything is flipped for the "ltr" function.
  23760. for (var i = 0; i < range.set.length; ++i) {
  23761. var comparators = range.set[i]
  23762. var high = null
  23763. var low = null
  23764. comparators.forEach(function (comparator) {
  23765. if (comparator.semver === ANY) {
  23766. comparator = new Comparator('>=0.0.0')
  23767. }
  23768. high = high || comparator
  23769. low = low || comparator
  23770. if (gtfn(comparator.semver, high.semver, options)) {
  23771. high = comparator
  23772. } else if (ltfn(comparator.semver, low.semver, options)) {
  23773. low = comparator
  23774. }
  23775. })
  23776. // If the edge version comparator has a operator then our version
  23777. // isn't outside it
  23778. if (high.operator === comp || high.operator === ecomp) {
  23779. return false
  23780. }
  23781. // If the lowest version comparator has an operator and our version
  23782. // is less than it then it isn't higher than the range
  23783. if ((!low.operator || low.operator === comp) &&
  23784. ltefn(version, low.semver)) {
  23785. return false
  23786. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  23787. return false
  23788. }
  23789. }
  23790. return true
  23791. }
  23792. exports.prerelease = prerelease
  23793. function prerelease (version, options) {
  23794. var parsed = parse(version, options)
  23795. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  23796. }
  23797. exports.intersects = intersects
  23798. function intersects (r1, r2, options) {
  23799. r1 = new Range(r1, options)
  23800. r2 = new Range(r2, options)
  23801. return r1.intersects(r2)
  23802. }
  23803. exports.coerce = coerce
  23804. function coerce (version, options) {
  23805. if (version instanceof SemVer) {
  23806. return version
  23807. }
  23808. if (typeof version === 'number') {
  23809. version = String(version)
  23810. }
  23811. if (typeof version !== 'string') {
  23812. return null
  23813. }
  23814. options = options || {}
  23815. var match = null
  23816. if (!options.rtl) {
  23817. match = version.match(re[t.COERCE])
  23818. } else {
  23819. // Find the right-most coercible string that does not share
  23820. // a terminus with a more left-ward coercible string.
  23821. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  23822. //
  23823. // Walk through the string checking with a /g regexp
  23824. // Manually set the index so as to pick up overlapping matches.
  23825. // Stop when we get a match that ends at the string end, since no
  23826. // coercible string can be more right-ward without the same terminus.
  23827. var next
  23828. while ((next = re[t.COERCERTL].exec(version)) &&
  23829. (!match || match.index + match[0].length !== version.length)
  23830. ) {
  23831. if (!match ||
  23832. next.index + next[0].length !== match.index + match[0].length) {
  23833. match = next
  23834. }
  23835. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  23836. }
  23837. // leave it in a clean state
  23838. re[t.COERCERTL].lastIndex = -1
  23839. }
  23840. if (match === null) {
  23841. return null
  23842. }
  23843. return parse(match[2] +
  23844. '.' + (match[3] || '0') +
  23845. '.' + (match[4] || '0'), options)
  23846. }
  23847. /***/ }),
  23848. /***/ 565:
  23849. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  23850. "use strict";
  23851. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  23852. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  23853. return new (P || (P = Promise))(function (resolve, reject) {
  23854. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  23855. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  23856. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  23857. step((generator = generator.apply(thisArg, _arguments || [])).next());
  23858. });
  23859. };
  23860. var __importStar = (this && this.__importStar) || function (mod) {
  23861. if (mod && mod.__esModule) return mod;
  23862. var result = {};
  23863. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  23864. result["default"] = mod;
  23865. return result;
  23866. };
  23867. var __importDefault = (this && this.__importDefault) || function (mod) {
  23868. return (mod && mod.__esModule) ? mod : { "default": mod };
  23869. };
  23870. Object.defineProperty(exports, "__esModule", { value: true });
  23871. const assert = __importStar(__webpack_require__(357));
  23872. const core = __importStar(__webpack_require__(186));
  23873. const exec = __importStar(__webpack_require__(514));
  23874. const fs = __importStar(__webpack_require__(747));
  23875. const io = __importStar(__webpack_require__(436));
  23876. const os = __importStar(__webpack_require__(87));
  23877. const path = __importStar(__webpack_require__(622));
  23878. const regexpHelper = __importStar(__webpack_require__(120));
  23879. const stateHelper = __importStar(__webpack_require__(647));
  23880. const urlHelper = __importStar(__webpack_require__(437));
  23881. const v4_1 = __importDefault(__webpack_require__(824));
  23882. const IS_WINDOWS = process.platform === 'win32';
  23883. const SSH_COMMAND_KEY = 'core.sshCommand';
  23884. function createAuthHelper(git, settings) {
  23885. return new GitAuthHelper(git, settings);
  23886. }
  23887. exports.createAuthHelper = createAuthHelper;
  23888. class GitAuthHelper {
  23889. constructor(gitCommandManager, gitSourceSettings) {
  23890. this.sshCommand = '';
  23891. this.sshKeyPath = '';
  23892. this.sshKnownHostsPath = '';
  23893. this.temporaryHomePath = '';
  23894. this.git = gitCommandManager;
  23895. this.settings = gitSourceSettings || {};
  23896. // Token auth header
  23897. const serverUrl = urlHelper.getServerUrl();
  23898. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  23899. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  23900. core.setSecret(basicCredential);
  23901. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  23902. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  23903. // Instead of SSH URL
  23904. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  23905. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  23906. }
  23907. configureAuth() {
  23908. return __awaiter(this, void 0, void 0, function* () {
  23909. // Remove possible previous values
  23910. yield this.removeAuth();
  23911. // Configure new values
  23912. yield this.configureSsh();
  23913. yield this.configureToken();
  23914. });
  23915. }
  23916. configureGlobalAuth() {
  23917. return __awaiter(this, void 0, void 0, function* () {
  23918. // Create a temp home directory
  23919. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  23920. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  23921. const uniqueId = v4_1.default();
  23922. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  23923. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  23924. // Copy the global git config
  23925. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  23926. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  23927. let configExists = false;
  23928. try {
  23929. yield fs.promises.stat(gitConfigPath);
  23930. configExists = true;
  23931. }
  23932. catch (err) {
  23933. if (err.code !== 'ENOENT') {
  23934. throw err;
  23935. }
  23936. }
  23937. if (configExists) {
  23938. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  23939. yield io.cp(gitConfigPath, newGitConfigPath);
  23940. }
  23941. else {
  23942. yield fs.promises.writeFile(newGitConfigPath, '');
  23943. }
  23944. try {
  23945. // Override HOME
  23946. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  23947. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  23948. // Configure the token
  23949. yield this.configureToken(newGitConfigPath, true);
  23950. // Configure HTTPS instead of SSH
  23951. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  23952. if (!this.settings.sshKey) {
  23953. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  23954. }
  23955. }
  23956. catch (err) {
  23957. // Unset in case somehow written to the real global config
  23958. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  23959. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  23960. throw err;
  23961. }
  23962. });
  23963. }
  23964. configureSubmoduleAuth() {
  23965. return __awaiter(this, void 0, void 0, function* () {
  23966. // Remove possible previous HTTPS instead of SSH
  23967. yield this.removeGitConfig(this.insteadOfKey, true);
  23968. if (this.settings.persistCredentials) {
  23969. // Configure a placeholder value. This approach avoids the credential being captured
  23970. // by process creation audit events, which are commonly logged. For more information,
  23971. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  23972. 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);
  23973. // Replace the placeholder
  23974. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  23975. for (const configPath of configPaths) {
  23976. core.debug(`Replacing token placeholder in '${configPath}'`);
  23977. this.replaceTokenPlaceholder(configPath);
  23978. }
  23979. if (this.settings.sshKey) {
  23980. // Configure core.sshCommand
  23981. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  23982. }
  23983. else {
  23984. // Configure HTTPS instead of SSH
  23985. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  23986. }
  23987. }
  23988. });
  23989. }
  23990. removeAuth() {
  23991. return __awaiter(this, void 0, void 0, function* () {
  23992. yield this.removeSsh();
  23993. yield this.removeToken();
  23994. });
  23995. }
  23996. removeGlobalAuth() {
  23997. return __awaiter(this, void 0, void 0, function* () {
  23998. core.debug(`Unsetting HOME override`);
  23999. this.git.removeEnvironmentVariable('HOME');
  24000. yield io.rmRF(this.temporaryHomePath);
  24001. });
  24002. }
  24003. configureSsh() {
  24004. return __awaiter(this, void 0, void 0, function* () {
  24005. if (!this.settings.sshKey) {
  24006. return;
  24007. }
  24008. // Write key
  24009. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  24010. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  24011. const uniqueId = v4_1.default();
  24012. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  24013. stateHelper.setSshKeyPath(this.sshKeyPath);
  24014. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  24015. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  24016. // Remove inherited permissions on Windows
  24017. if (IS_WINDOWS) {
  24018. const icacls = yield io.which('icacls.exe');
  24019. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  24020. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  24021. }
  24022. // Write known hosts
  24023. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  24024. let userKnownHosts = '';
  24025. try {
  24026. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  24027. }
  24028. catch (err) {
  24029. if (err.code !== 'ENOENT') {
  24030. throw err;
  24031. }
  24032. }
  24033. let knownHosts = '';
  24034. if (userKnownHosts) {
  24035. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  24036. }
  24037. if (this.settings.sshKnownHosts) {
  24038. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  24039. }
  24040. 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`;
  24041. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  24042. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  24043. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  24044. // Configure GIT_SSH_COMMAND
  24045. const sshPath = yield io.which('ssh', true);
  24046. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  24047. if (this.settings.sshStrict) {
  24048. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  24049. }
  24050. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  24051. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  24052. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  24053. // Configure core.sshCommand
  24054. if (this.settings.persistCredentials) {
  24055. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  24056. }
  24057. });
  24058. }
  24059. configureToken(configPath, globalConfig) {
  24060. return __awaiter(this, void 0, void 0, function* () {
  24061. // Validate args
  24062. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  24063. // Default config path
  24064. if (!configPath && !globalConfig) {
  24065. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  24066. }
  24067. // Configure a placeholder value. This approach avoids the credential being captured
  24068. // by process creation audit events, which are commonly logged. For more information,
  24069. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  24070. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  24071. // Replace the placeholder
  24072. yield this.replaceTokenPlaceholder(configPath || '');
  24073. });
  24074. }
  24075. replaceTokenPlaceholder(configPath) {
  24076. return __awaiter(this, void 0, void 0, function* () {
  24077. assert.ok(configPath, 'configPath is not defined');
  24078. let content = (yield fs.promises.readFile(configPath)).toString();
  24079. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  24080. if (placeholderIndex < 0 ||
  24081. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  24082. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  24083. }
  24084. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  24085. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  24086. yield fs.promises.writeFile(configPath, content);
  24087. });
  24088. }
  24089. removeSsh() {
  24090. return __awaiter(this, void 0, void 0, function* () {
  24091. // SSH key
  24092. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  24093. if (keyPath) {
  24094. try {
  24095. yield io.rmRF(keyPath);
  24096. }
  24097. catch (err) {
  24098. core.debug(err.message);
  24099. core.warning(`Failed to remove SSH key '${keyPath}'`);
  24100. }
  24101. }
  24102. // SSH known hosts
  24103. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  24104. if (knownHostsPath) {
  24105. try {
  24106. yield io.rmRF(knownHostsPath);
  24107. }
  24108. catch (_a) {
  24109. // Intentionally empty
  24110. }
  24111. }
  24112. // SSH command
  24113. yield this.removeGitConfig(SSH_COMMAND_KEY);
  24114. });
  24115. }
  24116. removeToken() {
  24117. return __awaiter(this, void 0, void 0, function* () {
  24118. // HTTP extra header
  24119. yield this.removeGitConfig(this.tokenConfigKey);
  24120. });
  24121. }
  24122. removeGitConfig(configKey, submoduleOnly = false) {
  24123. return __awaiter(this, void 0, void 0, function* () {
  24124. if (!submoduleOnly) {
  24125. if ((yield this.git.configExists(configKey)) &&
  24126. !(yield this.git.tryConfigUnset(configKey))) {
  24127. // Load the config contents
  24128. core.warning(`Failed to remove '${configKey}' from the git config`);
  24129. }
  24130. }
  24131. const pattern = regexpHelper.escape(configKey);
  24132. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  24133. });
  24134. }
  24135. }
  24136. /***/ }),
  24137. /***/ 578:
  24138. /***/ (function(module, __unusedexports, __webpack_require__) {
  24139. module.exports = authenticationBeforeRequest;
  24140. const btoa = __webpack_require__(358);
  24141. const uniq = __webpack_require__(216);
  24142. function authenticationBeforeRequest(state, options) {
  24143. if (!state.auth.type) {
  24144. return;
  24145. }
  24146. if (state.auth.type === "basic") {
  24147. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  24148. options.headers.authorization = `Basic ${hash}`;
  24149. return;
  24150. }
  24151. if (state.auth.type === "token") {
  24152. options.headers.authorization = `token ${state.auth.token}`;
  24153. return;
  24154. }
  24155. if (state.auth.type === "app") {
  24156. options.headers.authorization = `Bearer ${state.auth.token}`;
  24157. const acceptHeaders = options.headers.accept
  24158. .split(",")
  24159. .concat("application/vnd.github.machine-man-preview+json");
  24160. options.headers.accept = uniq(acceptHeaders)
  24161. .filter(Boolean)
  24162. .join(",");
  24163. return;
  24164. }
  24165. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  24166. if (state.auth.token) {
  24167. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  24168. return;
  24169. }
  24170. const key = encodeURIComponent(state.auth.key);
  24171. const secret = encodeURIComponent(state.auth.secret);
  24172. options.url += `client_id=${key}&client_secret=${secret}`;
  24173. }
  24174. /***/ }),
  24175. /***/ 579:
  24176. /***/ (function(module, __unusedexports, __webpack_require__) {
  24177. module.exports = paginatePlugin;
  24178. const { paginateRest } = __webpack_require__(193);
  24179. function paginatePlugin(octokit) {
  24180. Object.assign(octokit, paginateRest(octokit));
  24181. }
  24182. /***/ }),
  24183. /***/ 585:
  24184. /***/ (function(module, __unusedexports, __webpack_require__) {
  24185. "use strict";
  24186. const {PassThrough} = __webpack_require__(413);
  24187. module.exports = options => {
  24188. options = Object.assign({}, options);
  24189. const {array} = options;
  24190. let {encoding} = options;
  24191. const buffer = encoding === 'buffer';
  24192. let objectMode = false;
  24193. if (array) {
  24194. objectMode = !(encoding || buffer);
  24195. } else {
  24196. encoding = encoding || 'utf8';
  24197. }
  24198. if (buffer) {
  24199. encoding = null;
  24200. }
  24201. let len = 0;
  24202. const ret = [];
  24203. const stream = new PassThrough({objectMode});
  24204. if (encoding) {
  24205. stream.setEncoding(encoding);
  24206. }
  24207. stream.on('data', chunk => {
  24208. ret.push(chunk);
  24209. if (objectMode) {
  24210. len = ret.length;
  24211. } else {
  24212. len += chunk.length;
  24213. }
  24214. });
  24215. stream.getBufferedValue = () => {
  24216. if (array) {
  24217. return ret;
  24218. }
  24219. return buffer ? Buffer.concat(ret, len) : ret.join('');
  24220. };
  24221. stream.getBufferedLength = () => len;
  24222. return stream;
  24223. };
  24224. /***/ }),
  24225. /***/ 601:
  24226. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  24227. "use strict";
  24228. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  24229. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  24230. return new (P || (P = Promise))(function (resolve, reject) {
  24231. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  24232. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  24233. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  24234. step((generator = generator.apply(thisArg, _arguments || [])).next());
  24235. });
  24236. };
  24237. var __importStar = (this && this.__importStar) || function (mod) {
  24238. if (mod && mod.__esModule) return mod;
  24239. var result = {};
  24240. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  24241. result["default"] = mod;
  24242. return result;
  24243. };
  24244. Object.defineProperty(exports, "__esModule", { value: true });
  24245. const url_1 = __webpack_require__(835);
  24246. const core = __importStar(__webpack_require__(186));
  24247. const github = __importStar(__webpack_require__(438));
  24248. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  24249. function getCheckoutInfo(git, ref, commit) {
  24250. return __awaiter(this, void 0, void 0, function* () {
  24251. if (!git) {
  24252. throw new Error('Arg git cannot be empty');
  24253. }
  24254. if (!ref && !commit) {
  24255. throw new Error('Args ref and commit cannot both be empty');
  24256. }
  24257. const result = {};
  24258. const upperRef = (ref || '').toUpperCase();
  24259. // SHA only
  24260. if (!ref) {
  24261. result.ref = commit;
  24262. }
  24263. // refs/heads/
  24264. else if (upperRef.startsWith('REFS/HEADS/')) {
  24265. const branch = ref.substring('refs/heads/'.length);
  24266. result.ref = branch;
  24267. result.startPoint = `refs/remotes/origin/${branch}`;
  24268. }
  24269. // refs/pull/
  24270. else if (upperRef.startsWith('REFS/PULL/')) {
  24271. const branch = ref.substring('refs/pull/'.length);
  24272. result.ref = `refs/remotes/pull/${branch}`;
  24273. }
  24274. // refs/tags/
  24275. else if (upperRef.startsWith('REFS/')) {
  24276. result.ref = ref;
  24277. }
  24278. // Unqualified ref, check for a matching branch or tag
  24279. else {
  24280. if (yield git.branchExists(true, `origin/${ref}`)) {
  24281. result.ref = ref;
  24282. result.startPoint = `refs/remotes/origin/${ref}`;
  24283. }
  24284. else if (yield git.tagExists(`${ref}`)) {
  24285. result.ref = `refs/tags/${ref}`;
  24286. }
  24287. else {
  24288. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  24289. }
  24290. }
  24291. return result;
  24292. });
  24293. }
  24294. exports.getCheckoutInfo = getCheckoutInfo;
  24295. function getRefSpecForAllHistory(ref, commit) {
  24296. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  24297. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  24298. const branch = ref.substring('refs/pull/'.length);
  24299. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  24300. }
  24301. return result;
  24302. }
  24303. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  24304. function getRefSpec(ref, commit) {
  24305. if (!ref && !commit) {
  24306. throw new Error('Args ref and commit cannot both be empty');
  24307. }
  24308. const upperRef = (ref || '').toUpperCase();
  24309. // SHA
  24310. if (commit) {
  24311. // refs/heads
  24312. if (upperRef.startsWith('REFS/HEADS/')) {
  24313. const branch = ref.substring('refs/heads/'.length);
  24314. return [`+${commit}:refs/remotes/origin/${branch}`];
  24315. }
  24316. // refs/pull/
  24317. else if (upperRef.startsWith('REFS/PULL/')) {
  24318. const branch = ref.substring('refs/pull/'.length);
  24319. return [`+${commit}:refs/remotes/pull/${branch}`];
  24320. }
  24321. // refs/tags/
  24322. else if (upperRef.startsWith('REFS/TAGS/')) {
  24323. return [`+${commit}:${ref}`];
  24324. }
  24325. // Otherwise no destination ref
  24326. else {
  24327. return [commit];
  24328. }
  24329. }
  24330. // Unqualified ref, check for a matching branch or tag
  24331. else if (!upperRef.startsWith('REFS/')) {
  24332. return [
  24333. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  24334. `+refs/tags/${ref}*:refs/tags/${ref}*`
  24335. ];
  24336. }
  24337. // refs/heads/
  24338. else if (upperRef.startsWith('REFS/HEADS/')) {
  24339. const branch = ref.substring('refs/heads/'.length);
  24340. return [`+${ref}:refs/remotes/origin/${branch}`];
  24341. }
  24342. // refs/pull/
  24343. else if (upperRef.startsWith('REFS/PULL/')) {
  24344. const branch = ref.substring('refs/pull/'.length);
  24345. return [`+${ref}:refs/remotes/pull/${branch}`];
  24346. }
  24347. // refs/tags/
  24348. else {
  24349. return [`+${ref}:${ref}`];
  24350. }
  24351. }
  24352. exports.getRefSpec = getRefSpec;
  24353. /**
  24354. * Tests whether the initial fetch created the ref at the expected commit
  24355. */
  24356. function testRef(git, ref, commit) {
  24357. return __awaiter(this, void 0, void 0, function* () {
  24358. if (!git) {
  24359. throw new Error('Arg git cannot be empty');
  24360. }
  24361. if (!ref && !commit) {
  24362. throw new Error('Args ref and commit cannot both be empty');
  24363. }
  24364. // No SHA? Nothing to test
  24365. if (!commit) {
  24366. return true;
  24367. }
  24368. // SHA only?
  24369. else if (!ref) {
  24370. return yield git.shaExists(commit);
  24371. }
  24372. const upperRef = ref.toUpperCase();
  24373. // refs/heads/
  24374. if (upperRef.startsWith('REFS/HEADS/')) {
  24375. const branch = ref.substring('refs/heads/'.length);
  24376. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  24377. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  24378. }
  24379. // refs/pull/
  24380. else if (upperRef.startsWith('REFS/PULL/')) {
  24381. // Assume matches because fetched using the commit
  24382. return true;
  24383. }
  24384. // refs/tags/
  24385. else if (upperRef.startsWith('REFS/TAGS/')) {
  24386. const tagName = ref.substring('refs/tags/'.length);
  24387. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  24388. }
  24389. // Unexpected
  24390. else {
  24391. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  24392. return true;
  24393. }
  24394. });
  24395. }
  24396. exports.testRef = testRef;
  24397. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  24398. return __awaiter(this, void 0, void 0, function* () {
  24399. try {
  24400. // GHES?
  24401. if (isGhes()) {
  24402. return;
  24403. }
  24404. // Auth token?
  24405. if (!token) {
  24406. return;
  24407. }
  24408. // Public PR synchronize, for workflow repo?
  24409. if (fromPayload('repository.private') !== false ||
  24410. github.context.eventName !== 'pull_request' ||
  24411. fromPayload('action') !== 'synchronize' ||
  24412. repositoryOwner !== github.context.repo.owner ||
  24413. repositoryName !== github.context.repo.repo ||
  24414. ref !== github.context.ref ||
  24415. !ref.startsWith('refs/pull/') ||
  24416. commit !== github.context.sha) {
  24417. return;
  24418. }
  24419. // Head SHA
  24420. const expectedHeadSha = fromPayload('after');
  24421. if (!expectedHeadSha) {
  24422. core.debug('Unable to determine head sha');
  24423. return;
  24424. }
  24425. // Base SHA
  24426. const expectedBaseSha = fromPayload('pull_request.base.sha');
  24427. if (!expectedBaseSha) {
  24428. core.debug('Unable to determine base sha');
  24429. return;
  24430. }
  24431. // Expected message?
  24432. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  24433. if (commitInfo.indexOf(expectedMessage) >= 0) {
  24434. return;
  24435. }
  24436. // Extract details from message
  24437. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  24438. if (!match) {
  24439. core.debug('Unexpected message format');
  24440. return;
  24441. }
  24442. // Post telemetry
  24443. const actualHeadSha = match[1];
  24444. if (actualHeadSha !== expectedHeadSha) {
  24445. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  24446. const octokit = new github.GitHub(token, {
  24447. 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})`
  24448. });
  24449. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  24450. }
  24451. }
  24452. catch (err) {
  24453. core.debug(`Error when validating commit info: ${err.stack}`);
  24454. }
  24455. });
  24456. }
  24457. exports.checkCommitInfo = checkCommitInfo;
  24458. function fromPayload(path) {
  24459. return select(github.context.payload, path);
  24460. }
  24461. function select(obj, path) {
  24462. if (!obj) {
  24463. return undefined;
  24464. }
  24465. const i = path.indexOf('.');
  24466. if (i < 0) {
  24467. return obj[path];
  24468. }
  24469. const key = path.substr(0, i);
  24470. return select(obj[key], path.substr(i + 1));
  24471. }
  24472. function isGhes() {
  24473. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  24474. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  24475. }
  24476. /***/ }),
  24477. /***/ 603:
  24478. /***/ (function(module, __unusedexports, __webpack_require__) {
  24479. module.exports = withAuthorizationPrefix;
  24480. const atob = __webpack_require__(224);
  24481. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  24482. function withAuthorizationPrefix(authorization) {
  24483. if (/^(basic|bearer|token) /i.test(authorization)) {
  24484. return authorization;
  24485. }
  24486. try {
  24487. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  24488. return `basic ${authorization}`;
  24489. }
  24490. } catch (error) {}
  24491. if (authorization.split(/\./).length === 3) {
  24492. return `bearer ${authorization}`;
  24493. }
  24494. return `token ${authorization}`;
  24495. }
  24496. /***/ }),
  24497. /***/ 604:
  24498. /***/ (function(module, __unusedexports, __webpack_require__) {
  24499. module.exports = getPage
  24500. const deprecate = __webpack_require__(191)
  24501. const getPageLinks = __webpack_require__(889)
  24502. const HttpError = __webpack_require__(58)
  24503. function getPage (octokit, link, which, headers) {
  24504. 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.`)
  24505. const url = getPageLinks(link)[which]
  24506. if (!url) {
  24507. const urlError = new HttpError(`No ${which} page found`, 404)
  24508. return Promise.reject(urlError)
  24509. }
  24510. const requestOptions = {
  24511. url,
  24512. headers: applyAcceptHeader(link, headers)
  24513. }
  24514. const promise = octokit.request(requestOptions)
  24515. return promise
  24516. }
  24517. function applyAcceptHeader (res, headers) {
  24518. const previous = res.headers && res.headers['x-github-media-type']
  24519. if (!previous || (headers && headers.accept)) {
  24520. return headers
  24521. }
  24522. headers = headers || {}
  24523. headers.accept = 'application/vnd.' + previous
  24524. .replace('; param=', '.')
  24525. .replace('; format=', '+')
  24526. return headers
  24527. }
  24528. /***/ }),
  24529. /***/ 605:
  24530. /***/ (function(module) {
  24531. module.exports = require("http");
  24532. /***/ }),
  24533. /***/ 609:
  24534. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  24535. "use strict";
  24536. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  24537. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  24538. return new (P || (P = Promise))(function (resolve, reject) {
  24539. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  24540. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  24541. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  24542. step((generator = generator.apply(thisArg, _arguments || [])).next());
  24543. });
  24544. };
  24545. var __importStar = (this && this.__importStar) || function (mod) {
  24546. if (mod && mod.__esModule) return mod;
  24547. var result = {};
  24548. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  24549. result["default"] = mod;
  24550. return result;
  24551. };
  24552. Object.defineProperty(exports, "__esModule", { value: true });
  24553. const assert = __importStar(__webpack_require__(357));
  24554. const core = __importStar(__webpack_require__(186));
  24555. const fs = __importStar(__webpack_require__(747));
  24556. const fsHelper = __importStar(__webpack_require__(219));
  24557. const io = __importStar(__webpack_require__(436));
  24558. const path = __importStar(__webpack_require__(622));
  24559. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  24560. return __awaiter(this, void 0, void 0, function* () {
  24561. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  24562. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  24563. // Indicates whether to delete the directory contents
  24564. let remove = false;
  24565. // Check whether using git or REST API
  24566. if (!git) {
  24567. remove = true;
  24568. }
  24569. // Fetch URL does not match
  24570. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  24571. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  24572. remove = true;
  24573. }
  24574. else {
  24575. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  24576. const lockPaths = [
  24577. path.join(repositoryPath, '.git', 'index.lock'),
  24578. path.join(repositoryPath, '.git', 'shallow.lock')
  24579. ];
  24580. for (const lockPath of lockPaths) {
  24581. try {
  24582. yield io.rmRF(lockPath);
  24583. }
  24584. catch (error) {
  24585. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  24586. }
  24587. }
  24588. try {
  24589. core.startGroup('Removing previously created refs, to avoid conflicts');
  24590. // Checkout detached HEAD
  24591. if (!(yield git.isDetached())) {
  24592. yield git.checkoutDetach();
  24593. }
  24594. // Remove all refs/heads/*
  24595. let branches = yield git.branchList(false);
  24596. for (const branch of branches) {
  24597. yield git.branchDelete(false, branch);
  24598. }
  24599. // Remove any conflicting refs/remotes/origin/*
  24600. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  24601. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  24602. if (ref) {
  24603. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  24604. if (ref.startsWith('refs/heads/')) {
  24605. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  24606. const upperName1Slash = `${upperName1}/`;
  24607. branches = yield git.branchList(true);
  24608. for (const branch of branches) {
  24609. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  24610. const upperName2Slash = `${upperName2}/`;
  24611. if (upperName1.startsWith(upperName2Slash) ||
  24612. upperName2.startsWith(upperName1Slash)) {
  24613. yield git.branchDelete(true, branch);
  24614. }
  24615. }
  24616. }
  24617. }
  24618. core.endGroup();
  24619. // Clean
  24620. if (clean) {
  24621. core.startGroup('Cleaning the repository');
  24622. if (!(yield git.tryClean())) {
  24623. 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}'.`);
  24624. remove = true;
  24625. }
  24626. else if (!(yield git.tryReset())) {
  24627. remove = true;
  24628. }
  24629. core.endGroup();
  24630. if (remove) {
  24631. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  24632. }
  24633. }
  24634. }
  24635. catch (error) {
  24636. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  24637. remove = true;
  24638. }
  24639. }
  24640. if (remove) {
  24641. // Delete the contents of the directory. Don't delete the directory itself
  24642. // since it might be the current working directory.
  24643. core.info(`Deleting the contents of '${repositoryPath}'`);
  24644. for (const file of yield fs.promises.readdir(repositoryPath)) {
  24645. yield io.rmRF(path.join(repositoryPath, file));
  24646. }
  24647. }
  24648. });
  24649. }
  24650. exports.prepareExistingDirectory = prepareExistingDirectory;
  24651. /***/ }),
  24652. /***/ 613:
  24653. /***/ (function(module, __unusedexports, __webpack_require__) {
  24654. module.exports = parseOptions;
  24655. const { Deprecation } = __webpack_require__(932);
  24656. const { getUserAgent } = __webpack_require__(30);
  24657. const once = __webpack_require__(223);
  24658. const pkg = __webpack_require__(954);
  24659. const deprecateOptionsTimeout = once((log, deprecation) =>
  24660. log.warn(deprecation)
  24661. );
  24662. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  24663. const deprecateOptionsHeaders = once((log, deprecation) =>
  24664. log.warn(deprecation)
  24665. );
  24666. function parseOptions(options, log, hook) {
  24667. if (options.headers) {
  24668. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  24669. newObj[key.toLowerCase()] = options.headers[key];
  24670. return newObj;
  24671. }, {});
  24672. }
  24673. const clientDefaults = {
  24674. headers: options.headers || {},
  24675. request: options.request || {},
  24676. mediaType: {
  24677. previews: [],
  24678. format: ""
  24679. }
  24680. };
  24681. if (options.baseUrl) {
  24682. clientDefaults.baseUrl = options.baseUrl;
  24683. }
  24684. if (options.userAgent) {
  24685. clientDefaults.headers["user-agent"] = options.userAgent;
  24686. }
  24687. if (options.previews) {
  24688. clientDefaults.mediaType.previews = options.previews;
  24689. }
  24690. if (options.timeZone) {
  24691. clientDefaults.headers["time-zone"] = options.timeZone;
  24692. }
  24693. if (options.timeout) {
  24694. deprecateOptionsTimeout(
  24695. log,
  24696. new Deprecation(
  24697. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  24698. )
  24699. );
  24700. clientDefaults.request.timeout = options.timeout;
  24701. }
  24702. if (options.agent) {
  24703. deprecateOptionsAgent(
  24704. log,
  24705. new Deprecation(
  24706. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  24707. )
  24708. );
  24709. clientDefaults.request.agent = options.agent;
  24710. }
  24711. if (options.headers) {
  24712. deprecateOptionsHeaders(
  24713. log,
  24714. new Deprecation(
  24715. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  24716. )
  24717. );
  24718. }
  24719. const userAgentOption = clientDefaults.headers["user-agent"];
  24720. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  24721. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  24722. .filter(Boolean)
  24723. .join(" ");
  24724. clientDefaults.request.hook = hook.bind(null, "request");
  24725. return clientDefaults;
  24726. }
  24727. /***/ }),
  24728. /***/ 614:
  24729. /***/ (function(module) {
  24730. module.exports = require("events");
  24731. /***/ }),
  24732. /***/ 622:
  24733. /***/ (function(module) {
  24734. module.exports = require("path");
  24735. /***/ }),
  24736. /***/ 631:
  24737. /***/ (function(module, __unusedexports, __webpack_require__) {
  24738. module.exports = hasFirstPage
  24739. const deprecate = __webpack_require__(191)
  24740. const getPageLinks = __webpack_require__(889)
  24741. function hasFirstPage (link) {
  24742. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  24743. return getPageLinks(link).first
  24744. }
  24745. /***/ }),
  24746. /***/ 638:
  24747. /***/ (function(module) {
  24748. "use strict";
  24749. module.exports = /^#!.*/;
  24750. /***/ }),
  24751. /***/ 647:
  24752. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  24753. "use strict";
  24754. var __importStar = (this && this.__importStar) || function (mod) {
  24755. if (mod && mod.__esModule) return mod;
  24756. var result = {};
  24757. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  24758. result["default"] = mod;
  24759. return result;
  24760. };
  24761. Object.defineProperty(exports, "__esModule", { value: true });
  24762. const coreCommand = __importStar(__webpack_require__(351));
  24763. /**
  24764. * Indicates whether the POST action is running
  24765. */
  24766. exports.IsPost = !!process.env['STATE_isPost'];
  24767. /**
  24768. * The repository path for the POST action. The value is empty during the MAIN action.
  24769. */
  24770. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  24771. /**
  24772. * The SSH key path for the POST action. The value is empty during the MAIN action.
  24773. */
  24774. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  24775. /**
  24776. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  24777. */
  24778. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  24779. /**
  24780. * Save the repository path so the POST action can retrieve the value.
  24781. */
  24782. function setRepositoryPath(repositoryPath) {
  24783. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  24784. }
  24785. exports.setRepositoryPath = setRepositoryPath;
  24786. /**
  24787. * Save the SSH key path so the POST action can retrieve the value.
  24788. */
  24789. function setSshKeyPath(sshKeyPath) {
  24790. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  24791. }
  24792. exports.setSshKeyPath = setSshKeyPath;
  24793. /**
  24794. * Save the SSH known hosts path so the POST action can retrieve the value.
  24795. */
  24796. function setSshKnownHostsPath(sshKnownHostsPath) {
  24797. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  24798. }
  24799. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  24800. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  24801. // This is necessary since we don't have a separate entry point.
  24802. if (!exports.IsPost) {
  24803. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  24804. }
  24805. /***/ }),
  24806. /***/ 651:
  24807. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  24808. "use strict";
  24809. var net = __webpack_require__(937);
  24810. var tls = __webpack_require__(16);
  24811. var http = __webpack_require__(605);
  24812. var https = __webpack_require__(211);
  24813. var events = __webpack_require__(614);
  24814. var assert = __webpack_require__(357);
  24815. var util = __webpack_require__(669);
  24816. exports.httpOverHttp = httpOverHttp;
  24817. exports.httpsOverHttp = httpsOverHttp;
  24818. exports.httpOverHttps = httpOverHttps;
  24819. exports.httpsOverHttps = httpsOverHttps;
  24820. function httpOverHttp(options) {
  24821. var agent = new TunnelingAgent(options);
  24822. agent.request = http.request;
  24823. return agent;
  24824. }
  24825. function httpsOverHttp(options) {
  24826. var agent = new TunnelingAgent(options);
  24827. agent.request = http.request;
  24828. agent.createSocket = createSecureSocket;
  24829. return agent;
  24830. }
  24831. function httpOverHttps(options) {
  24832. var agent = new TunnelingAgent(options);
  24833. agent.request = https.request;
  24834. return agent;
  24835. }
  24836. function httpsOverHttps(options) {
  24837. var agent = new TunnelingAgent(options);
  24838. agent.request = https.request;
  24839. agent.createSocket = createSecureSocket;
  24840. return agent;
  24841. }
  24842. function TunnelingAgent(options) {
  24843. var self = this;
  24844. self.options = options || {};
  24845. self.proxyOptions = self.options.proxy || {};
  24846. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  24847. self.requests = [];
  24848. self.sockets = [];
  24849. self.on('free', function onFree(socket, host, port, localAddress) {
  24850. var options = toOptions(host, port, localAddress);
  24851. for (var i = 0, len = self.requests.length; i < len; ++i) {
  24852. var pending = self.requests[i];
  24853. if (pending.host === options.host && pending.port === options.port) {
  24854. // Detect the request to connect same origin server,
  24855. // reuse the connection.
  24856. self.requests.splice(i, 1);
  24857. pending.request.onSocket(socket);
  24858. return;
  24859. }
  24860. }
  24861. socket.destroy();
  24862. self.removeSocket(socket);
  24863. });
  24864. }
  24865. util.inherits(TunnelingAgent, events.EventEmitter);
  24866. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  24867. var self = this;
  24868. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  24869. if (self.sockets.length >= this.maxSockets) {
  24870. // We are over limit so we'll add it to the queue.
  24871. self.requests.push(options);
  24872. return;
  24873. }
  24874. // If we are under maxSockets create a new one.
  24875. self.createSocket(options, function(socket) {
  24876. socket.on('free', onFree);
  24877. socket.on('close', onCloseOrRemove);
  24878. socket.on('agentRemove', onCloseOrRemove);
  24879. req.onSocket(socket);
  24880. function onFree() {
  24881. self.emit('free', socket, options);
  24882. }
  24883. function onCloseOrRemove(err) {
  24884. self.removeSocket(socket);
  24885. socket.removeListener('free', onFree);
  24886. socket.removeListener('close', onCloseOrRemove);
  24887. socket.removeListener('agentRemove', onCloseOrRemove);
  24888. }
  24889. });
  24890. };
  24891. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  24892. var self = this;
  24893. var placeholder = {};
  24894. self.sockets.push(placeholder);
  24895. var connectOptions = mergeOptions({}, self.proxyOptions, {
  24896. method: 'CONNECT',
  24897. path: options.host + ':' + options.port,
  24898. agent: false
  24899. });
  24900. if (connectOptions.proxyAuth) {
  24901. connectOptions.headers = connectOptions.headers || {};
  24902. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  24903. new Buffer(connectOptions.proxyAuth).toString('base64');
  24904. }
  24905. debug('making CONNECT request');
  24906. var connectReq = self.request(connectOptions);
  24907. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  24908. connectReq.once('response', onResponse); // for v0.6
  24909. connectReq.once('upgrade', onUpgrade); // for v0.6
  24910. connectReq.once('connect', onConnect); // for v0.7 or later
  24911. connectReq.once('error', onError);
  24912. connectReq.end();
  24913. function onResponse(res) {
  24914. // Very hacky. This is necessary to avoid http-parser leaks.
  24915. res.upgrade = true;
  24916. }
  24917. function onUpgrade(res, socket, head) {
  24918. // Hacky.
  24919. process.nextTick(function() {
  24920. onConnect(res, socket, head);
  24921. });
  24922. }
  24923. function onConnect(res, socket, head) {
  24924. connectReq.removeAllListeners();
  24925. socket.removeAllListeners();
  24926. if (res.statusCode === 200) {
  24927. assert.equal(head.length, 0);
  24928. debug('tunneling connection has established');
  24929. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  24930. cb(socket);
  24931. } else {
  24932. debug('tunneling socket could not be established, statusCode=%d',
  24933. res.statusCode);
  24934. var error = new Error('tunneling socket could not be established, ' +
  24935. 'statusCode=' + res.statusCode);
  24936. error.code = 'ECONNRESET';
  24937. options.request.emit('error', error);
  24938. self.removeSocket(placeholder);
  24939. }
  24940. }
  24941. function onError(cause) {
  24942. connectReq.removeAllListeners();
  24943. debug('tunneling socket could not be established, cause=%s\n',
  24944. cause.message, cause.stack);
  24945. var error = new Error('tunneling socket could not be established, ' +
  24946. 'cause=' + cause.message);
  24947. error.code = 'ECONNRESET';
  24948. options.request.emit('error', error);
  24949. self.removeSocket(placeholder);
  24950. }
  24951. };
  24952. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  24953. var pos = this.sockets.indexOf(socket)
  24954. if (pos === -1) {
  24955. return;
  24956. }
  24957. this.sockets.splice(pos, 1);
  24958. var pending = this.requests.shift();
  24959. if (pending) {
  24960. // If we have pending requests and a socket gets closed a new one
  24961. // needs to be created to take over in the pool for the one that closed.
  24962. this.createSocket(pending, function(socket) {
  24963. pending.request.onSocket(socket);
  24964. });
  24965. }
  24966. };
  24967. function createSecureSocket(options, cb) {
  24968. var self = this;
  24969. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  24970. var hostHeader = options.request.getHeader('host');
  24971. var tlsOptions = mergeOptions({}, self.options, {
  24972. socket: socket,
  24973. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  24974. });
  24975. // 0 is dummy port for v0.6
  24976. var secureSocket = tls.connect(0, tlsOptions);
  24977. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  24978. cb(secureSocket);
  24979. });
  24980. }
  24981. function toOptions(host, port, localAddress) {
  24982. if (typeof host === 'string') { // since v0.10
  24983. return {
  24984. host: host,
  24985. port: port,
  24986. localAddress: localAddress
  24987. };
  24988. }
  24989. return host; // for v0.11 or later
  24990. }
  24991. function mergeOptions(target) {
  24992. for (var i = 1, len = arguments.length; i < len; ++i) {
  24993. var overrides = arguments[i];
  24994. if (typeof overrides === 'object') {
  24995. var keys = Object.keys(overrides);
  24996. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  24997. var k = keys[j];
  24998. if (overrides[k] !== undefined) {
  24999. target[k] = overrides[k];
  25000. }
  25001. }
  25002. }
  25003. }
  25004. return target;
  25005. }
  25006. var debug;
  25007. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  25008. debug = function() {
  25009. var args = Array.prototype.slice.call(arguments);
  25010. if (typeof args[0] === 'string') {
  25011. args[0] = 'TUNNEL: ' + args[0];
  25012. } else {
  25013. args.unshift('TUNNEL:');
  25014. }
  25015. console.error.apply(console, args);
  25016. }
  25017. } else {
  25018. debug = function() {};
  25019. }
  25020. exports.debug = debug; // for test
  25021. /***/ }),
  25022. /***/ 655:
  25023. /***/ (function(module, __unusedexports, __webpack_require__) {
  25024. module.exports = getNextPage
  25025. const getPage = __webpack_require__(604)
  25026. function getNextPage (octokit, link, headers) {
  25027. return getPage(octokit, link, 'next', headers)
  25028. }
  25029. /***/ }),
  25030. /***/ 657:
  25031. /***/ (function(module, __unusedexports, __webpack_require__) {
  25032. module.exports = octokitValidate;
  25033. const validate = __webpack_require__(132);
  25034. function octokitValidate(octokit) {
  25035. octokit.hook.before("request", validate.bind(null, octokit));
  25036. }
  25037. /***/ }),
  25038. /***/ 669:
  25039. /***/ (function(module) {
  25040. module.exports = require("util");
  25041. /***/ }),
  25042. /***/ 670:
  25043. /***/ (function(module) {
  25044. module.exports = register
  25045. function register (state, name, method, options) {
  25046. if (typeof method !== 'function') {
  25047. throw new Error('method for before hook must be a function')
  25048. }
  25049. if (!options) {
  25050. options = {}
  25051. }
  25052. if (Array.isArray(name)) {
  25053. return name.reverse().reduce(function (callback, name) {
  25054. return register.bind(null, state, name, callback, options)
  25055. }, method)()
  25056. }
  25057. return Promise.resolve()
  25058. .then(function () {
  25059. if (!state.registry[name]) {
  25060. return method(options)
  25061. }
  25062. return (state.registry[name]).reduce(function (method, registered) {
  25063. return registered.hook.bind(null, method, options)
  25064. }, method)()
  25065. })
  25066. }
  25067. /***/ }),
  25068. /***/ 682:
  25069. /***/ (function(module, __unusedexports, __webpack_require__) {
  25070. var register = __webpack_require__(670)
  25071. var addHook = __webpack_require__(549)
  25072. var removeHook = __webpack_require__(819)
  25073. // bind with array of arguments: https://stackoverflow.com/a/21792913
  25074. var bind = Function.bind
  25075. var bindable = bind.bind(bind)
  25076. function bindApi (hook, state, name) {
  25077. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  25078. hook.api = { remove: removeHookRef }
  25079. hook.remove = removeHookRef
  25080. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  25081. var args = name ? [state, kind, name] : [state, kind]
  25082. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  25083. })
  25084. }
  25085. function HookSingular () {
  25086. var singularHookName = 'h'
  25087. var singularHookState = {
  25088. registry: {}
  25089. }
  25090. var singularHook = register.bind(null, singularHookState, singularHookName)
  25091. bindApi(singularHook, singularHookState, singularHookName)
  25092. return singularHook
  25093. }
  25094. function HookCollection () {
  25095. var state = {
  25096. registry: {}
  25097. }
  25098. var hook = register.bind(null, state)
  25099. bindApi(hook, state)
  25100. return hook
  25101. }
  25102. var collectionHookDeprecationMessageDisplayed = false
  25103. function Hook () {
  25104. if (!collectionHookDeprecationMessageDisplayed) {
  25105. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  25106. collectionHookDeprecationMessageDisplayed = true
  25107. }
  25108. return HookCollection()
  25109. }
  25110. Hook.Singular = HookSingular.bind()
  25111. Hook.Collection = HookCollection.bind()
  25112. module.exports = Hook
  25113. // expose constructors as a named property for TypeScript
  25114. module.exports.Hook = Hook
  25115. module.exports.Singular = Hook.Singular
  25116. module.exports.Collection = Hook.Collection
  25117. /***/ }),
  25118. /***/ 689:
  25119. /***/ (function(module, __unusedexports, __webpack_require__) {
  25120. "use strict";
  25121. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  25122. // In that case, fall back to a deprecated internal.
  25123. const util = __webpack_require__(669);
  25124. let uv;
  25125. if (typeof util.getSystemErrorName === 'function') {
  25126. module.exports = util.getSystemErrorName;
  25127. } else {
  25128. try {
  25129. uv = process.binding('uv');
  25130. if (typeof uv.errname !== 'function') {
  25131. throw new TypeError('uv.errname is not a function');
  25132. }
  25133. } catch (err) {
  25134. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  25135. uv = null;
  25136. }
  25137. module.exports = code => errname(uv, code);
  25138. }
  25139. // Used for testing the fallback behavior
  25140. module.exports.__test__ = errname;
  25141. function errname(uv, code) {
  25142. if (uv) {
  25143. return uv.errname(code);
  25144. }
  25145. if (!(code < 0)) {
  25146. throw new Error('err >= 0');
  25147. }
  25148. return `Unknown system error ${code}`;
  25149. }
  25150. /***/ }),
  25151. /***/ 691:
  25152. /***/ (function(module, __unusedexports, __webpack_require__) {
  25153. module.exports = authenticationPlugin;
  25154. const { Deprecation } = __webpack_require__(932);
  25155. const once = __webpack_require__(223);
  25156. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  25157. const authenticate = __webpack_require__(795);
  25158. const beforeRequest = __webpack_require__(578);
  25159. const requestError = __webpack_require__(275);
  25160. function authenticationPlugin(octokit, options) {
  25161. if (options.auth) {
  25162. octokit.authenticate = () => {
  25163. deprecateAuthenticate(
  25164. octokit.log,
  25165. new Deprecation(
  25166. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  25167. )
  25168. );
  25169. };
  25170. return;
  25171. }
  25172. const state = {
  25173. octokit,
  25174. auth: false
  25175. };
  25176. octokit.authenticate = authenticate.bind(null, state);
  25177. octokit.hook.before("request", beforeRequest.bind(null, state));
  25178. octokit.hook.error("request", requestError.bind(null, state));
  25179. }
  25180. /***/ }),
  25181. /***/ 707:
  25182. /***/ (function(module) {
  25183. /**
  25184. * Convert array of 16 byte values to UUID string format of the form:
  25185. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  25186. */
  25187. var byteToHex = [];
  25188. for (var i = 0; i < 256; ++i) {
  25189. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  25190. }
  25191. function bytesToUuid(buf, offset) {
  25192. var i = offset || 0;
  25193. var bth = byteToHex;
  25194. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  25195. return ([bth[buf[i++]], bth[buf[i++]],
  25196. bth[buf[i++]], bth[buf[i++]], '-',
  25197. bth[buf[i++]], bth[buf[i++]], '-',
  25198. bth[buf[i++]], bth[buf[i++]], '-',
  25199. bth[buf[i++]], bth[buf[i++]], '-',
  25200. bth[buf[i++]], bth[buf[i++]],
  25201. bth[buf[i++]], bth[buf[i++]],
  25202. bth[buf[i++]], bth[buf[i++]]]).join('');
  25203. }
  25204. module.exports = bytesToUuid;
  25205. /***/ }),
  25206. /***/ 710:
  25207. /***/ (function(module) {
  25208. // This is not the set of all possible signals.
  25209. //
  25210. // It IS, however, the set of all signals that trigger
  25211. // an exit on either Linux or BSD systems. Linux is a
  25212. // superset of the signal names supported on BSD, and
  25213. // the unknown signals just fail to register, so we can
  25214. // catch that easily enough.
  25215. //
  25216. // Don't bother with SIGKILL. It's uncatchable, which
  25217. // means that we can't fire any callbacks anyway.
  25218. //
  25219. // If a user does happen to register a handler on a non-
  25220. // fatal signal like SIGWINCH or something, and then
  25221. // exit, it'll end up firing `process.emit('exit')`, so
  25222. // the handler will be fired anyway.
  25223. //
  25224. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  25225. // artificially, inherently leave the process in a
  25226. // state from which it is not safe to try and enter JS
  25227. // listeners.
  25228. module.exports = [
  25229. 'SIGABRT',
  25230. 'SIGALRM',
  25231. 'SIGHUP',
  25232. 'SIGINT',
  25233. 'SIGTERM'
  25234. ]
  25235. if (process.platform !== 'win32') {
  25236. module.exports.push(
  25237. 'SIGVTALRM',
  25238. 'SIGXCPU',
  25239. 'SIGXFSZ',
  25240. 'SIGUSR2',
  25241. 'SIGTRAP',
  25242. 'SIGSYS',
  25243. 'SIGQUIT',
  25244. 'SIGIOT'
  25245. // should detect profiler and enable/disable accordingly.
  25246. // see #21
  25247. // 'SIGPROF'
  25248. )
  25249. }
  25250. if (process.platform === 'linux') {
  25251. module.exports.push(
  25252. 'SIGIO',
  25253. 'SIGPOLL',
  25254. 'SIGPWR',
  25255. 'SIGSTKFLT',
  25256. 'SIGUNUSED'
  25257. )
  25258. }
  25259. /***/ }),
  25260. /***/ 728:
  25261. /***/ (function(module, __unusedexports, __webpack_require__) {
  25262. module.exports = isexe
  25263. isexe.sync = sync
  25264. var fs = __webpack_require__(747)
  25265. function isexe (path, options, cb) {
  25266. fs.stat(path, function (er, stat) {
  25267. cb(er, er ? false : checkStat(stat, options))
  25268. })
  25269. }
  25270. function sync (path, options) {
  25271. return checkStat(fs.statSync(path), options)
  25272. }
  25273. function checkStat (stat, options) {
  25274. return stat.isFile() && checkMode(stat, options)
  25275. }
  25276. function checkMode (stat, options) {
  25277. var mod = stat.mode
  25278. var uid = stat.uid
  25279. var gid = stat.gid
  25280. var myUid = options.uid !== undefined ?
  25281. options.uid : process.getuid && process.getuid()
  25282. var myGid = options.gid !== undefined ?
  25283. options.gid : process.getgid && process.getgid()
  25284. var u = parseInt('100', 8)
  25285. var g = parseInt('010', 8)
  25286. var o = parseInt('001', 8)
  25287. var ug = u | g
  25288. var ret = (mod & o) ||
  25289. (mod & g) && gid === myGid ||
  25290. (mod & u) && uid === myUid ||
  25291. (mod & ug) && myUid === 0
  25292. return ret
  25293. }
  25294. /***/ }),
  25295. /***/ 733:
  25296. /***/ (function(module, __unusedexports, __webpack_require__) {
  25297. module.exports = authenticationBeforeRequest;
  25298. const btoa = __webpack_require__(358);
  25299. const withAuthorizationPrefix = __webpack_require__(603);
  25300. function authenticationBeforeRequest(state, options) {
  25301. if (typeof state.auth === "string") {
  25302. options.headers.authorization = withAuthorizationPrefix(state.auth);
  25303. return;
  25304. }
  25305. if (state.auth.username) {
  25306. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  25307. options.headers.authorization = `Basic ${hash}`;
  25308. if (state.otp) {
  25309. options.headers["x-github-otp"] = state.otp;
  25310. }
  25311. return;
  25312. }
  25313. if (state.auth.clientId) {
  25314. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  25315. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  25316. // URL though: `/applications/:client_id/tokens/:access_token`.
  25317. //
  25318. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  25319. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  25320. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  25321. //
  25322. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  25323. // as well as "/applications/123/tokens/token456"
  25324. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  25325. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  25326. options.headers.authorization = `Basic ${hash}`;
  25327. return;
  25328. }
  25329. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  25330. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  25331. return;
  25332. }
  25333. return Promise.resolve()
  25334. .then(() => {
  25335. return state.auth();
  25336. })
  25337. .then(authorization => {
  25338. options.headers.authorization = withAuthorizationPrefix(authorization);
  25339. });
  25340. }
  25341. /***/ }),
  25342. /***/ 738:
  25343. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  25344. "use strict";
  25345. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  25346. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  25347. return new (P || (P = Promise))(function (resolve, reject) {
  25348. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  25349. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  25350. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  25351. step((generator = generator.apply(thisArg, _arguments || [])).next());
  25352. });
  25353. };
  25354. var __importStar = (this && this.__importStar) || function (mod) {
  25355. if (mod && mod.__esModule) return mod;
  25356. var result = {};
  25357. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  25358. result["default"] = mod;
  25359. return result;
  25360. };
  25361. Object.defineProperty(exports, "__esModule", { value: true });
  25362. const core = __importStar(__webpack_require__(186));
  25363. const exec = __importStar(__webpack_require__(514));
  25364. const fshelper = __importStar(__webpack_require__(219));
  25365. const io = __importStar(__webpack_require__(436));
  25366. const path = __importStar(__webpack_require__(622));
  25367. const refHelper = __importStar(__webpack_require__(601));
  25368. const regexpHelper = __importStar(__webpack_require__(120));
  25369. const retryHelper = __importStar(__webpack_require__(155));
  25370. const git_version_1 = __webpack_require__(142);
  25371. // Auth header not supported before 2.9
  25372. // Wire protocol v2 not supported before 2.18
  25373. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  25374. function createCommandManager(workingDirectory, lfs) {
  25375. return __awaiter(this, void 0, void 0, function* () {
  25376. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  25377. });
  25378. }
  25379. exports.createCommandManager = createCommandManager;
  25380. class GitCommandManager {
  25381. // Private constructor; use createCommandManager()
  25382. constructor() {
  25383. this.gitEnv = {
  25384. GIT_TERMINAL_PROMPT: '0',
  25385. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  25386. };
  25387. this.gitPath = '';
  25388. this.lfs = false;
  25389. this.workingDirectory = '';
  25390. }
  25391. branchDelete(remote, branch) {
  25392. return __awaiter(this, void 0, void 0, function* () {
  25393. const args = ['branch', '--delete', '--force'];
  25394. if (remote) {
  25395. args.push('--remote');
  25396. }
  25397. args.push(branch);
  25398. yield this.execGit(args);
  25399. });
  25400. }
  25401. branchExists(remote, pattern) {
  25402. return __awaiter(this, void 0, void 0, function* () {
  25403. const args = ['branch', '--list'];
  25404. if (remote) {
  25405. args.push('--remote');
  25406. }
  25407. args.push(pattern);
  25408. const output = yield this.execGit(args);
  25409. return !!output.stdout.trim();
  25410. });
  25411. }
  25412. branchList(remote) {
  25413. return __awaiter(this, void 0, void 0, function* () {
  25414. const result = [];
  25415. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  25416. // "branch --list" is more difficult when in a detached HEAD state.
  25417. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  25418. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  25419. const args = ['rev-parse', '--symbolic-full-name'];
  25420. if (remote) {
  25421. args.push('--remotes=origin');
  25422. }
  25423. else {
  25424. args.push('--branches');
  25425. }
  25426. const output = yield this.execGit(args);
  25427. for (let branch of output.stdout.trim().split('\n')) {
  25428. branch = branch.trim();
  25429. if (branch) {
  25430. if (branch.startsWith('refs/heads/')) {
  25431. branch = branch.substr('refs/heads/'.length);
  25432. }
  25433. else if (branch.startsWith('refs/remotes/')) {
  25434. branch = branch.substr('refs/remotes/'.length);
  25435. }
  25436. result.push(branch);
  25437. }
  25438. }
  25439. return result;
  25440. });
  25441. }
  25442. checkout(ref, startPoint) {
  25443. return __awaiter(this, void 0, void 0, function* () {
  25444. const args = ['checkout', '--progress', '--force'];
  25445. if (startPoint) {
  25446. args.push('-B', ref, startPoint);
  25447. }
  25448. else {
  25449. args.push(ref);
  25450. }
  25451. yield this.execGit(args);
  25452. });
  25453. }
  25454. checkoutDetach() {
  25455. return __awaiter(this, void 0, void 0, function* () {
  25456. const args = ['checkout', '--detach'];
  25457. yield this.execGit(args);
  25458. });
  25459. }
  25460. config(configKey, configValue, globalConfig) {
  25461. return __awaiter(this, void 0, void 0, function* () {
  25462. yield this.execGit([
  25463. 'config',
  25464. globalConfig ? '--global' : '--local',
  25465. configKey,
  25466. configValue
  25467. ]);
  25468. });
  25469. }
  25470. configExists(configKey, globalConfig) {
  25471. return __awaiter(this, void 0, void 0, function* () {
  25472. const pattern = regexpHelper.escape(configKey);
  25473. const output = yield this.execGit([
  25474. 'config',
  25475. globalConfig ? '--global' : '--local',
  25476. '--name-only',
  25477. '--get-regexp',
  25478. pattern
  25479. ], true);
  25480. return output.exitCode === 0;
  25481. });
  25482. }
  25483. fetch(refSpec, fetchDepth) {
  25484. return __awaiter(this, void 0, void 0, function* () {
  25485. const args = ['-c', 'protocol.version=2', 'fetch'];
  25486. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  25487. args.push('--no-tags');
  25488. }
  25489. args.push('--prune', '--progress', '--no-recurse-submodules');
  25490. if (fetchDepth && fetchDepth > 0) {
  25491. args.push(`--depth=${fetchDepth}`);
  25492. }
  25493. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  25494. args.push('--unshallow');
  25495. }
  25496. args.push('origin');
  25497. for (const arg of refSpec) {
  25498. args.push(arg);
  25499. }
  25500. const that = this;
  25501. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  25502. yield that.execGit(args);
  25503. }));
  25504. });
  25505. }
  25506. getDefaultBranch(repositoryUrl) {
  25507. return __awaiter(this, void 0, void 0, function* () {
  25508. let output;
  25509. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  25510. output = yield this.execGit([
  25511. 'ls-remote',
  25512. '--quiet',
  25513. '--exit-code',
  25514. '--symref',
  25515. repositoryUrl,
  25516. 'HEAD'
  25517. ]);
  25518. }));
  25519. if (output) {
  25520. // Satisfy compiler, will always be set
  25521. for (let line of output.stdout.trim().split('\n')) {
  25522. line = line.trim();
  25523. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  25524. return line
  25525. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  25526. .trim();
  25527. }
  25528. }
  25529. }
  25530. throw new Error('Unexpected output when retrieving default branch');
  25531. });
  25532. }
  25533. getWorkingDirectory() {
  25534. return this.workingDirectory;
  25535. }
  25536. init() {
  25537. return __awaiter(this, void 0, void 0, function* () {
  25538. yield this.execGit(['init', this.workingDirectory]);
  25539. });
  25540. }
  25541. isDetached() {
  25542. return __awaiter(this, void 0, void 0, function* () {
  25543. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  25544. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  25545. return !output.stdout.trim().startsWith('refs/heads/');
  25546. });
  25547. }
  25548. lfsFetch(ref) {
  25549. return __awaiter(this, void 0, void 0, function* () {
  25550. const args = ['lfs', 'fetch', 'origin', ref];
  25551. const that = this;
  25552. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  25553. yield that.execGit(args);
  25554. }));
  25555. });
  25556. }
  25557. lfsInstall() {
  25558. return __awaiter(this, void 0, void 0, function* () {
  25559. yield this.execGit(['lfs', 'install', '--local']);
  25560. });
  25561. }
  25562. log1() {
  25563. return __awaiter(this, void 0, void 0, function* () {
  25564. const output = yield this.execGit(['log', '-1']);
  25565. return output.stdout;
  25566. });
  25567. }
  25568. remoteAdd(remoteName, remoteUrl) {
  25569. return __awaiter(this, void 0, void 0, function* () {
  25570. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  25571. });
  25572. }
  25573. removeEnvironmentVariable(name) {
  25574. delete this.gitEnv[name];
  25575. }
  25576. /**
  25577. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  25578. * For an annotated tag, the tag SHA is returned.
  25579. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  25580. * @returns {Promise<string>}
  25581. */
  25582. revParse(ref) {
  25583. return __awaiter(this, void 0, void 0, function* () {
  25584. const output = yield this.execGit(['rev-parse', ref]);
  25585. return output.stdout.trim();
  25586. });
  25587. }
  25588. setEnvironmentVariable(name, value) {
  25589. this.gitEnv[name] = value;
  25590. }
  25591. shaExists(sha) {
  25592. return __awaiter(this, void 0, void 0, function* () {
  25593. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  25594. const output = yield this.execGit(args, true);
  25595. return output.exitCode === 0;
  25596. });
  25597. }
  25598. submoduleForeach(command, recursive) {
  25599. return __awaiter(this, void 0, void 0, function* () {
  25600. const args = ['submodule', 'foreach'];
  25601. if (recursive) {
  25602. args.push('--recursive');
  25603. }
  25604. args.push(command);
  25605. const output = yield this.execGit(args);
  25606. return output.stdout;
  25607. });
  25608. }
  25609. submoduleSync(recursive) {
  25610. return __awaiter(this, void 0, void 0, function* () {
  25611. const args = ['submodule', 'sync'];
  25612. if (recursive) {
  25613. args.push('--recursive');
  25614. }
  25615. yield this.execGit(args);
  25616. });
  25617. }
  25618. submoduleUpdate(fetchDepth, recursive) {
  25619. return __awaiter(this, void 0, void 0, function* () {
  25620. const args = ['-c', 'protocol.version=2'];
  25621. args.push('submodule', 'update', '--init', '--force');
  25622. if (fetchDepth > 0) {
  25623. args.push(`--depth=${fetchDepth}`);
  25624. }
  25625. if (recursive) {
  25626. args.push('--recursive');
  25627. }
  25628. yield this.execGit(args);
  25629. });
  25630. }
  25631. tagExists(pattern) {
  25632. return __awaiter(this, void 0, void 0, function* () {
  25633. const output = yield this.execGit(['tag', '--list', pattern]);
  25634. return !!output.stdout.trim();
  25635. });
  25636. }
  25637. tryClean() {
  25638. return __awaiter(this, void 0, void 0, function* () {
  25639. const output = yield this.execGit(['clean', '-ffdx'], true);
  25640. return output.exitCode === 0;
  25641. });
  25642. }
  25643. tryConfigUnset(configKey, globalConfig) {
  25644. return __awaiter(this, void 0, void 0, function* () {
  25645. const output = yield this.execGit([
  25646. 'config',
  25647. globalConfig ? '--global' : '--local',
  25648. '--unset-all',
  25649. configKey
  25650. ], true);
  25651. return output.exitCode === 0;
  25652. });
  25653. }
  25654. tryDisableAutomaticGarbageCollection() {
  25655. return __awaiter(this, void 0, void 0, function* () {
  25656. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  25657. return output.exitCode === 0;
  25658. });
  25659. }
  25660. tryGetFetchUrl() {
  25661. return __awaiter(this, void 0, void 0, function* () {
  25662. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  25663. if (output.exitCode !== 0) {
  25664. return '';
  25665. }
  25666. const stdout = output.stdout.trim();
  25667. if (stdout.includes('\n')) {
  25668. return '';
  25669. }
  25670. return stdout;
  25671. });
  25672. }
  25673. tryReset() {
  25674. return __awaiter(this, void 0, void 0, function* () {
  25675. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  25676. return output.exitCode === 0;
  25677. });
  25678. }
  25679. static createCommandManager(workingDirectory, lfs) {
  25680. return __awaiter(this, void 0, void 0, function* () {
  25681. const result = new GitCommandManager();
  25682. yield result.initializeCommandManager(workingDirectory, lfs);
  25683. return result;
  25684. });
  25685. }
  25686. execGit(args, allowAllExitCodes = false) {
  25687. return __awaiter(this, void 0, void 0, function* () {
  25688. fshelper.directoryExistsSync(this.workingDirectory, true);
  25689. const result = new GitOutput();
  25690. const env = {};
  25691. for (const key of Object.keys(process.env)) {
  25692. env[key] = process.env[key];
  25693. }
  25694. for (const key of Object.keys(this.gitEnv)) {
  25695. env[key] = this.gitEnv[key];
  25696. }
  25697. const stdout = [];
  25698. const options = {
  25699. cwd: this.workingDirectory,
  25700. env,
  25701. ignoreReturnCode: allowAllExitCodes,
  25702. listeners: {
  25703. stdout: (data) => {
  25704. stdout.push(data.toString());
  25705. }
  25706. }
  25707. };
  25708. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  25709. result.stdout = stdout.join('');
  25710. return result;
  25711. });
  25712. }
  25713. initializeCommandManager(workingDirectory, lfs) {
  25714. return __awaiter(this, void 0, void 0, function* () {
  25715. this.workingDirectory = workingDirectory;
  25716. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  25717. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  25718. this.lfs = lfs;
  25719. if (!this.lfs) {
  25720. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  25721. }
  25722. this.gitPath = yield io.which('git', true);
  25723. // Git version
  25724. core.debug('Getting git version');
  25725. let gitVersion = new git_version_1.GitVersion();
  25726. let gitOutput = yield this.execGit(['version']);
  25727. let stdout = gitOutput.stdout.trim();
  25728. if (!stdout.includes('\n')) {
  25729. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  25730. if (match) {
  25731. gitVersion = new git_version_1.GitVersion(match[0]);
  25732. }
  25733. }
  25734. if (!gitVersion.isValid()) {
  25735. throw new Error('Unable to determine git version');
  25736. }
  25737. // Minimum git version
  25738. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  25739. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  25740. }
  25741. if (this.lfs) {
  25742. // Git-lfs version
  25743. core.debug('Getting git-lfs version');
  25744. let gitLfsVersion = new git_version_1.GitVersion();
  25745. const gitLfsPath = yield io.which('git-lfs', true);
  25746. gitOutput = yield this.execGit(['lfs', 'version']);
  25747. stdout = gitOutput.stdout.trim();
  25748. if (!stdout.includes('\n')) {
  25749. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  25750. if (match) {
  25751. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  25752. }
  25753. }
  25754. if (!gitLfsVersion.isValid()) {
  25755. throw new Error('Unable to determine git-lfs version');
  25756. }
  25757. // Minimum git-lfs version
  25758. // Note:
  25759. // - Auth header not supported before 2.1
  25760. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  25761. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  25762. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  25763. }
  25764. }
  25765. // Set the user agent
  25766. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  25767. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  25768. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  25769. });
  25770. }
  25771. }
  25772. class GitOutput {
  25773. constructor() {
  25774. this.stdout = '';
  25775. this.exitCode = 0;
  25776. }
  25777. }
  25778. /***/ }),
  25779. /***/ 746:
  25780. /***/ (function(module, __unusedexports, __webpack_require__) {
  25781. "use strict";
  25782. const cp = __webpack_require__(129);
  25783. const parse = __webpack_require__(855);
  25784. const enoent = __webpack_require__(101);
  25785. function spawn(command, args, options) {
  25786. // Parse the arguments
  25787. const parsed = parse(command, args, options);
  25788. // Spawn the child process
  25789. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  25790. // Hook into child process "exit" event to emit an error if the command
  25791. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  25792. enoent.hookChildProcess(spawned, parsed);
  25793. return spawned;
  25794. }
  25795. function spawnSync(command, args, options) {
  25796. // Parse the arguments
  25797. const parsed = parse(command, args, options);
  25798. // Spawn the child process
  25799. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  25800. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  25801. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  25802. return result;
  25803. }
  25804. module.exports = spawn;
  25805. module.exports.spawn = spawn;
  25806. module.exports.sync = spawnSync;
  25807. module.exports._parse = parse;
  25808. module.exports._enoent = enoent;
  25809. /***/ }),
  25810. /***/ 747:
  25811. /***/ (function(module) {
  25812. module.exports = require("fs");
  25813. /***/ }),
  25814. /***/ 760:
  25815. /***/ (function(module, __unusedexports, __webpack_require__) {
  25816. "use strict";
  25817. const os = __webpack_require__(87);
  25818. const macosRelease = __webpack_require__(493);
  25819. const winRelease = __webpack_require__(515);
  25820. const osName = (platform, release) => {
  25821. if (!platform && release) {
  25822. throw new Error('You can\'t specify a `release` without specifying `platform`');
  25823. }
  25824. platform = platform || os.platform();
  25825. let id;
  25826. if (platform === 'darwin') {
  25827. if (!release && os.platform() === 'darwin') {
  25828. release = os.release();
  25829. }
  25830. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  25831. id = release ? macosRelease(release).name : '';
  25832. return prefix + (id ? ' ' + id : '');
  25833. }
  25834. if (platform === 'linux') {
  25835. if (!release && os.platform() === 'linux') {
  25836. release = os.release();
  25837. }
  25838. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  25839. return 'Linux' + (id ? ' ' + id : '');
  25840. }
  25841. if (platform === 'win32') {
  25842. if (!release && os.platform() === 'win32') {
  25843. release = os.release();
  25844. }
  25845. id = release ? winRelease(release) : '';
  25846. return 'Windows' + (id ? ' ' + id : '');
  25847. }
  25848. return platform;
  25849. };
  25850. module.exports = osName;
  25851. /***/ }),
  25852. /***/ 761:
  25853. /***/ (function(module) {
  25854. module.exports = require("zlib");
  25855. /***/ }),
  25856. /***/ 766:
  25857. /***/ (function(module, __unusedexports, __webpack_require__) {
  25858. "use strict";
  25859. const pump = __webpack_require__(341);
  25860. const bufferStream = __webpack_require__(585);
  25861. class MaxBufferError extends Error {
  25862. constructor() {
  25863. super('maxBuffer exceeded');
  25864. this.name = 'MaxBufferError';
  25865. }
  25866. }
  25867. function getStream(inputStream, options) {
  25868. if (!inputStream) {
  25869. return Promise.reject(new Error('Expected a stream'));
  25870. }
  25871. options = Object.assign({maxBuffer: Infinity}, options);
  25872. const {maxBuffer} = options;
  25873. let stream;
  25874. return new Promise((resolve, reject) => {
  25875. const rejectPromise = error => {
  25876. if (error) { // A null check
  25877. error.bufferedData = stream.getBufferedValue();
  25878. }
  25879. reject(error);
  25880. };
  25881. stream = pump(inputStream, bufferStream(options), error => {
  25882. if (error) {
  25883. rejectPromise(error);
  25884. return;
  25885. }
  25886. resolve();
  25887. });
  25888. stream.on('data', () => {
  25889. if (stream.getBufferedLength() > maxBuffer) {
  25890. rejectPromise(new MaxBufferError());
  25891. }
  25892. });
  25893. }).then(() => stream.getBufferedValue());
  25894. }
  25895. module.exports = getStream;
  25896. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  25897. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  25898. module.exports.MaxBufferError = MaxBufferError;
  25899. /***/ }),
  25900. /***/ 774:
  25901. /***/ (function(module) {
  25902. "use strict";
  25903. module.exports = function (x) {
  25904. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  25905. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  25906. if (x[x.length - 1] === lf) {
  25907. x = x.slice(0, x.length - 1);
  25908. }
  25909. if (x[x.length - 1] === cr) {
  25910. x = x.slice(0, x.length - 1);
  25911. }
  25912. return x;
  25913. };
  25914. /***/ }),
  25915. /***/ 784:
  25916. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  25917. "use strict";
  25918. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  25919. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  25920. return new (P || (P = Promise))(function (resolve, reject) {
  25921. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  25922. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  25923. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  25924. step((generator = generator.apply(thisArg, _arguments || [])).next());
  25925. });
  25926. };
  25927. Object.defineProperty(exports, "__esModule", { value: true });
  25928. const core = __webpack_require__(186);
  25929. const io = __webpack_require__(436);
  25930. const fs = __webpack_require__(747);
  25931. const os = __webpack_require__(87);
  25932. const path = __webpack_require__(622);
  25933. const httpm = __webpack_require__(538);
  25934. const semver = __webpack_require__(562);
  25935. const uuidV4 = __webpack_require__(824);
  25936. const exec_1 = __webpack_require__(514);
  25937. const assert_1 = __webpack_require__(357);
  25938. class HTTPError extends Error {
  25939. constructor(httpStatusCode) {
  25940. super(`Unexpected HTTP response: ${httpStatusCode}`);
  25941. this.httpStatusCode = httpStatusCode;
  25942. Object.setPrototypeOf(this, new.target.prototype);
  25943. }
  25944. }
  25945. exports.HTTPError = HTTPError;
  25946. const IS_WINDOWS = process.platform === 'win32';
  25947. const userAgent = 'actions/tool-cache';
  25948. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  25949. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  25950. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  25951. // If directories not found, place them in common temp locations
  25952. if (!tempDirectory || !cacheRoot) {
  25953. let baseLocation;
  25954. if (IS_WINDOWS) {
  25955. // On windows use the USERPROFILE env variable
  25956. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  25957. }
  25958. else {
  25959. if (process.platform === 'darwin') {
  25960. baseLocation = '/Users';
  25961. }
  25962. else {
  25963. baseLocation = '/home';
  25964. }
  25965. }
  25966. if (!tempDirectory) {
  25967. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  25968. }
  25969. if (!cacheRoot) {
  25970. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  25971. }
  25972. }
  25973. /**
  25974. * Download a tool from an url and stream it into a file
  25975. *
  25976. * @param url url of tool to download
  25977. * @returns path to downloaded tool
  25978. */
  25979. function downloadTool(url) {
  25980. return __awaiter(this, void 0, void 0, function* () {
  25981. // Wrap in a promise so that we can resolve from within stream callbacks
  25982. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  25983. try {
  25984. const http = new httpm.HttpClient(userAgent, [], {
  25985. allowRetries: true,
  25986. maxRetries: 3
  25987. });
  25988. const destPath = path.join(tempDirectory, uuidV4());
  25989. yield io.mkdirP(tempDirectory);
  25990. core.debug(`Downloading ${url}`);
  25991. core.debug(`Downloading ${destPath}`);
  25992. if (fs.existsSync(destPath)) {
  25993. throw new Error(`Destination file path ${destPath} already exists`);
  25994. }
  25995. const response = yield http.get(url);
  25996. if (response.message.statusCode !== 200) {
  25997. const err = new HTTPError(response.message.statusCode);
  25998. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  25999. throw err;
  26000. }
  26001. const file = fs.createWriteStream(destPath);
  26002. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  26003. try {
  26004. const stream = response.message.pipe(file);
  26005. stream.on('close', () => {
  26006. core.debug('download complete');
  26007. resolve(destPath);
  26008. });
  26009. }
  26010. catch (err) {
  26011. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  26012. reject(err);
  26013. }
  26014. }));
  26015. file.on('error', err => {
  26016. file.end();
  26017. reject(err);
  26018. });
  26019. }
  26020. catch (err) {
  26021. reject(err);
  26022. }
  26023. }));
  26024. });
  26025. }
  26026. exports.downloadTool = downloadTool;
  26027. /**
  26028. * Extract a .7z file
  26029. *
  26030. * @param file path to the .7z file
  26031. * @param dest destination directory. Optional.
  26032. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  26033. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  26034. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  26035. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  26036. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  26037. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  26038. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  26039. * to 7zr.exe can be pass to this function.
  26040. * @returns path to the destination directory
  26041. */
  26042. function extract7z(file, dest, _7zPath) {
  26043. return __awaiter(this, void 0, void 0, function* () {
  26044. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  26045. assert_1.ok(file, 'parameter "file" is required');
  26046. dest = dest || (yield _createExtractFolder(dest));
  26047. const originalCwd = process.cwd();
  26048. process.chdir(dest);
  26049. if (_7zPath) {
  26050. try {
  26051. const args = [
  26052. 'x',
  26053. '-bb1',
  26054. '-bd',
  26055. '-sccUTF-8',
  26056. file
  26057. ];
  26058. const options = {
  26059. silent: true
  26060. };
  26061. yield exec_1.exec(`"${_7zPath}"`, args, options);
  26062. }
  26063. finally {
  26064. process.chdir(originalCwd);
  26065. }
  26066. }
  26067. else {
  26068. const escapedScript = path
  26069. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  26070. .replace(/'/g, "''")
  26071. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  26072. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  26073. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  26074. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  26075. const args = [
  26076. '-NoLogo',
  26077. '-Sta',
  26078. '-NoProfile',
  26079. '-NonInteractive',
  26080. '-ExecutionPolicy',
  26081. 'Unrestricted',
  26082. '-Command',
  26083. command
  26084. ];
  26085. const options = {
  26086. silent: true
  26087. };
  26088. try {
  26089. const powershellPath = yield io.which('powershell', true);
  26090. yield exec_1.exec(`"${powershellPath}"`, args, options);
  26091. }
  26092. finally {
  26093. process.chdir(originalCwd);
  26094. }
  26095. }
  26096. return dest;
  26097. });
  26098. }
  26099. exports.extract7z = extract7z;
  26100. /**
  26101. * Extract a tar
  26102. *
  26103. * @param file path to the tar
  26104. * @param dest destination directory. Optional.
  26105. * @param flags flags for the tar. Optional.
  26106. * @returns path to the destination directory
  26107. */
  26108. function extractTar(file, dest, flags = 'xz') {
  26109. return __awaiter(this, void 0, void 0, function* () {
  26110. if (!file) {
  26111. throw new Error("parameter 'file' is required");
  26112. }
  26113. dest = dest || (yield _createExtractFolder(dest));
  26114. const tarPath = yield io.which('tar', true);
  26115. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  26116. return dest;
  26117. });
  26118. }
  26119. exports.extractTar = extractTar;
  26120. /**
  26121. * Extract a zip
  26122. *
  26123. * @param file path to the zip
  26124. * @param dest destination directory. Optional.
  26125. * @returns path to the destination directory
  26126. */
  26127. function extractZip(file, dest) {
  26128. return __awaiter(this, void 0, void 0, function* () {
  26129. if (!file) {
  26130. throw new Error("parameter 'file' is required");
  26131. }
  26132. dest = dest || (yield _createExtractFolder(dest));
  26133. if (IS_WINDOWS) {
  26134. yield extractZipWin(file, dest);
  26135. }
  26136. else {
  26137. yield extractZipNix(file, dest);
  26138. }
  26139. return dest;
  26140. });
  26141. }
  26142. exports.extractZip = extractZip;
  26143. function extractZipWin(file, dest) {
  26144. return __awaiter(this, void 0, void 0, function* () {
  26145. // build the powershell command
  26146. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  26147. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  26148. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  26149. // run powershell
  26150. const powershellPath = yield io.which('powershell');
  26151. const args = [
  26152. '-NoLogo',
  26153. '-Sta',
  26154. '-NoProfile',
  26155. '-NonInteractive',
  26156. '-ExecutionPolicy',
  26157. 'Unrestricted',
  26158. '-Command',
  26159. command
  26160. ];
  26161. yield exec_1.exec(`"${powershellPath}"`, args);
  26162. });
  26163. }
  26164. function extractZipNix(file, dest) {
  26165. return __awaiter(this, void 0, void 0, function* () {
  26166. const unzipPath = yield io.which('unzip');
  26167. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  26168. });
  26169. }
  26170. /**
  26171. * Caches a directory and installs it into the tool cacheDir
  26172. *
  26173. * @param sourceDir the directory to cache into tools
  26174. * @param tool tool name
  26175. * @param version version of the tool. semver format
  26176. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  26177. */
  26178. function cacheDir(sourceDir, tool, version, arch) {
  26179. return __awaiter(this, void 0, void 0, function* () {
  26180. version = semver.clean(version) || version;
  26181. arch = arch || os.arch();
  26182. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  26183. core.debug(`source dir: ${sourceDir}`);
  26184. if (!fs.statSync(sourceDir).isDirectory()) {
  26185. throw new Error('sourceDir is not a directory');
  26186. }
  26187. // Create the tool dir
  26188. const destPath = yield _createToolPath(tool, version, arch);
  26189. // copy each child item. do not move. move can fail on Windows
  26190. // due to anti-virus software having an open handle on a file.
  26191. for (const itemName of fs.readdirSync(sourceDir)) {
  26192. const s = path.join(sourceDir, itemName);
  26193. yield io.cp(s, destPath, { recursive: true });
  26194. }
  26195. // write .complete
  26196. _completeToolPath(tool, version, arch);
  26197. return destPath;
  26198. });
  26199. }
  26200. exports.cacheDir = cacheDir;
  26201. /**
  26202. * Caches a downloaded file (GUID) and installs it
  26203. * into the tool cache with a given targetName
  26204. *
  26205. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  26206. * @param targetFile the name of the file name in the tools directory
  26207. * @param tool tool name
  26208. * @param version version of the tool. semver format
  26209. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  26210. */
  26211. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  26212. return __awaiter(this, void 0, void 0, function* () {
  26213. version = semver.clean(version) || version;
  26214. arch = arch || os.arch();
  26215. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  26216. core.debug(`source file: ${sourceFile}`);
  26217. if (!fs.statSync(sourceFile).isFile()) {
  26218. throw new Error('sourceFile is not a file');
  26219. }
  26220. // create the tool dir
  26221. const destFolder = yield _createToolPath(tool, version, arch);
  26222. // copy instead of move. move can fail on Windows due to
  26223. // anti-virus software having an open handle on a file.
  26224. const destPath = path.join(destFolder, targetFile);
  26225. core.debug(`destination file ${destPath}`);
  26226. yield io.cp(sourceFile, destPath);
  26227. // write .complete
  26228. _completeToolPath(tool, version, arch);
  26229. return destFolder;
  26230. });
  26231. }
  26232. exports.cacheFile = cacheFile;
  26233. /**
  26234. * Finds the path to a tool version in the local installed tool cache
  26235. *
  26236. * @param toolName name of the tool
  26237. * @param versionSpec version of the tool
  26238. * @param arch optional arch. defaults to arch of computer
  26239. */
  26240. function find(toolName, versionSpec, arch) {
  26241. if (!toolName) {
  26242. throw new Error('toolName parameter is required');
  26243. }
  26244. if (!versionSpec) {
  26245. throw new Error('versionSpec parameter is required');
  26246. }
  26247. arch = arch || os.arch();
  26248. // attempt to resolve an explicit version
  26249. if (!_isExplicitVersion(versionSpec)) {
  26250. const localVersions = findAllVersions(toolName, arch);
  26251. const match = _evaluateVersions(localVersions, versionSpec);
  26252. versionSpec = match;
  26253. }
  26254. // check for the explicit version in the cache
  26255. let toolPath = '';
  26256. if (versionSpec) {
  26257. versionSpec = semver.clean(versionSpec) || '';
  26258. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  26259. core.debug(`checking cache: ${cachePath}`);
  26260. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  26261. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  26262. toolPath = cachePath;
  26263. }
  26264. else {
  26265. core.debug('not found');
  26266. }
  26267. }
  26268. return toolPath;
  26269. }
  26270. exports.find = find;
  26271. /**
  26272. * Finds the paths to all versions of a tool that are installed in the local tool cache
  26273. *
  26274. * @param toolName name of the tool
  26275. * @param arch optional arch. defaults to arch of computer
  26276. */
  26277. function findAllVersions(toolName, arch) {
  26278. const versions = [];
  26279. arch = arch || os.arch();
  26280. const toolPath = path.join(cacheRoot, toolName);
  26281. if (fs.existsSync(toolPath)) {
  26282. const children = fs.readdirSync(toolPath);
  26283. for (const child of children) {
  26284. if (_isExplicitVersion(child)) {
  26285. const fullPath = path.join(toolPath, child, arch || '');
  26286. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  26287. versions.push(child);
  26288. }
  26289. }
  26290. }
  26291. }
  26292. return versions;
  26293. }
  26294. exports.findAllVersions = findAllVersions;
  26295. function _createExtractFolder(dest) {
  26296. return __awaiter(this, void 0, void 0, function* () {
  26297. if (!dest) {
  26298. // create a temp dir
  26299. dest = path.join(tempDirectory, uuidV4());
  26300. }
  26301. yield io.mkdirP(dest);
  26302. return dest;
  26303. });
  26304. }
  26305. function _createToolPath(tool, version, arch) {
  26306. return __awaiter(this, void 0, void 0, function* () {
  26307. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  26308. core.debug(`destination ${folderPath}`);
  26309. const markerPath = `${folderPath}.complete`;
  26310. yield io.rmRF(folderPath);
  26311. yield io.rmRF(markerPath);
  26312. yield io.mkdirP(folderPath);
  26313. return folderPath;
  26314. });
  26315. }
  26316. function _completeToolPath(tool, version, arch) {
  26317. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  26318. const markerPath = `${folderPath}.complete`;
  26319. fs.writeFileSync(markerPath, '');
  26320. core.debug('finished caching tool');
  26321. }
  26322. function _isExplicitVersion(versionSpec) {
  26323. const c = semver.clean(versionSpec) || '';
  26324. core.debug(`isExplicit: ${c}`);
  26325. const valid = semver.valid(c) != null;
  26326. core.debug(`explicit? ${valid}`);
  26327. return valid;
  26328. }
  26329. function _evaluateVersions(versions, versionSpec) {
  26330. let version = '';
  26331. core.debug(`evaluating ${versions.length} versions`);
  26332. versions = versions.sort((a, b) => {
  26333. if (semver.gt(a, b)) {
  26334. return 1;
  26335. }
  26336. return -1;
  26337. });
  26338. for (let i = versions.length - 1; i >= 0; i--) {
  26339. const potential = versions[i];
  26340. const satisfied = semver.satisfies(potential, versionSpec);
  26341. if (satisfied) {
  26342. version = potential;
  26343. break;
  26344. }
  26345. }
  26346. if (version) {
  26347. core.debug(`matched: ${version}`);
  26348. }
  26349. else {
  26350. core.debug('match not found');
  26351. }
  26352. return version;
  26353. }
  26354. //# sourceMappingURL=tool-cache.js.map
  26355. /***/ }),
  26356. /***/ 795:
  26357. /***/ (function(module, __unusedexports, __webpack_require__) {
  26358. module.exports = authenticate;
  26359. const { Deprecation } = __webpack_require__(932);
  26360. const once = __webpack_require__(223);
  26361. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  26362. function authenticate(state, options) {
  26363. deprecateAuthenticate(
  26364. state.octokit.log,
  26365. new Deprecation(
  26366. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  26367. )
  26368. );
  26369. if (!options) {
  26370. state.auth = false;
  26371. return;
  26372. }
  26373. switch (options.type) {
  26374. case "basic":
  26375. if (!options.username || !options.password) {
  26376. throw new Error(
  26377. "Basic authentication requires both a username and password to be set"
  26378. );
  26379. }
  26380. break;
  26381. case "oauth":
  26382. if (!options.token && !(options.key && options.secret)) {
  26383. throw new Error(
  26384. "OAuth2 authentication requires a token or key & secret to be set"
  26385. );
  26386. }
  26387. break;
  26388. case "token":
  26389. case "app":
  26390. if (!options.token) {
  26391. throw new Error("Token authentication requires a token to be set");
  26392. }
  26393. break;
  26394. default:
  26395. throw new Error(
  26396. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  26397. );
  26398. }
  26399. state.auth = options;
  26400. }
  26401. /***/ }),
  26402. /***/ 819:
  26403. /***/ (function(module) {
  26404. module.exports = removeHook
  26405. function removeHook (state, name, method) {
  26406. if (!state.registry[name]) {
  26407. return
  26408. }
  26409. var index = state.registry[name]
  26410. .map(function (registered) { return registered.orig })
  26411. .indexOf(method)
  26412. if (index === -1) {
  26413. return
  26414. }
  26415. state.registry[name].splice(index, 1)
  26416. }
  26417. /***/ }),
  26418. /***/ 823:
  26419. /***/ (function(module, __unusedexports, __webpack_require__) {
  26420. module.exports = Octokit;
  26421. const { request } = __webpack_require__(234);
  26422. const Hook = __webpack_require__(682);
  26423. const parseClientOptions = __webpack_require__(613);
  26424. function Octokit(plugins, options) {
  26425. options = options || {};
  26426. const hook = new Hook.Collection();
  26427. const log = Object.assign(
  26428. {
  26429. debug: () => {},
  26430. info: () => {},
  26431. warn: console.warn,
  26432. error: console.error
  26433. },
  26434. options && options.log
  26435. );
  26436. const api = {
  26437. hook,
  26438. log,
  26439. request: request.defaults(parseClientOptions(options, log, hook))
  26440. };
  26441. plugins.forEach(pluginFunction => pluginFunction(api, options));
  26442. return api;
  26443. }
  26444. /***/ }),
  26445. /***/ 824:
  26446. /***/ (function(module, __unusedexports, __webpack_require__) {
  26447. var rng = __webpack_require__(859);
  26448. var bytesToUuid = __webpack_require__(707);
  26449. function v4(options, buf, offset) {
  26450. var i = buf && offset || 0;
  26451. if (typeof(options) == 'string') {
  26452. buf = options === 'binary' ? new Array(16) : null;
  26453. options = null;
  26454. }
  26455. options = options || {};
  26456. var rnds = options.random || (options.rng || rng)();
  26457. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  26458. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  26459. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  26460. // Copy bytes to buffer, if provided
  26461. if (buf) {
  26462. for (var ii = 0; ii < 16; ++ii) {
  26463. buf[i + ii] = rnds[ii];
  26464. }
  26465. }
  26466. return buf || bytesToUuid(rnds);
  26467. }
  26468. module.exports = v4;
  26469. /***/ }),
  26470. /***/ 826:
  26471. /***/ (function(module, __unusedexports, __webpack_require__) {
  26472. module.exports = registerPlugin;
  26473. const factory = __webpack_require__(320);
  26474. function registerPlugin(plugins, pluginFunction) {
  26475. return factory(
  26476. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26477. );
  26478. }
  26479. /***/ }),
  26480. /***/ 833:
  26481. /***/ (function(module, __unusedexports, __webpack_require__) {
  26482. const factory = __webpack_require__(320);
  26483. module.exports = factory();
  26484. /***/ }),
  26485. /***/ 835:
  26486. /***/ (function(module) {
  26487. module.exports = require("url");
  26488. /***/ }),
  26489. /***/ 840:
  26490. /***/ (function(module) {
  26491. "use strict";
  26492. /*!
  26493. * isobject <https://github.com/jonschlinkert/isobject>
  26494. *
  26495. * Copyright (c) 2014-2017, Jon Schlinkert.
  26496. * Released under the MIT License.
  26497. */
  26498. function isObject(val) {
  26499. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  26500. }
  26501. /*!
  26502. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  26503. *
  26504. * Copyright (c) 2014-2017, Jon Schlinkert.
  26505. * Released under the MIT License.
  26506. */
  26507. function isObjectObject(o) {
  26508. return isObject(o) === true
  26509. && Object.prototype.toString.call(o) === '[object Object]';
  26510. }
  26511. function isPlainObject(o) {
  26512. var ctor,prot;
  26513. if (isObjectObject(o) === false) return false;
  26514. // If has modified constructor
  26515. ctor = o.constructor;
  26516. if (typeof ctor !== 'function') return false;
  26517. // If has modified prototype
  26518. prot = ctor.prototype;
  26519. if (isObjectObject(prot) === false) return false;
  26520. // If constructor does not have an Object-specific method
  26521. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  26522. return false;
  26523. }
  26524. // Most likely a plain Object
  26525. return true;
  26526. }
  26527. module.exports = isPlainObject;
  26528. /***/ }),
  26529. /***/ 855:
  26530. /***/ (function(module, __unusedexports, __webpack_require__) {
  26531. "use strict";
  26532. const path = __webpack_require__(622);
  26533. const niceTry = __webpack_require__(560);
  26534. const resolveCommand = __webpack_require__(274);
  26535. const escape = __webpack_require__(48);
  26536. const readShebang = __webpack_require__(252);
  26537. const semver = __webpack_require__(911);
  26538. const isWin = process.platform === 'win32';
  26539. const isExecutableRegExp = /\.(?:com|exe)$/i;
  26540. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  26541. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  26542. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  26543. function detectShebang(parsed) {
  26544. parsed.file = resolveCommand(parsed);
  26545. const shebang = parsed.file && readShebang(parsed.file);
  26546. if (shebang) {
  26547. parsed.args.unshift(parsed.file);
  26548. parsed.command = shebang;
  26549. return resolveCommand(parsed);
  26550. }
  26551. return parsed.file;
  26552. }
  26553. function parseNonShell(parsed) {
  26554. if (!isWin) {
  26555. return parsed;
  26556. }
  26557. // Detect & add support for shebangs
  26558. const commandFile = detectShebang(parsed);
  26559. // We don't need a shell if the command filename is an executable
  26560. const needsShell = !isExecutableRegExp.test(commandFile);
  26561. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  26562. // Note that `forceShell` is an hidden option used only in tests
  26563. if (parsed.options.forceShell || needsShell) {
  26564. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  26565. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  26566. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  26567. // we need to double escape them
  26568. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  26569. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  26570. // This is necessary otherwise it will always fail with ENOENT in those cases
  26571. parsed.command = path.normalize(parsed.command);
  26572. // Escape command & arguments
  26573. parsed.command = escape.command(parsed.command);
  26574. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  26575. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  26576. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  26577. parsed.command = process.env.comspec || 'cmd.exe';
  26578. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  26579. }
  26580. return parsed;
  26581. }
  26582. function parseShell(parsed) {
  26583. // If node supports the shell option, there's no need to mimic its behavior
  26584. if (supportsShellOption) {
  26585. return parsed;
  26586. }
  26587. // Mimic node shell option
  26588. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  26589. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  26590. if (isWin) {
  26591. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  26592. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  26593. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  26594. } else {
  26595. if (typeof parsed.options.shell === 'string') {
  26596. parsed.command = parsed.options.shell;
  26597. } else if (process.platform === 'android') {
  26598. parsed.command = '/system/bin/sh';
  26599. } else {
  26600. parsed.command = '/bin/sh';
  26601. }
  26602. parsed.args = ['-c', shellCommand];
  26603. }
  26604. return parsed;
  26605. }
  26606. function parse(command, args, options) {
  26607. // Normalize arguments, similar to nodejs
  26608. if (args && !Array.isArray(args)) {
  26609. options = args;
  26610. args = null;
  26611. }
  26612. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  26613. options = Object.assign({}, options); // Clone object to avoid changing the original
  26614. // Build our parsed object
  26615. const parsed = {
  26616. command,
  26617. args,
  26618. options,
  26619. file: undefined,
  26620. original: {
  26621. command,
  26622. args,
  26623. },
  26624. };
  26625. // Delegate further parsing to shell or non-shell
  26626. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  26627. }
  26628. module.exports = parse;
  26629. /***/ }),
  26630. /***/ 859:
  26631. /***/ (function(module, __unusedexports, __webpack_require__) {
  26632. // Unique ID creation requires a high quality random # generator. In node.js
  26633. // this is pretty straight-forward - we use the crypto API.
  26634. var crypto = __webpack_require__(417);
  26635. module.exports = function nodeRNG() {
  26636. return crypto.randomBytes(16);
  26637. };
  26638. /***/ }),
  26639. /***/ 877:
  26640. /***/ (function(module) {
  26641. module.exports = eval("require")("encoding");
  26642. /***/ }),
  26643. /***/ 883:
  26644. /***/ (function(__unusedmodule, exports) {
  26645. "use strict";
  26646. Object.defineProperty(exports, '__esModule', { value: true });
  26647. const VERSION = "1.0.0";
  26648. /**
  26649. * @param octokit Octokit instance
  26650. * @param options Options passed to Octokit constructor
  26651. */
  26652. function requestLog(octokit) {
  26653. octokit.hook.wrap("request", (request, options) => {
  26654. octokit.log.debug("request", options);
  26655. const start = Date.now();
  26656. const requestOptions = octokit.request.endpoint.parse(options);
  26657. const path = requestOptions.url.replace(options.baseUrl, "");
  26658. return request(options).then(response => {
  26659. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  26660. return response;
  26661. }).catch(error => {
  26662. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  26663. throw error;
  26664. });
  26665. });
  26666. }
  26667. requestLog.VERSION = VERSION;
  26668. exports.requestLog = requestLog;
  26669. //# sourceMappingURL=index.js.map
  26670. /***/ }),
  26671. /***/ 889:
  26672. /***/ (function(module) {
  26673. module.exports = getPageLinks
  26674. function getPageLinks (link) {
  26675. link = link.link || link.headers.link || ''
  26676. const links = {}
  26677. // link format:
  26678. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  26679. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  26680. links[type] = uri
  26681. })
  26682. return links
  26683. }
  26684. /***/ }),
  26685. /***/ 911:
  26686. /***/ (function(module, exports) {
  26687. exports = module.exports = SemVer
  26688. var debug
  26689. /* istanbul ignore next */
  26690. if (typeof process === 'object' &&
  26691. process.env &&
  26692. process.env.NODE_DEBUG &&
  26693. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  26694. debug = function () {
  26695. var args = Array.prototype.slice.call(arguments, 0)
  26696. args.unshift('SEMVER')
  26697. console.log.apply(console, args)
  26698. }
  26699. } else {
  26700. debug = function () {}
  26701. }
  26702. // Note: this is the semver.org version of the spec that it implements
  26703. // Not necessarily the package version of this code.
  26704. exports.SEMVER_SPEC_VERSION = '2.0.0'
  26705. var MAX_LENGTH = 256
  26706. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  26707. /* istanbul ignore next */ 9007199254740991
  26708. // Max safe segment length for coercion.
  26709. var MAX_SAFE_COMPONENT_LENGTH = 16
  26710. // The actual regexps go on exports.re
  26711. var re = exports.re = []
  26712. var src = exports.src = []
  26713. var R = 0
  26714. // The following Regular Expressions can be used for tokenizing,
  26715. // validating, and parsing SemVer version strings.
  26716. // ## Numeric Identifier
  26717. // A single `0`, or a non-zero digit followed by zero or more digits.
  26718. var NUMERICIDENTIFIER = R++
  26719. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  26720. var NUMERICIDENTIFIERLOOSE = R++
  26721. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  26722. // ## Non-numeric Identifier
  26723. // Zero or more digits, followed by a letter or hyphen, and then zero or
  26724. // more letters, digits, or hyphens.
  26725. var NONNUMERICIDENTIFIER = R++
  26726. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  26727. // ## Main Version
  26728. // Three dot-separated numeric identifiers.
  26729. var MAINVERSION = R++
  26730. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  26731. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  26732. '(' + src[NUMERICIDENTIFIER] + ')'
  26733. var MAINVERSIONLOOSE = R++
  26734. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  26735. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  26736. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  26737. // ## Pre-release Version Identifier
  26738. // A numeric identifier, or a non-numeric identifier.
  26739. var PRERELEASEIDENTIFIER = R++
  26740. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  26741. '|' + src[NONNUMERICIDENTIFIER] + ')'
  26742. var PRERELEASEIDENTIFIERLOOSE = R++
  26743. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  26744. '|' + src[NONNUMERICIDENTIFIER] + ')'
  26745. // ## Pre-release Version
  26746. // Hyphen, followed by one or more dot-separated pre-release version
  26747. // identifiers.
  26748. var PRERELEASE = R++
  26749. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  26750. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  26751. var PRERELEASELOOSE = R++
  26752. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  26753. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  26754. // ## Build Metadata Identifier
  26755. // Any combination of digits, letters, or hyphens.
  26756. var BUILDIDENTIFIER = R++
  26757. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  26758. // ## Build Metadata
  26759. // Plus sign, followed by one or more period-separated build metadata
  26760. // identifiers.
  26761. var BUILD = R++
  26762. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  26763. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  26764. // ## Full Version String
  26765. // A main version, followed optionally by a pre-release version and
  26766. // build metadata.
  26767. // Note that the only major, minor, patch, and pre-release sections of
  26768. // the version string are capturing groups. The build metadata is not a
  26769. // capturing group, because it should not ever be used in version
  26770. // comparison.
  26771. var FULL = R++
  26772. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  26773. src[PRERELEASE] + '?' +
  26774. src[BUILD] + '?'
  26775. src[FULL] = '^' + FULLPLAIN + '$'
  26776. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  26777. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  26778. // common in the npm registry.
  26779. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  26780. src[PRERELEASELOOSE] + '?' +
  26781. src[BUILD] + '?'
  26782. var LOOSE = R++
  26783. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  26784. var GTLT = R++
  26785. src[GTLT] = '((?:<|>)?=?)'
  26786. // Something like "2.*" or "1.2.x".
  26787. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  26788. // Only the first item is strictly required.
  26789. var XRANGEIDENTIFIERLOOSE = R++
  26790. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  26791. var XRANGEIDENTIFIER = R++
  26792. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  26793. var XRANGEPLAIN = R++
  26794. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  26795. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  26796. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  26797. '(?:' + src[PRERELEASE] + ')?' +
  26798. src[BUILD] + '?' +
  26799. ')?)?'
  26800. var XRANGEPLAINLOOSE = R++
  26801. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  26802. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  26803. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  26804. '(?:' + src[PRERELEASELOOSE] + ')?' +
  26805. src[BUILD] + '?' +
  26806. ')?)?'
  26807. var XRANGE = R++
  26808. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  26809. var XRANGELOOSE = R++
  26810. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  26811. // Coercion.
  26812. // Extract anything that could conceivably be a part of a valid semver
  26813. var COERCE = R++
  26814. src[COERCE] = '(?:^|[^\\d])' +
  26815. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  26816. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  26817. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  26818. '(?:$|[^\\d])'
  26819. // Tilde ranges.
  26820. // Meaning is "reasonably at or greater than"
  26821. var LONETILDE = R++
  26822. src[LONETILDE] = '(?:~>?)'
  26823. var TILDETRIM = R++
  26824. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  26825. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  26826. var tildeTrimReplace = '$1~'
  26827. var TILDE = R++
  26828. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  26829. var TILDELOOSE = R++
  26830. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  26831. // Caret ranges.
  26832. // Meaning is "at least and backwards compatible with"
  26833. var LONECARET = R++
  26834. src[LONECARET] = '(?:\\^)'
  26835. var CARETTRIM = R++
  26836. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  26837. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  26838. var caretTrimReplace = '$1^'
  26839. var CARET = R++
  26840. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  26841. var CARETLOOSE = R++
  26842. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  26843. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  26844. var COMPARATORLOOSE = R++
  26845. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  26846. var COMPARATOR = R++
  26847. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  26848. // An expression to strip any whitespace between the gtlt and the thing
  26849. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  26850. var COMPARATORTRIM = R++
  26851. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  26852. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  26853. // this one has to use the /g flag
  26854. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  26855. var comparatorTrimReplace = '$1$2$3'
  26856. // Something like `1.2.3 - 1.2.4`
  26857. // Note that these all use the loose form, because they'll be
  26858. // checked against either the strict or loose comparator form
  26859. // later.
  26860. var HYPHENRANGE = R++
  26861. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  26862. '\\s+-\\s+' +
  26863. '(' + src[XRANGEPLAIN] + ')' +
  26864. '\\s*$'
  26865. var HYPHENRANGELOOSE = R++
  26866. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  26867. '\\s+-\\s+' +
  26868. '(' + src[XRANGEPLAINLOOSE] + ')' +
  26869. '\\s*$'
  26870. // Star ranges basically just allow anything at all.
  26871. var STAR = R++
  26872. src[STAR] = '(<|>)?=?\\s*\\*'
  26873. // Compile to actual regexp objects.
  26874. // All are flag-free, unless they were created above with a flag.
  26875. for (var i = 0; i < R; i++) {
  26876. debug(i, src[i])
  26877. if (!re[i]) {
  26878. re[i] = new RegExp(src[i])
  26879. }
  26880. }
  26881. exports.parse = parse
  26882. function parse (version, options) {
  26883. if (!options || typeof options !== 'object') {
  26884. options = {
  26885. loose: !!options,
  26886. includePrerelease: false
  26887. }
  26888. }
  26889. if (version instanceof SemVer) {
  26890. return version
  26891. }
  26892. if (typeof version !== 'string') {
  26893. return null
  26894. }
  26895. if (version.length > MAX_LENGTH) {
  26896. return null
  26897. }
  26898. var r = options.loose ? re[LOOSE] : re[FULL]
  26899. if (!r.test(version)) {
  26900. return null
  26901. }
  26902. try {
  26903. return new SemVer(version, options)
  26904. } catch (er) {
  26905. return null
  26906. }
  26907. }
  26908. exports.valid = valid
  26909. function valid (version, options) {
  26910. var v = parse(version, options)
  26911. return v ? v.version : null
  26912. }
  26913. exports.clean = clean
  26914. function clean (version, options) {
  26915. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  26916. return s ? s.version : null
  26917. }
  26918. exports.SemVer = SemVer
  26919. function SemVer (version, options) {
  26920. if (!options || typeof options !== 'object') {
  26921. options = {
  26922. loose: !!options,
  26923. includePrerelease: false
  26924. }
  26925. }
  26926. if (version instanceof SemVer) {
  26927. if (version.loose === options.loose) {
  26928. return version
  26929. } else {
  26930. version = version.version
  26931. }
  26932. } else if (typeof version !== 'string') {
  26933. throw new TypeError('Invalid Version: ' + version)
  26934. }
  26935. if (version.length > MAX_LENGTH) {
  26936. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  26937. }
  26938. if (!(this instanceof SemVer)) {
  26939. return new SemVer(version, options)
  26940. }
  26941. debug('SemVer', version, options)
  26942. this.options = options
  26943. this.loose = !!options.loose
  26944. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  26945. if (!m) {
  26946. throw new TypeError('Invalid Version: ' + version)
  26947. }
  26948. this.raw = version
  26949. // these are actually numbers
  26950. this.major = +m[1]
  26951. this.minor = +m[2]
  26952. this.patch = +m[3]
  26953. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  26954. throw new TypeError('Invalid major version')
  26955. }
  26956. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  26957. throw new TypeError('Invalid minor version')
  26958. }
  26959. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  26960. throw new TypeError('Invalid patch version')
  26961. }
  26962. // numberify any prerelease numeric ids
  26963. if (!m[4]) {
  26964. this.prerelease = []
  26965. } else {
  26966. this.prerelease = m[4].split('.').map(function (id) {
  26967. if (/^[0-9]+$/.test(id)) {
  26968. var num = +id
  26969. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  26970. return num
  26971. }
  26972. }
  26973. return id
  26974. })
  26975. }
  26976. this.build = m[5] ? m[5].split('.') : []
  26977. this.format()
  26978. }
  26979. SemVer.prototype.format = function () {
  26980. this.version = this.major + '.' + this.minor + '.' + this.patch
  26981. if (this.prerelease.length) {
  26982. this.version += '-' + this.prerelease.join('.')
  26983. }
  26984. return this.version
  26985. }
  26986. SemVer.prototype.toString = function () {
  26987. return this.version
  26988. }
  26989. SemVer.prototype.compare = function (other) {
  26990. debug('SemVer.compare', this.version, this.options, other)
  26991. if (!(other instanceof SemVer)) {
  26992. other = new SemVer(other, this.options)
  26993. }
  26994. return this.compareMain(other) || this.comparePre(other)
  26995. }
  26996. SemVer.prototype.compareMain = function (other) {
  26997. if (!(other instanceof SemVer)) {
  26998. other = new SemVer(other, this.options)
  26999. }
  27000. return compareIdentifiers(this.major, other.major) ||
  27001. compareIdentifiers(this.minor, other.minor) ||
  27002. compareIdentifiers(this.patch, other.patch)
  27003. }
  27004. SemVer.prototype.comparePre = function (other) {
  27005. if (!(other instanceof SemVer)) {
  27006. other = new SemVer(other, this.options)
  27007. }
  27008. // NOT having a prerelease is > having one
  27009. if (this.prerelease.length && !other.prerelease.length) {
  27010. return -1
  27011. } else if (!this.prerelease.length && other.prerelease.length) {
  27012. return 1
  27013. } else if (!this.prerelease.length && !other.prerelease.length) {
  27014. return 0
  27015. }
  27016. var i = 0
  27017. do {
  27018. var a = this.prerelease[i]
  27019. var b = other.prerelease[i]
  27020. debug('prerelease compare', i, a, b)
  27021. if (a === undefined && b === undefined) {
  27022. return 0
  27023. } else if (b === undefined) {
  27024. return 1
  27025. } else if (a === undefined) {
  27026. return -1
  27027. } else if (a === b) {
  27028. continue
  27029. } else {
  27030. return compareIdentifiers(a, b)
  27031. }
  27032. } while (++i)
  27033. }
  27034. // preminor will bump the version up to the next minor release, and immediately
  27035. // down to pre-release. premajor and prepatch work the same way.
  27036. SemVer.prototype.inc = function (release, identifier) {
  27037. switch (release) {
  27038. case 'premajor':
  27039. this.prerelease.length = 0
  27040. this.patch = 0
  27041. this.minor = 0
  27042. this.major++
  27043. this.inc('pre', identifier)
  27044. break
  27045. case 'preminor':
  27046. this.prerelease.length = 0
  27047. this.patch = 0
  27048. this.minor++
  27049. this.inc('pre', identifier)
  27050. break
  27051. case 'prepatch':
  27052. // If this is already a prerelease, it will bump to the next version
  27053. // drop any prereleases that might already exist, since they are not
  27054. // relevant at this point.
  27055. this.prerelease.length = 0
  27056. this.inc('patch', identifier)
  27057. this.inc('pre', identifier)
  27058. break
  27059. // If the input is a non-prerelease version, this acts the same as
  27060. // prepatch.
  27061. case 'prerelease':
  27062. if (this.prerelease.length === 0) {
  27063. this.inc('patch', identifier)
  27064. }
  27065. this.inc('pre', identifier)
  27066. break
  27067. case 'major':
  27068. // If this is a pre-major version, bump up to the same major version.
  27069. // Otherwise increment major.
  27070. // 1.0.0-5 bumps to 1.0.0
  27071. // 1.1.0 bumps to 2.0.0
  27072. if (this.minor !== 0 ||
  27073. this.patch !== 0 ||
  27074. this.prerelease.length === 0) {
  27075. this.major++
  27076. }
  27077. this.minor = 0
  27078. this.patch = 0
  27079. this.prerelease = []
  27080. break
  27081. case 'minor':
  27082. // If this is a pre-minor version, bump up to the same minor version.
  27083. // Otherwise increment minor.
  27084. // 1.2.0-5 bumps to 1.2.0
  27085. // 1.2.1 bumps to 1.3.0
  27086. if (this.patch !== 0 || this.prerelease.length === 0) {
  27087. this.minor++
  27088. }
  27089. this.patch = 0
  27090. this.prerelease = []
  27091. break
  27092. case 'patch':
  27093. // If this is not a pre-release version, it will increment the patch.
  27094. // If it is a pre-release it will bump up to the same patch version.
  27095. // 1.2.0-5 patches to 1.2.0
  27096. // 1.2.0 patches to 1.2.1
  27097. if (this.prerelease.length === 0) {
  27098. this.patch++
  27099. }
  27100. this.prerelease = []
  27101. break
  27102. // This probably shouldn't be used publicly.
  27103. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  27104. case 'pre':
  27105. if (this.prerelease.length === 0) {
  27106. this.prerelease = [0]
  27107. } else {
  27108. var i = this.prerelease.length
  27109. while (--i >= 0) {
  27110. if (typeof this.prerelease[i] === 'number') {
  27111. this.prerelease[i]++
  27112. i = -2
  27113. }
  27114. }
  27115. if (i === -1) {
  27116. // didn't increment anything
  27117. this.prerelease.push(0)
  27118. }
  27119. }
  27120. if (identifier) {
  27121. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  27122. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  27123. if (this.prerelease[0] === identifier) {
  27124. if (isNaN(this.prerelease[1])) {
  27125. this.prerelease = [identifier, 0]
  27126. }
  27127. } else {
  27128. this.prerelease = [identifier, 0]
  27129. }
  27130. }
  27131. break
  27132. default:
  27133. throw new Error('invalid increment argument: ' + release)
  27134. }
  27135. this.format()
  27136. this.raw = this.version
  27137. return this
  27138. }
  27139. exports.inc = inc
  27140. function inc (version, release, loose, identifier) {
  27141. if (typeof (loose) === 'string') {
  27142. identifier = loose
  27143. loose = undefined
  27144. }
  27145. try {
  27146. return new SemVer(version, loose).inc(release, identifier).version
  27147. } catch (er) {
  27148. return null
  27149. }
  27150. }
  27151. exports.diff = diff
  27152. function diff (version1, version2) {
  27153. if (eq(version1, version2)) {
  27154. return null
  27155. } else {
  27156. var v1 = parse(version1)
  27157. var v2 = parse(version2)
  27158. var prefix = ''
  27159. if (v1.prerelease.length || v2.prerelease.length) {
  27160. prefix = 'pre'
  27161. var defaultResult = 'prerelease'
  27162. }
  27163. for (var key in v1) {
  27164. if (key === 'major' || key === 'minor' || key === 'patch') {
  27165. if (v1[key] !== v2[key]) {
  27166. return prefix + key
  27167. }
  27168. }
  27169. }
  27170. return defaultResult // may be undefined
  27171. }
  27172. }
  27173. exports.compareIdentifiers = compareIdentifiers
  27174. var numeric = /^[0-9]+$/
  27175. function compareIdentifiers (a, b) {
  27176. var anum = numeric.test(a)
  27177. var bnum = numeric.test(b)
  27178. if (anum && bnum) {
  27179. a = +a
  27180. b = +b
  27181. }
  27182. return a === b ? 0
  27183. : (anum && !bnum) ? -1
  27184. : (bnum && !anum) ? 1
  27185. : a < b ? -1
  27186. : 1
  27187. }
  27188. exports.rcompareIdentifiers = rcompareIdentifiers
  27189. function rcompareIdentifiers (a, b) {
  27190. return compareIdentifiers(b, a)
  27191. }
  27192. exports.major = major
  27193. function major (a, loose) {
  27194. return new SemVer(a, loose).major
  27195. }
  27196. exports.minor = minor
  27197. function minor (a, loose) {
  27198. return new SemVer(a, loose).minor
  27199. }
  27200. exports.patch = patch
  27201. function patch (a, loose) {
  27202. return new SemVer(a, loose).patch
  27203. }
  27204. exports.compare = compare
  27205. function compare (a, b, loose) {
  27206. return new SemVer(a, loose).compare(new SemVer(b, loose))
  27207. }
  27208. exports.compareLoose = compareLoose
  27209. function compareLoose (a, b) {
  27210. return compare(a, b, true)
  27211. }
  27212. exports.rcompare = rcompare
  27213. function rcompare (a, b, loose) {
  27214. return compare(b, a, loose)
  27215. }
  27216. exports.sort = sort
  27217. function sort (list, loose) {
  27218. return list.sort(function (a, b) {
  27219. return exports.compare(a, b, loose)
  27220. })
  27221. }
  27222. exports.rsort = rsort
  27223. function rsort (list, loose) {
  27224. return list.sort(function (a, b) {
  27225. return exports.rcompare(a, b, loose)
  27226. })
  27227. }
  27228. exports.gt = gt
  27229. function gt (a, b, loose) {
  27230. return compare(a, b, loose) > 0
  27231. }
  27232. exports.lt = lt
  27233. function lt (a, b, loose) {
  27234. return compare(a, b, loose) < 0
  27235. }
  27236. exports.eq = eq
  27237. function eq (a, b, loose) {
  27238. return compare(a, b, loose) === 0
  27239. }
  27240. exports.neq = neq
  27241. function neq (a, b, loose) {
  27242. return compare(a, b, loose) !== 0
  27243. }
  27244. exports.gte = gte
  27245. function gte (a, b, loose) {
  27246. return compare(a, b, loose) >= 0
  27247. }
  27248. exports.lte = lte
  27249. function lte (a, b, loose) {
  27250. return compare(a, b, loose) <= 0
  27251. }
  27252. exports.cmp = cmp
  27253. function cmp (a, op, b, loose) {
  27254. switch (op) {
  27255. case '===':
  27256. if (typeof a === 'object')
  27257. a = a.version
  27258. if (typeof b === 'object')
  27259. b = b.version
  27260. return a === b
  27261. case '!==':
  27262. if (typeof a === 'object')
  27263. a = a.version
  27264. if (typeof b === 'object')
  27265. b = b.version
  27266. return a !== b
  27267. case '':
  27268. case '=':
  27269. case '==':
  27270. return eq(a, b, loose)
  27271. case '!=':
  27272. return neq(a, b, loose)
  27273. case '>':
  27274. return gt(a, b, loose)
  27275. case '>=':
  27276. return gte(a, b, loose)
  27277. case '<':
  27278. return lt(a, b, loose)
  27279. case '<=':
  27280. return lte(a, b, loose)
  27281. default:
  27282. throw new TypeError('Invalid operator: ' + op)
  27283. }
  27284. }
  27285. exports.Comparator = Comparator
  27286. function Comparator (comp, options) {
  27287. if (!options || typeof options !== 'object') {
  27288. options = {
  27289. loose: !!options,
  27290. includePrerelease: false
  27291. }
  27292. }
  27293. if (comp instanceof Comparator) {
  27294. if (comp.loose === !!options.loose) {
  27295. return comp
  27296. } else {
  27297. comp = comp.value
  27298. }
  27299. }
  27300. if (!(this instanceof Comparator)) {
  27301. return new Comparator(comp, options)
  27302. }
  27303. debug('comparator', comp, options)
  27304. this.options = options
  27305. this.loose = !!options.loose
  27306. this.parse(comp)
  27307. if (this.semver === ANY) {
  27308. this.value = ''
  27309. } else {
  27310. this.value = this.operator + this.semver.version
  27311. }
  27312. debug('comp', this)
  27313. }
  27314. var ANY = {}
  27315. Comparator.prototype.parse = function (comp) {
  27316. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  27317. var m = comp.match(r)
  27318. if (!m) {
  27319. throw new TypeError('Invalid comparator: ' + comp)
  27320. }
  27321. this.operator = m[1]
  27322. if (this.operator === '=') {
  27323. this.operator = ''
  27324. }
  27325. // if it literally is just '>' or '' then allow anything.
  27326. if (!m[2]) {
  27327. this.semver = ANY
  27328. } else {
  27329. this.semver = new SemVer(m[2], this.options.loose)
  27330. }
  27331. }
  27332. Comparator.prototype.toString = function () {
  27333. return this.value
  27334. }
  27335. Comparator.prototype.test = function (version) {
  27336. debug('Comparator.test', version, this.options.loose)
  27337. if (this.semver === ANY) {
  27338. return true
  27339. }
  27340. if (typeof version === 'string') {
  27341. version = new SemVer(version, this.options)
  27342. }
  27343. return cmp(version, this.operator, this.semver, this.options)
  27344. }
  27345. Comparator.prototype.intersects = function (comp, options) {
  27346. if (!(comp instanceof Comparator)) {
  27347. throw new TypeError('a Comparator is required')
  27348. }
  27349. if (!options || typeof options !== 'object') {
  27350. options = {
  27351. loose: !!options,
  27352. includePrerelease: false
  27353. }
  27354. }
  27355. var rangeTmp
  27356. if (this.operator === '') {
  27357. rangeTmp = new Range(comp.value, options)
  27358. return satisfies(this.value, rangeTmp, options)
  27359. } else if (comp.operator === '') {
  27360. rangeTmp = new Range(this.value, options)
  27361. return satisfies(comp.semver, rangeTmp, options)
  27362. }
  27363. var sameDirectionIncreasing =
  27364. (this.operator === '>=' || this.operator === '>') &&
  27365. (comp.operator === '>=' || comp.operator === '>')
  27366. var sameDirectionDecreasing =
  27367. (this.operator === '<=' || this.operator === '<') &&
  27368. (comp.operator === '<=' || comp.operator === '<')
  27369. var sameSemVer = this.semver.version === comp.semver.version
  27370. var differentDirectionsInclusive =
  27371. (this.operator === '>=' || this.operator === '<=') &&
  27372. (comp.operator === '>=' || comp.operator === '<=')
  27373. var oppositeDirectionsLessThan =
  27374. cmp(this.semver, '<', comp.semver, options) &&
  27375. ((this.operator === '>=' || this.operator === '>') &&
  27376. (comp.operator === '<=' || comp.operator === '<'))
  27377. var oppositeDirectionsGreaterThan =
  27378. cmp(this.semver, '>', comp.semver, options) &&
  27379. ((this.operator === '<=' || this.operator === '<') &&
  27380. (comp.operator === '>=' || comp.operator === '>'))
  27381. return sameDirectionIncreasing || sameDirectionDecreasing ||
  27382. (sameSemVer && differentDirectionsInclusive) ||
  27383. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  27384. }
  27385. exports.Range = Range
  27386. function Range (range, options) {
  27387. if (!options || typeof options !== 'object') {
  27388. options = {
  27389. loose: !!options,
  27390. includePrerelease: false
  27391. }
  27392. }
  27393. if (range instanceof Range) {
  27394. if (range.loose === !!options.loose &&
  27395. range.includePrerelease === !!options.includePrerelease) {
  27396. return range
  27397. } else {
  27398. return new Range(range.raw, options)
  27399. }
  27400. }
  27401. if (range instanceof Comparator) {
  27402. return new Range(range.value, options)
  27403. }
  27404. if (!(this instanceof Range)) {
  27405. return new Range(range, options)
  27406. }
  27407. this.options = options
  27408. this.loose = !!options.loose
  27409. this.includePrerelease = !!options.includePrerelease
  27410. // First, split based on boolean or ||
  27411. this.raw = range
  27412. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  27413. return this.parseRange(range.trim())
  27414. }, this).filter(function (c) {
  27415. // throw out any that are not relevant for whatever reason
  27416. return c.length
  27417. })
  27418. if (!this.set.length) {
  27419. throw new TypeError('Invalid SemVer Range: ' + range)
  27420. }
  27421. this.format()
  27422. }
  27423. Range.prototype.format = function () {
  27424. this.range = this.set.map(function (comps) {
  27425. return comps.join(' ').trim()
  27426. }).join('||').trim()
  27427. return this.range
  27428. }
  27429. Range.prototype.toString = function () {
  27430. return this.range
  27431. }
  27432. Range.prototype.parseRange = function (range) {
  27433. var loose = this.options.loose
  27434. range = range.trim()
  27435. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  27436. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  27437. range = range.replace(hr, hyphenReplace)
  27438. debug('hyphen replace', range)
  27439. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  27440. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  27441. debug('comparator trim', range, re[COMPARATORTRIM])
  27442. // `~ 1.2.3` => `~1.2.3`
  27443. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  27444. // `^ 1.2.3` => `^1.2.3`
  27445. range = range.replace(re[CARETTRIM], caretTrimReplace)
  27446. // normalize spaces
  27447. range = range.split(/\s+/).join(' ')
  27448. // At this point, the range is completely trimmed and
  27449. // ready to be split into comparators.
  27450. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  27451. var set = range.split(' ').map(function (comp) {
  27452. return parseComparator(comp, this.options)
  27453. }, this).join(' ').split(/\s+/)
  27454. if (this.options.loose) {
  27455. // in loose mode, throw out any that are not valid comparators
  27456. set = set.filter(function (comp) {
  27457. return !!comp.match(compRe)
  27458. })
  27459. }
  27460. set = set.map(function (comp) {
  27461. return new Comparator(comp, this.options)
  27462. }, this)
  27463. return set
  27464. }
  27465. Range.prototype.intersects = function (range, options) {
  27466. if (!(range instanceof Range)) {
  27467. throw new TypeError('a Range is required')
  27468. }
  27469. return this.set.some(function (thisComparators) {
  27470. return thisComparators.every(function (thisComparator) {
  27471. return range.set.some(function (rangeComparators) {
  27472. return rangeComparators.every(function (rangeComparator) {
  27473. return thisComparator.intersects(rangeComparator, options)
  27474. })
  27475. })
  27476. })
  27477. })
  27478. }
  27479. // Mostly just for testing and legacy API reasons
  27480. exports.toComparators = toComparators
  27481. function toComparators (range, options) {
  27482. return new Range(range, options).set.map(function (comp) {
  27483. return comp.map(function (c) {
  27484. return c.value
  27485. }).join(' ').trim().split(' ')
  27486. })
  27487. }
  27488. // comprised of xranges, tildes, stars, and gtlt's at this point.
  27489. // already replaced the hyphen ranges
  27490. // turn into a set of JUST comparators.
  27491. function parseComparator (comp, options) {
  27492. debug('comp', comp, options)
  27493. comp = replaceCarets(comp, options)
  27494. debug('caret', comp)
  27495. comp = replaceTildes(comp, options)
  27496. debug('tildes', comp)
  27497. comp = replaceXRanges(comp, options)
  27498. debug('xrange', comp)
  27499. comp = replaceStars(comp, options)
  27500. debug('stars', comp)
  27501. return comp
  27502. }
  27503. function isX (id) {
  27504. return !id || id.toLowerCase() === 'x' || id === '*'
  27505. }
  27506. // ~, ~> --> * (any, kinda silly)
  27507. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  27508. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  27509. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  27510. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  27511. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  27512. function replaceTildes (comp, options) {
  27513. return comp.trim().split(/\s+/).map(function (comp) {
  27514. return replaceTilde(comp, options)
  27515. }).join(' ')
  27516. }
  27517. function replaceTilde (comp, options) {
  27518. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  27519. return comp.replace(r, function (_, M, m, p, pr) {
  27520. debug('tilde', comp, _, M, m, p, pr)
  27521. var ret
  27522. if (isX(M)) {
  27523. ret = ''
  27524. } else if (isX(m)) {
  27525. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  27526. } else if (isX(p)) {
  27527. // ~1.2 == >=1.2.0 <1.3.0
  27528. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  27529. } else if (pr) {
  27530. debug('replaceTilde pr', pr)
  27531. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  27532. ' <' + M + '.' + (+m + 1) + '.0'
  27533. } else {
  27534. // ~1.2.3 == >=1.2.3 <1.3.0
  27535. ret = '>=' + M + '.' + m + '.' + p +
  27536. ' <' + M + '.' + (+m + 1) + '.0'
  27537. }
  27538. debug('tilde return', ret)
  27539. return ret
  27540. })
  27541. }
  27542. // ^ --> * (any, kinda silly)
  27543. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  27544. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  27545. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  27546. // ^1.2.3 --> >=1.2.3 <2.0.0
  27547. // ^1.2.0 --> >=1.2.0 <2.0.0
  27548. function replaceCarets (comp, options) {
  27549. return comp.trim().split(/\s+/).map(function (comp) {
  27550. return replaceCaret(comp, options)
  27551. }).join(' ')
  27552. }
  27553. function replaceCaret (comp, options) {
  27554. debug('caret', comp, options)
  27555. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  27556. return comp.replace(r, function (_, M, m, p, pr) {
  27557. debug('caret', comp, _, M, m, p, pr)
  27558. var ret
  27559. if (isX(M)) {
  27560. ret = ''
  27561. } else if (isX(m)) {
  27562. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  27563. } else if (isX(p)) {
  27564. if (M === '0') {
  27565. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  27566. } else {
  27567. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  27568. }
  27569. } else if (pr) {
  27570. debug('replaceCaret pr', pr)
  27571. if (M === '0') {
  27572. if (m === '0') {
  27573. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  27574. ' <' + M + '.' + m + '.' + (+p + 1)
  27575. } else {
  27576. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  27577. ' <' + M + '.' + (+m + 1) + '.0'
  27578. }
  27579. } else {
  27580. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  27581. ' <' + (+M + 1) + '.0.0'
  27582. }
  27583. } else {
  27584. debug('no pr')
  27585. if (M === '0') {
  27586. if (m === '0') {
  27587. ret = '>=' + M + '.' + m + '.' + p +
  27588. ' <' + M + '.' + m + '.' + (+p + 1)
  27589. } else {
  27590. ret = '>=' + M + '.' + m + '.' + p +
  27591. ' <' + M + '.' + (+m + 1) + '.0'
  27592. }
  27593. } else {
  27594. ret = '>=' + M + '.' + m + '.' + p +
  27595. ' <' + (+M + 1) + '.0.0'
  27596. }
  27597. }
  27598. debug('caret return', ret)
  27599. return ret
  27600. })
  27601. }
  27602. function replaceXRanges (comp, options) {
  27603. debug('replaceXRanges', comp, options)
  27604. return comp.split(/\s+/).map(function (comp) {
  27605. return replaceXRange(comp, options)
  27606. }).join(' ')
  27607. }
  27608. function replaceXRange (comp, options) {
  27609. comp = comp.trim()
  27610. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  27611. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  27612. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  27613. var xM = isX(M)
  27614. var xm = xM || isX(m)
  27615. var xp = xm || isX(p)
  27616. var anyX = xp
  27617. if (gtlt === '=' && anyX) {
  27618. gtlt = ''
  27619. }
  27620. if (xM) {
  27621. if (gtlt === '>' || gtlt === '<') {
  27622. // nothing is allowed
  27623. ret = '<0.0.0'
  27624. } else {
  27625. // nothing is forbidden
  27626. ret = '*'
  27627. }
  27628. } else if (gtlt && anyX) {
  27629. // we know patch is an x, because we have any x at all.
  27630. // replace X with 0
  27631. if (xm) {
  27632. m = 0
  27633. }
  27634. p = 0
  27635. if (gtlt === '>') {
  27636. // >1 => >=2.0.0
  27637. // >1.2 => >=1.3.0
  27638. // >1.2.3 => >= 1.2.4
  27639. gtlt = '>='
  27640. if (xm) {
  27641. M = +M + 1
  27642. m = 0
  27643. p = 0
  27644. } else {
  27645. m = +m + 1
  27646. p = 0
  27647. }
  27648. } else if (gtlt === '<=') {
  27649. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  27650. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  27651. gtlt = '<'
  27652. if (xm) {
  27653. M = +M + 1
  27654. } else {
  27655. m = +m + 1
  27656. }
  27657. }
  27658. ret = gtlt + M + '.' + m + '.' + p
  27659. } else if (xm) {
  27660. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  27661. } else if (xp) {
  27662. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  27663. }
  27664. debug('xRange return', ret)
  27665. return ret
  27666. })
  27667. }
  27668. // Because * is AND-ed with everything else in the comparator,
  27669. // and '' means "any version", just remove the *s entirely.
  27670. function replaceStars (comp, options) {
  27671. debug('replaceStars', comp, options)
  27672. // Looseness is ignored here. star is always as loose as it gets!
  27673. return comp.trim().replace(re[STAR], '')
  27674. }
  27675. // This function is passed to string.replace(re[HYPHENRANGE])
  27676. // M, m, patch, prerelease, build
  27677. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  27678. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  27679. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  27680. function hyphenReplace ($0,
  27681. from, fM, fm, fp, fpr, fb,
  27682. to, tM, tm, tp, tpr, tb) {
  27683. if (isX(fM)) {
  27684. from = ''
  27685. } else if (isX(fm)) {
  27686. from = '>=' + fM + '.0.0'
  27687. } else if (isX(fp)) {
  27688. from = '>=' + fM + '.' + fm + '.0'
  27689. } else {
  27690. from = '>=' + from
  27691. }
  27692. if (isX(tM)) {
  27693. to = ''
  27694. } else if (isX(tm)) {
  27695. to = '<' + (+tM + 1) + '.0.0'
  27696. } else if (isX(tp)) {
  27697. to = '<' + tM + '.' + (+tm + 1) + '.0'
  27698. } else if (tpr) {
  27699. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  27700. } else {
  27701. to = '<=' + to
  27702. }
  27703. return (from + ' ' + to).trim()
  27704. }
  27705. // if ANY of the sets match ALL of its comparators, then pass
  27706. Range.prototype.test = function (version) {
  27707. if (!version) {
  27708. return false
  27709. }
  27710. if (typeof version === 'string') {
  27711. version = new SemVer(version, this.options)
  27712. }
  27713. for (var i = 0; i < this.set.length; i++) {
  27714. if (testSet(this.set[i], version, this.options)) {
  27715. return true
  27716. }
  27717. }
  27718. return false
  27719. }
  27720. function testSet (set, version, options) {
  27721. for (var i = 0; i < set.length; i++) {
  27722. if (!set[i].test(version)) {
  27723. return false
  27724. }
  27725. }
  27726. if (version.prerelease.length && !options.includePrerelease) {
  27727. // Find the set of versions that are allowed to have prereleases
  27728. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  27729. // That should allow `1.2.3-pr.2` to pass.
  27730. // However, `1.2.4-alpha.notready` should NOT be allowed,
  27731. // even though it's within the range set by the comparators.
  27732. for (i = 0; i < set.length; i++) {
  27733. debug(set[i].semver)
  27734. if (set[i].semver === ANY) {
  27735. continue
  27736. }
  27737. if (set[i].semver.prerelease.length > 0) {
  27738. var allowed = set[i].semver
  27739. if (allowed.major === version.major &&
  27740. allowed.minor === version.minor &&
  27741. allowed.patch === version.patch) {
  27742. return true
  27743. }
  27744. }
  27745. }
  27746. // Version has a -pre, but it's not one of the ones we like.
  27747. return false
  27748. }
  27749. return true
  27750. }
  27751. exports.satisfies = satisfies
  27752. function satisfies (version, range, options) {
  27753. try {
  27754. range = new Range(range, options)
  27755. } catch (er) {
  27756. return false
  27757. }
  27758. return range.test(version)
  27759. }
  27760. exports.maxSatisfying = maxSatisfying
  27761. function maxSatisfying (versions, range, options) {
  27762. var max = null
  27763. var maxSV = null
  27764. try {
  27765. var rangeObj = new Range(range, options)
  27766. } catch (er) {
  27767. return null
  27768. }
  27769. versions.forEach(function (v) {
  27770. if (rangeObj.test(v)) {
  27771. // satisfies(v, range, options)
  27772. if (!max || maxSV.compare(v) === -1) {
  27773. // compare(max, v, true)
  27774. max = v
  27775. maxSV = new SemVer(max, options)
  27776. }
  27777. }
  27778. })
  27779. return max
  27780. }
  27781. exports.minSatisfying = minSatisfying
  27782. function minSatisfying (versions, range, options) {
  27783. var min = null
  27784. var minSV = null
  27785. try {
  27786. var rangeObj = new Range(range, options)
  27787. } catch (er) {
  27788. return null
  27789. }
  27790. versions.forEach(function (v) {
  27791. if (rangeObj.test(v)) {
  27792. // satisfies(v, range, options)
  27793. if (!min || minSV.compare(v) === 1) {
  27794. // compare(min, v, true)
  27795. min = v
  27796. minSV = new SemVer(min, options)
  27797. }
  27798. }
  27799. })
  27800. return min
  27801. }
  27802. exports.minVersion = minVersion
  27803. function minVersion (range, loose) {
  27804. range = new Range(range, loose)
  27805. var minver = new SemVer('0.0.0')
  27806. if (range.test(minver)) {
  27807. return minver
  27808. }
  27809. minver = new SemVer('0.0.0-0')
  27810. if (range.test(minver)) {
  27811. return minver
  27812. }
  27813. minver = null
  27814. for (var i = 0; i < range.set.length; ++i) {
  27815. var comparators = range.set[i]
  27816. comparators.forEach(function (comparator) {
  27817. // Clone to avoid manipulating the comparator's semver object.
  27818. var compver = new SemVer(comparator.semver.version)
  27819. switch (comparator.operator) {
  27820. case '>':
  27821. if (compver.prerelease.length === 0) {
  27822. compver.patch++
  27823. } else {
  27824. compver.prerelease.push(0)
  27825. }
  27826. compver.raw = compver.format()
  27827. /* fallthrough */
  27828. case '':
  27829. case '>=':
  27830. if (!minver || gt(minver, compver)) {
  27831. minver = compver
  27832. }
  27833. break
  27834. case '<':
  27835. case '<=':
  27836. /* Ignore maximum versions */
  27837. break
  27838. /* istanbul ignore next */
  27839. default:
  27840. throw new Error('Unexpected operation: ' + comparator.operator)
  27841. }
  27842. })
  27843. }
  27844. if (minver && range.test(minver)) {
  27845. return minver
  27846. }
  27847. return null
  27848. }
  27849. exports.validRange = validRange
  27850. function validRange (range, options) {
  27851. try {
  27852. // Return '*' instead of '' so that truthiness works.
  27853. // This will throw if it's invalid anyway
  27854. return new Range(range, options).range || '*'
  27855. } catch (er) {
  27856. return null
  27857. }
  27858. }
  27859. // Determine if version is less than all the versions possible in the range
  27860. exports.ltr = ltr
  27861. function ltr (version, range, options) {
  27862. return outside(version, range, '<', options)
  27863. }
  27864. // Determine if version is greater than all the versions possible in the range.
  27865. exports.gtr = gtr
  27866. function gtr (version, range, options) {
  27867. return outside(version, range, '>', options)
  27868. }
  27869. exports.outside = outside
  27870. function outside (version, range, hilo, options) {
  27871. version = new SemVer(version, options)
  27872. range = new Range(range, options)
  27873. var gtfn, ltefn, ltfn, comp, ecomp
  27874. switch (hilo) {
  27875. case '>':
  27876. gtfn = gt
  27877. ltefn = lte
  27878. ltfn = lt
  27879. comp = '>'
  27880. ecomp = '>='
  27881. break
  27882. case '<':
  27883. gtfn = lt
  27884. ltefn = gte
  27885. ltfn = gt
  27886. comp = '<'
  27887. ecomp = '<='
  27888. break
  27889. default:
  27890. throw new TypeError('Must provide a hilo val of "<" or ">"')
  27891. }
  27892. // If it satisifes the range it is not outside
  27893. if (satisfies(version, range, options)) {
  27894. return false
  27895. }
  27896. // From now on, variable terms are as if we're in "gtr" mode.
  27897. // but note that everything is flipped for the "ltr" function.
  27898. for (var i = 0; i < range.set.length; ++i) {
  27899. var comparators = range.set[i]
  27900. var high = null
  27901. var low = null
  27902. comparators.forEach(function (comparator) {
  27903. if (comparator.semver === ANY) {
  27904. comparator = new Comparator('>=0.0.0')
  27905. }
  27906. high = high || comparator
  27907. low = low || comparator
  27908. if (gtfn(comparator.semver, high.semver, options)) {
  27909. high = comparator
  27910. } else if (ltfn(comparator.semver, low.semver, options)) {
  27911. low = comparator
  27912. }
  27913. })
  27914. // If the edge version comparator has a operator then our version
  27915. // isn't outside it
  27916. if (high.operator === comp || high.operator === ecomp) {
  27917. return false
  27918. }
  27919. // If the lowest version comparator has an operator and our version
  27920. // is less than it then it isn't higher than the range
  27921. if ((!low.operator || low.operator === comp) &&
  27922. ltefn(version, low.semver)) {
  27923. return false
  27924. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  27925. return false
  27926. }
  27927. }
  27928. return true
  27929. }
  27930. exports.prerelease = prerelease
  27931. function prerelease (version, options) {
  27932. var parsed = parse(version, options)
  27933. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  27934. }
  27935. exports.intersects = intersects
  27936. function intersects (r1, r2, options) {
  27937. r1 = new Range(r1, options)
  27938. r2 = new Range(r2, options)
  27939. return r1.intersects(r2)
  27940. }
  27941. exports.coerce = coerce
  27942. function coerce (version) {
  27943. if (version instanceof SemVer) {
  27944. return version
  27945. }
  27946. if (typeof version !== 'string') {
  27947. return null
  27948. }
  27949. var match = version.match(re[COERCE])
  27950. if (match == null) {
  27951. return null
  27952. }
  27953. return parse(match[1] +
  27954. '.' + (match[2] || '0') +
  27955. '.' + (match[3] || '0'))
  27956. }
  27957. /***/ }),
  27958. /***/ 925:
  27959. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  27960. "use strict";
  27961. Object.defineProperty(exports, "__esModule", { value: true });
  27962. const url = __webpack_require__(835);
  27963. const http = __webpack_require__(605);
  27964. const https = __webpack_require__(211);
  27965. const pm = __webpack_require__(443);
  27966. let tunnel;
  27967. var HttpCodes;
  27968. (function (HttpCodes) {
  27969. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  27970. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  27971. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  27972. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  27973. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  27974. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  27975. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  27976. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  27977. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  27978. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  27979. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  27980. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  27981. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  27982. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  27983. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  27984. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  27985. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  27986. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  27987. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  27988. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  27989. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  27990. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  27991. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  27992. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  27993. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  27994. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  27995. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  27996. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  27997. var Headers;
  27998. (function (Headers) {
  27999. Headers["Accept"] = "accept";
  28000. Headers["ContentType"] = "content-type";
  28001. })(Headers = exports.Headers || (exports.Headers = {}));
  28002. var MediaTypes;
  28003. (function (MediaTypes) {
  28004. MediaTypes["ApplicationJson"] = "application/json";
  28005. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  28006. /**
  28007. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  28008. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  28009. */
  28010. function getProxyUrl(serverUrl) {
  28011. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  28012. return proxyUrl ? proxyUrl.href : '';
  28013. }
  28014. exports.getProxyUrl = getProxyUrl;
  28015. const HttpRedirectCodes = [
  28016. HttpCodes.MovedPermanently,
  28017. HttpCodes.ResourceMoved,
  28018. HttpCodes.SeeOther,
  28019. HttpCodes.TemporaryRedirect,
  28020. HttpCodes.PermanentRedirect
  28021. ];
  28022. const HttpResponseRetryCodes = [
  28023. HttpCodes.BadGateway,
  28024. HttpCodes.ServiceUnavailable,
  28025. HttpCodes.GatewayTimeout
  28026. ];
  28027. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  28028. const ExponentialBackoffCeiling = 10;
  28029. const ExponentialBackoffTimeSlice = 5;
  28030. class HttpClientResponse {
  28031. constructor(message) {
  28032. this.message = message;
  28033. }
  28034. readBody() {
  28035. return new Promise(async (resolve, reject) => {
  28036. let output = Buffer.alloc(0);
  28037. this.message.on('data', (chunk) => {
  28038. output = Buffer.concat([output, chunk]);
  28039. });
  28040. this.message.on('end', () => {
  28041. resolve(output.toString());
  28042. });
  28043. });
  28044. }
  28045. }
  28046. exports.HttpClientResponse = HttpClientResponse;
  28047. function isHttps(requestUrl) {
  28048. let parsedUrl = url.parse(requestUrl);
  28049. return parsedUrl.protocol === 'https:';
  28050. }
  28051. exports.isHttps = isHttps;
  28052. class HttpClient {
  28053. constructor(userAgent, handlers, requestOptions) {
  28054. this._ignoreSslError = false;
  28055. this._allowRedirects = true;
  28056. this._allowRedirectDowngrade = false;
  28057. this._maxRedirects = 50;
  28058. this._allowRetries = false;
  28059. this._maxRetries = 1;
  28060. this._keepAlive = false;
  28061. this._disposed = false;
  28062. this.userAgent = userAgent;
  28063. this.handlers = handlers || [];
  28064. this.requestOptions = requestOptions;
  28065. if (requestOptions) {
  28066. if (requestOptions.ignoreSslError != null) {
  28067. this._ignoreSslError = requestOptions.ignoreSslError;
  28068. }
  28069. this._socketTimeout = requestOptions.socketTimeout;
  28070. if (requestOptions.allowRedirects != null) {
  28071. this._allowRedirects = requestOptions.allowRedirects;
  28072. }
  28073. if (requestOptions.allowRedirectDowngrade != null) {
  28074. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  28075. }
  28076. if (requestOptions.maxRedirects != null) {
  28077. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  28078. }
  28079. if (requestOptions.keepAlive != null) {
  28080. this._keepAlive = requestOptions.keepAlive;
  28081. }
  28082. if (requestOptions.allowRetries != null) {
  28083. this._allowRetries = requestOptions.allowRetries;
  28084. }
  28085. if (requestOptions.maxRetries != null) {
  28086. this._maxRetries = requestOptions.maxRetries;
  28087. }
  28088. }
  28089. }
  28090. options(requestUrl, additionalHeaders) {
  28091. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  28092. }
  28093. get(requestUrl, additionalHeaders) {
  28094. return this.request('GET', requestUrl, null, additionalHeaders || {});
  28095. }
  28096. del(requestUrl, additionalHeaders) {
  28097. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  28098. }
  28099. post(requestUrl, data, additionalHeaders) {
  28100. return this.request('POST', requestUrl, data, additionalHeaders || {});
  28101. }
  28102. patch(requestUrl, data, additionalHeaders) {
  28103. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  28104. }
  28105. put(requestUrl, data, additionalHeaders) {
  28106. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  28107. }
  28108. head(requestUrl, additionalHeaders) {
  28109. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  28110. }
  28111. sendStream(verb, requestUrl, stream, additionalHeaders) {
  28112. return this.request(verb, requestUrl, stream, additionalHeaders);
  28113. }
  28114. /**
  28115. * Gets a typed object from an endpoint
  28116. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  28117. */
  28118. async getJson(requestUrl, additionalHeaders = {}) {
  28119. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  28120. let res = await this.get(requestUrl, additionalHeaders);
  28121. return this._processResponse(res, this.requestOptions);
  28122. }
  28123. async postJson(requestUrl, obj, additionalHeaders = {}) {
  28124. let data = JSON.stringify(obj, null, 2);
  28125. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  28126. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  28127. let res = await this.post(requestUrl, data, additionalHeaders);
  28128. return this._processResponse(res, this.requestOptions);
  28129. }
  28130. async putJson(requestUrl, obj, additionalHeaders = {}) {
  28131. let data = JSON.stringify(obj, null, 2);
  28132. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  28133. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  28134. let res = await this.put(requestUrl, data, additionalHeaders);
  28135. return this._processResponse(res, this.requestOptions);
  28136. }
  28137. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  28138. let data = JSON.stringify(obj, null, 2);
  28139. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  28140. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  28141. let res = await this.patch(requestUrl, data, additionalHeaders);
  28142. return this._processResponse(res, this.requestOptions);
  28143. }
  28144. /**
  28145. * Makes a raw http request.
  28146. * All other methods such as get, post, patch, and request ultimately call this.
  28147. * Prefer get, del, post and patch
  28148. */
  28149. async request(verb, requestUrl, data, headers) {
  28150. if (this._disposed) {
  28151. throw new Error('Client has already been disposed.');
  28152. }
  28153. let parsedUrl = url.parse(requestUrl);
  28154. let info = this._prepareRequest(verb, parsedUrl, headers);
  28155. // Only perform retries on reads since writes may not be idempotent.
  28156. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  28157. ? this._maxRetries + 1
  28158. : 1;
  28159. let numTries = 0;
  28160. let response;
  28161. while (numTries < maxTries) {
  28162. response = await this.requestRaw(info, data);
  28163. // Check if it's an authentication challenge
  28164. if (response &&
  28165. response.message &&
  28166. response.message.statusCode === HttpCodes.Unauthorized) {
  28167. let authenticationHandler;
  28168. for (let i = 0; i < this.handlers.length; i++) {
  28169. if (this.handlers[i].canHandleAuthentication(response)) {
  28170. authenticationHandler = this.handlers[i];
  28171. break;
  28172. }
  28173. }
  28174. if (authenticationHandler) {
  28175. return authenticationHandler.handleAuthentication(this, info, data);
  28176. }
  28177. else {
  28178. // We have received an unauthorized response but have no handlers to handle it.
  28179. // Let the response return to the caller.
  28180. return response;
  28181. }
  28182. }
  28183. let redirectsRemaining = this._maxRedirects;
  28184. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  28185. this._allowRedirects &&
  28186. redirectsRemaining > 0) {
  28187. const redirectUrl = response.message.headers['location'];
  28188. if (!redirectUrl) {
  28189. // if there's no location to redirect to, we won't
  28190. break;
  28191. }
  28192. let parsedRedirectUrl = url.parse(redirectUrl);
  28193. if (parsedUrl.protocol == 'https:' &&
  28194. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  28195. !this._allowRedirectDowngrade) {
  28196. 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.');
  28197. }
  28198. // we need to finish reading the response before reassigning response
  28199. // which will leak the open socket.
  28200. await response.readBody();
  28201. // strip authorization header if redirected to a different hostname
  28202. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  28203. for (let header in headers) {
  28204. // header names are case insensitive
  28205. if (header.toLowerCase() === 'authorization') {
  28206. delete headers[header];
  28207. }
  28208. }
  28209. }
  28210. // let's make the request with the new redirectUrl
  28211. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  28212. response = await this.requestRaw(info, data);
  28213. redirectsRemaining--;
  28214. }
  28215. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  28216. // If not a retry code, return immediately instead of retrying
  28217. return response;
  28218. }
  28219. numTries += 1;
  28220. if (numTries < maxTries) {
  28221. await response.readBody();
  28222. await this._performExponentialBackoff(numTries);
  28223. }
  28224. }
  28225. return response;
  28226. }
  28227. /**
  28228. * Needs to be called if keepAlive is set to true in request options.
  28229. */
  28230. dispose() {
  28231. if (this._agent) {
  28232. this._agent.destroy();
  28233. }
  28234. this._disposed = true;
  28235. }
  28236. /**
  28237. * Raw request.
  28238. * @param info
  28239. * @param data
  28240. */
  28241. requestRaw(info, data) {
  28242. return new Promise((resolve, reject) => {
  28243. let callbackForResult = function (err, res) {
  28244. if (err) {
  28245. reject(err);
  28246. }
  28247. resolve(res);
  28248. };
  28249. this.requestRawWithCallback(info, data, callbackForResult);
  28250. });
  28251. }
  28252. /**
  28253. * Raw request with callback.
  28254. * @param info
  28255. * @param data
  28256. * @param onResult
  28257. */
  28258. requestRawWithCallback(info, data, onResult) {
  28259. let socket;
  28260. if (typeof data === 'string') {
  28261. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  28262. }
  28263. let callbackCalled = false;
  28264. let handleResult = (err, res) => {
  28265. if (!callbackCalled) {
  28266. callbackCalled = true;
  28267. onResult(err, res);
  28268. }
  28269. };
  28270. let req = info.httpModule.request(info.options, (msg) => {
  28271. let res = new HttpClientResponse(msg);
  28272. handleResult(null, res);
  28273. });
  28274. req.on('socket', sock => {
  28275. socket = sock;
  28276. });
  28277. // If we ever get disconnected, we want the socket to timeout eventually
  28278. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  28279. if (socket) {
  28280. socket.end();
  28281. }
  28282. handleResult(new Error('Request timeout: ' + info.options.path), null);
  28283. });
  28284. req.on('error', function (err) {
  28285. // err has statusCode property
  28286. // res should have headers
  28287. handleResult(err, null);
  28288. });
  28289. if (data && typeof data === 'string') {
  28290. req.write(data, 'utf8');
  28291. }
  28292. if (data && typeof data !== 'string') {
  28293. data.on('close', function () {
  28294. req.end();
  28295. });
  28296. data.pipe(req);
  28297. }
  28298. else {
  28299. req.end();
  28300. }
  28301. }
  28302. /**
  28303. * Gets an http agent. This function is useful when you need an http agent that handles
  28304. * routing through a proxy server - depending upon the url and proxy environment variables.
  28305. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  28306. */
  28307. getAgent(serverUrl) {
  28308. let parsedUrl = url.parse(serverUrl);
  28309. return this._getAgent(parsedUrl);
  28310. }
  28311. _prepareRequest(method, requestUrl, headers) {
  28312. const info = {};
  28313. info.parsedUrl = requestUrl;
  28314. const usingSsl = info.parsedUrl.protocol === 'https:';
  28315. info.httpModule = usingSsl ? https : http;
  28316. const defaultPort = usingSsl ? 443 : 80;
  28317. info.options = {};
  28318. info.options.host = info.parsedUrl.hostname;
  28319. info.options.port = info.parsedUrl.port
  28320. ? parseInt(info.parsedUrl.port)
  28321. : defaultPort;
  28322. info.options.path =
  28323. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  28324. info.options.method = method;
  28325. info.options.headers = this._mergeHeaders(headers);
  28326. if (this.userAgent != null) {
  28327. info.options.headers['user-agent'] = this.userAgent;
  28328. }
  28329. info.options.agent = this._getAgent(info.parsedUrl);
  28330. // gives handlers an opportunity to participate
  28331. if (this.handlers) {
  28332. this.handlers.forEach(handler => {
  28333. handler.prepareRequest(info.options);
  28334. });
  28335. }
  28336. return info;
  28337. }
  28338. _mergeHeaders(headers) {
  28339. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  28340. if (this.requestOptions && this.requestOptions.headers) {
  28341. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  28342. }
  28343. return lowercaseKeys(headers || {});
  28344. }
  28345. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  28346. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  28347. let clientHeader;
  28348. if (this.requestOptions && this.requestOptions.headers) {
  28349. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  28350. }
  28351. return additionalHeaders[header] || clientHeader || _default;
  28352. }
  28353. _getAgent(parsedUrl) {
  28354. let agent;
  28355. let proxyUrl = pm.getProxyUrl(parsedUrl);
  28356. let useProxy = proxyUrl && proxyUrl.hostname;
  28357. if (this._keepAlive && useProxy) {
  28358. agent = this._proxyAgent;
  28359. }
  28360. if (this._keepAlive && !useProxy) {
  28361. agent = this._agent;
  28362. }
  28363. // if agent is already assigned use that agent.
  28364. if (!!agent) {
  28365. return agent;
  28366. }
  28367. const usingSsl = parsedUrl.protocol === 'https:';
  28368. let maxSockets = 100;
  28369. if (!!this.requestOptions) {
  28370. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  28371. }
  28372. if (useProxy) {
  28373. // If using proxy, need tunnel
  28374. if (!tunnel) {
  28375. tunnel = __webpack_require__(153);
  28376. }
  28377. const agentOptions = {
  28378. maxSockets: maxSockets,
  28379. keepAlive: this._keepAlive,
  28380. proxy: {
  28381. proxyAuth: proxyUrl.auth,
  28382. host: proxyUrl.hostname,
  28383. port: proxyUrl.port
  28384. }
  28385. };
  28386. let tunnelAgent;
  28387. const overHttps = proxyUrl.protocol === 'https:';
  28388. if (usingSsl) {
  28389. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  28390. }
  28391. else {
  28392. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  28393. }
  28394. agent = tunnelAgent(agentOptions);
  28395. this._proxyAgent = agent;
  28396. }
  28397. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  28398. if (this._keepAlive && !agent) {
  28399. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  28400. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  28401. this._agent = agent;
  28402. }
  28403. // if not using private agent and tunnel agent isn't setup then use global agent
  28404. if (!agent) {
  28405. agent = usingSsl ? https.globalAgent : http.globalAgent;
  28406. }
  28407. if (usingSsl && this._ignoreSslError) {
  28408. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  28409. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  28410. // we have to cast it to any and change it directly
  28411. agent.options = Object.assign(agent.options || {}, {
  28412. rejectUnauthorized: false
  28413. });
  28414. }
  28415. return agent;
  28416. }
  28417. _performExponentialBackoff(retryNumber) {
  28418. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  28419. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  28420. return new Promise(resolve => setTimeout(() => resolve(), ms));
  28421. }
  28422. static dateTimeDeserializer(key, value) {
  28423. if (typeof value === 'string') {
  28424. let a = new Date(value);
  28425. if (!isNaN(a.valueOf())) {
  28426. return a;
  28427. }
  28428. }
  28429. return value;
  28430. }
  28431. async _processResponse(res, options) {
  28432. return new Promise(async (resolve, reject) => {
  28433. const statusCode = res.message.statusCode;
  28434. const response = {
  28435. statusCode: statusCode,
  28436. result: null,
  28437. headers: {}
  28438. };
  28439. // not found leads to null obj returned
  28440. if (statusCode == HttpCodes.NotFound) {
  28441. resolve(response);
  28442. }
  28443. let obj;
  28444. let contents;
  28445. // get the result from the body
  28446. try {
  28447. contents = await res.readBody();
  28448. if (contents && contents.length > 0) {
  28449. if (options && options.deserializeDates) {
  28450. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  28451. }
  28452. else {
  28453. obj = JSON.parse(contents);
  28454. }
  28455. response.result = obj;
  28456. }
  28457. response.headers = res.message.headers;
  28458. }
  28459. catch (err) {
  28460. // Invalid resource (contents not json); leaving result obj null
  28461. }
  28462. // note that 3xx redirects are handled by the http layer.
  28463. if (statusCode > 299) {
  28464. let msg;
  28465. // if exception/error in body, attempt to get better error
  28466. if (obj && obj.message) {
  28467. msg = obj.message;
  28468. }
  28469. else if (contents && contents.length > 0) {
  28470. // it may be the case that the exception is in the body message as string
  28471. msg = contents;
  28472. }
  28473. else {
  28474. msg = 'Failed request: (' + statusCode + ')';
  28475. }
  28476. let err = new Error(msg);
  28477. // attach statusCode and body obj (if available) to the error object
  28478. err['statusCode'] = statusCode;
  28479. if (response.result) {
  28480. err['result'] = response.result;
  28481. }
  28482. reject(err);
  28483. }
  28484. else {
  28485. resolve(response);
  28486. }
  28487. });
  28488. }
  28489. }
  28490. exports.HttpClient = HttpClient;
  28491. /***/ }),
  28492. /***/ 928:
  28493. /***/ (function(module, __unusedexports, __webpack_require__) {
  28494. const { requestLog } = __webpack_require__(883);
  28495. const {
  28496. restEndpointMethods
  28497. } = __webpack_require__(44);
  28498. const Core = __webpack_require__(833);
  28499. const CORE_PLUGINS = [
  28500. __webpack_require__(555),
  28501. __webpack_require__(691), // deprecated: remove in v17
  28502. requestLog,
  28503. __webpack_require__(579),
  28504. restEndpointMethods,
  28505. __webpack_require__(657),
  28506. __webpack_require__(72) // deprecated: remove in v17
  28507. ];
  28508. const OctokitRest = Core.plugin(CORE_PLUGINS);
  28509. function DeprecatedOctokit(options) {
  28510. const warn =
  28511. options && options.log && options.log.warn
  28512. ? options.log.warn
  28513. : console.warn;
  28514. warn(
  28515. '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
  28516. );
  28517. return new OctokitRest(options);
  28518. }
  28519. const Octokit = Object.assign(DeprecatedOctokit, {
  28520. Octokit: OctokitRest
  28521. });
  28522. Object.keys(OctokitRest).forEach(key => {
  28523. /* istanbul ignore else */
  28524. if (OctokitRest.hasOwnProperty(key)) {
  28525. Octokit[key] = OctokitRest[key];
  28526. }
  28527. });
  28528. module.exports = Octokit;
  28529. /***/ }),
  28530. /***/ 931:
  28531. /***/ (function(module, __unusedexports, __webpack_require__) {
  28532. // Note: since nyc uses this module to output coverage, any lines
  28533. // that are in the direct sync flow of nyc's outputCoverage are
  28534. // ignored, since we can never get coverage for them.
  28535. var assert = __webpack_require__(357)
  28536. var signals = __webpack_require__(710)
  28537. var EE = __webpack_require__(614)
  28538. /* istanbul ignore if */
  28539. if (typeof EE !== 'function') {
  28540. EE = EE.EventEmitter
  28541. }
  28542. var emitter
  28543. if (process.__signal_exit_emitter__) {
  28544. emitter = process.__signal_exit_emitter__
  28545. } else {
  28546. emitter = process.__signal_exit_emitter__ = new EE()
  28547. emitter.count = 0
  28548. emitter.emitted = {}
  28549. }
  28550. // Because this emitter is a global, we have to check to see if a
  28551. // previous version of this library failed to enable infinite listeners.
  28552. // I know what you're about to say. But literally everything about
  28553. // signal-exit is a compromise with evil. Get used to it.
  28554. if (!emitter.infinite) {
  28555. emitter.setMaxListeners(Infinity)
  28556. emitter.infinite = true
  28557. }
  28558. module.exports = function (cb, opts) {
  28559. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  28560. if (loaded === false) {
  28561. load()
  28562. }
  28563. var ev = 'exit'
  28564. if (opts && opts.alwaysLast) {
  28565. ev = 'afterexit'
  28566. }
  28567. var remove = function () {
  28568. emitter.removeListener(ev, cb)
  28569. if (emitter.listeners('exit').length === 0 &&
  28570. emitter.listeners('afterexit').length === 0) {
  28571. unload()
  28572. }
  28573. }
  28574. emitter.on(ev, cb)
  28575. return remove
  28576. }
  28577. module.exports.unload = unload
  28578. function unload () {
  28579. if (!loaded) {
  28580. return
  28581. }
  28582. loaded = false
  28583. signals.forEach(function (sig) {
  28584. try {
  28585. process.removeListener(sig, sigListeners[sig])
  28586. } catch (er) {}
  28587. })
  28588. process.emit = originalProcessEmit
  28589. process.reallyExit = originalProcessReallyExit
  28590. emitter.count -= 1
  28591. }
  28592. function emit (event, code, signal) {
  28593. if (emitter.emitted[event]) {
  28594. return
  28595. }
  28596. emitter.emitted[event] = true
  28597. emitter.emit(event, code, signal)
  28598. }
  28599. // { <signal>: <listener fn>, ... }
  28600. var sigListeners = {}
  28601. signals.forEach(function (sig) {
  28602. sigListeners[sig] = function listener () {
  28603. // If there are no other listeners, an exit is coming!
  28604. // Simplest way: remove us and then re-send the signal.
  28605. // We know that this will kill the process, so we can
  28606. // safely emit now.
  28607. var listeners = process.listeners(sig)
  28608. if (listeners.length === emitter.count) {
  28609. unload()
  28610. emit('exit', null, sig)
  28611. /* istanbul ignore next */
  28612. emit('afterexit', null, sig)
  28613. /* istanbul ignore next */
  28614. process.kill(process.pid, sig)
  28615. }
  28616. }
  28617. })
  28618. module.exports.signals = function () {
  28619. return signals
  28620. }
  28621. module.exports.load = load
  28622. var loaded = false
  28623. function load () {
  28624. if (loaded) {
  28625. return
  28626. }
  28627. loaded = true
  28628. // This is the number of onSignalExit's that are in play.
  28629. // It's important so that we can count the correct number of
  28630. // listeners on signals, and don't wait for the other one to
  28631. // handle it instead of us.
  28632. emitter.count += 1
  28633. signals = signals.filter(function (sig) {
  28634. try {
  28635. process.on(sig, sigListeners[sig])
  28636. return true
  28637. } catch (er) {
  28638. return false
  28639. }
  28640. })
  28641. process.emit = processEmit
  28642. process.reallyExit = processReallyExit
  28643. }
  28644. var originalProcessReallyExit = process.reallyExit
  28645. function processReallyExit (code) {
  28646. process.exitCode = code || 0
  28647. emit('exit', process.exitCode, null)
  28648. /* istanbul ignore next */
  28649. emit('afterexit', process.exitCode, null)
  28650. /* istanbul ignore next */
  28651. originalProcessReallyExit.call(process, process.exitCode)
  28652. }
  28653. var originalProcessEmit = process.emit
  28654. function processEmit (ev, arg) {
  28655. if (ev === 'exit') {
  28656. if (arg !== undefined) {
  28657. process.exitCode = arg
  28658. }
  28659. var ret = originalProcessEmit.apply(this, arguments)
  28660. emit('exit', process.exitCode, null)
  28661. /* istanbul ignore next */
  28662. emit('afterexit', process.exitCode, null)
  28663. return ret
  28664. } else {
  28665. return originalProcessEmit.apply(this, arguments)
  28666. }
  28667. }
  28668. /***/ }),
  28669. /***/ 932:
  28670. /***/ (function(__unusedmodule, exports) {
  28671. "use strict";
  28672. Object.defineProperty(exports, '__esModule', { value: true });
  28673. class Deprecation extends Error {
  28674. constructor(message) {
  28675. super(message); // Maintains proper stack trace (only available on V8)
  28676. /* istanbul ignore next */
  28677. if (Error.captureStackTrace) {
  28678. Error.captureStackTrace(this, this.constructor);
  28679. }
  28680. this.name = 'Deprecation';
  28681. }
  28682. }
  28683. exports.Deprecation = Deprecation;
  28684. /***/ }),
  28685. /***/ 937:
  28686. /***/ (function(module) {
  28687. module.exports = require("net");
  28688. /***/ }),
  28689. /***/ 940:
  28690. /***/ (function(module) {
  28691. // Returns a wrapper function that returns a wrapped callback
  28692. // The wrapper function should do some stuff, and return a
  28693. // presumably different callback function.
  28694. // This makes sure that own properties are retained, so that
  28695. // decorations and such are not lost along the way.
  28696. module.exports = wrappy
  28697. function wrappy (fn, cb) {
  28698. if (fn && cb) return wrappy(fn)(cb)
  28699. if (typeof fn !== 'function')
  28700. throw new TypeError('need wrapper function')
  28701. Object.keys(fn).forEach(function (k) {
  28702. wrapper[k] = fn[k]
  28703. })
  28704. return wrapper
  28705. function wrapper() {
  28706. var args = new Array(arguments.length)
  28707. for (var i = 0; i < args.length; i++) {
  28708. args[i] = arguments[i]
  28709. }
  28710. var ret = fn.apply(this, args)
  28711. var cb = args[args.length-1]
  28712. if (typeof ret === 'function' && ret !== cb) {
  28713. Object.keys(cb).forEach(function (k) {
  28714. ret[k] = cb[k]
  28715. })
  28716. }
  28717. return ret
  28718. }
  28719. }
  28720. /***/ }),
  28721. /***/ 954:
  28722. /***/ (function(module) {
  28723. module.exports = {"_args":[["@octokit/rest@16.43.1","/Users/hross/Code/checkout"]],"_from":"@octokit/rest@16.43.1","_id":"@octokit/rest@16.43.1","_inBundle":false,"_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_location":"/@octokit/rest","_phantomChildren":{"@octokit/types":"2.14.0","deprecation":"2.3.1","once":"1.4.0"},"_requested":{"type":"version","registry":true,"raw":"@octokit/rest@16.43.1","name":"@octokit/rest","escapedName":"@octokit%2frest","scope":"@octokit","rawSpec":"16.43.1","saveSpec":null,"fetchSpec":"16.43.1"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_spec":"16.43.1","_where":"/Users/hross/Code/checkout","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/rest.js/issues"},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"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"}],"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"},"description":"GitHub REST API client for Node.js","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"},"files":["index.js","index.d.ts","lib","plugins"],"homepage":"https://github.com/octokit/rest.js#readme","keywords":["octokit","github","rest","api-client"],"license":"MIT","name":"@octokit/rest","nyc":{"ignore":["test"]},"publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/rest.js.git"},"scripts":{"build":"npm-run-all build:*","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","build:ts":"npm run -s update-endpoints:typescript","coverage":"nyc report --reporter=html && open coverage/index.html","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.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","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","prebuild:browser":"mkdirp dist/","pretest":"npm run -s lint","prevalidate:ts":"npm run -s build:ts","start-fixtures-server":"octokit-fixtures-server","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","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","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts"},"types":"index.d.ts","version":"16.43.1"};
  28724. /***/ }),
  28725. /***/ 962:
  28726. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28727. "use strict";
  28728. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28729. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28730. return new (P || (P = Promise))(function (resolve, reject) {
  28731. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28732. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28733. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28734. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28735. });
  28736. };
  28737. var _a;
  28738. Object.defineProperty(exports, "__esModule", { value: true });
  28739. const assert_1 = __webpack_require__(357);
  28740. const fs = __webpack_require__(747);
  28741. const path = __webpack_require__(622);
  28742. _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;
  28743. exports.IS_WINDOWS = process.platform === 'win32';
  28744. function exists(fsPath) {
  28745. return __awaiter(this, void 0, void 0, function* () {
  28746. try {
  28747. yield exports.stat(fsPath);
  28748. }
  28749. catch (err) {
  28750. if (err.code === 'ENOENT') {
  28751. return false;
  28752. }
  28753. throw err;
  28754. }
  28755. return true;
  28756. });
  28757. }
  28758. exports.exists = exists;
  28759. function isDirectory(fsPath, useStat = false) {
  28760. return __awaiter(this, void 0, void 0, function* () {
  28761. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  28762. return stats.isDirectory();
  28763. });
  28764. }
  28765. exports.isDirectory = isDirectory;
  28766. /**
  28767. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  28768. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  28769. */
  28770. function isRooted(p) {
  28771. p = normalizeSeparators(p);
  28772. if (!p) {
  28773. throw new Error('isRooted() parameter "p" cannot be empty');
  28774. }
  28775. if (exports.IS_WINDOWS) {
  28776. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  28777. ); // e.g. C: or C:\hello
  28778. }
  28779. return p.startsWith('/');
  28780. }
  28781. exports.isRooted = isRooted;
  28782. /**
  28783. * Recursively create a directory at `fsPath`.
  28784. *
  28785. * This implementation is optimistic, meaning it attempts to create the full
  28786. * path first, and backs up the path stack from there.
  28787. *
  28788. * @param fsPath The path to create
  28789. * @param maxDepth The maximum recursion depth
  28790. * @param depth The current recursion depth
  28791. */
  28792. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  28793. return __awaiter(this, void 0, void 0, function* () {
  28794. assert_1.ok(fsPath, 'a path argument must be provided');
  28795. fsPath = path.resolve(fsPath);
  28796. if (depth >= maxDepth)
  28797. return exports.mkdir(fsPath);
  28798. try {
  28799. yield exports.mkdir(fsPath);
  28800. return;
  28801. }
  28802. catch (err) {
  28803. switch (err.code) {
  28804. case 'ENOENT': {
  28805. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  28806. yield exports.mkdir(fsPath);
  28807. return;
  28808. }
  28809. default: {
  28810. let stats;
  28811. try {
  28812. stats = yield exports.stat(fsPath);
  28813. }
  28814. catch (err2) {
  28815. throw err;
  28816. }
  28817. if (!stats.isDirectory())
  28818. throw err;
  28819. }
  28820. }
  28821. }
  28822. });
  28823. }
  28824. exports.mkdirP = mkdirP;
  28825. /**
  28826. * Best effort attempt to determine whether a file exists and is executable.
  28827. * @param filePath file path to check
  28828. * @param extensions additional file extensions to try
  28829. * @return if file exists and is executable, returns the file path. otherwise empty string.
  28830. */
  28831. function tryGetExecutablePath(filePath, extensions) {
  28832. return __awaiter(this, void 0, void 0, function* () {
  28833. let stats = undefined;
  28834. try {
  28835. // test file exists
  28836. stats = yield exports.stat(filePath);
  28837. }
  28838. catch (err) {
  28839. if (err.code !== 'ENOENT') {
  28840. // eslint-disable-next-line no-console
  28841. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  28842. }
  28843. }
  28844. if (stats && stats.isFile()) {
  28845. if (exports.IS_WINDOWS) {
  28846. // on Windows, test for valid extension
  28847. const upperExt = path.extname(filePath).toUpperCase();
  28848. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  28849. return filePath;
  28850. }
  28851. }
  28852. else {
  28853. if (isUnixExecutable(stats)) {
  28854. return filePath;
  28855. }
  28856. }
  28857. }
  28858. // try each extension
  28859. const originalFilePath = filePath;
  28860. for (const extension of extensions) {
  28861. filePath = originalFilePath + extension;
  28862. stats = undefined;
  28863. try {
  28864. stats = yield exports.stat(filePath);
  28865. }
  28866. catch (err) {
  28867. if (err.code !== 'ENOENT') {
  28868. // eslint-disable-next-line no-console
  28869. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  28870. }
  28871. }
  28872. if (stats && stats.isFile()) {
  28873. if (exports.IS_WINDOWS) {
  28874. // preserve the case of the actual file (since an extension was appended)
  28875. try {
  28876. const directory = path.dirname(filePath);
  28877. const upperName = path.basename(filePath).toUpperCase();
  28878. for (const actualName of yield exports.readdir(directory)) {
  28879. if (upperName === actualName.toUpperCase()) {
  28880. filePath = path.join(directory, actualName);
  28881. break;
  28882. }
  28883. }
  28884. }
  28885. catch (err) {
  28886. // eslint-disable-next-line no-console
  28887. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  28888. }
  28889. return filePath;
  28890. }
  28891. else {
  28892. if (isUnixExecutable(stats)) {
  28893. return filePath;
  28894. }
  28895. }
  28896. }
  28897. }
  28898. return '';
  28899. });
  28900. }
  28901. exports.tryGetExecutablePath = tryGetExecutablePath;
  28902. function normalizeSeparators(p) {
  28903. p = p || '';
  28904. if (exports.IS_WINDOWS) {
  28905. // convert slashes on Windows
  28906. p = p.replace(/\//g, '\\');
  28907. // remove redundant slashes
  28908. return p.replace(/\\\\+/g, '\\');
  28909. }
  28910. // remove redundant slashes
  28911. return p.replace(/\/\/+/g, '/');
  28912. }
  28913. // on Mac/Linux, test the execute bit
  28914. // R W X R W X R W X
  28915. // 256 128 64 32 16 8 4 2 1
  28916. function isUnixExecutable(stats) {
  28917. return ((stats.mode & 1) > 0 ||
  28918. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  28919. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  28920. }
  28921. //# sourceMappingURL=io-util.js.map
  28922. /***/ }),
  28923. /***/ 996:
  28924. /***/ (function(module, __unusedexports, __webpack_require__) {
  28925. module.exports = hasPreviousPage
  28926. const deprecate = __webpack_require__(191)
  28927. const getPageLinks = __webpack_require__(889)
  28928. function hasPreviousPage (link) {
  28929. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28930. return getPageLinks(link).prev
  28931. }
  28932. /***/ }),
  28933. /***/ 997:
  28934. /***/ (function(module) {
  28935. module.exports = validateAuth;
  28936. function validateAuth(auth) {
  28937. if (typeof auth === "string") {
  28938. return;
  28939. }
  28940. if (typeof auth === "function") {
  28941. return;
  28942. }
  28943. if (auth.username && auth.password) {
  28944. return;
  28945. }
  28946. if (auth.clientId && auth.clientSecret) {
  28947. return;
  28948. }
  28949. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28950. }
  28951. /***/ })
  28952. /******/ });