index.js 504 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(372),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(190),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. 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.`);
  239. }
  240. else {
  241. 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.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. 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}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 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.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 18:
  1031. /***/ (function() {
  1032. eval("require")("encoding");
  1033. /***/ }),
  1034. /***/ 19:
  1035. /***/ (function(module, __unusedexports, __webpack_require__) {
  1036. module.exports = authenticationPlugin;
  1037. const { Deprecation } = __webpack_require__(692);
  1038. const once = __webpack_require__(969);
  1039. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1040. const authenticate = __webpack_require__(674);
  1041. const beforeRequest = __webpack_require__(471);
  1042. const requestError = __webpack_require__(349);
  1043. function authenticationPlugin(octokit, options) {
  1044. if (options.auth) {
  1045. octokit.authenticate = () => {
  1046. deprecateAuthenticate(
  1047. octokit.log,
  1048. new Deprecation(
  1049. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1050. )
  1051. );
  1052. };
  1053. return;
  1054. }
  1055. const state = {
  1056. octokit,
  1057. auth: false
  1058. };
  1059. octokit.authenticate = authenticate.bind(null, state);
  1060. octokit.hook.before("request", beforeRequest.bind(null, state));
  1061. octokit.hook.error("request", requestError.bind(null, state));
  1062. }
  1063. /***/ }),
  1064. /***/ 20:
  1065. /***/ (function(module, __unusedexports, __webpack_require__) {
  1066. "use strict";
  1067. const cp = __webpack_require__(129);
  1068. const parse = __webpack_require__(568);
  1069. const enoent = __webpack_require__(881);
  1070. function spawn(command, args, options) {
  1071. // Parse the arguments
  1072. const parsed = parse(command, args, options);
  1073. // Spawn the child process
  1074. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1075. // Hook into child process "exit" event to emit an error if the command
  1076. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1077. enoent.hookChildProcess(spawned, parsed);
  1078. return spawned;
  1079. }
  1080. function spawnSync(command, args, options) {
  1081. // Parse the arguments
  1082. const parsed = parse(command, args, options);
  1083. // Spawn the child process
  1084. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1085. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1086. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1087. return result;
  1088. }
  1089. module.exports = spawn;
  1090. module.exports.spawn = spawn;
  1091. module.exports.sync = spawnSync;
  1092. module.exports._parse = parse;
  1093. module.exports._enoent = enoent;
  1094. /***/ }),
  1095. /***/ 39:
  1096. /***/ (function(module) {
  1097. "use strict";
  1098. module.exports = opts => {
  1099. opts = opts || {};
  1100. const env = opts.env || process.env;
  1101. const platform = opts.platform || process.platform;
  1102. if (platform !== 'win32') {
  1103. return 'PATH';
  1104. }
  1105. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1106. };
  1107. /***/ }),
  1108. /***/ 47:
  1109. /***/ (function(module, __unusedexports, __webpack_require__) {
  1110. module.exports = factory;
  1111. const Octokit = __webpack_require__(402);
  1112. const registerPlugin = __webpack_require__(855);
  1113. function factory(plugins) {
  1114. const Api = Octokit.bind(null, plugins || []);
  1115. Api.plugin = registerPlugin.bind(null, plugins || []);
  1116. return Api;
  1117. }
  1118. /***/ }),
  1119. /***/ 49:
  1120. /***/ (function(module, __unusedexports, __webpack_require__) {
  1121. "use strict";
  1122. const os = __webpack_require__(87);
  1123. const execa = __webpack_require__(955);
  1124. // Reference: https://www.gaijin.at/en/lstwinver.php
  1125. const names = new Map([
  1126. ['10.0', '10'],
  1127. ['6.3', '8.1'],
  1128. ['6.2', '8'],
  1129. ['6.1', '7'],
  1130. ['6.0', 'Vista'],
  1131. ['5.2', 'Server 2003'],
  1132. ['5.1', 'XP'],
  1133. ['5.0', '2000'],
  1134. ['4.9', 'ME'],
  1135. ['4.1', '98'],
  1136. ['4.0', '95']
  1137. ]);
  1138. const windowsRelease = release => {
  1139. const version = /\d+\.\d/.exec(release || os.release());
  1140. if (release && !version) {
  1141. throw new Error('`release` argument doesn\'t match `n.n`');
  1142. }
  1143. const ver = (version || [])[0];
  1144. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1145. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1146. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1147. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1148. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1149. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1150. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1151. if (year) {
  1152. return `Server ${year}`;
  1153. }
  1154. }
  1155. return names.get(ver);
  1156. };
  1157. module.exports = windowsRelease;
  1158. /***/ }),
  1159. /***/ 87:
  1160. /***/ (function(module) {
  1161. module.exports = require("os");
  1162. /***/ }),
  1163. /***/ 118:
  1164. /***/ (function(module, __unusedexports, __webpack_require__) {
  1165. "use strict";
  1166. const os = __webpack_require__(87);
  1167. const nameMap = new Map([
  1168. [19, 'Catalina'],
  1169. [18, 'Mojave'],
  1170. [17, 'High Sierra'],
  1171. [16, 'Sierra'],
  1172. [15, 'El Capitan'],
  1173. [14, 'Yosemite'],
  1174. [13, 'Mavericks'],
  1175. [12, 'Mountain Lion'],
  1176. [11, 'Lion'],
  1177. [10, 'Snow Leopard'],
  1178. [9, 'Leopard'],
  1179. [8, 'Tiger'],
  1180. [7, 'Panther'],
  1181. [6, 'Jaguar'],
  1182. [5, 'Puma']
  1183. ]);
  1184. const macosRelease = release => {
  1185. release = Number((release || os.release()).split('.')[0]);
  1186. return {
  1187. name: nameMap.get(release),
  1188. version: '10.' + (release - 4)
  1189. };
  1190. };
  1191. module.exports = macosRelease;
  1192. // TODO: remove this in the next major version
  1193. module.exports.default = macosRelease;
  1194. /***/ }),
  1195. /***/ 126:
  1196. /***/ (function(module) {
  1197. /**
  1198. * lodash (Custom Build) <https://lodash.com/>
  1199. * Build: `lodash modularize exports="npm" -o ./`
  1200. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1201. * Released under MIT license <https://lodash.com/license>
  1202. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1203. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1204. */
  1205. /** Used as the size to enable large array optimizations. */
  1206. var LARGE_ARRAY_SIZE = 200;
  1207. /** Used to stand-in for `undefined` hash values. */
  1208. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1209. /** Used as references for various `Number` constants. */
  1210. var INFINITY = 1 / 0;
  1211. /** `Object#toString` result references. */
  1212. var funcTag = '[object Function]',
  1213. genTag = '[object GeneratorFunction]';
  1214. /**
  1215. * Used to match `RegExp`
  1216. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1217. */
  1218. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1219. /** Used to detect host constructors (Safari). */
  1220. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1221. /** Detect free variable `global` from Node.js. */
  1222. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1223. /** Detect free variable `self`. */
  1224. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1225. /** Used as a reference to the global object. */
  1226. var root = freeGlobal || freeSelf || Function('return this')();
  1227. /**
  1228. * A specialized version of `_.includes` for arrays without support for
  1229. * specifying an index to search from.
  1230. *
  1231. * @private
  1232. * @param {Array} [array] The array to inspect.
  1233. * @param {*} target The value to search for.
  1234. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1235. */
  1236. function arrayIncludes(array, value) {
  1237. var length = array ? array.length : 0;
  1238. return !!length && baseIndexOf(array, value, 0) > -1;
  1239. }
  1240. /**
  1241. * This function is like `arrayIncludes` except that it accepts a comparator.
  1242. *
  1243. * @private
  1244. * @param {Array} [array] The array to inspect.
  1245. * @param {*} target The value to search for.
  1246. * @param {Function} comparator The comparator invoked per element.
  1247. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1248. */
  1249. function arrayIncludesWith(array, value, comparator) {
  1250. var index = -1,
  1251. length = array ? array.length : 0;
  1252. while (++index < length) {
  1253. if (comparator(value, array[index])) {
  1254. return true;
  1255. }
  1256. }
  1257. return false;
  1258. }
  1259. /**
  1260. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1261. * support for iteratee shorthands.
  1262. *
  1263. * @private
  1264. * @param {Array} array The array to inspect.
  1265. * @param {Function} predicate The function invoked per iteration.
  1266. * @param {number} fromIndex The index to search from.
  1267. * @param {boolean} [fromRight] Specify iterating from right to left.
  1268. * @returns {number} Returns the index of the matched value, else `-1`.
  1269. */
  1270. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1271. var length = array.length,
  1272. index = fromIndex + (fromRight ? 1 : -1);
  1273. while ((fromRight ? index-- : ++index < length)) {
  1274. if (predicate(array[index], index, array)) {
  1275. return index;
  1276. }
  1277. }
  1278. return -1;
  1279. }
  1280. /**
  1281. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1282. *
  1283. * @private
  1284. * @param {Array} array The array to inspect.
  1285. * @param {*} value The value to search for.
  1286. * @param {number} fromIndex The index to search from.
  1287. * @returns {number} Returns the index of the matched value, else `-1`.
  1288. */
  1289. function baseIndexOf(array, value, fromIndex) {
  1290. if (value !== value) {
  1291. return baseFindIndex(array, baseIsNaN, fromIndex);
  1292. }
  1293. var index = fromIndex - 1,
  1294. length = array.length;
  1295. while (++index < length) {
  1296. if (array[index] === value) {
  1297. return index;
  1298. }
  1299. }
  1300. return -1;
  1301. }
  1302. /**
  1303. * The base implementation of `_.isNaN` without support for number objects.
  1304. *
  1305. * @private
  1306. * @param {*} value The value to check.
  1307. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1308. */
  1309. function baseIsNaN(value) {
  1310. return value !== value;
  1311. }
  1312. /**
  1313. * Checks if a cache value for `key` exists.
  1314. *
  1315. * @private
  1316. * @param {Object} cache The cache to query.
  1317. * @param {string} key The key of the entry to check.
  1318. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1319. */
  1320. function cacheHas(cache, key) {
  1321. return cache.has(key);
  1322. }
  1323. /**
  1324. * Gets the value at `key` of `object`.
  1325. *
  1326. * @private
  1327. * @param {Object} [object] The object to query.
  1328. * @param {string} key The key of the property to get.
  1329. * @returns {*} Returns the property value.
  1330. */
  1331. function getValue(object, key) {
  1332. return object == null ? undefined : object[key];
  1333. }
  1334. /**
  1335. * Checks if `value` is a host object in IE < 9.
  1336. *
  1337. * @private
  1338. * @param {*} value The value to check.
  1339. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1340. */
  1341. function isHostObject(value) {
  1342. // Many host objects are `Object` objects that can coerce to strings
  1343. // despite having improperly defined `toString` methods.
  1344. var result = false;
  1345. if (value != null && typeof value.toString != 'function') {
  1346. try {
  1347. result = !!(value + '');
  1348. } catch (e) {}
  1349. }
  1350. return result;
  1351. }
  1352. /**
  1353. * Converts `set` to an array of its values.
  1354. *
  1355. * @private
  1356. * @param {Object} set The set to convert.
  1357. * @returns {Array} Returns the values.
  1358. */
  1359. function setToArray(set) {
  1360. var index = -1,
  1361. result = Array(set.size);
  1362. set.forEach(function(value) {
  1363. result[++index] = value;
  1364. });
  1365. return result;
  1366. }
  1367. /** Used for built-in method references. */
  1368. var arrayProto = Array.prototype,
  1369. funcProto = Function.prototype,
  1370. objectProto = Object.prototype;
  1371. /** Used to detect overreaching core-js shims. */
  1372. var coreJsData = root['__core-js_shared__'];
  1373. /** Used to detect methods masquerading as native. */
  1374. var maskSrcKey = (function() {
  1375. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1376. return uid ? ('Symbol(src)_1.' + uid) : '';
  1377. }());
  1378. /** Used to resolve the decompiled source of functions. */
  1379. var funcToString = funcProto.toString;
  1380. /** Used to check objects for own properties. */
  1381. var hasOwnProperty = objectProto.hasOwnProperty;
  1382. /**
  1383. * Used to resolve the
  1384. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1385. * of values.
  1386. */
  1387. var objectToString = objectProto.toString;
  1388. /** Used to detect if a method is native. */
  1389. var reIsNative = RegExp('^' +
  1390. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1391. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1392. );
  1393. /** Built-in value references. */
  1394. var splice = arrayProto.splice;
  1395. /* Built-in method references that are verified to be native. */
  1396. var Map = getNative(root, 'Map'),
  1397. Set = getNative(root, 'Set'),
  1398. nativeCreate = getNative(Object, 'create');
  1399. /**
  1400. * Creates a hash object.
  1401. *
  1402. * @private
  1403. * @constructor
  1404. * @param {Array} [entries] The key-value pairs to cache.
  1405. */
  1406. function Hash(entries) {
  1407. var index = -1,
  1408. length = entries ? entries.length : 0;
  1409. this.clear();
  1410. while (++index < length) {
  1411. var entry = entries[index];
  1412. this.set(entry[0], entry[1]);
  1413. }
  1414. }
  1415. /**
  1416. * Removes all key-value entries from the hash.
  1417. *
  1418. * @private
  1419. * @name clear
  1420. * @memberOf Hash
  1421. */
  1422. function hashClear() {
  1423. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1424. }
  1425. /**
  1426. * Removes `key` and its value from the hash.
  1427. *
  1428. * @private
  1429. * @name delete
  1430. * @memberOf Hash
  1431. * @param {Object} hash The hash to modify.
  1432. * @param {string} key The key of the value to remove.
  1433. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1434. */
  1435. function hashDelete(key) {
  1436. return this.has(key) && delete this.__data__[key];
  1437. }
  1438. /**
  1439. * Gets the hash value for `key`.
  1440. *
  1441. * @private
  1442. * @name get
  1443. * @memberOf Hash
  1444. * @param {string} key The key of the value to get.
  1445. * @returns {*} Returns the entry value.
  1446. */
  1447. function hashGet(key) {
  1448. var data = this.__data__;
  1449. if (nativeCreate) {
  1450. var result = data[key];
  1451. return result === HASH_UNDEFINED ? undefined : result;
  1452. }
  1453. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1454. }
  1455. /**
  1456. * Checks if a hash value for `key` exists.
  1457. *
  1458. * @private
  1459. * @name has
  1460. * @memberOf Hash
  1461. * @param {string} key The key of the entry to check.
  1462. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1463. */
  1464. function hashHas(key) {
  1465. var data = this.__data__;
  1466. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1467. }
  1468. /**
  1469. * Sets the hash `key` to `value`.
  1470. *
  1471. * @private
  1472. * @name set
  1473. * @memberOf Hash
  1474. * @param {string} key The key of the value to set.
  1475. * @param {*} value The value to set.
  1476. * @returns {Object} Returns the hash instance.
  1477. */
  1478. function hashSet(key, value) {
  1479. var data = this.__data__;
  1480. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1481. return this;
  1482. }
  1483. // Add methods to `Hash`.
  1484. Hash.prototype.clear = hashClear;
  1485. Hash.prototype['delete'] = hashDelete;
  1486. Hash.prototype.get = hashGet;
  1487. Hash.prototype.has = hashHas;
  1488. Hash.prototype.set = hashSet;
  1489. /**
  1490. * Creates an list cache object.
  1491. *
  1492. * @private
  1493. * @constructor
  1494. * @param {Array} [entries] The key-value pairs to cache.
  1495. */
  1496. function ListCache(entries) {
  1497. var index = -1,
  1498. length = entries ? entries.length : 0;
  1499. this.clear();
  1500. while (++index < length) {
  1501. var entry = entries[index];
  1502. this.set(entry[0], entry[1]);
  1503. }
  1504. }
  1505. /**
  1506. * Removes all key-value entries from the list cache.
  1507. *
  1508. * @private
  1509. * @name clear
  1510. * @memberOf ListCache
  1511. */
  1512. function listCacheClear() {
  1513. this.__data__ = [];
  1514. }
  1515. /**
  1516. * Removes `key` and its value from the list cache.
  1517. *
  1518. * @private
  1519. * @name delete
  1520. * @memberOf ListCache
  1521. * @param {string} key The key of the value to remove.
  1522. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1523. */
  1524. function listCacheDelete(key) {
  1525. var data = this.__data__,
  1526. index = assocIndexOf(data, key);
  1527. if (index < 0) {
  1528. return false;
  1529. }
  1530. var lastIndex = data.length - 1;
  1531. if (index == lastIndex) {
  1532. data.pop();
  1533. } else {
  1534. splice.call(data, index, 1);
  1535. }
  1536. return true;
  1537. }
  1538. /**
  1539. * Gets the list cache value for `key`.
  1540. *
  1541. * @private
  1542. * @name get
  1543. * @memberOf ListCache
  1544. * @param {string} key The key of the value to get.
  1545. * @returns {*} Returns the entry value.
  1546. */
  1547. function listCacheGet(key) {
  1548. var data = this.__data__,
  1549. index = assocIndexOf(data, key);
  1550. return index < 0 ? undefined : data[index][1];
  1551. }
  1552. /**
  1553. * Checks if a list cache value for `key` exists.
  1554. *
  1555. * @private
  1556. * @name has
  1557. * @memberOf ListCache
  1558. * @param {string} key The key of the entry to check.
  1559. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1560. */
  1561. function listCacheHas(key) {
  1562. return assocIndexOf(this.__data__, key) > -1;
  1563. }
  1564. /**
  1565. * Sets the list cache `key` to `value`.
  1566. *
  1567. * @private
  1568. * @name set
  1569. * @memberOf ListCache
  1570. * @param {string} key The key of the value to set.
  1571. * @param {*} value The value to set.
  1572. * @returns {Object} Returns the list cache instance.
  1573. */
  1574. function listCacheSet(key, value) {
  1575. var data = this.__data__,
  1576. index = assocIndexOf(data, key);
  1577. if (index < 0) {
  1578. data.push([key, value]);
  1579. } else {
  1580. data[index][1] = value;
  1581. }
  1582. return this;
  1583. }
  1584. // Add methods to `ListCache`.
  1585. ListCache.prototype.clear = listCacheClear;
  1586. ListCache.prototype['delete'] = listCacheDelete;
  1587. ListCache.prototype.get = listCacheGet;
  1588. ListCache.prototype.has = listCacheHas;
  1589. ListCache.prototype.set = listCacheSet;
  1590. /**
  1591. * Creates a map cache object to store key-value pairs.
  1592. *
  1593. * @private
  1594. * @constructor
  1595. * @param {Array} [entries] The key-value pairs to cache.
  1596. */
  1597. function MapCache(entries) {
  1598. var index = -1,
  1599. length = entries ? entries.length : 0;
  1600. this.clear();
  1601. while (++index < length) {
  1602. var entry = entries[index];
  1603. this.set(entry[0], entry[1]);
  1604. }
  1605. }
  1606. /**
  1607. * Removes all key-value entries from the map.
  1608. *
  1609. * @private
  1610. * @name clear
  1611. * @memberOf MapCache
  1612. */
  1613. function mapCacheClear() {
  1614. this.__data__ = {
  1615. 'hash': new Hash,
  1616. 'map': new (Map || ListCache),
  1617. 'string': new Hash
  1618. };
  1619. }
  1620. /**
  1621. * Removes `key` and its value from the map.
  1622. *
  1623. * @private
  1624. * @name delete
  1625. * @memberOf MapCache
  1626. * @param {string} key The key of the value to remove.
  1627. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1628. */
  1629. function mapCacheDelete(key) {
  1630. return getMapData(this, key)['delete'](key);
  1631. }
  1632. /**
  1633. * Gets the map value for `key`.
  1634. *
  1635. * @private
  1636. * @name get
  1637. * @memberOf MapCache
  1638. * @param {string} key The key of the value to get.
  1639. * @returns {*} Returns the entry value.
  1640. */
  1641. function mapCacheGet(key) {
  1642. return getMapData(this, key).get(key);
  1643. }
  1644. /**
  1645. * Checks if a map value for `key` exists.
  1646. *
  1647. * @private
  1648. * @name has
  1649. * @memberOf MapCache
  1650. * @param {string} key The key of the entry to check.
  1651. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1652. */
  1653. function mapCacheHas(key) {
  1654. return getMapData(this, key).has(key);
  1655. }
  1656. /**
  1657. * Sets the map `key` to `value`.
  1658. *
  1659. * @private
  1660. * @name set
  1661. * @memberOf MapCache
  1662. * @param {string} key The key of the value to set.
  1663. * @param {*} value The value to set.
  1664. * @returns {Object} Returns the map cache instance.
  1665. */
  1666. function mapCacheSet(key, value) {
  1667. getMapData(this, key).set(key, value);
  1668. return this;
  1669. }
  1670. // Add methods to `MapCache`.
  1671. MapCache.prototype.clear = mapCacheClear;
  1672. MapCache.prototype['delete'] = mapCacheDelete;
  1673. MapCache.prototype.get = mapCacheGet;
  1674. MapCache.prototype.has = mapCacheHas;
  1675. MapCache.prototype.set = mapCacheSet;
  1676. /**
  1677. *
  1678. * Creates an array cache object to store unique values.
  1679. *
  1680. * @private
  1681. * @constructor
  1682. * @param {Array} [values] The values to cache.
  1683. */
  1684. function SetCache(values) {
  1685. var index = -1,
  1686. length = values ? values.length : 0;
  1687. this.__data__ = new MapCache;
  1688. while (++index < length) {
  1689. this.add(values[index]);
  1690. }
  1691. }
  1692. /**
  1693. * Adds `value` to the array cache.
  1694. *
  1695. * @private
  1696. * @name add
  1697. * @memberOf SetCache
  1698. * @alias push
  1699. * @param {*} value The value to cache.
  1700. * @returns {Object} Returns the cache instance.
  1701. */
  1702. function setCacheAdd(value) {
  1703. this.__data__.set(value, HASH_UNDEFINED);
  1704. return this;
  1705. }
  1706. /**
  1707. * Checks if `value` is in the array cache.
  1708. *
  1709. * @private
  1710. * @name has
  1711. * @memberOf SetCache
  1712. * @param {*} value The value to search for.
  1713. * @returns {number} Returns `true` if `value` is found, else `false`.
  1714. */
  1715. function setCacheHas(value) {
  1716. return this.__data__.has(value);
  1717. }
  1718. // Add methods to `SetCache`.
  1719. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1720. SetCache.prototype.has = setCacheHas;
  1721. /**
  1722. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1723. *
  1724. * @private
  1725. * @param {Array} array The array to inspect.
  1726. * @param {*} key The key to search for.
  1727. * @returns {number} Returns the index of the matched value, else `-1`.
  1728. */
  1729. function assocIndexOf(array, key) {
  1730. var length = array.length;
  1731. while (length--) {
  1732. if (eq(array[length][0], key)) {
  1733. return length;
  1734. }
  1735. }
  1736. return -1;
  1737. }
  1738. /**
  1739. * The base implementation of `_.isNative` without bad shim checks.
  1740. *
  1741. * @private
  1742. * @param {*} value The value to check.
  1743. * @returns {boolean} Returns `true` if `value` is a native function,
  1744. * else `false`.
  1745. */
  1746. function baseIsNative(value) {
  1747. if (!isObject(value) || isMasked(value)) {
  1748. return false;
  1749. }
  1750. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1751. return pattern.test(toSource(value));
  1752. }
  1753. /**
  1754. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1755. *
  1756. * @private
  1757. * @param {Array} array The array to inspect.
  1758. * @param {Function} [iteratee] The iteratee invoked per element.
  1759. * @param {Function} [comparator] The comparator invoked per element.
  1760. * @returns {Array} Returns the new duplicate free array.
  1761. */
  1762. function baseUniq(array, iteratee, comparator) {
  1763. var index = -1,
  1764. includes = arrayIncludes,
  1765. length = array.length,
  1766. isCommon = true,
  1767. result = [],
  1768. seen = result;
  1769. if (comparator) {
  1770. isCommon = false;
  1771. includes = arrayIncludesWith;
  1772. }
  1773. else if (length >= LARGE_ARRAY_SIZE) {
  1774. var set = iteratee ? null : createSet(array);
  1775. if (set) {
  1776. return setToArray(set);
  1777. }
  1778. isCommon = false;
  1779. includes = cacheHas;
  1780. seen = new SetCache;
  1781. }
  1782. else {
  1783. seen = iteratee ? [] : result;
  1784. }
  1785. outer:
  1786. while (++index < length) {
  1787. var value = array[index],
  1788. computed = iteratee ? iteratee(value) : value;
  1789. value = (comparator || value !== 0) ? value : 0;
  1790. if (isCommon && computed === computed) {
  1791. var seenIndex = seen.length;
  1792. while (seenIndex--) {
  1793. if (seen[seenIndex] === computed) {
  1794. continue outer;
  1795. }
  1796. }
  1797. if (iteratee) {
  1798. seen.push(computed);
  1799. }
  1800. result.push(value);
  1801. }
  1802. else if (!includes(seen, computed, comparator)) {
  1803. if (seen !== result) {
  1804. seen.push(computed);
  1805. }
  1806. result.push(value);
  1807. }
  1808. }
  1809. return result;
  1810. }
  1811. /**
  1812. * Creates a set object of `values`.
  1813. *
  1814. * @private
  1815. * @param {Array} values The values to add to the set.
  1816. * @returns {Object} Returns the new set.
  1817. */
  1818. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1819. return new Set(values);
  1820. };
  1821. /**
  1822. * Gets the data for `map`.
  1823. *
  1824. * @private
  1825. * @param {Object} map The map to query.
  1826. * @param {string} key The reference key.
  1827. * @returns {*} Returns the map data.
  1828. */
  1829. function getMapData(map, key) {
  1830. var data = map.__data__;
  1831. return isKeyable(key)
  1832. ? data[typeof key == 'string' ? 'string' : 'hash']
  1833. : data.map;
  1834. }
  1835. /**
  1836. * Gets the native function at `key` of `object`.
  1837. *
  1838. * @private
  1839. * @param {Object} object The object to query.
  1840. * @param {string} key The key of the method to get.
  1841. * @returns {*} Returns the function if it's native, else `undefined`.
  1842. */
  1843. function getNative(object, key) {
  1844. var value = getValue(object, key);
  1845. return baseIsNative(value) ? value : undefined;
  1846. }
  1847. /**
  1848. * Checks if `value` is suitable for use as unique object key.
  1849. *
  1850. * @private
  1851. * @param {*} value The value to check.
  1852. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1853. */
  1854. function isKeyable(value) {
  1855. var type = typeof value;
  1856. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1857. ? (value !== '__proto__')
  1858. : (value === null);
  1859. }
  1860. /**
  1861. * Checks if `func` has its source masked.
  1862. *
  1863. * @private
  1864. * @param {Function} func The function to check.
  1865. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1866. */
  1867. function isMasked(func) {
  1868. return !!maskSrcKey && (maskSrcKey in func);
  1869. }
  1870. /**
  1871. * Converts `func` to its source code.
  1872. *
  1873. * @private
  1874. * @param {Function} func The function to process.
  1875. * @returns {string} Returns the source code.
  1876. */
  1877. function toSource(func) {
  1878. if (func != null) {
  1879. try {
  1880. return funcToString.call(func);
  1881. } catch (e) {}
  1882. try {
  1883. return (func + '');
  1884. } catch (e) {}
  1885. }
  1886. return '';
  1887. }
  1888. /**
  1889. * Creates a duplicate-free version of an array, using
  1890. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1891. * for equality comparisons, in which only the first occurrence of each
  1892. * element is kept.
  1893. *
  1894. * @static
  1895. * @memberOf _
  1896. * @since 0.1.0
  1897. * @category Array
  1898. * @param {Array} array The array to inspect.
  1899. * @returns {Array} Returns the new duplicate free array.
  1900. * @example
  1901. *
  1902. * _.uniq([2, 1, 2]);
  1903. * // => [2, 1]
  1904. */
  1905. function uniq(array) {
  1906. return (array && array.length)
  1907. ? baseUniq(array)
  1908. : [];
  1909. }
  1910. /**
  1911. * Performs a
  1912. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1913. * comparison between two values to determine if they are equivalent.
  1914. *
  1915. * @static
  1916. * @memberOf _
  1917. * @since 4.0.0
  1918. * @category Lang
  1919. * @param {*} value The value to compare.
  1920. * @param {*} other The other value to compare.
  1921. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1922. * @example
  1923. *
  1924. * var object = { 'a': 1 };
  1925. * var other = { 'a': 1 };
  1926. *
  1927. * _.eq(object, object);
  1928. * // => true
  1929. *
  1930. * _.eq(object, other);
  1931. * // => false
  1932. *
  1933. * _.eq('a', 'a');
  1934. * // => true
  1935. *
  1936. * _.eq('a', Object('a'));
  1937. * // => false
  1938. *
  1939. * _.eq(NaN, NaN);
  1940. * // => true
  1941. */
  1942. function eq(value, other) {
  1943. return value === other || (value !== value && other !== other);
  1944. }
  1945. /**
  1946. * Checks if `value` is classified as a `Function` object.
  1947. *
  1948. * @static
  1949. * @memberOf _
  1950. * @since 0.1.0
  1951. * @category Lang
  1952. * @param {*} value The value to check.
  1953. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1954. * @example
  1955. *
  1956. * _.isFunction(_);
  1957. * // => true
  1958. *
  1959. * _.isFunction(/abc/);
  1960. * // => false
  1961. */
  1962. function isFunction(value) {
  1963. // The use of `Object#toString` avoids issues with the `typeof` operator
  1964. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1965. var tag = isObject(value) ? objectToString.call(value) : '';
  1966. return tag == funcTag || tag == genTag;
  1967. }
  1968. /**
  1969. * Checks if `value` is the
  1970. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1971. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1972. *
  1973. * @static
  1974. * @memberOf _
  1975. * @since 0.1.0
  1976. * @category Lang
  1977. * @param {*} value The value to check.
  1978. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1979. * @example
  1980. *
  1981. * _.isObject({});
  1982. * // => true
  1983. *
  1984. * _.isObject([1, 2, 3]);
  1985. * // => true
  1986. *
  1987. * _.isObject(_.noop);
  1988. * // => true
  1989. *
  1990. * _.isObject(null);
  1991. * // => false
  1992. */
  1993. function isObject(value) {
  1994. var type = typeof value;
  1995. return !!value && (type == 'object' || type == 'function');
  1996. }
  1997. /**
  1998. * This method returns `undefined`.
  1999. *
  2000. * @static
  2001. * @memberOf _
  2002. * @since 2.3.0
  2003. * @category Util
  2004. * @example
  2005. *
  2006. * _.times(2, _.noop);
  2007. * // => [undefined, undefined]
  2008. */
  2009. function noop() {
  2010. // No operation performed.
  2011. }
  2012. module.exports = uniq;
  2013. /***/ }),
  2014. /***/ 129:
  2015. /***/ (function(module) {
  2016. module.exports = require("child_process");
  2017. /***/ }),
  2018. /***/ 143:
  2019. /***/ (function(module, __unusedexports, __webpack_require__) {
  2020. module.exports = withAuthorizationPrefix;
  2021. const atob = __webpack_require__(368);
  2022. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2023. function withAuthorizationPrefix(authorization) {
  2024. if (/^(basic|bearer|token) /i.test(authorization)) {
  2025. return authorization;
  2026. }
  2027. try {
  2028. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2029. return `basic ${authorization}`;
  2030. }
  2031. } catch (error) {}
  2032. if (authorization.split(/\./).length === 3) {
  2033. return `bearer ${authorization}`;
  2034. }
  2035. return `token ${authorization}`;
  2036. }
  2037. /***/ }),
  2038. /***/ 145:
  2039. /***/ (function(module, __unusedexports, __webpack_require__) {
  2040. "use strict";
  2041. const pump = __webpack_require__(453);
  2042. const bufferStream = __webpack_require__(966);
  2043. class MaxBufferError extends Error {
  2044. constructor() {
  2045. super('maxBuffer exceeded');
  2046. this.name = 'MaxBufferError';
  2047. }
  2048. }
  2049. function getStream(inputStream, options) {
  2050. if (!inputStream) {
  2051. return Promise.reject(new Error('Expected a stream'));
  2052. }
  2053. options = Object.assign({maxBuffer: Infinity}, options);
  2054. const {maxBuffer} = options;
  2055. let stream;
  2056. return new Promise((resolve, reject) => {
  2057. const rejectPromise = error => {
  2058. if (error) { // A null check
  2059. error.bufferedData = stream.getBufferedValue();
  2060. }
  2061. reject(error);
  2062. };
  2063. stream = pump(inputStream, bufferStream(options), error => {
  2064. if (error) {
  2065. rejectPromise(error);
  2066. return;
  2067. }
  2068. resolve();
  2069. });
  2070. stream.on('data', () => {
  2071. if (stream.getBufferedLength() > maxBuffer) {
  2072. rejectPromise(new MaxBufferError());
  2073. }
  2074. });
  2075. }).then(() => stream.getBufferedValue());
  2076. }
  2077. module.exports = getStream;
  2078. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2079. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2080. module.exports.MaxBufferError = MaxBufferError;
  2081. /***/ }),
  2082. /***/ 148:
  2083. /***/ (function(module, __unusedexports, __webpack_require__) {
  2084. module.exports = paginatePlugin;
  2085. const iterator = __webpack_require__(8);
  2086. const paginate = __webpack_require__(807);
  2087. function paginatePlugin(octokit) {
  2088. octokit.paginate = paginate.bind(null, octokit);
  2089. octokit.paginate.iterator = iterator.bind(null, octokit);
  2090. }
  2091. /***/ }),
  2092. /***/ 168:
  2093. /***/ (function(module) {
  2094. "use strict";
  2095. const alias = ['stdin', 'stdout', 'stderr'];
  2096. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2097. module.exports = opts => {
  2098. if (!opts) {
  2099. return null;
  2100. }
  2101. if (opts.stdio && hasAlias(opts)) {
  2102. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2103. }
  2104. if (typeof opts.stdio === 'string') {
  2105. return opts.stdio;
  2106. }
  2107. const stdio = opts.stdio || [];
  2108. if (!Array.isArray(stdio)) {
  2109. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2110. }
  2111. const result = [];
  2112. const len = Math.max(stdio.length, alias.length);
  2113. for (let i = 0; i < len; i++) {
  2114. let value = null;
  2115. if (stdio[i] !== undefined) {
  2116. value = stdio[i];
  2117. } else if (opts[alias[i]] !== undefined) {
  2118. value = opts[alias[i]];
  2119. }
  2120. result[i] = value;
  2121. }
  2122. return result;
  2123. };
  2124. /***/ }),
  2125. /***/ 190:
  2126. /***/ (function(module, __unusedexports, __webpack_require__) {
  2127. module.exports = authenticationPlugin;
  2128. const beforeRequest = __webpack_require__(863);
  2129. const requestError = __webpack_require__(991);
  2130. const validate = __webpack_require__(954);
  2131. function authenticationPlugin(octokit, options) {
  2132. if (!options.auth) {
  2133. return;
  2134. }
  2135. validate(options.auth);
  2136. const state = {
  2137. octokit,
  2138. auth: options.auth
  2139. };
  2140. octokit.hook.before("request", beforeRequest.bind(null, state));
  2141. octokit.hook.error("request", requestError.bind(null, state));
  2142. }
  2143. /***/ }),
  2144. /***/ 197:
  2145. /***/ (function(module, __unusedexports, __webpack_require__) {
  2146. module.exports = isexe
  2147. isexe.sync = sync
  2148. var fs = __webpack_require__(747)
  2149. function isexe (path, options, cb) {
  2150. fs.stat(path, function (er, stat) {
  2151. cb(er, er ? false : checkStat(stat, options))
  2152. })
  2153. }
  2154. function sync (path, options) {
  2155. return checkStat(fs.statSync(path), options)
  2156. }
  2157. function checkStat (stat, options) {
  2158. return stat.isFile() && checkMode(stat, options)
  2159. }
  2160. function checkMode (stat, options) {
  2161. var mod = stat.mode
  2162. var uid = stat.uid
  2163. var gid = stat.gid
  2164. var myUid = options.uid !== undefined ?
  2165. options.uid : process.getuid && process.getuid()
  2166. var myGid = options.gid !== undefined ?
  2167. options.gid : process.getgid && process.getgid()
  2168. var u = parseInt('100', 8)
  2169. var g = parseInt('010', 8)
  2170. var o = parseInt('001', 8)
  2171. var ug = u | g
  2172. var ret = (mod & o) ||
  2173. (mod & g) && gid === myGid ||
  2174. (mod & u) && uid === myUid ||
  2175. (mod & ug) && myUid === 0
  2176. return ret
  2177. }
  2178. /***/ }),
  2179. /***/ 198:
  2180. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2181. "use strict";
  2182. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2183. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2184. return new (P || (P = Promise))(function (resolve, reject) {
  2185. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2186. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2187. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2188. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2189. });
  2190. };
  2191. var __importStar = (this && this.__importStar) || function (mod) {
  2192. if (mod && mod.__esModule) return mod;
  2193. var result = {};
  2194. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2195. result["default"] = mod;
  2196. return result;
  2197. };
  2198. Object.defineProperty(exports, "__esModule", { value: true });
  2199. const core = __importStar(__webpack_require__(470));
  2200. const coreCommand = __importStar(__webpack_require__(431));
  2201. const gitSourceProvider = __importStar(__webpack_require__(293));
  2202. const inputHelper = __importStar(__webpack_require__(821));
  2203. const path = __importStar(__webpack_require__(622));
  2204. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2205. function run() {
  2206. return __awaiter(this, void 0, void 0, function* () {
  2207. try {
  2208. const sourceSettings = inputHelper.getInputs();
  2209. try {
  2210. // Register problem matcher
  2211. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2212. // Get sources
  2213. yield gitSourceProvider.getSource(sourceSettings);
  2214. }
  2215. finally {
  2216. // Unregister problem matcher
  2217. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2218. }
  2219. }
  2220. catch (error) {
  2221. core.setFailed(error.message);
  2222. }
  2223. });
  2224. }
  2225. function cleanup() {
  2226. return __awaiter(this, void 0, void 0, function* () {
  2227. try {
  2228. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2229. }
  2230. catch (error) {
  2231. core.warning(error.message);
  2232. }
  2233. });
  2234. }
  2235. // Main
  2236. if (!cleanupRepositoryPath) {
  2237. run();
  2238. }
  2239. // Post
  2240. else {
  2241. cleanup();
  2242. }
  2243. /***/ }),
  2244. /***/ 211:
  2245. /***/ (function(module) {
  2246. module.exports = require("https");
  2247. /***/ }),
  2248. /***/ 215:
  2249. /***/ (function(module) {
  2250. module.exports = {"name":"@octokit/rest","version":"16.35.0","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^12.0.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.0.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^2.1.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^3.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^14.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^15.0.0","sinon":"^7.2.4","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.35.0.tgz","_integrity":"sha512-9ShFqYWo0CLoGYhA1FdtdykJuMzS/9H6vSbbQWDX4pWr4p9v+15MsH/wpd/3fIU+tSxylaNO48+PIHqOkBRx3w==","_from":"@octokit/rest@16.35.0"};
  2251. /***/ }),
  2252. /***/ 227:
  2253. /***/ (function(__unusedmodule, exports) {
  2254. "use strict";
  2255. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2256. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2257. return new (P || (P = Promise))(function (resolve, reject) {
  2258. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2259. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2260. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2261. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2262. });
  2263. };
  2264. Object.defineProperty(exports, "__esModule", { value: true });
  2265. function getCheckoutInfo(git, ref, commit) {
  2266. return __awaiter(this, void 0, void 0, function* () {
  2267. if (!git) {
  2268. throw new Error('Arg git cannot be empty');
  2269. }
  2270. if (!ref && !commit) {
  2271. throw new Error('Args ref and commit cannot both be empty');
  2272. }
  2273. const result = {};
  2274. const upperRef = (ref || '').toUpperCase();
  2275. // SHA only
  2276. if (!ref) {
  2277. result.ref = commit;
  2278. }
  2279. // refs/heads/
  2280. else if (upperRef.startsWith('REFS/HEADS/')) {
  2281. const branch = ref.substring('refs/heads/'.length);
  2282. result.ref = branch;
  2283. result.startPoint = `refs/remotes/origin/${branch}`;
  2284. }
  2285. // refs/pull/
  2286. else if (upperRef.startsWith('REFS/PULL/')) {
  2287. const branch = ref.substring('refs/pull/'.length);
  2288. result.ref = `refs/remotes/pull/${branch}`;
  2289. }
  2290. // refs/tags/
  2291. else if (upperRef.startsWith('REFS/')) {
  2292. result.ref = ref;
  2293. }
  2294. // Unqualified ref, check for a matching branch or tag
  2295. else {
  2296. if (yield git.branchExists(true, `origin/${ref}`)) {
  2297. result.ref = ref;
  2298. result.startPoint = `refs/remotes/origin/${ref}`;
  2299. }
  2300. else if (yield git.tagExists(`${ref}`)) {
  2301. result.ref = `refs/tags/${ref}`;
  2302. }
  2303. else {
  2304. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2305. }
  2306. }
  2307. return result;
  2308. });
  2309. }
  2310. exports.getCheckoutInfo = getCheckoutInfo;
  2311. function getRefSpec(ref, commit) {
  2312. if (!ref && !commit) {
  2313. throw new Error('Args ref and commit cannot both be empty');
  2314. }
  2315. const upperRef = (ref || '').toUpperCase();
  2316. // SHA
  2317. if (commit) {
  2318. // refs/heads
  2319. if (upperRef.startsWith('REFS/HEADS/')) {
  2320. const branch = ref.substring('refs/heads/'.length);
  2321. return [`+${commit}:refs/remotes/origin/${branch}`];
  2322. }
  2323. // refs/pull/
  2324. else if (upperRef.startsWith('REFS/PULL/')) {
  2325. const branch = ref.substring('refs/pull/'.length);
  2326. return [`+${commit}:refs/remotes/pull/${branch}`];
  2327. }
  2328. // refs/tags/
  2329. else if (upperRef.startsWith('REFS/TAGS/')) {
  2330. return [`+${commit}:${ref}`];
  2331. }
  2332. // Otherwise no destination ref
  2333. else {
  2334. return [commit];
  2335. }
  2336. }
  2337. // Unqualified ref, check for a matching branch or tag
  2338. else if (!upperRef.startsWith('REFS/')) {
  2339. return [
  2340. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2341. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2342. ];
  2343. }
  2344. // refs/heads/
  2345. else if (upperRef.startsWith('REFS/HEADS/')) {
  2346. const branch = ref.substring('refs/heads/'.length);
  2347. return [`+${ref}:refs/remotes/origin/${branch}`];
  2348. }
  2349. // refs/pull/
  2350. else if (upperRef.startsWith('REFS/PULL/')) {
  2351. const branch = ref.substring('refs/pull/'.length);
  2352. return [`+${ref}:refs/remotes/pull/${branch}`];
  2353. }
  2354. // refs/tags/
  2355. else {
  2356. return [`+${ref}:${ref}`];
  2357. }
  2358. }
  2359. exports.getRefSpec = getRefSpec;
  2360. /***/ }),
  2361. /***/ 248:
  2362. /***/ (function(module, __unusedexports, __webpack_require__) {
  2363. module.exports = octokitRegisterEndpoints;
  2364. const registerEndpoints = __webpack_require__(899);
  2365. function octokitRegisterEndpoints(octokit) {
  2366. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2367. }
  2368. /***/ }),
  2369. /***/ 260:
  2370. /***/ (function(module, __unusedexports, __webpack_require__) {
  2371. // Note: since nyc uses this module to output coverage, any lines
  2372. // that are in the direct sync flow of nyc's outputCoverage are
  2373. // ignored, since we can never get coverage for them.
  2374. var assert = __webpack_require__(357)
  2375. var signals = __webpack_require__(654)
  2376. var EE = __webpack_require__(614)
  2377. /* istanbul ignore if */
  2378. if (typeof EE !== 'function') {
  2379. EE = EE.EventEmitter
  2380. }
  2381. var emitter
  2382. if (process.__signal_exit_emitter__) {
  2383. emitter = process.__signal_exit_emitter__
  2384. } else {
  2385. emitter = process.__signal_exit_emitter__ = new EE()
  2386. emitter.count = 0
  2387. emitter.emitted = {}
  2388. }
  2389. // Because this emitter is a global, we have to check to see if a
  2390. // previous version of this library failed to enable infinite listeners.
  2391. // I know what you're about to say. But literally everything about
  2392. // signal-exit is a compromise with evil. Get used to it.
  2393. if (!emitter.infinite) {
  2394. emitter.setMaxListeners(Infinity)
  2395. emitter.infinite = true
  2396. }
  2397. module.exports = function (cb, opts) {
  2398. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2399. if (loaded === false) {
  2400. load()
  2401. }
  2402. var ev = 'exit'
  2403. if (opts && opts.alwaysLast) {
  2404. ev = 'afterexit'
  2405. }
  2406. var remove = function () {
  2407. emitter.removeListener(ev, cb)
  2408. if (emitter.listeners('exit').length === 0 &&
  2409. emitter.listeners('afterexit').length === 0) {
  2410. unload()
  2411. }
  2412. }
  2413. emitter.on(ev, cb)
  2414. return remove
  2415. }
  2416. module.exports.unload = unload
  2417. function unload () {
  2418. if (!loaded) {
  2419. return
  2420. }
  2421. loaded = false
  2422. signals.forEach(function (sig) {
  2423. try {
  2424. process.removeListener(sig, sigListeners[sig])
  2425. } catch (er) {}
  2426. })
  2427. process.emit = originalProcessEmit
  2428. process.reallyExit = originalProcessReallyExit
  2429. emitter.count -= 1
  2430. }
  2431. function emit (event, code, signal) {
  2432. if (emitter.emitted[event]) {
  2433. return
  2434. }
  2435. emitter.emitted[event] = true
  2436. emitter.emit(event, code, signal)
  2437. }
  2438. // { <signal>: <listener fn>, ... }
  2439. var sigListeners = {}
  2440. signals.forEach(function (sig) {
  2441. sigListeners[sig] = function listener () {
  2442. // If there are no other listeners, an exit is coming!
  2443. // Simplest way: remove us and then re-send the signal.
  2444. // We know that this will kill the process, so we can
  2445. // safely emit now.
  2446. var listeners = process.listeners(sig)
  2447. if (listeners.length === emitter.count) {
  2448. unload()
  2449. emit('exit', null, sig)
  2450. /* istanbul ignore next */
  2451. emit('afterexit', null, sig)
  2452. /* istanbul ignore next */
  2453. process.kill(process.pid, sig)
  2454. }
  2455. }
  2456. })
  2457. module.exports.signals = function () {
  2458. return signals
  2459. }
  2460. module.exports.load = load
  2461. var loaded = false
  2462. function load () {
  2463. if (loaded) {
  2464. return
  2465. }
  2466. loaded = true
  2467. // This is the number of onSignalExit's that are in play.
  2468. // It's important so that we can count the correct number of
  2469. // listeners on signals, and don't wait for the other one to
  2470. // handle it instead of us.
  2471. emitter.count += 1
  2472. signals = signals.filter(function (sig) {
  2473. try {
  2474. process.on(sig, sigListeners[sig])
  2475. return true
  2476. } catch (er) {
  2477. return false
  2478. }
  2479. })
  2480. process.emit = processEmit
  2481. process.reallyExit = processReallyExit
  2482. }
  2483. var originalProcessReallyExit = process.reallyExit
  2484. function processReallyExit (code) {
  2485. process.exitCode = code || 0
  2486. emit('exit', process.exitCode, null)
  2487. /* istanbul ignore next */
  2488. emit('afterexit', process.exitCode, null)
  2489. /* istanbul ignore next */
  2490. originalProcessReallyExit.call(process, process.exitCode)
  2491. }
  2492. var originalProcessEmit = process.emit
  2493. function processEmit (ev, arg) {
  2494. if (ev === 'exit') {
  2495. if (arg !== undefined) {
  2496. process.exitCode = arg
  2497. }
  2498. var ret = originalProcessEmit.apply(this, arguments)
  2499. emit('exit', process.exitCode, null)
  2500. /* istanbul ignore next */
  2501. emit('afterexit', process.exitCode, null)
  2502. return ret
  2503. } else {
  2504. return originalProcessEmit.apply(this, arguments)
  2505. }
  2506. }
  2507. /***/ }),
  2508. /***/ 262:
  2509. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2510. "use strict";
  2511. Object.defineProperty(exports, "__esModule", { value: true });
  2512. const fs_1 = __webpack_require__(747);
  2513. const os_1 = __webpack_require__(87);
  2514. class Context {
  2515. /**
  2516. * Hydrate the context from the environment
  2517. */
  2518. constructor() {
  2519. this.payload = {};
  2520. if (process.env.GITHUB_EVENT_PATH) {
  2521. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2522. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2523. }
  2524. else {
  2525. const path = process.env.GITHUB_EVENT_PATH;
  2526. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  2527. }
  2528. }
  2529. this.eventName = process.env.GITHUB_EVENT_NAME;
  2530. this.sha = process.env.GITHUB_SHA;
  2531. this.ref = process.env.GITHUB_REF;
  2532. this.workflow = process.env.GITHUB_WORKFLOW;
  2533. this.action = process.env.GITHUB_ACTION;
  2534. this.actor = process.env.GITHUB_ACTOR;
  2535. }
  2536. get issue() {
  2537. const payload = this.payload;
  2538. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2539. }
  2540. get repo() {
  2541. if (process.env.GITHUB_REPOSITORY) {
  2542. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2543. return { owner, repo };
  2544. }
  2545. if (this.payload.repository) {
  2546. return {
  2547. owner: this.payload.repository.owner.login,
  2548. repo: this.payload.repository.name
  2549. };
  2550. }
  2551. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2552. }
  2553. }
  2554. exports.Context = Context;
  2555. //# sourceMappingURL=context.js.map
  2556. /***/ }),
  2557. /***/ 265:
  2558. /***/ (function(module, __unusedexports, __webpack_require__) {
  2559. module.exports = getPage
  2560. const deprecate = __webpack_require__(370)
  2561. const getPageLinks = __webpack_require__(577)
  2562. const HttpError = __webpack_require__(297)
  2563. function getPage (octokit, link, which, headers) {
  2564. 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.`)
  2565. const url = getPageLinks(link)[which]
  2566. if (!url) {
  2567. const urlError = new HttpError(`No ${which} page found`, 404)
  2568. return Promise.reject(urlError)
  2569. }
  2570. const requestOptions = {
  2571. url,
  2572. headers: applyAcceptHeader(link, headers)
  2573. }
  2574. const promise = octokit.request(requestOptions)
  2575. return promise
  2576. }
  2577. function applyAcceptHeader (res, headers) {
  2578. const previous = res.headers && res.headers['x-github-media-type']
  2579. if (!previous || (headers && headers.accept)) {
  2580. return headers
  2581. }
  2582. headers = headers || {}
  2583. headers.accept = 'application/vnd.' + previous
  2584. .replace('; param=', '.')
  2585. .replace('; format=', '+')
  2586. return headers
  2587. }
  2588. /***/ }),
  2589. /***/ 280:
  2590. /***/ (function(module, exports) {
  2591. exports = module.exports = SemVer
  2592. var debug
  2593. /* istanbul ignore next */
  2594. if (typeof process === 'object' &&
  2595. process.env &&
  2596. process.env.NODE_DEBUG &&
  2597. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2598. debug = function () {
  2599. var args = Array.prototype.slice.call(arguments, 0)
  2600. args.unshift('SEMVER')
  2601. console.log.apply(console, args)
  2602. }
  2603. } else {
  2604. debug = function () {}
  2605. }
  2606. // Note: this is the semver.org version of the spec that it implements
  2607. // Not necessarily the package version of this code.
  2608. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2609. var MAX_LENGTH = 256
  2610. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2611. /* istanbul ignore next */ 9007199254740991
  2612. // Max safe segment length for coercion.
  2613. var MAX_SAFE_COMPONENT_LENGTH = 16
  2614. // The actual regexps go on exports.re
  2615. var re = exports.re = []
  2616. var src = exports.src = []
  2617. var R = 0
  2618. // The following Regular Expressions can be used for tokenizing,
  2619. // validating, and parsing SemVer version strings.
  2620. // ## Numeric Identifier
  2621. // A single `0`, or a non-zero digit followed by zero or more digits.
  2622. var NUMERICIDENTIFIER = R++
  2623. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2624. var NUMERICIDENTIFIERLOOSE = R++
  2625. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2626. // ## Non-numeric Identifier
  2627. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2628. // more letters, digits, or hyphens.
  2629. var NONNUMERICIDENTIFIER = R++
  2630. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2631. // ## Main Version
  2632. // Three dot-separated numeric identifiers.
  2633. var MAINVERSION = R++
  2634. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2635. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2636. '(' + src[NUMERICIDENTIFIER] + ')'
  2637. var MAINVERSIONLOOSE = R++
  2638. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2639. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2640. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2641. // ## Pre-release Version Identifier
  2642. // A numeric identifier, or a non-numeric identifier.
  2643. var PRERELEASEIDENTIFIER = R++
  2644. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2645. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2646. var PRERELEASEIDENTIFIERLOOSE = R++
  2647. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2648. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2649. // ## Pre-release Version
  2650. // Hyphen, followed by one or more dot-separated pre-release version
  2651. // identifiers.
  2652. var PRERELEASE = R++
  2653. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2654. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2655. var PRERELEASELOOSE = R++
  2656. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2657. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2658. // ## Build Metadata Identifier
  2659. // Any combination of digits, letters, or hyphens.
  2660. var BUILDIDENTIFIER = R++
  2661. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2662. // ## Build Metadata
  2663. // Plus sign, followed by one or more period-separated build metadata
  2664. // identifiers.
  2665. var BUILD = R++
  2666. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2667. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2668. // ## Full Version String
  2669. // A main version, followed optionally by a pre-release version and
  2670. // build metadata.
  2671. // Note that the only major, minor, patch, and pre-release sections of
  2672. // the version string are capturing groups. The build metadata is not a
  2673. // capturing group, because it should not ever be used in version
  2674. // comparison.
  2675. var FULL = R++
  2676. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2677. src[PRERELEASE] + '?' +
  2678. src[BUILD] + '?'
  2679. src[FULL] = '^' + FULLPLAIN + '$'
  2680. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2681. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2682. // common in the npm registry.
  2683. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2684. src[PRERELEASELOOSE] + '?' +
  2685. src[BUILD] + '?'
  2686. var LOOSE = R++
  2687. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2688. var GTLT = R++
  2689. src[GTLT] = '((?:<|>)?=?)'
  2690. // Something like "2.*" or "1.2.x".
  2691. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2692. // Only the first item is strictly required.
  2693. var XRANGEIDENTIFIERLOOSE = R++
  2694. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2695. var XRANGEIDENTIFIER = R++
  2696. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2697. var XRANGEPLAIN = R++
  2698. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2699. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2700. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2701. '(?:' + src[PRERELEASE] + ')?' +
  2702. src[BUILD] + '?' +
  2703. ')?)?'
  2704. var XRANGEPLAINLOOSE = R++
  2705. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2706. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2707. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2708. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2709. src[BUILD] + '?' +
  2710. ')?)?'
  2711. var XRANGE = R++
  2712. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2713. var XRANGELOOSE = R++
  2714. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2715. // Coercion.
  2716. // Extract anything that could conceivably be a part of a valid semver
  2717. var COERCE = R++
  2718. src[COERCE] = '(?:^|[^\\d])' +
  2719. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2720. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2721. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2722. '(?:$|[^\\d])'
  2723. // Tilde ranges.
  2724. // Meaning is "reasonably at or greater than"
  2725. var LONETILDE = R++
  2726. src[LONETILDE] = '(?:~>?)'
  2727. var TILDETRIM = R++
  2728. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2729. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2730. var tildeTrimReplace = '$1~'
  2731. var TILDE = R++
  2732. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2733. var TILDELOOSE = R++
  2734. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2735. // Caret ranges.
  2736. // Meaning is "at least and backwards compatible with"
  2737. var LONECARET = R++
  2738. src[LONECARET] = '(?:\\^)'
  2739. var CARETTRIM = R++
  2740. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2741. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2742. var caretTrimReplace = '$1^'
  2743. var CARET = R++
  2744. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2745. var CARETLOOSE = R++
  2746. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2747. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2748. var COMPARATORLOOSE = R++
  2749. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2750. var COMPARATOR = R++
  2751. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2752. // An expression to strip any whitespace between the gtlt and the thing
  2753. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2754. var COMPARATORTRIM = R++
  2755. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2756. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2757. // this one has to use the /g flag
  2758. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2759. var comparatorTrimReplace = '$1$2$3'
  2760. // Something like `1.2.3 - 1.2.4`
  2761. // Note that these all use the loose form, because they'll be
  2762. // checked against either the strict or loose comparator form
  2763. // later.
  2764. var HYPHENRANGE = R++
  2765. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  2766. '\\s+-\\s+' +
  2767. '(' + src[XRANGEPLAIN] + ')' +
  2768. '\\s*$'
  2769. var HYPHENRANGELOOSE = R++
  2770. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  2771. '\\s+-\\s+' +
  2772. '(' + src[XRANGEPLAINLOOSE] + ')' +
  2773. '\\s*$'
  2774. // Star ranges basically just allow anything at all.
  2775. var STAR = R++
  2776. src[STAR] = '(<|>)?=?\\s*\\*'
  2777. // Compile to actual regexp objects.
  2778. // All are flag-free, unless they were created above with a flag.
  2779. for (var i = 0; i < R; i++) {
  2780. debug(i, src[i])
  2781. if (!re[i]) {
  2782. re[i] = new RegExp(src[i])
  2783. }
  2784. }
  2785. exports.parse = parse
  2786. function parse (version, options) {
  2787. if (!options || typeof options !== 'object') {
  2788. options = {
  2789. loose: !!options,
  2790. includePrerelease: false
  2791. }
  2792. }
  2793. if (version instanceof SemVer) {
  2794. return version
  2795. }
  2796. if (typeof version !== 'string') {
  2797. return null
  2798. }
  2799. if (version.length > MAX_LENGTH) {
  2800. return null
  2801. }
  2802. var r = options.loose ? re[LOOSE] : re[FULL]
  2803. if (!r.test(version)) {
  2804. return null
  2805. }
  2806. try {
  2807. return new SemVer(version, options)
  2808. } catch (er) {
  2809. return null
  2810. }
  2811. }
  2812. exports.valid = valid
  2813. function valid (version, options) {
  2814. var v = parse(version, options)
  2815. return v ? v.version : null
  2816. }
  2817. exports.clean = clean
  2818. function clean (version, options) {
  2819. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  2820. return s ? s.version : null
  2821. }
  2822. exports.SemVer = SemVer
  2823. function SemVer (version, options) {
  2824. if (!options || typeof options !== 'object') {
  2825. options = {
  2826. loose: !!options,
  2827. includePrerelease: false
  2828. }
  2829. }
  2830. if (version instanceof SemVer) {
  2831. if (version.loose === options.loose) {
  2832. return version
  2833. } else {
  2834. version = version.version
  2835. }
  2836. } else if (typeof version !== 'string') {
  2837. throw new TypeError('Invalid Version: ' + version)
  2838. }
  2839. if (version.length > MAX_LENGTH) {
  2840. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  2841. }
  2842. if (!(this instanceof SemVer)) {
  2843. return new SemVer(version, options)
  2844. }
  2845. debug('SemVer', version, options)
  2846. this.options = options
  2847. this.loose = !!options.loose
  2848. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  2849. if (!m) {
  2850. throw new TypeError('Invalid Version: ' + version)
  2851. }
  2852. this.raw = version
  2853. // these are actually numbers
  2854. this.major = +m[1]
  2855. this.minor = +m[2]
  2856. this.patch = +m[3]
  2857. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  2858. throw new TypeError('Invalid major version')
  2859. }
  2860. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  2861. throw new TypeError('Invalid minor version')
  2862. }
  2863. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  2864. throw new TypeError('Invalid patch version')
  2865. }
  2866. // numberify any prerelease numeric ids
  2867. if (!m[4]) {
  2868. this.prerelease = []
  2869. } else {
  2870. this.prerelease = m[4].split('.').map(function (id) {
  2871. if (/^[0-9]+$/.test(id)) {
  2872. var num = +id
  2873. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  2874. return num
  2875. }
  2876. }
  2877. return id
  2878. })
  2879. }
  2880. this.build = m[5] ? m[5].split('.') : []
  2881. this.format()
  2882. }
  2883. SemVer.prototype.format = function () {
  2884. this.version = this.major + '.' + this.minor + '.' + this.patch
  2885. if (this.prerelease.length) {
  2886. this.version += '-' + this.prerelease.join('.')
  2887. }
  2888. return this.version
  2889. }
  2890. SemVer.prototype.toString = function () {
  2891. return this.version
  2892. }
  2893. SemVer.prototype.compare = function (other) {
  2894. debug('SemVer.compare', this.version, this.options, other)
  2895. if (!(other instanceof SemVer)) {
  2896. other = new SemVer(other, this.options)
  2897. }
  2898. return this.compareMain(other) || this.comparePre(other)
  2899. }
  2900. SemVer.prototype.compareMain = function (other) {
  2901. if (!(other instanceof SemVer)) {
  2902. other = new SemVer(other, this.options)
  2903. }
  2904. return compareIdentifiers(this.major, other.major) ||
  2905. compareIdentifiers(this.minor, other.minor) ||
  2906. compareIdentifiers(this.patch, other.patch)
  2907. }
  2908. SemVer.prototype.comparePre = function (other) {
  2909. if (!(other instanceof SemVer)) {
  2910. other = new SemVer(other, this.options)
  2911. }
  2912. // NOT having a prerelease is > having one
  2913. if (this.prerelease.length && !other.prerelease.length) {
  2914. return -1
  2915. } else if (!this.prerelease.length && other.prerelease.length) {
  2916. return 1
  2917. } else if (!this.prerelease.length && !other.prerelease.length) {
  2918. return 0
  2919. }
  2920. var i = 0
  2921. do {
  2922. var a = this.prerelease[i]
  2923. var b = other.prerelease[i]
  2924. debug('prerelease compare', i, a, b)
  2925. if (a === undefined && b === undefined) {
  2926. return 0
  2927. } else if (b === undefined) {
  2928. return 1
  2929. } else if (a === undefined) {
  2930. return -1
  2931. } else if (a === b) {
  2932. continue
  2933. } else {
  2934. return compareIdentifiers(a, b)
  2935. }
  2936. } while (++i)
  2937. }
  2938. // preminor will bump the version up to the next minor release, and immediately
  2939. // down to pre-release. premajor and prepatch work the same way.
  2940. SemVer.prototype.inc = function (release, identifier) {
  2941. switch (release) {
  2942. case 'premajor':
  2943. this.prerelease.length = 0
  2944. this.patch = 0
  2945. this.minor = 0
  2946. this.major++
  2947. this.inc('pre', identifier)
  2948. break
  2949. case 'preminor':
  2950. this.prerelease.length = 0
  2951. this.patch = 0
  2952. this.minor++
  2953. this.inc('pre', identifier)
  2954. break
  2955. case 'prepatch':
  2956. // If this is already a prerelease, it will bump to the next version
  2957. // drop any prereleases that might already exist, since they are not
  2958. // relevant at this point.
  2959. this.prerelease.length = 0
  2960. this.inc('patch', identifier)
  2961. this.inc('pre', identifier)
  2962. break
  2963. // If the input is a non-prerelease version, this acts the same as
  2964. // prepatch.
  2965. case 'prerelease':
  2966. if (this.prerelease.length === 0) {
  2967. this.inc('patch', identifier)
  2968. }
  2969. this.inc('pre', identifier)
  2970. break
  2971. case 'major':
  2972. // If this is a pre-major version, bump up to the same major version.
  2973. // Otherwise increment major.
  2974. // 1.0.0-5 bumps to 1.0.0
  2975. // 1.1.0 bumps to 2.0.0
  2976. if (this.minor !== 0 ||
  2977. this.patch !== 0 ||
  2978. this.prerelease.length === 0) {
  2979. this.major++
  2980. }
  2981. this.minor = 0
  2982. this.patch = 0
  2983. this.prerelease = []
  2984. break
  2985. case 'minor':
  2986. // If this is a pre-minor version, bump up to the same minor version.
  2987. // Otherwise increment minor.
  2988. // 1.2.0-5 bumps to 1.2.0
  2989. // 1.2.1 bumps to 1.3.0
  2990. if (this.patch !== 0 || this.prerelease.length === 0) {
  2991. this.minor++
  2992. }
  2993. this.patch = 0
  2994. this.prerelease = []
  2995. break
  2996. case 'patch':
  2997. // If this is not a pre-release version, it will increment the patch.
  2998. // If it is a pre-release it will bump up to the same patch version.
  2999. // 1.2.0-5 patches to 1.2.0
  3000. // 1.2.0 patches to 1.2.1
  3001. if (this.prerelease.length === 0) {
  3002. this.patch++
  3003. }
  3004. this.prerelease = []
  3005. break
  3006. // This probably shouldn't be used publicly.
  3007. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3008. case 'pre':
  3009. if (this.prerelease.length === 0) {
  3010. this.prerelease = [0]
  3011. } else {
  3012. var i = this.prerelease.length
  3013. while (--i >= 0) {
  3014. if (typeof this.prerelease[i] === 'number') {
  3015. this.prerelease[i]++
  3016. i = -2
  3017. }
  3018. }
  3019. if (i === -1) {
  3020. // didn't increment anything
  3021. this.prerelease.push(0)
  3022. }
  3023. }
  3024. if (identifier) {
  3025. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3026. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3027. if (this.prerelease[0] === identifier) {
  3028. if (isNaN(this.prerelease[1])) {
  3029. this.prerelease = [identifier, 0]
  3030. }
  3031. } else {
  3032. this.prerelease = [identifier, 0]
  3033. }
  3034. }
  3035. break
  3036. default:
  3037. throw new Error('invalid increment argument: ' + release)
  3038. }
  3039. this.format()
  3040. this.raw = this.version
  3041. return this
  3042. }
  3043. exports.inc = inc
  3044. function inc (version, release, loose, identifier) {
  3045. if (typeof (loose) === 'string') {
  3046. identifier = loose
  3047. loose = undefined
  3048. }
  3049. try {
  3050. return new SemVer(version, loose).inc(release, identifier).version
  3051. } catch (er) {
  3052. return null
  3053. }
  3054. }
  3055. exports.diff = diff
  3056. function diff (version1, version2) {
  3057. if (eq(version1, version2)) {
  3058. return null
  3059. } else {
  3060. var v1 = parse(version1)
  3061. var v2 = parse(version2)
  3062. var prefix = ''
  3063. if (v1.prerelease.length || v2.prerelease.length) {
  3064. prefix = 'pre'
  3065. var defaultResult = 'prerelease'
  3066. }
  3067. for (var key in v1) {
  3068. if (key === 'major' || key === 'minor' || key === 'patch') {
  3069. if (v1[key] !== v2[key]) {
  3070. return prefix + key
  3071. }
  3072. }
  3073. }
  3074. return defaultResult // may be undefined
  3075. }
  3076. }
  3077. exports.compareIdentifiers = compareIdentifiers
  3078. var numeric = /^[0-9]+$/
  3079. function compareIdentifiers (a, b) {
  3080. var anum = numeric.test(a)
  3081. var bnum = numeric.test(b)
  3082. if (anum && bnum) {
  3083. a = +a
  3084. b = +b
  3085. }
  3086. return a === b ? 0
  3087. : (anum && !bnum) ? -1
  3088. : (bnum && !anum) ? 1
  3089. : a < b ? -1
  3090. : 1
  3091. }
  3092. exports.rcompareIdentifiers = rcompareIdentifiers
  3093. function rcompareIdentifiers (a, b) {
  3094. return compareIdentifiers(b, a)
  3095. }
  3096. exports.major = major
  3097. function major (a, loose) {
  3098. return new SemVer(a, loose).major
  3099. }
  3100. exports.minor = minor
  3101. function minor (a, loose) {
  3102. return new SemVer(a, loose).minor
  3103. }
  3104. exports.patch = patch
  3105. function patch (a, loose) {
  3106. return new SemVer(a, loose).patch
  3107. }
  3108. exports.compare = compare
  3109. function compare (a, b, loose) {
  3110. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3111. }
  3112. exports.compareLoose = compareLoose
  3113. function compareLoose (a, b) {
  3114. return compare(a, b, true)
  3115. }
  3116. exports.rcompare = rcompare
  3117. function rcompare (a, b, loose) {
  3118. return compare(b, a, loose)
  3119. }
  3120. exports.sort = sort
  3121. function sort (list, loose) {
  3122. return list.sort(function (a, b) {
  3123. return exports.compare(a, b, loose)
  3124. })
  3125. }
  3126. exports.rsort = rsort
  3127. function rsort (list, loose) {
  3128. return list.sort(function (a, b) {
  3129. return exports.rcompare(a, b, loose)
  3130. })
  3131. }
  3132. exports.gt = gt
  3133. function gt (a, b, loose) {
  3134. return compare(a, b, loose) > 0
  3135. }
  3136. exports.lt = lt
  3137. function lt (a, b, loose) {
  3138. return compare(a, b, loose) < 0
  3139. }
  3140. exports.eq = eq
  3141. function eq (a, b, loose) {
  3142. return compare(a, b, loose) === 0
  3143. }
  3144. exports.neq = neq
  3145. function neq (a, b, loose) {
  3146. return compare(a, b, loose) !== 0
  3147. }
  3148. exports.gte = gte
  3149. function gte (a, b, loose) {
  3150. return compare(a, b, loose) >= 0
  3151. }
  3152. exports.lte = lte
  3153. function lte (a, b, loose) {
  3154. return compare(a, b, loose) <= 0
  3155. }
  3156. exports.cmp = cmp
  3157. function cmp (a, op, b, loose) {
  3158. switch (op) {
  3159. case '===':
  3160. if (typeof a === 'object')
  3161. a = a.version
  3162. if (typeof b === 'object')
  3163. b = b.version
  3164. return a === b
  3165. case '!==':
  3166. if (typeof a === 'object')
  3167. a = a.version
  3168. if (typeof b === 'object')
  3169. b = b.version
  3170. return a !== b
  3171. case '':
  3172. case '=':
  3173. case '==':
  3174. return eq(a, b, loose)
  3175. case '!=':
  3176. return neq(a, b, loose)
  3177. case '>':
  3178. return gt(a, b, loose)
  3179. case '>=':
  3180. return gte(a, b, loose)
  3181. case '<':
  3182. return lt(a, b, loose)
  3183. case '<=':
  3184. return lte(a, b, loose)
  3185. default:
  3186. throw new TypeError('Invalid operator: ' + op)
  3187. }
  3188. }
  3189. exports.Comparator = Comparator
  3190. function Comparator (comp, options) {
  3191. if (!options || typeof options !== 'object') {
  3192. options = {
  3193. loose: !!options,
  3194. includePrerelease: false
  3195. }
  3196. }
  3197. if (comp instanceof Comparator) {
  3198. if (comp.loose === !!options.loose) {
  3199. return comp
  3200. } else {
  3201. comp = comp.value
  3202. }
  3203. }
  3204. if (!(this instanceof Comparator)) {
  3205. return new Comparator(comp, options)
  3206. }
  3207. debug('comparator', comp, options)
  3208. this.options = options
  3209. this.loose = !!options.loose
  3210. this.parse(comp)
  3211. if (this.semver === ANY) {
  3212. this.value = ''
  3213. } else {
  3214. this.value = this.operator + this.semver.version
  3215. }
  3216. debug('comp', this)
  3217. }
  3218. var ANY = {}
  3219. Comparator.prototype.parse = function (comp) {
  3220. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3221. var m = comp.match(r)
  3222. if (!m) {
  3223. throw new TypeError('Invalid comparator: ' + comp)
  3224. }
  3225. this.operator = m[1]
  3226. if (this.operator === '=') {
  3227. this.operator = ''
  3228. }
  3229. // if it literally is just '>' or '' then allow anything.
  3230. if (!m[2]) {
  3231. this.semver = ANY
  3232. } else {
  3233. this.semver = new SemVer(m[2], this.options.loose)
  3234. }
  3235. }
  3236. Comparator.prototype.toString = function () {
  3237. return this.value
  3238. }
  3239. Comparator.prototype.test = function (version) {
  3240. debug('Comparator.test', version, this.options.loose)
  3241. if (this.semver === ANY) {
  3242. return true
  3243. }
  3244. if (typeof version === 'string') {
  3245. version = new SemVer(version, this.options)
  3246. }
  3247. return cmp(version, this.operator, this.semver, this.options)
  3248. }
  3249. Comparator.prototype.intersects = function (comp, options) {
  3250. if (!(comp instanceof Comparator)) {
  3251. throw new TypeError('a Comparator is required')
  3252. }
  3253. if (!options || typeof options !== 'object') {
  3254. options = {
  3255. loose: !!options,
  3256. includePrerelease: false
  3257. }
  3258. }
  3259. var rangeTmp
  3260. if (this.operator === '') {
  3261. rangeTmp = new Range(comp.value, options)
  3262. return satisfies(this.value, rangeTmp, options)
  3263. } else if (comp.operator === '') {
  3264. rangeTmp = new Range(this.value, options)
  3265. return satisfies(comp.semver, rangeTmp, options)
  3266. }
  3267. var sameDirectionIncreasing =
  3268. (this.operator === '>=' || this.operator === '>') &&
  3269. (comp.operator === '>=' || comp.operator === '>')
  3270. var sameDirectionDecreasing =
  3271. (this.operator === '<=' || this.operator === '<') &&
  3272. (comp.operator === '<=' || comp.operator === '<')
  3273. var sameSemVer = this.semver.version === comp.semver.version
  3274. var differentDirectionsInclusive =
  3275. (this.operator === '>=' || this.operator === '<=') &&
  3276. (comp.operator === '>=' || comp.operator === '<=')
  3277. var oppositeDirectionsLessThan =
  3278. cmp(this.semver, '<', comp.semver, options) &&
  3279. ((this.operator === '>=' || this.operator === '>') &&
  3280. (comp.operator === '<=' || comp.operator === '<'))
  3281. var oppositeDirectionsGreaterThan =
  3282. cmp(this.semver, '>', comp.semver, options) &&
  3283. ((this.operator === '<=' || this.operator === '<') &&
  3284. (comp.operator === '>=' || comp.operator === '>'))
  3285. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3286. (sameSemVer && differentDirectionsInclusive) ||
  3287. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3288. }
  3289. exports.Range = Range
  3290. function Range (range, options) {
  3291. if (!options || typeof options !== 'object') {
  3292. options = {
  3293. loose: !!options,
  3294. includePrerelease: false
  3295. }
  3296. }
  3297. if (range instanceof Range) {
  3298. if (range.loose === !!options.loose &&
  3299. range.includePrerelease === !!options.includePrerelease) {
  3300. return range
  3301. } else {
  3302. return new Range(range.raw, options)
  3303. }
  3304. }
  3305. if (range instanceof Comparator) {
  3306. return new Range(range.value, options)
  3307. }
  3308. if (!(this instanceof Range)) {
  3309. return new Range(range, options)
  3310. }
  3311. this.options = options
  3312. this.loose = !!options.loose
  3313. this.includePrerelease = !!options.includePrerelease
  3314. // First, split based on boolean or ||
  3315. this.raw = range
  3316. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3317. return this.parseRange(range.trim())
  3318. }, this).filter(function (c) {
  3319. // throw out any that are not relevant for whatever reason
  3320. return c.length
  3321. })
  3322. if (!this.set.length) {
  3323. throw new TypeError('Invalid SemVer Range: ' + range)
  3324. }
  3325. this.format()
  3326. }
  3327. Range.prototype.format = function () {
  3328. this.range = this.set.map(function (comps) {
  3329. return comps.join(' ').trim()
  3330. }).join('||').trim()
  3331. return this.range
  3332. }
  3333. Range.prototype.toString = function () {
  3334. return this.range
  3335. }
  3336. Range.prototype.parseRange = function (range) {
  3337. var loose = this.options.loose
  3338. range = range.trim()
  3339. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3340. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3341. range = range.replace(hr, hyphenReplace)
  3342. debug('hyphen replace', range)
  3343. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3344. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3345. debug('comparator trim', range, re[COMPARATORTRIM])
  3346. // `~ 1.2.3` => `~1.2.3`
  3347. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3348. // `^ 1.2.3` => `^1.2.3`
  3349. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3350. // normalize spaces
  3351. range = range.split(/\s+/).join(' ')
  3352. // At this point, the range is completely trimmed and
  3353. // ready to be split into comparators.
  3354. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3355. var set = range.split(' ').map(function (comp) {
  3356. return parseComparator(comp, this.options)
  3357. }, this).join(' ').split(/\s+/)
  3358. if (this.options.loose) {
  3359. // in loose mode, throw out any that are not valid comparators
  3360. set = set.filter(function (comp) {
  3361. return !!comp.match(compRe)
  3362. })
  3363. }
  3364. set = set.map(function (comp) {
  3365. return new Comparator(comp, this.options)
  3366. }, this)
  3367. return set
  3368. }
  3369. Range.prototype.intersects = function (range, options) {
  3370. if (!(range instanceof Range)) {
  3371. throw new TypeError('a Range is required')
  3372. }
  3373. return this.set.some(function (thisComparators) {
  3374. return thisComparators.every(function (thisComparator) {
  3375. return range.set.some(function (rangeComparators) {
  3376. return rangeComparators.every(function (rangeComparator) {
  3377. return thisComparator.intersects(rangeComparator, options)
  3378. })
  3379. })
  3380. })
  3381. })
  3382. }
  3383. // Mostly just for testing and legacy API reasons
  3384. exports.toComparators = toComparators
  3385. function toComparators (range, options) {
  3386. return new Range(range, options).set.map(function (comp) {
  3387. return comp.map(function (c) {
  3388. return c.value
  3389. }).join(' ').trim().split(' ')
  3390. })
  3391. }
  3392. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3393. // already replaced the hyphen ranges
  3394. // turn into a set of JUST comparators.
  3395. function parseComparator (comp, options) {
  3396. debug('comp', comp, options)
  3397. comp = replaceCarets(comp, options)
  3398. debug('caret', comp)
  3399. comp = replaceTildes(comp, options)
  3400. debug('tildes', comp)
  3401. comp = replaceXRanges(comp, options)
  3402. debug('xrange', comp)
  3403. comp = replaceStars(comp, options)
  3404. debug('stars', comp)
  3405. return comp
  3406. }
  3407. function isX (id) {
  3408. return !id || id.toLowerCase() === 'x' || id === '*'
  3409. }
  3410. // ~, ~> --> * (any, kinda silly)
  3411. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3412. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3413. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3414. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3415. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3416. function replaceTildes (comp, options) {
  3417. return comp.trim().split(/\s+/).map(function (comp) {
  3418. return replaceTilde(comp, options)
  3419. }).join(' ')
  3420. }
  3421. function replaceTilde (comp, options) {
  3422. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3423. return comp.replace(r, function (_, M, m, p, pr) {
  3424. debug('tilde', comp, _, M, m, p, pr)
  3425. var ret
  3426. if (isX(M)) {
  3427. ret = ''
  3428. } else if (isX(m)) {
  3429. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3430. } else if (isX(p)) {
  3431. // ~1.2 == >=1.2.0 <1.3.0
  3432. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3433. } else if (pr) {
  3434. debug('replaceTilde pr', pr)
  3435. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3436. ' <' + M + '.' + (+m + 1) + '.0'
  3437. } else {
  3438. // ~1.2.3 == >=1.2.3 <1.3.0
  3439. ret = '>=' + M + '.' + m + '.' + p +
  3440. ' <' + M + '.' + (+m + 1) + '.0'
  3441. }
  3442. debug('tilde return', ret)
  3443. return ret
  3444. })
  3445. }
  3446. // ^ --> * (any, kinda silly)
  3447. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3448. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3449. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3450. // ^1.2.3 --> >=1.2.3 <2.0.0
  3451. // ^1.2.0 --> >=1.2.0 <2.0.0
  3452. function replaceCarets (comp, options) {
  3453. return comp.trim().split(/\s+/).map(function (comp) {
  3454. return replaceCaret(comp, options)
  3455. }).join(' ')
  3456. }
  3457. function replaceCaret (comp, options) {
  3458. debug('caret', comp, options)
  3459. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3460. return comp.replace(r, function (_, M, m, p, pr) {
  3461. debug('caret', comp, _, M, m, p, pr)
  3462. var ret
  3463. if (isX(M)) {
  3464. ret = ''
  3465. } else if (isX(m)) {
  3466. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3467. } else if (isX(p)) {
  3468. if (M === '0') {
  3469. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3470. } else {
  3471. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3472. }
  3473. } else if (pr) {
  3474. debug('replaceCaret pr', pr)
  3475. if (M === '0') {
  3476. if (m === '0') {
  3477. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3478. ' <' + M + '.' + m + '.' + (+p + 1)
  3479. } else {
  3480. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3481. ' <' + M + '.' + (+m + 1) + '.0'
  3482. }
  3483. } else {
  3484. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3485. ' <' + (+M + 1) + '.0.0'
  3486. }
  3487. } else {
  3488. debug('no pr')
  3489. if (M === '0') {
  3490. if (m === '0') {
  3491. ret = '>=' + M + '.' + m + '.' + p +
  3492. ' <' + M + '.' + m + '.' + (+p + 1)
  3493. } else {
  3494. ret = '>=' + M + '.' + m + '.' + p +
  3495. ' <' + M + '.' + (+m + 1) + '.0'
  3496. }
  3497. } else {
  3498. ret = '>=' + M + '.' + m + '.' + p +
  3499. ' <' + (+M + 1) + '.0.0'
  3500. }
  3501. }
  3502. debug('caret return', ret)
  3503. return ret
  3504. })
  3505. }
  3506. function replaceXRanges (comp, options) {
  3507. debug('replaceXRanges', comp, options)
  3508. return comp.split(/\s+/).map(function (comp) {
  3509. return replaceXRange(comp, options)
  3510. }).join(' ')
  3511. }
  3512. function replaceXRange (comp, options) {
  3513. comp = comp.trim()
  3514. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3515. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3516. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3517. var xM = isX(M)
  3518. var xm = xM || isX(m)
  3519. var xp = xm || isX(p)
  3520. var anyX = xp
  3521. if (gtlt === '=' && anyX) {
  3522. gtlt = ''
  3523. }
  3524. if (xM) {
  3525. if (gtlt === '>' || gtlt === '<') {
  3526. // nothing is allowed
  3527. ret = '<0.0.0'
  3528. } else {
  3529. // nothing is forbidden
  3530. ret = '*'
  3531. }
  3532. } else if (gtlt && anyX) {
  3533. // we know patch is an x, because we have any x at all.
  3534. // replace X with 0
  3535. if (xm) {
  3536. m = 0
  3537. }
  3538. p = 0
  3539. if (gtlt === '>') {
  3540. // >1 => >=2.0.0
  3541. // >1.2 => >=1.3.0
  3542. // >1.2.3 => >= 1.2.4
  3543. gtlt = '>='
  3544. if (xm) {
  3545. M = +M + 1
  3546. m = 0
  3547. p = 0
  3548. } else {
  3549. m = +m + 1
  3550. p = 0
  3551. }
  3552. } else if (gtlt === '<=') {
  3553. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3554. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3555. gtlt = '<'
  3556. if (xm) {
  3557. M = +M + 1
  3558. } else {
  3559. m = +m + 1
  3560. }
  3561. }
  3562. ret = gtlt + M + '.' + m + '.' + p
  3563. } else if (xm) {
  3564. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3565. } else if (xp) {
  3566. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3567. }
  3568. debug('xRange return', ret)
  3569. return ret
  3570. })
  3571. }
  3572. // Because * is AND-ed with everything else in the comparator,
  3573. // and '' means "any version", just remove the *s entirely.
  3574. function replaceStars (comp, options) {
  3575. debug('replaceStars', comp, options)
  3576. // Looseness is ignored here. star is always as loose as it gets!
  3577. return comp.trim().replace(re[STAR], '')
  3578. }
  3579. // This function is passed to string.replace(re[HYPHENRANGE])
  3580. // M, m, patch, prerelease, build
  3581. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3582. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3583. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3584. function hyphenReplace ($0,
  3585. from, fM, fm, fp, fpr, fb,
  3586. to, tM, tm, tp, tpr, tb) {
  3587. if (isX(fM)) {
  3588. from = ''
  3589. } else if (isX(fm)) {
  3590. from = '>=' + fM + '.0.0'
  3591. } else if (isX(fp)) {
  3592. from = '>=' + fM + '.' + fm + '.0'
  3593. } else {
  3594. from = '>=' + from
  3595. }
  3596. if (isX(tM)) {
  3597. to = ''
  3598. } else if (isX(tm)) {
  3599. to = '<' + (+tM + 1) + '.0.0'
  3600. } else if (isX(tp)) {
  3601. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3602. } else if (tpr) {
  3603. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3604. } else {
  3605. to = '<=' + to
  3606. }
  3607. return (from + ' ' + to).trim()
  3608. }
  3609. // if ANY of the sets match ALL of its comparators, then pass
  3610. Range.prototype.test = function (version) {
  3611. if (!version) {
  3612. return false
  3613. }
  3614. if (typeof version === 'string') {
  3615. version = new SemVer(version, this.options)
  3616. }
  3617. for (var i = 0; i < this.set.length; i++) {
  3618. if (testSet(this.set[i], version, this.options)) {
  3619. return true
  3620. }
  3621. }
  3622. return false
  3623. }
  3624. function testSet (set, version, options) {
  3625. for (var i = 0; i < set.length; i++) {
  3626. if (!set[i].test(version)) {
  3627. return false
  3628. }
  3629. }
  3630. if (version.prerelease.length && !options.includePrerelease) {
  3631. // Find the set of versions that are allowed to have prereleases
  3632. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3633. // That should allow `1.2.3-pr.2` to pass.
  3634. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3635. // even though it's within the range set by the comparators.
  3636. for (i = 0; i < set.length; i++) {
  3637. debug(set[i].semver)
  3638. if (set[i].semver === ANY) {
  3639. continue
  3640. }
  3641. if (set[i].semver.prerelease.length > 0) {
  3642. var allowed = set[i].semver
  3643. if (allowed.major === version.major &&
  3644. allowed.minor === version.minor &&
  3645. allowed.patch === version.patch) {
  3646. return true
  3647. }
  3648. }
  3649. }
  3650. // Version has a -pre, but it's not one of the ones we like.
  3651. return false
  3652. }
  3653. return true
  3654. }
  3655. exports.satisfies = satisfies
  3656. function satisfies (version, range, options) {
  3657. try {
  3658. range = new Range(range, options)
  3659. } catch (er) {
  3660. return false
  3661. }
  3662. return range.test(version)
  3663. }
  3664. exports.maxSatisfying = maxSatisfying
  3665. function maxSatisfying (versions, range, options) {
  3666. var max = null
  3667. var maxSV = null
  3668. try {
  3669. var rangeObj = new Range(range, options)
  3670. } catch (er) {
  3671. return null
  3672. }
  3673. versions.forEach(function (v) {
  3674. if (rangeObj.test(v)) {
  3675. // satisfies(v, range, options)
  3676. if (!max || maxSV.compare(v) === -1) {
  3677. // compare(max, v, true)
  3678. max = v
  3679. maxSV = new SemVer(max, options)
  3680. }
  3681. }
  3682. })
  3683. return max
  3684. }
  3685. exports.minSatisfying = minSatisfying
  3686. function minSatisfying (versions, range, options) {
  3687. var min = null
  3688. var minSV = null
  3689. try {
  3690. var rangeObj = new Range(range, options)
  3691. } catch (er) {
  3692. return null
  3693. }
  3694. versions.forEach(function (v) {
  3695. if (rangeObj.test(v)) {
  3696. // satisfies(v, range, options)
  3697. if (!min || minSV.compare(v) === 1) {
  3698. // compare(min, v, true)
  3699. min = v
  3700. minSV = new SemVer(min, options)
  3701. }
  3702. }
  3703. })
  3704. return min
  3705. }
  3706. exports.minVersion = minVersion
  3707. function minVersion (range, loose) {
  3708. range = new Range(range, loose)
  3709. var minver = new SemVer('0.0.0')
  3710. if (range.test(minver)) {
  3711. return minver
  3712. }
  3713. minver = new SemVer('0.0.0-0')
  3714. if (range.test(minver)) {
  3715. return minver
  3716. }
  3717. minver = null
  3718. for (var i = 0; i < range.set.length; ++i) {
  3719. var comparators = range.set[i]
  3720. comparators.forEach(function (comparator) {
  3721. // Clone to avoid manipulating the comparator's semver object.
  3722. var compver = new SemVer(comparator.semver.version)
  3723. switch (comparator.operator) {
  3724. case '>':
  3725. if (compver.prerelease.length === 0) {
  3726. compver.patch++
  3727. } else {
  3728. compver.prerelease.push(0)
  3729. }
  3730. compver.raw = compver.format()
  3731. /* fallthrough */
  3732. case '':
  3733. case '>=':
  3734. if (!minver || gt(minver, compver)) {
  3735. minver = compver
  3736. }
  3737. break
  3738. case '<':
  3739. case '<=':
  3740. /* Ignore maximum versions */
  3741. break
  3742. /* istanbul ignore next */
  3743. default:
  3744. throw new Error('Unexpected operation: ' + comparator.operator)
  3745. }
  3746. })
  3747. }
  3748. if (minver && range.test(minver)) {
  3749. return minver
  3750. }
  3751. return null
  3752. }
  3753. exports.validRange = validRange
  3754. function validRange (range, options) {
  3755. try {
  3756. // Return '*' instead of '' so that truthiness works.
  3757. // This will throw if it's invalid anyway
  3758. return new Range(range, options).range || '*'
  3759. } catch (er) {
  3760. return null
  3761. }
  3762. }
  3763. // Determine if version is less than all the versions possible in the range
  3764. exports.ltr = ltr
  3765. function ltr (version, range, options) {
  3766. return outside(version, range, '<', options)
  3767. }
  3768. // Determine if version is greater than all the versions possible in the range.
  3769. exports.gtr = gtr
  3770. function gtr (version, range, options) {
  3771. return outside(version, range, '>', options)
  3772. }
  3773. exports.outside = outside
  3774. function outside (version, range, hilo, options) {
  3775. version = new SemVer(version, options)
  3776. range = new Range(range, options)
  3777. var gtfn, ltefn, ltfn, comp, ecomp
  3778. switch (hilo) {
  3779. case '>':
  3780. gtfn = gt
  3781. ltefn = lte
  3782. ltfn = lt
  3783. comp = '>'
  3784. ecomp = '>='
  3785. break
  3786. case '<':
  3787. gtfn = lt
  3788. ltefn = gte
  3789. ltfn = gt
  3790. comp = '<'
  3791. ecomp = '<='
  3792. break
  3793. default:
  3794. throw new TypeError('Must provide a hilo val of "<" or ">"')
  3795. }
  3796. // If it satisifes the range it is not outside
  3797. if (satisfies(version, range, options)) {
  3798. return false
  3799. }
  3800. // From now on, variable terms are as if we're in "gtr" mode.
  3801. // but note that everything is flipped for the "ltr" function.
  3802. for (var i = 0; i < range.set.length; ++i) {
  3803. var comparators = range.set[i]
  3804. var high = null
  3805. var low = null
  3806. comparators.forEach(function (comparator) {
  3807. if (comparator.semver === ANY) {
  3808. comparator = new Comparator('>=0.0.0')
  3809. }
  3810. high = high || comparator
  3811. low = low || comparator
  3812. if (gtfn(comparator.semver, high.semver, options)) {
  3813. high = comparator
  3814. } else if (ltfn(comparator.semver, low.semver, options)) {
  3815. low = comparator
  3816. }
  3817. })
  3818. // If the edge version comparator has a operator then our version
  3819. // isn't outside it
  3820. if (high.operator === comp || high.operator === ecomp) {
  3821. return false
  3822. }
  3823. // If the lowest version comparator has an operator and our version
  3824. // is less than it then it isn't higher than the range
  3825. if ((!low.operator || low.operator === comp) &&
  3826. ltefn(version, low.semver)) {
  3827. return false
  3828. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  3829. return false
  3830. }
  3831. }
  3832. return true
  3833. }
  3834. exports.prerelease = prerelease
  3835. function prerelease (version, options) {
  3836. var parsed = parse(version, options)
  3837. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  3838. }
  3839. exports.intersects = intersects
  3840. function intersects (r1, r2, options) {
  3841. r1 = new Range(r1, options)
  3842. r2 = new Range(r2, options)
  3843. return r1.intersects(r2)
  3844. }
  3845. exports.coerce = coerce
  3846. function coerce (version) {
  3847. if (version instanceof SemVer) {
  3848. return version
  3849. }
  3850. if (typeof version !== 'string') {
  3851. return null
  3852. }
  3853. var match = version.match(re[COERCE])
  3854. if (match == null) {
  3855. return null
  3856. }
  3857. return parse(match[1] +
  3858. '.' + (match[2] || '0') +
  3859. '.' + (match[3] || '0'))
  3860. }
  3861. /***/ }),
  3862. /***/ 289:
  3863. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3864. "use strict";
  3865. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3866. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3867. return new (P || (P = Promise))(function (resolve, reject) {
  3868. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3869. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3870. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3871. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3872. });
  3873. };
  3874. var __importStar = (this && this.__importStar) || function (mod) {
  3875. if (mod && mod.__esModule) return mod;
  3876. var result = {};
  3877. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  3878. result["default"] = mod;
  3879. return result;
  3880. };
  3881. Object.defineProperty(exports, "__esModule", { value: true });
  3882. const core = __importStar(__webpack_require__(470));
  3883. const exec = __importStar(__webpack_require__(986));
  3884. const fshelper = __importStar(__webpack_require__(618));
  3885. const io = __importStar(__webpack_require__(1));
  3886. const path = __importStar(__webpack_require__(622));
  3887. const git_version_1 = __webpack_require__(559);
  3888. function CreateCommandManager(workingDirectory, lfs) {
  3889. return __awaiter(this, void 0, void 0, function* () {
  3890. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  3891. });
  3892. }
  3893. exports.CreateCommandManager = CreateCommandManager;
  3894. class GitCommandManager {
  3895. // Private constructor; use createCommandManager()
  3896. constructor() {
  3897. this.gitEnv = {
  3898. GIT_TERMINAL_PROMPT: '0',
  3899. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  3900. };
  3901. this.gitPath = '';
  3902. this.lfs = false;
  3903. this.workingDirectory = '';
  3904. }
  3905. branchDelete(remote, branch) {
  3906. return __awaiter(this, void 0, void 0, function* () {
  3907. const args = ['branch', '--delete', '--force'];
  3908. if (remote) {
  3909. args.push('--remote');
  3910. }
  3911. args.push(branch);
  3912. yield this.execGit(args);
  3913. });
  3914. }
  3915. branchExists(remote, pattern) {
  3916. return __awaiter(this, void 0, void 0, function* () {
  3917. const args = ['branch', '--list'];
  3918. if (remote) {
  3919. args.push('--remote');
  3920. }
  3921. args.push(pattern);
  3922. const output = yield this.execGit(args);
  3923. return !!output.stdout.trim();
  3924. });
  3925. }
  3926. branchList(remote) {
  3927. return __awaiter(this, void 0, void 0, function* () {
  3928. const result = [];
  3929. // Note, this implementation uses "rev-parse --symbolic" because the output from
  3930. // "branch --list" is more difficult when in a detached HEAD state.
  3931. const args = ['rev-parse', '--symbolic'];
  3932. if (remote) {
  3933. args.push('--remotes=origin');
  3934. }
  3935. else {
  3936. args.push('--branches');
  3937. }
  3938. const output = yield this.execGit(args);
  3939. for (let branch of output.stdout.trim().split('\n')) {
  3940. branch = branch.trim();
  3941. if (branch) {
  3942. result.push(branch);
  3943. }
  3944. }
  3945. return result;
  3946. });
  3947. }
  3948. checkout(ref, startPoint) {
  3949. return __awaiter(this, void 0, void 0, function* () {
  3950. const args = ['checkout', '--progress', '--force'];
  3951. if (startPoint) {
  3952. args.push('-B', ref, startPoint);
  3953. }
  3954. else {
  3955. args.push(ref);
  3956. }
  3957. yield this.execGit(args);
  3958. });
  3959. }
  3960. checkoutDetach() {
  3961. return __awaiter(this, void 0, void 0, function* () {
  3962. const args = ['checkout', '--detach'];
  3963. yield this.execGit(args);
  3964. });
  3965. }
  3966. config(configKey, configValue) {
  3967. return __awaiter(this, void 0, void 0, function* () {
  3968. yield this.execGit(['config', configKey, configValue]);
  3969. });
  3970. }
  3971. configExists(configKey) {
  3972. return __awaiter(this, void 0, void 0, function* () {
  3973. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  3974. return `\\${x}`;
  3975. });
  3976. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  3977. return output.exitCode === 0;
  3978. });
  3979. }
  3980. fetch(fetchDepth, refSpec) {
  3981. return __awaiter(this, void 0, void 0, function* () {
  3982. const args = [
  3983. '-c',
  3984. 'protocol.version=2',
  3985. 'fetch',
  3986. '--no-tags',
  3987. '--prune',
  3988. '--progress',
  3989. '--no-recurse-submodules'
  3990. ];
  3991. if (fetchDepth > 0) {
  3992. args.push(`--depth=${fetchDepth}`);
  3993. }
  3994. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  3995. args.push('--unshallow');
  3996. }
  3997. args.push('origin');
  3998. for (const arg of refSpec) {
  3999. args.push(arg);
  4000. }
  4001. let attempt = 1;
  4002. const maxAttempts = 3;
  4003. while (attempt <= maxAttempts) {
  4004. const allowAllExitCodes = attempt < maxAttempts;
  4005. const output = yield this.execGit(args, allowAllExitCodes);
  4006. if (output.exitCode === 0) {
  4007. break;
  4008. }
  4009. const seconds = this.getRandomIntInclusive(1, 10);
  4010. core.warning(`Git fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4011. yield this.sleep(seconds * 1000);
  4012. attempt++;
  4013. }
  4014. });
  4015. }
  4016. getWorkingDirectory() {
  4017. return this.workingDirectory;
  4018. }
  4019. init() {
  4020. return __awaiter(this, void 0, void 0, function* () {
  4021. yield this.execGit(['init', this.workingDirectory]);
  4022. });
  4023. }
  4024. isDetached() {
  4025. return __awaiter(this, void 0, void 0, function* () {
  4026. // Note, this implementation uses "branch --show-current" because
  4027. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4028. // with nothing checked out.
  4029. const output = yield this.execGit(['branch', '--show-current']);
  4030. return output.stdout.trim() === '';
  4031. });
  4032. }
  4033. lfsFetch(ref) {
  4034. return __awaiter(this, void 0, void 0, function* () {
  4035. const args = ['lfs', 'fetch', 'origin', ref];
  4036. let attempt = 1;
  4037. const maxAttempts = 3;
  4038. while (attempt <= maxAttempts) {
  4039. const allowAllExitCodes = attempt < maxAttempts;
  4040. const output = yield this.execGit(args, allowAllExitCodes);
  4041. if (output.exitCode === 0) {
  4042. break;
  4043. }
  4044. const seconds = this.getRandomIntInclusive(1, 10);
  4045. core.warning(`Git lfs fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4046. yield this.sleep(seconds * 1000);
  4047. attempt++;
  4048. }
  4049. });
  4050. }
  4051. lfsInstall() {
  4052. return __awaiter(this, void 0, void 0, function* () {
  4053. yield this.execGit(['lfs', 'install', '--local']);
  4054. });
  4055. }
  4056. log1() {
  4057. return __awaiter(this, void 0, void 0, function* () {
  4058. yield this.execGit(['log', '-1']);
  4059. });
  4060. }
  4061. remoteAdd(remoteName, remoteUrl) {
  4062. return __awaiter(this, void 0, void 0, function* () {
  4063. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4064. });
  4065. }
  4066. tagExists(pattern) {
  4067. return __awaiter(this, void 0, void 0, function* () {
  4068. const output = yield this.execGit(['tag', '--list', pattern]);
  4069. return !!output.stdout.trim();
  4070. });
  4071. }
  4072. tryClean() {
  4073. return __awaiter(this, void 0, void 0, function* () {
  4074. const output = yield this.execGit(['clean', '-ffdx'], true);
  4075. return output.exitCode === 0;
  4076. });
  4077. }
  4078. tryConfigUnset(configKey) {
  4079. return __awaiter(this, void 0, void 0, function* () {
  4080. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4081. return output.exitCode === 0;
  4082. });
  4083. }
  4084. tryDisableAutomaticGarbageCollection() {
  4085. return __awaiter(this, void 0, void 0, function* () {
  4086. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4087. return output.exitCode === 0;
  4088. });
  4089. }
  4090. tryGetFetchUrl() {
  4091. return __awaiter(this, void 0, void 0, function* () {
  4092. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4093. if (output.exitCode !== 0) {
  4094. return '';
  4095. }
  4096. const stdout = output.stdout.trim();
  4097. if (stdout.includes('\n')) {
  4098. return '';
  4099. }
  4100. return stdout;
  4101. });
  4102. }
  4103. tryReset() {
  4104. return __awaiter(this, void 0, void 0, function* () {
  4105. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4106. return output.exitCode === 0;
  4107. });
  4108. }
  4109. static createCommandManager(workingDirectory, lfs) {
  4110. return __awaiter(this, void 0, void 0, function* () {
  4111. const result = new GitCommandManager();
  4112. yield result.initializeCommandManager(workingDirectory, lfs);
  4113. return result;
  4114. });
  4115. }
  4116. execGit(args, allowAllExitCodes = false) {
  4117. return __awaiter(this, void 0, void 0, function* () {
  4118. fshelper.directoryExistsSync(this.workingDirectory, true);
  4119. const result = new GitOutput();
  4120. const env = {};
  4121. for (const key of Object.keys(process.env)) {
  4122. env[key] = process.env[key];
  4123. }
  4124. for (const key of Object.keys(this.gitEnv)) {
  4125. env[key] = this.gitEnv[key];
  4126. }
  4127. const stdout = [];
  4128. const options = {
  4129. cwd: this.workingDirectory,
  4130. env,
  4131. ignoreReturnCode: allowAllExitCodes,
  4132. listeners: {
  4133. stdout: (data) => {
  4134. stdout.push(data.toString());
  4135. }
  4136. }
  4137. };
  4138. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4139. result.stdout = stdout.join('');
  4140. return result;
  4141. });
  4142. }
  4143. initializeCommandManager(workingDirectory, lfs) {
  4144. return __awaiter(this, void 0, void 0, function* () {
  4145. this.workingDirectory = workingDirectory;
  4146. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4147. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4148. this.lfs = lfs;
  4149. if (!this.lfs) {
  4150. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4151. }
  4152. this.gitPath = yield io.which('git', true);
  4153. // Git version
  4154. core.debug('Getting git version');
  4155. let gitVersion = new git_version_1.GitVersion();
  4156. let gitOutput = yield this.execGit(['version']);
  4157. let stdout = gitOutput.stdout.trim();
  4158. if (!stdout.includes('\n')) {
  4159. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4160. if (match) {
  4161. gitVersion = new git_version_1.GitVersion(match[0]);
  4162. }
  4163. }
  4164. if (!gitVersion.isValid()) {
  4165. throw new Error('Unable to determine git version');
  4166. }
  4167. // Minimum git version
  4168. // Note:
  4169. // - Auth header not supported before 2.9
  4170. // - Wire protocol v2 not supported before 2.18
  4171. const minimumGitVersion = new git_version_1.GitVersion('2.18');
  4172. if (!gitVersion.checkMinimum(minimumGitVersion)) {
  4173. throw new Error(`Minimum required git version is ${minimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4174. }
  4175. if (this.lfs) {
  4176. // Git-lfs version
  4177. core.debug('Getting git-lfs version');
  4178. let gitLfsVersion = new git_version_1.GitVersion();
  4179. const gitLfsPath = yield io.which('git-lfs', true);
  4180. gitOutput = yield this.execGit(['lfs', 'version']);
  4181. stdout = gitOutput.stdout.trim();
  4182. if (!stdout.includes('\n')) {
  4183. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4184. if (match) {
  4185. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4186. }
  4187. }
  4188. if (!gitLfsVersion.isValid()) {
  4189. throw new Error('Unable to determine git-lfs version');
  4190. }
  4191. // Minimum git-lfs version
  4192. // Note:
  4193. // - Auth header not supported before 2.1
  4194. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4195. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4196. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4197. }
  4198. }
  4199. // Set the user agent
  4200. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4201. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4202. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4203. });
  4204. }
  4205. getRandomIntInclusive(minimum, maximum) {
  4206. minimum = Math.floor(minimum);
  4207. maximum = Math.floor(maximum);
  4208. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  4209. }
  4210. sleep(milliseconds) {
  4211. return __awaiter(this, void 0, void 0, function* () {
  4212. return new Promise(resolve => setTimeout(resolve, milliseconds));
  4213. });
  4214. }
  4215. }
  4216. class GitOutput {
  4217. constructor() {
  4218. this.stdout = '';
  4219. this.exitCode = 0;
  4220. }
  4221. }
  4222. /***/ }),
  4223. /***/ 293:
  4224. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4225. "use strict";
  4226. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4227. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4228. return new (P || (P = Promise))(function (resolve, reject) {
  4229. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4230. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4231. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4232. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4233. });
  4234. };
  4235. var __importStar = (this && this.__importStar) || function (mod) {
  4236. if (mod && mod.__esModule) return mod;
  4237. var result = {};
  4238. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4239. result["default"] = mod;
  4240. return result;
  4241. };
  4242. Object.defineProperty(exports, "__esModule", { value: true });
  4243. const core = __importStar(__webpack_require__(470));
  4244. const coreCommand = __importStar(__webpack_require__(431));
  4245. const fs = __importStar(__webpack_require__(747));
  4246. const fsHelper = __importStar(__webpack_require__(618));
  4247. const gitCommandManager = __importStar(__webpack_require__(289));
  4248. const io = __importStar(__webpack_require__(1));
  4249. const path = __importStar(__webpack_require__(622));
  4250. const refHelper = __importStar(__webpack_require__(227));
  4251. const githubApiHelper = __importStar(__webpack_require__(464));
  4252. const authConfigKey = `http.https://github.com/.extraheader`;
  4253. function getSource(settings) {
  4254. return __awaiter(this, void 0, void 0, function* () {
  4255. // Repository URL
  4256. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4257. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4258. // Set intra-task state for cleanup
  4259. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4260. // Remove conflicting file path
  4261. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4262. yield io.rmRF(settings.repositoryPath);
  4263. }
  4264. // Create directory
  4265. let isExisting = true;
  4266. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4267. isExisting = false;
  4268. yield io.mkdirP(settings.repositoryPath);
  4269. }
  4270. // Git command manager
  4271. core.info(`Working directory is '${settings.repositoryPath}'`);
  4272. let git = null;
  4273. try {
  4274. git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4275. }
  4276. catch (err) {
  4277. // Git is required for LFS
  4278. if (settings.lfs) {
  4279. throw err;
  4280. }
  4281. // Otherwise fallback to REST API
  4282. }
  4283. // Prepare existing directory, otherwise recreate
  4284. if (isExisting) {
  4285. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4286. }
  4287. if (!git || `${1}` == '1') {
  4288. yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
  4289. }
  4290. else {
  4291. // Initialize the repository
  4292. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4293. yield git.init();
  4294. yield git.remoteAdd('origin', repositoryUrl);
  4295. }
  4296. // Disable automatic garbage collection
  4297. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4298. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4299. }
  4300. // Remove possible previous extraheader
  4301. yield removeGitConfig(git, authConfigKey);
  4302. // Add extraheader (auth)
  4303. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4304. core.setSecret(base64Credentials);
  4305. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4306. yield git.config(authConfigKey, authConfigValue);
  4307. // LFS install
  4308. if (settings.lfs) {
  4309. yield git.lfsInstall();
  4310. }
  4311. // Fetch
  4312. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4313. yield git.fetch(settings.fetchDepth, refSpec);
  4314. // Checkout info
  4315. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4316. // LFS fetch
  4317. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4318. // Explicit lfs fetch will fetch lfs objects in parallel.
  4319. if (settings.lfs) {
  4320. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4321. }
  4322. // Checkout
  4323. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4324. // Dump some info about the checked out commit
  4325. yield git.log1();
  4326. }
  4327. });
  4328. }
  4329. exports.getSource = getSource;
  4330. function cleanup(repositoryPath) {
  4331. return __awaiter(this, void 0, void 0, function* () {
  4332. // Repo exists?
  4333. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4334. return;
  4335. }
  4336. fsHelper.directoryExistsSync(repositoryPath, true);
  4337. // Remove the config key
  4338. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4339. yield removeGitConfig(git, authConfigKey);
  4340. });
  4341. }
  4342. exports.cleanup = cleanup;
  4343. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4344. return __awaiter(this, void 0, void 0, function* () {
  4345. let remove = false;
  4346. // Check whether using git or REST API
  4347. if (!git) {
  4348. remove = true;
  4349. }
  4350. // Fetch URL does not match
  4351. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4352. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4353. remove = true;
  4354. }
  4355. else {
  4356. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4357. const lockPaths = [
  4358. path.join(repositoryPath, '.git', 'index.lock'),
  4359. path.join(repositoryPath, '.git', 'shallow.lock')
  4360. ];
  4361. for (const lockPath of lockPaths) {
  4362. try {
  4363. yield io.rmRF(lockPath);
  4364. }
  4365. catch (error) {
  4366. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4367. }
  4368. }
  4369. try {
  4370. // Checkout detached HEAD
  4371. if (!(yield git.isDetached())) {
  4372. yield git.checkoutDetach();
  4373. }
  4374. // Remove all refs/heads/*
  4375. let branches = yield git.branchList(false);
  4376. for (const branch of branches) {
  4377. yield git.branchDelete(false, branch);
  4378. }
  4379. // Remove all refs/remotes/origin/* to avoid conflicts
  4380. branches = yield git.branchList(true);
  4381. for (const branch of branches) {
  4382. yield git.branchDelete(true, branch);
  4383. }
  4384. // Clean
  4385. if (clean) {
  4386. if (!(yield git.tryClean())) {
  4387. 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}'.`);
  4388. remove = true;
  4389. }
  4390. else if (!(yield git.tryReset())) {
  4391. remove = true;
  4392. }
  4393. if (remove) {
  4394. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4395. }
  4396. }
  4397. }
  4398. catch (error) {
  4399. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4400. remove = true;
  4401. }
  4402. }
  4403. if (remove) {
  4404. // Delete the contents of the directory. Don't delete the directory itself
  4405. // since it might be the current working directory.
  4406. core.info(`Deleting the contents of '${repositoryPath}'`);
  4407. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4408. yield io.rmRF(path.join(repositoryPath, file));
  4409. }
  4410. }
  4411. });
  4412. }
  4413. function removeGitConfig(git, configKey) {
  4414. return __awaiter(this, void 0, void 0, function* () {
  4415. if ((yield git.configExists(configKey)) &&
  4416. !(yield git.tryConfigUnset(configKey))) {
  4417. // Load the config contents
  4418. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4419. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4420. fsHelper.fileExistsSync(configPath);
  4421. let contents = fs.readFileSync(configPath).toString() || '';
  4422. // Filter - only includes lines that do not contain the config key
  4423. const upperConfigKey = configKey.toUpperCase();
  4424. const split = contents
  4425. .split('\n')
  4426. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4427. contents = split.join('\n');
  4428. // Rewrite the config file
  4429. fs.writeFileSync(configPath, contents);
  4430. }
  4431. });
  4432. }
  4433. /***/ }),
  4434. /***/ 294:
  4435. /***/ (function(module, __unusedexports, __webpack_require__) {
  4436. module.exports = parseOptions;
  4437. const { Deprecation } = __webpack_require__(692);
  4438. const { getUserAgent } = __webpack_require__(796);
  4439. const once = __webpack_require__(969);
  4440. const pkg = __webpack_require__(215);
  4441. const deprecateOptionsTimeout = once((log, deprecation) =>
  4442. log.warn(deprecation)
  4443. );
  4444. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4445. const deprecateOptionsHeaders = once((log, deprecation) =>
  4446. log.warn(deprecation)
  4447. );
  4448. function parseOptions(options, log, hook) {
  4449. if (options.headers) {
  4450. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4451. newObj[key.toLowerCase()] = options.headers[key];
  4452. return newObj;
  4453. }, {});
  4454. }
  4455. const clientDefaults = {
  4456. headers: options.headers || {},
  4457. request: options.request || {},
  4458. mediaType: {
  4459. previews: [],
  4460. format: ""
  4461. }
  4462. };
  4463. if (options.baseUrl) {
  4464. clientDefaults.baseUrl = options.baseUrl;
  4465. }
  4466. if (options.userAgent) {
  4467. clientDefaults.headers["user-agent"] = options.userAgent;
  4468. }
  4469. if (options.previews) {
  4470. clientDefaults.mediaType.previews = options.previews;
  4471. }
  4472. if (options.timeZone) {
  4473. clientDefaults.headers["time-zone"] = options.timeZone;
  4474. }
  4475. if (options.timeout) {
  4476. deprecateOptionsTimeout(
  4477. log,
  4478. new Deprecation(
  4479. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4480. )
  4481. );
  4482. clientDefaults.request.timeout = options.timeout;
  4483. }
  4484. if (options.agent) {
  4485. deprecateOptionsAgent(
  4486. log,
  4487. new Deprecation(
  4488. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4489. )
  4490. );
  4491. clientDefaults.request.agent = options.agent;
  4492. }
  4493. if (options.headers) {
  4494. deprecateOptionsHeaders(
  4495. log,
  4496. new Deprecation(
  4497. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4498. )
  4499. );
  4500. }
  4501. const userAgentOption = clientDefaults.headers["user-agent"];
  4502. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4503. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4504. .filter(Boolean)
  4505. .join(" ");
  4506. clientDefaults.request.hook = hook.bind(null, "request");
  4507. return clientDefaults;
  4508. }
  4509. /***/ }),
  4510. /***/ 297:
  4511. /***/ (function(module) {
  4512. module.exports = class HttpError extends Error {
  4513. constructor (message, code, headers) {
  4514. super(message)
  4515. // Maintains proper stack trace (only available on V8)
  4516. /* istanbul ignore next */
  4517. if (Error.captureStackTrace) {
  4518. Error.captureStackTrace(this, this.constructor)
  4519. }
  4520. this.name = 'HttpError'
  4521. this.code = code
  4522. this.headers = headers
  4523. }
  4524. }
  4525. /***/ }),
  4526. /***/ 301:
  4527. /***/ (function(module, __unusedexports, __webpack_require__) {
  4528. /**
  4529. * Some “list” response that can be paginated have a different response structure
  4530. *
  4531. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4532. * /installation/repositories also has `repository_selection`), as well as a key with
  4533. * the list of the items which name varies from endpoint to endpoint:
  4534. *
  4535. * - https://developer.github.com/v3/search/#example (key `items`)
  4536. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4537. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4538. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4539. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4540. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  4541. *
  4542. * Octokit normalizes these responses so that paginated results are always returned following
  4543. * the same structure. One challenge is that if the list response has only one page, no Link
  4544. * header is provided, so this header alone is not sufficient to check wether a response is
  4545. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4546. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4547. * property because it also exists in the response of Get the combined status for a specific ref.
  4548. */
  4549. module.exports = normalizePaginatedListResponse;
  4550. const { Deprecation } = __webpack_require__(692);
  4551. const once = __webpack_require__(969);
  4552. const deprecateIncompleteResults = once((log, deprecation) =>
  4553. log.warn(deprecation)
  4554. );
  4555. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4556. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4557. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4558. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4559. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4560. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4561. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  4562. function normalizePaginatedListResponse(octokit, url, response) {
  4563. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4564. if (
  4565. !REGEX_IS_SEARCH_PATH.test(path) &&
  4566. !REGEX_IS_CHECKS_PATH.test(path) &&
  4567. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4568. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  4569. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  4570. ) {
  4571. return;
  4572. }
  4573. // keep the additional properties intact to avoid a breaking change,
  4574. // but log a deprecation warning when accessed
  4575. const incompleteResults = response.data.incomplete_results;
  4576. const repositorySelection = response.data.repository_selection;
  4577. const totalCount = response.data.total_count;
  4578. delete response.data.incomplete_results;
  4579. delete response.data.repository_selection;
  4580. delete response.data.total_count;
  4581. const namespaceKey = Object.keys(response.data)[0];
  4582. response.data = response.data[namespaceKey];
  4583. Object.defineProperty(response.data, namespaceKey, {
  4584. get() {
  4585. deprecateNamespace(
  4586. octokit.log,
  4587. new Deprecation(
  4588. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4589. )
  4590. );
  4591. return response.data;
  4592. }
  4593. });
  4594. if (typeof incompleteResults !== "undefined") {
  4595. Object.defineProperty(response.data, "incomplete_results", {
  4596. get() {
  4597. deprecateIncompleteResults(
  4598. octokit.log,
  4599. new Deprecation(
  4600. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4601. )
  4602. );
  4603. return incompleteResults;
  4604. }
  4605. });
  4606. }
  4607. if (typeof repositorySelection !== "undefined") {
  4608. Object.defineProperty(response.data, "repository_selection", {
  4609. get() {
  4610. deprecateTotalCount(
  4611. octokit.log,
  4612. new Deprecation(
  4613. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4614. )
  4615. );
  4616. return repositorySelection;
  4617. }
  4618. });
  4619. }
  4620. Object.defineProperty(response.data, "total_count", {
  4621. get() {
  4622. deprecateTotalCount(
  4623. octokit.log,
  4624. new Deprecation(
  4625. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4626. )
  4627. );
  4628. return totalCount;
  4629. }
  4630. });
  4631. }
  4632. /***/ }),
  4633. /***/ 323:
  4634. /***/ (function(module) {
  4635. "use strict";
  4636. var isStream = module.exports = function (stream) {
  4637. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4638. };
  4639. isStream.writable = function (stream) {
  4640. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4641. };
  4642. isStream.readable = function (stream) {
  4643. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4644. };
  4645. isStream.duplex = function (stream) {
  4646. return isStream.writable(stream) && isStream.readable(stream);
  4647. };
  4648. isStream.transform = function (stream) {
  4649. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4650. };
  4651. /***/ }),
  4652. /***/ 336:
  4653. /***/ (function(module, __unusedexports, __webpack_require__) {
  4654. module.exports = hasLastPage
  4655. const deprecate = __webpack_require__(370)
  4656. const getPageLinks = __webpack_require__(577)
  4657. function hasLastPage (link) {
  4658. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4659. return getPageLinks(link).last
  4660. }
  4661. /***/ }),
  4662. /***/ 348:
  4663. /***/ (function(module, __unusedexports, __webpack_require__) {
  4664. "use strict";
  4665. module.exports = validate;
  4666. const { RequestError } = __webpack_require__(463);
  4667. const get = __webpack_require__(854);
  4668. const set = __webpack_require__(883);
  4669. function validate(octokit, options) {
  4670. if (!options.request.validate) {
  4671. return;
  4672. }
  4673. const { validate: params } = options.request;
  4674. Object.keys(params).forEach(parameterName => {
  4675. const parameter = get(params, parameterName);
  4676. const expectedType = parameter.type;
  4677. let parentParameterName;
  4678. let parentValue;
  4679. let parentParamIsPresent = true;
  4680. let parentParameterIsArray = false;
  4681. if (/\./.test(parameterName)) {
  4682. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4683. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4684. if (parentParameterIsArray) {
  4685. parentParameterName = parentParameterName.slice(0, -2);
  4686. }
  4687. parentValue = get(options, parentParameterName);
  4688. parentParamIsPresent =
  4689. parentParameterName === "headers" ||
  4690. (typeof parentValue === "object" && parentValue !== null);
  4691. }
  4692. const values = parentParameterIsArray
  4693. ? (get(options, parentParameterName) || []).map(
  4694. value => value[parameterName.split(/\./).pop()]
  4695. )
  4696. : [get(options, parameterName)];
  4697. values.forEach((value, i) => {
  4698. const valueIsPresent = typeof value !== "undefined";
  4699. const valueIsNull = value === null;
  4700. const currentParameterName = parentParameterIsArray
  4701. ? parameterName.replace(/\[\]/, `[${i}]`)
  4702. : parameterName;
  4703. if (!parameter.required && !valueIsPresent) {
  4704. return;
  4705. }
  4706. // if the parent parameter is of type object but allows null
  4707. // then the child parameters can be ignored
  4708. if (!parentParamIsPresent) {
  4709. return;
  4710. }
  4711. if (parameter.allowNull && valueIsNull) {
  4712. return;
  4713. }
  4714. if (!parameter.allowNull && valueIsNull) {
  4715. throw new RequestError(
  4716. `'${currentParameterName}' cannot be null`,
  4717. 400,
  4718. {
  4719. request: options
  4720. }
  4721. );
  4722. }
  4723. if (parameter.required && !valueIsPresent) {
  4724. throw new RequestError(
  4725. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4726. value
  4727. )}`,
  4728. 400,
  4729. {
  4730. request: options
  4731. }
  4732. );
  4733. }
  4734. // parse to integer before checking for enum
  4735. // so that string "1" will match enum with number 1
  4736. if (expectedType === "integer") {
  4737. const unparsedValue = value;
  4738. value = parseInt(value, 10);
  4739. if (isNaN(value)) {
  4740. throw new RequestError(
  4741. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4742. unparsedValue
  4743. )} is NaN`,
  4744. 400,
  4745. {
  4746. request: options
  4747. }
  4748. );
  4749. }
  4750. }
  4751. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4752. throw new RequestError(
  4753. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4754. value
  4755. )}`,
  4756. 400,
  4757. {
  4758. request: options
  4759. }
  4760. );
  4761. }
  4762. if (parameter.validation) {
  4763. const regex = new RegExp(parameter.validation);
  4764. if (!regex.test(value)) {
  4765. throw new RequestError(
  4766. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4767. value
  4768. )}`,
  4769. 400,
  4770. {
  4771. request: options
  4772. }
  4773. );
  4774. }
  4775. }
  4776. if (expectedType === "object" && typeof value === "string") {
  4777. try {
  4778. value = JSON.parse(value);
  4779. } catch (exception) {
  4780. throw new RequestError(
  4781. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4782. value
  4783. )}`,
  4784. 400,
  4785. {
  4786. request: options
  4787. }
  4788. );
  4789. }
  4790. }
  4791. set(options, parameter.mapTo || currentParameterName, value);
  4792. });
  4793. });
  4794. return options;
  4795. }
  4796. /***/ }),
  4797. /***/ 349:
  4798. /***/ (function(module, __unusedexports, __webpack_require__) {
  4799. module.exports = authenticationRequestError;
  4800. const { RequestError } = __webpack_require__(463);
  4801. function authenticationRequestError(state, error, options) {
  4802. /* istanbul ignore next */
  4803. if (!error.headers) throw error;
  4804. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  4805. // handle "2FA required" error only
  4806. if (error.status !== 401 || !otpRequired) {
  4807. throw error;
  4808. }
  4809. if (
  4810. error.status === 401 &&
  4811. otpRequired &&
  4812. error.request &&
  4813. error.request.headers["x-github-otp"]
  4814. ) {
  4815. throw new RequestError(
  4816. "Invalid one-time password for two-factor authentication",
  4817. 401,
  4818. {
  4819. headers: error.headers,
  4820. request: options
  4821. }
  4822. );
  4823. }
  4824. if (typeof state.auth.on2fa !== "function") {
  4825. throw new RequestError(
  4826. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  4827. 401,
  4828. {
  4829. headers: error.headers,
  4830. request: options
  4831. }
  4832. );
  4833. }
  4834. return Promise.resolve()
  4835. .then(() => {
  4836. return state.auth.on2fa();
  4837. })
  4838. .then(oneTimePassword => {
  4839. const newOptions = Object.assign(options, {
  4840. headers: Object.assign(
  4841. { "x-github-otp": oneTimePassword },
  4842. options.headers
  4843. )
  4844. });
  4845. return state.octokit.request(newOptions);
  4846. });
  4847. }
  4848. /***/ }),
  4849. /***/ 357:
  4850. /***/ (function(module) {
  4851. module.exports = require("assert");
  4852. /***/ }),
  4853. /***/ 363:
  4854. /***/ (function(module) {
  4855. module.exports = register
  4856. function register (state, name, method, options) {
  4857. if (typeof method !== 'function') {
  4858. throw new Error('method for before hook must be a function')
  4859. }
  4860. if (!options) {
  4861. options = {}
  4862. }
  4863. if (Array.isArray(name)) {
  4864. return name.reverse().reduce(function (callback, name) {
  4865. return register.bind(null, state, name, callback, options)
  4866. }, method)()
  4867. }
  4868. return Promise.resolve()
  4869. .then(function () {
  4870. if (!state.registry[name]) {
  4871. return method(options)
  4872. }
  4873. return (state.registry[name]).reduce(function (method, registered) {
  4874. return registered.hook.bind(null, method, options)
  4875. }, method)()
  4876. })
  4877. }
  4878. /***/ }),
  4879. /***/ 368:
  4880. /***/ (function(module) {
  4881. module.exports = function atob(str) {
  4882. return Buffer.from(str, 'base64').toString('binary')
  4883. }
  4884. /***/ }),
  4885. /***/ 370:
  4886. /***/ (function(module) {
  4887. module.exports = deprecate
  4888. const loggedMessages = {}
  4889. function deprecate (message) {
  4890. if (loggedMessages[message]) {
  4891. return
  4892. }
  4893. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  4894. loggedMessages[message] = 1
  4895. }
  4896. /***/ }),
  4897. /***/ 372:
  4898. /***/ (function(module) {
  4899. module.exports = octokitDebug;
  4900. function octokitDebug(octokit) {
  4901. octokit.hook.wrap("request", (request, options) => {
  4902. octokit.log.debug("request", options);
  4903. const start = Date.now();
  4904. const requestOptions = octokit.request.endpoint.parse(options);
  4905. const path = requestOptions.url.replace(options.baseUrl, "");
  4906. return request(options)
  4907. .then(response => {
  4908. octokit.log.info(
  4909. `${requestOptions.method} ${path} - ${
  4910. response.status
  4911. } in ${Date.now() - start}ms`
  4912. );
  4913. return response;
  4914. })
  4915. .catch(error => {
  4916. octokit.log.info(
  4917. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  4918. start}ms`
  4919. );
  4920. throw error;
  4921. });
  4922. });
  4923. }
  4924. /***/ }),
  4925. /***/ 385:
  4926. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4927. "use strict";
  4928. Object.defineProperty(exports, '__esModule', { value: true });
  4929. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  4930. var isPlainObject = _interopDefault(__webpack_require__(696));
  4931. var universalUserAgent = __webpack_require__(796);
  4932. function lowercaseKeys(object) {
  4933. if (!object) {
  4934. return {};
  4935. }
  4936. return Object.keys(object).reduce((newObj, key) => {
  4937. newObj[key.toLowerCase()] = object[key];
  4938. return newObj;
  4939. }, {});
  4940. }
  4941. function mergeDeep(defaults, options) {
  4942. const result = Object.assign({}, defaults);
  4943. Object.keys(options).forEach(key => {
  4944. if (isPlainObject(options[key])) {
  4945. if (!(key in defaults)) Object.assign(result, {
  4946. [key]: options[key]
  4947. });else result[key] = mergeDeep(defaults[key], options[key]);
  4948. } else {
  4949. Object.assign(result, {
  4950. [key]: options[key]
  4951. });
  4952. }
  4953. });
  4954. return result;
  4955. }
  4956. function merge(defaults, route, options) {
  4957. if (typeof route === "string") {
  4958. let [method, url] = route.split(" ");
  4959. options = Object.assign(url ? {
  4960. method,
  4961. url
  4962. } : {
  4963. url: method
  4964. }, options);
  4965. } else {
  4966. options = Object.assign({}, route);
  4967. } // lowercase header names before merging with defaults to avoid duplicates
  4968. options.headers = lowercaseKeys(options.headers);
  4969. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  4970. if (defaults && defaults.mediaType.previews.length) {
  4971. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  4972. }
  4973. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  4974. return mergedOptions;
  4975. }
  4976. function addQueryParameters(url, parameters) {
  4977. const separator = /\?/.test(url) ? "&" : "?";
  4978. const names = Object.keys(parameters);
  4979. if (names.length === 0) {
  4980. return url;
  4981. }
  4982. return url + separator + names.map(name => {
  4983. if (name === "q") {
  4984. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  4985. }
  4986. return `${name}=${encodeURIComponent(parameters[name])}`;
  4987. }).join("&");
  4988. }
  4989. const urlVariableRegex = /\{[^}]+\}/g;
  4990. function removeNonChars(variableName) {
  4991. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  4992. }
  4993. function extractUrlVariableNames(url) {
  4994. const matches = url.match(urlVariableRegex);
  4995. if (!matches) {
  4996. return [];
  4997. }
  4998. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  4999. }
  5000. function omit(object, keysToOmit) {
  5001. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5002. obj[key] = object[key];
  5003. return obj;
  5004. }, {});
  5005. }
  5006. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5007. // TODO: create separate package.
  5008. //
  5009. // Copyright (c) 2012-2014, Bram Stein
  5010. // All rights reserved.
  5011. // Redistribution and use in source and binary forms, with or without
  5012. // modification, are permitted provided that the following conditions
  5013. // are met:
  5014. // 1. Redistributions of source code must retain the above copyright
  5015. // notice, this list of conditions and the following disclaimer.
  5016. // 2. Redistributions in binary form must reproduce the above copyright
  5017. // notice, this list of conditions and the following disclaimer in the
  5018. // documentation and/or other materials provided with the distribution.
  5019. // 3. The name of the author may not be used to endorse or promote products
  5020. // derived from this software without specific prior written permission.
  5021. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5022. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5023. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5024. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5025. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5026. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5027. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5028. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5029. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5030. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5031. /* istanbul ignore file */
  5032. function encodeReserved(str) {
  5033. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5034. if (!/%[0-9A-Fa-f]/.test(part)) {
  5035. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5036. }
  5037. return part;
  5038. }).join("");
  5039. }
  5040. function encodeUnreserved(str) {
  5041. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5042. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5043. });
  5044. }
  5045. function encodeValue(operator, value, key) {
  5046. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5047. if (key) {
  5048. return encodeUnreserved(key) + "=" + value;
  5049. } else {
  5050. return value;
  5051. }
  5052. }
  5053. function isDefined(value) {
  5054. return value !== undefined && value !== null;
  5055. }
  5056. function isKeyOperator(operator) {
  5057. return operator === ";" || operator === "&" || operator === "?";
  5058. }
  5059. function getValues(context, operator, key, modifier) {
  5060. var value = context[key],
  5061. result = [];
  5062. if (isDefined(value) && value !== "") {
  5063. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5064. value = value.toString();
  5065. if (modifier && modifier !== "*") {
  5066. value = value.substring(0, parseInt(modifier, 10));
  5067. }
  5068. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5069. } else {
  5070. if (modifier === "*") {
  5071. if (Array.isArray(value)) {
  5072. value.filter(isDefined).forEach(function (value) {
  5073. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5074. });
  5075. } else {
  5076. Object.keys(value).forEach(function (k) {
  5077. if (isDefined(value[k])) {
  5078. result.push(encodeValue(operator, value[k], k));
  5079. }
  5080. });
  5081. }
  5082. } else {
  5083. const tmp = [];
  5084. if (Array.isArray(value)) {
  5085. value.filter(isDefined).forEach(function (value) {
  5086. tmp.push(encodeValue(operator, value));
  5087. });
  5088. } else {
  5089. Object.keys(value).forEach(function (k) {
  5090. if (isDefined(value[k])) {
  5091. tmp.push(encodeUnreserved(k));
  5092. tmp.push(encodeValue(operator, value[k].toString()));
  5093. }
  5094. });
  5095. }
  5096. if (isKeyOperator(operator)) {
  5097. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5098. } else if (tmp.length !== 0) {
  5099. result.push(tmp.join(","));
  5100. }
  5101. }
  5102. }
  5103. } else {
  5104. if (operator === ";") {
  5105. if (isDefined(value)) {
  5106. result.push(encodeUnreserved(key));
  5107. }
  5108. } else if (value === "" && (operator === "&" || operator === "?")) {
  5109. result.push(encodeUnreserved(key) + "=");
  5110. } else if (value === "") {
  5111. result.push("");
  5112. }
  5113. }
  5114. return result;
  5115. }
  5116. function parseUrl(template) {
  5117. return {
  5118. expand: expand.bind(null, template)
  5119. };
  5120. }
  5121. function expand(template, context) {
  5122. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5123. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5124. if (expression) {
  5125. let operator = "";
  5126. const values = [];
  5127. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5128. operator = expression.charAt(0);
  5129. expression = expression.substr(1);
  5130. }
  5131. expression.split(/,/g).forEach(function (variable) {
  5132. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5133. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5134. });
  5135. if (operator && operator !== "+") {
  5136. var separator = ",";
  5137. if (operator === "?") {
  5138. separator = "&";
  5139. } else if (operator !== "#") {
  5140. separator = operator;
  5141. }
  5142. return (values.length !== 0 ? operator : "") + values.join(separator);
  5143. } else {
  5144. return values.join(",");
  5145. }
  5146. } else {
  5147. return encodeReserved(literal);
  5148. }
  5149. });
  5150. }
  5151. function parse(options) {
  5152. // https://fetch.spec.whatwg.org/#methods
  5153. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5154. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5155. let headers = Object.assign({}, options.headers);
  5156. let body;
  5157. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5158. const urlVariableNames = extractUrlVariableNames(url);
  5159. url = parseUrl(url).expand(parameters);
  5160. if (!/^http/.test(url)) {
  5161. url = options.baseUrl + url;
  5162. }
  5163. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5164. const remainingParameters = omit(parameters, omittedParameters);
  5165. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5166. if (!isBinaryRequset) {
  5167. if (options.mediaType.format) {
  5168. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5169. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5170. }
  5171. if (options.mediaType.previews.length) {
  5172. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5173. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5174. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5175. return `application/vnd.github.${preview}-preview${format}`;
  5176. }).join(",");
  5177. }
  5178. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5179. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5180. if (["GET", "HEAD"].includes(method)) {
  5181. url = addQueryParameters(url, remainingParameters);
  5182. } else {
  5183. if ("data" in remainingParameters) {
  5184. body = remainingParameters.data;
  5185. } else {
  5186. if (Object.keys(remainingParameters).length) {
  5187. body = remainingParameters;
  5188. } else {
  5189. headers["content-length"] = 0;
  5190. }
  5191. }
  5192. } // default content-type for JSON if body is set
  5193. if (!headers["content-type"] && typeof body !== "undefined") {
  5194. headers["content-type"] = "application/json; charset=utf-8";
  5195. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5196. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5197. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5198. body = "";
  5199. } // Only return body/request keys if present
  5200. return Object.assign({
  5201. method,
  5202. url,
  5203. headers
  5204. }, typeof body !== "undefined" ? {
  5205. body
  5206. } : null, options.request ? {
  5207. request: options.request
  5208. } : null);
  5209. }
  5210. function endpointWithDefaults(defaults, route, options) {
  5211. return parse(merge(defaults, route, options));
  5212. }
  5213. function withDefaults(oldDefaults, newDefaults) {
  5214. const DEFAULTS = merge(oldDefaults, newDefaults);
  5215. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5216. return Object.assign(endpoint, {
  5217. DEFAULTS,
  5218. defaults: withDefaults.bind(null, DEFAULTS),
  5219. merge: merge.bind(null, DEFAULTS),
  5220. parse
  5221. });
  5222. }
  5223. const VERSION = "5.5.1";
  5224. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5225. // So we use RequestParameters and add method as additional required property.
  5226. const DEFAULTS = {
  5227. method: "GET",
  5228. baseUrl: "https://api.github.com",
  5229. headers: {
  5230. accept: "application/vnd.github.v3+json",
  5231. "user-agent": userAgent
  5232. },
  5233. mediaType: {
  5234. format: "",
  5235. previews: []
  5236. }
  5237. };
  5238. const endpoint = withDefaults(null, DEFAULTS);
  5239. exports.endpoint = endpoint;
  5240. //# sourceMappingURL=index.js.map
  5241. /***/ }),
  5242. /***/ 389:
  5243. /***/ (function(module, __unusedexports, __webpack_require__) {
  5244. "use strict";
  5245. const fs = __webpack_require__(747);
  5246. const shebangCommand = __webpack_require__(866);
  5247. function readShebang(command) {
  5248. // Read the first 150 bytes from the file
  5249. const size = 150;
  5250. let buffer;
  5251. if (Buffer.alloc) {
  5252. // Node.js v4.5+ / v5.10+
  5253. buffer = Buffer.alloc(size);
  5254. } else {
  5255. // Old Node.js API
  5256. buffer = new Buffer(size);
  5257. buffer.fill(0); // zero-fill
  5258. }
  5259. let fd;
  5260. try {
  5261. fd = fs.openSync(command, 'r');
  5262. fs.readSync(fd, buffer, 0, size, 0);
  5263. fs.closeSync(fd);
  5264. } catch (e) { /* Empty */ }
  5265. // Attempt to extract shebang (null is returned if not a shebang)
  5266. return shebangCommand(buffer.toString());
  5267. }
  5268. module.exports = readShebang;
  5269. /***/ }),
  5270. /***/ 402:
  5271. /***/ (function(module, __unusedexports, __webpack_require__) {
  5272. module.exports = Octokit;
  5273. const { request } = __webpack_require__(753);
  5274. const Hook = __webpack_require__(523);
  5275. const parseClientOptions = __webpack_require__(294);
  5276. function Octokit(plugins, options) {
  5277. options = options || {};
  5278. const hook = new Hook.Collection();
  5279. const log = Object.assign(
  5280. {
  5281. debug: () => {},
  5282. info: () => {},
  5283. warn: console.warn,
  5284. error: console.error
  5285. },
  5286. options && options.log
  5287. );
  5288. const api = {
  5289. hook,
  5290. log,
  5291. request: request.defaults(parseClientOptions(options, log, hook))
  5292. };
  5293. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5294. return api;
  5295. }
  5296. /***/ }),
  5297. /***/ 413:
  5298. /***/ (function(module) {
  5299. module.exports = require("stream");
  5300. /***/ }),
  5301. /***/ 427:
  5302. /***/ (function(module, __unusedexports, __webpack_require__) {
  5303. "use strict";
  5304. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5305. // In that case, fall back to a deprecated internal.
  5306. const util = __webpack_require__(669);
  5307. let uv;
  5308. if (typeof util.getSystemErrorName === 'function') {
  5309. module.exports = util.getSystemErrorName;
  5310. } else {
  5311. try {
  5312. uv = process.binding('uv');
  5313. if (typeof uv.errname !== 'function') {
  5314. throw new TypeError('uv.errname is not a function');
  5315. }
  5316. } catch (err) {
  5317. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5318. uv = null;
  5319. }
  5320. module.exports = code => errname(uv, code);
  5321. }
  5322. // Used for testing the fallback behavior
  5323. module.exports.__test__ = errname;
  5324. function errname(uv, code) {
  5325. if (uv) {
  5326. return uv.errname(code);
  5327. }
  5328. if (!(code < 0)) {
  5329. throw new Error('err >= 0');
  5330. }
  5331. return `Unknown system error ${code}`;
  5332. }
  5333. /***/ }),
  5334. /***/ 430:
  5335. /***/ (function(module, __unusedexports, __webpack_require__) {
  5336. module.exports = octokitValidate;
  5337. const validate = __webpack_require__(348);
  5338. function octokitValidate(octokit) {
  5339. octokit.hook.before("request", validate.bind(null, octokit));
  5340. }
  5341. /***/ }),
  5342. /***/ 431:
  5343. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5344. "use strict";
  5345. Object.defineProperty(exports, "__esModule", { value: true });
  5346. const os = __webpack_require__(87);
  5347. /**
  5348. * Commands
  5349. *
  5350. * Command Format:
  5351. * ##[name key=value;key=value]message
  5352. *
  5353. * Examples:
  5354. * ##[warning]This is the user warning message
  5355. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5356. */
  5357. function issueCommand(command, properties, message) {
  5358. const cmd = new Command(command, properties, message);
  5359. process.stdout.write(cmd.toString() + os.EOL);
  5360. }
  5361. exports.issueCommand = issueCommand;
  5362. function issue(name, message = '') {
  5363. issueCommand(name, {}, message);
  5364. }
  5365. exports.issue = issue;
  5366. const CMD_STRING = '::';
  5367. class Command {
  5368. constructor(command, properties, message) {
  5369. if (!command) {
  5370. command = 'missing.command';
  5371. }
  5372. this.command = command;
  5373. this.properties = properties;
  5374. this.message = message;
  5375. }
  5376. toString() {
  5377. let cmdStr = CMD_STRING + this.command;
  5378. if (this.properties && Object.keys(this.properties).length > 0) {
  5379. cmdStr += ' ';
  5380. for (const key in this.properties) {
  5381. if (this.properties.hasOwnProperty(key)) {
  5382. const val = this.properties[key];
  5383. if (val) {
  5384. // safely append the val - avoid blowing up when attempting to
  5385. // call .replace() if message is not a string for some reason
  5386. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5387. }
  5388. }
  5389. }
  5390. }
  5391. cmdStr += CMD_STRING;
  5392. // safely append the message - avoid blowing up when attempting to
  5393. // call .replace() if message is not a string for some reason
  5394. const message = `${this.message || ''}`;
  5395. cmdStr += escapeData(message);
  5396. return cmdStr;
  5397. }
  5398. }
  5399. function escapeData(s) {
  5400. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5401. }
  5402. function escape(s) {
  5403. return s
  5404. .replace(/\r/g, '%0D')
  5405. .replace(/\n/g, '%0A')
  5406. .replace(/]/g, '%5D')
  5407. .replace(/;/g, '%3B');
  5408. }
  5409. //# sourceMappingURL=command.js.map
  5410. /***/ }),
  5411. /***/ 453:
  5412. /***/ (function(module, __unusedexports, __webpack_require__) {
  5413. var once = __webpack_require__(969)
  5414. var eos = __webpack_require__(562)
  5415. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5416. var noop = function () {}
  5417. var ancient = /^v?\.0/.test(process.version)
  5418. var isFn = function (fn) {
  5419. return typeof fn === 'function'
  5420. }
  5421. var isFS = function (stream) {
  5422. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5423. if (!fs) return false // browser
  5424. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5425. }
  5426. var isRequest = function (stream) {
  5427. return stream.setHeader && isFn(stream.abort)
  5428. }
  5429. var destroyer = function (stream, reading, writing, callback) {
  5430. callback = once(callback)
  5431. var closed = false
  5432. stream.on('close', function () {
  5433. closed = true
  5434. })
  5435. eos(stream, {readable: reading, writable: writing}, function (err) {
  5436. if (err) return callback(err)
  5437. closed = true
  5438. callback()
  5439. })
  5440. var destroyed = false
  5441. return function (err) {
  5442. if (closed) return
  5443. if (destroyed) return
  5444. destroyed = true
  5445. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5446. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5447. if (isFn(stream.destroy)) return stream.destroy()
  5448. callback(err || new Error('stream was destroyed'))
  5449. }
  5450. }
  5451. var call = function (fn) {
  5452. fn()
  5453. }
  5454. var pipe = function (from, to) {
  5455. return from.pipe(to)
  5456. }
  5457. var pump = function () {
  5458. var streams = Array.prototype.slice.call(arguments)
  5459. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5460. if (Array.isArray(streams[0])) streams = streams[0]
  5461. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5462. var error
  5463. var destroys = streams.map(function (stream, i) {
  5464. var reading = i < streams.length - 1
  5465. var writing = i > 0
  5466. return destroyer(stream, reading, writing, function (err) {
  5467. if (!error) error = err
  5468. if (err) destroys.forEach(call)
  5469. if (reading) return
  5470. destroys.forEach(call)
  5471. callback(error)
  5472. })
  5473. })
  5474. return streams.reduce(pipe)
  5475. }
  5476. module.exports = pump
  5477. /***/ }),
  5478. /***/ 454:
  5479. /***/ (function(module, exports, __webpack_require__) {
  5480. "use strict";
  5481. Object.defineProperty(exports, '__esModule', { value: true });
  5482. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5483. var Stream = _interopDefault(__webpack_require__(413));
  5484. var http = _interopDefault(__webpack_require__(605));
  5485. var Url = _interopDefault(__webpack_require__(835));
  5486. var https = _interopDefault(__webpack_require__(211));
  5487. var zlib = _interopDefault(__webpack_require__(761));
  5488. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5489. // fix for "Readable" isn't a named export issue
  5490. const Readable = Stream.Readable;
  5491. const BUFFER = Symbol('buffer');
  5492. const TYPE = Symbol('type');
  5493. class Blob {
  5494. constructor() {
  5495. this[TYPE] = '';
  5496. const blobParts = arguments[0];
  5497. const options = arguments[1];
  5498. const buffers = [];
  5499. let size = 0;
  5500. if (blobParts) {
  5501. const a = blobParts;
  5502. const length = Number(a.length);
  5503. for (let i = 0; i < length; i++) {
  5504. const element = a[i];
  5505. let buffer;
  5506. if (element instanceof Buffer) {
  5507. buffer = element;
  5508. } else if (ArrayBuffer.isView(element)) {
  5509. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5510. } else if (element instanceof ArrayBuffer) {
  5511. buffer = Buffer.from(element);
  5512. } else if (element instanceof Blob) {
  5513. buffer = element[BUFFER];
  5514. } else {
  5515. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5516. }
  5517. size += buffer.length;
  5518. buffers.push(buffer);
  5519. }
  5520. }
  5521. this[BUFFER] = Buffer.concat(buffers);
  5522. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5523. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5524. this[TYPE] = type;
  5525. }
  5526. }
  5527. get size() {
  5528. return this[BUFFER].length;
  5529. }
  5530. get type() {
  5531. return this[TYPE];
  5532. }
  5533. text() {
  5534. return Promise.resolve(this[BUFFER].toString());
  5535. }
  5536. arrayBuffer() {
  5537. const buf = this[BUFFER];
  5538. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5539. return Promise.resolve(ab);
  5540. }
  5541. stream() {
  5542. const readable = new Readable();
  5543. readable._read = function () {};
  5544. readable.push(this[BUFFER]);
  5545. readable.push(null);
  5546. return readable;
  5547. }
  5548. toString() {
  5549. return '[object Blob]';
  5550. }
  5551. slice() {
  5552. const size = this.size;
  5553. const start = arguments[0];
  5554. const end = arguments[1];
  5555. let relativeStart, relativeEnd;
  5556. if (start === undefined) {
  5557. relativeStart = 0;
  5558. } else if (start < 0) {
  5559. relativeStart = Math.max(size + start, 0);
  5560. } else {
  5561. relativeStart = Math.min(start, size);
  5562. }
  5563. if (end === undefined) {
  5564. relativeEnd = size;
  5565. } else if (end < 0) {
  5566. relativeEnd = Math.max(size + end, 0);
  5567. } else {
  5568. relativeEnd = Math.min(end, size);
  5569. }
  5570. const span = Math.max(relativeEnd - relativeStart, 0);
  5571. const buffer = this[BUFFER];
  5572. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5573. const blob = new Blob([], { type: arguments[2] });
  5574. blob[BUFFER] = slicedBuffer;
  5575. return blob;
  5576. }
  5577. }
  5578. Object.defineProperties(Blob.prototype, {
  5579. size: { enumerable: true },
  5580. type: { enumerable: true },
  5581. slice: { enumerable: true }
  5582. });
  5583. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5584. value: 'Blob',
  5585. writable: false,
  5586. enumerable: false,
  5587. configurable: true
  5588. });
  5589. /**
  5590. * fetch-error.js
  5591. *
  5592. * FetchError interface for operational errors
  5593. */
  5594. /**
  5595. * Create FetchError instance
  5596. *
  5597. * @param String message Error message for human
  5598. * @param String type Error type for machine
  5599. * @param String systemError For Node.js system error
  5600. * @return FetchError
  5601. */
  5602. function FetchError(message, type, systemError) {
  5603. Error.call(this, message);
  5604. this.message = message;
  5605. this.type = type;
  5606. // when err.type is `system`, err.code contains system error code
  5607. if (systemError) {
  5608. this.code = this.errno = systemError.code;
  5609. }
  5610. // hide custom error implementation details from end-users
  5611. Error.captureStackTrace(this, this.constructor);
  5612. }
  5613. FetchError.prototype = Object.create(Error.prototype);
  5614. FetchError.prototype.constructor = FetchError;
  5615. FetchError.prototype.name = 'FetchError';
  5616. let convert;
  5617. try {
  5618. convert = __webpack_require__(18).convert;
  5619. } catch (e) {}
  5620. const INTERNALS = Symbol('Body internals');
  5621. // fix an issue where "PassThrough" isn't a named export for node <10
  5622. const PassThrough = Stream.PassThrough;
  5623. /**
  5624. * Body mixin
  5625. *
  5626. * Ref: https://fetch.spec.whatwg.org/#body
  5627. *
  5628. * @param Stream body Readable stream
  5629. * @param Object opts Response options
  5630. * @return Void
  5631. */
  5632. function Body(body) {
  5633. var _this = this;
  5634. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5635. _ref$size = _ref.size;
  5636. let size = _ref$size === undefined ? 0 : _ref$size;
  5637. var _ref$timeout = _ref.timeout;
  5638. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5639. if (body == null) {
  5640. // body is undefined or null
  5641. body = null;
  5642. } else if (isURLSearchParams(body)) {
  5643. // body is a URLSearchParams
  5644. body = Buffer.from(body.toString());
  5645. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5646. // body is ArrayBuffer
  5647. body = Buffer.from(body);
  5648. } else if (ArrayBuffer.isView(body)) {
  5649. // body is ArrayBufferView
  5650. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5651. } else if (body instanceof Stream) ; else {
  5652. // none of the above
  5653. // coerce to string then buffer
  5654. body = Buffer.from(String(body));
  5655. }
  5656. this[INTERNALS] = {
  5657. body,
  5658. disturbed: false,
  5659. error: null
  5660. };
  5661. this.size = size;
  5662. this.timeout = timeout;
  5663. if (body instanceof Stream) {
  5664. body.on('error', function (err) {
  5665. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5666. _this[INTERNALS].error = error;
  5667. });
  5668. }
  5669. }
  5670. Body.prototype = {
  5671. get body() {
  5672. return this[INTERNALS].body;
  5673. },
  5674. get bodyUsed() {
  5675. return this[INTERNALS].disturbed;
  5676. },
  5677. /**
  5678. * Decode response as ArrayBuffer
  5679. *
  5680. * @return Promise
  5681. */
  5682. arrayBuffer() {
  5683. return consumeBody.call(this).then(function (buf) {
  5684. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5685. });
  5686. },
  5687. /**
  5688. * Return raw response as Blob
  5689. *
  5690. * @return Promise
  5691. */
  5692. blob() {
  5693. let ct = this.headers && this.headers.get('content-type') || '';
  5694. return consumeBody.call(this).then(function (buf) {
  5695. return Object.assign(
  5696. // Prevent copying
  5697. new Blob([], {
  5698. type: ct.toLowerCase()
  5699. }), {
  5700. [BUFFER]: buf
  5701. });
  5702. });
  5703. },
  5704. /**
  5705. * Decode response as json
  5706. *
  5707. * @return Promise
  5708. */
  5709. json() {
  5710. var _this2 = this;
  5711. return consumeBody.call(this).then(function (buffer) {
  5712. try {
  5713. return JSON.parse(buffer.toString());
  5714. } catch (err) {
  5715. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5716. }
  5717. });
  5718. },
  5719. /**
  5720. * Decode response as text
  5721. *
  5722. * @return Promise
  5723. */
  5724. text() {
  5725. return consumeBody.call(this).then(function (buffer) {
  5726. return buffer.toString();
  5727. });
  5728. },
  5729. /**
  5730. * Decode response as buffer (non-spec api)
  5731. *
  5732. * @return Promise
  5733. */
  5734. buffer() {
  5735. return consumeBody.call(this);
  5736. },
  5737. /**
  5738. * Decode response as text, while automatically detecting the encoding and
  5739. * trying to decode to UTF-8 (non-spec api)
  5740. *
  5741. * @return Promise
  5742. */
  5743. textConverted() {
  5744. var _this3 = this;
  5745. return consumeBody.call(this).then(function (buffer) {
  5746. return convertBody(buffer, _this3.headers);
  5747. });
  5748. }
  5749. };
  5750. // In browsers, all properties are enumerable.
  5751. Object.defineProperties(Body.prototype, {
  5752. body: { enumerable: true },
  5753. bodyUsed: { enumerable: true },
  5754. arrayBuffer: { enumerable: true },
  5755. blob: { enumerable: true },
  5756. json: { enumerable: true },
  5757. text: { enumerable: true }
  5758. });
  5759. Body.mixIn = function (proto) {
  5760. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5761. // istanbul ignore else: future proof
  5762. if (!(name in proto)) {
  5763. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5764. Object.defineProperty(proto, name, desc);
  5765. }
  5766. }
  5767. };
  5768. /**
  5769. * Consume and convert an entire Body to a Buffer.
  5770. *
  5771. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5772. *
  5773. * @return Promise
  5774. */
  5775. function consumeBody() {
  5776. var _this4 = this;
  5777. if (this[INTERNALS].disturbed) {
  5778. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5779. }
  5780. this[INTERNALS].disturbed = true;
  5781. if (this[INTERNALS].error) {
  5782. return Body.Promise.reject(this[INTERNALS].error);
  5783. }
  5784. let body = this.body;
  5785. // body is null
  5786. if (body === null) {
  5787. return Body.Promise.resolve(Buffer.alloc(0));
  5788. }
  5789. // body is blob
  5790. if (isBlob(body)) {
  5791. body = body.stream();
  5792. }
  5793. // body is buffer
  5794. if (Buffer.isBuffer(body)) {
  5795. return Body.Promise.resolve(body);
  5796. }
  5797. // istanbul ignore if: should never happen
  5798. if (!(body instanceof Stream)) {
  5799. return Body.Promise.resolve(Buffer.alloc(0));
  5800. }
  5801. // body is stream
  5802. // get ready to actually consume the body
  5803. let accum = [];
  5804. let accumBytes = 0;
  5805. let abort = false;
  5806. return new Body.Promise(function (resolve, reject) {
  5807. let resTimeout;
  5808. // allow timeout on slow response body
  5809. if (_this4.timeout) {
  5810. resTimeout = setTimeout(function () {
  5811. abort = true;
  5812. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  5813. }, _this4.timeout);
  5814. }
  5815. // handle stream errors
  5816. body.on('error', function (err) {
  5817. if (err.name === 'AbortError') {
  5818. // if the request was aborted, reject with this Error
  5819. abort = true;
  5820. reject(err);
  5821. } else {
  5822. // other errors, such as incorrect content-encoding
  5823. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  5824. }
  5825. });
  5826. body.on('data', function (chunk) {
  5827. if (abort || chunk === null) {
  5828. return;
  5829. }
  5830. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  5831. abort = true;
  5832. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  5833. return;
  5834. }
  5835. accumBytes += chunk.length;
  5836. accum.push(chunk);
  5837. });
  5838. body.on('end', function () {
  5839. if (abort) {
  5840. return;
  5841. }
  5842. clearTimeout(resTimeout);
  5843. try {
  5844. resolve(Buffer.concat(accum, accumBytes));
  5845. } catch (err) {
  5846. // handle streams that have accumulated too much data (issue #414)
  5847. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  5848. }
  5849. });
  5850. });
  5851. }
  5852. /**
  5853. * Detect buffer encoding and convert to target encoding
  5854. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  5855. *
  5856. * @param Buffer buffer Incoming buffer
  5857. * @param String encoding Target encoding
  5858. * @return String
  5859. */
  5860. function convertBody(buffer, headers) {
  5861. if (typeof convert !== 'function') {
  5862. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  5863. }
  5864. const ct = headers.get('content-type');
  5865. let charset = 'utf-8';
  5866. let res, str;
  5867. // header
  5868. if (ct) {
  5869. res = /charset=([^;]*)/i.exec(ct);
  5870. }
  5871. // no charset in content type, peek at response body for at most 1024 bytes
  5872. str = buffer.slice(0, 1024).toString();
  5873. // html5
  5874. if (!res && str) {
  5875. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  5876. }
  5877. // html4
  5878. if (!res && str) {
  5879. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  5880. if (res) {
  5881. res = /charset=(.*)/i.exec(res.pop());
  5882. }
  5883. }
  5884. // xml
  5885. if (!res && str) {
  5886. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  5887. }
  5888. // found charset
  5889. if (res) {
  5890. charset = res.pop();
  5891. // prevent decode issues when sites use incorrect encoding
  5892. // ref: https://hsivonen.fi/encoding-menu/
  5893. if (charset === 'gb2312' || charset === 'gbk') {
  5894. charset = 'gb18030';
  5895. }
  5896. }
  5897. // turn raw buffers into a single utf-8 buffer
  5898. return convert(buffer, 'UTF-8', charset).toString();
  5899. }
  5900. /**
  5901. * Detect a URLSearchParams object
  5902. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  5903. *
  5904. * @param Object obj Object to detect by type or brand
  5905. * @return String
  5906. */
  5907. function isURLSearchParams(obj) {
  5908. // Duck-typing as a necessary condition.
  5909. 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') {
  5910. return false;
  5911. }
  5912. // Brand-checking and more duck-typing as optional condition.
  5913. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  5914. }
  5915. /**
  5916. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  5917. * @param {*} obj
  5918. * @return {boolean}
  5919. */
  5920. function isBlob(obj) {
  5921. 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]);
  5922. }
  5923. /**
  5924. * Clone body given Res/Req instance
  5925. *
  5926. * @param Mixed instance Response or Request instance
  5927. * @return Mixed
  5928. */
  5929. function clone(instance) {
  5930. let p1, p2;
  5931. let body = instance.body;
  5932. // don't allow cloning a used body
  5933. if (instance.bodyUsed) {
  5934. throw new Error('cannot clone body after it is used');
  5935. }
  5936. // check that body is a stream and not form-data object
  5937. // note: we can't clone the form-data object without having it as a dependency
  5938. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  5939. // tee instance body
  5940. p1 = new PassThrough();
  5941. p2 = new PassThrough();
  5942. body.pipe(p1);
  5943. body.pipe(p2);
  5944. // set instance body to teed body and return the other teed body
  5945. instance[INTERNALS].body = p1;
  5946. body = p2;
  5947. }
  5948. return body;
  5949. }
  5950. /**
  5951. * Performs the operation "extract a `Content-Type` value from |object|" as
  5952. * specified in the specification:
  5953. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  5954. *
  5955. * This function assumes that instance.body is present.
  5956. *
  5957. * @param Mixed instance Any options.body input
  5958. */
  5959. function extractContentType(body) {
  5960. if (body === null) {
  5961. // body is null
  5962. return null;
  5963. } else if (typeof body === 'string') {
  5964. // body is string
  5965. return 'text/plain;charset=UTF-8';
  5966. } else if (isURLSearchParams(body)) {
  5967. // body is a URLSearchParams
  5968. return 'application/x-www-form-urlencoded;charset=UTF-8';
  5969. } else if (isBlob(body)) {
  5970. // body is blob
  5971. return body.type || null;
  5972. } else if (Buffer.isBuffer(body)) {
  5973. // body is buffer
  5974. return null;
  5975. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5976. // body is ArrayBuffer
  5977. return null;
  5978. } else if (ArrayBuffer.isView(body)) {
  5979. // body is ArrayBufferView
  5980. return null;
  5981. } else if (typeof body.getBoundary === 'function') {
  5982. // detect form data input from form-data module
  5983. return `multipart/form-data;boundary=${body.getBoundary()}`;
  5984. } else if (body instanceof Stream) {
  5985. // body is stream
  5986. // can't really do much about this
  5987. return null;
  5988. } else {
  5989. // Body constructor defaults other things to string
  5990. return 'text/plain;charset=UTF-8';
  5991. }
  5992. }
  5993. /**
  5994. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  5995. * For us, we have to explicitly get it with a function.
  5996. *
  5997. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  5998. *
  5999. * @param Body instance Instance of Body
  6000. * @return Number? Number of bytes, or null if not possible
  6001. */
  6002. function getTotalBytes(instance) {
  6003. const body = instance.body;
  6004. if (body === null) {
  6005. // body is null
  6006. return 0;
  6007. } else if (isBlob(body)) {
  6008. return body.size;
  6009. } else if (Buffer.isBuffer(body)) {
  6010. // body is buffer
  6011. return body.length;
  6012. } else if (body && typeof body.getLengthSync === 'function') {
  6013. // detect form data input from form-data module
  6014. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6015. body.hasKnownLength && body.hasKnownLength()) {
  6016. // 2.x
  6017. return body.getLengthSync();
  6018. }
  6019. return null;
  6020. } else {
  6021. // body is stream
  6022. return null;
  6023. }
  6024. }
  6025. /**
  6026. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6027. *
  6028. * @param Body instance Instance of Body
  6029. * @return Void
  6030. */
  6031. function writeToStream(dest, instance) {
  6032. const body = instance.body;
  6033. if (body === null) {
  6034. // body is null
  6035. dest.end();
  6036. } else if (isBlob(body)) {
  6037. body.stream().pipe(dest);
  6038. } else if (Buffer.isBuffer(body)) {
  6039. // body is buffer
  6040. dest.write(body);
  6041. dest.end();
  6042. } else {
  6043. // body is stream
  6044. body.pipe(dest);
  6045. }
  6046. }
  6047. // expose Promise
  6048. Body.Promise = global.Promise;
  6049. /**
  6050. * headers.js
  6051. *
  6052. * Headers class offers convenient helpers
  6053. */
  6054. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6055. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6056. function validateName(name) {
  6057. name = `${name}`;
  6058. if (invalidTokenRegex.test(name) || name === '') {
  6059. throw new TypeError(`${name} is not a legal HTTP header name`);
  6060. }
  6061. }
  6062. function validateValue(value) {
  6063. value = `${value}`;
  6064. if (invalidHeaderCharRegex.test(value)) {
  6065. throw new TypeError(`${value} is not a legal HTTP header value`);
  6066. }
  6067. }
  6068. /**
  6069. * Find the key in the map object given a header name.
  6070. *
  6071. * Returns undefined if not found.
  6072. *
  6073. * @param String name Header name
  6074. * @return String|Undefined
  6075. */
  6076. function find(map, name) {
  6077. name = name.toLowerCase();
  6078. for (const key in map) {
  6079. if (key.toLowerCase() === name) {
  6080. return key;
  6081. }
  6082. }
  6083. return undefined;
  6084. }
  6085. const MAP = Symbol('map');
  6086. class Headers {
  6087. /**
  6088. * Headers class
  6089. *
  6090. * @param Object headers Response headers
  6091. * @return Void
  6092. */
  6093. constructor() {
  6094. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6095. this[MAP] = Object.create(null);
  6096. if (init instanceof Headers) {
  6097. const rawHeaders = init.raw();
  6098. const headerNames = Object.keys(rawHeaders);
  6099. for (const headerName of headerNames) {
  6100. for (const value of rawHeaders[headerName]) {
  6101. this.append(headerName, value);
  6102. }
  6103. }
  6104. return;
  6105. }
  6106. // We don't worry about converting prop to ByteString here as append()
  6107. // will handle it.
  6108. if (init == null) ; else if (typeof init === 'object') {
  6109. const method = init[Symbol.iterator];
  6110. if (method != null) {
  6111. if (typeof method !== 'function') {
  6112. throw new TypeError('Header pairs must be iterable');
  6113. }
  6114. // sequence<sequence<ByteString>>
  6115. // Note: per spec we have to first exhaust the lists then process them
  6116. const pairs = [];
  6117. for (const pair of init) {
  6118. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6119. throw new TypeError('Each header pair must be iterable');
  6120. }
  6121. pairs.push(Array.from(pair));
  6122. }
  6123. for (const pair of pairs) {
  6124. if (pair.length !== 2) {
  6125. throw new TypeError('Each header pair must be a name/value tuple');
  6126. }
  6127. this.append(pair[0], pair[1]);
  6128. }
  6129. } else {
  6130. // record<ByteString, ByteString>
  6131. for (const key of Object.keys(init)) {
  6132. const value = init[key];
  6133. this.append(key, value);
  6134. }
  6135. }
  6136. } else {
  6137. throw new TypeError('Provided initializer must be an object');
  6138. }
  6139. }
  6140. /**
  6141. * Return combined header value given name
  6142. *
  6143. * @param String name Header name
  6144. * @return Mixed
  6145. */
  6146. get(name) {
  6147. name = `${name}`;
  6148. validateName(name);
  6149. const key = find(this[MAP], name);
  6150. if (key === undefined) {
  6151. return null;
  6152. }
  6153. return this[MAP][key].join(', ');
  6154. }
  6155. /**
  6156. * Iterate over all headers
  6157. *
  6158. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6159. * @param Boolean thisArg `this` context for callback function
  6160. * @return Void
  6161. */
  6162. forEach(callback) {
  6163. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6164. let pairs = getHeaders(this);
  6165. let i = 0;
  6166. while (i < pairs.length) {
  6167. var _pairs$i = pairs[i];
  6168. const name = _pairs$i[0],
  6169. value = _pairs$i[1];
  6170. callback.call(thisArg, value, name, this);
  6171. pairs = getHeaders(this);
  6172. i++;
  6173. }
  6174. }
  6175. /**
  6176. * Overwrite header values given name
  6177. *
  6178. * @param String name Header name
  6179. * @param String value Header value
  6180. * @return Void
  6181. */
  6182. set(name, value) {
  6183. name = `${name}`;
  6184. value = `${value}`;
  6185. validateName(name);
  6186. validateValue(value);
  6187. const key = find(this[MAP], name);
  6188. this[MAP][key !== undefined ? key : name] = [value];
  6189. }
  6190. /**
  6191. * Append a value onto existing header
  6192. *
  6193. * @param String name Header name
  6194. * @param String value Header value
  6195. * @return Void
  6196. */
  6197. append(name, value) {
  6198. name = `${name}`;
  6199. value = `${value}`;
  6200. validateName(name);
  6201. validateValue(value);
  6202. const key = find(this[MAP], name);
  6203. if (key !== undefined) {
  6204. this[MAP][key].push(value);
  6205. } else {
  6206. this[MAP][name] = [value];
  6207. }
  6208. }
  6209. /**
  6210. * Check for header name existence
  6211. *
  6212. * @param String name Header name
  6213. * @return Boolean
  6214. */
  6215. has(name) {
  6216. name = `${name}`;
  6217. validateName(name);
  6218. return find(this[MAP], name) !== undefined;
  6219. }
  6220. /**
  6221. * Delete all header values given name
  6222. *
  6223. * @param String name Header name
  6224. * @return Void
  6225. */
  6226. delete(name) {
  6227. name = `${name}`;
  6228. validateName(name);
  6229. const key = find(this[MAP], name);
  6230. if (key !== undefined) {
  6231. delete this[MAP][key];
  6232. }
  6233. }
  6234. /**
  6235. * Return raw headers (non-spec api)
  6236. *
  6237. * @return Object
  6238. */
  6239. raw() {
  6240. return this[MAP];
  6241. }
  6242. /**
  6243. * Get an iterator on keys.
  6244. *
  6245. * @return Iterator
  6246. */
  6247. keys() {
  6248. return createHeadersIterator(this, 'key');
  6249. }
  6250. /**
  6251. * Get an iterator on values.
  6252. *
  6253. * @return Iterator
  6254. */
  6255. values() {
  6256. return createHeadersIterator(this, 'value');
  6257. }
  6258. /**
  6259. * Get an iterator on entries.
  6260. *
  6261. * This is the default iterator of the Headers object.
  6262. *
  6263. * @return Iterator
  6264. */
  6265. [Symbol.iterator]() {
  6266. return createHeadersIterator(this, 'key+value');
  6267. }
  6268. }
  6269. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6270. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6271. value: 'Headers',
  6272. writable: false,
  6273. enumerable: false,
  6274. configurable: true
  6275. });
  6276. Object.defineProperties(Headers.prototype, {
  6277. get: { enumerable: true },
  6278. forEach: { enumerable: true },
  6279. set: { enumerable: true },
  6280. append: { enumerable: true },
  6281. has: { enumerable: true },
  6282. delete: { enumerable: true },
  6283. keys: { enumerable: true },
  6284. values: { enumerable: true },
  6285. entries: { enumerable: true }
  6286. });
  6287. function getHeaders(headers) {
  6288. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6289. const keys = Object.keys(headers[MAP]).sort();
  6290. return keys.map(kind === 'key' ? function (k) {
  6291. return k.toLowerCase();
  6292. } : kind === 'value' ? function (k) {
  6293. return headers[MAP][k].join(', ');
  6294. } : function (k) {
  6295. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6296. });
  6297. }
  6298. const INTERNAL = Symbol('internal');
  6299. function createHeadersIterator(target, kind) {
  6300. const iterator = Object.create(HeadersIteratorPrototype);
  6301. iterator[INTERNAL] = {
  6302. target,
  6303. kind,
  6304. index: 0
  6305. };
  6306. return iterator;
  6307. }
  6308. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6309. next() {
  6310. // istanbul ignore if
  6311. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6312. throw new TypeError('Value of `this` is not a HeadersIterator');
  6313. }
  6314. var _INTERNAL = this[INTERNAL];
  6315. const target = _INTERNAL.target,
  6316. kind = _INTERNAL.kind,
  6317. index = _INTERNAL.index;
  6318. const values = getHeaders(target, kind);
  6319. const len = values.length;
  6320. if (index >= len) {
  6321. return {
  6322. value: undefined,
  6323. done: true
  6324. };
  6325. }
  6326. this[INTERNAL].index = index + 1;
  6327. return {
  6328. value: values[index],
  6329. done: false
  6330. };
  6331. }
  6332. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6333. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6334. value: 'HeadersIterator',
  6335. writable: false,
  6336. enumerable: false,
  6337. configurable: true
  6338. });
  6339. /**
  6340. * Export the Headers object in a form that Node.js can consume.
  6341. *
  6342. * @param Headers headers
  6343. * @return Object
  6344. */
  6345. function exportNodeCompatibleHeaders(headers) {
  6346. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6347. // http.request() only supports string as Host header. This hack makes
  6348. // specifying custom Host header possible.
  6349. const hostHeaderKey = find(headers[MAP], 'Host');
  6350. if (hostHeaderKey !== undefined) {
  6351. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6352. }
  6353. return obj;
  6354. }
  6355. /**
  6356. * Create a Headers object from an object of headers, ignoring those that do
  6357. * not conform to HTTP grammar productions.
  6358. *
  6359. * @param Object obj Object of headers
  6360. * @return Headers
  6361. */
  6362. function createHeadersLenient(obj) {
  6363. const headers = new Headers();
  6364. for (const name of Object.keys(obj)) {
  6365. if (invalidTokenRegex.test(name)) {
  6366. continue;
  6367. }
  6368. if (Array.isArray(obj[name])) {
  6369. for (const val of obj[name]) {
  6370. if (invalidHeaderCharRegex.test(val)) {
  6371. continue;
  6372. }
  6373. if (headers[MAP][name] === undefined) {
  6374. headers[MAP][name] = [val];
  6375. } else {
  6376. headers[MAP][name].push(val);
  6377. }
  6378. }
  6379. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6380. headers[MAP][name] = [obj[name]];
  6381. }
  6382. }
  6383. return headers;
  6384. }
  6385. const INTERNALS$1 = Symbol('Response internals');
  6386. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6387. const STATUS_CODES = http.STATUS_CODES;
  6388. /**
  6389. * Response class
  6390. *
  6391. * @param Stream body Readable stream
  6392. * @param Object opts Response options
  6393. * @return Void
  6394. */
  6395. class Response {
  6396. constructor() {
  6397. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6398. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6399. Body.call(this, body, opts);
  6400. const status = opts.status || 200;
  6401. const headers = new Headers(opts.headers);
  6402. if (body != null && !headers.has('Content-Type')) {
  6403. const contentType = extractContentType(body);
  6404. if (contentType) {
  6405. headers.append('Content-Type', contentType);
  6406. }
  6407. }
  6408. this[INTERNALS$1] = {
  6409. url: opts.url,
  6410. status,
  6411. statusText: opts.statusText || STATUS_CODES[status],
  6412. headers,
  6413. counter: opts.counter
  6414. };
  6415. }
  6416. get url() {
  6417. return this[INTERNALS$1].url || '';
  6418. }
  6419. get status() {
  6420. return this[INTERNALS$1].status;
  6421. }
  6422. /**
  6423. * Convenience property representing if the request ended normally
  6424. */
  6425. get ok() {
  6426. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6427. }
  6428. get redirected() {
  6429. return this[INTERNALS$1].counter > 0;
  6430. }
  6431. get statusText() {
  6432. return this[INTERNALS$1].statusText;
  6433. }
  6434. get headers() {
  6435. return this[INTERNALS$1].headers;
  6436. }
  6437. /**
  6438. * Clone this response
  6439. *
  6440. * @return Response
  6441. */
  6442. clone() {
  6443. return new Response(clone(this), {
  6444. url: this.url,
  6445. status: this.status,
  6446. statusText: this.statusText,
  6447. headers: this.headers,
  6448. ok: this.ok,
  6449. redirected: this.redirected
  6450. });
  6451. }
  6452. }
  6453. Body.mixIn(Response.prototype);
  6454. Object.defineProperties(Response.prototype, {
  6455. url: { enumerable: true },
  6456. status: { enumerable: true },
  6457. ok: { enumerable: true },
  6458. redirected: { enumerable: true },
  6459. statusText: { enumerable: true },
  6460. headers: { enumerable: true },
  6461. clone: { enumerable: true }
  6462. });
  6463. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6464. value: 'Response',
  6465. writable: false,
  6466. enumerable: false,
  6467. configurable: true
  6468. });
  6469. const INTERNALS$2 = Symbol('Request internals');
  6470. // fix an issue where "format", "parse" aren't a named export for node <10
  6471. const parse_url = Url.parse;
  6472. const format_url = Url.format;
  6473. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6474. /**
  6475. * Check if a value is an instance of Request.
  6476. *
  6477. * @param Mixed input
  6478. * @return Boolean
  6479. */
  6480. function isRequest(input) {
  6481. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6482. }
  6483. function isAbortSignal(signal) {
  6484. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6485. return !!(proto && proto.constructor.name === 'AbortSignal');
  6486. }
  6487. /**
  6488. * Request class
  6489. *
  6490. * @param Mixed input Url or Request instance
  6491. * @param Object init Custom options
  6492. * @return Void
  6493. */
  6494. class Request {
  6495. constructor(input) {
  6496. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6497. let parsedURL;
  6498. // normalize input
  6499. if (!isRequest(input)) {
  6500. if (input && input.href) {
  6501. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6502. // will fall into this branch also (since their `toString()` will return
  6503. // `href` property anyway)
  6504. parsedURL = parse_url(input.href);
  6505. } else {
  6506. // coerce input to a string before attempting to parse
  6507. parsedURL = parse_url(`${input}`);
  6508. }
  6509. input = {};
  6510. } else {
  6511. parsedURL = parse_url(input.url);
  6512. }
  6513. let method = init.method || input.method || 'GET';
  6514. method = method.toUpperCase();
  6515. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6516. throw new TypeError('Request with GET/HEAD method cannot have body');
  6517. }
  6518. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6519. Body.call(this, inputBody, {
  6520. timeout: init.timeout || input.timeout || 0,
  6521. size: init.size || input.size || 0
  6522. });
  6523. const headers = new Headers(init.headers || input.headers || {});
  6524. if (inputBody != null && !headers.has('Content-Type')) {
  6525. const contentType = extractContentType(inputBody);
  6526. if (contentType) {
  6527. headers.append('Content-Type', contentType);
  6528. }
  6529. }
  6530. let signal = isRequest(input) ? input.signal : null;
  6531. if ('signal' in init) signal = init.signal;
  6532. if (signal != null && !isAbortSignal(signal)) {
  6533. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6534. }
  6535. this[INTERNALS$2] = {
  6536. method,
  6537. redirect: init.redirect || input.redirect || 'follow',
  6538. headers,
  6539. parsedURL,
  6540. signal
  6541. };
  6542. // node-fetch-only options
  6543. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6544. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6545. this.counter = init.counter || input.counter || 0;
  6546. this.agent = init.agent || input.agent;
  6547. }
  6548. get method() {
  6549. return this[INTERNALS$2].method;
  6550. }
  6551. get url() {
  6552. return format_url(this[INTERNALS$2].parsedURL);
  6553. }
  6554. get headers() {
  6555. return this[INTERNALS$2].headers;
  6556. }
  6557. get redirect() {
  6558. return this[INTERNALS$2].redirect;
  6559. }
  6560. get signal() {
  6561. return this[INTERNALS$2].signal;
  6562. }
  6563. /**
  6564. * Clone this request
  6565. *
  6566. * @return Request
  6567. */
  6568. clone() {
  6569. return new Request(this);
  6570. }
  6571. }
  6572. Body.mixIn(Request.prototype);
  6573. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6574. value: 'Request',
  6575. writable: false,
  6576. enumerable: false,
  6577. configurable: true
  6578. });
  6579. Object.defineProperties(Request.prototype, {
  6580. method: { enumerable: true },
  6581. url: { enumerable: true },
  6582. headers: { enumerable: true },
  6583. redirect: { enumerable: true },
  6584. clone: { enumerable: true },
  6585. signal: { enumerable: true }
  6586. });
  6587. /**
  6588. * Convert a Request to Node.js http request options.
  6589. *
  6590. * @param Request A Request instance
  6591. * @return Object The options object to be passed to http.request
  6592. */
  6593. function getNodeRequestOptions(request) {
  6594. const parsedURL = request[INTERNALS$2].parsedURL;
  6595. const headers = new Headers(request[INTERNALS$2].headers);
  6596. // fetch step 1.3
  6597. if (!headers.has('Accept')) {
  6598. headers.set('Accept', '*/*');
  6599. }
  6600. // Basic fetch
  6601. if (!parsedURL.protocol || !parsedURL.hostname) {
  6602. throw new TypeError('Only absolute URLs are supported');
  6603. }
  6604. if (!/^https?:$/.test(parsedURL.protocol)) {
  6605. throw new TypeError('Only HTTP(S) protocols are supported');
  6606. }
  6607. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6608. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6609. }
  6610. // HTTP-network-or-cache fetch steps 2.4-2.7
  6611. let contentLengthValue = null;
  6612. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6613. contentLengthValue = '0';
  6614. }
  6615. if (request.body != null) {
  6616. const totalBytes = getTotalBytes(request);
  6617. if (typeof totalBytes === 'number') {
  6618. contentLengthValue = String(totalBytes);
  6619. }
  6620. }
  6621. if (contentLengthValue) {
  6622. headers.set('Content-Length', contentLengthValue);
  6623. }
  6624. // HTTP-network-or-cache fetch step 2.11
  6625. if (!headers.has('User-Agent')) {
  6626. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6627. }
  6628. // HTTP-network-or-cache fetch step 2.15
  6629. if (request.compress && !headers.has('Accept-Encoding')) {
  6630. headers.set('Accept-Encoding', 'gzip,deflate');
  6631. }
  6632. let agent = request.agent;
  6633. if (typeof agent === 'function') {
  6634. agent = agent(parsedURL);
  6635. }
  6636. if (!headers.has('Connection') && !agent) {
  6637. headers.set('Connection', 'close');
  6638. }
  6639. // HTTP-network fetch step 4.2
  6640. // chunked encoding is handled by Node.js
  6641. return Object.assign({}, parsedURL, {
  6642. method: request.method,
  6643. headers: exportNodeCompatibleHeaders(headers),
  6644. agent
  6645. });
  6646. }
  6647. /**
  6648. * abort-error.js
  6649. *
  6650. * AbortError interface for cancelled requests
  6651. */
  6652. /**
  6653. * Create AbortError instance
  6654. *
  6655. * @param String message Error message for human
  6656. * @return AbortError
  6657. */
  6658. function AbortError(message) {
  6659. Error.call(this, message);
  6660. this.type = 'aborted';
  6661. this.message = message;
  6662. // hide custom error implementation details from end-users
  6663. Error.captureStackTrace(this, this.constructor);
  6664. }
  6665. AbortError.prototype = Object.create(Error.prototype);
  6666. AbortError.prototype.constructor = AbortError;
  6667. AbortError.prototype.name = 'AbortError';
  6668. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6669. const PassThrough$1 = Stream.PassThrough;
  6670. const resolve_url = Url.resolve;
  6671. /**
  6672. * Fetch function
  6673. *
  6674. * @param Mixed url Absolute url or Request instance
  6675. * @param Object opts Fetch options
  6676. * @return Promise
  6677. */
  6678. function fetch(url, opts) {
  6679. // allow custom promise
  6680. if (!fetch.Promise) {
  6681. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6682. }
  6683. Body.Promise = fetch.Promise;
  6684. // wrap http.request into fetch
  6685. return new fetch.Promise(function (resolve, reject) {
  6686. // build request object
  6687. const request = new Request(url, opts);
  6688. const options = getNodeRequestOptions(request);
  6689. const send = (options.protocol === 'https:' ? https : http).request;
  6690. const signal = request.signal;
  6691. let response = null;
  6692. const abort = function abort() {
  6693. let error = new AbortError('The user aborted a request.');
  6694. reject(error);
  6695. if (request.body && request.body instanceof Stream.Readable) {
  6696. request.body.destroy(error);
  6697. }
  6698. if (!response || !response.body) return;
  6699. response.body.emit('error', error);
  6700. };
  6701. if (signal && signal.aborted) {
  6702. abort();
  6703. return;
  6704. }
  6705. const abortAndFinalize = function abortAndFinalize() {
  6706. abort();
  6707. finalize();
  6708. };
  6709. // send request
  6710. const req = send(options);
  6711. let reqTimeout;
  6712. if (signal) {
  6713. signal.addEventListener('abort', abortAndFinalize);
  6714. }
  6715. function finalize() {
  6716. req.abort();
  6717. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6718. clearTimeout(reqTimeout);
  6719. }
  6720. if (request.timeout) {
  6721. req.once('socket', function (socket) {
  6722. reqTimeout = setTimeout(function () {
  6723. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6724. finalize();
  6725. }, request.timeout);
  6726. });
  6727. }
  6728. req.on('error', function (err) {
  6729. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6730. finalize();
  6731. });
  6732. req.on('response', function (res) {
  6733. clearTimeout(reqTimeout);
  6734. const headers = createHeadersLenient(res.headers);
  6735. // HTTP fetch step 5
  6736. if (fetch.isRedirect(res.statusCode)) {
  6737. // HTTP fetch step 5.2
  6738. const location = headers.get('Location');
  6739. // HTTP fetch step 5.3
  6740. const locationURL = location === null ? null : resolve_url(request.url, location);
  6741. // HTTP fetch step 5.5
  6742. switch (request.redirect) {
  6743. case 'error':
  6744. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6745. finalize();
  6746. return;
  6747. case 'manual':
  6748. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6749. if (locationURL !== null) {
  6750. // handle corrupted header
  6751. try {
  6752. headers.set('Location', locationURL);
  6753. } catch (err) {
  6754. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6755. reject(err);
  6756. }
  6757. }
  6758. break;
  6759. case 'follow':
  6760. // HTTP-redirect fetch step 2
  6761. if (locationURL === null) {
  6762. break;
  6763. }
  6764. // HTTP-redirect fetch step 5
  6765. if (request.counter >= request.follow) {
  6766. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6767. finalize();
  6768. return;
  6769. }
  6770. // HTTP-redirect fetch step 6 (counter increment)
  6771. // Create a new Request object.
  6772. const requestOpts = {
  6773. headers: new Headers(request.headers),
  6774. follow: request.follow,
  6775. counter: request.counter + 1,
  6776. agent: request.agent,
  6777. compress: request.compress,
  6778. method: request.method,
  6779. body: request.body,
  6780. signal: request.signal,
  6781. timeout: request.timeout
  6782. };
  6783. // HTTP-redirect fetch step 9
  6784. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  6785. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  6786. finalize();
  6787. return;
  6788. }
  6789. // HTTP-redirect fetch step 11
  6790. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  6791. requestOpts.method = 'GET';
  6792. requestOpts.body = undefined;
  6793. requestOpts.headers.delete('content-length');
  6794. }
  6795. // HTTP-redirect fetch step 15
  6796. resolve(fetch(new Request(locationURL, requestOpts)));
  6797. finalize();
  6798. return;
  6799. }
  6800. }
  6801. // prepare response
  6802. res.once('end', function () {
  6803. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6804. });
  6805. let body = res.pipe(new PassThrough$1());
  6806. const response_options = {
  6807. url: request.url,
  6808. status: res.statusCode,
  6809. statusText: res.statusMessage,
  6810. headers: headers,
  6811. size: request.size,
  6812. timeout: request.timeout,
  6813. counter: request.counter
  6814. };
  6815. // HTTP-network fetch step 12.1.1.3
  6816. const codings = headers.get('Content-Encoding');
  6817. // HTTP-network fetch step 12.1.1.4: handle content codings
  6818. // in following scenarios we ignore compression support
  6819. // 1. compression support is disabled
  6820. // 2. HEAD request
  6821. // 3. no Content-Encoding header
  6822. // 4. no content response (204)
  6823. // 5. content not modified response (304)
  6824. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  6825. response = new Response(body, response_options);
  6826. resolve(response);
  6827. return;
  6828. }
  6829. // For Node v6+
  6830. // Be less strict when decoding compressed responses, since sometimes
  6831. // servers send slightly invalid responses that are still accepted
  6832. // by common browsers.
  6833. // Always using Z_SYNC_FLUSH is what cURL does.
  6834. const zlibOptions = {
  6835. flush: zlib.Z_SYNC_FLUSH,
  6836. finishFlush: zlib.Z_SYNC_FLUSH
  6837. };
  6838. // for gzip
  6839. if (codings == 'gzip' || codings == 'x-gzip') {
  6840. body = body.pipe(zlib.createGunzip(zlibOptions));
  6841. response = new Response(body, response_options);
  6842. resolve(response);
  6843. return;
  6844. }
  6845. // for deflate
  6846. if (codings == 'deflate' || codings == 'x-deflate') {
  6847. // handle the infamous raw deflate response from old servers
  6848. // a hack for old IIS and Apache servers
  6849. const raw = res.pipe(new PassThrough$1());
  6850. raw.once('data', function (chunk) {
  6851. // see http://stackoverflow.com/questions/37519828
  6852. if ((chunk[0] & 0x0F) === 0x08) {
  6853. body = body.pipe(zlib.createInflate());
  6854. } else {
  6855. body = body.pipe(zlib.createInflateRaw());
  6856. }
  6857. response = new Response(body, response_options);
  6858. resolve(response);
  6859. });
  6860. return;
  6861. }
  6862. // for br
  6863. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  6864. body = body.pipe(zlib.createBrotliDecompress());
  6865. response = new Response(body, response_options);
  6866. resolve(response);
  6867. return;
  6868. }
  6869. // otherwise, use response as-is
  6870. response = new Response(body, response_options);
  6871. resolve(response);
  6872. });
  6873. writeToStream(req, request);
  6874. });
  6875. }
  6876. /**
  6877. * Redirect code matching
  6878. *
  6879. * @param Number code Status code
  6880. * @return Boolean
  6881. */
  6882. fetch.isRedirect = function (code) {
  6883. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  6884. };
  6885. // expose Promise
  6886. fetch.Promise = global.Promise;
  6887. module.exports = exports = fetch;
  6888. Object.defineProperty(exports, "__esModule", { value: true });
  6889. exports.default = exports;
  6890. exports.Headers = Headers;
  6891. exports.Request = Request;
  6892. exports.Response = Response;
  6893. exports.FetchError = FetchError;
  6894. /***/ }),
  6895. /***/ 462:
  6896. /***/ (function(module) {
  6897. "use strict";
  6898. // See http://www.robvanderwoude.com/escapechars.php
  6899. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  6900. function escapeCommand(arg) {
  6901. // Escape meta chars
  6902. arg = arg.replace(metaCharsRegExp, '^$1');
  6903. return arg;
  6904. }
  6905. function escapeArgument(arg, doubleEscapeMetaChars) {
  6906. // Convert to string
  6907. arg = `${arg}`;
  6908. // Algorithm below is based on https://qntm.org/cmd
  6909. // Sequence of backslashes followed by a double quote:
  6910. // double up all the backslashes and escape the double quote
  6911. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  6912. // Sequence of backslashes followed by the end of the string
  6913. // (which will become a double quote later):
  6914. // double up all the backslashes
  6915. arg = arg.replace(/(\\*)$/, '$1$1');
  6916. // All other backslashes occur literally
  6917. // Quote the whole thing:
  6918. arg = `"${arg}"`;
  6919. // Escape meta chars
  6920. arg = arg.replace(metaCharsRegExp, '^$1');
  6921. // Double escape meta chars if necessary
  6922. if (doubleEscapeMetaChars) {
  6923. arg = arg.replace(metaCharsRegExp, '^$1');
  6924. }
  6925. return arg;
  6926. }
  6927. module.exports.command = escapeCommand;
  6928. module.exports.argument = escapeArgument;
  6929. /***/ }),
  6930. /***/ 463:
  6931. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6932. "use strict";
  6933. Object.defineProperty(exports, '__esModule', { value: true });
  6934. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6935. var deprecation = __webpack_require__(692);
  6936. var once = _interopDefault(__webpack_require__(969));
  6937. const logOnce = once(deprecation => console.warn(deprecation));
  6938. /**
  6939. * Error with extra properties to help with debugging
  6940. */
  6941. class RequestError extends Error {
  6942. constructor(message, statusCode, options) {
  6943. super(message); // Maintains proper stack trace (only available on V8)
  6944. /* istanbul ignore next */
  6945. if (Error.captureStackTrace) {
  6946. Error.captureStackTrace(this, this.constructor);
  6947. }
  6948. this.name = "HttpError";
  6949. this.status = statusCode;
  6950. Object.defineProperty(this, "code", {
  6951. get() {
  6952. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  6953. return statusCode;
  6954. }
  6955. });
  6956. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  6957. const requestCopy = Object.assign({}, options.request);
  6958. if (options.request.headers.authorization) {
  6959. requestCopy.headers = Object.assign({}, options.request.headers, {
  6960. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  6961. });
  6962. }
  6963. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  6964. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  6965. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  6966. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  6967. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  6968. this.request = requestCopy;
  6969. }
  6970. }
  6971. exports.RequestError = RequestError;
  6972. //# sourceMappingURL=index.js.map
  6973. /***/ }),
  6974. /***/ 464:
  6975. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6976. "use strict";
  6977. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6978. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6979. return new (P || (P = Promise))(function (resolve, reject) {
  6980. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6981. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6982. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6983. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6984. });
  6985. };
  6986. var __importStar = (this && this.__importStar) || function (mod) {
  6987. if (mod && mod.__esModule) return mod;
  6988. var result = {};
  6989. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6990. result["default"] = mod;
  6991. return result;
  6992. };
  6993. Object.defineProperty(exports, "__esModule", { value: true });
  6994. const github = __importStar(__webpack_require__(469));
  6995. const IS_WINDOWS = process.platform === 'win32';
  6996. function downloadRepository(accessToken, owner, repo, ref, repositoryPath) {
  6997. return __awaiter(this, void 0, void 0, function* () {
  6998. const octokit = new github.GitHub(accessToken);
  6999. const params = {
  7000. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7001. owner: owner,
  7002. repo: repo,
  7003. ref: ref
  7004. };
  7005. const response = yield octokit.repos.getArchiveLink(params);
  7006. console.log(`status=${response.status}`);
  7007. console.log(`headers=${JSON.stringify(response.headers)}`);
  7008. console.log(`data=${JSON.stringify(typeof (response.data))}`);
  7009. });
  7010. }
  7011. exports.downloadRepository = downloadRepository;
  7012. /***/ }),
  7013. /***/ 469:
  7014. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7015. "use strict";
  7016. var __importDefault = (this && this.__importDefault) || function (mod) {
  7017. return (mod && mod.__esModule) ? mod : { "default": mod };
  7018. };
  7019. var __importStar = (this && this.__importStar) || function (mod) {
  7020. if (mod && mod.__esModule) return mod;
  7021. var result = {};
  7022. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7023. result["default"] = mod;
  7024. return result;
  7025. };
  7026. Object.defineProperty(exports, "__esModule", { value: true });
  7027. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7028. const graphql_1 = __webpack_require__(898);
  7029. const rest_1 = __importDefault(__webpack_require__(0));
  7030. const Context = __importStar(__webpack_require__(262));
  7031. // We need this in order to extend Octokit
  7032. rest_1.default.prototype = new rest_1.default();
  7033. exports.context = new Context.Context();
  7034. class GitHub extends rest_1.default {
  7035. constructor(token, opts = {}) {
  7036. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7037. this.graphql = graphql_1.graphql.defaults({
  7038. headers: { authorization: `token ${token}` }
  7039. });
  7040. }
  7041. }
  7042. exports.GitHub = GitHub;
  7043. //# sourceMappingURL=github.js.map
  7044. /***/ }),
  7045. /***/ 470:
  7046. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7047. "use strict";
  7048. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7049. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7050. return new (P || (P = Promise))(function (resolve, reject) {
  7051. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7052. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7053. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7054. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7055. });
  7056. };
  7057. Object.defineProperty(exports, "__esModule", { value: true });
  7058. const command_1 = __webpack_require__(431);
  7059. const os = __webpack_require__(87);
  7060. const path = __webpack_require__(622);
  7061. /**
  7062. * The code to exit an action
  7063. */
  7064. var ExitCode;
  7065. (function (ExitCode) {
  7066. /**
  7067. * A code indicating that the action was successful
  7068. */
  7069. ExitCode[ExitCode["Success"] = 0] = "Success";
  7070. /**
  7071. * A code indicating that the action was a failure
  7072. */
  7073. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7074. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7075. //-----------------------------------------------------------------------
  7076. // Variables
  7077. //-----------------------------------------------------------------------
  7078. /**
  7079. * Sets env variable for this action and future actions in the job
  7080. * @param name the name of the variable to set
  7081. * @param val the value of the variable
  7082. */
  7083. function exportVariable(name, val) {
  7084. process.env[name] = val;
  7085. command_1.issueCommand('set-env', { name }, val);
  7086. }
  7087. exports.exportVariable = exportVariable;
  7088. /**
  7089. * Registers a secret which will get masked from logs
  7090. * @param secret value of the secret
  7091. */
  7092. function setSecret(secret) {
  7093. command_1.issueCommand('add-mask', {}, secret);
  7094. }
  7095. exports.setSecret = setSecret;
  7096. /**
  7097. * Prepends inputPath to the PATH (for this action and future actions)
  7098. * @param inputPath
  7099. */
  7100. function addPath(inputPath) {
  7101. command_1.issueCommand('add-path', {}, inputPath);
  7102. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7103. }
  7104. exports.addPath = addPath;
  7105. /**
  7106. * Gets the value of an input. The value is also trimmed.
  7107. *
  7108. * @param name name of the input to get
  7109. * @param options optional. See InputOptions.
  7110. * @returns string
  7111. */
  7112. function getInput(name, options) {
  7113. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7114. if (options && options.required && !val) {
  7115. throw new Error(`Input required and not supplied: ${name}`);
  7116. }
  7117. return val.trim();
  7118. }
  7119. exports.getInput = getInput;
  7120. /**
  7121. * Sets the value of an output.
  7122. *
  7123. * @param name name of the output to set
  7124. * @param value value to store
  7125. */
  7126. function setOutput(name, value) {
  7127. command_1.issueCommand('set-output', { name }, value);
  7128. }
  7129. exports.setOutput = setOutput;
  7130. //-----------------------------------------------------------------------
  7131. // Results
  7132. //-----------------------------------------------------------------------
  7133. /**
  7134. * Sets the action status to failed.
  7135. * When the action exits it will be with an exit code of 1
  7136. * @param message add error issue message
  7137. */
  7138. function setFailed(message) {
  7139. process.exitCode = ExitCode.Failure;
  7140. error(message);
  7141. }
  7142. exports.setFailed = setFailed;
  7143. //-----------------------------------------------------------------------
  7144. // Logging Commands
  7145. //-----------------------------------------------------------------------
  7146. /**
  7147. * Writes debug message to user log
  7148. * @param message debug message
  7149. */
  7150. function debug(message) {
  7151. command_1.issueCommand('debug', {}, message);
  7152. }
  7153. exports.debug = debug;
  7154. /**
  7155. * Adds an error issue
  7156. * @param message error issue message
  7157. */
  7158. function error(message) {
  7159. command_1.issue('error', message);
  7160. }
  7161. exports.error = error;
  7162. /**
  7163. * Adds an warning issue
  7164. * @param message warning issue message
  7165. */
  7166. function warning(message) {
  7167. command_1.issue('warning', message);
  7168. }
  7169. exports.warning = warning;
  7170. /**
  7171. * Writes info to log with console.log.
  7172. * @param message info message
  7173. */
  7174. function info(message) {
  7175. process.stdout.write(message + os.EOL);
  7176. }
  7177. exports.info = info;
  7178. /**
  7179. * Begin an output group.
  7180. *
  7181. * Output until the next `groupEnd` will be foldable in this group
  7182. *
  7183. * @param name The name of the output group
  7184. */
  7185. function startGroup(name) {
  7186. command_1.issue('group', name);
  7187. }
  7188. exports.startGroup = startGroup;
  7189. /**
  7190. * End an output group.
  7191. */
  7192. function endGroup() {
  7193. command_1.issue('endgroup');
  7194. }
  7195. exports.endGroup = endGroup;
  7196. /**
  7197. * Wrap an asynchronous function call in a group.
  7198. *
  7199. * Returns the same type as the function itself.
  7200. *
  7201. * @param name The name of the group
  7202. * @param fn The function to wrap in the group
  7203. */
  7204. function group(name, fn) {
  7205. return __awaiter(this, void 0, void 0, function* () {
  7206. startGroup(name);
  7207. let result;
  7208. try {
  7209. result = yield fn();
  7210. }
  7211. finally {
  7212. endGroup();
  7213. }
  7214. return result;
  7215. });
  7216. }
  7217. exports.group = group;
  7218. //# sourceMappingURL=core.js.map
  7219. /***/ }),
  7220. /***/ 471:
  7221. /***/ (function(module, __unusedexports, __webpack_require__) {
  7222. module.exports = authenticationBeforeRequest;
  7223. const btoa = __webpack_require__(675);
  7224. const uniq = __webpack_require__(126);
  7225. function authenticationBeforeRequest(state, options) {
  7226. if (!state.auth.type) {
  7227. return;
  7228. }
  7229. if (state.auth.type === "basic") {
  7230. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7231. options.headers.authorization = `Basic ${hash}`;
  7232. return;
  7233. }
  7234. if (state.auth.type === "token") {
  7235. options.headers.authorization = `token ${state.auth.token}`;
  7236. return;
  7237. }
  7238. if (state.auth.type === "app") {
  7239. options.headers.authorization = `Bearer ${state.auth.token}`;
  7240. const acceptHeaders = options.headers.accept
  7241. .split(",")
  7242. .concat("application/vnd.github.machine-man-preview+json");
  7243. options.headers.accept = uniq(acceptHeaders)
  7244. .filter(Boolean)
  7245. .join(",");
  7246. return;
  7247. }
  7248. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7249. if (state.auth.token) {
  7250. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7251. return;
  7252. }
  7253. const key = encodeURIComponent(state.auth.key);
  7254. const secret = encodeURIComponent(state.auth.secret);
  7255. options.url += `client_id=${key}&client_secret=${secret}`;
  7256. }
  7257. /***/ }),
  7258. /***/ 489:
  7259. /***/ (function(module, __unusedexports, __webpack_require__) {
  7260. "use strict";
  7261. const path = __webpack_require__(622);
  7262. const which = __webpack_require__(814);
  7263. const pathKey = __webpack_require__(39)();
  7264. function resolveCommandAttempt(parsed, withoutPathExt) {
  7265. const cwd = process.cwd();
  7266. const hasCustomCwd = parsed.options.cwd != null;
  7267. // If a custom `cwd` was specified, we need to change the process cwd
  7268. // because `which` will do stat calls but does not support a custom cwd
  7269. if (hasCustomCwd) {
  7270. try {
  7271. process.chdir(parsed.options.cwd);
  7272. } catch (err) {
  7273. /* Empty */
  7274. }
  7275. }
  7276. let resolved;
  7277. try {
  7278. resolved = which.sync(parsed.command, {
  7279. path: (parsed.options.env || process.env)[pathKey],
  7280. pathExt: withoutPathExt ? path.delimiter : undefined,
  7281. });
  7282. } catch (e) {
  7283. /* Empty */
  7284. } finally {
  7285. process.chdir(cwd);
  7286. }
  7287. // If we successfully resolved, ensure that an absolute path is returned
  7288. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7289. if (resolved) {
  7290. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7291. }
  7292. return resolved;
  7293. }
  7294. function resolveCommand(parsed) {
  7295. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7296. }
  7297. module.exports = resolveCommand;
  7298. /***/ }),
  7299. /***/ 510:
  7300. /***/ (function(module) {
  7301. module.exports = addHook
  7302. function addHook (state, kind, name, hook) {
  7303. var orig = hook
  7304. if (!state.registry[name]) {
  7305. state.registry[name] = []
  7306. }
  7307. if (kind === 'before') {
  7308. hook = function (method, options) {
  7309. return Promise.resolve()
  7310. .then(orig.bind(null, options))
  7311. .then(method.bind(null, options))
  7312. }
  7313. }
  7314. if (kind === 'after') {
  7315. hook = function (method, options) {
  7316. var result
  7317. return Promise.resolve()
  7318. .then(method.bind(null, options))
  7319. .then(function (result_) {
  7320. result = result_
  7321. return orig(result, options)
  7322. })
  7323. .then(function () {
  7324. return result
  7325. })
  7326. }
  7327. }
  7328. if (kind === 'error') {
  7329. hook = function (method, options) {
  7330. return Promise.resolve()
  7331. .then(method.bind(null, options))
  7332. .catch(function (error) {
  7333. return orig(error, options)
  7334. })
  7335. }
  7336. }
  7337. state.registry[name].push({
  7338. hook: hook,
  7339. orig: orig
  7340. })
  7341. }
  7342. /***/ }),
  7343. /***/ 523:
  7344. /***/ (function(module, __unusedexports, __webpack_require__) {
  7345. var register = __webpack_require__(363)
  7346. var addHook = __webpack_require__(510)
  7347. var removeHook = __webpack_require__(763)
  7348. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7349. var bind = Function.bind
  7350. var bindable = bind.bind(bind)
  7351. function bindApi (hook, state, name) {
  7352. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7353. hook.api = { remove: removeHookRef }
  7354. hook.remove = removeHookRef
  7355. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7356. var args = name ? [state, kind, name] : [state, kind]
  7357. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7358. })
  7359. }
  7360. function HookSingular () {
  7361. var singularHookName = 'h'
  7362. var singularHookState = {
  7363. registry: {}
  7364. }
  7365. var singularHook = register.bind(null, singularHookState, singularHookName)
  7366. bindApi(singularHook, singularHookState, singularHookName)
  7367. return singularHook
  7368. }
  7369. function HookCollection () {
  7370. var state = {
  7371. registry: {}
  7372. }
  7373. var hook = register.bind(null, state)
  7374. bindApi(hook, state)
  7375. return hook
  7376. }
  7377. var collectionHookDeprecationMessageDisplayed = false
  7378. function Hook () {
  7379. if (!collectionHookDeprecationMessageDisplayed) {
  7380. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7381. collectionHookDeprecationMessageDisplayed = true
  7382. }
  7383. return HookCollection()
  7384. }
  7385. Hook.Singular = HookSingular.bind()
  7386. Hook.Collection = HookCollection.bind()
  7387. module.exports = Hook
  7388. // expose constructors as a named property for TypeScript
  7389. module.exports.Hook = Hook
  7390. module.exports.Singular = Hook.Singular
  7391. module.exports.Collection = Hook.Collection
  7392. /***/ }),
  7393. /***/ 529:
  7394. /***/ (function(module, __unusedexports, __webpack_require__) {
  7395. const factory = __webpack_require__(47);
  7396. module.exports = factory();
  7397. /***/ }),
  7398. /***/ 536:
  7399. /***/ (function(module, __unusedexports, __webpack_require__) {
  7400. module.exports = hasFirstPage
  7401. const deprecate = __webpack_require__(370)
  7402. const getPageLinks = __webpack_require__(577)
  7403. function hasFirstPage (link) {
  7404. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7405. return getPageLinks(link).first
  7406. }
  7407. /***/ }),
  7408. /***/ 550:
  7409. /***/ (function(module, __unusedexports, __webpack_require__) {
  7410. module.exports = getNextPage
  7411. const getPage = __webpack_require__(265)
  7412. function getNextPage (octokit, link, headers) {
  7413. return getPage(octokit, link, 'next', headers)
  7414. }
  7415. /***/ }),
  7416. /***/ 558:
  7417. /***/ (function(module, __unusedexports, __webpack_require__) {
  7418. module.exports = hasPreviousPage
  7419. const deprecate = __webpack_require__(370)
  7420. const getPageLinks = __webpack_require__(577)
  7421. function hasPreviousPage (link) {
  7422. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7423. return getPageLinks(link).prev
  7424. }
  7425. /***/ }),
  7426. /***/ 559:
  7427. /***/ (function(__unusedmodule, exports) {
  7428. "use strict";
  7429. Object.defineProperty(exports, "__esModule", { value: true });
  7430. class GitVersion {
  7431. /**
  7432. * Used for comparing the version of git and git-lfs against the minimum required version
  7433. * @param version the version string, e.g. 1.2 or 1.2.3
  7434. */
  7435. constructor(version) {
  7436. this.major = NaN;
  7437. this.minor = NaN;
  7438. this.patch = NaN;
  7439. if (version) {
  7440. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  7441. if (match) {
  7442. this.major = Number(match[1]);
  7443. this.minor = Number(match[2]);
  7444. if (match[4]) {
  7445. this.patch = Number(match[4]);
  7446. }
  7447. }
  7448. }
  7449. }
  7450. /**
  7451. * Compares the instance against a minimum required version
  7452. * @param minimum Minimum version
  7453. */
  7454. checkMinimum(minimum) {
  7455. if (!minimum.isValid()) {
  7456. throw new Error('Arg minimum is not a valid version');
  7457. }
  7458. // Major is insufficient
  7459. if (this.major < minimum.major) {
  7460. return false;
  7461. }
  7462. // Major is equal
  7463. if (this.major === minimum.major) {
  7464. // Minor is insufficient
  7465. if (this.minor < minimum.minor) {
  7466. return false;
  7467. }
  7468. // Minor is equal
  7469. if (this.minor === minimum.minor) {
  7470. // Patch is insufficient
  7471. if (this.patch && this.patch < (minimum.patch || 0)) {
  7472. return false;
  7473. }
  7474. }
  7475. }
  7476. return true;
  7477. }
  7478. /**
  7479. * Indicates whether the instance was constructed from a valid version string
  7480. */
  7481. isValid() {
  7482. return !isNaN(this.major);
  7483. }
  7484. /**
  7485. * Returns the version as a string, e.g. 1.2 or 1.2.3
  7486. */
  7487. toString() {
  7488. let result = '';
  7489. if (this.isValid()) {
  7490. result = `${this.major}.${this.minor}`;
  7491. if (!isNaN(this.patch)) {
  7492. result += `.${this.patch}`;
  7493. }
  7494. }
  7495. return result;
  7496. }
  7497. }
  7498. exports.GitVersion = GitVersion;
  7499. /***/ }),
  7500. /***/ 562:
  7501. /***/ (function(module, __unusedexports, __webpack_require__) {
  7502. var once = __webpack_require__(969);
  7503. var noop = function() {};
  7504. var isRequest = function(stream) {
  7505. return stream.setHeader && typeof stream.abort === 'function';
  7506. };
  7507. var isChildProcess = function(stream) {
  7508. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  7509. };
  7510. var eos = function(stream, opts, callback) {
  7511. if (typeof opts === 'function') return eos(stream, null, opts);
  7512. if (!opts) opts = {};
  7513. callback = once(callback || noop);
  7514. var ws = stream._writableState;
  7515. var rs = stream._readableState;
  7516. var readable = opts.readable || (opts.readable !== false && stream.readable);
  7517. var writable = opts.writable || (opts.writable !== false && stream.writable);
  7518. var cancelled = false;
  7519. var onlegacyfinish = function() {
  7520. if (!stream.writable) onfinish();
  7521. };
  7522. var onfinish = function() {
  7523. writable = false;
  7524. if (!readable) callback.call(stream);
  7525. };
  7526. var onend = function() {
  7527. readable = false;
  7528. if (!writable) callback.call(stream);
  7529. };
  7530. var onexit = function(exitCode) {
  7531. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  7532. };
  7533. var onerror = function(err) {
  7534. callback.call(stream, err);
  7535. };
  7536. var onclose = function() {
  7537. process.nextTick(onclosenexttick);
  7538. };
  7539. var onclosenexttick = function() {
  7540. if (cancelled) return;
  7541. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  7542. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  7543. };
  7544. var onrequest = function() {
  7545. stream.req.on('finish', onfinish);
  7546. };
  7547. if (isRequest(stream)) {
  7548. stream.on('complete', onfinish);
  7549. stream.on('abort', onclose);
  7550. if (stream.req) onrequest();
  7551. else stream.on('request', onrequest);
  7552. } else if (writable && !ws) { // legacy streams
  7553. stream.on('end', onlegacyfinish);
  7554. stream.on('close', onlegacyfinish);
  7555. }
  7556. if (isChildProcess(stream)) stream.on('exit', onexit);
  7557. stream.on('end', onend);
  7558. stream.on('finish', onfinish);
  7559. if (opts.error !== false) stream.on('error', onerror);
  7560. stream.on('close', onclose);
  7561. return function() {
  7562. cancelled = true;
  7563. stream.removeListener('complete', onfinish);
  7564. stream.removeListener('abort', onclose);
  7565. stream.removeListener('request', onrequest);
  7566. if (stream.req) stream.req.removeListener('finish', onfinish);
  7567. stream.removeListener('end', onlegacyfinish);
  7568. stream.removeListener('close', onlegacyfinish);
  7569. stream.removeListener('finish', onfinish);
  7570. stream.removeListener('exit', onexit);
  7571. stream.removeListener('end', onend);
  7572. stream.removeListener('error', onerror);
  7573. stream.removeListener('close', onclose);
  7574. };
  7575. };
  7576. module.exports = eos;
  7577. /***/ }),
  7578. /***/ 563:
  7579. /***/ (function(module, __unusedexports, __webpack_require__) {
  7580. module.exports = getPreviousPage
  7581. const getPage = __webpack_require__(265)
  7582. function getPreviousPage (octokit, link, headers) {
  7583. return getPage(octokit, link, 'prev', headers)
  7584. }
  7585. /***/ }),
  7586. /***/ 568:
  7587. /***/ (function(module, __unusedexports, __webpack_require__) {
  7588. "use strict";
  7589. const path = __webpack_require__(622);
  7590. const niceTry = __webpack_require__(948);
  7591. const resolveCommand = __webpack_require__(489);
  7592. const escape = __webpack_require__(462);
  7593. const readShebang = __webpack_require__(389);
  7594. const semver = __webpack_require__(280);
  7595. const isWin = process.platform === 'win32';
  7596. const isExecutableRegExp = /\.(?:com|exe)$/i;
  7597. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  7598. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  7599. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  7600. function detectShebang(parsed) {
  7601. parsed.file = resolveCommand(parsed);
  7602. const shebang = parsed.file && readShebang(parsed.file);
  7603. if (shebang) {
  7604. parsed.args.unshift(parsed.file);
  7605. parsed.command = shebang;
  7606. return resolveCommand(parsed);
  7607. }
  7608. return parsed.file;
  7609. }
  7610. function parseNonShell(parsed) {
  7611. if (!isWin) {
  7612. return parsed;
  7613. }
  7614. // Detect & add support for shebangs
  7615. const commandFile = detectShebang(parsed);
  7616. // We don't need a shell if the command filename is an executable
  7617. const needsShell = !isExecutableRegExp.test(commandFile);
  7618. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  7619. // Note that `forceShell` is an hidden option used only in tests
  7620. if (parsed.options.forceShell || needsShell) {
  7621. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  7622. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  7623. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  7624. // we need to double escape them
  7625. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  7626. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  7627. // This is necessary otherwise it will always fail with ENOENT in those cases
  7628. parsed.command = path.normalize(parsed.command);
  7629. // Escape command & arguments
  7630. parsed.command = escape.command(parsed.command);
  7631. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  7632. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7633. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7634. parsed.command = process.env.comspec || 'cmd.exe';
  7635. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7636. }
  7637. return parsed;
  7638. }
  7639. function parseShell(parsed) {
  7640. // If node supports the shell option, there's no need to mimic its behavior
  7641. if (supportsShellOption) {
  7642. return parsed;
  7643. }
  7644. // Mimic node shell option
  7645. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  7646. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7647. if (isWin) {
  7648. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  7649. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7650. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7651. } else {
  7652. if (typeof parsed.options.shell === 'string') {
  7653. parsed.command = parsed.options.shell;
  7654. } else if (process.platform === 'android') {
  7655. parsed.command = '/system/bin/sh';
  7656. } else {
  7657. parsed.command = '/bin/sh';
  7658. }
  7659. parsed.args = ['-c', shellCommand];
  7660. }
  7661. return parsed;
  7662. }
  7663. function parse(command, args, options) {
  7664. // Normalize arguments, similar to nodejs
  7665. if (args && !Array.isArray(args)) {
  7666. options = args;
  7667. args = null;
  7668. }
  7669. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  7670. options = Object.assign({}, options); // Clone object to avoid changing the original
  7671. // Build our parsed object
  7672. const parsed = {
  7673. command,
  7674. args,
  7675. options,
  7676. file: undefined,
  7677. original: {
  7678. command,
  7679. args,
  7680. },
  7681. };
  7682. // Delegate further parsing to shell or non-shell
  7683. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  7684. }
  7685. module.exports = parse;
  7686. /***/ }),
  7687. /***/ 577:
  7688. /***/ (function(module) {
  7689. module.exports = getPageLinks
  7690. function getPageLinks (link) {
  7691. link = link.link || link.headers.link || ''
  7692. const links = {}
  7693. // link format:
  7694. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  7695. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  7696. links[type] = uri
  7697. })
  7698. return links
  7699. }
  7700. /***/ }),
  7701. /***/ 586:
  7702. /***/ (function(module, __unusedexports, __webpack_require__) {
  7703. module.exports = octokitRestApiEndpoints;
  7704. const ROUTES = __webpack_require__(705);
  7705. function octokitRestApiEndpoints(octokit) {
  7706. // Aliasing scopes for backward compatibility
  7707. // See https://github.com/octokit/rest.js/pull/1134
  7708. ROUTES.gitdata = ROUTES.git;
  7709. ROUTES.authorization = ROUTES.oauthAuthorizations;
  7710. ROUTES.pullRequests = ROUTES.pulls;
  7711. octokit.registerEndpoints(ROUTES);
  7712. }
  7713. /***/ }),
  7714. /***/ 605:
  7715. /***/ (function(module) {
  7716. module.exports = require("http");
  7717. /***/ }),
  7718. /***/ 614:
  7719. /***/ (function(module) {
  7720. module.exports = require("events");
  7721. /***/ }),
  7722. /***/ 618:
  7723. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7724. "use strict";
  7725. var __importStar = (this && this.__importStar) || function (mod) {
  7726. if (mod && mod.__esModule) return mod;
  7727. var result = {};
  7728. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7729. result["default"] = mod;
  7730. return result;
  7731. };
  7732. Object.defineProperty(exports, "__esModule", { value: true });
  7733. const fs = __importStar(__webpack_require__(747));
  7734. function directoryExistsSync(path, required) {
  7735. if (!path) {
  7736. throw new Error("Arg 'path' must not be empty");
  7737. }
  7738. let stats;
  7739. try {
  7740. stats = fs.statSync(path);
  7741. }
  7742. catch (error) {
  7743. if (error.code === 'ENOENT') {
  7744. if (!required) {
  7745. return false;
  7746. }
  7747. throw new Error(`Directory '${path}' does not exist`);
  7748. }
  7749. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7750. }
  7751. if (stats.isDirectory()) {
  7752. return true;
  7753. }
  7754. else if (!required) {
  7755. return false;
  7756. }
  7757. throw new Error(`Directory '${path}' does not exist`);
  7758. }
  7759. exports.directoryExistsSync = directoryExistsSync;
  7760. function existsSync(path) {
  7761. if (!path) {
  7762. throw new Error("Arg 'path' must not be empty");
  7763. }
  7764. try {
  7765. fs.statSync(path);
  7766. }
  7767. catch (error) {
  7768. if (error.code === 'ENOENT') {
  7769. return false;
  7770. }
  7771. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7772. }
  7773. return true;
  7774. }
  7775. exports.existsSync = existsSync;
  7776. function fileExistsSync(path) {
  7777. if (!path) {
  7778. throw new Error("Arg 'path' must not be empty");
  7779. }
  7780. let stats;
  7781. try {
  7782. stats = fs.statSync(path);
  7783. }
  7784. catch (error) {
  7785. if (error.code === 'ENOENT') {
  7786. return false;
  7787. }
  7788. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7789. }
  7790. if (!stats.isDirectory()) {
  7791. return true;
  7792. }
  7793. return false;
  7794. }
  7795. exports.fileExistsSync = fileExistsSync;
  7796. /***/ }),
  7797. /***/ 621:
  7798. /***/ (function(module, __unusedexports, __webpack_require__) {
  7799. "use strict";
  7800. const path = __webpack_require__(622);
  7801. const pathKey = __webpack_require__(39);
  7802. module.exports = opts => {
  7803. opts = Object.assign({
  7804. cwd: process.cwd(),
  7805. path: process.env[pathKey()]
  7806. }, opts);
  7807. let prev;
  7808. let pth = path.resolve(opts.cwd);
  7809. const ret = [];
  7810. while (prev !== pth) {
  7811. ret.push(path.join(pth, 'node_modules/.bin'));
  7812. prev = pth;
  7813. pth = path.resolve(pth, '..');
  7814. }
  7815. // ensure the running `node` binary is used
  7816. ret.push(path.dirname(process.execPath));
  7817. return ret.concat(opts.path).join(path.delimiter);
  7818. };
  7819. module.exports.env = opts => {
  7820. opts = Object.assign({
  7821. env: process.env
  7822. }, opts);
  7823. const env = Object.assign({}, opts.env);
  7824. const path = pathKey({env});
  7825. opts.path = env[path];
  7826. env[path] = module.exports(opts);
  7827. return env;
  7828. };
  7829. /***/ }),
  7830. /***/ 622:
  7831. /***/ (function(module) {
  7832. module.exports = require("path");
  7833. /***/ }),
  7834. /***/ 649:
  7835. /***/ (function(module, __unusedexports, __webpack_require__) {
  7836. module.exports = getLastPage
  7837. const getPage = __webpack_require__(265)
  7838. function getLastPage (octokit, link, headers) {
  7839. return getPage(octokit, link, 'last', headers)
  7840. }
  7841. /***/ }),
  7842. /***/ 654:
  7843. /***/ (function(module) {
  7844. // This is not the set of all possible signals.
  7845. //
  7846. // It IS, however, the set of all signals that trigger
  7847. // an exit on either Linux or BSD systems. Linux is a
  7848. // superset of the signal names supported on BSD, and
  7849. // the unknown signals just fail to register, so we can
  7850. // catch that easily enough.
  7851. //
  7852. // Don't bother with SIGKILL. It's uncatchable, which
  7853. // means that we can't fire any callbacks anyway.
  7854. //
  7855. // If a user does happen to register a handler on a non-
  7856. // fatal signal like SIGWINCH or something, and then
  7857. // exit, it'll end up firing `process.emit('exit')`, so
  7858. // the handler will be fired anyway.
  7859. //
  7860. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  7861. // artificially, inherently leave the process in a
  7862. // state from which it is not safe to try and enter JS
  7863. // listeners.
  7864. module.exports = [
  7865. 'SIGABRT',
  7866. 'SIGALRM',
  7867. 'SIGHUP',
  7868. 'SIGINT',
  7869. 'SIGTERM'
  7870. ]
  7871. if (process.platform !== 'win32') {
  7872. module.exports.push(
  7873. 'SIGVTALRM',
  7874. 'SIGXCPU',
  7875. 'SIGXFSZ',
  7876. 'SIGUSR2',
  7877. 'SIGTRAP',
  7878. 'SIGSYS',
  7879. 'SIGQUIT',
  7880. 'SIGIOT'
  7881. // should detect profiler and enable/disable accordingly.
  7882. // see #21
  7883. // 'SIGPROF'
  7884. )
  7885. }
  7886. if (process.platform === 'linux') {
  7887. module.exports.push(
  7888. 'SIGIO',
  7889. 'SIGPOLL',
  7890. 'SIGPWR',
  7891. 'SIGSTKFLT',
  7892. 'SIGUNUSED'
  7893. )
  7894. }
  7895. /***/ }),
  7896. /***/ 669:
  7897. /***/ (function(module) {
  7898. module.exports = require("util");
  7899. /***/ }),
  7900. /***/ 672:
  7901. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7902. "use strict";
  7903. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7904. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7905. return new (P || (P = Promise))(function (resolve, reject) {
  7906. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7907. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7908. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7909. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7910. });
  7911. };
  7912. var _a;
  7913. Object.defineProperty(exports, "__esModule", { value: true });
  7914. const assert_1 = __webpack_require__(357);
  7915. const fs = __webpack_require__(747);
  7916. const path = __webpack_require__(622);
  7917. _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;
  7918. exports.IS_WINDOWS = process.platform === 'win32';
  7919. function exists(fsPath) {
  7920. return __awaiter(this, void 0, void 0, function* () {
  7921. try {
  7922. yield exports.stat(fsPath);
  7923. }
  7924. catch (err) {
  7925. if (err.code === 'ENOENT') {
  7926. return false;
  7927. }
  7928. throw err;
  7929. }
  7930. return true;
  7931. });
  7932. }
  7933. exports.exists = exists;
  7934. function isDirectory(fsPath, useStat = false) {
  7935. return __awaiter(this, void 0, void 0, function* () {
  7936. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  7937. return stats.isDirectory();
  7938. });
  7939. }
  7940. exports.isDirectory = isDirectory;
  7941. /**
  7942. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  7943. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  7944. */
  7945. function isRooted(p) {
  7946. p = normalizeSeparators(p);
  7947. if (!p) {
  7948. throw new Error('isRooted() parameter "p" cannot be empty');
  7949. }
  7950. if (exports.IS_WINDOWS) {
  7951. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  7952. ); // e.g. C: or C:\hello
  7953. }
  7954. return p.startsWith('/');
  7955. }
  7956. exports.isRooted = isRooted;
  7957. /**
  7958. * Recursively create a directory at `fsPath`.
  7959. *
  7960. * This implementation is optimistic, meaning it attempts to create the full
  7961. * path first, and backs up the path stack from there.
  7962. *
  7963. * @param fsPath The path to create
  7964. * @param maxDepth The maximum recursion depth
  7965. * @param depth The current recursion depth
  7966. */
  7967. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  7968. return __awaiter(this, void 0, void 0, function* () {
  7969. assert_1.ok(fsPath, 'a path argument must be provided');
  7970. fsPath = path.resolve(fsPath);
  7971. if (depth >= maxDepth)
  7972. return exports.mkdir(fsPath);
  7973. try {
  7974. yield exports.mkdir(fsPath);
  7975. return;
  7976. }
  7977. catch (err) {
  7978. switch (err.code) {
  7979. case 'ENOENT': {
  7980. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  7981. yield exports.mkdir(fsPath);
  7982. return;
  7983. }
  7984. default: {
  7985. let stats;
  7986. try {
  7987. stats = yield exports.stat(fsPath);
  7988. }
  7989. catch (err2) {
  7990. throw err;
  7991. }
  7992. if (!stats.isDirectory())
  7993. throw err;
  7994. }
  7995. }
  7996. }
  7997. });
  7998. }
  7999. exports.mkdirP = mkdirP;
  8000. /**
  8001. * Best effort attempt to determine whether a file exists and is executable.
  8002. * @param filePath file path to check
  8003. * @param extensions additional file extensions to try
  8004. * @return if file exists and is executable, returns the file path. otherwise empty string.
  8005. */
  8006. function tryGetExecutablePath(filePath, extensions) {
  8007. return __awaiter(this, void 0, void 0, function* () {
  8008. let stats = undefined;
  8009. try {
  8010. // test file exists
  8011. stats = yield exports.stat(filePath);
  8012. }
  8013. catch (err) {
  8014. if (err.code !== 'ENOENT') {
  8015. // eslint-disable-next-line no-console
  8016. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8017. }
  8018. }
  8019. if (stats && stats.isFile()) {
  8020. if (exports.IS_WINDOWS) {
  8021. // on Windows, test for valid extension
  8022. const upperExt = path.extname(filePath).toUpperCase();
  8023. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  8024. return filePath;
  8025. }
  8026. }
  8027. else {
  8028. if (isUnixExecutable(stats)) {
  8029. return filePath;
  8030. }
  8031. }
  8032. }
  8033. // try each extension
  8034. const originalFilePath = filePath;
  8035. for (const extension of extensions) {
  8036. filePath = originalFilePath + extension;
  8037. stats = undefined;
  8038. try {
  8039. stats = yield exports.stat(filePath);
  8040. }
  8041. catch (err) {
  8042. if (err.code !== 'ENOENT') {
  8043. // eslint-disable-next-line no-console
  8044. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8045. }
  8046. }
  8047. if (stats && stats.isFile()) {
  8048. if (exports.IS_WINDOWS) {
  8049. // preserve the case of the actual file (since an extension was appended)
  8050. try {
  8051. const directory = path.dirname(filePath);
  8052. const upperName = path.basename(filePath).toUpperCase();
  8053. for (const actualName of yield exports.readdir(directory)) {
  8054. if (upperName === actualName.toUpperCase()) {
  8055. filePath = path.join(directory, actualName);
  8056. break;
  8057. }
  8058. }
  8059. }
  8060. catch (err) {
  8061. // eslint-disable-next-line no-console
  8062. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  8063. }
  8064. return filePath;
  8065. }
  8066. else {
  8067. if (isUnixExecutable(stats)) {
  8068. return filePath;
  8069. }
  8070. }
  8071. }
  8072. }
  8073. return '';
  8074. });
  8075. }
  8076. exports.tryGetExecutablePath = tryGetExecutablePath;
  8077. function normalizeSeparators(p) {
  8078. p = p || '';
  8079. if (exports.IS_WINDOWS) {
  8080. // convert slashes on Windows
  8081. p = p.replace(/\//g, '\\');
  8082. // remove redundant slashes
  8083. return p.replace(/\\\\+/g, '\\');
  8084. }
  8085. // remove redundant slashes
  8086. return p.replace(/\/\/+/g, '/');
  8087. }
  8088. // on Mac/Linux, test the execute bit
  8089. // R W X R W X R W X
  8090. // 256 128 64 32 16 8 4 2 1
  8091. function isUnixExecutable(stats) {
  8092. return ((stats.mode & 1) > 0 ||
  8093. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  8094. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  8095. }
  8096. //# sourceMappingURL=io-util.js.map
  8097. /***/ }),
  8098. /***/ 674:
  8099. /***/ (function(module, __unusedexports, __webpack_require__) {
  8100. module.exports = authenticate;
  8101. const { Deprecation } = __webpack_require__(692);
  8102. const once = __webpack_require__(969);
  8103. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  8104. function authenticate(state, options) {
  8105. deprecateAuthenticate(
  8106. state.octokit.log,
  8107. new Deprecation(
  8108. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  8109. )
  8110. );
  8111. if (!options) {
  8112. state.auth = false;
  8113. return;
  8114. }
  8115. switch (options.type) {
  8116. case "basic":
  8117. if (!options.username || !options.password) {
  8118. throw new Error(
  8119. "Basic authentication requires both a username and password to be set"
  8120. );
  8121. }
  8122. break;
  8123. case "oauth":
  8124. if (!options.token && !(options.key && options.secret)) {
  8125. throw new Error(
  8126. "OAuth2 authentication requires a token or key & secret to be set"
  8127. );
  8128. }
  8129. break;
  8130. case "token":
  8131. case "app":
  8132. if (!options.token) {
  8133. throw new Error("Token authentication requires a token to be set");
  8134. }
  8135. break;
  8136. default:
  8137. throw new Error(
  8138. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  8139. );
  8140. }
  8141. state.auth = options;
  8142. }
  8143. /***/ }),
  8144. /***/ 675:
  8145. /***/ (function(module) {
  8146. module.exports = function btoa(str) {
  8147. return new Buffer(str).toString('base64')
  8148. }
  8149. /***/ }),
  8150. /***/ 692:
  8151. /***/ (function(__unusedmodule, exports) {
  8152. "use strict";
  8153. Object.defineProperty(exports, '__esModule', { value: true });
  8154. class Deprecation extends Error {
  8155. constructor(message) {
  8156. super(message); // Maintains proper stack trace (only available on V8)
  8157. /* istanbul ignore next */
  8158. if (Error.captureStackTrace) {
  8159. Error.captureStackTrace(this, this.constructor);
  8160. }
  8161. this.name = 'Deprecation';
  8162. }
  8163. }
  8164. exports.Deprecation = Deprecation;
  8165. /***/ }),
  8166. /***/ 696:
  8167. /***/ (function(module) {
  8168. "use strict";
  8169. /*!
  8170. * isobject <https://github.com/jonschlinkert/isobject>
  8171. *
  8172. * Copyright (c) 2014-2017, Jon Schlinkert.
  8173. * Released under the MIT License.
  8174. */
  8175. function isObject(val) {
  8176. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  8177. }
  8178. /*!
  8179. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  8180. *
  8181. * Copyright (c) 2014-2017, Jon Schlinkert.
  8182. * Released under the MIT License.
  8183. */
  8184. function isObjectObject(o) {
  8185. return isObject(o) === true
  8186. && Object.prototype.toString.call(o) === '[object Object]';
  8187. }
  8188. function isPlainObject(o) {
  8189. var ctor,prot;
  8190. if (isObjectObject(o) === false) return false;
  8191. // If has modified constructor
  8192. ctor = o.constructor;
  8193. if (typeof ctor !== 'function') return false;
  8194. // If has modified prototype
  8195. prot = ctor.prototype;
  8196. if (isObjectObject(prot) === false) return false;
  8197. // If constructor does not have an Object-specific method
  8198. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  8199. return false;
  8200. }
  8201. // Most likely a plain Object
  8202. return true;
  8203. }
  8204. module.exports = isPlainObject;
  8205. /***/ }),
  8206. /***/ 697:
  8207. /***/ (function(module) {
  8208. "use strict";
  8209. module.exports = (promise, onFinally) => {
  8210. onFinally = onFinally || (() => {});
  8211. return promise.then(
  8212. val => new Promise(resolve => {
  8213. resolve(onFinally());
  8214. }).then(() => val),
  8215. err => new Promise(resolve => {
  8216. resolve(onFinally());
  8217. }).then(() => {
  8218. throw err;
  8219. })
  8220. );
  8221. };
  8222. /***/ }),
  8223. /***/ 705:
  8224. /***/ (function(module) {
  8225. module.exports = {"activity":{"checkStarringRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"deleteRepoSubscription":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"deleteThreadSubscription":{"method":"DELETE","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"getRepoSubscription":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"getThread":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"getThreadSubscription":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"listEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/orgs/:org"},"listEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events"},"listFeeds":{"method":"GET","params":{},"url":"/feeds"},"listNotifications":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/notifications"},"listNotificationsForRepo":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"listPublicEvents":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/events"},"listPublicEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/events"},"listPublicEventsForRepoNetwork":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/networks/:owner/:repo/events"},"listPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/public"},"listReceivedEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events"},"listReceivedPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events/public"},"listRepoEvents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/events"},"listReposStarredByAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/user/starred"},"listReposStarredByUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/starred"},"listReposWatchedByUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/subscriptions"},"listStargazersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stargazers"},"listWatchedReposForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/subscriptions"},"listWatchersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscribers"},"markAsRead":{"method":"PUT","params":{"last_read_at":{"type":"string"}},"url":"/notifications"},"markNotificationsAsReadForRepo":{"method":"PUT","params":{"last_read_at":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"markThreadAsRead":{"method":"PATCH","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"setRepoSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"subscribed":{"type":"boolean"}},"url":"/repos/:owner/:repo/subscription"},"setThreadSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"starRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"unstarRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"}},"apps":{"addRepoToInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"PUT","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"checkAccountIsAssociatedWithAny":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/accounts/:account_id"},"checkAccountIsAssociatedWithAnyStubbed":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/accounts/:account_id"},"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"checkToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"POST","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"createContentAttachment":{"headers":{"accept":"application/vnd.github.corsair-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"content_reference_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/content_references/:content_reference_id/attachments"},"createFromManifest":{"headers":{"accept":"application/vnd.github.fury-preview+json"},"method":"POST","params":{"code":{"required":true,"type":"string"}},"url":"/app-manifests/:code/conversions"},"createInstallationToken":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"POST","params":{"installation_id":{"required":true,"type":"integer"},"permissions":{"type":"object"},"repository_ids":{"type":"integer[]"}},"url":"/app/installations/:installation_id/access_tokens"},"deleteAuthorization":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grant"},"deleteInstallation":{"headers":{"accept":"application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"deleteToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"findOrgInstallation":{"deprecated":"octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"findRepoInstallation":{"deprecated":"octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"findUserInstallation":{"deprecated":"octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"getAuthenticated":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{},"url":"/app"},"getBySlug":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"app_slug":{"required":true,"type":"string"}},"url":"/apps/:app_slug"},"getInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"getOrgInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"getRepoInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"getUserInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"listAccountsUserOrOrgOnPlan":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/plans/:plan_id/accounts"},"listAccountsUserOrOrgOnPlanStubbed":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/stubbed/plans/:plan_id/accounts"},"listInstallationReposForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations/:installation_id/repositories"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/app/installations"},"listInstallationsForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations"},"listMarketplacePurchasesForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases"},"listMarketplacePurchasesForAuthenticatedUserStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases/stubbed"},"listPlans":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/plans"},"listPlansStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/plans"},"listRepos":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/installation/repositories"},"removeRepoFromInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"resetToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"PATCH","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"}},"checks":{"create":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"head_sha":{"required":true,"type":"string"},"name":{"required":true,"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs"},"createSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"head_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites"},"get":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"},"getSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id"},"listAnnotations":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id/annotations"},"listForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-runs"},"listForSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"check_suite_id":{"required":true,"type":"integer"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"},"listSuitesForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"app_id":{"type":"integer"},"check_name":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-suites"},"rerequestSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"},"setSuitesPreferences":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"auto_trigger_checks":{"type":"object[]"},"auto_trigger_checks[].app_id":{"required":true,"type":"integer"},"auto_trigger_checks[].setting":{"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/preferences"},"update":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"check_run_id":{"required":true,"type":"integer"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"}},"codesOfConduct":{"getConductCode":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"key":{"required":true,"type":"string"}},"url":"/codes_of_conduct/:key"},"getForRepo":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/code_of_conduct"},"listConductCodes":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{},"url":"/codes_of_conduct"}},"emojis":{"get":{"method":"GET","params":{},"url":"/emojis"}},"gists":{"checkIsStarred":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"create":{"method":"POST","params":{"description":{"type":"string"},"files":{"required":true,"type":"object"},"files.content":{"type":"string"},"public":{"type":"boolean"}},"url":"/gists"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments"},"delete":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"fork":{"method":"POST","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/forks"},"get":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"getRevision":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/gists/:gist_id/:sha"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists"},"listComments":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/comments"},"listCommits":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/commits"},"listForks":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/forks"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/public"},"listPublicForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gists"},"listStarred":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/starred"},"star":{"method":"PUT","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"unstar":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"files":{"type":"object"},"files.content":{"type":"string"},"files.filename":{"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"}},"git":{"createBlob":{"method":"POST","params":{"content":{"required":true,"type":"string"},"encoding":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs"},"createCommit":{"method":"POST","params":{"author":{"type":"object"},"author.date":{"type":"string"},"author.email":{"type":"string"},"author.name":{"type":"string"},"committer":{"type":"object"},"committer.date":{"type":"string"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"parents":{"required":true,"type":"string[]"},"repo":{"required":true,"type":"string"},"signature":{"type":"string"},"tree":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits"},"createRef":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs"},"createTag":{"method":"POST","params":{"message":{"required":true,"type":"string"},"object":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"},"tagger":{"type":"object"},"tagger.date":{"type":"string"},"tagger.email":{"type":"string"},"tagger.name":{"type":"string"},"type":{"enum":["commit","tree","blob"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags"},"createTree":{"method":"POST","params":{"base_tree":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tree":{"required":true,"type":"object[]"},"tree[].content":{"type":"string"},"tree[].mode":{"enum":["100644","100755","040000","160000","120000"],"type":"string"},"tree[].path":{"type":"string"},"tree[].sha":{"allowNull":true,"type":"string"},"tree[].type":{"enum":["blob","tree","commit"],"type":"string"}},"url":"/repos/:owner/:repo/git/trees"},"deleteRef":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"},"getBlob":{"method":"GET","params":{"file_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs/:file_sha"},"getCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits/:commit_sha"},"getRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/ref/:ref"},"getTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags/:tag_sha"},"getTree":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"recursive":{"enum":["1"],"type":"integer"},"repo":{"required":true,"type":"string"},"tree_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/trees/:tree_sha"},"listMatchingRefs":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/matching-refs/:ref"},"listRefs":{"method":"GET","params":{"namespace":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:namespace"},"updateRef":{"method":"PATCH","params":{"force":{"type":"boolean"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"}},"gitignore":{"getTemplate":{"method":"GET","params":{"name":{"required":true,"type":"string"}},"url":"/gitignore/templates/:name"},"listTemplates":{"method":"GET","params":{},"url":"/gitignore/templates"}},"interactions":{"addOrUpdateRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"addOrUpdateRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"getRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"getRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"removeRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"removeRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"}},"issues":{"addAssignees":{"method":"POST","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"addLabels":{"method":"POST","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"required":true,"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"checkAssignee":{"method":"GET","params":{"assignee":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees/:assignee"},"create":{"method":"POST","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"labels":{"type":"string[]"},"milestone":{"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"createLabel":{"method":"POST","params":{"color":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"createMilestone":{"method":"POST","params":{"description":{"type":"string"},"due_on":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"deleteLabel":{"method":"DELETE","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"deleteMilestone":{"method":"DELETE","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"get":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"getEvent":{"method":"GET","params":{"event_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events/:event_id"},"getLabel":{"method":"GET","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"getMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"list":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/issues"},"listAssignees":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees"},"listComments":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/issues/comments"},"listEvents":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/events"},"listEventsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events"},"listEventsForTimeline":{"headers":{"accept":"application/vnd.github.mockingbird-preview+json"},"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/timeline"},"listForAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/user/issues"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/issues"},"listForRepo":{"method":"GET","params":{"assignee":{"type":"string"},"creator":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"labels":{"type":"string"},"mentioned":{"type":"string"},"milestone":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/issues"},"listLabelsForMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number/labels"},"listLabelsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"listLabelsOnIssue":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"listMilestonesForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["due_on","completeness"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"lock":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"lock_reason":{"enum":["off-topic","too heated","resolved","spam"],"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"removeAssignees":{"method":"DELETE","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"removeLabel":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels/:name"},"removeLabels":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"replaceLabels":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"unlock":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"update":{"method":"PATCH","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"milestone":{"allowNull":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"updateLabel":{"method":"PATCH","params":{"color":{"type":"string"},"current_name":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:current_name"},"updateMilestone":{"method":"PATCH","params":{"description":{"type":"string"},"due_on":{"type":"string"},"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"}},"licenses":{"get":{"method":"GET","params":{"license":{"required":true,"type":"string"}},"url":"/licenses/:license"},"getForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/license"},"list":{"deprecated":"octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)","method":"GET","params":{},"url":"/licenses"},"listCommonlyUsed":{"method":"GET","params":{},"url":"/licenses"}},"markdown":{"render":{"method":"POST","params":{"context":{"type":"string"},"mode":{"enum":["markdown","gfm"],"type":"string"},"text":{"required":true,"type":"string"}},"url":"/markdown"},"renderRaw":{"headers":{"content-type":"text/plain; charset=utf-8"},"method":"POST","params":{"data":{"mapTo":"data","required":true,"type":"string"}},"url":"/markdown/raw"}},"meta":{"get":{"method":"GET","params":{},"url":"/meta"}},"migrations":{"cancelImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"deleteArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"deleteArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"getArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getCommitAuthors":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/large_files"},"getStatusForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id"},"getStatusForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id"},"listForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/migrations"},"listForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations"},"mapCommitAuthor":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"author_id":{"required":true,"type":"integer"},"email":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/authors/:author_id"},"setLfsPreference":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"use_lfs":{"enum":["opt_in","opt_out"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/lfs"},"startForAuthenticatedUser":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"repositories":{"required":true,"type":"string[]"}},"url":"/user/migrations"},"startForOrg":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"org":{"required":true,"type":"string"},"repositories":{"required":true,"type":"string[]"}},"url":"/orgs/:org/migrations"},"startImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tfvc_project":{"type":"string"},"vcs":{"enum":["subversion","git","mercurial","tfvc"],"type":"string"},"vcs_password":{"type":"string"},"vcs_url":{"required":true,"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"},"unlockRepoForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"repo_name":{"required":true,"type":"string"}},"url":"/user/migrations/:migration_id/repos/:repo_name/lock"},"unlockRepoForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"repo_name":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"},"updateImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"vcs_password":{"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"}},"oauthAuthorizations":{"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"createAuthorization":{"deprecated":"octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization","method":"POST","params":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"fingerprint":{"type":"string"},"note":{"required":true,"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations"},"deleteAuthorization":{"deprecated":"octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization","method":"DELETE","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"deleteGrant":{"deprecated":"octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant","method":"DELETE","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getAuthorization":{"deprecated":"octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization","method":"GET","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"getGrant":{"deprecated":"octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant","method":"GET","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getOrCreateAuthorizationForApp":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id"},"getOrCreateAuthorizationForAppAndFingerprint":{"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","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"getOrCreateAuthorizationForAppFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"listAuthorizations":{"deprecated":"octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/authorizations"},"listGrants":{"deprecated":"octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/applications/grants"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"updateAuthorization":{"deprecated":"octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization","method":"PATCH","params":{"add_scopes":{"type":"string[]"},"authorization_id":{"required":true,"type":"integer"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"remove_scopes":{"type":"string[]"},"scopes":{"type":"string[]"}},"url":"/authorizations/:authorization_id"}},"orgs":{"addOrUpdateMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["admin","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"blockUser":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkBlockedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"checkPublicMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"concealMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"convertMemberToOutsideCollaborator":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks"},"createInvitation":{"method":"POST","params":{"email":{"type":"string"},"invitee_id":{"type":"integer"},"org":{"required":true,"type":"string"},"role":{"enum":["admin","direct_member","billing_manager"],"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/orgs/:org/invitations"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"get":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"getMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"getMembershipForAuthenticatedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/organizations"},"listBlockedUsers":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/orgs"},"listForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/orgs"},"listHooks":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/hooks"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/installations"},"listInvitationTeams":{"method":"GET","params":{"invitation_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations/:invitation_id/teams"},"listMembers":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["all","admin","member"],"type":"string"}},"url":"/orgs/:org/members"},"listMemberships":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["active","pending"],"type":"string"}},"url":"/user/memberships/orgs"},"listOutsideCollaborators":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/outside_collaborators"},"listPendingInvitations":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations"},"listPublicMembers":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/public_members"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id/pings"},"publicizeMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"removeMember":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"removeMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"removeOutsideCollaborator":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"unblockUser":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"update":{"method":"PATCH","params":{"billing_email":{"type":"string"},"company":{"type":"string"},"default_repository_permission":{"enum":["read","write","admin","none"],"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"has_organization_projects":{"type":"boolean"},"has_repository_projects":{"type":"boolean"},"location":{"type":"string"},"members_allowed_repository_creation_type":{"enum":["all","private","none"],"type":"string"},"members_can_create_repositories":{"type":"boolean"},"name":{"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"updateMembership":{"method":"PATCH","params":{"org":{"required":true,"type":"string"},"state":{"enum":["active"],"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"}},"projects":{"addCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"createCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"content_id":{"type":"integer"},"content_type":{"type":"string"},"note":{"type":"string"}},"url":"/projects/columns/:column_id/cards"},"createColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"name":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"createForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"}},"url":"/user/projects"},"createForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/projects"},"createForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/projects"},"delete":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"deleteCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"deleteColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"get":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"getCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"getColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"listCards":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"archived_state":{"enum":["all","archived","not_archived"],"type":"string"},"column_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/projects/columns/:column_id/cards"},"listCollaborators":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/collaborators"},"listColumns":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"listForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/projects"},"listForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/projects"},"listForUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/projects"},"moveCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"card_id":{"required":true,"type":"integer"},"column_id":{"type":"integer"},"position":{"required":true,"type":"string","validation":"^(top|bottom|after:\\d+)$"}},"url":"/projects/columns/cards/:card_id/moves"},"moveColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"position":{"required":true,"type":"string","validation":"^(first|last|after:\\d+)$"}},"url":"/projects/columns/:column_id/moves"},"removeCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"reviewUserPermissionLevel":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username/permission"},"update":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"name":{"type":"string"},"organization_permission":{"type":"string"},"private":{"type":"boolean"},"project_id":{"required":true,"type":"integer"},"state":{"enum":["open","closed"],"type":"string"}},"url":"/projects/:project_id"},"updateCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"archived":{"type":"boolean"},"card_id":{"required":true,"type":"integer"},"note":{"type":"string"}},"url":"/projects/columns/cards/:card_id"},"updateColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"column_id":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"}},"url":"/projects/columns/:column_id"}},"pulls":{"checkIfMerged":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"create":{"method":"POST","params":{"base":{"required":true,"type":"string"},"body":{"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"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.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createCommentReply":{"deprecated":"octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)","method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"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.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createFromIssue":{"deprecated":"octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request","method":"POST","params":{"base":{"required":true,"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"issue":{"required":true,"type":"integer"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createReview":{"method":"POST","params":{"body":{"type":"string"},"comments":{"type":"object[]"},"comments[].body":{"required":true,"type":"string"},"comments[].path":{"required":true,"type":"string"},"comments[].position":{"required":true,"type":"integer"},"commit_id":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"createReviewCommentReply":{"method":"POST","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"},"createReviewRequest":{"method":"POST","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"deletePendingReview":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"deleteReviewRequest":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"dismissReview":{"method":"PUT","params":{"message":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"},"get":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"getCommentsForReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"},"getReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"list":{"method":"GET","params":{"base":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"head":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["created","updated","popularity","long-running"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"listComments":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments"},"listCommits":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/commits"},"listFiles":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/files"},"listReviewRequests":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"listReviews":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"merge":{"method":"PUT","params":{"commit_message":{"type":"string"},"commit_title":{"type":"string"},"merge_method":{"enum":["merge","squash","rebase"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"submitReview":{"method":"POST","params":{"body":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"},"update":{"method":"PATCH","params":{"base":{"type":"string"},"body":{"type":"string"},"maintainer_can_modify":{"type":"boolean"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"updateBranch":{"headers":{"accept":"application/vnd.github.lydian-preview+json"},"method":"PUT","params":{"expected_head_sha":{"type":"string"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/update-branch"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"updateReview":{"method":"PUT","params":{"body":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"}},"rateLimit":{"get":{"method":"GET","params":{},"url":"/rate_limit"}},"reactions":{"createForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"createForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"createForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"createForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"createForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"createForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"delete":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"DELETE","params":{"reaction_id":{"required":true,"type":"integer"}},"url":"/reactions/:reaction_id"},"listForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"listForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"listForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"listForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"listForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"listForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"}},"repos":{"acceptInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"addCollaborator":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"addDeployKey":{"method":"POST","params":{"key":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"read_only":{"type":"boolean"},"repo":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/keys"},"addProtectedBranchAdminEnforcement":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"addProtectedBranchAppRestrictions":{"method":"POST","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"addProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"addProtectedBranchRequiredStatusChecksContexts":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"addProtectedBranchTeamRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"addProtectedBranchUserRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"checkCollaborator":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"checkVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"compareCommits":{"method":"GET","params":{"base":{"required":true,"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/compare/:base...:head"},"createCommitComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_sha":{"required":true,"type":"string"},"line":{"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"type":"string"},"position":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"alias":"commit_sha","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"createDeployment":{"method":"POST","params":{"auto_merge":{"type":"boolean"},"description":{"type":"string"},"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"payload":{"type":"string"},"production_environment":{"type":"boolean"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_contexts":{"type":"string[]"},"task":{"type":"string"},"transient_environment":{"type":"boolean"}},"url":"/repos/:owner/:repo/deployments"},"createDeploymentStatus":{"method":"POST","params":{"auto_inactive":{"type":"boolean"},"deployment_id":{"required":true,"type":"integer"},"description":{"type":"string"},"environment":{"enum":["production","staging","qa"],"type":"string"},"environment_url":{"type":"string"},"log_url":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["error","failure","inactive","in_progress","queued","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"createDispatchEvent":{"headers":{"accept":"application/vnd.github.everest-preview+json"},"method":"POST","params":{"client_payload":{"type":"object"},"event_type":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/dispatches"},"createFile":{"deprecated":"octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createForAuthenticatedUser":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/user/repos"},"createFork":{"method":"POST","params":{"organization":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/forks"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"createInOrg":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/orgs/:org/repos"},"createOrUpdateFile":{"method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createRelease":{"method":"POST","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"repo":{"required":true,"type":"string"},"tag_name":{"required":true,"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases"},"createStatus":{"method":"POST","params":{"context":{"type":"string"},"description":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"},"state":{"enum":["error","failure","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/statuses/:sha"},"createUsingTemplate":{"headers":{"accept":"application/vnd.github.baptiste-preview+json"},"method":"POST","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"type":"string"},"private":{"type":"boolean"},"template_owner":{"required":true,"type":"string"},"template_repo":{"required":true,"type":"string"}},"url":"/repos/:template_owner/:template_repo/generate"},"declineInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"delete":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"deleteCommitComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"deleteDownload":{"method":"DELETE","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"deleteFile":{"method":"DELETE","params":{"author":{"type":"object"},"author.email":{"type":"string"},"author.name":{"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"deleteInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"deleteRelease":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"deleteReleaseAsset":{"method":"DELETE","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"disableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"disablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"disableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"enableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"enablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"type":"object"},"source.branch":{"enum":["master","gh-pages"],"type":"string"},"source.path":{"type":"string"}},"url":"/repos/:owner/:repo/pages"},"enableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"get":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"getAppsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"getArchiveLink":{"method":"GET","params":{"archive_format":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/:archive_format/:ref"},"getBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch"},"getBranchProtection":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"getClones":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/clones"},"getCodeFrequencyStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/code_frequency"},"getCollaboratorPermissionLevel":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username/permission"},"getCombinedStatusForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/status"},"getCommit":{"method":"GET","params":{"commit_sha":{"alias":"ref","deprecated":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"alias":"ref","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getCommitActivityStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/commit_activity"},"getCommitComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"getCommitRefSha":{"deprecated":"octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit","headers":{"accept":"application/vnd.github.v3.sha"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getContents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"getContributorsStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/contributors"},"getDeployKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"getDeployment":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id"},"getDeploymentStatus":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"},"getDownload":{"method":"GET","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"getLatestPagesBuild":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/latest"},"getLatestRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/latest"},"getPages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"getPagesBuild":{"method":"GET","params":{"build_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/:build_id"},"getParticipationStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/participation"},"getProtectedBranchAdminEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"getProtectedBranchPullRequestReviewEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"getProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"getProtectedBranchRequiredStatusChecks":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"getProtectedBranchRestrictions":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"getPunchCardStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/punch_card"},"getReadme":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/readme"},"getRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"getReleaseAsset":{"method":"GET","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"getReleaseByTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/tags/:tag"},"getTeamsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"getTopPaths":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/paths"},"getTopReferrers":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/referrers"},"getUsersWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"getViews":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/views"},"list":{"method":"GET","params":{"affiliation":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","public","private","member"],"type":"string"},"visibility":{"enum":["all","public","private"],"type":"string"}},"url":"/user/repos"},"listAppsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"listAssetsForRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id/assets"},"listBranches":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"protected":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches"},"listBranchesForHeadCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/branches-where-head"},"listCollaborators":{"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators"},"listCommentsForCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"alias":"commit_sha","deprecated":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"listCommitComments":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments"},"listCommits":{"method":"GET","params":{"author":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"}},"url":"/repos/:owner/:repo/commits"},"listContributors":{"method":"GET","params":{"anon":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contributors"},"listDeployKeys":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys"},"listDeploymentStatuses":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"listDeployments":{"method":"GET","params":{"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"task":{"type":"string"}},"url":"/repos/:owner/:repo/deployments"},"listDownloads":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","public","private","forks","sources","member"],"type":"string"}},"url":"/orgs/:org/repos"},"listForUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/repos"},"listForks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["newest","oldest","stargazers"],"type":"string"}},"url":"/repos/:owner/:repo/forks"},"listHooks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"listInvitations":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations"},"listInvitationsForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/repository_invitations"},"listLanguages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/languages"},"listPagesBuilds":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"listProtectedBranchRequiredStatusChecksContexts":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"listProtectedBranchTeamRestrictions":{"deprecated":"octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listProtectedBranchUserRestrictions":{"deprecated":"octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/repositories"},"listPullRequestsAssociatedWithCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/pulls"},"listReleases":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases"},"listStatusesForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/statuses"},"listTags":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/tags"},"listTeams":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/teams"},"listTeamsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"listUsersWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"merge":{"method":"POST","params":{"base":{"required":true,"type":"string"},"commit_message":{"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/merges"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/pings"},"removeBranchProtection":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"removeCollaborator":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"removeDeployKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"removeProtectedBranchAdminEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"removeProtectedBranchAppRestrictions":{"method":"DELETE","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"removeProtectedBranchPullRequestReviewEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"removeProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"removeProtectedBranchRequiredStatusChecks":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"removeProtectedBranchRequiredStatusChecksContexts":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"removeProtectedBranchRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"removeProtectedBranchTeamRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"removeProtectedBranchUserRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceProtectedBranchAppRestrictions":{"method":"PUT","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"replaceProtectedBranchRequiredStatusChecksContexts":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"replaceProtectedBranchTeamRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"replaceProtectedBranchUserRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"PUT","params":{"names":{"required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"requestPageBuild":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"retrieveCommunityProfileMetrics":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/profile"},"testPushHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/tests"},"transfer":{"headers":{"accept":"application/vnd.github.nightshade-preview+json"},"method":"POST","params":{"new_owner":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/repos/:owner/:repo/transfer"},"update":{"method":"PATCH","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"archived":{"type":"boolean"},"default_branch":{"type":"string"},"description":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"private":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_pull_request_reviews":{"allowNull":true,"required":true,"type":"object"},"required_pull_request_reviews.dismiss_stale_reviews":{"type":"boolean"},"required_pull_request_reviews.dismissal_restrictions":{"type":"object"},"required_pull_request_reviews.dismissal_restrictions.teams":{"type":"string[]"},"required_pull_request_reviews.dismissal_restrictions.users":{"type":"string[]"},"required_pull_request_reviews.require_code_owner_reviews":{"type":"boolean"},"required_pull_request_reviews.required_approving_review_count":{"type":"integer"},"required_status_checks":{"allowNull":true,"required":true,"type":"object"},"required_status_checks.contexts":{"required":true,"type":"string[]"},"required_status_checks.strict":{"required":true,"type":"boolean"},"restrictions":{"allowNull":true,"required":true,"type":"object"},"restrictions.apps":{"type":"string[]"},"restrictions.teams":{"required":true,"type":"string[]"},"restrictions.users":{"required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"updateCommitComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"updateFile":{"deprecated":"octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"add_events":{"type":"string[]"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"remove_events":{"type":"string[]"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"updateInformationAboutPagesSite":{"method":"PUT","params":{"cname":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"enum":["\"gh-pages\"","\"master\"","\"master /docs\""],"type":"string"}},"url":"/repos/:owner/:repo/pages"},"updateInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"permissions":{"enum":["read","write","admin"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"updateProtectedBranchPullRequestReviewEnforcement":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"dismiss_stale_reviews":{"type":"boolean"},"dismissal_restrictions":{"type":"object"},"dismissal_restrictions.teams":{"type":"string[]"},"dismissal_restrictions.users":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"require_code_owner_reviews":{"type":"boolean"},"required_approving_review_count":{"type":"integer"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"updateProtectedBranchRequiredStatusChecks":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"contexts":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"strict":{"type":"boolean"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"updateRelease":{"method":"PATCH","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"tag_name":{"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"updateReleaseAsset":{"method":"PATCH","params":{"asset_id":{"required":true,"type":"integer"},"label":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"uploadReleaseAsset":{"method":"POST","params":{"file":{"mapTo":"data","required":true,"type":"string | object"},"headers":{"required":true,"type":"object"},"headers.content-length":{"required":true,"type":"integer"},"headers.content-type":{"required":true,"type":"string"},"label":{"type":"string"},"name":{"required":true,"type":"string"},"url":{"required":true,"type":"string"}},"url":":url"}},"search":{"code":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["indexed"],"type":"string"}},"url":"/search/code"},"commits":{"headers":{"accept":"application/vnd.github.cloak-preview+json"},"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["author-date","committer-date"],"type":"string"}},"url":"/search/commits"},"issues":{"deprecated":"octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)","method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"issuesAndPullRequests":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"labels":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"q":{"required":true,"type":"string"},"repository_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/search/labels"},"repos":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["stars","forks","help-wanted-issues","updated"],"type":"string"}},"url":"/search/repositories"},"topics":{"method":"GET","params":{"q":{"required":true,"type":"string"}},"url":"/search/topics"},"users":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["followers","repositories","joined"],"type":"string"}},"url":"/search/users"}},"teams":{"addMember":{"deprecated":"octokit.teams.addMember() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"method":"PUT","params":{"role":{"enum":["member","maintainer"],"type":"string"},"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"addOrUpdateProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"addOrUpdateRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"checkManagesRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"create":{"method":"POST","params":{"description":{"type":"string"},"maintainers":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"repo_names":{"type":"string[]"}},"url":"/orgs/:org/teams"},"createDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/teams/:team_id/discussions"},"createDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"delete":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"get":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getByName":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"getDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"getMember":{"deprecated":"octokit.teams.getMember() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"list":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/teams"},"listChild":{"headers":{"accept":"application/vnd.github.hellcat-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"listDiscussions":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/teams"},"listMembers":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/members"},"listPendingInvitations":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects"},"listRepos":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMember":{"deprecated":"octokit.teams.removeMember() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembership":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"reviewProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"updateDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"},"title":{"type":"string"}},"url":"/teams/:team_id/discussions/:discussion_number"},"updateDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"}},"users":{"addEmails":{"method":"POST","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"block":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkBlocked":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkFollowing":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"checkFollowingForUser":{"method":"GET","params":{"target_user":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following/:target_user"},"createGpgKey":{"method":"POST","params":{"armored_public_key":{"type":"string"}},"url":"/user/gpg_keys"},"createPublicKey":{"method":"POST","params":{"key":{"type":"string"},"title":{"type":"string"}},"url":"/user/keys"},"deleteEmails":{"method":"DELETE","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"deleteGpgKey":{"method":"DELETE","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"deletePublicKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"follow":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"getAuthenticated":{"method":"GET","params":{},"url":"/user"},"getByUsername":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username"},"getContextForUser":{"headers":{"accept":"application/vnd.github.hagar-preview+json"},"method":"GET","params":{"subject_id":{"type":"string"},"subject_type":{"enum":["organization","repository","issue","pull_request"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/hovercard"},"getGpgKey":{"method":"GET","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"getPublicKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/users"},"listBlocked":{"method":"GET","params":{},"url":"/user/blocks"},"listEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/emails"},"listFollowersForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/followers"},"listFollowersForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/followers"},"listFollowingForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/following"},"listFollowingForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following"},"listGpgKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/gpg_keys"},"listGpgKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gpg_keys"},"listPublicEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/public_emails"},"listPublicKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/keys"},"listPublicKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/keys"},"togglePrimaryEmailVisibility":{"method":"PATCH","params":{"email":{"required":true,"type":"string"},"visibility":{"required":true,"type":"string"}},"url":"/user/email/visibility"},"unblock":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"unfollow":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"updateAuthenticated":{"method":"PATCH","params":{"bio":{"type":"string"},"blog":{"type":"string"},"company":{"type":"string"},"email":{"type":"string"},"hireable":{"type":"boolean"},"location":{"type":"string"},"name":{"type":"string"}},"url":"/user"}}};
  8226. /***/ }),
  8227. /***/ 742:
  8228. /***/ (function(module, __unusedexports, __webpack_require__) {
  8229. var fs = __webpack_require__(747)
  8230. var core
  8231. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  8232. core = __webpack_require__(818)
  8233. } else {
  8234. core = __webpack_require__(197)
  8235. }
  8236. module.exports = isexe
  8237. isexe.sync = sync
  8238. function isexe (path, options, cb) {
  8239. if (typeof options === 'function') {
  8240. cb = options
  8241. options = {}
  8242. }
  8243. if (!cb) {
  8244. if (typeof Promise !== 'function') {
  8245. throw new TypeError('callback not provided')
  8246. }
  8247. return new Promise(function (resolve, reject) {
  8248. isexe(path, options || {}, function (er, is) {
  8249. if (er) {
  8250. reject(er)
  8251. } else {
  8252. resolve(is)
  8253. }
  8254. })
  8255. })
  8256. }
  8257. core(path, options || {}, function (er, is) {
  8258. // ignore EACCES because that just means we aren't allowed to run it
  8259. if (er) {
  8260. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  8261. er = null
  8262. is = false
  8263. }
  8264. }
  8265. cb(er, is)
  8266. })
  8267. }
  8268. function sync (path, options) {
  8269. // my kingdom for a filtered catch
  8270. try {
  8271. return core.sync(path, options || {})
  8272. } catch (er) {
  8273. if (options && options.ignoreErrors || er.code === 'EACCES') {
  8274. return false
  8275. } else {
  8276. throw er
  8277. }
  8278. }
  8279. }
  8280. /***/ }),
  8281. /***/ 747:
  8282. /***/ (function(module) {
  8283. module.exports = require("fs");
  8284. /***/ }),
  8285. /***/ 753:
  8286. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8287. "use strict";
  8288. Object.defineProperty(exports, '__esModule', { value: true });
  8289. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8290. var endpoint = __webpack_require__(385);
  8291. var universalUserAgent = __webpack_require__(796);
  8292. var isPlainObject = _interopDefault(__webpack_require__(696));
  8293. var nodeFetch = _interopDefault(__webpack_require__(454));
  8294. var requestError = __webpack_require__(463);
  8295. const VERSION = "5.3.1";
  8296. function getBufferResponse(response) {
  8297. return response.arrayBuffer();
  8298. }
  8299. function fetchWrapper(requestOptions) {
  8300. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  8301. requestOptions.body = JSON.stringify(requestOptions.body);
  8302. }
  8303. let headers = {};
  8304. let status;
  8305. let url;
  8306. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  8307. return fetch(requestOptions.url, Object.assign({
  8308. method: requestOptions.method,
  8309. body: requestOptions.body,
  8310. headers: requestOptions.headers,
  8311. redirect: requestOptions.redirect
  8312. }, requestOptions.request)).then(response => {
  8313. url = response.url;
  8314. status = response.status;
  8315. for (const keyAndValue of response.headers) {
  8316. headers[keyAndValue[0]] = keyAndValue[1];
  8317. }
  8318. if (status === 204 || status === 205) {
  8319. return;
  8320. } // GitHub API returns 200 for HEAD requsets
  8321. if (requestOptions.method === "HEAD") {
  8322. if (status < 400) {
  8323. return;
  8324. }
  8325. throw new requestError.RequestError(response.statusText, status, {
  8326. headers,
  8327. request: requestOptions
  8328. });
  8329. }
  8330. if (status === 304) {
  8331. throw new requestError.RequestError("Not modified", status, {
  8332. headers,
  8333. request: requestOptions
  8334. });
  8335. }
  8336. if (status >= 400) {
  8337. return response.text().then(message => {
  8338. const error = new requestError.RequestError(message, status, {
  8339. headers,
  8340. request: requestOptions
  8341. });
  8342. try {
  8343. let responseBody = JSON.parse(error.message);
  8344. Object.assign(error, responseBody);
  8345. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  8346. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  8347. } catch (e) {// ignore, see octokit/rest.js#684
  8348. }
  8349. throw error;
  8350. });
  8351. }
  8352. const contentType = response.headers.get("content-type");
  8353. if (/application\/json/.test(contentType)) {
  8354. return response.json();
  8355. }
  8356. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  8357. return response.text();
  8358. }
  8359. return getBufferResponse(response);
  8360. }).then(data => {
  8361. return {
  8362. status,
  8363. url,
  8364. headers,
  8365. data
  8366. };
  8367. }).catch(error => {
  8368. if (error instanceof requestError.RequestError) {
  8369. throw error;
  8370. }
  8371. throw new requestError.RequestError(error.message, 500, {
  8372. headers,
  8373. request: requestOptions
  8374. });
  8375. });
  8376. }
  8377. function withDefaults(oldEndpoint, newDefaults) {
  8378. const endpoint = oldEndpoint.defaults(newDefaults);
  8379. const newApi = function (route, parameters) {
  8380. const endpointOptions = endpoint.merge(route, parameters);
  8381. if (!endpointOptions.request || !endpointOptions.request.hook) {
  8382. return fetchWrapper(endpoint.parse(endpointOptions));
  8383. }
  8384. const request = (route, parameters) => {
  8385. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  8386. };
  8387. Object.assign(request, {
  8388. endpoint,
  8389. defaults: withDefaults.bind(null, endpoint)
  8390. });
  8391. return endpointOptions.request.hook(request, endpointOptions);
  8392. };
  8393. return Object.assign(newApi, {
  8394. endpoint,
  8395. defaults: withDefaults.bind(null, endpoint)
  8396. });
  8397. }
  8398. const request = withDefaults(endpoint.endpoint, {
  8399. headers: {
  8400. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  8401. }
  8402. });
  8403. exports.request = request;
  8404. //# sourceMappingURL=index.js.map
  8405. /***/ }),
  8406. /***/ 761:
  8407. /***/ (function(module) {
  8408. module.exports = require("zlib");
  8409. /***/ }),
  8410. /***/ 763:
  8411. /***/ (function(module) {
  8412. module.exports = removeHook
  8413. function removeHook (state, name, method) {
  8414. if (!state.registry[name]) {
  8415. return
  8416. }
  8417. var index = state.registry[name]
  8418. .map(function (registered) { return registered.orig })
  8419. .indexOf(method)
  8420. if (index === -1) {
  8421. return
  8422. }
  8423. state.registry[name].splice(index, 1)
  8424. }
  8425. /***/ }),
  8426. /***/ 768:
  8427. /***/ (function(module) {
  8428. "use strict";
  8429. module.exports = function (x) {
  8430. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  8431. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  8432. if (x[x.length - 1] === lf) {
  8433. x = x.slice(0, x.length - 1);
  8434. }
  8435. if (x[x.length - 1] === cr) {
  8436. x = x.slice(0, x.length - 1);
  8437. }
  8438. return x;
  8439. };
  8440. /***/ }),
  8441. /***/ 777:
  8442. /***/ (function(module, __unusedexports, __webpack_require__) {
  8443. module.exports = getFirstPage
  8444. const getPage = __webpack_require__(265)
  8445. function getFirstPage (octokit, link, headers) {
  8446. return getPage(octokit, link, 'first', headers)
  8447. }
  8448. /***/ }),
  8449. /***/ 796:
  8450. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8451. "use strict";
  8452. Object.defineProperty(exports, '__esModule', { value: true });
  8453. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8454. var osName = _interopDefault(__webpack_require__(2));
  8455. function getUserAgent() {
  8456. try {
  8457. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  8458. } catch (error) {
  8459. if (/wmic os get Caption/.test(error.message)) {
  8460. return "Windows <version undetectable>";
  8461. }
  8462. throw error;
  8463. }
  8464. }
  8465. exports.getUserAgent = getUserAgent;
  8466. //# sourceMappingURL=index.js.map
  8467. /***/ }),
  8468. /***/ 807:
  8469. /***/ (function(module, __unusedexports, __webpack_require__) {
  8470. module.exports = paginate;
  8471. const iterator = __webpack_require__(8);
  8472. function paginate(octokit, route, options, mapFn) {
  8473. if (typeof options === "function") {
  8474. mapFn = options;
  8475. options = undefined;
  8476. }
  8477. options = octokit.request.endpoint.merge(route, options);
  8478. return gather(
  8479. octokit,
  8480. [],
  8481. iterator(octokit, options)[Symbol.asyncIterator](),
  8482. mapFn
  8483. );
  8484. }
  8485. function gather(octokit, results, iterator, mapFn) {
  8486. return iterator.next().then(result => {
  8487. if (result.done) {
  8488. return results;
  8489. }
  8490. let earlyExit = false;
  8491. function done() {
  8492. earlyExit = true;
  8493. }
  8494. results = results.concat(
  8495. mapFn ? mapFn(result.value, done) : result.value.data
  8496. );
  8497. if (earlyExit) {
  8498. return results;
  8499. }
  8500. return gather(octokit, results, iterator, mapFn);
  8501. });
  8502. }
  8503. /***/ }),
  8504. /***/ 814:
  8505. /***/ (function(module, __unusedexports, __webpack_require__) {
  8506. module.exports = which
  8507. which.sync = whichSync
  8508. var isWindows = process.platform === 'win32' ||
  8509. process.env.OSTYPE === 'cygwin' ||
  8510. process.env.OSTYPE === 'msys'
  8511. var path = __webpack_require__(622)
  8512. var COLON = isWindows ? ';' : ':'
  8513. var isexe = __webpack_require__(742)
  8514. function getNotFoundError (cmd) {
  8515. var er = new Error('not found: ' + cmd)
  8516. er.code = 'ENOENT'
  8517. return er
  8518. }
  8519. function getPathInfo (cmd, opt) {
  8520. var colon = opt.colon || COLON
  8521. var pathEnv = opt.path || process.env.PATH || ''
  8522. var pathExt = ['']
  8523. pathEnv = pathEnv.split(colon)
  8524. var pathExtExe = ''
  8525. if (isWindows) {
  8526. pathEnv.unshift(process.cwd())
  8527. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  8528. pathExt = pathExtExe.split(colon)
  8529. // Always test the cmd itself first. isexe will check to make sure
  8530. // it's found in the pathExt set.
  8531. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  8532. pathExt.unshift('')
  8533. }
  8534. // If it has a slash, then we don't bother searching the pathenv.
  8535. // just check the file itself, and that's it.
  8536. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  8537. pathEnv = ['']
  8538. return {
  8539. env: pathEnv,
  8540. ext: pathExt,
  8541. extExe: pathExtExe
  8542. }
  8543. }
  8544. function which (cmd, opt, cb) {
  8545. if (typeof opt === 'function') {
  8546. cb = opt
  8547. opt = {}
  8548. }
  8549. var info = getPathInfo(cmd, opt)
  8550. var pathEnv = info.env
  8551. var pathExt = info.ext
  8552. var pathExtExe = info.extExe
  8553. var found = []
  8554. ;(function F (i, l) {
  8555. if (i === l) {
  8556. if (opt.all && found.length)
  8557. return cb(null, found)
  8558. else
  8559. return cb(getNotFoundError(cmd))
  8560. }
  8561. var pathPart = pathEnv[i]
  8562. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8563. pathPart = pathPart.slice(1, -1)
  8564. var p = path.join(pathPart, cmd)
  8565. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  8566. p = cmd.slice(0, 2) + p
  8567. }
  8568. ;(function E (ii, ll) {
  8569. if (ii === ll) return F(i + 1, l)
  8570. var ext = pathExt[ii]
  8571. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  8572. if (!er && is) {
  8573. if (opt.all)
  8574. found.push(p + ext)
  8575. else
  8576. return cb(null, p + ext)
  8577. }
  8578. return E(ii + 1, ll)
  8579. })
  8580. })(0, pathExt.length)
  8581. })(0, pathEnv.length)
  8582. }
  8583. function whichSync (cmd, opt) {
  8584. opt = opt || {}
  8585. var info = getPathInfo(cmd, opt)
  8586. var pathEnv = info.env
  8587. var pathExt = info.ext
  8588. var pathExtExe = info.extExe
  8589. var found = []
  8590. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  8591. var pathPart = pathEnv[i]
  8592. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8593. pathPart = pathPart.slice(1, -1)
  8594. var p = path.join(pathPart, cmd)
  8595. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  8596. p = cmd.slice(0, 2) + p
  8597. }
  8598. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  8599. var cur = p + pathExt[j]
  8600. var is
  8601. try {
  8602. is = isexe.sync(cur, { pathExt: pathExtExe })
  8603. if (is) {
  8604. if (opt.all)
  8605. found.push(cur)
  8606. else
  8607. return cur
  8608. }
  8609. } catch (ex) {}
  8610. }
  8611. }
  8612. if (opt.all && found.length)
  8613. return found
  8614. if (opt.nothrow)
  8615. return null
  8616. throw getNotFoundError(cmd)
  8617. }
  8618. /***/ }),
  8619. /***/ 816:
  8620. /***/ (function(module) {
  8621. "use strict";
  8622. module.exports = /^#!.*/;
  8623. /***/ }),
  8624. /***/ 818:
  8625. /***/ (function(module, __unusedexports, __webpack_require__) {
  8626. module.exports = isexe
  8627. isexe.sync = sync
  8628. var fs = __webpack_require__(747)
  8629. function checkPathExt (path, options) {
  8630. var pathext = options.pathExt !== undefined ?
  8631. options.pathExt : process.env.PATHEXT
  8632. if (!pathext) {
  8633. return true
  8634. }
  8635. pathext = pathext.split(';')
  8636. if (pathext.indexOf('') !== -1) {
  8637. return true
  8638. }
  8639. for (var i = 0; i < pathext.length; i++) {
  8640. var p = pathext[i].toLowerCase()
  8641. if (p && path.substr(-p.length).toLowerCase() === p) {
  8642. return true
  8643. }
  8644. }
  8645. return false
  8646. }
  8647. function checkStat (stat, path, options) {
  8648. if (!stat.isSymbolicLink() && !stat.isFile()) {
  8649. return false
  8650. }
  8651. return checkPathExt(path, options)
  8652. }
  8653. function isexe (path, options, cb) {
  8654. fs.stat(path, function (er, stat) {
  8655. cb(er, er ? false : checkStat(stat, path, options))
  8656. })
  8657. }
  8658. function sync (path, options) {
  8659. return checkStat(fs.statSync(path), path, options)
  8660. }
  8661. /***/ }),
  8662. /***/ 821:
  8663. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8664. "use strict";
  8665. var __importStar = (this && this.__importStar) || function (mod) {
  8666. if (mod && mod.__esModule) return mod;
  8667. var result = {};
  8668. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8669. result["default"] = mod;
  8670. return result;
  8671. };
  8672. Object.defineProperty(exports, "__esModule", { value: true });
  8673. const core = __importStar(__webpack_require__(470));
  8674. const fsHelper = __importStar(__webpack_require__(618));
  8675. const github = __importStar(__webpack_require__(469));
  8676. const path = __importStar(__webpack_require__(622));
  8677. function getInputs() {
  8678. const result = {};
  8679. // GitHub workspace
  8680. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  8681. if (!githubWorkspacePath) {
  8682. throw new Error('GITHUB_WORKSPACE not defined');
  8683. }
  8684. githubWorkspacePath = path.resolve(githubWorkspacePath);
  8685. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  8686. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  8687. // Qualified repository
  8688. const qualifiedRepository = core.getInput('repository') ||
  8689. `${github.context.repo.owner}/${github.context.repo.repo}`;
  8690. core.debug(`qualified repository = '${qualifiedRepository}'`);
  8691. const splitRepository = qualifiedRepository.split('/');
  8692. if (splitRepository.length !== 2 ||
  8693. !splitRepository[0] ||
  8694. !splitRepository[1]) {
  8695. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  8696. }
  8697. result.repositoryOwner = splitRepository[0];
  8698. result.repositoryName = splitRepository[1];
  8699. // Repository path
  8700. result.repositoryPath = core.getInput('path') || '.';
  8701. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  8702. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  8703. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  8704. }
  8705. // Workflow repository?
  8706. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  8707. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  8708. // Source branch, source version
  8709. result.ref = core.getInput('ref');
  8710. if (!result.ref) {
  8711. if (isWorkflowRepository) {
  8712. result.ref = github.context.ref;
  8713. result.commit = github.context.sha;
  8714. }
  8715. if (!result.ref && !result.commit) {
  8716. result.ref = 'refs/heads/master';
  8717. }
  8718. }
  8719. // SHA?
  8720. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  8721. result.commit = result.ref;
  8722. result.ref = '';
  8723. }
  8724. core.debug(`ref = '${result.ref}'`);
  8725. core.debug(`commit = '${result.commit}'`);
  8726. // Clean
  8727. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  8728. core.debug(`clean = ${result.clean}`);
  8729. // Submodules
  8730. if (core.getInput('submodules')) {
  8731. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  8732. }
  8733. // Fetch depth
  8734. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  8735. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  8736. result.fetchDepth = 0;
  8737. }
  8738. core.debug(`fetch depth = ${result.fetchDepth}`);
  8739. // LFS
  8740. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  8741. core.debug(`lfs = ${result.lfs}`);
  8742. // Access token
  8743. result.accessToken = core.getInput('token');
  8744. return result;
  8745. }
  8746. exports.getInputs = getInputs;
  8747. /***/ }),
  8748. /***/ 835:
  8749. /***/ (function(module) {
  8750. module.exports = require("url");
  8751. /***/ }),
  8752. /***/ 850:
  8753. /***/ (function(module, __unusedexports, __webpack_require__) {
  8754. module.exports = paginationMethodsPlugin
  8755. function paginationMethodsPlugin (octokit) {
  8756. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  8757. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  8758. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  8759. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  8760. octokit.hasFirstPage = __webpack_require__(536)
  8761. octokit.hasLastPage = __webpack_require__(336)
  8762. octokit.hasNextPage = __webpack_require__(929)
  8763. octokit.hasPreviousPage = __webpack_require__(558)
  8764. }
  8765. /***/ }),
  8766. /***/ 854:
  8767. /***/ (function(module) {
  8768. /**
  8769. * lodash (Custom Build) <https://lodash.com/>
  8770. * Build: `lodash modularize exports="npm" -o ./`
  8771. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8772. * Released under MIT license <https://lodash.com/license>
  8773. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8774. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8775. */
  8776. /** Used as the `TypeError` message for "Functions" methods. */
  8777. var FUNC_ERROR_TEXT = 'Expected a function';
  8778. /** Used to stand-in for `undefined` hash values. */
  8779. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8780. /** Used as references for various `Number` constants. */
  8781. var INFINITY = 1 / 0;
  8782. /** `Object#toString` result references. */
  8783. var funcTag = '[object Function]',
  8784. genTag = '[object GeneratorFunction]',
  8785. symbolTag = '[object Symbol]';
  8786. /** Used to match property names within property paths. */
  8787. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8788. reIsPlainProp = /^\w*$/,
  8789. reLeadingDot = /^\./,
  8790. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8791. /**
  8792. * Used to match `RegExp`
  8793. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8794. */
  8795. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8796. /** Used to match backslashes in property paths. */
  8797. var reEscapeChar = /\\(\\)?/g;
  8798. /** Used to detect host constructors (Safari). */
  8799. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8800. /** Detect free variable `global` from Node.js. */
  8801. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  8802. /** Detect free variable `self`. */
  8803. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8804. /** Used as a reference to the global object. */
  8805. var root = freeGlobal || freeSelf || Function('return this')();
  8806. /**
  8807. * Gets the value at `key` of `object`.
  8808. *
  8809. * @private
  8810. * @param {Object} [object] The object to query.
  8811. * @param {string} key The key of the property to get.
  8812. * @returns {*} Returns the property value.
  8813. */
  8814. function getValue(object, key) {
  8815. return object == null ? undefined : object[key];
  8816. }
  8817. /**
  8818. * Checks if `value` is a host object in IE < 9.
  8819. *
  8820. * @private
  8821. * @param {*} value The value to check.
  8822. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  8823. */
  8824. function isHostObject(value) {
  8825. // Many host objects are `Object` objects that can coerce to strings
  8826. // despite having improperly defined `toString` methods.
  8827. var result = false;
  8828. if (value != null && typeof value.toString != 'function') {
  8829. try {
  8830. result = !!(value + '');
  8831. } catch (e) {}
  8832. }
  8833. return result;
  8834. }
  8835. /** Used for built-in method references. */
  8836. var arrayProto = Array.prototype,
  8837. funcProto = Function.prototype,
  8838. objectProto = Object.prototype;
  8839. /** Used to detect overreaching core-js shims. */
  8840. var coreJsData = root['__core-js_shared__'];
  8841. /** Used to detect methods masquerading as native. */
  8842. var maskSrcKey = (function() {
  8843. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8844. return uid ? ('Symbol(src)_1.' + uid) : '';
  8845. }());
  8846. /** Used to resolve the decompiled source of functions. */
  8847. var funcToString = funcProto.toString;
  8848. /** Used to check objects for own properties. */
  8849. var hasOwnProperty = objectProto.hasOwnProperty;
  8850. /**
  8851. * Used to resolve the
  8852. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8853. * of values.
  8854. */
  8855. var objectToString = objectProto.toString;
  8856. /** Used to detect if a method is native. */
  8857. var reIsNative = RegExp('^' +
  8858. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8859. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8860. );
  8861. /** Built-in value references. */
  8862. var Symbol = root.Symbol,
  8863. splice = arrayProto.splice;
  8864. /* Built-in method references that are verified to be native. */
  8865. var Map = getNative(root, 'Map'),
  8866. nativeCreate = getNative(Object, 'create');
  8867. /** Used to convert symbols to primitives and strings. */
  8868. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8869. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8870. /**
  8871. * Creates a hash object.
  8872. *
  8873. * @private
  8874. * @constructor
  8875. * @param {Array} [entries] The key-value pairs to cache.
  8876. */
  8877. function Hash(entries) {
  8878. var index = -1,
  8879. length = entries ? entries.length : 0;
  8880. this.clear();
  8881. while (++index < length) {
  8882. var entry = entries[index];
  8883. this.set(entry[0], entry[1]);
  8884. }
  8885. }
  8886. /**
  8887. * Removes all key-value entries from the hash.
  8888. *
  8889. * @private
  8890. * @name clear
  8891. * @memberOf Hash
  8892. */
  8893. function hashClear() {
  8894. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8895. }
  8896. /**
  8897. * Removes `key` and its value from the hash.
  8898. *
  8899. * @private
  8900. * @name delete
  8901. * @memberOf Hash
  8902. * @param {Object} hash The hash to modify.
  8903. * @param {string} key The key of the value to remove.
  8904. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8905. */
  8906. function hashDelete(key) {
  8907. return this.has(key) && delete this.__data__[key];
  8908. }
  8909. /**
  8910. * Gets the hash value for `key`.
  8911. *
  8912. * @private
  8913. * @name get
  8914. * @memberOf Hash
  8915. * @param {string} key The key of the value to get.
  8916. * @returns {*} Returns the entry value.
  8917. */
  8918. function hashGet(key) {
  8919. var data = this.__data__;
  8920. if (nativeCreate) {
  8921. var result = data[key];
  8922. return result === HASH_UNDEFINED ? undefined : result;
  8923. }
  8924. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8925. }
  8926. /**
  8927. * Checks if a hash value for `key` exists.
  8928. *
  8929. * @private
  8930. * @name has
  8931. * @memberOf Hash
  8932. * @param {string} key The key of the entry to check.
  8933. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8934. */
  8935. function hashHas(key) {
  8936. var data = this.__data__;
  8937. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  8938. }
  8939. /**
  8940. * Sets the hash `key` to `value`.
  8941. *
  8942. * @private
  8943. * @name set
  8944. * @memberOf Hash
  8945. * @param {string} key The key of the value to set.
  8946. * @param {*} value The value to set.
  8947. * @returns {Object} Returns the hash instance.
  8948. */
  8949. function hashSet(key, value) {
  8950. var data = this.__data__;
  8951. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  8952. return this;
  8953. }
  8954. // Add methods to `Hash`.
  8955. Hash.prototype.clear = hashClear;
  8956. Hash.prototype['delete'] = hashDelete;
  8957. Hash.prototype.get = hashGet;
  8958. Hash.prototype.has = hashHas;
  8959. Hash.prototype.set = hashSet;
  8960. /**
  8961. * Creates an list cache object.
  8962. *
  8963. * @private
  8964. * @constructor
  8965. * @param {Array} [entries] The key-value pairs to cache.
  8966. */
  8967. function ListCache(entries) {
  8968. var index = -1,
  8969. length = entries ? entries.length : 0;
  8970. this.clear();
  8971. while (++index < length) {
  8972. var entry = entries[index];
  8973. this.set(entry[0], entry[1]);
  8974. }
  8975. }
  8976. /**
  8977. * Removes all key-value entries from the list cache.
  8978. *
  8979. * @private
  8980. * @name clear
  8981. * @memberOf ListCache
  8982. */
  8983. function listCacheClear() {
  8984. this.__data__ = [];
  8985. }
  8986. /**
  8987. * Removes `key` and its value from the list cache.
  8988. *
  8989. * @private
  8990. * @name delete
  8991. * @memberOf ListCache
  8992. * @param {string} key The key of the value to remove.
  8993. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8994. */
  8995. function listCacheDelete(key) {
  8996. var data = this.__data__,
  8997. index = assocIndexOf(data, key);
  8998. if (index < 0) {
  8999. return false;
  9000. }
  9001. var lastIndex = data.length - 1;
  9002. if (index == lastIndex) {
  9003. data.pop();
  9004. } else {
  9005. splice.call(data, index, 1);
  9006. }
  9007. return true;
  9008. }
  9009. /**
  9010. * Gets the list cache value for `key`.
  9011. *
  9012. * @private
  9013. * @name get
  9014. * @memberOf ListCache
  9015. * @param {string} key The key of the value to get.
  9016. * @returns {*} Returns the entry value.
  9017. */
  9018. function listCacheGet(key) {
  9019. var data = this.__data__,
  9020. index = assocIndexOf(data, key);
  9021. return index < 0 ? undefined : data[index][1];
  9022. }
  9023. /**
  9024. * Checks if a list cache value for `key` exists.
  9025. *
  9026. * @private
  9027. * @name has
  9028. * @memberOf ListCache
  9029. * @param {string} key The key of the entry to check.
  9030. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9031. */
  9032. function listCacheHas(key) {
  9033. return assocIndexOf(this.__data__, key) > -1;
  9034. }
  9035. /**
  9036. * Sets the list cache `key` to `value`.
  9037. *
  9038. * @private
  9039. * @name set
  9040. * @memberOf ListCache
  9041. * @param {string} key The key of the value to set.
  9042. * @param {*} value The value to set.
  9043. * @returns {Object} Returns the list cache instance.
  9044. */
  9045. function listCacheSet(key, value) {
  9046. var data = this.__data__,
  9047. index = assocIndexOf(data, key);
  9048. if (index < 0) {
  9049. data.push([key, value]);
  9050. } else {
  9051. data[index][1] = value;
  9052. }
  9053. return this;
  9054. }
  9055. // Add methods to `ListCache`.
  9056. ListCache.prototype.clear = listCacheClear;
  9057. ListCache.prototype['delete'] = listCacheDelete;
  9058. ListCache.prototype.get = listCacheGet;
  9059. ListCache.prototype.has = listCacheHas;
  9060. ListCache.prototype.set = listCacheSet;
  9061. /**
  9062. * Creates a map cache object to store key-value pairs.
  9063. *
  9064. * @private
  9065. * @constructor
  9066. * @param {Array} [entries] The key-value pairs to cache.
  9067. */
  9068. function MapCache(entries) {
  9069. var index = -1,
  9070. length = entries ? entries.length : 0;
  9071. this.clear();
  9072. while (++index < length) {
  9073. var entry = entries[index];
  9074. this.set(entry[0], entry[1]);
  9075. }
  9076. }
  9077. /**
  9078. * Removes all key-value entries from the map.
  9079. *
  9080. * @private
  9081. * @name clear
  9082. * @memberOf MapCache
  9083. */
  9084. function mapCacheClear() {
  9085. this.__data__ = {
  9086. 'hash': new Hash,
  9087. 'map': new (Map || ListCache),
  9088. 'string': new Hash
  9089. };
  9090. }
  9091. /**
  9092. * Removes `key` and its value from the map.
  9093. *
  9094. * @private
  9095. * @name delete
  9096. * @memberOf MapCache
  9097. * @param {string} key The key of the value to remove.
  9098. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9099. */
  9100. function mapCacheDelete(key) {
  9101. return getMapData(this, key)['delete'](key);
  9102. }
  9103. /**
  9104. * Gets the map value for `key`.
  9105. *
  9106. * @private
  9107. * @name get
  9108. * @memberOf MapCache
  9109. * @param {string} key The key of the value to get.
  9110. * @returns {*} Returns the entry value.
  9111. */
  9112. function mapCacheGet(key) {
  9113. return getMapData(this, key).get(key);
  9114. }
  9115. /**
  9116. * Checks if a map value for `key` exists.
  9117. *
  9118. * @private
  9119. * @name has
  9120. * @memberOf MapCache
  9121. * @param {string} key The key of the entry to check.
  9122. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9123. */
  9124. function mapCacheHas(key) {
  9125. return getMapData(this, key).has(key);
  9126. }
  9127. /**
  9128. * Sets the map `key` to `value`.
  9129. *
  9130. * @private
  9131. * @name set
  9132. * @memberOf MapCache
  9133. * @param {string} key The key of the value to set.
  9134. * @param {*} value The value to set.
  9135. * @returns {Object} Returns the map cache instance.
  9136. */
  9137. function mapCacheSet(key, value) {
  9138. getMapData(this, key).set(key, value);
  9139. return this;
  9140. }
  9141. // Add methods to `MapCache`.
  9142. MapCache.prototype.clear = mapCacheClear;
  9143. MapCache.prototype['delete'] = mapCacheDelete;
  9144. MapCache.prototype.get = mapCacheGet;
  9145. MapCache.prototype.has = mapCacheHas;
  9146. MapCache.prototype.set = mapCacheSet;
  9147. /**
  9148. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9149. *
  9150. * @private
  9151. * @param {Array} array The array to inspect.
  9152. * @param {*} key The key to search for.
  9153. * @returns {number} Returns the index of the matched value, else `-1`.
  9154. */
  9155. function assocIndexOf(array, key) {
  9156. var length = array.length;
  9157. while (length--) {
  9158. if (eq(array[length][0], key)) {
  9159. return length;
  9160. }
  9161. }
  9162. return -1;
  9163. }
  9164. /**
  9165. * The base implementation of `_.get` without support for default values.
  9166. *
  9167. * @private
  9168. * @param {Object} object The object to query.
  9169. * @param {Array|string} path The path of the property to get.
  9170. * @returns {*} Returns the resolved value.
  9171. */
  9172. function baseGet(object, path) {
  9173. path = isKey(path, object) ? [path] : castPath(path);
  9174. var index = 0,
  9175. length = path.length;
  9176. while (object != null && index < length) {
  9177. object = object[toKey(path[index++])];
  9178. }
  9179. return (index && index == length) ? object : undefined;
  9180. }
  9181. /**
  9182. * The base implementation of `_.isNative` without bad shim checks.
  9183. *
  9184. * @private
  9185. * @param {*} value The value to check.
  9186. * @returns {boolean} Returns `true` if `value` is a native function,
  9187. * else `false`.
  9188. */
  9189. function baseIsNative(value) {
  9190. if (!isObject(value) || isMasked(value)) {
  9191. return false;
  9192. }
  9193. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  9194. return pattern.test(toSource(value));
  9195. }
  9196. /**
  9197. * The base implementation of `_.toString` which doesn't convert nullish
  9198. * values to empty strings.
  9199. *
  9200. * @private
  9201. * @param {*} value The value to process.
  9202. * @returns {string} Returns the string.
  9203. */
  9204. function baseToString(value) {
  9205. // Exit early for strings to avoid a performance hit in some environments.
  9206. if (typeof value == 'string') {
  9207. return value;
  9208. }
  9209. if (isSymbol(value)) {
  9210. return symbolToString ? symbolToString.call(value) : '';
  9211. }
  9212. var result = (value + '');
  9213. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9214. }
  9215. /**
  9216. * Casts `value` to a path array if it's not one.
  9217. *
  9218. * @private
  9219. * @param {*} value The value to inspect.
  9220. * @returns {Array} Returns the cast property path array.
  9221. */
  9222. function castPath(value) {
  9223. return isArray(value) ? value : stringToPath(value);
  9224. }
  9225. /**
  9226. * Gets the data for `map`.
  9227. *
  9228. * @private
  9229. * @param {Object} map The map to query.
  9230. * @param {string} key The reference key.
  9231. * @returns {*} Returns the map data.
  9232. */
  9233. function getMapData(map, key) {
  9234. var data = map.__data__;
  9235. return isKeyable(key)
  9236. ? data[typeof key == 'string' ? 'string' : 'hash']
  9237. : data.map;
  9238. }
  9239. /**
  9240. * Gets the native function at `key` of `object`.
  9241. *
  9242. * @private
  9243. * @param {Object} object The object to query.
  9244. * @param {string} key The key of the method to get.
  9245. * @returns {*} Returns the function if it's native, else `undefined`.
  9246. */
  9247. function getNative(object, key) {
  9248. var value = getValue(object, key);
  9249. return baseIsNative(value) ? value : undefined;
  9250. }
  9251. /**
  9252. * Checks if `value` is a property name and not a property path.
  9253. *
  9254. * @private
  9255. * @param {*} value The value to check.
  9256. * @param {Object} [object] The object to query keys on.
  9257. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9258. */
  9259. function isKey(value, object) {
  9260. if (isArray(value)) {
  9261. return false;
  9262. }
  9263. var type = typeof value;
  9264. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  9265. value == null || isSymbol(value)) {
  9266. return true;
  9267. }
  9268. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  9269. (object != null && value in Object(object));
  9270. }
  9271. /**
  9272. * Checks if `value` is suitable for use as unique object key.
  9273. *
  9274. * @private
  9275. * @param {*} value The value to check.
  9276. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  9277. */
  9278. function isKeyable(value) {
  9279. var type = typeof value;
  9280. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  9281. ? (value !== '__proto__')
  9282. : (value === null);
  9283. }
  9284. /**
  9285. * Checks if `func` has its source masked.
  9286. *
  9287. * @private
  9288. * @param {Function} func The function to check.
  9289. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  9290. */
  9291. function isMasked(func) {
  9292. return !!maskSrcKey && (maskSrcKey in func);
  9293. }
  9294. /**
  9295. * Converts `string` to a property path array.
  9296. *
  9297. * @private
  9298. * @param {string} string The string to convert.
  9299. * @returns {Array} Returns the property path array.
  9300. */
  9301. var stringToPath = memoize(function(string) {
  9302. string = toString(string);
  9303. var result = [];
  9304. if (reLeadingDot.test(string)) {
  9305. result.push('');
  9306. }
  9307. string.replace(rePropName, function(match, number, quote, string) {
  9308. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  9309. });
  9310. return result;
  9311. });
  9312. /**
  9313. * Converts `value` to a string key if it's not a string or symbol.
  9314. *
  9315. * @private
  9316. * @param {*} value The value to inspect.
  9317. * @returns {string|symbol} Returns the key.
  9318. */
  9319. function toKey(value) {
  9320. if (typeof value == 'string' || isSymbol(value)) {
  9321. return value;
  9322. }
  9323. var result = (value + '');
  9324. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9325. }
  9326. /**
  9327. * Converts `func` to its source code.
  9328. *
  9329. * @private
  9330. * @param {Function} func The function to process.
  9331. * @returns {string} Returns the source code.
  9332. */
  9333. function toSource(func) {
  9334. if (func != null) {
  9335. try {
  9336. return funcToString.call(func);
  9337. } catch (e) {}
  9338. try {
  9339. return (func + '');
  9340. } catch (e) {}
  9341. }
  9342. return '';
  9343. }
  9344. /**
  9345. * Creates a function that memoizes the result of `func`. If `resolver` is
  9346. * provided, it determines the cache key for storing the result based on the
  9347. * arguments provided to the memoized function. By default, the first argument
  9348. * provided to the memoized function is used as the map cache key. The `func`
  9349. * is invoked with the `this` binding of the memoized function.
  9350. *
  9351. * **Note:** The cache is exposed as the `cache` property on the memoized
  9352. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  9353. * constructor with one whose instances implement the
  9354. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  9355. * method interface of `delete`, `get`, `has`, and `set`.
  9356. *
  9357. * @static
  9358. * @memberOf _
  9359. * @since 0.1.0
  9360. * @category Function
  9361. * @param {Function} func The function to have its output memoized.
  9362. * @param {Function} [resolver] The function to resolve the cache key.
  9363. * @returns {Function} Returns the new memoized function.
  9364. * @example
  9365. *
  9366. * var object = { 'a': 1, 'b': 2 };
  9367. * var other = { 'c': 3, 'd': 4 };
  9368. *
  9369. * var values = _.memoize(_.values);
  9370. * values(object);
  9371. * // => [1, 2]
  9372. *
  9373. * values(other);
  9374. * // => [3, 4]
  9375. *
  9376. * object.a = 2;
  9377. * values(object);
  9378. * // => [1, 2]
  9379. *
  9380. * // Modify the result cache.
  9381. * values.cache.set(object, ['a', 'b']);
  9382. * values(object);
  9383. * // => ['a', 'b']
  9384. *
  9385. * // Replace `_.memoize.Cache`.
  9386. * _.memoize.Cache = WeakMap;
  9387. */
  9388. function memoize(func, resolver) {
  9389. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  9390. throw new TypeError(FUNC_ERROR_TEXT);
  9391. }
  9392. var memoized = function() {
  9393. var args = arguments,
  9394. key = resolver ? resolver.apply(this, args) : args[0],
  9395. cache = memoized.cache;
  9396. if (cache.has(key)) {
  9397. return cache.get(key);
  9398. }
  9399. var result = func.apply(this, args);
  9400. memoized.cache = cache.set(key, result);
  9401. return result;
  9402. };
  9403. memoized.cache = new (memoize.Cache || MapCache);
  9404. return memoized;
  9405. }
  9406. // Assign cache to `_.memoize`.
  9407. memoize.Cache = MapCache;
  9408. /**
  9409. * Performs a
  9410. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9411. * comparison between two values to determine if they are equivalent.
  9412. *
  9413. * @static
  9414. * @memberOf _
  9415. * @since 4.0.0
  9416. * @category Lang
  9417. * @param {*} value The value to compare.
  9418. * @param {*} other The other value to compare.
  9419. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9420. * @example
  9421. *
  9422. * var object = { 'a': 1 };
  9423. * var other = { 'a': 1 };
  9424. *
  9425. * _.eq(object, object);
  9426. * // => true
  9427. *
  9428. * _.eq(object, other);
  9429. * // => false
  9430. *
  9431. * _.eq('a', 'a');
  9432. * // => true
  9433. *
  9434. * _.eq('a', Object('a'));
  9435. * // => false
  9436. *
  9437. * _.eq(NaN, NaN);
  9438. * // => true
  9439. */
  9440. function eq(value, other) {
  9441. return value === other || (value !== value && other !== other);
  9442. }
  9443. /**
  9444. * Checks if `value` is classified as an `Array` object.
  9445. *
  9446. * @static
  9447. * @memberOf _
  9448. * @since 0.1.0
  9449. * @category Lang
  9450. * @param {*} value The value to check.
  9451. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  9452. * @example
  9453. *
  9454. * _.isArray([1, 2, 3]);
  9455. * // => true
  9456. *
  9457. * _.isArray(document.body.children);
  9458. * // => false
  9459. *
  9460. * _.isArray('abc');
  9461. * // => false
  9462. *
  9463. * _.isArray(_.noop);
  9464. * // => false
  9465. */
  9466. var isArray = Array.isArray;
  9467. /**
  9468. * Checks if `value` is classified as a `Function` object.
  9469. *
  9470. * @static
  9471. * @memberOf _
  9472. * @since 0.1.0
  9473. * @category Lang
  9474. * @param {*} value The value to check.
  9475. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  9476. * @example
  9477. *
  9478. * _.isFunction(_);
  9479. * // => true
  9480. *
  9481. * _.isFunction(/abc/);
  9482. * // => false
  9483. */
  9484. function isFunction(value) {
  9485. // The use of `Object#toString` avoids issues with the `typeof` operator
  9486. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  9487. var tag = isObject(value) ? objectToString.call(value) : '';
  9488. return tag == funcTag || tag == genTag;
  9489. }
  9490. /**
  9491. * Checks if `value` is the
  9492. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  9493. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  9494. *
  9495. * @static
  9496. * @memberOf _
  9497. * @since 0.1.0
  9498. * @category Lang
  9499. * @param {*} value The value to check.
  9500. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  9501. * @example
  9502. *
  9503. * _.isObject({});
  9504. * // => true
  9505. *
  9506. * _.isObject([1, 2, 3]);
  9507. * // => true
  9508. *
  9509. * _.isObject(_.noop);
  9510. * // => true
  9511. *
  9512. * _.isObject(null);
  9513. * // => false
  9514. */
  9515. function isObject(value) {
  9516. var type = typeof value;
  9517. return !!value && (type == 'object' || type == 'function');
  9518. }
  9519. /**
  9520. * Checks if `value` is object-like. A value is object-like if it's not `null`
  9521. * and has a `typeof` result of "object".
  9522. *
  9523. * @static
  9524. * @memberOf _
  9525. * @since 4.0.0
  9526. * @category Lang
  9527. * @param {*} value The value to check.
  9528. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  9529. * @example
  9530. *
  9531. * _.isObjectLike({});
  9532. * // => true
  9533. *
  9534. * _.isObjectLike([1, 2, 3]);
  9535. * // => true
  9536. *
  9537. * _.isObjectLike(_.noop);
  9538. * // => false
  9539. *
  9540. * _.isObjectLike(null);
  9541. * // => false
  9542. */
  9543. function isObjectLike(value) {
  9544. return !!value && typeof value == 'object';
  9545. }
  9546. /**
  9547. * Checks if `value` is classified as a `Symbol` primitive or object.
  9548. *
  9549. * @static
  9550. * @memberOf _
  9551. * @since 4.0.0
  9552. * @category Lang
  9553. * @param {*} value The value to check.
  9554. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  9555. * @example
  9556. *
  9557. * _.isSymbol(Symbol.iterator);
  9558. * // => true
  9559. *
  9560. * _.isSymbol('abc');
  9561. * // => false
  9562. */
  9563. function isSymbol(value) {
  9564. return typeof value == 'symbol' ||
  9565. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  9566. }
  9567. /**
  9568. * Converts `value` to a string. An empty string is returned for `null`
  9569. * and `undefined` values. The sign of `-0` is preserved.
  9570. *
  9571. * @static
  9572. * @memberOf _
  9573. * @since 4.0.0
  9574. * @category Lang
  9575. * @param {*} value The value to process.
  9576. * @returns {string} Returns the string.
  9577. * @example
  9578. *
  9579. * _.toString(null);
  9580. * // => ''
  9581. *
  9582. * _.toString(-0);
  9583. * // => '-0'
  9584. *
  9585. * _.toString([1, 2, 3]);
  9586. * // => '1,2,3'
  9587. */
  9588. function toString(value) {
  9589. return value == null ? '' : baseToString(value);
  9590. }
  9591. /**
  9592. * Gets the value at `path` of `object`. If the resolved value is
  9593. * `undefined`, the `defaultValue` is returned in its place.
  9594. *
  9595. * @static
  9596. * @memberOf _
  9597. * @since 3.7.0
  9598. * @category Object
  9599. * @param {Object} object The object to query.
  9600. * @param {Array|string} path The path of the property to get.
  9601. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  9602. * @returns {*} Returns the resolved value.
  9603. * @example
  9604. *
  9605. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  9606. *
  9607. * _.get(object, 'a[0].b.c');
  9608. * // => 3
  9609. *
  9610. * _.get(object, ['a', '0', 'b', 'c']);
  9611. * // => 3
  9612. *
  9613. * _.get(object, 'a.b.c', 'default');
  9614. * // => 'default'
  9615. */
  9616. function get(object, path, defaultValue) {
  9617. var result = object == null ? undefined : baseGet(object, path);
  9618. return result === undefined ? defaultValue : result;
  9619. }
  9620. module.exports = get;
  9621. /***/ }),
  9622. /***/ 855:
  9623. /***/ (function(module, __unusedexports, __webpack_require__) {
  9624. module.exports = registerPlugin;
  9625. const factory = __webpack_require__(47);
  9626. function registerPlugin(plugins, pluginFunction) {
  9627. return factory(
  9628. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  9629. );
  9630. }
  9631. /***/ }),
  9632. /***/ 863:
  9633. /***/ (function(module, __unusedexports, __webpack_require__) {
  9634. module.exports = authenticationBeforeRequest;
  9635. const btoa = __webpack_require__(675);
  9636. const withAuthorizationPrefix = __webpack_require__(143);
  9637. function authenticationBeforeRequest(state, options) {
  9638. if (typeof state.auth === "string") {
  9639. options.headers.authorization = withAuthorizationPrefix(state.auth);
  9640. // https://developer.github.com/v3/previews/#integrations
  9641. if (
  9642. /^bearer /i.test(state.auth) &&
  9643. !/machine-man/.test(options.headers.accept)
  9644. ) {
  9645. const acceptHeaders = options.headers.accept
  9646. .split(",")
  9647. .concat("application/vnd.github.machine-man-preview+json");
  9648. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  9649. }
  9650. return;
  9651. }
  9652. if (state.auth.username) {
  9653. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  9654. options.headers.authorization = `Basic ${hash}`;
  9655. if (state.otp) {
  9656. options.headers["x-github-otp"] = state.otp;
  9657. }
  9658. return;
  9659. }
  9660. if (state.auth.clientId) {
  9661. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  9662. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  9663. // URL though: `/applications/:client_id/tokens/:access_token`.
  9664. //
  9665. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  9666. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  9667. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  9668. //
  9669. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  9670. // as well as "/applications/123/tokens/token456"
  9671. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  9672. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  9673. options.headers.authorization = `Basic ${hash}`;
  9674. return;
  9675. }
  9676. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  9677. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  9678. return;
  9679. }
  9680. return Promise.resolve()
  9681. .then(() => {
  9682. return state.auth();
  9683. })
  9684. .then(authorization => {
  9685. options.headers.authorization = withAuthorizationPrefix(authorization);
  9686. });
  9687. }
  9688. /***/ }),
  9689. /***/ 866:
  9690. /***/ (function(module, __unusedexports, __webpack_require__) {
  9691. "use strict";
  9692. var shebangRegex = __webpack_require__(816);
  9693. module.exports = function (str) {
  9694. var match = str.match(shebangRegex);
  9695. if (!match) {
  9696. return null;
  9697. }
  9698. var arr = match[0].replace(/#! ?/, '').split(' ');
  9699. var bin = arr[0].split('/').pop();
  9700. var arg = arr[1];
  9701. return (bin === 'env' ?
  9702. arg :
  9703. bin + (arg ? ' ' + arg : '')
  9704. );
  9705. };
  9706. /***/ }),
  9707. /***/ 881:
  9708. /***/ (function(module) {
  9709. "use strict";
  9710. const isWin = process.platform === 'win32';
  9711. function notFoundError(original, syscall) {
  9712. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  9713. code: 'ENOENT',
  9714. errno: 'ENOENT',
  9715. syscall: `${syscall} ${original.command}`,
  9716. path: original.command,
  9717. spawnargs: original.args,
  9718. });
  9719. }
  9720. function hookChildProcess(cp, parsed) {
  9721. if (!isWin) {
  9722. return;
  9723. }
  9724. const originalEmit = cp.emit;
  9725. cp.emit = function (name, arg1) {
  9726. // If emitting "exit" event and exit code is 1, we need to check if
  9727. // the command exists and emit an "error" instead
  9728. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  9729. if (name === 'exit') {
  9730. const err = verifyENOENT(arg1, parsed, 'spawn');
  9731. if (err) {
  9732. return originalEmit.call(cp, 'error', err);
  9733. }
  9734. }
  9735. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  9736. };
  9737. }
  9738. function verifyENOENT(status, parsed) {
  9739. if (isWin && status === 1 && !parsed.file) {
  9740. return notFoundError(parsed.original, 'spawn');
  9741. }
  9742. return null;
  9743. }
  9744. function verifyENOENTSync(status, parsed) {
  9745. if (isWin && status === 1 && !parsed.file) {
  9746. return notFoundError(parsed.original, 'spawnSync');
  9747. }
  9748. return null;
  9749. }
  9750. module.exports = {
  9751. hookChildProcess,
  9752. verifyENOENT,
  9753. verifyENOENTSync,
  9754. notFoundError,
  9755. };
  9756. /***/ }),
  9757. /***/ 883:
  9758. /***/ (function(module) {
  9759. /**
  9760. * lodash (Custom Build) <https://lodash.com/>
  9761. * Build: `lodash modularize exports="npm" -o ./`
  9762. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  9763. * Released under MIT license <https://lodash.com/license>
  9764. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  9765. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  9766. */
  9767. /** Used as the `TypeError` message for "Functions" methods. */
  9768. var FUNC_ERROR_TEXT = 'Expected a function';
  9769. /** Used to stand-in for `undefined` hash values. */
  9770. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  9771. /** Used as references for various `Number` constants. */
  9772. var INFINITY = 1 / 0,
  9773. MAX_SAFE_INTEGER = 9007199254740991;
  9774. /** `Object#toString` result references. */
  9775. var funcTag = '[object Function]',
  9776. genTag = '[object GeneratorFunction]',
  9777. symbolTag = '[object Symbol]';
  9778. /** Used to match property names within property paths. */
  9779. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  9780. reIsPlainProp = /^\w*$/,
  9781. reLeadingDot = /^\./,
  9782. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  9783. /**
  9784. * Used to match `RegExp`
  9785. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  9786. */
  9787. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  9788. /** Used to match backslashes in property paths. */
  9789. var reEscapeChar = /\\(\\)?/g;
  9790. /** Used to detect host constructors (Safari). */
  9791. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  9792. /** Used to detect unsigned integer values. */
  9793. var reIsUint = /^(?:0|[1-9]\d*)$/;
  9794. /** Detect free variable `global` from Node.js. */
  9795. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  9796. /** Detect free variable `self`. */
  9797. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  9798. /** Used as a reference to the global object. */
  9799. var root = freeGlobal || freeSelf || Function('return this')();
  9800. /**
  9801. * Gets the value at `key` of `object`.
  9802. *
  9803. * @private
  9804. * @param {Object} [object] The object to query.
  9805. * @param {string} key The key of the property to get.
  9806. * @returns {*} Returns the property value.
  9807. */
  9808. function getValue(object, key) {
  9809. return object == null ? undefined : object[key];
  9810. }
  9811. /**
  9812. * Checks if `value` is a host object in IE < 9.
  9813. *
  9814. * @private
  9815. * @param {*} value The value to check.
  9816. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  9817. */
  9818. function isHostObject(value) {
  9819. // Many host objects are `Object` objects that can coerce to strings
  9820. // despite having improperly defined `toString` methods.
  9821. var result = false;
  9822. if (value != null && typeof value.toString != 'function') {
  9823. try {
  9824. result = !!(value + '');
  9825. } catch (e) {}
  9826. }
  9827. return result;
  9828. }
  9829. /** Used for built-in method references. */
  9830. var arrayProto = Array.prototype,
  9831. funcProto = Function.prototype,
  9832. objectProto = Object.prototype;
  9833. /** Used to detect overreaching core-js shims. */
  9834. var coreJsData = root['__core-js_shared__'];
  9835. /** Used to detect methods masquerading as native. */
  9836. var maskSrcKey = (function() {
  9837. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  9838. return uid ? ('Symbol(src)_1.' + uid) : '';
  9839. }());
  9840. /** Used to resolve the decompiled source of functions. */
  9841. var funcToString = funcProto.toString;
  9842. /** Used to check objects for own properties. */
  9843. var hasOwnProperty = objectProto.hasOwnProperty;
  9844. /**
  9845. * Used to resolve the
  9846. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  9847. * of values.
  9848. */
  9849. var objectToString = objectProto.toString;
  9850. /** Used to detect if a method is native. */
  9851. var reIsNative = RegExp('^' +
  9852. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  9853. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  9854. );
  9855. /** Built-in value references. */
  9856. var Symbol = root.Symbol,
  9857. splice = arrayProto.splice;
  9858. /* Built-in method references that are verified to be native. */
  9859. var Map = getNative(root, 'Map'),
  9860. nativeCreate = getNative(Object, 'create');
  9861. /** Used to convert symbols to primitives and strings. */
  9862. var symbolProto = Symbol ? Symbol.prototype : undefined,
  9863. symbolToString = symbolProto ? symbolProto.toString : undefined;
  9864. /**
  9865. * Creates a hash object.
  9866. *
  9867. * @private
  9868. * @constructor
  9869. * @param {Array} [entries] The key-value pairs to cache.
  9870. */
  9871. function Hash(entries) {
  9872. var index = -1,
  9873. length = entries ? entries.length : 0;
  9874. this.clear();
  9875. while (++index < length) {
  9876. var entry = entries[index];
  9877. this.set(entry[0], entry[1]);
  9878. }
  9879. }
  9880. /**
  9881. * Removes all key-value entries from the hash.
  9882. *
  9883. * @private
  9884. * @name clear
  9885. * @memberOf Hash
  9886. */
  9887. function hashClear() {
  9888. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  9889. }
  9890. /**
  9891. * Removes `key` and its value from the hash.
  9892. *
  9893. * @private
  9894. * @name delete
  9895. * @memberOf Hash
  9896. * @param {Object} hash The hash to modify.
  9897. * @param {string} key The key of the value to remove.
  9898. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9899. */
  9900. function hashDelete(key) {
  9901. return this.has(key) && delete this.__data__[key];
  9902. }
  9903. /**
  9904. * Gets the hash value for `key`.
  9905. *
  9906. * @private
  9907. * @name get
  9908. * @memberOf Hash
  9909. * @param {string} key The key of the value to get.
  9910. * @returns {*} Returns the entry value.
  9911. */
  9912. function hashGet(key) {
  9913. var data = this.__data__;
  9914. if (nativeCreate) {
  9915. var result = data[key];
  9916. return result === HASH_UNDEFINED ? undefined : result;
  9917. }
  9918. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  9919. }
  9920. /**
  9921. * Checks if a hash value for `key` exists.
  9922. *
  9923. * @private
  9924. * @name has
  9925. * @memberOf Hash
  9926. * @param {string} key The key of the entry to check.
  9927. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9928. */
  9929. function hashHas(key) {
  9930. var data = this.__data__;
  9931. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  9932. }
  9933. /**
  9934. * Sets the hash `key` to `value`.
  9935. *
  9936. * @private
  9937. * @name set
  9938. * @memberOf Hash
  9939. * @param {string} key The key of the value to set.
  9940. * @param {*} value The value to set.
  9941. * @returns {Object} Returns the hash instance.
  9942. */
  9943. function hashSet(key, value) {
  9944. var data = this.__data__;
  9945. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  9946. return this;
  9947. }
  9948. // Add methods to `Hash`.
  9949. Hash.prototype.clear = hashClear;
  9950. Hash.prototype['delete'] = hashDelete;
  9951. Hash.prototype.get = hashGet;
  9952. Hash.prototype.has = hashHas;
  9953. Hash.prototype.set = hashSet;
  9954. /**
  9955. * Creates an list cache object.
  9956. *
  9957. * @private
  9958. * @constructor
  9959. * @param {Array} [entries] The key-value pairs to cache.
  9960. */
  9961. function ListCache(entries) {
  9962. var index = -1,
  9963. length = entries ? entries.length : 0;
  9964. this.clear();
  9965. while (++index < length) {
  9966. var entry = entries[index];
  9967. this.set(entry[0], entry[1]);
  9968. }
  9969. }
  9970. /**
  9971. * Removes all key-value entries from the list cache.
  9972. *
  9973. * @private
  9974. * @name clear
  9975. * @memberOf ListCache
  9976. */
  9977. function listCacheClear() {
  9978. this.__data__ = [];
  9979. }
  9980. /**
  9981. * Removes `key` and its value from the list cache.
  9982. *
  9983. * @private
  9984. * @name delete
  9985. * @memberOf ListCache
  9986. * @param {string} key The key of the value to remove.
  9987. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9988. */
  9989. function listCacheDelete(key) {
  9990. var data = this.__data__,
  9991. index = assocIndexOf(data, key);
  9992. if (index < 0) {
  9993. return false;
  9994. }
  9995. var lastIndex = data.length - 1;
  9996. if (index == lastIndex) {
  9997. data.pop();
  9998. } else {
  9999. splice.call(data, index, 1);
  10000. }
  10001. return true;
  10002. }
  10003. /**
  10004. * Gets the list cache value for `key`.
  10005. *
  10006. * @private
  10007. * @name get
  10008. * @memberOf ListCache
  10009. * @param {string} key The key of the value to get.
  10010. * @returns {*} Returns the entry value.
  10011. */
  10012. function listCacheGet(key) {
  10013. var data = this.__data__,
  10014. index = assocIndexOf(data, key);
  10015. return index < 0 ? undefined : data[index][1];
  10016. }
  10017. /**
  10018. * Checks if a list cache value for `key` exists.
  10019. *
  10020. * @private
  10021. * @name has
  10022. * @memberOf ListCache
  10023. * @param {string} key The key of the entry to check.
  10024. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10025. */
  10026. function listCacheHas(key) {
  10027. return assocIndexOf(this.__data__, key) > -1;
  10028. }
  10029. /**
  10030. * Sets the list cache `key` to `value`.
  10031. *
  10032. * @private
  10033. * @name set
  10034. * @memberOf ListCache
  10035. * @param {string} key The key of the value to set.
  10036. * @param {*} value The value to set.
  10037. * @returns {Object} Returns the list cache instance.
  10038. */
  10039. function listCacheSet(key, value) {
  10040. var data = this.__data__,
  10041. index = assocIndexOf(data, key);
  10042. if (index < 0) {
  10043. data.push([key, value]);
  10044. } else {
  10045. data[index][1] = value;
  10046. }
  10047. return this;
  10048. }
  10049. // Add methods to `ListCache`.
  10050. ListCache.prototype.clear = listCacheClear;
  10051. ListCache.prototype['delete'] = listCacheDelete;
  10052. ListCache.prototype.get = listCacheGet;
  10053. ListCache.prototype.has = listCacheHas;
  10054. ListCache.prototype.set = listCacheSet;
  10055. /**
  10056. * Creates a map cache object to store key-value pairs.
  10057. *
  10058. * @private
  10059. * @constructor
  10060. * @param {Array} [entries] The key-value pairs to cache.
  10061. */
  10062. function MapCache(entries) {
  10063. var index = -1,
  10064. length = entries ? entries.length : 0;
  10065. this.clear();
  10066. while (++index < length) {
  10067. var entry = entries[index];
  10068. this.set(entry[0], entry[1]);
  10069. }
  10070. }
  10071. /**
  10072. * Removes all key-value entries from the map.
  10073. *
  10074. * @private
  10075. * @name clear
  10076. * @memberOf MapCache
  10077. */
  10078. function mapCacheClear() {
  10079. this.__data__ = {
  10080. 'hash': new Hash,
  10081. 'map': new (Map || ListCache),
  10082. 'string': new Hash
  10083. };
  10084. }
  10085. /**
  10086. * Removes `key` and its value from the map.
  10087. *
  10088. * @private
  10089. * @name delete
  10090. * @memberOf MapCache
  10091. * @param {string} key The key of the value to remove.
  10092. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10093. */
  10094. function mapCacheDelete(key) {
  10095. return getMapData(this, key)['delete'](key);
  10096. }
  10097. /**
  10098. * Gets the map value for `key`.
  10099. *
  10100. * @private
  10101. * @name get
  10102. * @memberOf MapCache
  10103. * @param {string} key The key of the value to get.
  10104. * @returns {*} Returns the entry value.
  10105. */
  10106. function mapCacheGet(key) {
  10107. return getMapData(this, key).get(key);
  10108. }
  10109. /**
  10110. * Checks if a map value for `key` exists.
  10111. *
  10112. * @private
  10113. * @name has
  10114. * @memberOf MapCache
  10115. * @param {string} key The key of the entry to check.
  10116. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10117. */
  10118. function mapCacheHas(key) {
  10119. return getMapData(this, key).has(key);
  10120. }
  10121. /**
  10122. * Sets the map `key` to `value`.
  10123. *
  10124. * @private
  10125. * @name set
  10126. * @memberOf MapCache
  10127. * @param {string} key The key of the value to set.
  10128. * @param {*} value The value to set.
  10129. * @returns {Object} Returns the map cache instance.
  10130. */
  10131. function mapCacheSet(key, value) {
  10132. getMapData(this, key).set(key, value);
  10133. return this;
  10134. }
  10135. // Add methods to `MapCache`.
  10136. MapCache.prototype.clear = mapCacheClear;
  10137. MapCache.prototype['delete'] = mapCacheDelete;
  10138. MapCache.prototype.get = mapCacheGet;
  10139. MapCache.prototype.has = mapCacheHas;
  10140. MapCache.prototype.set = mapCacheSet;
  10141. /**
  10142. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  10143. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10144. * for equality comparisons.
  10145. *
  10146. * @private
  10147. * @param {Object} object The object to modify.
  10148. * @param {string} key The key of the property to assign.
  10149. * @param {*} value The value to assign.
  10150. */
  10151. function assignValue(object, key, value) {
  10152. var objValue = object[key];
  10153. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  10154. (value === undefined && !(key in object))) {
  10155. object[key] = value;
  10156. }
  10157. }
  10158. /**
  10159. * Gets the index at which the `key` is found in `array` of key-value pairs.
  10160. *
  10161. * @private
  10162. * @param {Array} array The array to inspect.
  10163. * @param {*} key The key to search for.
  10164. * @returns {number} Returns the index of the matched value, else `-1`.
  10165. */
  10166. function assocIndexOf(array, key) {
  10167. var length = array.length;
  10168. while (length--) {
  10169. if (eq(array[length][0], key)) {
  10170. return length;
  10171. }
  10172. }
  10173. return -1;
  10174. }
  10175. /**
  10176. * The base implementation of `_.isNative` without bad shim checks.
  10177. *
  10178. * @private
  10179. * @param {*} value The value to check.
  10180. * @returns {boolean} Returns `true` if `value` is a native function,
  10181. * else `false`.
  10182. */
  10183. function baseIsNative(value) {
  10184. if (!isObject(value) || isMasked(value)) {
  10185. return false;
  10186. }
  10187. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  10188. return pattern.test(toSource(value));
  10189. }
  10190. /**
  10191. * The base implementation of `_.set`.
  10192. *
  10193. * @private
  10194. * @param {Object} object The object to modify.
  10195. * @param {Array|string} path The path of the property to set.
  10196. * @param {*} value The value to set.
  10197. * @param {Function} [customizer] The function to customize path creation.
  10198. * @returns {Object} Returns `object`.
  10199. */
  10200. function baseSet(object, path, value, customizer) {
  10201. if (!isObject(object)) {
  10202. return object;
  10203. }
  10204. path = isKey(path, object) ? [path] : castPath(path);
  10205. var index = -1,
  10206. length = path.length,
  10207. lastIndex = length - 1,
  10208. nested = object;
  10209. while (nested != null && ++index < length) {
  10210. var key = toKey(path[index]),
  10211. newValue = value;
  10212. if (index != lastIndex) {
  10213. var objValue = nested[key];
  10214. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10215. if (newValue === undefined) {
  10216. newValue = isObject(objValue)
  10217. ? objValue
  10218. : (isIndex(path[index + 1]) ? [] : {});
  10219. }
  10220. }
  10221. assignValue(nested, key, newValue);
  10222. nested = nested[key];
  10223. }
  10224. return object;
  10225. }
  10226. /**
  10227. * The base implementation of `_.toString` which doesn't convert nullish
  10228. * values to empty strings.
  10229. *
  10230. * @private
  10231. * @param {*} value The value to process.
  10232. * @returns {string} Returns the string.
  10233. */
  10234. function baseToString(value) {
  10235. // Exit early for strings to avoid a performance hit in some environments.
  10236. if (typeof value == 'string') {
  10237. return value;
  10238. }
  10239. if (isSymbol(value)) {
  10240. return symbolToString ? symbolToString.call(value) : '';
  10241. }
  10242. var result = (value + '');
  10243. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10244. }
  10245. /**
  10246. * Casts `value` to a path array if it's not one.
  10247. *
  10248. * @private
  10249. * @param {*} value The value to inspect.
  10250. * @returns {Array} Returns the cast property path array.
  10251. */
  10252. function castPath(value) {
  10253. return isArray(value) ? value : stringToPath(value);
  10254. }
  10255. /**
  10256. * Gets the data for `map`.
  10257. *
  10258. * @private
  10259. * @param {Object} map The map to query.
  10260. * @param {string} key The reference key.
  10261. * @returns {*} Returns the map data.
  10262. */
  10263. function getMapData(map, key) {
  10264. var data = map.__data__;
  10265. return isKeyable(key)
  10266. ? data[typeof key == 'string' ? 'string' : 'hash']
  10267. : data.map;
  10268. }
  10269. /**
  10270. * Gets the native function at `key` of `object`.
  10271. *
  10272. * @private
  10273. * @param {Object} object The object to query.
  10274. * @param {string} key The key of the method to get.
  10275. * @returns {*} Returns the function if it's native, else `undefined`.
  10276. */
  10277. function getNative(object, key) {
  10278. var value = getValue(object, key);
  10279. return baseIsNative(value) ? value : undefined;
  10280. }
  10281. /**
  10282. * Checks if `value` is a valid array-like index.
  10283. *
  10284. * @private
  10285. * @param {*} value The value to check.
  10286. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  10287. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  10288. */
  10289. function isIndex(value, length) {
  10290. length = length == null ? MAX_SAFE_INTEGER : length;
  10291. return !!length &&
  10292. (typeof value == 'number' || reIsUint.test(value)) &&
  10293. (value > -1 && value % 1 == 0 && value < length);
  10294. }
  10295. /**
  10296. * Checks if `value` is a property name and not a property path.
  10297. *
  10298. * @private
  10299. * @param {*} value The value to check.
  10300. * @param {Object} [object] The object to query keys on.
  10301. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  10302. */
  10303. function isKey(value, object) {
  10304. if (isArray(value)) {
  10305. return false;
  10306. }
  10307. var type = typeof value;
  10308. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  10309. value == null || isSymbol(value)) {
  10310. return true;
  10311. }
  10312. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  10313. (object != null && value in Object(object));
  10314. }
  10315. /**
  10316. * Checks if `value` is suitable for use as unique object key.
  10317. *
  10318. * @private
  10319. * @param {*} value The value to check.
  10320. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  10321. */
  10322. function isKeyable(value) {
  10323. var type = typeof value;
  10324. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  10325. ? (value !== '__proto__')
  10326. : (value === null);
  10327. }
  10328. /**
  10329. * Checks if `func` has its source masked.
  10330. *
  10331. * @private
  10332. * @param {Function} func The function to check.
  10333. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  10334. */
  10335. function isMasked(func) {
  10336. return !!maskSrcKey && (maskSrcKey in func);
  10337. }
  10338. /**
  10339. * Converts `string` to a property path array.
  10340. *
  10341. * @private
  10342. * @param {string} string The string to convert.
  10343. * @returns {Array} Returns the property path array.
  10344. */
  10345. var stringToPath = memoize(function(string) {
  10346. string = toString(string);
  10347. var result = [];
  10348. if (reLeadingDot.test(string)) {
  10349. result.push('');
  10350. }
  10351. string.replace(rePropName, function(match, number, quote, string) {
  10352. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  10353. });
  10354. return result;
  10355. });
  10356. /**
  10357. * Converts `value` to a string key if it's not a string or symbol.
  10358. *
  10359. * @private
  10360. * @param {*} value The value to inspect.
  10361. * @returns {string|symbol} Returns the key.
  10362. */
  10363. function toKey(value) {
  10364. if (typeof value == 'string' || isSymbol(value)) {
  10365. return value;
  10366. }
  10367. var result = (value + '');
  10368. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10369. }
  10370. /**
  10371. * Converts `func` to its source code.
  10372. *
  10373. * @private
  10374. * @param {Function} func The function to process.
  10375. * @returns {string} Returns the source code.
  10376. */
  10377. function toSource(func) {
  10378. if (func != null) {
  10379. try {
  10380. return funcToString.call(func);
  10381. } catch (e) {}
  10382. try {
  10383. return (func + '');
  10384. } catch (e) {}
  10385. }
  10386. return '';
  10387. }
  10388. /**
  10389. * Creates a function that memoizes the result of `func`. If `resolver` is
  10390. * provided, it determines the cache key for storing the result based on the
  10391. * arguments provided to the memoized function. By default, the first argument
  10392. * provided to the memoized function is used as the map cache key. The `func`
  10393. * is invoked with the `this` binding of the memoized function.
  10394. *
  10395. * **Note:** The cache is exposed as the `cache` property on the memoized
  10396. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10397. * constructor with one whose instances implement the
  10398. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10399. * method interface of `delete`, `get`, `has`, and `set`.
  10400. *
  10401. * @static
  10402. * @memberOf _
  10403. * @since 0.1.0
  10404. * @category Function
  10405. * @param {Function} func The function to have its output memoized.
  10406. * @param {Function} [resolver] The function to resolve the cache key.
  10407. * @returns {Function} Returns the new memoized function.
  10408. * @example
  10409. *
  10410. * var object = { 'a': 1, 'b': 2 };
  10411. * var other = { 'c': 3, 'd': 4 };
  10412. *
  10413. * var values = _.memoize(_.values);
  10414. * values(object);
  10415. * // => [1, 2]
  10416. *
  10417. * values(other);
  10418. * // => [3, 4]
  10419. *
  10420. * object.a = 2;
  10421. * values(object);
  10422. * // => [1, 2]
  10423. *
  10424. * // Modify the result cache.
  10425. * values.cache.set(object, ['a', 'b']);
  10426. * values(object);
  10427. * // => ['a', 'b']
  10428. *
  10429. * // Replace `_.memoize.Cache`.
  10430. * _.memoize.Cache = WeakMap;
  10431. */
  10432. function memoize(func, resolver) {
  10433. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  10434. throw new TypeError(FUNC_ERROR_TEXT);
  10435. }
  10436. var memoized = function() {
  10437. var args = arguments,
  10438. key = resolver ? resolver.apply(this, args) : args[0],
  10439. cache = memoized.cache;
  10440. if (cache.has(key)) {
  10441. return cache.get(key);
  10442. }
  10443. var result = func.apply(this, args);
  10444. memoized.cache = cache.set(key, result);
  10445. return result;
  10446. };
  10447. memoized.cache = new (memoize.Cache || MapCache);
  10448. return memoized;
  10449. }
  10450. // Assign cache to `_.memoize`.
  10451. memoize.Cache = MapCache;
  10452. /**
  10453. * Performs a
  10454. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10455. * comparison between two values to determine if they are equivalent.
  10456. *
  10457. * @static
  10458. * @memberOf _
  10459. * @since 4.0.0
  10460. * @category Lang
  10461. * @param {*} value The value to compare.
  10462. * @param {*} other The other value to compare.
  10463. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  10464. * @example
  10465. *
  10466. * var object = { 'a': 1 };
  10467. * var other = { 'a': 1 };
  10468. *
  10469. * _.eq(object, object);
  10470. * // => true
  10471. *
  10472. * _.eq(object, other);
  10473. * // => false
  10474. *
  10475. * _.eq('a', 'a');
  10476. * // => true
  10477. *
  10478. * _.eq('a', Object('a'));
  10479. * // => false
  10480. *
  10481. * _.eq(NaN, NaN);
  10482. * // => true
  10483. */
  10484. function eq(value, other) {
  10485. return value === other || (value !== value && other !== other);
  10486. }
  10487. /**
  10488. * Checks if `value` is classified as an `Array` object.
  10489. *
  10490. * @static
  10491. * @memberOf _
  10492. * @since 0.1.0
  10493. * @category Lang
  10494. * @param {*} value The value to check.
  10495. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  10496. * @example
  10497. *
  10498. * _.isArray([1, 2, 3]);
  10499. * // => true
  10500. *
  10501. * _.isArray(document.body.children);
  10502. * // => false
  10503. *
  10504. * _.isArray('abc');
  10505. * // => false
  10506. *
  10507. * _.isArray(_.noop);
  10508. * // => false
  10509. */
  10510. var isArray = Array.isArray;
  10511. /**
  10512. * Checks if `value` is classified as a `Function` object.
  10513. *
  10514. * @static
  10515. * @memberOf _
  10516. * @since 0.1.0
  10517. * @category Lang
  10518. * @param {*} value The value to check.
  10519. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10520. * @example
  10521. *
  10522. * _.isFunction(_);
  10523. * // => true
  10524. *
  10525. * _.isFunction(/abc/);
  10526. * // => false
  10527. */
  10528. function isFunction(value) {
  10529. // The use of `Object#toString` avoids issues with the `typeof` operator
  10530. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  10531. var tag = isObject(value) ? objectToString.call(value) : '';
  10532. return tag == funcTag || tag == genTag;
  10533. }
  10534. /**
  10535. * Checks if `value` is the
  10536. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10537. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10538. *
  10539. * @static
  10540. * @memberOf _
  10541. * @since 0.1.0
  10542. * @category Lang
  10543. * @param {*} value The value to check.
  10544. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10545. * @example
  10546. *
  10547. * _.isObject({});
  10548. * // => true
  10549. *
  10550. * _.isObject([1, 2, 3]);
  10551. * // => true
  10552. *
  10553. * _.isObject(_.noop);
  10554. * // => true
  10555. *
  10556. * _.isObject(null);
  10557. * // => false
  10558. */
  10559. function isObject(value) {
  10560. var type = typeof value;
  10561. return !!value && (type == 'object' || type == 'function');
  10562. }
  10563. /**
  10564. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10565. * and has a `typeof` result of "object".
  10566. *
  10567. * @static
  10568. * @memberOf _
  10569. * @since 4.0.0
  10570. * @category Lang
  10571. * @param {*} value The value to check.
  10572. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10573. * @example
  10574. *
  10575. * _.isObjectLike({});
  10576. * // => true
  10577. *
  10578. * _.isObjectLike([1, 2, 3]);
  10579. * // => true
  10580. *
  10581. * _.isObjectLike(_.noop);
  10582. * // => false
  10583. *
  10584. * _.isObjectLike(null);
  10585. * // => false
  10586. */
  10587. function isObjectLike(value) {
  10588. return !!value && typeof value == 'object';
  10589. }
  10590. /**
  10591. * Checks if `value` is classified as a `Symbol` primitive or object.
  10592. *
  10593. * @static
  10594. * @memberOf _
  10595. * @since 4.0.0
  10596. * @category Lang
  10597. * @param {*} value The value to check.
  10598. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10599. * @example
  10600. *
  10601. * _.isSymbol(Symbol.iterator);
  10602. * // => true
  10603. *
  10604. * _.isSymbol('abc');
  10605. * // => false
  10606. */
  10607. function isSymbol(value) {
  10608. return typeof value == 'symbol' ||
  10609. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  10610. }
  10611. /**
  10612. * Converts `value` to a string. An empty string is returned for `null`
  10613. * and `undefined` values. The sign of `-0` is preserved.
  10614. *
  10615. * @static
  10616. * @memberOf _
  10617. * @since 4.0.0
  10618. * @category Lang
  10619. * @param {*} value The value to process.
  10620. * @returns {string} Returns the string.
  10621. * @example
  10622. *
  10623. * _.toString(null);
  10624. * // => ''
  10625. *
  10626. * _.toString(-0);
  10627. * // => '-0'
  10628. *
  10629. * _.toString([1, 2, 3]);
  10630. * // => '1,2,3'
  10631. */
  10632. function toString(value) {
  10633. return value == null ? '' : baseToString(value);
  10634. }
  10635. /**
  10636. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  10637. * it's created. Arrays are created for missing index properties while objects
  10638. * are created for all other missing properties. Use `_.setWith` to customize
  10639. * `path` creation.
  10640. *
  10641. * **Note:** This method mutates `object`.
  10642. *
  10643. * @static
  10644. * @memberOf _
  10645. * @since 3.7.0
  10646. * @category Object
  10647. * @param {Object} object The object to modify.
  10648. * @param {Array|string} path The path of the property to set.
  10649. * @param {*} value The value to set.
  10650. * @returns {Object} Returns `object`.
  10651. * @example
  10652. *
  10653. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  10654. *
  10655. * _.set(object, 'a[0].b.c', 4);
  10656. * console.log(object.a[0].b.c);
  10657. * // => 4
  10658. *
  10659. * _.set(object, ['x', '0', 'y', 'z'], 5);
  10660. * console.log(object.x[0].y.z);
  10661. * // => 5
  10662. */
  10663. function set(object, path, value) {
  10664. return object == null ? object : baseSet(object, path, value);
  10665. }
  10666. module.exports = set;
  10667. /***/ }),
  10668. /***/ 898:
  10669. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10670. "use strict";
  10671. Object.defineProperty(exports, '__esModule', { value: true });
  10672. var request = __webpack_require__(753);
  10673. var universalUserAgent = __webpack_require__(796);
  10674. const VERSION = "4.3.1";
  10675. class GraphqlError extends Error {
  10676. constructor(request, response) {
  10677. const message = response.data.errors[0].message;
  10678. super(message);
  10679. Object.assign(this, response.data);
  10680. this.name = "GraphqlError";
  10681. this.request = request; // Maintains proper stack trace (only available on V8)
  10682. /* istanbul ignore next */
  10683. if (Error.captureStackTrace) {
  10684. Error.captureStackTrace(this, this.constructor);
  10685. }
  10686. }
  10687. }
  10688. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  10689. function graphql(request, query, options) {
  10690. options = typeof query === "string" ? options = Object.assign({
  10691. query
  10692. }, options) : options = query;
  10693. const requestOptions = Object.keys(options).reduce((result, key) => {
  10694. if (NON_VARIABLE_OPTIONS.includes(key)) {
  10695. result[key] = options[key];
  10696. return result;
  10697. }
  10698. if (!result.variables) {
  10699. result.variables = {};
  10700. }
  10701. result.variables[key] = options[key];
  10702. return result;
  10703. }, {});
  10704. return request(requestOptions).then(response => {
  10705. if (response.data.errors) {
  10706. throw new GraphqlError(requestOptions, {
  10707. data: response.data
  10708. });
  10709. }
  10710. return response.data.data;
  10711. });
  10712. }
  10713. function withDefaults(request$1, newDefaults) {
  10714. const newRequest = request$1.defaults(newDefaults);
  10715. const newApi = (query, options) => {
  10716. return graphql(newRequest, query, options);
  10717. };
  10718. return Object.assign(newApi, {
  10719. defaults: withDefaults.bind(null, newRequest),
  10720. endpoint: request.request.endpoint
  10721. });
  10722. }
  10723. const graphql$1 = withDefaults(request.request, {
  10724. headers: {
  10725. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10726. },
  10727. method: "POST",
  10728. url: "/graphql"
  10729. });
  10730. function withCustomRequest(customRequest) {
  10731. return withDefaults(customRequest, {
  10732. method: "POST",
  10733. url: "/graphql"
  10734. });
  10735. }
  10736. exports.graphql = graphql$1;
  10737. exports.withCustomRequest = withCustomRequest;
  10738. //# sourceMappingURL=index.js.map
  10739. /***/ }),
  10740. /***/ 899:
  10741. /***/ (function(module, __unusedexports, __webpack_require__) {
  10742. module.exports = registerEndpoints;
  10743. const { Deprecation } = __webpack_require__(692);
  10744. function registerEndpoints(octokit, routes) {
  10745. Object.keys(routes).forEach(namespaceName => {
  10746. if (!octokit[namespaceName]) {
  10747. octokit[namespaceName] = {};
  10748. }
  10749. Object.keys(routes[namespaceName]).forEach(apiName => {
  10750. const apiOptions = routes[namespaceName][apiName];
  10751. const endpointDefaults = ["method", "url", "headers"].reduce(
  10752. (map, key) => {
  10753. if (typeof apiOptions[key] !== "undefined") {
  10754. map[key] = apiOptions[key];
  10755. }
  10756. return map;
  10757. },
  10758. {}
  10759. );
  10760. endpointDefaults.request = {
  10761. validate: apiOptions.params
  10762. };
  10763. let request = octokit.request.defaults(endpointDefaults);
  10764. // patch request & endpoint methods to support deprecated parameters.
  10765. // Not the most elegant solution, but we don’t want to move deprecation
  10766. // logic into octokit/endpoint.js as it’s out of scope
  10767. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  10768. key => apiOptions.params[key].deprecated
  10769. );
  10770. if (hasDeprecatedParam) {
  10771. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  10772. request = patch(
  10773. octokit.request.defaults(endpointDefaults),
  10774. `.${namespaceName}.${apiName}()`
  10775. );
  10776. request.endpoint = patch(
  10777. request.endpoint,
  10778. `.${namespaceName}.${apiName}.endpoint()`
  10779. );
  10780. request.endpoint.merge = patch(
  10781. request.endpoint.merge,
  10782. `.${namespaceName}.${apiName}.endpoint.merge()`
  10783. );
  10784. }
  10785. if (apiOptions.deprecated) {
  10786. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  10787. octokit.log.warn(
  10788. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  10789. );
  10790. octokit[namespaceName][apiName] = request;
  10791. return request.apply(null, arguments);
  10792. };
  10793. return;
  10794. }
  10795. octokit[namespaceName][apiName] = request;
  10796. });
  10797. });
  10798. }
  10799. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  10800. const patchedMethod = options => {
  10801. options = Object.assign({}, options);
  10802. Object.keys(options).forEach(key => {
  10803. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  10804. const aliasKey = apiOptions.params[key].alias;
  10805. octokit.log.warn(
  10806. new Deprecation(
  10807. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  10808. )
  10809. );
  10810. if (!(aliasKey in options)) {
  10811. options[aliasKey] = options[key];
  10812. }
  10813. delete options[key];
  10814. }
  10815. });
  10816. return method(options);
  10817. };
  10818. Object.keys(method).forEach(key => {
  10819. patchedMethod[key] = method[key];
  10820. });
  10821. return patchedMethod;
  10822. }
  10823. /***/ }),
  10824. /***/ 929:
  10825. /***/ (function(module, __unusedexports, __webpack_require__) {
  10826. module.exports = hasNextPage
  10827. const deprecate = __webpack_require__(370)
  10828. const getPageLinks = __webpack_require__(577)
  10829. function hasNextPage (link) {
  10830. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10831. return getPageLinks(link).next
  10832. }
  10833. /***/ }),
  10834. /***/ 948:
  10835. /***/ (function(module) {
  10836. "use strict";
  10837. /**
  10838. * Tries to execute a function and discards any error that occurs.
  10839. * @param {Function} fn - Function that might or might not throw an error.
  10840. * @returns {?*} Return-value of the function when no error occurred.
  10841. */
  10842. module.exports = function(fn) {
  10843. try { return fn() } catch (e) {}
  10844. }
  10845. /***/ }),
  10846. /***/ 954:
  10847. /***/ (function(module) {
  10848. module.exports = validateAuth;
  10849. function validateAuth(auth) {
  10850. if (typeof auth === "string") {
  10851. return;
  10852. }
  10853. if (typeof auth === "function") {
  10854. return;
  10855. }
  10856. if (auth.username && auth.password) {
  10857. return;
  10858. }
  10859. if (auth.clientId && auth.clientSecret) {
  10860. return;
  10861. }
  10862. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  10863. }
  10864. /***/ }),
  10865. /***/ 955:
  10866. /***/ (function(module, __unusedexports, __webpack_require__) {
  10867. "use strict";
  10868. const path = __webpack_require__(622);
  10869. const childProcess = __webpack_require__(129);
  10870. const crossSpawn = __webpack_require__(20);
  10871. const stripEof = __webpack_require__(768);
  10872. const npmRunPath = __webpack_require__(621);
  10873. const isStream = __webpack_require__(323);
  10874. const _getStream = __webpack_require__(145);
  10875. const pFinally = __webpack_require__(697);
  10876. const onExit = __webpack_require__(260);
  10877. const errname = __webpack_require__(427);
  10878. const stdio = __webpack_require__(168);
  10879. const TEN_MEGABYTES = 1000 * 1000 * 10;
  10880. function handleArgs(cmd, args, opts) {
  10881. let parsed;
  10882. opts = Object.assign({
  10883. extendEnv: true,
  10884. env: {}
  10885. }, opts);
  10886. if (opts.extendEnv) {
  10887. opts.env = Object.assign({}, process.env, opts.env);
  10888. }
  10889. if (opts.__winShell === true) {
  10890. delete opts.__winShell;
  10891. parsed = {
  10892. command: cmd,
  10893. args,
  10894. options: opts,
  10895. file: cmd,
  10896. original: {
  10897. cmd,
  10898. args
  10899. }
  10900. };
  10901. } else {
  10902. parsed = crossSpawn._parse(cmd, args, opts);
  10903. }
  10904. opts = Object.assign({
  10905. maxBuffer: TEN_MEGABYTES,
  10906. buffer: true,
  10907. stripEof: true,
  10908. preferLocal: true,
  10909. localDir: parsed.options.cwd || process.cwd(),
  10910. encoding: 'utf8',
  10911. reject: true,
  10912. cleanup: true
  10913. }, parsed.options);
  10914. opts.stdio = stdio(opts);
  10915. if (opts.preferLocal) {
  10916. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  10917. }
  10918. if (opts.detached) {
  10919. // #115
  10920. opts.cleanup = false;
  10921. }
  10922. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  10923. // #116
  10924. parsed.args.unshift('/q');
  10925. }
  10926. return {
  10927. cmd: parsed.command,
  10928. args: parsed.args,
  10929. opts,
  10930. parsed
  10931. };
  10932. }
  10933. function handleInput(spawned, input) {
  10934. if (input === null || input === undefined) {
  10935. return;
  10936. }
  10937. if (isStream(input)) {
  10938. input.pipe(spawned.stdin);
  10939. } else {
  10940. spawned.stdin.end(input);
  10941. }
  10942. }
  10943. function handleOutput(opts, val) {
  10944. if (val && opts.stripEof) {
  10945. val = stripEof(val);
  10946. }
  10947. return val;
  10948. }
  10949. function handleShell(fn, cmd, opts) {
  10950. let file = '/bin/sh';
  10951. let args = ['-c', cmd];
  10952. opts = Object.assign({}, opts);
  10953. if (process.platform === 'win32') {
  10954. opts.__winShell = true;
  10955. file = process.env.comspec || 'cmd.exe';
  10956. args = ['/s', '/c', `"${cmd}"`];
  10957. opts.windowsVerbatimArguments = true;
  10958. }
  10959. if (opts.shell) {
  10960. file = opts.shell;
  10961. delete opts.shell;
  10962. }
  10963. return fn(file, args, opts);
  10964. }
  10965. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  10966. if (!process[stream]) {
  10967. return null;
  10968. }
  10969. let ret;
  10970. if (!buffer) {
  10971. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  10972. ret = new Promise((resolve, reject) => {
  10973. process[stream]
  10974. .once('end', resolve)
  10975. .once('error', reject);
  10976. });
  10977. } else if (encoding) {
  10978. ret = _getStream(process[stream], {
  10979. encoding,
  10980. maxBuffer
  10981. });
  10982. } else {
  10983. ret = _getStream.buffer(process[stream], {maxBuffer});
  10984. }
  10985. return ret.catch(err => {
  10986. err.stream = stream;
  10987. err.message = `${stream} ${err.message}`;
  10988. throw err;
  10989. });
  10990. }
  10991. function makeError(result, options) {
  10992. const {stdout, stderr} = result;
  10993. let err = result.error;
  10994. const {code, signal} = result;
  10995. const {parsed, joinedCmd} = options;
  10996. const timedOut = options.timedOut || false;
  10997. if (!err) {
  10998. let output = '';
  10999. if (Array.isArray(parsed.opts.stdio)) {
  11000. if (parsed.opts.stdio[2] !== 'inherit') {
  11001. output += output.length > 0 ? stderr : `\n${stderr}`;
  11002. }
  11003. if (parsed.opts.stdio[1] !== 'inherit') {
  11004. output += `\n${stdout}`;
  11005. }
  11006. } else if (parsed.opts.stdio !== 'inherit') {
  11007. output = `\n${stderr}${stdout}`;
  11008. }
  11009. err = new Error(`Command failed: ${joinedCmd}${output}`);
  11010. err.code = code < 0 ? errname(code) : code;
  11011. }
  11012. err.stdout = stdout;
  11013. err.stderr = stderr;
  11014. err.failed = true;
  11015. err.signal = signal || null;
  11016. err.cmd = joinedCmd;
  11017. err.timedOut = timedOut;
  11018. return err;
  11019. }
  11020. function joinCmd(cmd, args) {
  11021. let joinedCmd = cmd;
  11022. if (Array.isArray(args) && args.length > 0) {
  11023. joinedCmd += ' ' + args.join(' ');
  11024. }
  11025. return joinedCmd;
  11026. }
  11027. module.exports = (cmd, args, opts) => {
  11028. const parsed = handleArgs(cmd, args, opts);
  11029. const {encoding, buffer, maxBuffer} = parsed.opts;
  11030. const joinedCmd = joinCmd(cmd, args);
  11031. let spawned;
  11032. try {
  11033. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  11034. } catch (err) {
  11035. return Promise.reject(err);
  11036. }
  11037. let removeExitHandler;
  11038. if (parsed.opts.cleanup) {
  11039. removeExitHandler = onExit(() => {
  11040. spawned.kill();
  11041. });
  11042. }
  11043. let timeoutId = null;
  11044. let timedOut = false;
  11045. const cleanup = () => {
  11046. if (timeoutId) {
  11047. clearTimeout(timeoutId);
  11048. timeoutId = null;
  11049. }
  11050. if (removeExitHandler) {
  11051. removeExitHandler();
  11052. }
  11053. };
  11054. if (parsed.opts.timeout > 0) {
  11055. timeoutId = setTimeout(() => {
  11056. timeoutId = null;
  11057. timedOut = true;
  11058. spawned.kill(parsed.opts.killSignal);
  11059. }, parsed.opts.timeout);
  11060. }
  11061. const processDone = new Promise(resolve => {
  11062. spawned.on('exit', (code, signal) => {
  11063. cleanup();
  11064. resolve({code, signal});
  11065. });
  11066. spawned.on('error', err => {
  11067. cleanup();
  11068. resolve({error: err});
  11069. });
  11070. if (spawned.stdin) {
  11071. spawned.stdin.on('error', err => {
  11072. cleanup();
  11073. resolve({error: err});
  11074. });
  11075. }
  11076. });
  11077. function destroy() {
  11078. if (spawned.stdout) {
  11079. spawned.stdout.destroy();
  11080. }
  11081. if (spawned.stderr) {
  11082. spawned.stderr.destroy();
  11083. }
  11084. }
  11085. const handlePromise = () => pFinally(Promise.all([
  11086. processDone,
  11087. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  11088. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  11089. ]).then(arr => {
  11090. const result = arr[0];
  11091. result.stdout = arr[1];
  11092. result.stderr = arr[2];
  11093. if (result.error || result.code !== 0 || result.signal !== null) {
  11094. const err = makeError(result, {
  11095. joinedCmd,
  11096. parsed,
  11097. timedOut
  11098. });
  11099. // TODO: missing some timeout logic for killed
  11100. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  11101. // err.killed = spawned.killed || killed;
  11102. err.killed = err.killed || spawned.killed;
  11103. if (!parsed.opts.reject) {
  11104. return err;
  11105. }
  11106. throw err;
  11107. }
  11108. return {
  11109. stdout: handleOutput(parsed.opts, result.stdout),
  11110. stderr: handleOutput(parsed.opts, result.stderr),
  11111. code: 0,
  11112. failed: false,
  11113. killed: false,
  11114. signal: null,
  11115. cmd: joinedCmd,
  11116. timedOut: false
  11117. };
  11118. }), destroy);
  11119. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  11120. handleInput(spawned, parsed.opts.input);
  11121. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  11122. spawned.catch = onrejected => handlePromise().catch(onrejected);
  11123. return spawned;
  11124. };
  11125. // TODO: set `stderr: 'ignore'` when that option is implemented
  11126. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  11127. // TODO: set `stdout: 'ignore'` when that option is implemented
  11128. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  11129. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  11130. module.exports.sync = (cmd, args, opts) => {
  11131. const parsed = handleArgs(cmd, args, opts);
  11132. const joinedCmd = joinCmd(cmd, args);
  11133. if (isStream(parsed.opts.input)) {
  11134. throw new TypeError('The `input` option cannot be a stream in sync mode');
  11135. }
  11136. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  11137. result.code = result.status;
  11138. if (result.error || result.status !== 0 || result.signal !== null) {
  11139. const err = makeError(result, {
  11140. joinedCmd,
  11141. parsed
  11142. });
  11143. if (!parsed.opts.reject) {
  11144. return err;
  11145. }
  11146. throw err;
  11147. }
  11148. return {
  11149. stdout: handleOutput(parsed.opts, result.stdout),
  11150. stderr: handleOutput(parsed.opts, result.stderr),
  11151. code: 0,
  11152. failed: false,
  11153. signal: null,
  11154. cmd: joinedCmd,
  11155. timedOut: false
  11156. };
  11157. };
  11158. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  11159. /***/ }),
  11160. /***/ 966:
  11161. /***/ (function(module, __unusedexports, __webpack_require__) {
  11162. "use strict";
  11163. const {PassThrough} = __webpack_require__(413);
  11164. module.exports = options => {
  11165. options = Object.assign({}, options);
  11166. const {array} = options;
  11167. let {encoding} = options;
  11168. const buffer = encoding === 'buffer';
  11169. let objectMode = false;
  11170. if (array) {
  11171. objectMode = !(encoding || buffer);
  11172. } else {
  11173. encoding = encoding || 'utf8';
  11174. }
  11175. if (buffer) {
  11176. encoding = null;
  11177. }
  11178. let len = 0;
  11179. const ret = [];
  11180. const stream = new PassThrough({objectMode});
  11181. if (encoding) {
  11182. stream.setEncoding(encoding);
  11183. }
  11184. stream.on('data', chunk => {
  11185. ret.push(chunk);
  11186. if (objectMode) {
  11187. len = ret.length;
  11188. } else {
  11189. len += chunk.length;
  11190. }
  11191. });
  11192. stream.getBufferedValue = () => {
  11193. if (array) {
  11194. return ret;
  11195. }
  11196. return buffer ? Buffer.concat(ret, len) : ret.join('');
  11197. };
  11198. stream.getBufferedLength = () => len;
  11199. return stream;
  11200. };
  11201. /***/ }),
  11202. /***/ 969:
  11203. /***/ (function(module, __unusedexports, __webpack_require__) {
  11204. var wrappy = __webpack_require__(11)
  11205. module.exports = wrappy(once)
  11206. module.exports.strict = wrappy(onceStrict)
  11207. once.proto = once(function () {
  11208. Object.defineProperty(Function.prototype, 'once', {
  11209. value: function () {
  11210. return once(this)
  11211. },
  11212. configurable: true
  11213. })
  11214. Object.defineProperty(Function.prototype, 'onceStrict', {
  11215. value: function () {
  11216. return onceStrict(this)
  11217. },
  11218. configurable: true
  11219. })
  11220. })
  11221. function once (fn) {
  11222. var f = function () {
  11223. if (f.called) return f.value
  11224. f.called = true
  11225. return f.value = fn.apply(this, arguments)
  11226. }
  11227. f.called = false
  11228. return f
  11229. }
  11230. function onceStrict (fn) {
  11231. var f = function () {
  11232. if (f.called)
  11233. throw new Error(f.onceError)
  11234. f.called = true
  11235. return f.value = fn.apply(this, arguments)
  11236. }
  11237. var name = fn.name || 'Function wrapped with `once`'
  11238. f.onceError = name + " shouldn't be called more than once"
  11239. f.called = false
  11240. return f
  11241. }
  11242. /***/ }),
  11243. /***/ 986:
  11244. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11245. "use strict";
  11246. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11247. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11248. return new (P || (P = Promise))(function (resolve, reject) {
  11249. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11250. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11251. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11252. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11253. });
  11254. };
  11255. Object.defineProperty(exports, "__esModule", { value: true });
  11256. const tr = __webpack_require__(9);
  11257. /**
  11258. * Exec a command.
  11259. * Output will be streamed to the live console.
  11260. * Returns promise with return code
  11261. *
  11262. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  11263. * @param args optional arguments for tool. Escaping is handled by the lib.
  11264. * @param options optional exec options. See ExecOptions
  11265. * @returns Promise<number> exit code
  11266. */
  11267. function exec(commandLine, args, options) {
  11268. return __awaiter(this, void 0, void 0, function* () {
  11269. const commandArgs = tr.argStringToArray(commandLine);
  11270. if (commandArgs.length === 0) {
  11271. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  11272. }
  11273. // Path to tool to execute should be first arg
  11274. const toolPath = commandArgs[0];
  11275. args = commandArgs.slice(1).concat(args || []);
  11276. const runner = new tr.ToolRunner(toolPath, args, options);
  11277. return runner.exec();
  11278. });
  11279. }
  11280. exports.exec = exec;
  11281. //# sourceMappingURL=exec.js.map
  11282. /***/ }),
  11283. /***/ 991:
  11284. /***/ (function(module, __unusedexports, __webpack_require__) {
  11285. module.exports = authenticationRequestError;
  11286. const { RequestError } = __webpack_require__(463);
  11287. function authenticationRequestError(state, error, options) {
  11288. if (!error.headers) throw error;
  11289. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  11290. // handle "2FA required" error only
  11291. if (error.status !== 401 || !otpRequired) {
  11292. throw error;
  11293. }
  11294. if (
  11295. error.status === 401 &&
  11296. otpRequired &&
  11297. error.request &&
  11298. error.request.headers["x-github-otp"]
  11299. ) {
  11300. if (state.otp) {
  11301. delete state.otp; // no longer valid, request again
  11302. } else {
  11303. throw new RequestError(
  11304. "Invalid one-time password for two-factor authentication",
  11305. 401,
  11306. {
  11307. headers: error.headers,
  11308. request: options
  11309. }
  11310. );
  11311. }
  11312. }
  11313. if (typeof state.auth.on2fa !== "function") {
  11314. throw new RequestError(
  11315. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  11316. 401,
  11317. {
  11318. headers: error.headers,
  11319. request: options
  11320. }
  11321. );
  11322. }
  11323. return Promise.resolve()
  11324. .then(() => {
  11325. return state.auth.on2fa();
  11326. })
  11327. .then(oneTimePassword => {
  11328. const newOptions = Object.assign(options, {
  11329. headers: Object.assign(options.headers, {
  11330. "x-github-otp": oneTimePassword
  11331. })
  11332. });
  11333. return state.octokit.request(newOptions).then(response => {
  11334. // If OTP still valid, then persist it for following requests
  11335. state.otp = oneTimePassword;
  11336. return response;
  11337. });
  11338. });
  11339. }
  11340. /***/ })
  11341. /******/ });