index.js 500 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338
  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. module.exports = withDefaults
  48. const graphql = __webpack_require__(500)
  49. function withDefaults (request, newDefaults) {
  50. const newRequest = request.defaults(newDefaults)
  51. const newApi = function (query, options) {
  52. return graphql(newRequest, query, options)
  53. }
  54. newApi.defaults = withDefaults.bind(null, newRequest)
  55. return newApi
  56. }
  57. /***/ }),
  58. /***/ 1:
  59. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  60. "use strict";
  61. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  62. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  63. return new (P || (P = Promise))(function (resolve, reject) {
  64. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  65. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  66. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  67. step((generator = generator.apply(thisArg, _arguments || [])).next());
  68. });
  69. };
  70. Object.defineProperty(exports, "__esModule", { value: true });
  71. const childProcess = __webpack_require__(129);
  72. const path = __webpack_require__(622);
  73. const util_1 = __webpack_require__(669);
  74. const ioUtil = __webpack_require__(672);
  75. const exec = util_1.promisify(childProcess.exec);
  76. /**
  77. * Copies a file or folder.
  78. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  79. *
  80. * @param source source path
  81. * @param dest destination path
  82. * @param options optional. See CopyOptions.
  83. */
  84. function cp(source, dest, options = {}) {
  85. return __awaiter(this, void 0, void 0, function* () {
  86. const { force, recursive } = readCopyOptions(options);
  87. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  88. // Dest is an existing file, but not forcing
  89. if (destStat && destStat.isFile() && !force) {
  90. return;
  91. }
  92. // If dest is an existing directory, should copy inside.
  93. const newDest = destStat && destStat.isDirectory()
  94. ? path.join(dest, path.basename(source))
  95. : dest;
  96. if (!(yield ioUtil.exists(source))) {
  97. throw new Error(`no such file or directory: ${source}`);
  98. }
  99. const sourceStat = yield ioUtil.stat(source);
  100. if (sourceStat.isDirectory()) {
  101. if (!recursive) {
  102. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  103. }
  104. else {
  105. yield cpDirRecursive(source, newDest, 0, force);
  106. }
  107. }
  108. else {
  109. if (path.relative(source, newDest) === '') {
  110. // a file cannot be copied to itself
  111. throw new Error(`'${newDest}' and '${source}' are the same file`);
  112. }
  113. yield copyFile(source, newDest, force);
  114. }
  115. });
  116. }
  117. exports.cp = cp;
  118. /**
  119. * Moves a path.
  120. *
  121. * @param source source path
  122. * @param dest destination path
  123. * @param options optional. See MoveOptions.
  124. */
  125. function mv(source, dest, options = {}) {
  126. return __awaiter(this, void 0, void 0, function* () {
  127. if (yield ioUtil.exists(dest)) {
  128. let destExists = true;
  129. if (yield ioUtil.isDirectory(dest)) {
  130. // If dest is directory copy src into dest
  131. dest = path.join(dest, path.basename(source));
  132. destExists = yield ioUtil.exists(dest);
  133. }
  134. if (destExists) {
  135. if (options.force == null || options.force) {
  136. yield rmRF(dest);
  137. }
  138. else {
  139. throw new Error('Destination already exists');
  140. }
  141. }
  142. }
  143. yield mkdirP(path.dirname(dest));
  144. yield ioUtil.rename(source, dest);
  145. });
  146. }
  147. exports.mv = mv;
  148. /**
  149. * Remove a path recursively with force
  150. *
  151. * @param inputPath path to remove
  152. */
  153. function rmRF(inputPath) {
  154. return __awaiter(this, void 0, void 0, function* () {
  155. if (ioUtil.IS_WINDOWS) {
  156. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  157. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  158. try {
  159. if (yield ioUtil.isDirectory(inputPath, true)) {
  160. yield exec(`rd /s /q "${inputPath}"`);
  161. }
  162. else {
  163. yield exec(`del /f /a "${inputPath}"`);
  164. }
  165. }
  166. catch (err) {
  167. // if you try to delete a file that doesn't exist, desired result is achieved
  168. // other errors are valid
  169. if (err.code !== 'ENOENT')
  170. throw err;
  171. }
  172. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  173. try {
  174. yield ioUtil.unlink(inputPath);
  175. }
  176. catch (err) {
  177. // if you try to delete a file that doesn't exist, desired result is achieved
  178. // other errors are valid
  179. if (err.code !== 'ENOENT')
  180. throw err;
  181. }
  182. }
  183. else {
  184. let isDir = false;
  185. try {
  186. isDir = yield ioUtil.isDirectory(inputPath);
  187. }
  188. catch (err) {
  189. // if you try to delete a file that doesn't exist, desired result is achieved
  190. // other errors are valid
  191. if (err.code !== 'ENOENT')
  192. throw err;
  193. return;
  194. }
  195. if (isDir) {
  196. yield exec(`rm -rf "${inputPath}"`);
  197. }
  198. else {
  199. yield ioUtil.unlink(inputPath);
  200. }
  201. }
  202. });
  203. }
  204. exports.rmRF = rmRF;
  205. /**
  206. * Make a directory. Creates the full path with folders in between
  207. * Will throw if it fails
  208. *
  209. * @param fsPath path to create
  210. * @returns Promise<void>
  211. */
  212. function mkdirP(fsPath) {
  213. return __awaiter(this, void 0, void 0, function* () {
  214. yield ioUtil.mkdirP(fsPath);
  215. });
  216. }
  217. exports.mkdirP = mkdirP;
  218. /**
  219. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  220. * If you check and the tool does not exist, it will throw.
  221. *
  222. * @param tool name of the tool
  223. * @param check whether to check if tool exists
  224. * @returns Promise<string> path to tool
  225. */
  226. function which(tool, check) {
  227. return __awaiter(this, void 0, void 0, function* () {
  228. if (!tool) {
  229. throw new Error("parameter 'tool' is required");
  230. }
  231. // recursive when check=true
  232. if (check) {
  233. const result = yield which(tool, false);
  234. if (!result) {
  235. if (ioUtil.IS_WINDOWS) {
  236. 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.`);
  237. }
  238. else {
  239. 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.`);
  240. }
  241. }
  242. }
  243. try {
  244. // build the list of extensions to try
  245. const extensions = [];
  246. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  247. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  248. if (extension) {
  249. extensions.push(extension);
  250. }
  251. }
  252. }
  253. // if it's rooted, return it if exists. otherwise return empty.
  254. if (ioUtil.isRooted(tool)) {
  255. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  256. if (filePath) {
  257. return filePath;
  258. }
  259. return '';
  260. }
  261. // if any path separators, return empty
  262. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  263. return '';
  264. }
  265. // build the list of directories
  266. //
  267. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  268. // it feels like we should not do this. Checking the current directory seems like more of a use
  269. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  270. // across platforms.
  271. const directories = [];
  272. if (process.env.PATH) {
  273. for (const p of process.env.PATH.split(path.delimiter)) {
  274. if (p) {
  275. directories.push(p);
  276. }
  277. }
  278. }
  279. // return the first match
  280. for (const directory of directories) {
  281. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  282. if (filePath) {
  283. return filePath;
  284. }
  285. }
  286. return '';
  287. }
  288. catch (err) {
  289. throw new Error(`which failed with message ${err.message}`);
  290. }
  291. });
  292. }
  293. exports.which = which;
  294. function readCopyOptions(options) {
  295. const force = options.force == null ? true : options.force;
  296. const recursive = Boolean(options.recursive);
  297. return { force, recursive };
  298. }
  299. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  300. return __awaiter(this, void 0, void 0, function* () {
  301. // Ensure there is not a run away recursive copy
  302. if (currentDepth >= 255)
  303. return;
  304. currentDepth++;
  305. yield mkdirP(destDir);
  306. const files = yield ioUtil.readdir(sourceDir);
  307. for (const fileName of files) {
  308. const srcFile = `${sourceDir}/${fileName}`;
  309. const destFile = `${destDir}/${fileName}`;
  310. const srcFileStat = yield ioUtil.lstat(srcFile);
  311. if (srcFileStat.isDirectory()) {
  312. // Recurse
  313. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  314. }
  315. else {
  316. yield copyFile(srcFile, destFile, force);
  317. }
  318. }
  319. // Change the mode for the newly created directory
  320. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  321. });
  322. }
  323. // Buffered file copy
  324. function copyFile(srcFile, destFile, force) {
  325. return __awaiter(this, void 0, void 0, function* () {
  326. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  327. // unlink/re-link it
  328. try {
  329. yield ioUtil.lstat(destFile);
  330. yield ioUtil.unlink(destFile);
  331. }
  332. catch (e) {
  333. // Try to override file permission
  334. if (e.code === 'EPERM') {
  335. yield ioUtil.chmod(destFile, '0666');
  336. yield ioUtil.unlink(destFile);
  337. }
  338. // other errors = it doesn't exist, no work to do
  339. }
  340. // Copy over symlink
  341. const symlinkFull = yield ioUtil.readlink(srcFile);
  342. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  343. }
  344. else if (!(yield ioUtil.exists(destFile)) || force) {
  345. yield ioUtil.copyFile(srcFile, destFile);
  346. }
  347. });
  348. }
  349. //# sourceMappingURL=io.js.map
  350. /***/ }),
  351. /***/ 2:
  352. /***/ (function(module, __unusedexports, __webpack_require__) {
  353. "use strict";
  354. const os = __webpack_require__(87);
  355. const macosRelease = __webpack_require__(118);
  356. const winRelease = __webpack_require__(49);
  357. const osName = (platform, release) => {
  358. if (!platform && release) {
  359. throw new Error('You can\'t specify a `release` without specifying `platform`');
  360. }
  361. platform = platform || os.platform();
  362. let id;
  363. if (platform === 'darwin') {
  364. if (!release && os.platform() === 'darwin') {
  365. release = os.release();
  366. }
  367. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  368. id = release ? macosRelease(release).name : '';
  369. return prefix + (id ? ' ' + id : '');
  370. }
  371. if (platform === 'linux') {
  372. if (!release && os.platform() === 'linux') {
  373. release = os.release();
  374. }
  375. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  376. return 'Linux' + (id ? ' ' + id : '');
  377. }
  378. if (platform === 'win32') {
  379. if (!release && os.platform() === 'win32') {
  380. release = os.release();
  381. }
  382. id = release ? winRelease(release) : '';
  383. return 'Windows' + (id ? ' ' + id : '');
  384. }
  385. return platform;
  386. };
  387. module.exports = osName;
  388. /***/ }),
  389. /***/ 3:
  390. /***/ (function(module, __unusedexports, __webpack_require__) {
  391. var once = __webpack_require__(969);
  392. var noop = function() {};
  393. var isRequest = function(stream) {
  394. return stream.setHeader && typeof stream.abort === 'function';
  395. };
  396. var isChildProcess = function(stream) {
  397. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  398. };
  399. var eos = function(stream, opts, callback) {
  400. if (typeof opts === 'function') return eos(stream, null, opts);
  401. if (!opts) opts = {};
  402. callback = once(callback || noop);
  403. var ws = stream._writableState;
  404. var rs = stream._readableState;
  405. var readable = opts.readable || (opts.readable !== false && stream.readable);
  406. var writable = opts.writable || (opts.writable !== false && stream.writable);
  407. var cancelled = false;
  408. var onlegacyfinish = function() {
  409. if (!stream.writable) onfinish();
  410. };
  411. var onfinish = function() {
  412. writable = false;
  413. if (!readable) callback.call(stream);
  414. };
  415. var onend = function() {
  416. readable = false;
  417. if (!writable) callback.call(stream);
  418. };
  419. var onexit = function(exitCode) {
  420. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  421. };
  422. var onerror = function(err) {
  423. callback.call(stream, err);
  424. };
  425. var onclose = function() {
  426. process.nextTick(onclosenexttick);
  427. };
  428. var onclosenexttick = function() {
  429. if (cancelled) return;
  430. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  431. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  432. };
  433. var onrequest = function() {
  434. stream.req.on('finish', onfinish);
  435. };
  436. if (isRequest(stream)) {
  437. stream.on('complete', onfinish);
  438. stream.on('abort', onclose);
  439. if (stream.req) onrequest();
  440. else stream.on('request', onrequest);
  441. } else if (writable && !ws) { // legacy streams
  442. stream.on('end', onlegacyfinish);
  443. stream.on('close', onlegacyfinish);
  444. }
  445. if (isChildProcess(stream)) stream.on('exit', onexit);
  446. stream.on('end', onend);
  447. stream.on('finish', onfinish);
  448. if (opts.error !== false) stream.on('error', onerror);
  449. stream.on('close', onclose);
  450. return function() {
  451. cancelled = true;
  452. stream.removeListener('complete', onfinish);
  453. stream.removeListener('abort', onclose);
  454. stream.removeListener('request', onrequest);
  455. if (stream.req) stream.req.removeListener('finish', onfinish);
  456. stream.removeListener('end', onlegacyfinish);
  457. stream.removeListener('close', onlegacyfinish);
  458. stream.removeListener('finish', onfinish);
  459. stream.removeListener('exit', onexit);
  460. stream.removeListener('end', onend);
  461. stream.removeListener('error', onerror);
  462. stream.removeListener('close', onclose);
  463. };
  464. };
  465. module.exports = eos;
  466. /***/ }),
  467. /***/ 8:
  468. /***/ (function(module, __unusedexports, __webpack_require__) {
  469. module.exports = iterator;
  470. const normalizePaginatedListResponse = __webpack_require__(301);
  471. function iterator(octokit, options) {
  472. const headers = options.headers;
  473. let url = octokit.request.endpoint(options).url;
  474. return {
  475. [Symbol.asyncIterator]: () => ({
  476. next() {
  477. if (!url) {
  478. return Promise.resolve({ done: true });
  479. }
  480. return octokit
  481. .request({ url, headers })
  482. .then(response => {
  483. normalizePaginatedListResponse(octokit, url, response);
  484. // `response.headers.link` format:
  485. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  486. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  487. url = ((response.headers.link || "").match(
  488. /<([^>]+)>;\s*rel="next"/
  489. ) || [])[1];
  490. return { value: response };
  491. });
  492. }
  493. })
  494. };
  495. }
  496. /***/ }),
  497. /***/ 9:
  498. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  499. "use strict";
  500. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  501. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  502. return new (P || (P = Promise))(function (resolve, reject) {
  503. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  504. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  505. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  506. step((generator = generator.apply(thisArg, _arguments || [])).next());
  507. });
  508. };
  509. Object.defineProperty(exports, "__esModule", { value: true });
  510. const os = __webpack_require__(87);
  511. const events = __webpack_require__(614);
  512. const child = __webpack_require__(129);
  513. /* eslint-disable @typescript-eslint/unbound-method */
  514. const IS_WINDOWS = process.platform === 'win32';
  515. /*
  516. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  517. */
  518. class ToolRunner extends events.EventEmitter {
  519. constructor(toolPath, args, options) {
  520. super();
  521. if (!toolPath) {
  522. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  523. }
  524. this.toolPath = toolPath;
  525. this.args = args || [];
  526. this.options = options || {};
  527. }
  528. _debug(message) {
  529. if (this.options.listeners && this.options.listeners.debug) {
  530. this.options.listeners.debug(message);
  531. }
  532. }
  533. _getCommandString(options, noPrefix) {
  534. const toolPath = this._getSpawnFileName();
  535. const args = this._getSpawnArgs(options);
  536. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  537. if (IS_WINDOWS) {
  538. // Windows + cmd file
  539. if (this._isCmdFile()) {
  540. cmd += toolPath;
  541. for (const a of args) {
  542. cmd += ` ${a}`;
  543. }
  544. }
  545. // Windows + verbatim
  546. else if (options.windowsVerbatimArguments) {
  547. cmd += `"${toolPath}"`;
  548. for (const a of args) {
  549. cmd += ` ${a}`;
  550. }
  551. }
  552. // Windows (regular)
  553. else {
  554. cmd += this._windowsQuoteCmdArg(toolPath);
  555. for (const a of args) {
  556. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  557. }
  558. }
  559. }
  560. else {
  561. // OSX/Linux - this can likely be improved with some form of quoting.
  562. // creating processes on Unix is fundamentally different than Windows.
  563. // on Unix, execvp() takes an arg array.
  564. cmd += toolPath;
  565. for (const a of args) {
  566. cmd += ` ${a}`;
  567. }
  568. }
  569. return cmd;
  570. }
  571. _processLineBuffer(data, strBuffer, onLine) {
  572. try {
  573. let s = strBuffer + data.toString();
  574. let n = s.indexOf(os.EOL);
  575. while (n > -1) {
  576. const line = s.substring(0, n);
  577. onLine(line);
  578. // the rest of the string ...
  579. s = s.substring(n + os.EOL.length);
  580. n = s.indexOf(os.EOL);
  581. }
  582. strBuffer = s;
  583. }
  584. catch (err) {
  585. // streaming lines to console is best effort. Don't fail a build.
  586. this._debug(`error processing line. Failed with error ${err}`);
  587. }
  588. }
  589. _getSpawnFileName() {
  590. if (IS_WINDOWS) {
  591. if (this._isCmdFile()) {
  592. return process.env['COMSPEC'] || 'cmd.exe';
  593. }
  594. }
  595. return this.toolPath;
  596. }
  597. _getSpawnArgs(options) {
  598. if (IS_WINDOWS) {
  599. if (this._isCmdFile()) {
  600. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  601. for (const a of this.args) {
  602. argline += ' ';
  603. argline += options.windowsVerbatimArguments
  604. ? a
  605. : this._windowsQuoteCmdArg(a);
  606. }
  607. argline += '"';
  608. return [argline];
  609. }
  610. }
  611. return this.args;
  612. }
  613. _endsWith(str, end) {
  614. return str.endsWith(end);
  615. }
  616. _isCmdFile() {
  617. const upperToolPath = this.toolPath.toUpperCase();
  618. return (this._endsWith(upperToolPath, '.CMD') ||
  619. this._endsWith(upperToolPath, '.BAT'));
  620. }
  621. _windowsQuoteCmdArg(arg) {
  622. // for .exe, apply the normal quoting rules that libuv applies
  623. if (!this._isCmdFile()) {
  624. return this._uvQuoteCmdArg(arg);
  625. }
  626. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  627. // the libuv rules are generic and are not designed specifically for cmd.exe
  628. // command line parser.
  629. //
  630. // for a detailed description of the cmd.exe command line parser, refer to
  631. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  632. // need quotes for empty arg
  633. if (!arg) {
  634. return '""';
  635. }
  636. // determine whether the arg needs to be quoted
  637. const cmdSpecialChars = [
  638. ' ',
  639. '\t',
  640. '&',
  641. '(',
  642. ')',
  643. '[',
  644. ']',
  645. '{',
  646. '}',
  647. '^',
  648. '=',
  649. ';',
  650. '!',
  651. "'",
  652. '+',
  653. ',',
  654. '`',
  655. '~',
  656. '|',
  657. '<',
  658. '>',
  659. '"'
  660. ];
  661. let needsQuotes = false;
  662. for (const char of arg) {
  663. if (cmdSpecialChars.some(x => x === char)) {
  664. needsQuotes = true;
  665. break;
  666. }
  667. }
  668. // short-circuit if quotes not needed
  669. if (!needsQuotes) {
  670. return arg;
  671. }
  672. // the following quoting rules are very similar to the rules that by libuv applies.
  673. //
  674. // 1) wrap the string in quotes
  675. //
  676. // 2) double-up quotes - i.e. " => ""
  677. //
  678. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  679. // doesn't work well with a cmd.exe command line.
  680. //
  681. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  682. // for example, the command line:
  683. // foo.exe "myarg:""my val"""
  684. // is parsed by a .NET console app into an arg array:
  685. // [ "myarg:\"my val\"" ]
  686. // which is the same end result when applying libuv quoting rules. although the actual
  687. // command line from libuv quoting rules would look like:
  688. // foo.exe "myarg:\"my val\""
  689. //
  690. // 3) double-up slashes that precede a quote,
  691. // e.g. hello \world => "hello \world"
  692. // hello\"world => "hello\\""world"
  693. // hello\\"world => "hello\\\\""world"
  694. // hello world\ => "hello world\\"
  695. //
  696. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  697. // the reasons for including this as a .cmd quoting rule are:
  698. //
  699. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  700. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  701. //
  702. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  703. // haven't heard any complaints about that aspect.
  704. //
  705. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  706. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  707. // by using %%.
  708. //
  709. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  710. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  711. //
  712. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  713. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  714. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  715. // to an external program.
  716. //
  717. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  718. // % can be escaped within a .cmd file.
  719. let reverse = '"';
  720. let quoteHit = true;
  721. for (let i = arg.length; i > 0; i--) {
  722. // walk the string in reverse
  723. reverse += arg[i - 1];
  724. if (quoteHit && arg[i - 1] === '\\') {
  725. reverse += '\\'; // double the slash
  726. }
  727. else if (arg[i - 1] === '"') {
  728. quoteHit = true;
  729. reverse += '"'; // double the quote
  730. }
  731. else {
  732. quoteHit = false;
  733. }
  734. }
  735. reverse += '"';
  736. return reverse
  737. .split('')
  738. .reverse()
  739. .join('');
  740. }
  741. _uvQuoteCmdArg(arg) {
  742. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  743. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  744. // is used.
  745. //
  746. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  747. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  748. // pasting copyright notice from Node within this function:
  749. //
  750. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  751. //
  752. // Permission is hereby granted, free of charge, to any person obtaining a copy
  753. // of this software and associated documentation files (the "Software"), to
  754. // deal in the Software without restriction, including without limitation the
  755. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  756. // sell copies of the Software, and to permit persons to whom the Software is
  757. // furnished to do so, subject to the following conditions:
  758. //
  759. // The above copyright notice and this permission notice shall be included in
  760. // all copies or substantial portions of the Software.
  761. //
  762. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  763. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  764. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  765. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  766. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  767. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  768. // IN THE SOFTWARE.
  769. if (!arg) {
  770. // Need double quotation for empty argument
  771. return '""';
  772. }
  773. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  774. // No quotation needed
  775. return arg;
  776. }
  777. if (!arg.includes('"') && !arg.includes('\\')) {
  778. // No embedded double quotes or backslashes, so I can just wrap
  779. // quote marks around the whole thing.
  780. return `"${arg}"`;
  781. }
  782. // Expected input/output:
  783. // input : hello"world
  784. // output: "hello\"world"
  785. // input : hello""world
  786. // output: "hello\"\"world"
  787. // input : hello\world
  788. // output: hello\world
  789. // input : hello\\world
  790. // output: hello\\world
  791. // input : hello\"world
  792. // output: "hello\\\"world"
  793. // input : hello\\"world
  794. // output: "hello\\\\\"world"
  795. // input : hello world\
  796. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  797. // but it appears the comment is wrong, it should be "hello world\\"
  798. let reverse = '"';
  799. let quoteHit = true;
  800. for (let i = arg.length; i > 0; i--) {
  801. // walk the string in reverse
  802. reverse += arg[i - 1];
  803. if (quoteHit && arg[i - 1] === '\\') {
  804. reverse += '\\';
  805. }
  806. else if (arg[i - 1] === '"') {
  807. quoteHit = true;
  808. reverse += '\\';
  809. }
  810. else {
  811. quoteHit = false;
  812. }
  813. }
  814. reverse += '"';
  815. return reverse
  816. .split('')
  817. .reverse()
  818. .join('');
  819. }
  820. _cloneExecOptions(options) {
  821. options = options || {};
  822. const result = {
  823. cwd: options.cwd || process.cwd(),
  824. env: options.env || process.env,
  825. silent: options.silent || false,
  826. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  827. failOnStdErr: options.failOnStdErr || false,
  828. ignoreReturnCode: options.ignoreReturnCode || false,
  829. delay: options.delay || 10000
  830. };
  831. result.outStream = options.outStream || process.stdout;
  832. result.errStream = options.errStream || process.stderr;
  833. return result;
  834. }
  835. _getSpawnOptions(options, toolPath) {
  836. options = options || {};
  837. const result = {};
  838. result.cwd = options.cwd;
  839. result.env = options.env;
  840. result['windowsVerbatimArguments'] =
  841. options.windowsVerbatimArguments || this._isCmdFile();
  842. if (options.windowsVerbatimArguments) {
  843. result.argv0 = `"${toolPath}"`;
  844. }
  845. return result;
  846. }
  847. /**
  848. * Exec a tool.
  849. * Output will be streamed to the live console.
  850. * Returns promise with return code
  851. *
  852. * @param tool path to tool to exec
  853. * @param options optional exec options. See ExecOptions
  854. * @returns number
  855. */
  856. exec() {
  857. return __awaiter(this, void 0, void 0, function* () {
  858. return new Promise((resolve, reject) => {
  859. this._debug(`exec tool: ${this.toolPath}`);
  860. this._debug('arguments:');
  861. for (const arg of this.args) {
  862. this._debug(` ${arg}`);
  863. }
  864. const optionsNonNull = this._cloneExecOptions(this.options);
  865. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  866. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  867. }
  868. const state = new ExecState(optionsNonNull, this.toolPath);
  869. state.on('debug', (message) => {
  870. this._debug(message);
  871. });
  872. const fileName = this._getSpawnFileName();
  873. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  874. const stdbuffer = '';
  875. if (cp.stdout) {
  876. cp.stdout.on('data', (data) => {
  877. if (this.options.listeners && this.options.listeners.stdout) {
  878. this.options.listeners.stdout(data);
  879. }
  880. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  881. optionsNonNull.outStream.write(data);
  882. }
  883. this._processLineBuffer(data, stdbuffer, (line) => {
  884. if (this.options.listeners && this.options.listeners.stdline) {
  885. this.options.listeners.stdline(line);
  886. }
  887. });
  888. });
  889. }
  890. const errbuffer = '';
  891. if (cp.stderr) {
  892. cp.stderr.on('data', (data) => {
  893. state.processStderr = true;
  894. if (this.options.listeners && this.options.listeners.stderr) {
  895. this.options.listeners.stderr(data);
  896. }
  897. if (!optionsNonNull.silent &&
  898. optionsNonNull.errStream &&
  899. optionsNonNull.outStream) {
  900. const s = optionsNonNull.failOnStdErr
  901. ? optionsNonNull.errStream
  902. : optionsNonNull.outStream;
  903. s.write(data);
  904. }
  905. this._processLineBuffer(data, errbuffer, (line) => {
  906. if (this.options.listeners && this.options.listeners.errline) {
  907. this.options.listeners.errline(line);
  908. }
  909. });
  910. });
  911. }
  912. cp.on('error', (err) => {
  913. state.processError = err.message;
  914. state.processExited = true;
  915. state.processClosed = true;
  916. state.CheckComplete();
  917. });
  918. cp.on('exit', (code) => {
  919. state.processExitCode = code;
  920. state.processExited = true;
  921. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  922. state.CheckComplete();
  923. });
  924. cp.on('close', (code) => {
  925. state.processExitCode = code;
  926. state.processExited = true;
  927. state.processClosed = true;
  928. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  929. state.CheckComplete();
  930. });
  931. state.on('done', (error, exitCode) => {
  932. if (stdbuffer.length > 0) {
  933. this.emit('stdline', stdbuffer);
  934. }
  935. if (errbuffer.length > 0) {
  936. this.emit('errline', errbuffer);
  937. }
  938. cp.removeAllListeners();
  939. if (error) {
  940. reject(error);
  941. }
  942. else {
  943. resolve(exitCode);
  944. }
  945. });
  946. });
  947. });
  948. }
  949. }
  950. exports.ToolRunner = ToolRunner;
  951. /**
  952. * Convert an arg string to an array of args. Handles escaping
  953. *
  954. * @param argString string of arguments
  955. * @returns string[] array of arguments
  956. */
  957. function argStringToArray(argString) {
  958. const args = [];
  959. let inQuotes = false;
  960. let escaped = false;
  961. let arg = '';
  962. function append(c) {
  963. // we only escape double quotes.
  964. if (escaped && c !== '"') {
  965. arg += '\\';
  966. }
  967. arg += c;
  968. escaped = false;
  969. }
  970. for (let i = 0; i < argString.length; i++) {
  971. const c = argString.charAt(i);
  972. if (c === '"') {
  973. if (!escaped) {
  974. inQuotes = !inQuotes;
  975. }
  976. else {
  977. append(c);
  978. }
  979. continue;
  980. }
  981. if (c === '\\' && escaped) {
  982. append(c);
  983. continue;
  984. }
  985. if (c === '\\' && inQuotes) {
  986. escaped = true;
  987. continue;
  988. }
  989. if (c === ' ' && !inQuotes) {
  990. if (arg.length > 0) {
  991. args.push(arg);
  992. arg = '';
  993. }
  994. continue;
  995. }
  996. append(c);
  997. }
  998. if (arg.length > 0) {
  999. args.push(arg.trim());
  1000. }
  1001. return args;
  1002. }
  1003. exports.argStringToArray = argStringToArray;
  1004. class ExecState extends events.EventEmitter {
  1005. constructor(options, toolPath) {
  1006. super();
  1007. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  1008. this.processError = '';
  1009. this.processExitCode = 0;
  1010. this.processExited = false; // tracks whether the process has exited
  1011. this.processStderr = false; // tracks whether stderr was written to
  1012. this.delay = 10000; // 10 seconds
  1013. this.done = false;
  1014. this.timeout = null;
  1015. if (!toolPath) {
  1016. throw new Error('toolPath must not be empty');
  1017. }
  1018. this.options = options;
  1019. this.toolPath = toolPath;
  1020. if (options.delay) {
  1021. this.delay = options.delay;
  1022. }
  1023. }
  1024. CheckComplete() {
  1025. if (this.done) {
  1026. return;
  1027. }
  1028. if (this.processClosed) {
  1029. this._setResult();
  1030. }
  1031. else if (this.processExited) {
  1032. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  1033. }
  1034. }
  1035. _debug(message) {
  1036. this.emit('debug', message);
  1037. }
  1038. _setResult() {
  1039. // determine whether there is an error
  1040. let error;
  1041. if (this.processExited) {
  1042. if (this.processError) {
  1043. 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}`);
  1044. }
  1045. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  1046. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  1047. }
  1048. else if (this.processStderr && this.options.failOnStdErr) {
  1049. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  1050. }
  1051. }
  1052. // clear the timeout
  1053. if (this.timeout) {
  1054. clearTimeout(this.timeout);
  1055. this.timeout = null;
  1056. }
  1057. this.done = true;
  1058. this.emit('done', error, this.processExitCode);
  1059. }
  1060. static HandleTimeout(state) {
  1061. if (state.done) {
  1062. return;
  1063. }
  1064. if (!state.processClosed && state.processExited) {
  1065. const message = `The STDIO streams did not close within ${state.delay /
  1066. 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.`;
  1067. state._debug(message);
  1068. }
  1069. state._setResult();
  1070. }
  1071. }
  1072. //# sourceMappingURL=toolrunner.js.map
  1073. /***/ }),
  1074. /***/ 11:
  1075. /***/ (function(module) {
  1076. // Returns a wrapper function that returns a wrapped callback
  1077. // The wrapper function should do some stuff, and return a
  1078. // presumably different callback function.
  1079. // This makes sure that own properties are retained, so that
  1080. // decorations and such are not lost along the way.
  1081. module.exports = wrappy
  1082. function wrappy (fn, cb) {
  1083. if (fn && cb) return wrappy(fn)(cb)
  1084. if (typeof fn !== 'function')
  1085. throw new TypeError('need wrapper function')
  1086. Object.keys(fn).forEach(function (k) {
  1087. wrapper[k] = fn[k]
  1088. })
  1089. return wrapper
  1090. function wrapper() {
  1091. var args = new Array(arguments.length)
  1092. for (var i = 0; i < args.length; i++) {
  1093. args[i] = arguments[i]
  1094. }
  1095. var ret = fn.apply(this, args)
  1096. var cb = args[args.length-1]
  1097. if (typeof ret === 'function' && ret !== cb) {
  1098. Object.keys(cb).forEach(function (k) {
  1099. ret[k] = cb[k]
  1100. })
  1101. }
  1102. return ret
  1103. }
  1104. }
  1105. /***/ }),
  1106. /***/ 18:
  1107. /***/ (function() {
  1108. eval("require")("encoding");
  1109. /***/ }),
  1110. /***/ 19:
  1111. /***/ (function(module, __unusedexports, __webpack_require__) {
  1112. module.exports = authenticationPlugin;
  1113. const { Deprecation } = __webpack_require__(692);
  1114. const once = __webpack_require__(969);
  1115. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1116. const authenticate = __webpack_require__(674);
  1117. const beforeRequest = __webpack_require__(471);
  1118. const requestError = __webpack_require__(349);
  1119. function authenticationPlugin(octokit, options) {
  1120. if (options.auth) {
  1121. octokit.authenticate = () => {
  1122. deprecateAuthenticate(
  1123. octokit.log,
  1124. new Deprecation(
  1125. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1126. )
  1127. );
  1128. };
  1129. return;
  1130. }
  1131. const state = {
  1132. octokit,
  1133. auth: false
  1134. };
  1135. octokit.authenticate = authenticate.bind(null, state);
  1136. octokit.hook.before("request", beforeRequest.bind(null, state));
  1137. octokit.hook.error("request", requestError.bind(null, state));
  1138. }
  1139. /***/ }),
  1140. /***/ 20:
  1141. /***/ (function(module, __unusedexports, __webpack_require__) {
  1142. "use strict";
  1143. const cp = __webpack_require__(129);
  1144. const parse = __webpack_require__(568);
  1145. const enoent = __webpack_require__(881);
  1146. function spawn(command, args, options) {
  1147. // Parse the arguments
  1148. const parsed = parse(command, args, options);
  1149. // Spawn the child process
  1150. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1151. // Hook into child process "exit" event to emit an error if the command
  1152. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1153. enoent.hookChildProcess(spawned, parsed);
  1154. return spawned;
  1155. }
  1156. function spawnSync(command, args, options) {
  1157. // Parse the arguments
  1158. const parsed = parse(command, args, options);
  1159. // Spawn the child process
  1160. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1161. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1162. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1163. return result;
  1164. }
  1165. module.exports = spawn;
  1166. module.exports.spawn = spawn;
  1167. module.exports.sync = spawnSync;
  1168. module.exports._parse = parse;
  1169. module.exports._enoent = enoent;
  1170. /***/ }),
  1171. /***/ 34:
  1172. /***/ (function(module) {
  1173. module.exports = require("https");
  1174. /***/ }),
  1175. /***/ 39:
  1176. /***/ (function(module) {
  1177. "use strict";
  1178. module.exports = opts => {
  1179. opts = opts || {};
  1180. const env = opts.env || process.env;
  1181. const platform = opts.platform || process.platform;
  1182. if (platform !== 'win32') {
  1183. return 'PATH';
  1184. }
  1185. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1186. };
  1187. /***/ }),
  1188. /***/ 46:
  1189. /***/ (function(module, __unusedexports, __webpack_require__) {
  1190. module.exports = getUserAgentNode
  1191. const osName = __webpack_require__(2)
  1192. function getUserAgentNode () {
  1193. try {
  1194. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`
  1195. } catch (error) {
  1196. if (/wmic os get Caption/.test(error.message)) {
  1197. return 'Windows <version undetectable>'
  1198. }
  1199. throw error
  1200. }
  1201. }
  1202. /***/ }),
  1203. /***/ 47:
  1204. /***/ (function(module, __unusedexports, __webpack_require__) {
  1205. module.exports = factory;
  1206. const Octokit = __webpack_require__(402);
  1207. const registerPlugin = __webpack_require__(855);
  1208. function factory(plugins) {
  1209. const Api = Octokit.bind(null, plugins || []);
  1210. Api.plugin = registerPlugin.bind(null, plugins || []);
  1211. return Api;
  1212. }
  1213. /***/ }),
  1214. /***/ 49:
  1215. /***/ (function(module, __unusedexports, __webpack_require__) {
  1216. "use strict";
  1217. const os = __webpack_require__(87);
  1218. const execa = __webpack_require__(955);
  1219. // Reference: https://www.gaijin.at/en/lstwinver.php
  1220. const names = new Map([
  1221. ['10.0', '10'],
  1222. ['6.3', '8.1'],
  1223. ['6.2', '8'],
  1224. ['6.1', '7'],
  1225. ['6.0', 'Vista'],
  1226. ['5.2', 'Server 2003'],
  1227. ['5.1', 'XP'],
  1228. ['5.0', '2000'],
  1229. ['4.9', 'ME'],
  1230. ['4.1', '98'],
  1231. ['4.0', '95']
  1232. ]);
  1233. const windowsRelease = release => {
  1234. const version = /\d+\.\d/.exec(release || os.release());
  1235. if (release && !version) {
  1236. throw new Error('`release` argument doesn\'t match `n.n`');
  1237. }
  1238. const ver = (version || [])[0];
  1239. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1240. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1241. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1242. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1243. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1244. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1245. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1246. if (year) {
  1247. return `Server ${year}`;
  1248. }
  1249. }
  1250. return names.get(ver);
  1251. };
  1252. module.exports = windowsRelease;
  1253. /***/ }),
  1254. /***/ 87:
  1255. /***/ (function(module) {
  1256. module.exports = require("os");
  1257. /***/ }),
  1258. /***/ 118:
  1259. /***/ (function(module, __unusedexports, __webpack_require__) {
  1260. "use strict";
  1261. const os = __webpack_require__(87);
  1262. const nameMap = new Map([
  1263. [19, 'Catalina'],
  1264. [18, 'Mojave'],
  1265. [17, 'High Sierra'],
  1266. [16, 'Sierra'],
  1267. [15, 'El Capitan'],
  1268. [14, 'Yosemite'],
  1269. [13, 'Mavericks'],
  1270. [12, 'Mountain Lion'],
  1271. [11, 'Lion'],
  1272. [10, 'Snow Leopard'],
  1273. [9, 'Leopard'],
  1274. [8, 'Tiger'],
  1275. [7, 'Panther'],
  1276. [6, 'Jaguar'],
  1277. [5, 'Puma']
  1278. ]);
  1279. const macosRelease = release => {
  1280. release = Number((release || os.release()).split('.')[0]);
  1281. return {
  1282. name: nameMap.get(release),
  1283. version: '10.' + (release - 4)
  1284. };
  1285. };
  1286. module.exports = macosRelease;
  1287. // TODO: remove this in the next major version
  1288. module.exports.default = macosRelease;
  1289. /***/ }),
  1290. /***/ 126:
  1291. /***/ (function(module) {
  1292. /**
  1293. * lodash (Custom Build) <https://lodash.com/>
  1294. * Build: `lodash modularize exports="npm" -o ./`
  1295. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1296. * Released under MIT license <https://lodash.com/license>
  1297. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1298. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1299. */
  1300. /** Used as the size to enable large array optimizations. */
  1301. var LARGE_ARRAY_SIZE = 200;
  1302. /** Used to stand-in for `undefined` hash values. */
  1303. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1304. /** Used as references for various `Number` constants. */
  1305. var INFINITY = 1 / 0;
  1306. /** `Object#toString` result references. */
  1307. var funcTag = '[object Function]',
  1308. genTag = '[object GeneratorFunction]';
  1309. /**
  1310. * Used to match `RegExp`
  1311. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1312. */
  1313. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1314. /** Used to detect host constructors (Safari). */
  1315. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1316. /** Detect free variable `global` from Node.js. */
  1317. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1318. /** Detect free variable `self`. */
  1319. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1320. /** Used as a reference to the global object. */
  1321. var root = freeGlobal || freeSelf || Function('return this')();
  1322. /**
  1323. * A specialized version of `_.includes` for arrays without support for
  1324. * specifying an index to search from.
  1325. *
  1326. * @private
  1327. * @param {Array} [array] The array to inspect.
  1328. * @param {*} target The value to search for.
  1329. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1330. */
  1331. function arrayIncludes(array, value) {
  1332. var length = array ? array.length : 0;
  1333. return !!length && baseIndexOf(array, value, 0) > -1;
  1334. }
  1335. /**
  1336. * This function is like `arrayIncludes` except that it accepts a comparator.
  1337. *
  1338. * @private
  1339. * @param {Array} [array] The array to inspect.
  1340. * @param {*} target The value to search for.
  1341. * @param {Function} comparator The comparator invoked per element.
  1342. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1343. */
  1344. function arrayIncludesWith(array, value, comparator) {
  1345. var index = -1,
  1346. length = array ? array.length : 0;
  1347. while (++index < length) {
  1348. if (comparator(value, array[index])) {
  1349. return true;
  1350. }
  1351. }
  1352. return false;
  1353. }
  1354. /**
  1355. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1356. * support for iteratee shorthands.
  1357. *
  1358. * @private
  1359. * @param {Array} array The array to inspect.
  1360. * @param {Function} predicate The function invoked per iteration.
  1361. * @param {number} fromIndex The index to search from.
  1362. * @param {boolean} [fromRight] Specify iterating from right to left.
  1363. * @returns {number} Returns the index of the matched value, else `-1`.
  1364. */
  1365. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1366. var length = array.length,
  1367. index = fromIndex + (fromRight ? 1 : -1);
  1368. while ((fromRight ? index-- : ++index < length)) {
  1369. if (predicate(array[index], index, array)) {
  1370. return index;
  1371. }
  1372. }
  1373. return -1;
  1374. }
  1375. /**
  1376. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1377. *
  1378. * @private
  1379. * @param {Array} array The array to inspect.
  1380. * @param {*} value The value to search for.
  1381. * @param {number} fromIndex The index to search from.
  1382. * @returns {number} Returns the index of the matched value, else `-1`.
  1383. */
  1384. function baseIndexOf(array, value, fromIndex) {
  1385. if (value !== value) {
  1386. return baseFindIndex(array, baseIsNaN, fromIndex);
  1387. }
  1388. var index = fromIndex - 1,
  1389. length = array.length;
  1390. while (++index < length) {
  1391. if (array[index] === value) {
  1392. return index;
  1393. }
  1394. }
  1395. return -1;
  1396. }
  1397. /**
  1398. * The base implementation of `_.isNaN` without support for number objects.
  1399. *
  1400. * @private
  1401. * @param {*} value The value to check.
  1402. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1403. */
  1404. function baseIsNaN(value) {
  1405. return value !== value;
  1406. }
  1407. /**
  1408. * Checks if a cache value for `key` exists.
  1409. *
  1410. * @private
  1411. * @param {Object} cache The cache to query.
  1412. * @param {string} key The key of the entry to check.
  1413. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1414. */
  1415. function cacheHas(cache, key) {
  1416. return cache.has(key);
  1417. }
  1418. /**
  1419. * Gets the value at `key` of `object`.
  1420. *
  1421. * @private
  1422. * @param {Object} [object] The object to query.
  1423. * @param {string} key The key of the property to get.
  1424. * @returns {*} Returns the property value.
  1425. */
  1426. function getValue(object, key) {
  1427. return object == null ? undefined : object[key];
  1428. }
  1429. /**
  1430. * Checks if `value` is a host object in IE < 9.
  1431. *
  1432. * @private
  1433. * @param {*} value The value to check.
  1434. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1435. */
  1436. function isHostObject(value) {
  1437. // Many host objects are `Object` objects that can coerce to strings
  1438. // despite having improperly defined `toString` methods.
  1439. var result = false;
  1440. if (value != null && typeof value.toString != 'function') {
  1441. try {
  1442. result = !!(value + '');
  1443. } catch (e) {}
  1444. }
  1445. return result;
  1446. }
  1447. /**
  1448. * Converts `set` to an array of its values.
  1449. *
  1450. * @private
  1451. * @param {Object} set The set to convert.
  1452. * @returns {Array} Returns the values.
  1453. */
  1454. function setToArray(set) {
  1455. var index = -1,
  1456. result = Array(set.size);
  1457. set.forEach(function(value) {
  1458. result[++index] = value;
  1459. });
  1460. return result;
  1461. }
  1462. /** Used for built-in method references. */
  1463. var arrayProto = Array.prototype,
  1464. funcProto = Function.prototype,
  1465. objectProto = Object.prototype;
  1466. /** Used to detect overreaching core-js shims. */
  1467. var coreJsData = root['__core-js_shared__'];
  1468. /** Used to detect methods masquerading as native. */
  1469. var maskSrcKey = (function() {
  1470. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1471. return uid ? ('Symbol(src)_1.' + uid) : '';
  1472. }());
  1473. /** Used to resolve the decompiled source of functions. */
  1474. var funcToString = funcProto.toString;
  1475. /** Used to check objects for own properties. */
  1476. var hasOwnProperty = objectProto.hasOwnProperty;
  1477. /**
  1478. * Used to resolve the
  1479. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1480. * of values.
  1481. */
  1482. var objectToString = objectProto.toString;
  1483. /** Used to detect if a method is native. */
  1484. var reIsNative = RegExp('^' +
  1485. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1486. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1487. );
  1488. /** Built-in value references. */
  1489. var splice = arrayProto.splice;
  1490. /* Built-in method references that are verified to be native. */
  1491. var Map = getNative(root, 'Map'),
  1492. Set = getNative(root, 'Set'),
  1493. nativeCreate = getNative(Object, 'create');
  1494. /**
  1495. * Creates a hash object.
  1496. *
  1497. * @private
  1498. * @constructor
  1499. * @param {Array} [entries] The key-value pairs to cache.
  1500. */
  1501. function Hash(entries) {
  1502. var index = -1,
  1503. length = entries ? entries.length : 0;
  1504. this.clear();
  1505. while (++index < length) {
  1506. var entry = entries[index];
  1507. this.set(entry[0], entry[1]);
  1508. }
  1509. }
  1510. /**
  1511. * Removes all key-value entries from the hash.
  1512. *
  1513. * @private
  1514. * @name clear
  1515. * @memberOf Hash
  1516. */
  1517. function hashClear() {
  1518. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1519. }
  1520. /**
  1521. * Removes `key` and its value from the hash.
  1522. *
  1523. * @private
  1524. * @name delete
  1525. * @memberOf Hash
  1526. * @param {Object} hash The hash to modify.
  1527. * @param {string} key The key of the value to remove.
  1528. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1529. */
  1530. function hashDelete(key) {
  1531. return this.has(key) && delete this.__data__[key];
  1532. }
  1533. /**
  1534. * Gets the hash value for `key`.
  1535. *
  1536. * @private
  1537. * @name get
  1538. * @memberOf Hash
  1539. * @param {string} key The key of the value to get.
  1540. * @returns {*} Returns the entry value.
  1541. */
  1542. function hashGet(key) {
  1543. var data = this.__data__;
  1544. if (nativeCreate) {
  1545. var result = data[key];
  1546. return result === HASH_UNDEFINED ? undefined : result;
  1547. }
  1548. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1549. }
  1550. /**
  1551. * Checks if a hash value for `key` exists.
  1552. *
  1553. * @private
  1554. * @name has
  1555. * @memberOf Hash
  1556. * @param {string} key The key of the entry to check.
  1557. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1558. */
  1559. function hashHas(key) {
  1560. var data = this.__data__;
  1561. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1562. }
  1563. /**
  1564. * Sets the hash `key` to `value`.
  1565. *
  1566. * @private
  1567. * @name set
  1568. * @memberOf Hash
  1569. * @param {string} key The key of the value to set.
  1570. * @param {*} value The value to set.
  1571. * @returns {Object} Returns the hash instance.
  1572. */
  1573. function hashSet(key, value) {
  1574. var data = this.__data__;
  1575. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1576. return this;
  1577. }
  1578. // Add methods to `Hash`.
  1579. Hash.prototype.clear = hashClear;
  1580. Hash.prototype['delete'] = hashDelete;
  1581. Hash.prototype.get = hashGet;
  1582. Hash.prototype.has = hashHas;
  1583. Hash.prototype.set = hashSet;
  1584. /**
  1585. * Creates an list cache object.
  1586. *
  1587. * @private
  1588. * @constructor
  1589. * @param {Array} [entries] The key-value pairs to cache.
  1590. */
  1591. function ListCache(entries) {
  1592. var index = -1,
  1593. length = entries ? entries.length : 0;
  1594. this.clear();
  1595. while (++index < length) {
  1596. var entry = entries[index];
  1597. this.set(entry[0], entry[1]);
  1598. }
  1599. }
  1600. /**
  1601. * Removes all key-value entries from the list cache.
  1602. *
  1603. * @private
  1604. * @name clear
  1605. * @memberOf ListCache
  1606. */
  1607. function listCacheClear() {
  1608. this.__data__ = [];
  1609. }
  1610. /**
  1611. * Removes `key` and its value from the list cache.
  1612. *
  1613. * @private
  1614. * @name delete
  1615. * @memberOf ListCache
  1616. * @param {string} key The key of the value to remove.
  1617. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1618. */
  1619. function listCacheDelete(key) {
  1620. var data = this.__data__,
  1621. index = assocIndexOf(data, key);
  1622. if (index < 0) {
  1623. return false;
  1624. }
  1625. var lastIndex = data.length - 1;
  1626. if (index == lastIndex) {
  1627. data.pop();
  1628. } else {
  1629. splice.call(data, index, 1);
  1630. }
  1631. return true;
  1632. }
  1633. /**
  1634. * Gets the list cache value for `key`.
  1635. *
  1636. * @private
  1637. * @name get
  1638. * @memberOf ListCache
  1639. * @param {string} key The key of the value to get.
  1640. * @returns {*} Returns the entry value.
  1641. */
  1642. function listCacheGet(key) {
  1643. var data = this.__data__,
  1644. index = assocIndexOf(data, key);
  1645. return index < 0 ? undefined : data[index][1];
  1646. }
  1647. /**
  1648. * Checks if a list cache value for `key` exists.
  1649. *
  1650. * @private
  1651. * @name has
  1652. * @memberOf ListCache
  1653. * @param {string} key The key of the entry to check.
  1654. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1655. */
  1656. function listCacheHas(key) {
  1657. return assocIndexOf(this.__data__, key) > -1;
  1658. }
  1659. /**
  1660. * Sets the list cache `key` to `value`.
  1661. *
  1662. * @private
  1663. * @name set
  1664. * @memberOf ListCache
  1665. * @param {string} key The key of the value to set.
  1666. * @param {*} value The value to set.
  1667. * @returns {Object} Returns the list cache instance.
  1668. */
  1669. function listCacheSet(key, value) {
  1670. var data = this.__data__,
  1671. index = assocIndexOf(data, key);
  1672. if (index < 0) {
  1673. data.push([key, value]);
  1674. } else {
  1675. data[index][1] = value;
  1676. }
  1677. return this;
  1678. }
  1679. // Add methods to `ListCache`.
  1680. ListCache.prototype.clear = listCacheClear;
  1681. ListCache.prototype['delete'] = listCacheDelete;
  1682. ListCache.prototype.get = listCacheGet;
  1683. ListCache.prototype.has = listCacheHas;
  1684. ListCache.prototype.set = listCacheSet;
  1685. /**
  1686. * Creates a map cache object to store key-value pairs.
  1687. *
  1688. * @private
  1689. * @constructor
  1690. * @param {Array} [entries] The key-value pairs to cache.
  1691. */
  1692. function MapCache(entries) {
  1693. var index = -1,
  1694. length = entries ? entries.length : 0;
  1695. this.clear();
  1696. while (++index < length) {
  1697. var entry = entries[index];
  1698. this.set(entry[0], entry[1]);
  1699. }
  1700. }
  1701. /**
  1702. * Removes all key-value entries from the map.
  1703. *
  1704. * @private
  1705. * @name clear
  1706. * @memberOf MapCache
  1707. */
  1708. function mapCacheClear() {
  1709. this.__data__ = {
  1710. 'hash': new Hash,
  1711. 'map': new (Map || ListCache),
  1712. 'string': new Hash
  1713. };
  1714. }
  1715. /**
  1716. * Removes `key` and its value from the map.
  1717. *
  1718. * @private
  1719. * @name delete
  1720. * @memberOf MapCache
  1721. * @param {string} key The key of the value to remove.
  1722. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1723. */
  1724. function mapCacheDelete(key) {
  1725. return getMapData(this, key)['delete'](key);
  1726. }
  1727. /**
  1728. * Gets the map value for `key`.
  1729. *
  1730. * @private
  1731. * @name get
  1732. * @memberOf MapCache
  1733. * @param {string} key The key of the value to get.
  1734. * @returns {*} Returns the entry value.
  1735. */
  1736. function mapCacheGet(key) {
  1737. return getMapData(this, key).get(key);
  1738. }
  1739. /**
  1740. * Checks if a map value for `key` exists.
  1741. *
  1742. * @private
  1743. * @name has
  1744. * @memberOf MapCache
  1745. * @param {string} key The key of the entry to check.
  1746. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1747. */
  1748. function mapCacheHas(key) {
  1749. return getMapData(this, key).has(key);
  1750. }
  1751. /**
  1752. * Sets the map `key` to `value`.
  1753. *
  1754. * @private
  1755. * @name set
  1756. * @memberOf MapCache
  1757. * @param {string} key The key of the value to set.
  1758. * @param {*} value The value to set.
  1759. * @returns {Object} Returns the map cache instance.
  1760. */
  1761. function mapCacheSet(key, value) {
  1762. getMapData(this, key).set(key, value);
  1763. return this;
  1764. }
  1765. // Add methods to `MapCache`.
  1766. MapCache.prototype.clear = mapCacheClear;
  1767. MapCache.prototype['delete'] = mapCacheDelete;
  1768. MapCache.prototype.get = mapCacheGet;
  1769. MapCache.prototype.has = mapCacheHas;
  1770. MapCache.prototype.set = mapCacheSet;
  1771. /**
  1772. *
  1773. * Creates an array cache object to store unique values.
  1774. *
  1775. * @private
  1776. * @constructor
  1777. * @param {Array} [values] The values to cache.
  1778. */
  1779. function SetCache(values) {
  1780. var index = -1,
  1781. length = values ? values.length : 0;
  1782. this.__data__ = new MapCache;
  1783. while (++index < length) {
  1784. this.add(values[index]);
  1785. }
  1786. }
  1787. /**
  1788. * Adds `value` to the array cache.
  1789. *
  1790. * @private
  1791. * @name add
  1792. * @memberOf SetCache
  1793. * @alias push
  1794. * @param {*} value The value to cache.
  1795. * @returns {Object} Returns the cache instance.
  1796. */
  1797. function setCacheAdd(value) {
  1798. this.__data__.set(value, HASH_UNDEFINED);
  1799. return this;
  1800. }
  1801. /**
  1802. * Checks if `value` is in the array cache.
  1803. *
  1804. * @private
  1805. * @name has
  1806. * @memberOf SetCache
  1807. * @param {*} value The value to search for.
  1808. * @returns {number} Returns `true` if `value` is found, else `false`.
  1809. */
  1810. function setCacheHas(value) {
  1811. return this.__data__.has(value);
  1812. }
  1813. // Add methods to `SetCache`.
  1814. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1815. SetCache.prototype.has = setCacheHas;
  1816. /**
  1817. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1818. *
  1819. * @private
  1820. * @param {Array} array The array to inspect.
  1821. * @param {*} key The key to search for.
  1822. * @returns {number} Returns the index of the matched value, else `-1`.
  1823. */
  1824. function assocIndexOf(array, key) {
  1825. var length = array.length;
  1826. while (length--) {
  1827. if (eq(array[length][0], key)) {
  1828. return length;
  1829. }
  1830. }
  1831. return -1;
  1832. }
  1833. /**
  1834. * The base implementation of `_.isNative` without bad shim checks.
  1835. *
  1836. * @private
  1837. * @param {*} value The value to check.
  1838. * @returns {boolean} Returns `true` if `value` is a native function,
  1839. * else `false`.
  1840. */
  1841. function baseIsNative(value) {
  1842. if (!isObject(value) || isMasked(value)) {
  1843. return false;
  1844. }
  1845. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1846. return pattern.test(toSource(value));
  1847. }
  1848. /**
  1849. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1850. *
  1851. * @private
  1852. * @param {Array} array The array to inspect.
  1853. * @param {Function} [iteratee] The iteratee invoked per element.
  1854. * @param {Function} [comparator] The comparator invoked per element.
  1855. * @returns {Array} Returns the new duplicate free array.
  1856. */
  1857. function baseUniq(array, iteratee, comparator) {
  1858. var index = -1,
  1859. includes = arrayIncludes,
  1860. length = array.length,
  1861. isCommon = true,
  1862. result = [],
  1863. seen = result;
  1864. if (comparator) {
  1865. isCommon = false;
  1866. includes = arrayIncludesWith;
  1867. }
  1868. else if (length >= LARGE_ARRAY_SIZE) {
  1869. var set = iteratee ? null : createSet(array);
  1870. if (set) {
  1871. return setToArray(set);
  1872. }
  1873. isCommon = false;
  1874. includes = cacheHas;
  1875. seen = new SetCache;
  1876. }
  1877. else {
  1878. seen = iteratee ? [] : result;
  1879. }
  1880. outer:
  1881. while (++index < length) {
  1882. var value = array[index],
  1883. computed = iteratee ? iteratee(value) : value;
  1884. value = (comparator || value !== 0) ? value : 0;
  1885. if (isCommon && computed === computed) {
  1886. var seenIndex = seen.length;
  1887. while (seenIndex--) {
  1888. if (seen[seenIndex] === computed) {
  1889. continue outer;
  1890. }
  1891. }
  1892. if (iteratee) {
  1893. seen.push(computed);
  1894. }
  1895. result.push(value);
  1896. }
  1897. else if (!includes(seen, computed, comparator)) {
  1898. if (seen !== result) {
  1899. seen.push(computed);
  1900. }
  1901. result.push(value);
  1902. }
  1903. }
  1904. return result;
  1905. }
  1906. /**
  1907. * Creates a set object of `values`.
  1908. *
  1909. * @private
  1910. * @param {Array} values The values to add to the set.
  1911. * @returns {Object} Returns the new set.
  1912. */
  1913. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1914. return new Set(values);
  1915. };
  1916. /**
  1917. * Gets the data for `map`.
  1918. *
  1919. * @private
  1920. * @param {Object} map The map to query.
  1921. * @param {string} key The reference key.
  1922. * @returns {*} Returns the map data.
  1923. */
  1924. function getMapData(map, key) {
  1925. var data = map.__data__;
  1926. return isKeyable(key)
  1927. ? data[typeof key == 'string' ? 'string' : 'hash']
  1928. : data.map;
  1929. }
  1930. /**
  1931. * Gets the native function at `key` of `object`.
  1932. *
  1933. * @private
  1934. * @param {Object} object The object to query.
  1935. * @param {string} key The key of the method to get.
  1936. * @returns {*} Returns the function if it's native, else `undefined`.
  1937. */
  1938. function getNative(object, key) {
  1939. var value = getValue(object, key);
  1940. return baseIsNative(value) ? value : undefined;
  1941. }
  1942. /**
  1943. * Checks if `value` is suitable for use as unique object key.
  1944. *
  1945. * @private
  1946. * @param {*} value The value to check.
  1947. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1948. */
  1949. function isKeyable(value) {
  1950. var type = typeof value;
  1951. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1952. ? (value !== '__proto__')
  1953. : (value === null);
  1954. }
  1955. /**
  1956. * Checks if `func` has its source masked.
  1957. *
  1958. * @private
  1959. * @param {Function} func The function to check.
  1960. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1961. */
  1962. function isMasked(func) {
  1963. return !!maskSrcKey && (maskSrcKey in func);
  1964. }
  1965. /**
  1966. * Converts `func` to its source code.
  1967. *
  1968. * @private
  1969. * @param {Function} func The function to process.
  1970. * @returns {string} Returns the source code.
  1971. */
  1972. function toSource(func) {
  1973. if (func != null) {
  1974. try {
  1975. return funcToString.call(func);
  1976. } catch (e) {}
  1977. try {
  1978. return (func + '');
  1979. } catch (e) {}
  1980. }
  1981. return '';
  1982. }
  1983. /**
  1984. * Creates a duplicate-free version of an array, using
  1985. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1986. * for equality comparisons, in which only the first occurrence of each
  1987. * element is kept.
  1988. *
  1989. * @static
  1990. * @memberOf _
  1991. * @since 0.1.0
  1992. * @category Array
  1993. * @param {Array} array The array to inspect.
  1994. * @returns {Array} Returns the new duplicate free array.
  1995. * @example
  1996. *
  1997. * _.uniq([2, 1, 2]);
  1998. * // => [2, 1]
  1999. */
  2000. function uniq(array) {
  2001. return (array && array.length)
  2002. ? baseUniq(array)
  2003. : [];
  2004. }
  2005. /**
  2006. * Performs a
  2007. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2008. * comparison between two values to determine if they are equivalent.
  2009. *
  2010. * @static
  2011. * @memberOf _
  2012. * @since 4.0.0
  2013. * @category Lang
  2014. * @param {*} value The value to compare.
  2015. * @param {*} other The other value to compare.
  2016. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2017. * @example
  2018. *
  2019. * var object = { 'a': 1 };
  2020. * var other = { 'a': 1 };
  2021. *
  2022. * _.eq(object, object);
  2023. * // => true
  2024. *
  2025. * _.eq(object, other);
  2026. * // => false
  2027. *
  2028. * _.eq('a', 'a');
  2029. * // => true
  2030. *
  2031. * _.eq('a', Object('a'));
  2032. * // => false
  2033. *
  2034. * _.eq(NaN, NaN);
  2035. * // => true
  2036. */
  2037. function eq(value, other) {
  2038. return value === other || (value !== value && other !== other);
  2039. }
  2040. /**
  2041. * Checks if `value` is classified as a `Function` object.
  2042. *
  2043. * @static
  2044. * @memberOf _
  2045. * @since 0.1.0
  2046. * @category Lang
  2047. * @param {*} value The value to check.
  2048. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2049. * @example
  2050. *
  2051. * _.isFunction(_);
  2052. * // => true
  2053. *
  2054. * _.isFunction(/abc/);
  2055. * // => false
  2056. */
  2057. function isFunction(value) {
  2058. // The use of `Object#toString` avoids issues with the `typeof` operator
  2059. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2060. var tag = isObject(value) ? objectToString.call(value) : '';
  2061. return tag == funcTag || tag == genTag;
  2062. }
  2063. /**
  2064. * Checks if `value` is the
  2065. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2066. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2067. *
  2068. * @static
  2069. * @memberOf _
  2070. * @since 0.1.0
  2071. * @category Lang
  2072. * @param {*} value The value to check.
  2073. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2074. * @example
  2075. *
  2076. * _.isObject({});
  2077. * // => true
  2078. *
  2079. * _.isObject([1, 2, 3]);
  2080. * // => true
  2081. *
  2082. * _.isObject(_.noop);
  2083. * // => true
  2084. *
  2085. * _.isObject(null);
  2086. * // => false
  2087. */
  2088. function isObject(value) {
  2089. var type = typeof value;
  2090. return !!value && (type == 'object' || type == 'function');
  2091. }
  2092. /**
  2093. * This method returns `undefined`.
  2094. *
  2095. * @static
  2096. * @memberOf _
  2097. * @since 2.3.0
  2098. * @category Util
  2099. * @example
  2100. *
  2101. * _.times(2, _.noop);
  2102. * // => [undefined, undefined]
  2103. */
  2104. function noop() {
  2105. // No operation performed.
  2106. }
  2107. module.exports = uniq;
  2108. /***/ }),
  2109. /***/ 129:
  2110. /***/ (function(module) {
  2111. module.exports = require("child_process");
  2112. /***/ }),
  2113. /***/ 143:
  2114. /***/ (function(module, __unusedexports, __webpack_require__) {
  2115. module.exports = withAuthorizationPrefix;
  2116. const atob = __webpack_require__(368);
  2117. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2118. function withAuthorizationPrefix(authorization) {
  2119. if (/^(basic|bearer|token) /i.test(authorization)) {
  2120. return authorization;
  2121. }
  2122. try {
  2123. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2124. return `basic ${authorization}`;
  2125. }
  2126. } catch (error) {}
  2127. if (authorization.split(/\./).length === 3) {
  2128. return `bearer ${authorization}`;
  2129. }
  2130. return `token ${authorization}`;
  2131. }
  2132. /***/ }),
  2133. /***/ 145:
  2134. /***/ (function(module, __unusedexports, __webpack_require__) {
  2135. "use strict";
  2136. const pump = __webpack_require__(453);
  2137. const bufferStream = __webpack_require__(966);
  2138. class MaxBufferError extends Error {
  2139. constructor() {
  2140. super('maxBuffer exceeded');
  2141. this.name = 'MaxBufferError';
  2142. }
  2143. }
  2144. function getStream(inputStream, options) {
  2145. if (!inputStream) {
  2146. return Promise.reject(new Error('Expected a stream'));
  2147. }
  2148. options = Object.assign({maxBuffer: Infinity}, options);
  2149. const {maxBuffer} = options;
  2150. let stream;
  2151. return new Promise((resolve, reject) => {
  2152. const rejectPromise = error => {
  2153. if (error) { // A null check
  2154. error.bufferedData = stream.getBufferedValue();
  2155. }
  2156. reject(error);
  2157. };
  2158. stream = pump(inputStream, bufferStream(options), error => {
  2159. if (error) {
  2160. rejectPromise(error);
  2161. return;
  2162. }
  2163. resolve();
  2164. });
  2165. stream.on('data', () => {
  2166. if (stream.getBufferedLength() > maxBuffer) {
  2167. rejectPromise(new MaxBufferError());
  2168. }
  2169. });
  2170. }).then(() => stream.getBufferedValue());
  2171. }
  2172. module.exports = getStream;
  2173. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2174. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2175. module.exports.MaxBufferError = MaxBufferError;
  2176. /***/ }),
  2177. /***/ 148:
  2178. /***/ (function(module, __unusedexports, __webpack_require__) {
  2179. module.exports = paginatePlugin;
  2180. const iterator = __webpack_require__(8);
  2181. const paginate = __webpack_require__(807);
  2182. function paginatePlugin(octokit) {
  2183. octokit.paginate = paginate.bind(null, octokit);
  2184. octokit.paginate.iterator = iterator.bind(null, octokit);
  2185. }
  2186. /***/ }),
  2187. /***/ 168:
  2188. /***/ (function(module) {
  2189. "use strict";
  2190. const alias = ['stdin', 'stdout', 'stderr'];
  2191. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2192. module.exports = opts => {
  2193. if (!opts) {
  2194. return null;
  2195. }
  2196. if (opts.stdio && hasAlias(opts)) {
  2197. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2198. }
  2199. if (typeof opts.stdio === 'string') {
  2200. return opts.stdio;
  2201. }
  2202. const stdio = opts.stdio || [];
  2203. if (!Array.isArray(stdio)) {
  2204. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2205. }
  2206. const result = [];
  2207. const len = Math.max(stdio.length, alias.length);
  2208. for (let i = 0; i < len; i++) {
  2209. let value = null;
  2210. if (stdio[i] !== undefined) {
  2211. value = stdio[i];
  2212. } else if (opts[alias[i]] !== undefined) {
  2213. value = opts[alias[i]];
  2214. }
  2215. result[i] = value;
  2216. }
  2217. return result;
  2218. };
  2219. /***/ }),
  2220. /***/ 190:
  2221. /***/ (function(module, __unusedexports, __webpack_require__) {
  2222. module.exports = authenticationPlugin;
  2223. const beforeRequest = __webpack_require__(863);
  2224. const requestError = __webpack_require__(991);
  2225. const validate = __webpack_require__(954);
  2226. function authenticationPlugin(octokit, options) {
  2227. if (!options.auth) {
  2228. return;
  2229. }
  2230. validate(options.auth);
  2231. const state = {
  2232. octokit,
  2233. auth: options.auth
  2234. };
  2235. octokit.hook.before("request", beforeRequest.bind(null, state));
  2236. octokit.hook.error("request", requestError.bind(null, state));
  2237. }
  2238. /***/ }),
  2239. /***/ 197:
  2240. /***/ (function(module, __unusedexports, __webpack_require__) {
  2241. module.exports = isexe
  2242. isexe.sync = sync
  2243. var fs = __webpack_require__(747)
  2244. function isexe (path, options, cb) {
  2245. fs.stat(path, function (er, stat) {
  2246. cb(er, er ? false : checkStat(stat, options))
  2247. })
  2248. }
  2249. function sync (path, options) {
  2250. return checkStat(fs.statSync(path), options)
  2251. }
  2252. function checkStat (stat, options) {
  2253. return stat.isFile() && checkMode(stat, options)
  2254. }
  2255. function checkMode (stat, options) {
  2256. var mod = stat.mode
  2257. var uid = stat.uid
  2258. var gid = stat.gid
  2259. var myUid = options.uid !== undefined ?
  2260. options.uid : process.getuid && process.getuid()
  2261. var myGid = options.gid !== undefined ?
  2262. options.gid : process.getgid && process.getgid()
  2263. var u = parseInt('100', 8)
  2264. var g = parseInt('010', 8)
  2265. var o = parseInt('001', 8)
  2266. var ug = u | g
  2267. var ret = (mod & o) ||
  2268. (mod & g) && gid === myGid ||
  2269. (mod & u) && uid === myUid ||
  2270. (mod & ug) && myUid === 0
  2271. return ret
  2272. }
  2273. /***/ }),
  2274. /***/ 198:
  2275. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2276. "use strict";
  2277. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2278. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2279. return new (P || (P = Promise))(function (resolve, reject) {
  2280. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2281. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2282. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2283. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2284. });
  2285. };
  2286. var __importStar = (this && this.__importStar) || function (mod) {
  2287. if (mod && mod.__esModule) return mod;
  2288. var result = {};
  2289. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2290. result["default"] = mod;
  2291. return result;
  2292. };
  2293. Object.defineProperty(exports, "__esModule", { value: true });
  2294. const core = __importStar(__webpack_require__(470));
  2295. const coreCommand = __importStar(__webpack_require__(431));
  2296. const gitSourceProvider = __importStar(__webpack_require__(293));
  2297. const inputHelper = __importStar(__webpack_require__(821));
  2298. const path = __importStar(__webpack_require__(622));
  2299. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2300. function run() {
  2301. return __awaiter(this, void 0, void 0, function* () {
  2302. try {
  2303. const sourceSettings = inputHelper.getInputs();
  2304. try {
  2305. // Register problem matcher
  2306. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2307. // Get sources
  2308. yield gitSourceProvider.getSource(sourceSettings);
  2309. }
  2310. finally {
  2311. // Unregister problem matcher
  2312. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2313. }
  2314. }
  2315. catch (error) {
  2316. core.setFailed(error.message);
  2317. }
  2318. });
  2319. }
  2320. function cleanup() {
  2321. return __awaiter(this, void 0, void 0, function* () {
  2322. try {
  2323. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2324. }
  2325. catch (error) {
  2326. core.warning(error.message);
  2327. }
  2328. });
  2329. }
  2330. // Main
  2331. if (!cleanupRepositoryPath) {
  2332. run();
  2333. }
  2334. // Post
  2335. else {
  2336. cleanup();
  2337. }
  2338. /***/ }),
  2339. /***/ 211:
  2340. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2341. "use strict";
  2342. Object.defineProperty(exports, '__esModule', { value: true });
  2343. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2344. var osName = _interopDefault(__webpack_require__(2));
  2345. function getUserAgent() {
  2346. try {
  2347. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2348. } catch (error) {
  2349. if (/wmic os get Caption/.test(error.message)) {
  2350. return "Windows <version undetectable>";
  2351. }
  2352. throw error;
  2353. }
  2354. }
  2355. exports.getUserAgent = getUserAgent;
  2356. //# sourceMappingURL=index.js.map
  2357. /***/ }),
  2358. /***/ 215:
  2359. /***/ (function(module) {
  2360. module.exports = {"name":"@octokit/rest","version":"16.33.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.0.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.33.0.tgz","_integrity":"sha512-t4jMR+odsfooQwmHiREoTQixVTX2DfdbSaO+lKrW9R5XBuk0DW+5T/JdfwtxAGUAHgvDDpWY/NVVDfEPTzxD6g==","_from":"@octokit/rest@16.33.0"};
  2361. /***/ }),
  2362. /***/ 227:
  2363. /***/ (function(__unusedmodule, exports) {
  2364. "use strict";
  2365. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2366. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2367. return new (P || (P = Promise))(function (resolve, reject) {
  2368. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2369. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2370. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2371. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2372. });
  2373. };
  2374. Object.defineProperty(exports, "__esModule", { value: true });
  2375. function getCheckoutInfo(git, ref, commit) {
  2376. return __awaiter(this, void 0, void 0, function* () {
  2377. if (!git) {
  2378. throw new Error('Arg git cannot be empty');
  2379. }
  2380. if (!ref && !commit) {
  2381. throw new Error('Args ref and commit cannot both be empty');
  2382. }
  2383. const result = {};
  2384. const upperRef = (ref || '').toUpperCase();
  2385. // SHA only
  2386. if (!ref) {
  2387. result.ref = commit;
  2388. }
  2389. // refs/heads/
  2390. else if (upperRef.startsWith('REFS/HEADS/')) {
  2391. const branch = ref.substring('refs/heads/'.length);
  2392. result.ref = branch;
  2393. result.startPoint = `refs/remotes/origin/${branch}`;
  2394. }
  2395. // refs/pull/
  2396. else if (upperRef.startsWith('REFS/PULL/')) {
  2397. const branch = ref.substring('refs/pull/'.length);
  2398. result.ref = `refs/remotes/pull/${branch}`;
  2399. }
  2400. // refs/tags/
  2401. else if (upperRef.startsWith('REFS/')) {
  2402. result.ref = ref;
  2403. }
  2404. // Unqualified ref, check for a matching branch or tag
  2405. else {
  2406. if (yield git.branchExists(true, `origin/${ref}`)) {
  2407. result.ref = ref;
  2408. result.startPoint = `refs/remotes/origin/${ref}`;
  2409. }
  2410. else if (yield git.tagExists(`${ref}`)) {
  2411. result.ref = `refs/tags/${ref}`;
  2412. }
  2413. else {
  2414. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2415. }
  2416. }
  2417. return result;
  2418. });
  2419. }
  2420. exports.getCheckoutInfo = getCheckoutInfo;
  2421. function getRefSpec(ref, commit) {
  2422. if (!ref && !commit) {
  2423. throw new Error('Args ref and commit cannot both be empty');
  2424. }
  2425. const upperRef = (ref || '').toUpperCase();
  2426. // SHA
  2427. if (commit) {
  2428. // refs/heads
  2429. if (upperRef.startsWith('REFS/HEADS/')) {
  2430. const branch = ref.substring('refs/heads/'.length);
  2431. return [`+${commit}:refs/remotes/origin/${branch}`];
  2432. }
  2433. // refs/pull/
  2434. else if (upperRef.startsWith('REFS/PULL/')) {
  2435. const branch = ref.substring('refs/pull/'.length);
  2436. return [`+${commit}:refs/remotes/pull/${branch}`];
  2437. }
  2438. // refs/tags/
  2439. else if (upperRef.startsWith('REFS/TAGS/')) {
  2440. return [`+${commit}:${ref}`];
  2441. }
  2442. // Otherwise no destination ref
  2443. else {
  2444. return [commit];
  2445. }
  2446. }
  2447. // Unqualified ref, check for a matching branch or tag
  2448. else if (!upperRef.startsWith('REFS/')) {
  2449. return [
  2450. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2451. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2452. ];
  2453. }
  2454. // refs/heads/
  2455. else if (upperRef.startsWith('REFS/HEADS/')) {
  2456. const branch = ref.substring('refs/heads/'.length);
  2457. return [`+${ref}:refs/remotes/origin/${branch}`];
  2458. }
  2459. // refs/pull/
  2460. else if (upperRef.startsWith('REFS/PULL/')) {
  2461. const branch = ref.substring('refs/pull/'.length);
  2462. return [`+${ref}:refs/remotes/pull/${branch}`];
  2463. }
  2464. // refs/tags/
  2465. else {
  2466. return [`+${ref}:${ref}`];
  2467. }
  2468. }
  2469. exports.getRefSpec = getRefSpec;
  2470. /***/ }),
  2471. /***/ 248:
  2472. /***/ (function(module, __unusedexports, __webpack_require__) {
  2473. module.exports = octokitRegisterEndpoints;
  2474. const registerEndpoints = __webpack_require__(899);
  2475. function octokitRegisterEndpoints(octokit) {
  2476. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2477. }
  2478. /***/ }),
  2479. /***/ 260:
  2480. /***/ (function(module, __unusedexports, __webpack_require__) {
  2481. // Note: since nyc uses this module to output coverage, any lines
  2482. // that are in the direct sync flow of nyc's outputCoverage are
  2483. // ignored, since we can never get coverage for them.
  2484. var assert = __webpack_require__(357)
  2485. var signals = __webpack_require__(654)
  2486. var EE = __webpack_require__(614)
  2487. /* istanbul ignore if */
  2488. if (typeof EE !== 'function') {
  2489. EE = EE.EventEmitter
  2490. }
  2491. var emitter
  2492. if (process.__signal_exit_emitter__) {
  2493. emitter = process.__signal_exit_emitter__
  2494. } else {
  2495. emitter = process.__signal_exit_emitter__ = new EE()
  2496. emitter.count = 0
  2497. emitter.emitted = {}
  2498. }
  2499. // Because this emitter is a global, we have to check to see if a
  2500. // previous version of this library failed to enable infinite listeners.
  2501. // I know what you're about to say. But literally everything about
  2502. // signal-exit is a compromise with evil. Get used to it.
  2503. if (!emitter.infinite) {
  2504. emitter.setMaxListeners(Infinity)
  2505. emitter.infinite = true
  2506. }
  2507. module.exports = function (cb, opts) {
  2508. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2509. if (loaded === false) {
  2510. load()
  2511. }
  2512. var ev = 'exit'
  2513. if (opts && opts.alwaysLast) {
  2514. ev = 'afterexit'
  2515. }
  2516. var remove = function () {
  2517. emitter.removeListener(ev, cb)
  2518. if (emitter.listeners('exit').length === 0 &&
  2519. emitter.listeners('afterexit').length === 0) {
  2520. unload()
  2521. }
  2522. }
  2523. emitter.on(ev, cb)
  2524. return remove
  2525. }
  2526. module.exports.unload = unload
  2527. function unload () {
  2528. if (!loaded) {
  2529. return
  2530. }
  2531. loaded = false
  2532. signals.forEach(function (sig) {
  2533. try {
  2534. process.removeListener(sig, sigListeners[sig])
  2535. } catch (er) {}
  2536. })
  2537. process.emit = originalProcessEmit
  2538. process.reallyExit = originalProcessReallyExit
  2539. emitter.count -= 1
  2540. }
  2541. function emit (event, code, signal) {
  2542. if (emitter.emitted[event]) {
  2543. return
  2544. }
  2545. emitter.emitted[event] = true
  2546. emitter.emit(event, code, signal)
  2547. }
  2548. // { <signal>: <listener fn>, ... }
  2549. var sigListeners = {}
  2550. signals.forEach(function (sig) {
  2551. sigListeners[sig] = function listener () {
  2552. // If there are no other listeners, an exit is coming!
  2553. // Simplest way: remove us and then re-send the signal.
  2554. // We know that this will kill the process, so we can
  2555. // safely emit now.
  2556. var listeners = process.listeners(sig)
  2557. if (listeners.length === emitter.count) {
  2558. unload()
  2559. emit('exit', null, sig)
  2560. /* istanbul ignore next */
  2561. emit('afterexit', null, sig)
  2562. /* istanbul ignore next */
  2563. process.kill(process.pid, sig)
  2564. }
  2565. }
  2566. })
  2567. module.exports.signals = function () {
  2568. return signals
  2569. }
  2570. module.exports.load = load
  2571. var loaded = false
  2572. function load () {
  2573. if (loaded) {
  2574. return
  2575. }
  2576. loaded = true
  2577. // This is the number of onSignalExit's that are in play.
  2578. // It's important so that we can count the correct number of
  2579. // listeners on signals, and don't wait for the other one to
  2580. // handle it instead of us.
  2581. emitter.count += 1
  2582. signals = signals.filter(function (sig) {
  2583. try {
  2584. process.on(sig, sigListeners[sig])
  2585. return true
  2586. } catch (er) {
  2587. return false
  2588. }
  2589. })
  2590. process.emit = processEmit
  2591. process.reallyExit = processReallyExit
  2592. }
  2593. var originalProcessReallyExit = process.reallyExit
  2594. function processReallyExit (code) {
  2595. process.exitCode = code || 0
  2596. emit('exit', process.exitCode, null)
  2597. /* istanbul ignore next */
  2598. emit('afterexit', process.exitCode, null)
  2599. /* istanbul ignore next */
  2600. originalProcessReallyExit.call(process, process.exitCode)
  2601. }
  2602. var originalProcessEmit = process.emit
  2603. function processEmit (ev, arg) {
  2604. if (ev === 'exit') {
  2605. if (arg !== undefined) {
  2606. process.exitCode = arg
  2607. }
  2608. var ret = originalProcessEmit.apply(this, arguments)
  2609. emit('exit', process.exitCode, null)
  2610. /* istanbul ignore next */
  2611. emit('afterexit', process.exitCode, null)
  2612. return ret
  2613. } else {
  2614. return originalProcessEmit.apply(this, arguments)
  2615. }
  2616. }
  2617. /***/ }),
  2618. /***/ 262:
  2619. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2620. "use strict";
  2621. Object.defineProperty(exports, "__esModule", { value: true });
  2622. const fs_1 = __webpack_require__(747);
  2623. const os_1 = __webpack_require__(87);
  2624. class Context {
  2625. /**
  2626. * Hydrate the context from the environment
  2627. */
  2628. constructor() {
  2629. this.payload = {};
  2630. if (process.env.GITHUB_EVENT_PATH) {
  2631. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2632. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2633. }
  2634. else {
  2635. process.stdout.write(`GITHUB_EVENT_PATH ${process.env.GITHUB_EVENT_PATH} does not exist${os_1.EOL}`);
  2636. }
  2637. }
  2638. this.eventName = process.env.GITHUB_EVENT_NAME;
  2639. this.sha = process.env.GITHUB_SHA;
  2640. this.ref = process.env.GITHUB_REF;
  2641. this.workflow = process.env.GITHUB_WORKFLOW;
  2642. this.action = process.env.GITHUB_ACTION;
  2643. this.actor = process.env.GITHUB_ACTOR;
  2644. }
  2645. get issue() {
  2646. const payload = this.payload;
  2647. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2648. }
  2649. get repo() {
  2650. if (process.env.GITHUB_REPOSITORY) {
  2651. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2652. return { owner, repo };
  2653. }
  2654. if (this.payload.repository) {
  2655. return {
  2656. owner: this.payload.repository.owner.login,
  2657. repo: this.payload.repository.name
  2658. };
  2659. }
  2660. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2661. }
  2662. }
  2663. exports.Context = Context;
  2664. //# sourceMappingURL=context.js.map
  2665. /***/ }),
  2666. /***/ 265:
  2667. /***/ (function(module, __unusedexports, __webpack_require__) {
  2668. module.exports = getPage
  2669. const deprecate = __webpack_require__(370)
  2670. const getPageLinks = __webpack_require__(577)
  2671. const HttpError = __webpack_require__(297)
  2672. function getPage (octokit, link, which, headers) {
  2673. 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.`)
  2674. const url = getPageLinks(link)[which]
  2675. if (!url) {
  2676. const urlError = new HttpError(`No ${which} page found`, 404)
  2677. return Promise.reject(urlError)
  2678. }
  2679. const requestOptions = {
  2680. url,
  2681. headers: applyAcceptHeader(link, headers)
  2682. }
  2683. const promise = octokit.request(requestOptions)
  2684. return promise
  2685. }
  2686. function applyAcceptHeader (res, headers) {
  2687. const previous = res.headers && res.headers['x-github-media-type']
  2688. if (!previous || (headers && headers.accept)) {
  2689. return headers
  2690. }
  2691. headers = headers || {}
  2692. headers.accept = 'application/vnd.' + previous
  2693. .replace('; param=', '.')
  2694. .replace('; format=', '+')
  2695. return headers
  2696. }
  2697. /***/ }),
  2698. /***/ 280:
  2699. /***/ (function(module, exports) {
  2700. exports = module.exports = SemVer
  2701. var debug
  2702. /* istanbul ignore next */
  2703. if (typeof process === 'object' &&
  2704. process.env &&
  2705. process.env.NODE_DEBUG &&
  2706. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2707. debug = function () {
  2708. var args = Array.prototype.slice.call(arguments, 0)
  2709. args.unshift('SEMVER')
  2710. console.log.apply(console, args)
  2711. }
  2712. } else {
  2713. debug = function () {}
  2714. }
  2715. // Note: this is the semver.org version of the spec that it implements
  2716. // Not necessarily the package version of this code.
  2717. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2718. var MAX_LENGTH = 256
  2719. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2720. /* istanbul ignore next */ 9007199254740991
  2721. // Max safe segment length for coercion.
  2722. var MAX_SAFE_COMPONENT_LENGTH = 16
  2723. // The actual regexps go on exports.re
  2724. var re = exports.re = []
  2725. var src = exports.src = []
  2726. var R = 0
  2727. // The following Regular Expressions can be used for tokenizing,
  2728. // validating, and parsing SemVer version strings.
  2729. // ## Numeric Identifier
  2730. // A single `0`, or a non-zero digit followed by zero or more digits.
  2731. var NUMERICIDENTIFIER = R++
  2732. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2733. var NUMERICIDENTIFIERLOOSE = R++
  2734. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2735. // ## Non-numeric Identifier
  2736. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2737. // more letters, digits, or hyphens.
  2738. var NONNUMERICIDENTIFIER = R++
  2739. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2740. // ## Main Version
  2741. // Three dot-separated numeric identifiers.
  2742. var MAINVERSION = R++
  2743. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2744. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2745. '(' + src[NUMERICIDENTIFIER] + ')'
  2746. var MAINVERSIONLOOSE = R++
  2747. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2748. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2749. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2750. // ## Pre-release Version Identifier
  2751. // A numeric identifier, or a non-numeric identifier.
  2752. var PRERELEASEIDENTIFIER = R++
  2753. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2754. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2755. var PRERELEASEIDENTIFIERLOOSE = R++
  2756. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2757. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2758. // ## Pre-release Version
  2759. // Hyphen, followed by one or more dot-separated pre-release version
  2760. // identifiers.
  2761. var PRERELEASE = R++
  2762. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2763. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2764. var PRERELEASELOOSE = R++
  2765. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2766. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2767. // ## Build Metadata Identifier
  2768. // Any combination of digits, letters, or hyphens.
  2769. var BUILDIDENTIFIER = R++
  2770. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2771. // ## Build Metadata
  2772. // Plus sign, followed by one or more period-separated build metadata
  2773. // identifiers.
  2774. var BUILD = R++
  2775. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2776. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2777. // ## Full Version String
  2778. // A main version, followed optionally by a pre-release version and
  2779. // build metadata.
  2780. // Note that the only major, minor, patch, and pre-release sections of
  2781. // the version string are capturing groups. The build metadata is not a
  2782. // capturing group, because it should not ever be used in version
  2783. // comparison.
  2784. var FULL = R++
  2785. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2786. src[PRERELEASE] + '?' +
  2787. src[BUILD] + '?'
  2788. src[FULL] = '^' + FULLPLAIN + '$'
  2789. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2790. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2791. // common in the npm registry.
  2792. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2793. src[PRERELEASELOOSE] + '?' +
  2794. src[BUILD] + '?'
  2795. var LOOSE = R++
  2796. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2797. var GTLT = R++
  2798. src[GTLT] = '((?:<|>)?=?)'
  2799. // Something like "2.*" or "1.2.x".
  2800. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2801. // Only the first item is strictly required.
  2802. var XRANGEIDENTIFIERLOOSE = R++
  2803. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2804. var XRANGEIDENTIFIER = R++
  2805. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2806. var XRANGEPLAIN = R++
  2807. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2808. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2809. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2810. '(?:' + src[PRERELEASE] + ')?' +
  2811. src[BUILD] + '?' +
  2812. ')?)?'
  2813. var XRANGEPLAINLOOSE = R++
  2814. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2815. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2816. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2817. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2818. src[BUILD] + '?' +
  2819. ')?)?'
  2820. var XRANGE = R++
  2821. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2822. var XRANGELOOSE = R++
  2823. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2824. // Coercion.
  2825. // Extract anything that could conceivably be a part of a valid semver
  2826. var COERCE = R++
  2827. src[COERCE] = '(?:^|[^\\d])' +
  2828. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2829. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2830. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2831. '(?:$|[^\\d])'
  2832. // Tilde ranges.
  2833. // Meaning is "reasonably at or greater than"
  2834. var LONETILDE = R++
  2835. src[LONETILDE] = '(?:~>?)'
  2836. var TILDETRIM = R++
  2837. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2838. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2839. var tildeTrimReplace = '$1~'
  2840. var TILDE = R++
  2841. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2842. var TILDELOOSE = R++
  2843. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2844. // Caret ranges.
  2845. // Meaning is "at least and backwards compatible with"
  2846. var LONECARET = R++
  2847. src[LONECARET] = '(?:\\^)'
  2848. var CARETTRIM = R++
  2849. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2850. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2851. var caretTrimReplace = '$1^'
  2852. var CARET = R++
  2853. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2854. var CARETLOOSE = R++
  2855. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2856. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2857. var COMPARATORLOOSE = R++
  2858. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2859. var COMPARATOR = R++
  2860. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2861. // An expression to strip any whitespace between the gtlt and the thing
  2862. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2863. var COMPARATORTRIM = R++
  2864. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2865. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2866. // this one has to use the /g flag
  2867. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2868. var comparatorTrimReplace = '$1$2$3'
  2869. // Something like `1.2.3 - 1.2.4`
  2870. // Note that these all use the loose form, because they'll be
  2871. // checked against either the strict or loose comparator form
  2872. // later.
  2873. var HYPHENRANGE = R++
  2874. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  2875. '\\s+-\\s+' +
  2876. '(' + src[XRANGEPLAIN] + ')' +
  2877. '\\s*$'
  2878. var HYPHENRANGELOOSE = R++
  2879. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  2880. '\\s+-\\s+' +
  2881. '(' + src[XRANGEPLAINLOOSE] + ')' +
  2882. '\\s*$'
  2883. // Star ranges basically just allow anything at all.
  2884. var STAR = R++
  2885. src[STAR] = '(<|>)?=?\\s*\\*'
  2886. // Compile to actual regexp objects.
  2887. // All are flag-free, unless they were created above with a flag.
  2888. for (var i = 0; i < R; i++) {
  2889. debug(i, src[i])
  2890. if (!re[i]) {
  2891. re[i] = new RegExp(src[i])
  2892. }
  2893. }
  2894. exports.parse = parse
  2895. function parse (version, options) {
  2896. if (!options || typeof options !== 'object') {
  2897. options = {
  2898. loose: !!options,
  2899. includePrerelease: false
  2900. }
  2901. }
  2902. if (version instanceof SemVer) {
  2903. return version
  2904. }
  2905. if (typeof version !== 'string') {
  2906. return null
  2907. }
  2908. if (version.length > MAX_LENGTH) {
  2909. return null
  2910. }
  2911. var r = options.loose ? re[LOOSE] : re[FULL]
  2912. if (!r.test(version)) {
  2913. return null
  2914. }
  2915. try {
  2916. return new SemVer(version, options)
  2917. } catch (er) {
  2918. return null
  2919. }
  2920. }
  2921. exports.valid = valid
  2922. function valid (version, options) {
  2923. var v = parse(version, options)
  2924. return v ? v.version : null
  2925. }
  2926. exports.clean = clean
  2927. function clean (version, options) {
  2928. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  2929. return s ? s.version : null
  2930. }
  2931. exports.SemVer = SemVer
  2932. function SemVer (version, options) {
  2933. if (!options || typeof options !== 'object') {
  2934. options = {
  2935. loose: !!options,
  2936. includePrerelease: false
  2937. }
  2938. }
  2939. if (version instanceof SemVer) {
  2940. if (version.loose === options.loose) {
  2941. return version
  2942. } else {
  2943. version = version.version
  2944. }
  2945. } else if (typeof version !== 'string') {
  2946. throw new TypeError('Invalid Version: ' + version)
  2947. }
  2948. if (version.length > MAX_LENGTH) {
  2949. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  2950. }
  2951. if (!(this instanceof SemVer)) {
  2952. return new SemVer(version, options)
  2953. }
  2954. debug('SemVer', version, options)
  2955. this.options = options
  2956. this.loose = !!options.loose
  2957. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  2958. if (!m) {
  2959. throw new TypeError('Invalid Version: ' + version)
  2960. }
  2961. this.raw = version
  2962. // these are actually numbers
  2963. this.major = +m[1]
  2964. this.minor = +m[2]
  2965. this.patch = +m[3]
  2966. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  2967. throw new TypeError('Invalid major version')
  2968. }
  2969. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  2970. throw new TypeError('Invalid minor version')
  2971. }
  2972. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  2973. throw new TypeError('Invalid patch version')
  2974. }
  2975. // numberify any prerelease numeric ids
  2976. if (!m[4]) {
  2977. this.prerelease = []
  2978. } else {
  2979. this.prerelease = m[4].split('.').map(function (id) {
  2980. if (/^[0-9]+$/.test(id)) {
  2981. var num = +id
  2982. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  2983. return num
  2984. }
  2985. }
  2986. return id
  2987. })
  2988. }
  2989. this.build = m[5] ? m[5].split('.') : []
  2990. this.format()
  2991. }
  2992. SemVer.prototype.format = function () {
  2993. this.version = this.major + '.' + this.minor + '.' + this.patch
  2994. if (this.prerelease.length) {
  2995. this.version += '-' + this.prerelease.join('.')
  2996. }
  2997. return this.version
  2998. }
  2999. SemVer.prototype.toString = function () {
  3000. return this.version
  3001. }
  3002. SemVer.prototype.compare = function (other) {
  3003. debug('SemVer.compare', this.version, this.options, other)
  3004. if (!(other instanceof SemVer)) {
  3005. other = new SemVer(other, this.options)
  3006. }
  3007. return this.compareMain(other) || this.comparePre(other)
  3008. }
  3009. SemVer.prototype.compareMain = function (other) {
  3010. if (!(other instanceof SemVer)) {
  3011. other = new SemVer(other, this.options)
  3012. }
  3013. return compareIdentifiers(this.major, other.major) ||
  3014. compareIdentifiers(this.minor, other.minor) ||
  3015. compareIdentifiers(this.patch, other.patch)
  3016. }
  3017. SemVer.prototype.comparePre = function (other) {
  3018. if (!(other instanceof SemVer)) {
  3019. other = new SemVer(other, this.options)
  3020. }
  3021. // NOT having a prerelease is > having one
  3022. if (this.prerelease.length && !other.prerelease.length) {
  3023. return -1
  3024. } else if (!this.prerelease.length && other.prerelease.length) {
  3025. return 1
  3026. } else if (!this.prerelease.length && !other.prerelease.length) {
  3027. return 0
  3028. }
  3029. var i = 0
  3030. do {
  3031. var a = this.prerelease[i]
  3032. var b = other.prerelease[i]
  3033. debug('prerelease compare', i, a, b)
  3034. if (a === undefined && b === undefined) {
  3035. return 0
  3036. } else if (b === undefined) {
  3037. return 1
  3038. } else if (a === undefined) {
  3039. return -1
  3040. } else if (a === b) {
  3041. continue
  3042. } else {
  3043. return compareIdentifiers(a, b)
  3044. }
  3045. } while (++i)
  3046. }
  3047. // preminor will bump the version up to the next minor release, and immediately
  3048. // down to pre-release. premajor and prepatch work the same way.
  3049. SemVer.prototype.inc = function (release, identifier) {
  3050. switch (release) {
  3051. case 'premajor':
  3052. this.prerelease.length = 0
  3053. this.patch = 0
  3054. this.minor = 0
  3055. this.major++
  3056. this.inc('pre', identifier)
  3057. break
  3058. case 'preminor':
  3059. this.prerelease.length = 0
  3060. this.patch = 0
  3061. this.minor++
  3062. this.inc('pre', identifier)
  3063. break
  3064. case 'prepatch':
  3065. // If this is already a prerelease, it will bump to the next version
  3066. // drop any prereleases that might already exist, since they are not
  3067. // relevant at this point.
  3068. this.prerelease.length = 0
  3069. this.inc('patch', identifier)
  3070. this.inc('pre', identifier)
  3071. break
  3072. // If the input is a non-prerelease version, this acts the same as
  3073. // prepatch.
  3074. case 'prerelease':
  3075. if (this.prerelease.length === 0) {
  3076. this.inc('patch', identifier)
  3077. }
  3078. this.inc('pre', identifier)
  3079. break
  3080. case 'major':
  3081. // If this is a pre-major version, bump up to the same major version.
  3082. // Otherwise increment major.
  3083. // 1.0.0-5 bumps to 1.0.0
  3084. // 1.1.0 bumps to 2.0.0
  3085. if (this.minor !== 0 ||
  3086. this.patch !== 0 ||
  3087. this.prerelease.length === 0) {
  3088. this.major++
  3089. }
  3090. this.minor = 0
  3091. this.patch = 0
  3092. this.prerelease = []
  3093. break
  3094. case 'minor':
  3095. // If this is a pre-minor version, bump up to the same minor version.
  3096. // Otherwise increment minor.
  3097. // 1.2.0-5 bumps to 1.2.0
  3098. // 1.2.1 bumps to 1.3.0
  3099. if (this.patch !== 0 || this.prerelease.length === 0) {
  3100. this.minor++
  3101. }
  3102. this.patch = 0
  3103. this.prerelease = []
  3104. break
  3105. case 'patch':
  3106. // If this is not a pre-release version, it will increment the patch.
  3107. // If it is a pre-release it will bump up to the same patch version.
  3108. // 1.2.0-5 patches to 1.2.0
  3109. // 1.2.0 patches to 1.2.1
  3110. if (this.prerelease.length === 0) {
  3111. this.patch++
  3112. }
  3113. this.prerelease = []
  3114. break
  3115. // This probably shouldn't be used publicly.
  3116. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3117. case 'pre':
  3118. if (this.prerelease.length === 0) {
  3119. this.prerelease = [0]
  3120. } else {
  3121. var i = this.prerelease.length
  3122. while (--i >= 0) {
  3123. if (typeof this.prerelease[i] === 'number') {
  3124. this.prerelease[i]++
  3125. i = -2
  3126. }
  3127. }
  3128. if (i === -1) {
  3129. // didn't increment anything
  3130. this.prerelease.push(0)
  3131. }
  3132. }
  3133. if (identifier) {
  3134. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3135. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3136. if (this.prerelease[0] === identifier) {
  3137. if (isNaN(this.prerelease[1])) {
  3138. this.prerelease = [identifier, 0]
  3139. }
  3140. } else {
  3141. this.prerelease = [identifier, 0]
  3142. }
  3143. }
  3144. break
  3145. default:
  3146. throw new Error('invalid increment argument: ' + release)
  3147. }
  3148. this.format()
  3149. this.raw = this.version
  3150. return this
  3151. }
  3152. exports.inc = inc
  3153. function inc (version, release, loose, identifier) {
  3154. if (typeof (loose) === 'string') {
  3155. identifier = loose
  3156. loose = undefined
  3157. }
  3158. try {
  3159. return new SemVer(version, loose).inc(release, identifier).version
  3160. } catch (er) {
  3161. return null
  3162. }
  3163. }
  3164. exports.diff = diff
  3165. function diff (version1, version2) {
  3166. if (eq(version1, version2)) {
  3167. return null
  3168. } else {
  3169. var v1 = parse(version1)
  3170. var v2 = parse(version2)
  3171. var prefix = ''
  3172. if (v1.prerelease.length || v2.prerelease.length) {
  3173. prefix = 'pre'
  3174. var defaultResult = 'prerelease'
  3175. }
  3176. for (var key in v1) {
  3177. if (key === 'major' || key === 'minor' || key === 'patch') {
  3178. if (v1[key] !== v2[key]) {
  3179. return prefix + key
  3180. }
  3181. }
  3182. }
  3183. return defaultResult // may be undefined
  3184. }
  3185. }
  3186. exports.compareIdentifiers = compareIdentifiers
  3187. var numeric = /^[0-9]+$/
  3188. function compareIdentifiers (a, b) {
  3189. var anum = numeric.test(a)
  3190. var bnum = numeric.test(b)
  3191. if (anum && bnum) {
  3192. a = +a
  3193. b = +b
  3194. }
  3195. return a === b ? 0
  3196. : (anum && !bnum) ? -1
  3197. : (bnum && !anum) ? 1
  3198. : a < b ? -1
  3199. : 1
  3200. }
  3201. exports.rcompareIdentifiers = rcompareIdentifiers
  3202. function rcompareIdentifiers (a, b) {
  3203. return compareIdentifiers(b, a)
  3204. }
  3205. exports.major = major
  3206. function major (a, loose) {
  3207. return new SemVer(a, loose).major
  3208. }
  3209. exports.minor = minor
  3210. function minor (a, loose) {
  3211. return new SemVer(a, loose).minor
  3212. }
  3213. exports.patch = patch
  3214. function patch (a, loose) {
  3215. return new SemVer(a, loose).patch
  3216. }
  3217. exports.compare = compare
  3218. function compare (a, b, loose) {
  3219. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3220. }
  3221. exports.compareLoose = compareLoose
  3222. function compareLoose (a, b) {
  3223. return compare(a, b, true)
  3224. }
  3225. exports.rcompare = rcompare
  3226. function rcompare (a, b, loose) {
  3227. return compare(b, a, loose)
  3228. }
  3229. exports.sort = sort
  3230. function sort (list, loose) {
  3231. return list.sort(function (a, b) {
  3232. return exports.compare(a, b, loose)
  3233. })
  3234. }
  3235. exports.rsort = rsort
  3236. function rsort (list, loose) {
  3237. return list.sort(function (a, b) {
  3238. return exports.rcompare(a, b, loose)
  3239. })
  3240. }
  3241. exports.gt = gt
  3242. function gt (a, b, loose) {
  3243. return compare(a, b, loose) > 0
  3244. }
  3245. exports.lt = lt
  3246. function lt (a, b, loose) {
  3247. return compare(a, b, loose) < 0
  3248. }
  3249. exports.eq = eq
  3250. function eq (a, b, loose) {
  3251. return compare(a, b, loose) === 0
  3252. }
  3253. exports.neq = neq
  3254. function neq (a, b, loose) {
  3255. return compare(a, b, loose) !== 0
  3256. }
  3257. exports.gte = gte
  3258. function gte (a, b, loose) {
  3259. return compare(a, b, loose) >= 0
  3260. }
  3261. exports.lte = lte
  3262. function lte (a, b, loose) {
  3263. return compare(a, b, loose) <= 0
  3264. }
  3265. exports.cmp = cmp
  3266. function cmp (a, op, b, loose) {
  3267. switch (op) {
  3268. case '===':
  3269. if (typeof a === 'object')
  3270. a = a.version
  3271. if (typeof b === 'object')
  3272. b = b.version
  3273. return a === b
  3274. case '!==':
  3275. if (typeof a === 'object')
  3276. a = a.version
  3277. if (typeof b === 'object')
  3278. b = b.version
  3279. return a !== b
  3280. case '':
  3281. case '=':
  3282. case '==':
  3283. return eq(a, b, loose)
  3284. case '!=':
  3285. return neq(a, b, loose)
  3286. case '>':
  3287. return gt(a, b, loose)
  3288. case '>=':
  3289. return gte(a, b, loose)
  3290. case '<':
  3291. return lt(a, b, loose)
  3292. case '<=':
  3293. return lte(a, b, loose)
  3294. default:
  3295. throw new TypeError('Invalid operator: ' + op)
  3296. }
  3297. }
  3298. exports.Comparator = Comparator
  3299. function Comparator (comp, options) {
  3300. if (!options || typeof options !== 'object') {
  3301. options = {
  3302. loose: !!options,
  3303. includePrerelease: false
  3304. }
  3305. }
  3306. if (comp instanceof Comparator) {
  3307. if (comp.loose === !!options.loose) {
  3308. return comp
  3309. } else {
  3310. comp = comp.value
  3311. }
  3312. }
  3313. if (!(this instanceof Comparator)) {
  3314. return new Comparator(comp, options)
  3315. }
  3316. debug('comparator', comp, options)
  3317. this.options = options
  3318. this.loose = !!options.loose
  3319. this.parse(comp)
  3320. if (this.semver === ANY) {
  3321. this.value = ''
  3322. } else {
  3323. this.value = this.operator + this.semver.version
  3324. }
  3325. debug('comp', this)
  3326. }
  3327. var ANY = {}
  3328. Comparator.prototype.parse = function (comp) {
  3329. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3330. var m = comp.match(r)
  3331. if (!m) {
  3332. throw new TypeError('Invalid comparator: ' + comp)
  3333. }
  3334. this.operator = m[1]
  3335. if (this.operator === '=') {
  3336. this.operator = ''
  3337. }
  3338. // if it literally is just '>' or '' then allow anything.
  3339. if (!m[2]) {
  3340. this.semver = ANY
  3341. } else {
  3342. this.semver = new SemVer(m[2], this.options.loose)
  3343. }
  3344. }
  3345. Comparator.prototype.toString = function () {
  3346. return this.value
  3347. }
  3348. Comparator.prototype.test = function (version) {
  3349. debug('Comparator.test', version, this.options.loose)
  3350. if (this.semver === ANY) {
  3351. return true
  3352. }
  3353. if (typeof version === 'string') {
  3354. version = new SemVer(version, this.options)
  3355. }
  3356. return cmp(version, this.operator, this.semver, this.options)
  3357. }
  3358. Comparator.prototype.intersects = function (comp, options) {
  3359. if (!(comp instanceof Comparator)) {
  3360. throw new TypeError('a Comparator is required')
  3361. }
  3362. if (!options || typeof options !== 'object') {
  3363. options = {
  3364. loose: !!options,
  3365. includePrerelease: false
  3366. }
  3367. }
  3368. var rangeTmp
  3369. if (this.operator === '') {
  3370. rangeTmp = new Range(comp.value, options)
  3371. return satisfies(this.value, rangeTmp, options)
  3372. } else if (comp.operator === '') {
  3373. rangeTmp = new Range(this.value, options)
  3374. return satisfies(comp.semver, rangeTmp, options)
  3375. }
  3376. var sameDirectionIncreasing =
  3377. (this.operator === '>=' || this.operator === '>') &&
  3378. (comp.operator === '>=' || comp.operator === '>')
  3379. var sameDirectionDecreasing =
  3380. (this.operator === '<=' || this.operator === '<') &&
  3381. (comp.operator === '<=' || comp.operator === '<')
  3382. var sameSemVer = this.semver.version === comp.semver.version
  3383. var differentDirectionsInclusive =
  3384. (this.operator === '>=' || this.operator === '<=') &&
  3385. (comp.operator === '>=' || comp.operator === '<=')
  3386. var oppositeDirectionsLessThan =
  3387. cmp(this.semver, '<', comp.semver, options) &&
  3388. ((this.operator === '>=' || this.operator === '>') &&
  3389. (comp.operator === '<=' || comp.operator === '<'))
  3390. var oppositeDirectionsGreaterThan =
  3391. cmp(this.semver, '>', comp.semver, options) &&
  3392. ((this.operator === '<=' || this.operator === '<') &&
  3393. (comp.operator === '>=' || comp.operator === '>'))
  3394. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3395. (sameSemVer && differentDirectionsInclusive) ||
  3396. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3397. }
  3398. exports.Range = Range
  3399. function Range (range, options) {
  3400. if (!options || typeof options !== 'object') {
  3401. options = {
  3402. loose: !!options,
  3403. includePrerelease: false
  3404. }
  3405. }
  3406. if (range instanceof Range) {
  3407. if (range.loose === !!options.loose &&
  3408. range.includePrerelease === !!options.includePrerelease) {
  3409. return range
  3410. } else {
  3411. return new Range(range.raw, options)
  3412. }
  3413. }
  3414. if (range instanceof Comparator) {
  3415. return new Range(range.value, options)
  3416. }
  3417. if (!(this instanceof Range)) {
  3418. return new Range(range, options)
  3419. }
  3420. this.options = options
  3421. this.loose = !!options.loose
  3422. this.includePrerelease = !!options.includePrerelease
  3423. // First, split based on boolean or ||
  3424. this.raw = range
  3425. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3426. return this.parseRange(range.trim())
  3427. }, this).filter(function (c) {
  3428. // throw out any that are not relevant for whatever reason
  3429. return c.length
  3430. })
  3431. if (!this.set.length) {
  3432. throw new TypeError('Invalid SemVer Range: ' + range)
  3433. }
  3434. this.format()
  3435. }
  3436. Range.prototype.format = function () {
  3437. this.range = this.set.map(function (comps) {
  3438. return comps.join(' ').trim()
  3439. }).join('||').trim()
  3440. return this.range
  3441. }
  3442. Range.prototype.toString = function () {
  3443. return this.range
  3444. }
  3445. Range.prototype.parseRange = function (range) {
  3446. var loose = this.options.loose
  3447. range = range.trim()
  3448. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3449. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3450. range = range.replace(hr, hyphenReplace)
  3451. debug('hyphen replace', range)
  3452. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3453. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3454. debug('comparator trim', range, re[COMPARATORTRIM])
  3455. // `~ 1.2.3` => `~1.2.3`
  3456. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3457. // `^ 1.2.3` => `^1.2.3`
  3458. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3459. // normalize spaces
  3460. range = range.split(/\s+/).join(' ')
  3461. // At this point, the range is completely trimmed and
  3462. // ready to be split into comparators.
  3463. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3464. var set = range.split(' ').map(function (comp) {
  3465. return parseComparator(comp, this.options)
  3466. }, this).join(' ').split(/\s+/)
  3467. if (this.options.loose) {
  3468. // in loose mode, throw out any that are not valid comparators
  3469. set = set.filter(function (comp) {
  3470. return !!comp.match(compRe)
  3471. })
  3472. }
  3473. set = set.map(function (comp) {
  3474. return new Comparator(comp, this.options)
  3475. }, this)
  3476. return set
  3477. }
  3478. Range.prototype.intersects = function (range, options) {
  3479. if (!(range instanceof Range)) {
  3480. throw new TypeError('a Range is required')
  3481. }
  3482. return this.set.some(function (thisComparators) {
  3483. return thisComparators.every(function (thisComparator) {
  3484. return range.set.some(function (rangeComparators) {
  3485. return rangeComparators.every(function (rangeComparator) {
  3486. return thisComparator.intersects(rangeComparator, options)
  3487. })
  3488. })
  3489. })
  3490. })
  3491. }
  3492. // Mostly just for testing and legacy API reasons
  3493. exports.toComparators = toComparators
  3494. function toComparators (range, options) {
  3495. return new Range(range, options).set.map(function (comp) {
  3496. return comp.map(function (c) {
  3497. return c.value
  3498. }).join(' ').trim().split(' ')
  3499. })
  3500. }
  3501. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3502. // already replaced the hyphen ranges
  3503. // turn into a set of JUST comparators.
  3504. function parseComparator (comp, options) {
  3505. debug('comp', comp, options)
  3506. comp = replaceCarets(comp, options)
  3507. debug('caret', comp)
  3508. comp = replaceTildes(comp, options)
  3509. debug('tildes', comp)
  3510. comp = replaceXRanges(comp, options)
  3511. debug('xrange', comp)
  3512. comp = replaceStars(comp, options)
  3513. debug('stars', comp)
  3514. return comp
  3515. }
  3516. function isX (id) {
  3517. return !id || id.toLowerCase() === 'x' || id === '*'
  3518. }
  3519. // ~, ~> --> * (any, kinda silly)
  3520. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3521. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3522. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3523. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3524. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3525. function replaceTildes (comp, options) {
  3526. return comp.trim().split(/\s+/).map(function (comp) {
  3527. return replaceTilde(comp, options)
  3528. }).join(' ')
  3529. }
  3530. function replaceTilde (comp, options) {
  3531. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3532. return comp.replace(r, function (_, M, m, p, pr) {
  3533. debug('tilde', comp, _, M, m, p, pr)
  3534. var ret
  3535. if (isX(M)) {
  3536. ret = ''
  3537. } else if (isX(m)) {
  3538. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3539. } else if (isX(p)) {
  3540. // ~1.2 == >=1.2.0 <1.3.0
  3541. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3542. } else if (pr) {
  3543. debug('replaceTilde pr', pr)
  3544. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3545. ' <' + M + '.' + (+m + 1) + '.0'
  3546. } else {
  3547. // ~1.2.3 == >=1.2.3 <1.3.0
  3548. ret = '>=' + M + '.' + m + '.' + p +
  3549. ' <' + M + '.' + (+m + 1) + '.0'
  3550. }
  3551. debug('tilde return', ret)
  3552. return ret
  3553. })
  3554. }
  3555. // ^ --> * (any, kinda silly)
  3556. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3557. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3558. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3559. // ^1.2.3 --> >=1.2.3 <2.0.0
  3560. // ^1.2.0 --> >=1.2.0 <2.0.0
  3561. function replaceCarets (comp, options) {
  3562. return comp.trim().split(/\s+/).map(function (comp) {
  3563. return replaceCaret(comp, options)
  3564. }).join(' ')
  3565. }
  3566. function replaceCaret (comp, options) {
  3567. debug('caret', comp, options)
  3568. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3569. return comp.replace(r, function (_, M, m, p, pr) {
  3570. debug('caret', comp, _, M, m, p, pr)
  3571. var ret
  3572. if (isX(M)) {
  3573. ret = ''
  3574. } else if (isX(m)) {
  3575. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3576. } else if (isX(p)) {
  3577. if (M === '0') {
  3578. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3579. } else {
  3580. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3581. }
  3582. } else if (pr) {
  3583. debug('replaceCaret pr', pr)
  3584. if (M === '0') {
  3585. if (m === '0') {
  3586. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3587. ' <' + M + '.' + m + '.' + (+p + 1)
  3588. } else {
  3589. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3590. ' <' + M + '.' + (+m + 1) + '.0'
  3591. }
  3592. } else {
  3593. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3594. ' <' + (+M + 1) + '.0.0'
  3595. }
  3596. } else {
  3597. debug('no pr')
  3598. if (M === '0') {
  3599. if (m === '0') {
  3600. ret = '>=' + M + '.' + m + '.' + p +
  3601. ' <' + M + '.' + m + '.' + (+p + 1)
  3602. } else {
  3603. ret = '>=' + M + '.' + m + '.' + p +
  3604. ' <' + M + '.' + (+m + 1) + '.0'
  3605. }
  3606. } else {
  3607. ret = '>=' + M + '.' + m + '.' + p +
  3608. ' <' + (+M + 1) + '.0.0'
  3609. }
  3610. }
  3611. debug('caret return', ret)
  3612. return ret
  3613. })
  3614. }
  3615. function replaceXRanges (comp, options) {
  3616. debug('replaceXRanges', comp, options)
  3617. return comp.split(/\s+/).map(function (comp) {
  3618. return replaceXRange(comp, options)
  3619. }).join(' ')
  3620. }
  3621. function replaceXRange (comp, options) {
  3622. comp = comp.trim()
  3623. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3624. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3625. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3626. var xM = isX(M)
  3627. var xm = xM || isX(m)
  3628. var xp = xm || isX(p)
  3629. var anyX = xp
  3630. if (gtlt === '=' && anyX) {
  3631. gtlt = ''
  3632. }
  3633. if (xM) {
  3634. if (gtlt === '>' || gtlt === '<') {
  3635. // nothing is allowed
  3636. ret = '<0.0.0'
  3637. } else {
  3638. // nothing is forbidden
  3639. ret = '*'
  3640. }
  3641. } else if (gtlt && anyX) {
  3642. // we know patch is an x, because we have any x at all.
  3643. // replace X with 0
  3644. if (xm) {
  3645. m = 0
  3646. }
  3647. p = 0
  3648. if (gtlt === '>') {
  3649. // >1 => >=2.0.0
  3650. // >1.2 => >=1.3.0
  3651. // >1.2.3 => >= 1.2.4
  3652. gtlt = '>='
  3653. if (xm) {
  3654. M = +M + 1
  3655. m = 0
  3656. p = 0
  3657. } else {
  3658. m = +m + 1
  3659. p = 0
  3660. }
  3661. } else if (gtlt === '<=') {
  3662. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3663. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3664. gtlt = '<'
  3665. if (xm) {
  3666. M = +M + 1
  3667. } else {
  3668. m = +m + 1
  3669. }
  3670. }
  3671. ret = gtlt + M + '.' + m + '.' + p
  3672. } else if (xm) {
  3673. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3674. } else if (xp) {
  3675. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3676. }
  3677. debug('xRange return', ret)
  3678. return ret
  3679. })
  3680. }
  3681. // Because * is AND-ed with everything else in the comparator,
  3682. // and '' means "any version", just remove the *s entirely.
  3683. function replaceStars (comp, options) {
  3684. debug('replaceStars', comp, options)
  3685. // Looseness is ignored here. star is always as loose as it gets!
  3686. return comp.trim().replace(re[STAR], '')
  3687. }
  3688. // This function is passed to string.replace(re[HYPHENRANGE])
  3689. // M, m, patch, prerelease, build
  3690. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3691. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3692. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3693. function hyphenReplace ($0,
  3694. from, fM, fm, fp, fpr, fb,
  3695. to, tM, tm, tp, tpr, tb) {
  3696. if (isX(fM)) {
  3697. from = ''
  3698. } else if (isX(fm)) {
  3699. from = '>=' + fM + '.0.0'
  3700. } else if (isX(fp)) {
  3701. from = '>=' + fM + '.' + fm + '.0'
  3702. } else {
  3703. from = '>=' + from
  3704. }
  3705. if (isX(tM)) {
  3706. to = ''
  3707. } else if (isX(tm)) {
  3708. to = '<' + (+tM + 1) + '.0.0'
  3709. } else if (isX(tp)) {
  3710. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3711. } else if (tpr) {
  3712. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3713. } else {
  3714. to = '<=' + to
  3715. }
  3716. return (from + ' ' + to).trim()
  3717. }
  3718. // if ANY of the sets match ALL of its comparators, then pass
  3719. Range.prototype.test = function (version) {
  3720. if (!version) {
  3721. return false
  3722. }
  3723. if (typeof version === 'string') {
  3724. version = new SemVer(version, this.options)
  3725. }
  3726. for (var i = 0; i < this.set.length; i++) {
  3727. if (testSet(this.set[i], version, this.options)) {
  3728. return true
  3729. }
  3730. }
  3731. return false
  3732. }
  3733. function testSet (set, version, options) {
  3734. for (var i = 0; i < set.length; i++) {
  3735. if (!set[i].test(version)) {
  3736. return false
  3737. }
  3738. }
  3739. if (version.prerelease.length && !options.includePrerelease) {
  3740. // Find the set of versions that are allowed to have prereleases
  3741. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3742. // That should allow `1.2.3-pr.2` to pass.
  3743. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3744. // even though it's within the range set by the comparators.
  3745. for (i = 0; i < set.length; i++) {
  3746. debug(set[i].semver)
  3747. if (set[i].semver === ANY) {
  3748. continue
  3749. }
  3750. if (set[i].semver.prerelease.length > 0) {
  3751. var allowed = set[i].semver
  3752. if (allowed.major === version.major &&
  3753. allowed.minor === version.minor &&
  3754. allowed.patch === version.patch) {
  3755. return true
  3756. }
  3757. }
  3758. }
  3759. // Version has a -pre, but it's not one of the ones we like.
  3760. return false
  3761. }
  3762. return true
  3763. }
  3764. exports.satisfies = satisfies
  3765. function satisfies (version, range, options) {
  3766. try {
  3767. range = new Range(range, options)
  3768. } catch (er) {
  3769. return false
  3770. }
  3771. return range.test(version)
  3772. }
  3773. exports.maxSatisfying = maxSatisfying
  3774. function maxSatisfying (versions, range, options) {
  3775. var max = null
  3776. var maxSV = null
  3777. try {
  3778. var rangeObj = new Range(range, options)
  3779. } catch (er) {
  3780. return null
  3781. }
  3782. versions.forEach(function (v) {
  3783. if (rangeObj.test(v)) {
  3784. // satisfies(v, range, options)
  3785. if (!max || maxSV.compare(v) === -1) {
  3786. // compare(max, v, true)
  3787. max = v
  3788. maxSV = new SemVer(max, options)
  3789. }
  3790. }
  3791. })
  3792. return max
  3793. }
  3794. exports.minSatisfying = minSatisfying
  3795. function minSatisfying (versions, range, options) {
  3796. var min = null
  3797. var minSV = null
  3798. try {
  3799. var rangeObj = new Range(range, options)
  3800. } catch (er) {
  3801. return null
  3802. }
  3803. versions.forEach(function (v) {
  3804. if (rangeObj.test(v)) {
  3805. // satisfies(v, range, options)
  3806. if (!min || minSV.compare(v) === 1) {
  3807. // compare(min, v, true)
  3808. min = v
  3809. minSV = new SemVer(min, options)
  3810. }
  3811. }
  3812. })
  3813. return min
  3814. }
  3815. exports.minVersion = minVersion
  3816. function minVersion (range, loose) {
  3817. range = new Range(range, loose)
  3818. var minver = new SemVer('0.0.0')
  3819. if (range.test(minver)) {
  3820. return minver
  3821. }
  3822. minver = new SemVer('0.0.0-0')
  3823. if (range.test(minver)) {
  3824. return minver
  3825. }
  3826. minver = null
  3827. for (var i = 0; i < range.set.length; ++i) {
  3828. var comparators = range.set[i]
  3829. comparators.forEach(function (comparator) {
  3830. // Clone to avoid manipulating the comparator's semver object.
  3831. var compver = new SemVer(comparator.semver.version)
  3832. switch (comparator.operator) {
  3833. case '>':
  3834. if (compver.prerelease.length === 0) {
  3835. compver.patch++
  3836. } else {
  3837. compver.prerelease.push(0)
  3838. }
  3839. compver.raw = compver.format()
  3840. /* fallthrough */
  3841. case '':
  3842. case '>=':
  3843. if (!minver || gt(minver, compver)) {
  3844. minver = compver
  3845. }
  3846. break
  3847. case '<':
  3848. case '<=':
  3849. /* Ignore maximum versions */
  3850. break
  3851. /* istanbul ignore next */
  3852. default:
  3853. throw new Error('Unexpected operation: ' + comparator.operator)
  3854. }
  3855. })
  3856. }
  3857. if (minver && range.test(minver)) {
  3858. return minver
  3859. }
  3860. return null
  3861. }
  3862. exports.validRange = validRange
  3863. function validRange (range, options) {
  3864. try {
  3865. // Return '*' instead of '' so that truthiness works.
  3866. // This will throw if it's invalid anyway
  3867. return new Range(range, options).range || '*'
  3868. } catch (er) {
  3869. return null
  3870. }
  3871. }
  3872. // Determine if version is less than all the versions possible in the range
  3873. exports.ltr = ltr
  3874. function ltr (version, range, options) {
  3875. return outside(version, range, '<', options)
  3876. }
  3877. // Determine if version is greater than all the versions possible in the range.
  3878. exports.gtr = gtr
  3879. function gtr (version, range, options) {
  3880. return outside(version, range, '>', options)
  3881. }
  3882. exports.outside = outside
  3883. function outside (version, range, hilo, options) {
  3884. version = new SemVer(version, options)
  3885. range = new Range(range, options)
  3886. var gtfn, ltefn, ltfn, comp, ecomp
  3887. switch (hilo) {
  3888. case '>':
  3889. gtfn = gt
  3890. ltefn = lte
  3891. ltfn = lt
  3892. comp = '>'
  3893. ecomp = '>='
  3894. break
  3895. case '<':
  3896. gtfn = lt
  3897. ltefn = gte
  3898. ltfn = gt
  3899. comp = '<'
  3900. ecomp = '<='
  3901. break
  3902. default:
  3903. throw new TypeError('Must provide a hilo val of "<" or ">"')
  3904. }
  3905. // If it satisifes the range it is not outside
  3906. if (satisfies(version, range, options)) {
  3907. return false
  3908. }
  3909. // From now on, variable terms are as if we're in "gtr" mode.
  3910. // but note that everything is flipped for the "ltr" function.
  3911. for (var i = 0; i < range.set.length; ++i) {
  3912. var comparators = range.set[i]
  3913. var high = null
  3914. var low = null
  3915. comparators.forEach(function (comparator) {
  3916. if (comparator.semver === ANY) {
  3917. comparator = new Comparator('>=0.0.0')
  3918. }
  3919. high = high || comparator
  3920. low = low || comparator
  3921. if (gtfn(comparator.semver, high.semver, options)) {
  3922. high = comparator
  3923. } else if (ltfn(comparator.semver, low.semver, options)) {
  3924. low = comparator
  3925. }
  3926. })
  3927. // If the edge version comparator has a operator then our version
  3928. // isn't outside it
  3929. if (high.operator === comp || high.operator === ecomp) {
  3930. return false
  3931. }
  3932. // If the lowest version comparator has an operator and our version
  3933. // is less than it then it isn't higher than the range
  3934. if ((!low.operator || low.operator === comp) &&
  3935. ltefn(version, low.semver)) {
  3936. return false
  3937. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  3938. return false
  3939. }
  3940. }
  3941. return true
  3942. }
  3943. exports.prerelease = prerelease
  3944. function prerelease (version, options) {
  3945. var parsed = parse(version, options)
  3946. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  3947. }
  3948. exports.intersects = intersects
  3949. function intersects (r1, r2, options) {
  3950. r1 = new Range(r1, options)
  3951. r2 = new Range(r2, options)
  3952. return r1.intersects(r2)
  3953. }
  3954. exports.coerce = coerce
  3955. function coerce (version) {
  3956. if (version instanceof SemVer) {
  3957. return version
  3958. }
  3959. if (typeof version !== 'string') {
  3960. return null
  3961. }
  3962. var match = version.match(re[COERCE])
  3963. if (match == null) {
  3964. return null
  3965. }
  3966. return parse(match[1] +
  3967. '.' + (match[2] || '0') +
  3968. '.' + (match[3] || '0'))
  3969. }
  3970. /***/ }),
  3971. /***/ 289:
  3972. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3973. "use strict";
  3974. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3975. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3976. return new (P || (P = Promise))(function (resolve, reject) {
  3977. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3978. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3979. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3980. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3981. });
  3982. };
  3983. var __importStar = (this && this.__importStar) || function (mod) {
  3984. if (mod && mod.__esModule) return mod;
  3985. var result = {};
  3986. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  3987. result["default"] = mod;
  3988. return result;
  3989. };
  3990. Object.defineProperty(exports, "__esModule", { value: true });
  3991. const core = __importStar(__webpack_require__(470));
  3992. const exec = __importStar(__webpack_require__(986));
  3993. const fshelper = __importStar(__webpack_require__(618));
  3994. const io = __importStar(__webpack_require__(1));
  3995. const path = __importStar(__webpack_require__(622));
  3996. const git_version_1 = __webpack_require__(559);
  3997. function CreateCommandManager(workingDirectory, lfs) {
  3998. return __awaiter(this, void 0, void 0, function* () {
  3999. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4000. });
  4001. }
  4002. exports.CreateCommandManager = CreateCommandManager;
  4003. class GitCommandManager {
  4004. // Private constructor; use createCommandManager()
  4005. constructor() {
  4006. this.gitEnv = {
  4007. GIT_TERMINAL_PROMPT: '0',
  4008. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4009. };
  4010. this.gitPath = '';
  4011. this.lfs = false;
  4012. this.workingDirectory = '';
  4013. }
  4014. branchDelete(remote, branch) {
  4015. return __awaiter(this, void 0, void 0, function* () {
  4016. const args = ['branch', '--delete', '--force'];
  4017. if (remote) {
  4018. args.push('--remote');
  4019. }
  4020. args.push(branch);
  4021. yield this.execGit(args);
  4022. });
  4023. }
  4024. branchExists(remote, pattern) {
  4025. return __awaiter(this, void 0, void 0, function* () {
  4026. const args = ['branch', '--list'];
  4027. if (remote) {
  4028. args.push('--remote');
  4029. }
  4030. args.push(pattern);
  4031. const output = yield this.execGit(args);
  4032. return !!output.stdout.trim();
  4033. });
  4034. }
  4035. branchList(remote) {
  4036. return __awaiter(this, void 0, void 0, function* () {
  4037. const result = [];
  4038. // Note, this implementation uses "rev-parse --symbolic" because the output from
  4039. // "branch --list" is more difficult when in a detached HEAD state.
  4040. const args = ['rev-parse', '--symbolic'];
  4041. if (remote) {
  4042. args.push('--remotes=origin');
  4043. }
  4044. else {
  4045. args.push('--branches');
  4046. }
  4047. const output = yield this.execGit(args);
  4048. for (let branch of output.stdout.trim().split('\n')) {
  4049. branch = branch.trim();
  4050. if (branch) {
  4051. result.push(branch);
  4052. }
  4053. }
  4054. return result;
  4055. });
  4056. }
  4057. checkout(ref, startPoint) {
  4058. return __awaiter(this, void 0, void 0, function* () {
  4059. const args = ['checkout', '--progress', '--force'];
  4060. if (startPoint) {
  4061. args.push('-B', ref, startPoint);
  4062. }
  4063. else {
  4064. args.push(ref);
  4065. }
  4066. yield this.execGit(args);
  4067. });
  4068. }
  4069. checkoutDetach() {
  4070. return __awaiter(this, void 0, void 0, function* () {
  4071. const args = ['checkout', '--detach'];
  4072. yield this.execGit(args);
  4073. });
  4074. }
  4075. config(configKey, configValue) {
  4076. return __awaiter(this, void 0, void 0, function* () {
  4077. yield this.execGit(['config', configKey, configValue]);
  4078. });
  4079. }
  4080. configExists(configKey) {
  4081. return __awaiter(this, void 0, void 0, function* () {
  4082. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4083. return `\\${x}`;
  4084. });
  4085. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  4086. return output.exitCode === 0;
  4087. });
  4088. }
  4089. fetch(fetchDepth, refSpec) {
  4090. return __awaiter(this, void 0, void 0, function* () {
  4091. const args = [
  4092. '-c',
  4093. 'protocol.version=2',
  4094. 'fetch',
  4095. '--no-tags',
  4096. '--prune',
  4097. '--progress',
  4098. '--no-recurse-submodules'
  4099. ];
  4100. if (fetchDepth > 0) {
  4101. args.push(`--depth=${fetchDepth}`);
  4102. }
  4103. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4104. args.push('--unshallow');
  4105. }
  4106. args.push('origin');
  4107. for (const arg of refSpec) {
  4108. args.push(arg);
  4109. }
  4110. let attempt = 1;
  4111. const maxAttempts = 3;
  4112. while (attempt <= maxAttempts) {
  4113. const allowAllExitCodes = attempt < maxAttempts;
  4114. const output = yield this.execGit(args, allowAllExitCodes);
  4115. if (output.exitCode === 0) {
  4116. break;
  4117. }
  4118. const seconds = this.getRandomIntInclusive(1, 10);
  4119. core.warning(`Git fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4120. yield this.sleep(seconds * 1000);
  4121. attempt++;
  4122. }
  4123. });
  4124. }
  4125. getWorkingDirectory() {
  4126. return this.workingDirectory;
  4127. }
  4128. init() {
  4129. return __awaiter(this, void 0, void 0, function* () {
  4130. yield this.execGit(['init', this.workingDirectory]);
  4131. });
  4132. }
  4133. isDetached() {
  4134. return __awaiter(this, void 0, void 0, function* () {
  4135. // Note, this implementation uses "branch --show-current" because
  4136. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4137. // with nothing checked out.
  4138. const output = yield this.execGit(['branch', '--show-current']);
  4139. return output.stdout.trim() === '';
  4140. });
  4141. }
  4142. lfsFetch(ref) {
  4143. return __awaiter(this, void 0, void 0, function* () {
  4144. const args = ['lfs', 'fetch', 'origin', ref];
  4145. let attempt = 1;
  4146. const maxAttempts = 3;
  4147. while (attempt <= maxAttempts) {
  4148. const allowAllExitCodes = attempt < maxAttempts;
  4149. const output = yield this.execGit(args, allowAllExitCodes);
  4150. if (output.exitCode === 0) {
  4151. break;
  4152. }
  4153. const seconds = this.getRandomIntInclusive(1, 10);
  4154. core.warning(`Git lfs fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4155. yield this.sleep(seconds * 1000);
  4156. attempt++;
  4157. }
  4158. });
  4159. }
  4160. lfsInstall() {
  4161. return __awaiter(this, void 0, void 0, function* () {
  4162. yield this.execGit(['lfs', 'install', '--local']);
  4163. });
  4164. }
  4165. log1() {
  4166. return __awaiter(this, void 0, void 0, function* () {
  4167. yield this.execGit(['log', '-1']);
  4168. });
  4169. }
  4170. remoteAdd(remoteName, remoteUrl) {
  4171. return __awaiter(this, void 0, void 0, function* () {
  4172. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4173. });
  4174. }
  4175. tagExists(pattern) {
  4176. return __awaiter(this, void 0, void 0, function* () {
  4177. const output = yield this.execGit(['tag', '--list', pattern]);
  4178. return !!output.stdout.trim();
  4179. });
  4180. }
  4181. tryClean() {
  4182. return __awaiter(this, void 0, void 0, function* () {
  4183. const output = yield this.execGit(['clean', '-ffdx'], true);
  4184. return output.exitCode === 0;
  4185. });
  4186. }
  4187. tryConfigUnset(configKey) {
  4188. return __awaiter(this, void 0, void 0, function* () {
  4189. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4190. return output.exitCode === 0;
  4191. });
  4192. }
  4193. tryDisableAutomaticGarbageCollection() {
  4194. return __awaiter(this, void 0, void 0, function* () {
  4195. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4196. return output.exitCode === 0;
  4197. });
  4198. }
  4199. tryGetFetchUrl() {
  4200. return __awaiter(this, void 0, void 0, function* () {
  4201. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4202. if (output.exitCode !== 0) {
  4203. return '';
  4204. }
  4205. const stdout = output.stdout.trim();
  4206. if (stdout.includes('\n')) {
  4207. return '';
  4208. }
  4209. return stdout;
  4210. });
  4211. }
  4212. tryReset() {
  4213. return __awaiter(this, void 0, void 0, function* () {
  4214. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4215. return output.exitCode === 0;
  4216. });
  4217. }
  4218. static createCommandManager(workingDirectory, lfs) {
  4219. return __awaiter(this, void 0, void 0, function* () {
  4220. const result = new GitCommandManager();
  4221. yield result.initializeCommandManager(workingDirectory, lfs);
  4222. return result;
  4223. });
  4224. }
  4225. execGit(args, allowAllExitCodes = false) {
  4226. return __awaiter(this, void 0, void 0, function* () {
  4227. fshelper.directoryExistsSync(this.workingDirectory, true);
  4228. const result = new GitOutput();
  4229. const env = {};
  4230. for (const key of Object.keys(process.env)) {
  4231. env[key] = process.env[key];
  4232. }
  4233. for (const key of Object.keys(this.gitEnv)) {
  4234. env[key] = this.gitEnv[key];
  4235. }
  4236. const stdout = [];
  4237. const options = {
  4238. cwd: this.workingDirectory,
  4239. env,
  4240. ignoreReturnCode: allowAllExitCodes,
  4241. listeners: {
  4242. stdout: (data) => {
  4243. stdout.push(data.toString());
  4244. }
  4245. }
  4246. };
  4247. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4248. result.stdout = stdout.join('');
  4249. return result;
  4250. });
  4251. }
  4252. initializeCommandManager(workingDirectory, lfs) {
  4253. return __awaiter(this, void 0, void 0, function* () {
  4254. this.workingDirectory = workingDirectory;
  4255. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4256. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4257. this.lfs = lfs;
  4258. if (!this.lfs) {
  4259. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4260. }
  4261. this.gitPath = yield io.which('git', true);
  4262. // Git version
  4263. core.debug('Getting git version');
  4264. let gitVersion = new git_version_1.GitVersion();
  4265. let gitOutput = yield this.execGit(['version']);
  4266. let stdout = gitOutput.stdout.trim();
  4267. if (!stdout.includes('\n')) {
  4268. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4269. if (match) {
  4270. gitVersion = new git_version_1.GitVersion(match[0]);
  4271. }
  4272. }
  4273. if (!gitVersion.isValid()) {
  4274. throw new Error('Unable to determine git version');
  4275. }
  4276. // Minimum git version
  4277. // Note:
  4278. // - Auth header not supported before 2.9
  4279. // - Wire protocol v2 not supported before 2.18
  4280. const minimumGitVersion = new git_version_1.GitVersion('2.18');
  4281. if (!gitVersion.checkMinimum(minimumGitVersion)) {
  4282. throw new Error(`Minimum required git version is ${minimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4283. }
  4284. if (this.lfs) {
  4285. // Git-lfs version
  4286. core.debug('Getting git-lfs version');
  4287. let gitLfsVersion = new git_version_1.GitVersion();
  4288. const gitLfsPath = yield io.which('git-lfs', true);
  4289. gitOutput = yield this.execGit(['lfs', 'version']);
  4290. stdout = gitOutput.stdout.trim();
  4291. if (!stdout.includes('\n')) {
  4292. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4293. if (match) {
  4294. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4295. }
  4296. }
  4297. if (!gitLfsVersion.isValid()) {
  4298. throw new Error('Unable to determine git-lfs version');
  4299. }
  4300. // Minimum git-lfs version
  4301. // Note:
  4302. // - Auth header not supported before 2.1
  4303. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4304. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4305. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4306. }
  4307. }
  4308. // Set the user agent
  4309. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4310. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4311. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4312. });
  4313. }
  4314. getRandomIntInclusive(minimum, maximum) {
  4315. minimum = Math.floor(minimum);
  4316. maximum = Math.floor(maximum);
  4317. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  4318. }
  4319. sleep(milliseconds) {
  4320. return __awaiter(this, void 0, void 0, function* () {
  4321. return new Promise(resolve => setTimeout(resolve, milliseconds));
  4322. });
  4323. }
  4324. }
  4325. class GitOutput {
  4326. constructor() {
  4327. this.stdout = '';
  4328. this.exitCode = 0;
  4329. }
  4330. }
  4331. /***/ }),
  4332. /***/ 293:
  4333. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4334. "use strict";
  4335. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4336. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4337. return new (P || (P = Promise))(function (resolve, reject) {
  4338. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4339. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4340. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4341. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4342. });
  4343. };
  4344. var __importStar = (this && this.__importStar) || function (mod) {
  4345. if (mod && mod.__esModule) return mod;
  4346. var result = {};
  4347. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4348. result["default"] = mod;
  4349. return result;
  4350. };
  4351. Object.defineProperty(exports, "__esModule", { value: true });
  4352. const core = __importStar(__webpack_require__(470));
  4353. const coreCommand = __importStar(__webpack_require__(431));
  4354. const fs = __importStar(__webpack_require__(747));
  4355. const fsHelper = __importStar(__webpack_require__(618));
  4356. const gitCommandManager = __importStar(__webpack_require__(289));
  4357. const io = __importStar(__webpack_require__(1));
  4358. const path = __importStar(__webpack_require__(622));
  4359. const refHelper = __importStar(__webpack_require__(227));
  4360. const authConfigKey = `http.https://github.com/.extraheader`;
  4361. function getSource(settings) {
  4362. return __awaiter(this, void 0, void 0, function* () {
  4363. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4364. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4365. // Remove conflicting file path
  4366. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4367. yield io.rmRF(settings.repositoryPath);
  4368. }
  4369. // Create directory
  4370. let isExisting = true;
  4371. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4372. isExisting = false;
  4373. yield io.mkdirP(settings.repositoryPath);
  4374. }
  4375. // Git command manager
  4376. core.info(`Working directory is '${settings.repositoryPath}'`);
  4377. const git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4378. // Try prepare existing directory, otherwise recreate
  4379. if (isExisting &&
  4380. !(yield tryPrepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean))) {
  4381. // Delete the contents of the directory. Don't delete the directory itself
  4382. // since it may be the current working directory.
  4383. core.info(`Deleting the contents of '${settings.repositoryPath}'`);
  4384. for (const file of yield fs.promises.readdir(settings.repositoryPath)) {
  4385. yield io.rmRF(path.join(settings.repositoryPath, file));
  4386. }
  4387. }
  4388. // Initialize the repository
  4389. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4390. yield git.init();
  4391. yield git.remoteAdd('origin', repositoryUrl);
  4392. }
  4393. // Disable automatic garbage collection
  4394. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4395. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4396. }
  4397. // Remove possible previous extraheader
  4398. yield removeGitConfig(git, authConfigKey);
  4399. // Add extraheader (auth)
  4400. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4401. core.setSecret(base64Credentials);
  4402. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4403. yield git.config(authConfigKey, authConfigValue);
  4404. // LFS install
  4405. if (settings.lfs) {
  4406. yield git.lfsInstall();
  4407. }
  4408. // Fetch
  4409. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4410. yield git.fetch(settings.fetchDepth, refSpec);
  4411. // Checkout info
  4412. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4413. // LFS fetch
  4414. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4415. // Explicit lfs fetch will fetch lfs objects in parallel.
  4416. if (settings.lfs) {
  4417. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4418. }
  4419. // Checkout
  4420. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4421. // Dump some info about the checked out commit
  4422. yield git.log1();
  4423. // Set intra-task state for cleanup
  4424. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4425. });
  4426. }
  4427. exports.getSource = getSource;
  4428. function cleanup(repositoryPath) {
  4429. return __awaiter(this, void 0, void 0, function* () {
  4430. // Repo exists?
  4431. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4432. return;
  4433. }
  4434. fsHelper.directoryExistsSync(repositoryPath, true);
  4435. // Remove the config key
  4436. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4437. yield removeGitConfig(git, authConfigKey);
  4438. });
  4439. }
  4440. exports.cleanup = cleanup;
  4441. function tryPrepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4442. return __awaiter(this, void 0, void 0, function* () {
  4443. // Fetch URL does not match
  4444. if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4445. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4446. return false;
  4447. }
  4448. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4449. const lockPaths = [
  4450. path.join(repositoryPath, '.git', 'index.lock'),
  4451. path.join(repositoryPath, '.git', 'shallow.lock')
  4452. ];
  4453. for (const lockPath of lockPaths) {
  4454. try {
  4455. yield io.rmRF(lockPath);
  4456. }
  4457. catch (error) {
  4458. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4459. }
  4460. }
  4461. try {
  4462. // Checkout detached HEAD
  4463. if (!(yield git.isDetached())) {
  4464. yield git.checkoutDetach();
  4465. }
  4466. // Remove all refs/heads/*
  4467. let branches = yield git.branchList(false);
  4468. for (const branch of branches) {
  4469. yield git.branchDelete(false, branch);
  4470. }
  4471. // Remove all refs/remotes/origin/* to avoid conflicts
  4472. branches = yield git.branchList(true);
  4473. for (const branch of branches) {
  4474. yield git.branchDelete(true, branch);
  4475. }
  4476. }
  4477. catch (error) {
  4478. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4479. return false;
  4480. }
  4481. // Clean
  4482. if (clean) {
  4483. let succeeded = true;
  4484. if (!(yield git.tryClean())) {
  4485. 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}'.`);
  4486. succeeded = false;
  4487. }
  4488. else if (!(yield git.tryReset())) {
  4489. succeeded = false;
  4490. }
  4491. if (!succeeded) {
  4492. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4493. }
  4494. return succeeded;
  4495. }
  4496. return true;
  4497. });
  4498. }
  4499. function removeGitConfig(git, configKey) {
  4500. return __awaiter(this, void 0, void 0, function* () {
  4501. if ((yield git.configExists(configKey)) &&
  4502. !(yield git.tryConfigUnset(configKey))) {
  4503. // Load the config contents
  4504. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4505. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4506. fsHelper.fileExistsSync(configPath);
  4507. let contents = fs.readFileSync(configPath).toString() || '';
  4508. // Filter - only includes lines that do not contain the config key
  4509. const upperConfigKey = configKey.toUpperCase();
  4510. const split = contents
  4511. .split('\n')
  4512. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4513. contents = split.join('\n');
  4514. // Rewrite the config file
  4515. fs.writeFileSync(configPath, contents);
  4516. }
  4517. });
  4518. }
  4519. /***/ }),
  4520. /***/ 294:
  4521. /***/ (function(module, __unusedexports, __webpack_require__) {
  4522. module.exports = parseOptions;
  4523. const { Deprecation } = __webpack_require__(692);
  4524. const { getUserAgent } = __webpack_require__(619);
  4525. const once = __webpack_require__(969);
  4526. const pkg = __webpack_require__(215);
  4527. const deprecateOptionsTimeout = once((log, deprecation) =>
  4528. log.warn(deprecation)
  4529. );
  4530. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4531. const deprecateOptionsHeaders = once((log, deprecation) =>
  4532. log.warn(deprecation)
  4533. );
  4534. function parseOptions(options, log, hook) {
  4535. if (options.headers) {
  4536. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4537. newObj[key.toLowerCase()] = options.headers[key];
  4538. return newObj;
  4539. }, {});
  4540. }
  4541. const clientDefaults = {
  4542. headers: options.headers || {},
  4543. request: options.request || {},
  4544. mediaType: {
  4545. previews: [],
  4546. format: ""
  4547. }
  4548. };
  4549. if (options.baseUrl) {
  4550. clientDefaults.baseUrl = options.baseUrl;
  4551. }
  4552. if (options.userAgent) {
  4553. clientDefaults.headers["user-agent"] = options.userAgent;
  4554. }
  4555. if (options.previews) {
  4556. clientDefaults.mediaType.previews = options.previews;
  4557. }
  4558. if (options.timeZone) {
  4559. clientDefaults.headers["time-zone"] = options.timeZone;
  4560. }
  4561. if (options.timeout) {
  4562. deprecateOptionsTimeout(
  4563. log,
  4564. new Deprecation(
  4565. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4566. )
  4567. );
  4568. clientDefaults.request.timeout = options.timeout;
  4569. }
  4570. if (options.agent) {
  4571. deprecateOptionsAgent(
  4572. log,
  4573. new Deprecation(
  4574. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4575. )
  4576. );
  4577. clientDefaults.request.agent = options.agent;
  4578. }
  4579. if (options.headers) {
  4580. deprecateOptionsHeaders(
  4581. log,
  4582. new Deprecation(
  4583. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4584. )
  4585. );
  4586. }
  4587. const userAgentOption = clientDefaults.headers["user-agent"];
  4588. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4589. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4590. .filter(Boolean)
  4591. .join(" ");
  4592. clientDefaults.request.hook = hook.bind(null, "request");
  4593. return clientDefaults;
  4594. }
  4595. /***/ }),
  4596. /***/ 297:
  4597. /***/ (function(module) {
  4598. module.exports = class HttpError extends Error {
  4599. constructor (message, code, headers) {
  4600. super(message)
  4601. // Maintains proper stack trace (only available on V8)
  4602. /* istanbul ignore next */
  4603. if (Error.captureStackTrace) {
  4604. Error.captureStackTrace(this, this.constructor)
  4605. }
  4606. this.name = 'HttpError'
  4607. this.code = code
  4608. this.headers = headers
  4609. }
  4610. }
  4611. /***/ }),
  4612. /***/ 301:
  4613. /***/ (function(module, __unusedexports, __webpack_require__) {
  4614. /**
  4615. * Some “list” response that can be paginated have a different response structure
  4616. *
  4617. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4618. * /installation/repositories also has `repository_selection`), as well as a key with
  4619. * the list of the items which name varies from endpoint to endpoint:
  4620. *
  4621. * - https://developer.github.com/v3/search/#example (key `items`)
  4622. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4623. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4624. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4625. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4626. *
  4627. * Octokit normalizes these responses so that paginated results are always returned following
  4628. * the same structure. One challenge is that if the list response has only one page, no Link
  4629. * header is provided, so this header alone is not sufficient to check wether a response is
  4630. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4631. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4632. * property because it also exists in the response of Get the combined status for a specific ref.
  4633. */
  4634. module.exports = normalizePaginatedListResponse;
  4635. const { Deprecation } = __webpack_require__(692);
  4636. const once = __webpack_require__(969);
  4637. const deprecateIncompleteResults = once((log, deprecation) =>
  4638. log.warn(deprecation)
  4639. );
  4640. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4641. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4642. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4643. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4644. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4645. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4646. function normalizePaginatedListResponse(octokit, url, response) {
  4647. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4648. if (
  4649. !REGEX_IS_SEARCH_PATH.test(path) &&
  4650. !REGEX_IS_CHECKS_PATH.test(path) &&
  4651. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4652. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path)
  4653. ) {
  4654. return;
  4655. }
  4656. // keep the additional properties intact to avoid a breaking change,
  4657. // but log a deprecation warning when accessed
  4658. const incompleteResults = response.data.incomplete_results;
  4659. const repositorySelection = response.data.repository_selection;
  4660. const totalCount = response.data.total_count;
  4661. delete response.data.incomplete_results;
  4662. delete response.data.repository_selection;
  4663. delete response.data.total_count;
  4664. const namespaceKey = Object.keys(response.data)[0];
  4665. response.data = response.data[namespaceKey];
  4666. Object.defineProperty(response.data, namespaceKey, {
  4667. get() {
  4668. deprecateNamespace(
  4669. octokit.log,
  4670. new Deprecation(
  4671. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4672. )
  4673. );
  4674. return response.data;
  4675. }
  4676. });
  4677. if (typeof incompleteResults !== "undefined") {
  4678. Object.defineProperty(response.data, "incomplete_results", {
  4679. get() {
  4680. deprecateIncompleteResults(
  4681. octokit.log,
  4682. new Deprecation(
  4683. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4684. )
  4685. );
  4686. return incompleteResults;
  4687. }
  4688. });
  4689. }
  4690. if (typeof repositorySelection !== "undefined") {
  4691. Object.defineProperty(response.data, "repository_selection", {
  4692. get() {
  4693. deprecateTotalCount(
  4694. octokit.log,
  4695. new Deprecation(
  4696. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4697. )
  4698. );
  4699. return repositorySelection;
  4700. }
  4701. });
  4702. }
  4703. Object.defineProperty(response.data, "total_count", {
  4704. get() {
  4705. deprecateTotalCount(
  4706. octokit.log,
  4707. new Deprecation(
  4708. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4709. )
  4710. );
  4711. return totalCount;
  4712. }
  4713. });
  4714. }
  4715. /***/ }),
  4716. /***/ 309:
  4717. /***/ (function(module, __unusedexports, __webpack_require__) {
  4718. module.exports = octokitRestNormalizeGitReferenceResponses;
  4719. const { RequestError } = __webpack_require__(463);
  4720. function octokitRestNormalizeGitReferenceResponses(octokit) {
  4721. octokit.hook.wrap("request", (request, options) => {
  4722. const isGetOrListRefRequest = /\/repos\/:?\w+\/:?\w+\/git\/refs\/:?\w+/.test(
  4723. options.url
  4724. );
  4725. if (!isGetOrListRefRequest) {
  4726. return request(options);
  4727. }
  4728. const isGetRefRequest = "ref" in options;
  4729. return request(options)
  4730. .then(response => {
  4731. // request single reference
  4732. if (isGetRefRequest) {
  4733. if (Array.isArray(response.data)) {
  4734. throw new RequestError(
  4735. `More than one reference found for "${options.ref}"`,
  4736. 404,
  4737. {
  4738. request: options
  4739. }
  4740. );
  4741. }
  4742. // ✅ received single reference
  4743. return response;
  4744. }
  4745. // request list of references
  4746. if (!Array.isArray(response.data)) {
  4747. response.data = [response.data];
  4748. }
  4749. return response;
  4750. })
  4751. .catch(error => {
  4752. if (isGetRefRequest) {
  4753. throw error;
  4754. }
  4755. if (error.status === 404) {
  4756. return {
  4757. status: 200,
  4758. headers: error.headers,
  4759. data: []
  4760. };
  4761. }
  4762. throw error;
  4763. });
  4764. });
  4765. }
  4766. /***/ }),
  4767. /***/ 314:
  4768. /***/ (function(module) {
  4769. module.exports = {"name":"@octokit/graphql","version":"2.1.3","publishConfig":{"access":"public"},"description":"GitHub GraphQL API client for browsers and Node","main":"index.js","scripts":{"prebuild":"mkdirp dist/","build":"npm-run-all build:*","build:development":"webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json","build:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map","bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","pretest":"standard","test":"nyc mocha test/*-test.js","test:browser":"cypress run --browser chrome"},"repository":{"type":"git","url":"https://github.com/octokit/graphql.js.git"},"keywords":["octokit","github","api","graphql"],"author":"Gregor Martynus (https://github.com/gr2m)","license":"MIT","bugs":{"url":"https://github.com/octokit/graphql.js/issues"},"homepage":"https://github.com/octokit/graphql.js#readme","dependencies":{"@octokit/request":"^5.0.0","universal-user-agent":"^2.0.3"},"devDependencies":{"chai":"^4.2.0","compression-webpack-plugin":"^2.0.0","coveralls":"^3.0.3","cypress":"^3.1.5","fetch-mock":"^7.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","npm-run-all":"^4.1.3","nyc":"^14.0.0","semantic-release":"^15.13.3","simple-mock":"^0.8.0","standard":"^12.0.1","webpack":"^4.29.6","webpack-bundle-analyzer":"^3.1.0","webpack-cli":"^3.2.3"},"bundlesize":[{"path":"./dist/octokit-graphql.min.js.gz","maxSize":"5KB"}],"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"files":["lib"],"_resolved":"https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz","_integrity":"sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==","_from":"@octokit/graphql@2.1.3"};
  4770. /***/ }),
  4771. /***/ 323:
  4772. /***/ (function(module) {
  4773. "use strict";
  4774. var isStream = module.exports = function (stream) {
  4775. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4776. };
  4777. isStream.writable = function (stream) {
  4778. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4779. };
  4780. isStream.readable = function (stream) {
  4781. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4782. };
  4783. isStream.duplex = function (stream) {
  4784. return isStream.writable(stream) && isStream.readable(stream);
  4785. };
  4786. isStream.transform = function (stream) {
  4787. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4788. };
  4789. /***/ }),
  4790. /***/ 336:
  4791. /***/ (function(module, __unusedexports, __webpack_require__) {
  4792. module.exports = hasLastPage
  4793. const deprecate = __webpack_require__(370)
  4794. const getPageLinks = __webpack_require__(577)
  4795. function hasLastPage (link) {
  4796. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4797. return getPageLinks(link).last
  4798. }
  4799. /***/ }),
  4800. /***/ 348:
  4801. /***/ (function(module, __unusedexports, __webpack_require__) {
  4802. "use strict";
  4803. module.exports = validate;
  4804. const { RequestError } = __webpack_require__(463);
  4805. const get = __webpack_require__(854);
  4806. const set = __webpack_require__(883);
  4807. function validate(octokit, options) {
  4808. if (!options.request.validate) {
  4809. return;
  4810. }
  4811. const { validate: params } = options.request;
  4812. Object.keys(params).forEach(parameterName => {
  4813. const parameter = get(params, parameterName);
  4814. const expectedType = parameter.type;
  4815. let parentParameterName;
  4816. let parentValue;
  4817. let parentParamIsPresent = true;
  4818. let parentParameterIsArray = false;
  4819. if (/\./.test(parameterName)) {
  4820. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4821. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4822. if (parentParameterIsArray) {
  4823. parentParameterName = parentParameterName.slice(0, -2);
  4824. }
  4825. parentValue = get(options, parentParameterName);
  4826. parentParamIsPresent =
  4827. parentParameterName === "headers" ||
  4828. (typeof parentValue === "object" && parentValue !== null);
  4829. }
  4830. const values = parentParameterIsArray
  4831. ? (get(options, parentParameterName) || []).map(
  4832. value => value[parameterName.split(/\./).pop()]
  4833. )
  4834. : [get(options, parameterName)];
  4835. values.forEach((value, i) => {
  4836. const valueIsPresent = typeof value !== "undefined";
  4837. const valueIsNull = value === null;
  4838. const currentParameterName = parentParameterIsArray
  4839. ? parameterName.replace(/\[\]/, `[${i}]`)
  4840. : parameterName;
  4841. if (!parameter.required && !valueIsPresent) {
  4842. return;
  4843. }
  4844. // if the parent parameter is of type object but allows null
  4845. // then the child parameters can be ignored
  4846. if (!parentParamIsPresent) {
  4847. return;
  4848. }
  4849. if (parameter.allowNull && valueIsNull) {
  4850. return;
  4851. }
  4852. if (!parameter.allowNull && valueIsNull) {
  4853. throw new RequestError(
  4854. `'${currentParameterName}' cannot be null`,
  4855. 400,
  4856. {
  4857. request: options
  4858. }
  4859. );
  4860. }
  4861. if (parameter.required && !valueIsPresent) {
  4862. throw new RequestError(
  4863. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4864. value
  4865. )}`,
  4866. 400,
  4867. {
  4868. request: options
  4869. }
  4870. );
  4871. }
  4872. // parse to integer before checking for enum
  4873. // so that string "1" will match enum with number 1
  4874. if (expectedType === "integer") {
  4875. const unparsedValue = value;
  4876. value = parseInt(value, 10);
  4877. if (isNaN(value)) {
  4878. throw new RequestError(
  4879. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4880. unparsedValue
  4881. )} is NaN`,
  4882. 400,
  4883. {
  4884. request: options
  4885. }
  4886. );
  4887. }
  4888. }
  4889. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4890. throw new RequestError(
  4891. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4892. value
  4893. )}`,
  4894. 400,
  4895. {
  4896. request: options
  4897. }
  4898. );
  4899. }
  4900. if (parameter.validation) {
  4901. const regex = new RegExp(parameter.validation);
  4902. if (!regex.test(value)) {
  4903. throw new RequestError(
  4904. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4905. value
  4906. )}`,
  4907. 400,
  4908. {
  4909. request: options
  4910. }
  4911. );
  4912. }
  4913. }
  4914. if (expectedType === "object" && typeof value === "string") {
  4915. try {
  4916. value = JSON.parse(value);
  4917. } catch (exception) {
  4918. throw new RequestError(
  4919. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4920. value
  4921. )}`,
  4922. 400,
  4923. {
  4924. request: options
  4925. }
  4926. );
  4927. }
  4928. }
  4929. set(options, parameter.mapTo || currentParameterName, value);
  4930. });
  4931. });
  4932. return options;
  4933. }
  4934. /***/ }),
  4935. /***/ 349:
  4936. /***/ (function(module, __unusedexports, __webpack_require__) {
  4937. module.exports = authenticationRequestError;
  4938. const { RequestError } = __webpack_require__(463);
  4939. function authenticationRequestError(state, error, options) {
  4940. /* istanbul ignore next */
  4941. if (!error.headers) throw error;
  4942. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  4943. // handle "2FA required" error only
  4944. if (error.status !== 401 || !otpRequired) {
  4945. throw error;
  4946. }
  4947. if (
  4948. error.status === 401 &&
  4949. otpRequired &&
  4950. error.request &&
  4951. error.request.headers["x-github-otp"]
  4952. ) {
  4953. throw new RequestError(
  4954. "Invalid one-time password for two-factor authentication",
  4955. 401,
  4956. {
  4957. headers: error.headers,
  4958. request: options
  4959. }
  4960. );
  4961. }
  4962. if (typeof state.auth.on2fa !== "function") {
  4963. throw new RequestError(
  4964. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  4965. 401,
  4966. {
  4967. headers: error.headers,
  4968. request: options
  4969. }
  4970. );
  4971. }
  4972. return Promise.resolve()
  4973. .then(() => {
  4974. return state.auth.on2fa();
  4975. })
  4976. .then(oneTimePassword => {
  4977. const newOptions = Object.assign(options, {
  4978. headers: Object.assign(
  4979. { "x-github-otp": oneTimePassword },
  4980. options.headers
  4981. )
  4982. });
  4983. return state.octokit.request(newOptions);
  4984. });
  4985. }
  4986. /***/ }),
  4987. /***/ 357:
  4988. /***/ (function(module) {
  4989. module.exports = require("assert");
  4990. /***/ }),
  4991. /***/ 363:
  4992. /***/ (function(module) {
  4993. module.exports = register
  4994. function register (state, name, method, options) {
  4995. if (typeof method !== 'function') {
  4996. throw new Error('method for before hook must be a function')
  4997. }
  4998. if (!options) {
  4999. options = {}
  5000. }
  5001. if (Array.isArray(name)) {
  5002. return name.reverse().reduce(function (callback, name) {
  5003. return register.bind(null, state, name, callback, options)
  5004. }, method)()
  5005. }
  5006. return Promise.resolve()
  5007. .then(function () {
  5008. if (!state.registry[name]) {
  5009. return method(options)
  5010. }
  5011. return (state.registry[name]).reduce(function (method, registered) {
  5012. return registered.hook.bind(null, method, options)
  5013. }, method)()
  5014. })
  5015. }
  5016. /***/ }),
  5017. /***/ 368:
  5018. /***/ (function(module) {
  5019. module.exports = function atob(str) {
  5020. return Buffer.from(str, 'base64').toString('binary')
  5021. }
  5022. /***/ }),
  5023. /***/ 370:
  5024. /***/ (function(module) {
  5025. module.exports = deprecate
  5026. const loggedMessages = {}
  5027. function deprecate (message) {
  5028. if (loggedMessages[message]) {
  5029. return
  5030. }
  5031. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5032. loggedMessages[message] = 1
  5033. }
  5034. /***/ }),
  5035. /***/ 372:
  5036. /***/ (function(module) {
  5037. module.exports = octokitDebug;
  5038. function octokitDebug(octokit) {
  5039. octokit.hook.wrap("request", (request, options) => {
  5040. octokit.log.debug("request", options);
  5041. const start = Date.now();
  5042. const requestOptions = octokit.request.endpoint.parse(options);
  5043. const path = requestOptions.url.replace(options.baseUrl, "");
  5044. return request(options)
  5045. .then(response => {
  5046. octokit.log.info(
  5047. `${requestOptions.method} ${path} - ${
  5048. response.status
  5049. } in ${Date.now() - start}ms`
  5050. );
  5051. return response;
  5052. })
  5053. .catch(error => {
  5054. octokit.log.info(
  5055. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5056. start}ms`
  5057. );
  5058. throw error;
  5059. });
  5060. });
  5061. }
  5062. /***/ }),
  5063. /***/ 385:
  5064. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5065. "use strict";
  5066. Object.defineProperty(exports, '__esModule', { value: true });
  5067. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5068. var isPlainObject = _interopDefault(__webpack_require__(696));
  5069. var universalUserAgent = __webpack_require__(562);
  5070. function lowercaseKeys(object) {
  5071. if (!object) {
  5072. return {};
  5073. }
  5074. return Object.keys(object).reduce((newObj, key) => {
  5075. newObj[key.toLowerCase()] = object[key];
  5076. return newObj;
  5077. }, {});
  5078. }
  5079. function mergeDeep(defaults, options) {
  5080. const result = Object.assign({}, defaults);
  5081. Object.keys(options).forEach(key => {
  5082. if (isPlainObject(options[key])) {
  5083. if (!(key in defaults)) Object.assign(result, {
  5084. [key]: options[key]
  5085. });else result[key] = mergeDeep(defaults[key], options[key]);
  5086. } else {
  5087. Object.assign(result, {
  5088. [key]: options[key]
  5089. });
  5090. }
  5091. });
  5092. return result;
  5093. }
  5094. function merge(defaults, route, options) {
  5095. if (typeof route === "string") {
  5096. let [method, url] = route.split(" ");
  5097. options = Object.assign(url ? {
  5098. method,
  5099. url
  5100. } : {
  5101. url: method
  5102. }, options);
  5103. } else {
  5104. options = Object.assign({}, route);
  5105. } // lowercase header names before merging with defaults to avoid duplicates
  5106. options.headers = lowercaseKeys(options.headers);
  5107. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5108. if (defaults && defaults.mediaType.previews.length) {
  5109. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5110. }
  5111. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5112. return mergedOptions;
  5113. }
  5114. function addQueryParameters(url, parameters) {
  5115. const separator = /\?/.test(url) ? "&" : "?";
  5116. const names = Object.keys(parameters);
  5117. if (names.length === 0) {
  5118. return url;
  5119. }
  5120. return url + separator + names.map(name => {
  5121. if (name === "q") {
  5122. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5123. }
  5124. return `${name}=${encodeURIComponent(parameters[name])}`;
  5125. }).join("&");
  5126. }
  5127. const urlVariableRegex = /\{[^}]+\}/g;
  5128. function removeNonChars(variableName) {
  5129. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5130. }
  5131. function extractUrlVariableNames(url) {
  5132. const matches = url.match(urlVariableRegex);
  5133. if (!matches) {
  5134. return [];
  5135. }
  5136. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5137. }
  5138. function omit(object, keysToOmit) {
  5139. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5140. obj[key] = object[key];
  5141. return obj;
  5142. }, {});
  5143. }
  5144. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5145. // TODO: create separate package.
  5146. //
  5147. // Copyright (c) 2012-2014, Bram Stein
  5148. // All rights reserved.
  5149. // Redistribution and use in source and binary forms, with or without
  5150. // modification, are permitted provided that the following conditions
  5151. // are met:
  5152. // 1. Redistributions of source code must retain the above copyright
  5153. // notice, this list of conditions and the following disclaimer.
  5154. // 2. Redistributions in binary form must reproduce the above copyright
  5155. // notice, this list of conditions and the following disclaimer in the
  5156. // documentation and/or other materials provided with the distribution.
  5157. // 3. The name of the author may not be used to endorse or promote products
  5158. // derived from this software without specific prior written permission.
  5159. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5160. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5161. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5162. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5163. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5164. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5165. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5166. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5167. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5168. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5169. /* istanbul ignore file */
  5170. function encodeReserved(str) {
  5171. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5172. if (!/%[0-9A-Fa-f]/.test(part)) {
  5173. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5174. }
  5175. return part;
  5176. }).join("");
  5177. }
  5178. function encodeUnreserved(str) {
  5179. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5180. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5181. });
  5182. }
  5183. function encodeValue(operator, value, key) {
  5184. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5185. if (key) {
  5186. return encodeUnreserved(key) + "=" + value;
  5187. } else {
  5188. return value;
  5189. }
  5190. }
  5191. function isDefined(value) {
  5192. return value !== undefined && value !== null;
  5193. }
  5194. function isKeyOperator(operator) {
  5195. return operator === ";" || operator === "&" || operator === "?";
  5196. }
  5197. function getValues(context, operator, key, modifier) {
  5198. var value = context[key],
  5199. result = [];
  5200. if (isDefined(value) && value !== "") {
  5201. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5202. value = value.toString();
  5203. if (modifier && modifier !== "*") {
  5204. value = value.substring(0, parseInt(modifier, 10));
  5205. }
  5206. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5207. } else {
  5208. if (modifier === "*") {
  5209. if (Array.isArray(value)) {
  5210. value.filter(isDefined).forEach(function (value) {
  5211. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5212. });
  5213. } else {
  5214. Object.keys(value).forEach(function (k) {
  5215. if (isDefined(value[k])) {
  5216. result.push(encodeValue(operator, value[k], k));
  5217. }
  5218. });
  5219. }
  5220. } else {
  5221. const tmp = [];
  5222. if (Array.isArray(value)) {
  5223. value.filter(isDefined).forEach(function (value) {
  5224. tmp.push(encodeValue(operator, value));
  5225. });
  5226. } else {
  5227. Object.keys(value).forEach(function (k) {
  5228. if (isDefined(value[k])) {
  5229. tmp.push(encodeUnreserved(k));
  5230. tmp.push(encodeValue(operator, value[k].toString()));
  5231. }
  5232. });
  5233. }
  5234. if (isKeyOperator(operator)) {
  5235. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5236. } else if (tmp.length !== 0) {
  5237. result.push(tmp.join(","));
  5238. }
  5239. }
  5240. }
  5241. } else {
  5242. if (operator === ";") {
  5243. if (isDefined(value)) {
  5244. result.push(encodeUnreserved(key));
  5245. }
  5246. } else if (value === "" && (operator === "&" || operator === "?")) {
  5247. result.push(encodeUnreserved(key) + "=");
  5248. } else if (value === "") {
  5249. result.push("");
  5250. }
  5251. }
  5252. return result;
  5253. }
  5254. function parseUrl(template) {
  5255. return {
  5256. expand: expand.bind(null, template)
  5257. };
  5258. }
  5259. function expand(template, context) {
  5260. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5261. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5262. if (expression) {
  5263. let operator = "";
  5264. const values = [];
  5265. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5266. operator = expression.charAt(0);
  5267. expression = expression.substr(1);
  5268. }
  5269. expression.split(/,/g).forEach(function (variable) {
  5270. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5271. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5272. });
  5273. if (operator && operator !== "+") {
  5274. var separator = ",";
  5275. if (operator === "?") {
  5276. separator = "&";
  5277. } else if (operator !== "#") {
  5278. separator = operator;
  5279. }
  5280. return (values.length !== 0 ? operator : "") + values.join(separator);
  5281. } else {
  5282. return values.join(",");
  5283. }
  5284. } else {
  5285. return encodeReserved(literal);
  5286. }
  5287. });
  5288. }
  5289. function parse(options) {
  5290. // https://fetch.spec.whatwg.org/#methods
  5291. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5292. let url = options.url.replace(/:([a-z]\w+)/g, "{+$1}");
  5293. let headers = Object.assign({}, options.headers);
  5294. let body;
  5295. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5296. const urlVariableNames = extractUrlVariableNames(url);
  5297. url = parseUrl(url).expand(parameters);
  5298. if (!/^http/.test(url)) {
  5299. url = options.baseUrl + url;
  5300. }
  5301. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5302. const remainingParameters = omit(parameters, omittedParameters);
  5303. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5304. if (!isBinaryRequset) {
  5305. if (options.mediaType.format) {
  5306. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5307. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5308. }
  5309. if (options.mediaType.previews.length) {
  5310. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5311. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5312. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5313. return `application/vnd.github.${preview}-preview${format}`;
  5314. }).join(",");
  5315. }
  5316. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5317. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5318. if (["GET", "HEAD"].includes(method)) {
  5319. url = addQueryParameters(url, remainingParameters);
  5320. } else {
  5321. if ("data" in remainingParameters) {
  5322. body = remainingParameters.data;
  5323. } else {
  5324. if (Object.keys(remainingParameters).length) {
  5325. body = remainingParameters;
  5326. } else {
  5327. headers["content-length"] = 0;
  5328. }
  5329. }
  5330. } // default content-type for JSON if body is set
  5331. if (!headers["content-type"] && typeof body !== "undefined") {
  5332. headers["content-type"] = "application/json; charset=utf-8";
  5333. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5334. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5335. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5336. body = "";
  5337. } // Only return body/request keys if present
  5338. return Object.assign({
  5339. method,
  5340. url,
  5341. headers
  5342. }, typeof body !== "undefined" ? {
  5343. body
  5344. } : null, options.request ? {
  5345. request: options.request
  5346. } : null);
  5347. }
  5348. function endpointWithDefaults(defaults, route, options) {
  5349. return parse(merge(defaults, route, options));
  5350. }
  5351. function withDefaults(oldDefaults, newDefaults) {
  5352. const DEFAULTS = merge(oldDefaults, newDefaults);
  5353. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5354. return Object.assign(endpoint, {
  5355. DEFAULTS,
  5356. defaults: withDefaults.bind(null, DEFAULTS),
  5357. merge: merge.bind(null, DEFAULTS),
  5358. parse
  5359. });
  5360. }
  5361. const VERSION = "0.0.0-development";
  5362. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
  5363. const DEFAULTS = {
  5364. method: "GET",
  5365. baseUrl: "https://api.github.com",
  5366. headers: {
  5367. accept: "application/vnd.github.v3+json",
  5368. "user-agent": userAgent
  5369. },
  5370. mediaType: {
  5371. format: "",
  5372. previews: []
  5373. }
  5374. };
  5375. const endpoint = withDefaults(null, DEFAULTS);
  5376. exports.endpoint = endpoint;
  5377. //# sourceMappingURL=index.js.map
  5378. /***/ }),
  5379. /***/ 389:
  5380. /***/ (function(module, __unusedexports, __webpack_require__) {
  5381. "use strict";
  5382. const fs = __webpack_require__(747);
  5383. const shebangCommand = __webpack_require__(866);
  5384. function readShebang(command) {
  5385. // Read the first 150 bytes from the file
  5386. const size = 150;
  5387. let buffer;
  5388. if (Buffer.alloc) {
  5389. // Node.js v4.5+ / v5.10+
  5390. buffer = Buffer.alloc(size);
  5391. } else {
  5392. // Old Node.js API
  5393. buffer = new Buffer(size);
  5394. buffer.fill(0); // zero-fill
  5395. }
  5396. let fd;
  5397. try {
  5398. fd = fs.openSync(command, 'r');
  5399. fs.readSync(fd, buffer, 0, size, 0);
  5400. fs.closeSync(fd);
  5401. } catch (e) { /* Empty */ }
  5402. // Attempt to extract shebang (null is returned if not a shebang)
  5403. return shebangCommand(buffer.toString());
  5404. }
  5405. module.exports = readShebang;
  5406. /***/ }),
  5407. /***/ 402:
  5408. /***/ (function(module, __unusedexports, __webpack_require__) {
  5409. module.exports = Octokit;
  5410. const { request } = __webpack_require__(753);
  5411. const Hook = __webpack_require__(523);
  5412. const parseClientOptions = __webpack_require__(294);
  5413. function Octokit(plugins, options) {
  5414. options = options || {};
  5415. const hook = new Hook.Collection();
  5416. const log = Object.assign(
  5417. {
  5418. debug: () => {},
  5419. info: () => {},
  5420. warn: console.warn,
  5421. error: console.error
  5422. },
  5423. options && options.log
  5424. );
  5425. const api = {
  5426. hook,
  5427. log,
  5428. request: request.defaults(parseClientOptions(options, log, hook))
  5429. };
  5430. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5431. return api;
  5432. }
  5433. /***/ }),
  5434. /***/ 413:
  5435. /***/ (function(module) {
  5436. module.exports = require("stream");
  5437. /***/ }),
  5438. /***/ 427:
  5439. /***/ (function(module, __unusedexports, __webpack_require__) {
  5440. "use strict";
  5441. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5442. // In that case, fall back to a deprecated internal.
  5443. const util = __webpack_require__(669);
  5444. let uv;
  5445. if (typeof util.getSystemErrorName === 'function') {
  5446. module.exports = util.getSystemErrorName;
  5447. } else {
  5448. try {
  5449. uv = process.binding('uv');
  5450. if (typeof uv.errname !== 'function') {
  5451. throw new TypeError('uv.errname is not a function');
  5452. }
  5453. } catch (err) {
  5454. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5455. uv = null;
  5456. }
  5457. module.exports = code => errname(uv, code);
  5458. }
  5459. // Used for testing the fallback behavior
  5460. module.exports.__test__ = errname;
  5461. function errname(uv, code) {
  5462. if (uv) {
  5463. return uv.errname(code);
  5464. }
  5465. if (!(code < 0)) {
  5466. throw new Error('err >= 0');
  5467. }
  5468. return `Unknown system error ${code}`;
  5469. }
  5470. /***/ }),
  5471. /***/ 430:
  5472. /***/ (function(module, __unusedexports, __webpack_require__) {
  5473. module.exports = octokitValidate;
  5474. const validate = __webpack_require__(348);
  5475. function octokitValidate(octokit) {
  5476. octokit.hook.before("request", validate.bind(null, octokit));
  5477. }
  5478. /***/ }),
  5479. /***/ 431:
  5480. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5481. "use strict";
  5482. Object.defineProperty(exports, "__esModule", { value: true });
  5483. const os = __webpack_require__(87);
  5484. /**
  5485. * Commands
  5486. *
  5487. * Command Format:
  5488. * ##[name key=value;key=value]message
  5489. *
  5490. * Examples:
  5491. * ##[warning]This is the user warning message
  5492. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5493. */
  5494. function issueCommand(command, properties, message) {
  5495. const cmd = new Command(command, properties, message);
  5496. process.stdout.write(cmd.toString() + os.EOL);
  5497. }
  5498. exports.issueCommand = issueCommand;
  5499. function issue(name, message = '') {
  5500. issueCommand(name, {}, message);
  5501. }
  5502. exports.issue = issue;
  5503. const CMD_STRING = '::';
  5504. class Command {
  5505. constructor(command, properties, message) {
  5506. if (!command) {
  5507. command = 'missing.command';
  5508. }
  5509. this.command = command;
  5510. this.properties = properties;
  5511. this.message = message;
  5512. }
  5513. toString() {
  5514. let cmdStr = CMD_STRING + this.command;
  5515. if (this.properties && Object.keys(this.properties).length > 0) {
  5516. cmdStr += ' ';
  5517. for (const key in this.properties) {
  5518. if (this.properties.hasOwnProperty(key)) {
  5519. const val = this.properties[key];
  5520. if (val) {
  5521. // safely append the val - avoid blowing up when attempting to
  5522. // call .replace() if message is not a string for some reason
  5523. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5524. }
  5525. }
  5526. }
  5527. }
  5528. cmdStr += CMD_STRING;
  5529. // safely append the message - avoid blowing up when attempting to
  5530. // call .replace() if message is not a string for some reason
  5531. const message = `${this.message || ''}`;
  5532. cmdStr += escapeData(message);
  5533. return cmdStr;
  5534. }
  5535. }
  5536. function escapeData(s) {
  5537. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5538. }
  5539. function escape(s) {
  5540. return s
  5541. .replace(/\r/g, '%0D')
  5542. .replace(/\n/g, '%0A')
  5543. .replace(/]/g, '%5D')
  5544. .replace(/;/g, '%3B');
  5545. }
  5546. //# sourceMappingURL=command.js.map
  5547. /***/ }),
  5548. /***/ 453:
  5549. /***/ (function(module, __unusedexports, __webpack_require__) {
  5550. var once = __webpack_require__(969)
  5551. var eos = __webpack_require__(3)
  5552. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5553. var noop = function () {}
  5554. var ancient = /^v?\.0/.test(process.version)
  5555. var isFn = function (fn) {
  5556. return typeof fn === 'function'
  5557. }
  5558. var isFS = function (stream) {
  5559. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5560. if (!fs) return false // browser
  5561. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5562. }
  5563. var isRequest = function (stream) {
  5564. return stream.setHeader && isFn(stream.abort)
  5565. }
  5566. var destroyer = function (stream, reading, writing, callback) {
  5567. callback = once(callback)
  5568. var closed = false
  5569. stream.on('close', function () {
  5570. closed = true
  5571. })
  5572. eos(stream, {readable: reading, writable: writing}, function (err) {
  5573. if (err) return callback(err)
  5574. closed = true
  5575. callback()
  5576. })
  5577. var destroyed = false
  5578. return function (err) {
  5579. if (closed) return
  5580. if (destroyed) return
  5581. destroyed = true
  5582. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5583. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5584. if (isFn(stream.destroy)) return stream.destroy()
  5585. callback(err || new Error('stream was destroyed'))
  5586. }
  5587. }
  5588. var call = function (fn) {
  5589. fn()
  5590. }
  5591. var pipe = function (from, to) {
  5592. return from.pipe(to)
  5593. }
  5594. var pump = function () {
  5595. var streams = Array.prototype.slice.call(arguments)
  5596. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5597. if (Array.isArray(streams[0])) streams = streams[0]
  5598. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5599. var error
  5600. var destroys = streams.map(function (stream, i) {
  5601. var reading = i < streams.length - 1
  5602. var writing = i > 0
  5603. return destroyer(stream, reading, writing, function (err) {
  5604. if (!error) error = err
  5605. if (err) destroys.forEach(call)
  5606. if (reading) return
  5607. destroys.forEach(call)
  5608. callback(error)
  5609. })
  5610. })
  5611. return streams.reduce(pipe)
  5612. }
  5613. module.exports = pump
  5614. /***/ }),
  5615. /***/ 454:
  5616. /***/ (function(module, exports, __webpack_require__) {
  5617. "use strict";
  5618. Object.defineProperty(exports, '__esModule', { value: true });
  5619. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5620. var Stream = _interopDefault(__webpack_require__(413));
  5621. var http = _interopDefault(__webpack_require__(605));
  5622. var Url = _interopDefault(__webpack_require__(835));
  5623. var https = _interopDefault(__webpack_require__(34));
  5624. var zlib = _interopDefault(__webpack_require__(761));
  5625. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5626. // fix for "Readable" isn't a named export issue
  5627. const Readable = Stream.Readable;
  5628. const BUFFER = Symbol('buffer');
  5629. const TYPE = Symbol('type');
  5630. class Blob {
  5631. constructor() {
  5632. this[TYPE] = '';
  5633. const blobParts = arguments[0];
  5634. const options = arguments[1];
  5635. const buffers = [];
  5636. let size = 0;
  5637. if (blobParts) {
  5638. const a = blobParts;
  5639. const length = Number(a.length);
  5640. for (let i = 0; i < length; i++) {
  5641. const element = a[i];
  5642. let buffer;
  5643. if (element instanceof Buffer) {
  5644. buffer = element;
  5645. } else if (ArrayBuffer.isView(element)) {
  5646. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5647. } else if (element instanceof ArrayBuffer) {
  5648. buffer = Buffer.from(element);
  5649. } else if (element instanceof Blob) {
  5650. buffer = element[BUFFER];
  5651. } else {
  5652. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5653. }
  5654. size += buffer.length;
  5655. buffers.push(buffer);
  5656. }
  5657. }
  5658. this[BUFFER] = Buffer.concat(buffers);
  5659. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5660. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5661. this[TYPE] = type;
  5662. }
  5663. }
  5664. get size() {
  5665. return this[BUFFER].length;
  5666. }
  5667. get type() {
  5668. return this[TYPE];
  5669. }
  5670. text() {
  5671. return Promise.resolve(this[BUFFER].toString());
  5672. }
  5673. arrayBuffer() {
  5674. const buf = this[BUFFER];
  5675. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5676. return Promise.resolve(ab);
  5677. }
  5678. stream() {
  5679. const readable = new Readable();
  5680. readable._read = function () {};
  5681. readable.push(this[BUFFER]);
  5682. readable.push(null);
  5683. return readable;
  5684. }
  5685. toString() {
  5686. return '[object Blob]';
  5687. }
  5688. slice() {
  5689. const size = this.size;
  5690. const start = arguments[0];
  5691. const end = arguments[1];
  5692. let relativeStart, relativeEnd;
  5693. if (start === undefined) {
  5694. relativeStart = 0;
  5695. } else if (start < 0) {
  5696. relativeStart = Math.max(size + start, 0);
  5697. } else {
  5698. relativeStart = Math.min(start, size);
  5699. }
  5700. if (end === undefined) {
  5701. relativeEnd = size;
  5702. } else if (end < 0) {
  5703. relativeEnd = Math.max(size + end, 0);
  5704. } else {
  5705. relativeEnd = Math.min(end, size);
  5706. }
  5707. const span = Math.max(relativeEnd - relativeStart, 0);
  5708. const buffer = this[BUFFER];
  5709. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5710. const blob = new Blob([], { type: arguments[2] });
  5711. blob[BUFFER] = slicedBuffer;
  5712. return blob;
  5713. }
  5714. }
  5715. Object.defineProperties(Blob.prototype, {
  5716. size: { enumerable: true },
  5717. type: { enumerable: true },
  5718. slice: { enumerable: true }
  5719. });
  5720. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5721. value: 'Blob',
  5722. writable: false,
  5723. enumerable: false,
  5724. configurable: true
  5725. });
  5726. /**
  5727. * fetch-error.js
  5728. *
  5729. * FetchError interface for operational errors
  5730. */
  5731. /**
  5732. * Create FetchError instance
  5733. *
  5734. * @param String message Error message for human
  5735. * @param String type Error type for machine
  5736. * @param String systemError For Node.js system error
  5737. * @return FetchError
  5738. */
  5739. function FetchError(message, type, systemError) {
  5740. Error.call(this, message);
  5741. this.message = message;
  5742. this.type = type;
  5743. // when err.type is `system`, err.code contains system error code
  5744. if (systemError) {
  5745. this.code = this.errno = systemError.code;
  5746. }
  5747. // hide custom error implementation details from end-users
  5748. Error.captureStackTrace(this, this.constructor);
  5749. }
  5750. FetchError.prototype = Object.create(Error.prototype);
  5751. FetchError.prototype.constructor = FetchError;
  5752. FetchError.prototype.name = 'FetchError';
  5753. let convert;
  5754. try {
  5755. convert = __webpack_require__(18).convert;
  5756. } catch (e) {}
  5757. const INTERNALS = Symbol('Body internals');
  5758. // fix an issue where "PassThrough" isn't a named export for node <10
  5759. const PassThrough = Stream.PassThrough;
  5760. /**
  5761. * Body mixin
  5762. *
  5763. * Ref: https://fetch.spec.whatwg.org/#body
  5764. *
  5765. * @param Stream body Readable stream
  5766. * @param Object opts Response options
  5767. * @return Void
  5768. */
  5769. function Body(body) {
  5770. var _this = this;
  5771. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5772. _ref$size = _ref.size;
  5773. let size = _ref$size === undefined ? 0 : _ref$size;
  5774. var _ref$timeout = _ref.timeout;
  5775. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5776. if (body == null) {
  5777. // body is undefined or null
  5778. body = null;
  5779. } else if (isURLSearchParams(body)) {
  5780. // body is a URLSearchParams
  5781. body = Buffer.from(body.toString());
  5782. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5783. // body is ArrayBuffer
  5784. body = Buffer.from(body);
  5785. } else if (ArrayBuffer.isView(body)) {
  5786. // body is ArrayBufferView
  5787. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5788. } else if (body instanceof Stream) ; else {
  5789. // none of the above
  5790. // coerce to string then buffer
  5791. body = Buffer.from(String(body));
  5792. }
  5793. this[INTERNALS] = {
  5794. body,
  5795. disturbed: false,
  5796. error: null
  5797. };
  5798. this.size = size;
  5799. this.timeout = timeout;
  5800. if (body instanceof Stream) {
  5801. body.on('error', function (err) {
  5802. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5803. _this[INTERNALS].error = error;
  5804. });
  5805. }
  5806. }
  5807. Body.prototype = {
  5808. get body() {
  5809. return this[INTERNALS].body;
  5810. },
  5811. get bodyUsed() {
  5812. return this[INTERNALS].disturbed;
  5813. },
  5814. /**
  5815. * Decode response as ArrayBuffer
  5816. *
  5817. * @return Promise
  5818. */
  5819. arrayBuffer() {
  5820. return consumeBody.call(this).then(function (buf) {
  5821. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5822. });
  5823. },
  5824. /**
  5825. * Return raw response as Blob
  5826. *
  5827. * @return Promise
  5828. */
  5829. blob() {
  5830. let ct = this.headers && this.headers.get('content-type') || '';
  5831. return consumeBody.call(this).then(function (buf) {
  5832. return Object.assign(
  5833. // Prevent copying
  5834. new Blob([], {
  5835. type: ct.toLowerCase()
  5836. }), {
  5837. [BUFFER]: buf
  5838. });
  5839. });
  5840. },
  5841. /**
  5842. * Decode response as json
  5843. *
  5844. * @return Promise
  5845. */
  5846. json() {
  5847. var _this2 = this;
  5848. return consumeBody.call(this).then(function (buffer) {
  5849. try {
  5850. return JSON.parse(buffer.toString());
  5851. } catch (err) {
  5852. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5853. }
  5854. });
  5855. },
  5856. /**
  5857. * Decode response as text
  5858. *
  5859. * @return Promise
  5860. */
  5861. text() {
  5862. return consumeBody.call(this).then(function (buffer) {
  5863. return buffer.toString();
  5864. });
  5865. },
  5866. /**
  5867. * Decode response as buffer (non-spec api)
  5868. *
  5869. * @return Promise
  5870. */
  5871. buffer() {
  5872. return consumeBody.call(this);
  5873. },
  5874. /**
  5875. * Decode response as text, while automatically detecting the encoding and
  5876. * trying to decode to UTF-8 (non-spec api)
  5877. *
  5878. * @return Promise
  5879. */
  5880. textConverted() {
  5881. var _this3 = this;
  5882. return consumeBody.call(this).then(function (buffer) {
  5883. return convertBody(buffer, _this3.headers);
  5884. });
  5885. }
  5886. };
  5887. // In browsers, all properties are enumerable.
  5888. Object.defineProperties(Body.prototype, {
  5889. body: { enumerable: true },
  5890. bodyUsed: { enumerable: true },
  5891. arrayBuffer: { enumerable: true },
  5892. blob: { enumerable: true },
  5893. json: { enumerable: true },
  5894. text: { enumerable: true }
  5895. });
  5896. Body.mixIn = function (proto) {
  5897. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5898. // istanbul ignore else: future proof
  5899. if (!(name in proto)) {
  5900. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5901. Object.defineProperty(proto, name, desc);
  5902. }
  5903. }
  5904. };
  5905. /**
  5906. * Consume and convert an entire Body to a Buffer.
  5907. *
  5908. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5909. *
  5910. * @return Promise
  5911. */
  5912. function consumeBody() {
  5913. var _this4 = this;
  5914. if (this[INTERNALS].disturbed) {
  5915. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5916. }
  5917. this[INTERNALS].disturbed = true;
  5918. if (this[INTERNALS].error) {
  5919. return Body.Promise.reject(this[INTERNALS].error);
  5920. }
  5921. let body = this.body;
  5922. // body is null
  5923. if (body === null) {
  5924. return Body.Promise.resolve(Buffer.alloc(0));
  5925. }
  5926. // body is blob
  5927. if (isBlob(body)) {
  5928. body = body.stream();
  5929. }
  5930. // body is buffer
  5931. if (Buffer.isBuffer(body)) {
  5932. return Body.Promise.resolve(body);
  5933. }
  5934. // istanbul ignore if: should never happen
  5935. if (!(body instanceof Stream)) {
  5936. return Body.Promise.resolve(Buffer.alloc(0));
  5937. }
  5938. // body is stream
  5939. // get ready to actually consume the body
  5940. let accum = [];
  5941. let accumBytes = 0;
  5942. let abort = false;
  5943. return new Body.Promise(function (resolve, reject) {
  5944. let resTimeout;
  5945. // allow timeout on slow response body
  5946. if (_this4.timeout) {
  5947. resTimeout = setTimeout(function () {
  5948. abort = true;
  5949. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  5950. }, _this4.timeout);
  5951. }
  5952. // handle stream errors
  5953. body.on('error', function (err) {
  5954. if (err.name === 'AbortError') {
  5955. // if the request was aborted, reject with this Error
  5956. abort = true;
  5957. reject(err);
  5958. } else {
  5959. // other errors, such as incorrect content-encoding
  5960. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  5961. }
  5962. });
  5963. body.on('data', function (chunk) {
  5964. if (abort || chunk === null) {
  5965. return;
  5966. }
  5967. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  5968. abort = true;
  5969. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  5970. return;
  5971. }
  5972. accumBytes += chunk.length;
  5973. accum.push(chunk);
  5974. });
  5975. body.on('end', function () {
  5976. if (abort) {
  5977. return;
  5978. }
  5979. clearTimeout(resTimeout);
  5980. try {
  5981. resolve(Buffer.concat(accum, accumBytes));
  5982. } catch (err) {
  5983. // handle streams that have accumulated too much data (issue #414)
  5984. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  5985. }
  5986. });
  5987. });
  5988. }
  5989. /**
  5990. * Detect buffer encoding and convert to target encoding
  5991. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  5992. *
  5993. * @param Buffer buffer Incoming buffer
  5994. * @param String encoding Target encoding
  5995. * @return String
  5996. */
  5997. function convertBody(buffer, headers) {
  5998. if (typeof convert !== 'function') {
  5999. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6000. }
  6001. const ct = headers.get('content-type');
  6002. let charset = 'utf-8';
  6003. let res, str;
  6004. // header
  6005. if (ct) {
  6006. res = /charset=([^;]*)/i.exec(ct);
  6007. }
  6008. // no charset in content type, peek at response body for at most 1024 bytes
  6009. str = buffer.slice(0, 1024).toString();
  6010. // html5
  6011. if (!res && str) {
  6012. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6013. }
  6014. // html4
  6015. if (!res && str) {
  6016. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6017. if (res) {
  6018. res = /charset=(.*)/i.exec(res.pop());
  6019. }
  6020. }
  6021. // xml
  6022. if (!res && str) {
  6023. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6024. }
  6025. // found charset
  6026. if (res) {
  6027. charset = res.pop();
  6028. // prevent decode issues when sites use incorrect encoding
  6029. // ref: https://hsivonen.fi/encoding-menu/
  6030. if (charset === 'gb2312' || charset === 'gbk') {
  6031. charset = 'gb18030';
  6032. }
  6033. }
  6034. // turn raw buffers into a single utf-8 buffer
  6035. return convert(buffer, 'UTF-8', charset).toString();
  6036. }
  6037. /**
  6038. * Detect a URLSearchParams object
  6039. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6040. *
  6041. * @param Object obj Object to detect by type or brand
  6042. * @return String
  6043. */
  6044. function isURLSearchParams(obj) {
  6045. // Duck-typing as a necessary condition.
  6046. 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') {
  6047. return false;
  6048. }
  6049. // Brand-checking and more duck-typing as optional condition.
  6050. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6051. }
  6052. /**
  6053. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6054. * @param {*} obj
  6055. * @return {boolean}
  6056. */
  6057. function isBlob(obj) {
  6058. 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]);
  6059. }
  6060. /**
  6061. * Clone body given Res/Req instance
  6062. *
  6063. * @param Mixed instance Response or Request instance
  6064. * @return Mixed
  6065. */
  6066. function clone(instance) {
  6067. let p1, p2;
  6068. let body = instance.body;
  6069. // don't allow cloning a used body
  6070. if (instance.bodyUsed) {
  6071. throw new Error('cannot clone body after it is used');
  6072. }
  6073. // check that body is a stream and not form-data object
  6074. // note: we can't clone the form-data object without having it as a dependency
  6075. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6076. // tee instance body
  6077. p1 = new PassThrough();
  6078. p2 = new PassThrough();
  6079. body.pipe(p1);
  6080. body.pipe(p2);
  6081. // set instance body to teed body and return the other teed body
  6082. instance[INTERNALS].body = p1;
  6083. body = p2;
  6084. }
  6085. return body;
  6086. }
  6087. /**
  6088. * Performs the operation "extract a `Content-Type` value from |object|" as
  6089. * specified in the specification:
  6090. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6091. *
  6092. * This function assumes that instance.body is present.
  6093. *
  6094. * @param Mixed instance Any options.body input
  6095. */
  6096. function extractContentType(body) {
  6097. if (body === null) {
  6098. // body is null
  6099. return null;
  6100. } else if (typeof body === 'string') {
  6101. // body is string
  6102. return 'text/plain;charset=UTF-8';
  6103. } else if (isURLSearchParams(body)) {
  6104. // body is a URLSearchParams
  6105. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6106. } else if (isBlob(body)) {
  6107. // body is blob
  6108. return body.type || null;
  6109. } else if (Buffer.isBuffer(body)) {
  6110. // body is buffer
  6111. return null;
  6112. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6113. // body is ArrayBuffer
  6114. return null;
  6115. } else if (ArrayBuffer.isView(body)) {
  6116. // body is ArrayBufferView
  6117. return null;
  6118. } else if (typeof body.getBoundary === 'function') {
  6119. // detect form data input from form-data module
  6120. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6121. } else if (body instanceof Stream) {
  6122. // body is stream
  6123. // can't really do much about this
  6124. return null;
  6125. } else {
  6126. // Body constructor defaults other things to string
  6127. return 'text/plain;charset=UTF-8';
  6128. }
  6129. }
  6130. /**
  6131. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6132. * For us, we have to explicitly get it with a function.
  6133. *
  6134. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6135. *
  6136. * @param Body instance Instance of Body
  6137. * @return Number? Number of bytes, or null if not possible
  6138. */
  6139. function getTotalBytes(instance) {
  6140. const body = instance.body;
  6141. if (body === null) {
  6142. // body is null
  6143. return 0;
  6144. } else if (isBlob(body)) {
  6145. return body.size;
  6146. } else if (Buffer.isBuffer(body)) {
  6147. // body is buffer
  6148. return body.length;
  6149. } else if (body && typeof body.getLengthSync === 'function') {
  6150. // detect form data input from form-data module
  6151. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6152. body.hasKnownLength && body.hasKnownLength()) {
  6153. // 2.x
  6154. return body.getLengthSync();
  6155. }
  6156. return null;
  6157. } else {
  6158. // body is stream
  6159. return null;
  6160. }
  6161. }
  6162. /**
  6163. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6164. *
  6165. * @param Body instance Instance of Body
  6166. * @return Void
  6167. */
  6168. function writeToStream(dest, instance) {
  6169. const body = instance.body;
  6170. if (body === null) {
  6171. // body is null
  6172. dest.end();
  6173. } else if (isBlob(body)) {
  6174. body.stream().pipe(dest);
  6175. } else if (Buffer.isBuffer(body)) {
  6176. // body is buffer
  6177. dest.write(body);
  6178. dest.end();
  6179. } else {
  6180. // body is stream
  6181. body.pipe(dest);
  6182. }
  6183. }
  6184. // expose Promise
  6185. Body.Promise = global.Promise;
  6186. /**
  6187. * headers.js
  6188. *
  6189. * Headers class offers convenient helpers
  6190. */
  6191. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6192. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6193. function validateName(name) {
  6194. name = `${name}`;
  6195. if (invalidTokenRegex.test(name) || name === '') {
  6196. throw new TypeError(`${name} is not a legal HTTP header name`);
  6197. }
  6198. }
  6199. function validateValue(value) {
  6200. value = `${value}`;
  6201. if (invalidHeaderCharRegex.test(value)) {
  6202. throw new TypeError(`${value} is not a legal HTTP header value`);
  6203. }
  6204. }
  6205. /**
  6206. * Find the key in the map object given a header name.
  6207. *
  6208. * Returns undefined if not found.
  6209. *
  6210. * @param String name Header name
  6211. * @return String|Undefined
  6212. */
  6213. function find(map, name) {
  6214. name = name.toLowerCase();
  6215. for (const key in map) {
  6216. if (key.toLowerCase() === name) {
  6217. return key;
  6218. }
  6219. }
  6220. return undefined;
  6221. }
  6222. const MAP = Symbol('map');
  6223. class Headers {
  6224. /**
  6225. * Headers class
  6226. *
  6227. * @param Object headers Response headers
  6228. * @return Void
  6229. */
  6230. constructor() {
  6231. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6232. this[MAP] = Object.create(null);
  6233. if (init instanceof Headers) {
  6234. const rawHeaders = init.raw();
  6235. const headerNames = Object.keys(rawHeaders);
  6236. for (const headerName of headerNames) {
  6237. for (const value of rawHeaders[headerName]) {
  6238. this.append(headerName, value);
  6239. }
  6240. }
  6241. return;
  6242. }
  6243. // We don't worry about converting prop to ByteString here as append()
  6244. // will handle it.
  6245. if (init == null) ; else if (typeof init === 'object') {
  6246. const method = init[Symbol.iterator];
  6247. if (method != null) {
  6248. if (typeof method !== 'function') {
  6249. throw new TypeError('Header pairs must be iterable');
  6250. }
  6251. // sequence<sequence<ByteString>>
  6252. // Note: per spec we have to first exhaust the lists then process them
  6253. const pairs = [];
  6254. for (const pair of init) {
  6255. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6256. throw new TypeError('Each header pair must be iterable');
  6257. }
  6258. pairs.push(Array.from(pair));
  6259. }
  6260. for (const pair of pairs) {
  6261. if (pair.length !== 2) {
  6262. throw new TypeError('Each header pair must be a name/value tuple');
  6263. }
  6264. this.append(pair[0], pair[1]);
  6265. }
  6266. } else {
  6267. // record<ByteString, ByteString>
  6268. for (const key of Object.keys(init)) {
  6269. const value = init[key];
  6270. this.append(key, value);
  6271. }
  6272. }
  6273. } else {
  6274. throw new TypeError('Provided initializer must be an object');
  6275. }
  6276. }
  6277. /**
  6278. * Return combined header value given name
  6279. *
  6280. * @param String name Header name
  6281. * @return Mixed
  6282. */
  6283. get(name) {
  6284. name = `${name}`;
  6285. validateName(name);
  6286. const key = find(this[MAP], name);
  6287. if (key === undefined) {
  6288. return null;
  6289. }
  6290. return this[MAP][key].join(', ');
  6291. }
  6292. /**
  6293. * Iterate over all headers
  6294. *
  6295. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6296. * @param Boolean thisArg `this` context for callback function
  6297. * @return Void
  6298. */
  6299. forEach(callback) {
  6300. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6301. let pairs = getHeaders(this);
  6302. let i = 0;
  6303. while (i < pairs.length) {
  6304. var _pairs$i = pairs[i];
  6305. const name = _pairs$i[0],
  6306. value = _pairs$i[1];
  6307. callback.call(thisArg, value, name, this);
  6308. pairs = getHeaders(this);
  6309. i++;
  6310. }
  6311. }
  6312. /**
  6313. * Overwrite header values given name
  6314. *
  6315. * @param String name Header name
  6316. * @param String value Header value
  6317. * @return Void
  6318. */
  6319. set(name, value) {
  6320. name = `${name}`;
  6321. value = `${value}`;
  6322. validateName(name);
  6323. validateValue(value);
  6324. const key = find(this[MAP], name);
  6325. this[MAP][key !== undefined ? key : name] = [value];
  6326. }
  6327. /**
  6328. * Append a value onto existing header
  6329. *
  6330. * @param String name Header name
  6331. * @param String value Header value
  6332. * @return Void
  6333. */
  6334. append(name, value) {
  6335. name = `${name}`;
  6336. value = `${value}`;
  6337. validateName(name);
  6338. validateValue(value);
  6339. const key = find(this[MAP], name);
  6340. if (key !== undefined) {
  6341. this[MAP][key].push(value);
  6342. } else {
  6343. this[MAP][name] = [value];
  6344. }
  6345. }
  6346. /**
  6347. * Check for header name existence
  6348. *
  6349. * @param String name Header name
  6350. * @return Boolean
  6351. */
  6352. has(name) {
  6353. name = `${name}`;
  6354. validateName(name);
  6355. return find(this[MAP], name) !== undefined;
  6356. }
  6357. /**
  6358. * Delete all header values given name
  6359. *
  6360. * @param String name Header name
  6361. * @return Void
  6362. */
  6363. delete(name) {
  6364. name = `${name}`;
  6365. validateName(name);
  6366. const key = find(this[MAP], name);
  6367. if (key !== undefined) {
  6368. delete this[MAP][key];
  6369. }
  6370. }
  6371. /**
  6372. * Return raw headers (non-spec api)
  6373. *
  6374. * @return Object
  6375. */
  6376. raw() {
  6377. return this[MAP];
  6378. }
  6379. /**
  6380. * Get an iterator on keys.
  6381. *
  6382. * @return Iterator
  6383. */
  6384. keys() {
  6385. return createHeadersIterator(this, 'key');
  6386. }
  6387. /**
  6388. * Get an iterator on values.
  6389. *
  6390. * @return Iterator
  6391. */
  6392. values() {
  6393. return createHeadersIterator(this, 'value');
  6394. }
  6395. /**
  6396. * Get an iterator on entries.
  6397. *
  6398. * This is the default iterator of the Headers object.
  6399. *
  6400. * @return Iterator
  6401. */
  6402. [Symbol.iterator]() {
  6403. return createHeadersIterator(this, 'key+value');
  6404. }
  6405. }
  6406. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6407. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6408. value: 'Headers',
  6409. writable: false,
  6410. enumerable: false,
  6411. configurable: true
  6412. });
  6413. Object.defineProperties(Headers.prototype, {
  6414. get: { enumerable: true },
  6415. forEach: { enumerable: true },
  6416. set: { enumerable: true },
  6417. append: { enumerable: true },
  6418. has: { enumerable: true },
  6419. delete: { enumerable: true },
  6420. keys: { enumerable: true },
  6421. values: { enumerable: true },
  6422. entries: { enumerable: true }
  6423. });
  6424. function getHeaders(headers) {
  6425. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6426. const keys = Object.keys(headers[MAP]).sort();
  6427. return keys.map(kind === 'key' ? function (k) {
  6428. return k.toLowerCase();
  6429. } : kind === 'value' ? function (k) {
  6430. return headers[MAP][k].join(', ');
  6431. } : function (k) {
  6432. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6433. });
  6434. }
  6435. const INTERNAL = Symbol('internal');
  6436. function createHeadersIterator(target, kind) {
  6437. const iterator = Object.create(HeadersIteratorPrototype);
  6438. iterator[INTERNAL] = {
  6439. target,
  6440. kind,
  6441. index: 0
  6442. };
  6443. return iterator;
  6444. }
  6445. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6446. next() {
  6447. // istanbul ignore if
  6448. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6449. throw new TypeError('Value of `this` is not a HeadersIterator');
  6450. }
  6451. var _INTERNAL = this[INTERNAL];
  6452. const target = _INTERNAL.target,
  6453. kind = _INTERNAL.kind,
  6454. index = _INTERNAL.index;
  6455. const values = getHeaders(target, kind);
  6456. const len = values.length;
  6457. if (index >= len) {
  6458. return {
  6459. value: undefined,
  6460. done: true
  6461. };
  6462. }
  6463. this[INTERNAL].index = index + 1;
  6464. return {
  6465. value: values[index],
  6466. done: false
  6467. };
  6468. }
  6469. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6470. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6471. value: 'HeadersIterator',
  6472. writable: false,
  6473. enumerable: false,
  6474. configurable: true
  6475. });
  6476. /**
  6477. * Export the Headers object in a form that Node.js can consume.
  6478. *
  6479. * @param Headers headers
  6480. * @return Object
  6481. */
  6482. function exportNodeCompatibleHeaders(headers) {
  6483. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6484. // http.request() only supports string as Host header. This hack makes
  6485. // specifying custom Host header possible.
  6486. const hostHeaderKey = find(headers[MAP], 'Host');
  6487. if (hostHeaderKey !== undefined) {
  6488. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6489. }
  6490. return obj;
  6491. }
  6492. /**
  6493. * Create a Headers object from an object of headers, ignoring those that do
  6494. * not conform to HTTP grammar productions.
  6495. *
  6496. * @param Object obj Object of headers
  6497. * @return Headers
  6498. */
  6499. function createHeadersLenient(obj) {
  6500. const headers = new Headers();
  6501. for (const name of Object.keys(obj)) {
  6502. if (invalidTokenRegex.test(name)) {
  6503. continue;
  6504. }
  6505. if (Array.isArray(obj[name])) {
  6506. for (const val of obj[name]) {
  6507. if (invalidHeaderCharRegex.test(val)) {
  6508. continue;
  6509. }
  6510. if (headers[MAP][name] === undefined) {
  6511. headers[MAP][name] = [val];
  6512. } else {
  6513. headers[MAP][name].push(val);
  6514. }
  6515. }
  6516. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6517. headers[MAP][name] = [obj[name]];
  6518. }
  6519. }
  6520. return headers;
  6521. }
  6522. const INTERNALS$1 = Symbol('Response internals');
  6523. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6524. const STATUS_CODES = http.STATUS_CODES;
  6525. /**
  6526. * Response class
  6527. *
  6528. * @param Stream body Readable stream
  6529. * @param Object opts Response options
  6530. * @return Void
  6531. */
  6532. class Response {
  6533. constructor() {
  6534. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6535. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6536. Body.call(this, body, opts);
  6537. const status = opts.status || 200;
  6538. const headers = new Headers(opts.headers);
  6539. if (body != null && !headers.has('Content-Type')) {
  6540. const contentType = extractContentType(body);
  6541. if (contentType) {
  6542. headers.append('Content-Type', contentType);
  6543. }
  6544. }
  6545. this[INTERNALS$1] = {
  6546. url: opts.url,
  6547. status,
  6548. statusText: opts.statusText || STATUS_CODES[status],
  6549. headers,
  6550. counter: opts.counter
  6551. };
  6552. }
  6553. get url() {
  6554. return this[INTERNALS$1].url || '';
  6555. }
  6556. get status() {
  6557. return this[INTERNALS$1].status;
  6558. }
  6559. /**
  6560. * Convenience property representing if the request ended normally
  6561. */
  6562. get ok() {
  6563. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6564. }
  6565. get redirected() {
  6566. return this[INTERNALS$1].counter > 0;
  6567. }
  6568. get statusText() {
  6569. return this[INTERNALS$1].statusText;
  6570. }
  6571. get headers() {
  6572. return this[INTERNALS$1].headers;
  6573. }
  6574. /**
  6575. * Clone this response
  6576. *
  6577. * @return Response
  6578. */
  6579. clone() {
  6580. return new Response(clone(this), {
  6581. url: this.url,
  6582. status: this.status,
  6583. statusText: this.statusText,
  6584. headers: this.headers,
  6585. ok: this.ok,
  6586. redirected: this.redirected
  6587. });
  6588. }
  6589. }
  6590. Body.mixIn(Response.prototype);
  6591. Object.defineProperties(Response.prototype, {
  6592. url: { enumerable: true },
  6593. status: { enumerable: true },
  6594. ok: { enumerable: true },
  6595. redirected: { enumerable: true },
  6596. statusText: { enumerable: true },
  6597. headers: { enumerable: true },
  6598. clone: { enumerable: true }
  6599. });
  6600. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6601. value: 'Response',
  6602. writable: false,
  6603. enumerable: false,
  6604. configurable: true
  6605. });
  6606. const INTERNALS$2 = Symbol('Request internals');
  6607. // fix an issue where "format", "parse" aren't a named export for node <10
  6608. const parse_url = Url.parse;
  6609. const format_url = Url.format;
  6610. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6611. /**
  6612. * Check if a value is an instance of Request.
  6613. *
  6614. * @param Mixed input
  6615. * @return Boolean
  6616. */
  6617. function isRequest(input) {
  6618. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6619. }
  6620. function isAbortSignal(signal) {
  6621. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6622. return !!(proto && proto.constructor.name === 'AbortSignal');
  6623. }
  6624. /**
  6625. * Request class
  6626. *
  6627. * @param Mixed input Url or Request instance
  6628. * @param Object init Custom options
  6629. * @return Void
  6630. */
  6631. class Request {
  6632. constructor(input) {
  6633. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6634. let parsedURL;
  6635. // normalize input
  6636. if (!isRequest(input)) {
  6637. if (input && input.href) {
  6638. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6639. // will fall into this branch also (since their `toString()` will return
  6640. // `href` property anyway)
  6641. parsedURL = parse_url(input.href);
  6642. } else {
  6643. // coerce input to a string before attempting to parse
  6644. parsedURL = parse_url(`${input}`);
  6645. }
  6646. input = {};
  6647. } else {
  6648. parsedURL = parse_url(input.url);
  6649. }
  6650. let method = init.method || input.method || 'GET';
  6651. method = method.toUpperCase();
  6652. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6653. throw new TypeError('Request with GET/HEAD method cannot have body');
  6654. }
  6655. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6656. Body.call(this, inputBody, {
  6657. timeout: init.timeout || input.timeout || 0,
  6658. size: init.size || input.size || 0
  6659. });
  6660. const headers = new Headers(init.headers || input.headers || {});
  6661. if (inputBody != null && !headers.has('Content-Type')) {
  6662. const contentType = extractContentType(inputBody);
  6663. if (contentType) {
  6664. headers.append('Content-Type', contentType);
  6665. }
  6666. }
  6667. let signal = isRequest(input) ? input.signal : null;
  6668. if ('signal' in init) signal = init.signal;
  6669. if (signal != null && !isAbortSignal(signal)) {
  6670. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6671. }
  6672. this[INTERNALS$2] = {
  6673. method,
  6674. redirect: init.redirect || input.redirect || 'follow',
  6675. headers,
  6676. parsedURL,
  6677. signal
  6678. };
  6679. // node-fetch-only options
  6680. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6681. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6682. this.counter = init.counter || input.counter || 0;
  6683. this.agent = init.agent || input.agent;
  6684. }
  6685. get method() {
  6686. return this[INTERNALS$2].method;
  6687. }
  6688. get url() {
  6689. return format_url(this[INTERNALS$2].parsedURL);
  6690. }
  6691. get headers() {
  6692. return this[INTERNALS$2].headers;
  6693. }
  6694. get redirect() {
  6695. return this[INTERNALS$2].redirect;
  6696. }
  6697. get signal() {
  6698. return this[INTERNALS$2].signal;
  6699. }
  6700. /**
  6701. * Clone this request
  6702. *
  6703. * @return Request
  6704. */
  6705. clone() {
  6706. return new Request(this);
  6707. }
  6708. }
  6709. Body.mixIn(Request.prototype);
  6710. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6711. value: 'Request',
  6712. writable: false,
  6713. enumerable: false,
  6714. configurable: true
  6715. });
  6716. Object.defineProperties(Request.prototype, {
  6717. method: { enumerable: true },
  6718. url: { enumerable: true },
  6719. headers: { enumerable: true },
  6720. redirect: { enumerable: true },
  6721. clone: { enumerable: true },
  6722. signal: { enumerable: true }
  6723. });
  6724. /**
  6725. * Convert a Request to Node.js http request options.
  6726. *
  6727. * @param Request A Request instance
  6728. * @return Object The options object to be passed to http.request
  6729. */
  6730. function getNodeRequestOptions(request) {
  6731. const parsedURL = request[INTERNALS$2].parsedURL;
  6732. const headers = new Headers(request[INTERNALS$2].headers);
  6733. // fetch step 1.3
  6734. if (!headers.has('Accept')) {
  6735. headers.set('Accept', '*/*');
  6736. }
  6737. // Basic fetch
  6738. if (!parsedURL.protocol || !parsedURL.hostname) {
  6739. throw new TypeError('Only absolute URLs are supported');
  6740. }
  6741. if (!/^https?:$/.test(parsedURL.protocol)) {
  6742. throw new TypeError('Only HTTP(S) protocols are supported');
  6743. }
  6744. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6745. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6746. }
  6747. // HTTP-network-or-cache fetch steps 2.4-2.7
  6748. let contentLengthValue = null;
  6749. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6750. contentLengthValue = '0';
  6751. }
  6752. if (request.body != null) {
  6753. const totalBytes = getTotalBytes(request);
  6754. if (typeof totalBytes === 'number') {
  6755. contentLengthValue = String(totalBytes);
  6756. }
  6757. }
  6758. if (contentLengthValue) {
  6759. headers.set('Content-Length', contentLengthValue);
  6760. }
  6761. // HTTP-network-or-cache fetch step 2.11
  6762. if (!headers.has('User-Agent')) {
  6763. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6764. }
  6765. // HTTP-network-or-cache fetch step 2.15
  6766. if (request.compress && !headers.has('Accept-Encoding')) {
  6767. headers.set('Accept-Encoding', 'gzip,deflate');
  6768. }
  6769. let agent = request.agent;
  6770. if (typeof agent === 'function') {
  6771. agent = agent(parsedURL);
  6772. }
  6773. if (!headers.has('Connection') && !agent) {
  6774. headers.set('Connection', 'close');
  6775. }
  6776. // HTTP-network fetch step 4.2
  6777. // chunked encoding is handled by Node.js
  6778. return Object.assign({}, parsedURL, {
  6779. method: request.method,
  6780. headers: exportNodeCompatibleHeaders(headers),
  6781. agent
  6782. });
  6783. }
  6784. /**
  6785. * abort-error.js
  6786. *
  6787. * AbortError interface for cancelled requests
  6788. */
  6789. /**
  6790. * Create AbortError instance
  6791. *
  6792. * @param String message Error message for human
  6793. * @return AbortError
  6794. */
  6795. function AbortError(message) {
  6796. Error.call(this, message);
  6797. this.type = 'aborted';
  6798. this.message = message;
  6799. // hide custom error implementation details from end-users
  6800. Error.captureStackTrace(this, this.constructor);
  6801. }
  6802. AbortError.prototype = Object.create(Error.prototype);
  6803. AbortError.prototype.constructor = AbortError;
  6804. AbortError.prototype.name = 'AbortError';
  6805. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6806. const PassThrough$1 = Stream.PassThrough;
  6807. const resolve_url = Url.resolve;
  6808. /**
  6809. * Fetch function
  6810. *
  6811. * @param Mixed url Absolute url or Request instance
  6812. * @param Object opts Fetch options
  6813. * @return Promise
  6814. */
  6815. function fetch(url, opts) {
  6816. // allow custom promise
  6817. if (!fetch.Promise) {
  6818. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6819. }
  6820. Body.Promise = fetch.Promise;
  6821. // wrap http.request into fetch
  6822. return new fetch.Promise(function (resolve, reject) {
  6823. // build request object
  6824. const request = new Request(url, opts);
  6825. const options = getNodeRequestOptions(request);
  6826. const send = (options.protocol === 'https:' ? https : http).request;
  6827. const signal = request.signal;
  6828. let response = null;
  6829. const abort = function abort() {
  6830. let error = new AbortError('The user aborted a request.');
  6831. reject(error);
  6832. if (request.body && request.body instanceof Stream.Readable) {
  6833. request.body.destroy(error);
  6834. }
  6835. if (!response || !response.body) return;
  6836. response.body.emit('error', error);
  6837. };
  6838. if (signal && signal.aborted) {
  6839. abort();
  6840. return;
  6841. }
  6842. const abortAndFinalize = function abortAndFinalize() {
  6843. abort();
  6844. finalize();
  6845. };
  6846. // send request
  6847. const req = send(options);
  6848. let reqTimeout;
  6849. if (signal) {
  6850. signal.addEventListener('abort', abortAndFinalize);
  6851. }
  6852. function finalize() {
  6853. req.abort();
  6854. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6855. clearTimeout(reqTimeout);
  6856. }
  6857. if (request.timeout) {
  6858. req.once('socket', function (socket) {
  6859. reqTimeout = setTimeout(function () {
  6860. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6861. finalize();
  6862. }, request.timeout);
  6863. });
  6864. }
  6865. req.on('error', function (err) {
  6866. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6867. finalize();
  6868. });
  6869. req.on('response', function (res) {
  6870. clearTimeout(reqTimeout);
  6871. const headers = createHeadersLenient(res.headers);
  6872. // HTTP fetch step 5
  6873. if (fetch.isRedirect(res.statusCode)) {
  6874. // HTTP fetch step 5.2
  6875. const location = headers.get('Location');
  6876. // HTTP fetch step 5.3
  6877. const locationURL = location === null ? null : resolve_url(request.url, location);
  6878. // HTTP fetch step 5.5
  6879. switch (request.redirect) {
  6880. case 'error':
  6881. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6882. finalize();
  6883. return;
  6884. case 'manual':
  6885. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6886. if (locationURL !== null) {
  6887. // handle corrupted header
  6888. try {
  6889. headers.set('Location', locationURL);
  6890. } catch (err) {
  6891. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6892. reject(err);
  6893. }
  6894. }
  6895. break;
  6896. case 'follow':
  6897. // HTTP-redirect fetch step 2
  6898. if (locationURL === null) {
  6899. break;
  6900. }
  6901. // HTTP-redirect fetch step 5
  6902. if (request.counter >= request.follow) {
  6903. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6904. finalize();
  6905. return;
  6906. }
  6907. // HTTP-redirect fetch step 6 (counter increment)
  6908. // Create a new Request object.
  6909. const requestOpts = {
  6910. headers: new Headers(request.headers),
  6911. follow: request.follow,
  6912. counter: request.counter + 1,
  6913. agent: request.agent,
  6914. compress: request.compress,
  6915. method: request.method,
  6916. body: request.body,
  6917. signal: request.signal,
  6918. timeout: request.timeout
  6919. };
  6920. // HTTP-redirect fetch step 9
  6921. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  6922. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  6923. finalize();
  6924. return;
  6925. }
  6926. // HTTP-redirect fetch step 11
  6927. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  6928. requestOpts.method = 'GET';
  6929. requestOpts.body = undefined;
  6930. requestOpts.headers.delete('content-length');
  6931. }
  6932. // HTTP-redirect fetch step 15
  6933. resolve(fetch(new Request(locationURL, requestOpts)));
  6934. finalize();
  6935. return;
  6936. }
  6937. }
  6938. // prepare response
  6939. res.once('end', function () {
  6940. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6941. });
  6942. let body = res.pipe(new PassThrough$1());
  6943. const response_options = {
  6944. url: request.url,
  6945. status: res.statusCode,
  6946. statusText: res.statusMessage,
  6947. headers: headers,
  6948. size: request.size,
  6949. timeout: request.timeout,
  6950. counter: request.counter
  6951. };
  6952. // HTTP-network fetch step 12.1.1.3
  6953. const codings = headers.get('Content-Encoding');
  6954. // HTTP-network fetch step 12.1.1.4: handle content codings
  6955. // in following scenarios we ignore compression support
  6956. // 1. compression support is disabled
  6957. // 2. HEAD request
  6958. // 3. no Content-Encoding header
  6959. // 4. no content response (204)
  6960. // 5. content not modified response (304)
  6961. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  6962. response = new Response(body, response_options);
  6963. resolve(response);
  6964. return;
  6965. }
  6966. // For Node v6+
  6967. // Be less strict when decoding compressed responses, since sometimes
  6968. // servers send slightly invalid responses that are still accepted
  6969. // by common browsers.
  6970. // Always using Z_SYNC_FLUSH is what cURL does.
  6971. const zlibOptions = {
  6972. flush: zlib.Z_SYNC_FLUSH,
  6973. finishFlush: zlib.Z_SYNC_FLUSH
  6974. };
  6975. // for gzip
  6976. if (codings == 'gzip' || codings == 'x-gzip') {
  6977. body = body.pipe(zlib.createGunzip(zlibOptions));
  6978. response = new Response(body, response_options);
  6979. resolve(response);
  6980. return;
  6981. }
  6982. // for deflate
  6983. if (codings == 'deflate' || codings == 'x-deflate') {
  6984. // handle the infamous raw deflate response from old servers
  6985. // a hack for old IIS and Apache servers
  6986. const raw = res.pipe(new PassThrough$1());
  6987. raw.once('data', function (chunk) {
  6988. // see http://stackoverflow.com/questions/37519828
  6989. if ((chunk[0] & 0x0F) === 0x08) {
  6990. body = body.pipe(zlib.createInflate());
  6991. } else {
  6992. body = body.pipe(zlib.createInflateRaw());
  6993. }
  6994. response = new Response(body, response_options);
  6995. resolve(response);
  6996. });
  6997. return;
  6998. }
  6999. // for br
  7000. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7001. body = body.pipe(zlib.createBrotliDecompress());
  7002. response = new Response(body, response_options);
  7003. resolve(response);
  7004. return;
  7005. }
  7006. // otherwise, use response as-is
  7007. response = new Response(body, response_options);
  7008. resolve(response);
  7009. });
  7010. writeToStream(req, request);
  7011. });
  7012. }
  7013. /**
  7014. * Redirect code matching
  7015. *
  7016. * @param Number code Status code
  7017. * @return Boolean
  7018. */
  7019. fetch.isRedirect = function (code) {
  7020. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7021. };
  7022. // expose Promise
  7023. fetch.Promise = global.Promise;
  7024. module.exports = exports = fetch;
  7025. Object.defineProperty(exports, "__esModule", { value: true });
  7026. exports.default = exports;
  7027. exports.Headers = Headers;
  7028. exports.Request = Request;
  7029. exports.Response = Response;
  7030. exports.FetchError = FetchError;
  7031. /***/ }),
  7032. /***/ 462:
  7033. /***/ (function(module) {
  7034. "use strict";
  7035. // See http://www.robvanderwoude.com/escapechars.php
  7036. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7037. function escapeCommand(arg) {
  7038. // Escape meta chars
  7039. arg = arg.replace(metaCharsRegExp, '^$1');
  7040. return arg;
  7041. }
  7042. function escapeArgument(arg, doubleEscapeMetaChars) {
  7043. // Convert to string
  7044. arg = `${arg}`;
  7045. // Algorithm below is based on https://qntm.org/cmd
  7046. // Sequence of backslashes followed by a double quote:
  7047. // double up all the backslashes and escape the double quote
  7048. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7049. // Sequence of backslashes followed by the end of the string
  7050. // (which will become a double quote later):
  7051. // double up all the backslashes
  7052. arg = arg.replace(/(\\*)$/, '$1$1');
  7053. // All other backslashes occur literally
  7054. // Quote the whole thing:
  7055. arg = `"${arg}"`;
  7056. // Escape meta chars
  7057. arg = arg.replace(metaCharsRegExp, '^$1');
  7058. // Double escape meta chars if necessary
  7059. if (doubleEscapeMetaChars) {
  7060. arg = arg.replace(metaCharsRegExp, '^$1');
  7061. }
  7062. return arg;
  7063. }
  7064. module.exports.command = escapeCommand;
  7065. module.exports.argument = escapeArgument;
  7066. /***/ }),
  7067. /***/ 463:
  7068. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7069. "use strict";
  7070. Object.defineProperty(exports, '__esModule', { value: true });
  7071. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7072. var deprecation = __webpack_require__(692);
  7073. var once = _interopDefault(__webpack_require__(969));
  7074. const logOnce = once(deprecation => console.warn(deprecation));
  7075. /**
  7076. * Error with extra properties to help with debugging
  7077. */
  7078. class RequestError extends Error {
  7079. constructor(message, statusCode, options) {
  7080. super(message); // Maintains proper stack trace (only available on V8)
  7081. /* istanbul ignore next */
  7082. if (Error.captureStackTrace) {
  7083. Error.captureStackTrace(this, this.constructor);
  7084. }
  7085. this.name = "HttpError";
  7086. this.status = statusCode;
  7087. Object.defineProperty(this, "code", {
  7088. get() {
  7089. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7090. return statusCode;
  7091. }
  7092. });
  7093. this.headers = options.headers; // redact request credentials without mutating original request options
  7094. const requestCopy = Object.assign({}, options.request);
  7095. if (options.request.headers.authorization) {
  7096. requestCopy.headers = Object.assign({}, options.request.headers, {
  7097. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7098. });
  7099. }
  7100. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7101. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7102. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7103. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7104. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7105. this.request = requestCopy;
  7106. }
  7107. }
  7108. exports.RequestError = RequestError;
  7109. /***/ }),
  7110. /***/ 469:
  7111. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7112. "use strict";
  7113. var __importDefault = (this && this.__importDefault) || function (mod) {
  7114. return (mod && mod.__esModule) ? mod : { "default": mod };
  7115. };
  7116. var __importStar = (this && this.__importStar) || function (mod) {
  7117. if (mod && mod.__esModule) return mod;
  7118. var result = {};
  7119. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7120. result["default"] = mod;
  7121. return result;
  7122. };
  7123. Object.defineProperty(exports, "__esModule", { value: true });
  7124. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7125. const graphql_1 = __webpack_require__(503);
  7126. const rest_1 = __importDefault(__webpack_require__(613));
  7127. const Context = __importStar(__webpack_require__(262));
  7128. // We need this in order to extend Octokit
  7129. rest_1.default.prototype = new rest_1.default();
  7130. exports.context = new Context.Context();
  7131. class GitHub extends rest_1.default {
  7132. constructor(token, opts = {}) {
  7133. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7134. this.graphql = graphql_1.defaults({
  7135. headers: { authorization: `token ${token}` }
  7136. });
  7137. }
  7138. }
  7139. exports.GitHub = GitHub;
  7140. //# sourceMappingURL=github.js.map
  7141. /***/ }),
  7142. /***/ 470:
  7143. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7144. "use strict";
  7145. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7146. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7147. return new (P || (P = Promise))(function (resolve, reject) {
  7148. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7149. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7150. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7151. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7152. });
  7153. };
  7154. Object.defineProperty(exports, "__esModule", { value: true });
  7155. const command_1 = __webpack_require__(431);
  7156. const os = __webpack_require__(87);
  7157. const path = __webpack_require__(622);
  7158. /**
  7159. * The code to exit an action
  7160. */
  7161. var ExitCode;
  7162. (function (ExitCode) {
  7163. /**
  7164. * A code indicating that the action was successful
  7165. */
  7166. ExitCode[ExitCode["Success"] = 0] = "Success";
  7167. /**
  7168. * A code indicating that the action was a failure
  7169. */
  7170. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7171. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7172. //-----------------------------------------------------------------------
  7173. // Variables
  7174. //-----------------------------------------------------------------------
  7175. /**
  7176. * Sets env variable for this action and future actions in the job
  7177. * @param name the name of the variable to set
  7178. * @param val the value of the variable
  7179. */
  7180. function exportVariable(name, val) {
  7181. process.env[name] = val;
  7182. command_1.issueCommand('set-env', { name }, val);
  7183. }
  7184. exports.exportVariable = exportVariable;
  7185. /**
  7186. * Registers a secret which will get masked from logs
  7187. * @param secret value of the secret
  7188. */
  7189. function setSecret(secret) {
  7190. command_1.issueCommand('add-mask', {}, secret);
  7191. }
  7192. exports.setSecret = setSecret;
  7193. /**
  7194. * Prepends inputPath to the PATH (for this action and future actions)
  7195. * @param inputPath
  7196. */
  7197. function addPath(inputPath) {
  7198. command_1.issueCommand('add-path', {}, inputPath);
  7199. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7200. }
  7201. exports.addPath = addPath;
  7202. /**
  7203. * Gets the value of an input. The value is also trimmed.
  7204. *
  7205. * @param name name of the input to get
  7206. * @param options optional. See InputOptions.
  7207. * @returns string
  7208. */
  7209. function getInput(name, options) {
  7210. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7211. if (options && options.required && !val) {
  7212. throw new Error(`Input required and not supplied: ${name}`);
  7213. }
  7214. return val.trim();
  7215. }
  7216. exports.getInput = getInput;
  7217. /**
  7218. * Sets the value of an output.
  7219. *
  7220. * @param name name of the output to set
  7221. * @param value value to store
  7222. */
  7223. function setOutput(name, value) {
  7224. command_1.issueCommand('set-output', { name }, value);
  7225. }
  7226. exports.setOutput = setOutput;
  7227. //-----------------------------------------------------------------------
  7228. // Results
  7229. //-----------------------------------------------------------------------
  7230. /**
  7231. * Sets the action status to failed.
  7232. * When the action exits it will be with an exit code of 1
  7233. * @param message add error issue message
  7234. */
  7235. function setFailed(message) {
  7236. process.exitCode = ExitCode.Failure;
  7237. error(message);
  7238. }
  7239. exports.setFailed = setFailed;
  7240. //-----------------------------------------------------------------------
  7241. // Logging Commands
  7242. //-----------------------------------------------------------------------
  7243. /**
  7244. * Writes debug message to user log
  7245. * @param message debug message
  7246. */
  7247. function debug(message) {
  7248. command_1.issueCommand('debug', {}, message);
  7249. }
  7250. exports.debug = debug;
  7251. /**
  7252. * Adds an error issue
  7253. * @param message error issue message
  7254. */
  7255. function error(message) {
  7256. command_1.issue('error', message);
  7257. }
  7258. exports.error = error;
  7259. /**
  7260. * Adds an warning issue
  7261. * @param message warning issue message
  7262. */
  7263. function warning(message) {
  7264. command_1.issue('warning', message);
  7265. }
  7266. exports.warning = warning;
  7267. /**
  7268. * Writes info to log with console.log.
  7269. * @param message info message
  7270. */
  7271. function info(message) {
  7272. process.stdout.write(message + os.EOL);
  7273. }
  7274. exports.info = info;
  7275. /**
  7276. * Begin an output group.
  7277. *
  7278. * Output until the next `groupEnd` will be foldable in this group
  7279. *
  7280. * @param name The name of the output group
  7281. */
  7282. function startGroup(name) {
  7283. command_1.issue('group', name);
  7284. }
  7285. exports.startGroup = startGroup;
  7286. /**
  7287. * End an output group.
  7288. */
  7289. function endGroup() {
  7290. command_1.issue('endgroup');
  7291. }
  7292. exports.endGroup = endGroup;
  7293. /**
  7294. * Wrap an asynchronous function call in a group.
  7295. *
  7296. * Returns the same type as the function itself.
  7297. *
  7298. * @param name The name of the group
  7299. * @param fn The function to wrap in the group
  7300. */
  7301. function group(name, fn) {
  7302. return __awaiter(this, void 0, void 0, function* () {
  7303. startGroup(name);
  7304. let result;
  7305. try {
  7306. result = yield fn();
  7307. }
  7308. finally {
  7309. endGroup();
  7310. }
  7311. return result;
  7312. });
  7313. }
  7314. exports.group = group;
  7315. //# sourceMappingURL=core.js.map
  7316. /***/ }),
  7317. /***/ 471:
  7318. /***/ (function(module, __unusedexports, __webpack_require__) {
  7319. module.exports = authenticationBeforeRequest;
  7320. const btoa = __webpack_require__(675);
  7321. const uniq = __webpack_require__(126);
  7322. function authenticationBeforeRequest(state, options) {
  7323. if (!state.auth.type) {
  7324. return;
  7325. }
  7326. if (state.auth.type === "basic") {
  7327. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7328. options.headers.authorization = `Basic ${hash}`;
  7329. return;
  7330. }
  7331. if (state.auth.type === "token") {
  7332. options.headers.authorization = `token ${state.auth.token}`;
  7333. return;
  7334. }
  7335. if (state.auth.type === "app") {
  7336. options.headers.authorization = `Bearer ${state.auth.token}`;
  7337. const acceptHeaders = options.headers.accept
  7338. .split(",")
  7339. .concat("application/vnd.github.machine-man-preview+json");
  7340. options.headers.accept = uniq(acceptHeaders)
  7341. .filter(Boolean)
  7342. .join(",");
  7343. return;
  7344. }
  7345. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7346. if (state.auth.token) {
  7347. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7348. return;
  7349. }
  7350. const key = encodeURIComponent(state.auth.key);
  7351. const secret = encodeURIComponent(state.auth.secret);
  7352. options.url += `client_id=${key}&client_secret=${secret}`;
  7353. }
  7354. /***/ }),
  7355. /***/ 489:
  7356. /***/ (function(module, __unusedexports, __webpack_require__) {
  7357. "use strict";
  7358. const path = __webpack_require__(622);
  7359. const which = __webpack_require__(814);
  7360. const pathKey = __webpack_require__(39)();
  7361. function resolveCommandAttempt(parsed, withoutPathExt) {
  7362. const cwd = process.cwd();
  7363. const hasCustomCwd = parsed.options.cwd != null;
  7364. // If a custom `cwd` was specified, we need to change the process cwd
  7365. // because `which` will do stat calls but does not support a custom cwd
  7366. if (hasCustomCwd) {
  7367. try {
  7368. process.chdir(parsed.options.cwd);
  7369. } catch (err) {
  7370. /* Empty */
  7371. }
  7372. }
  7373. let resolved;
  7374. try {
  7375. resolved = which.sync(parsed.command, {
  7376. path: (parsed.options.env || process.env)[pathKey],
  7377. pathExt: withoutPathExt ? path.delimiter : undefined,
  7378. });
  7379. } catch (e) {
  7380. /* Empty */
  7381. } finally {
  7382. process.chdir(cwd);
  7383. }
  7384. // If we successfully resolved, ensure that an absolute path is returned
  7385. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7386. if (resolved) {
  7387. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7388. }
  7389. return resolved;
  7390. }
  7391. function resolveCommand(parsed) {
  7392. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7393. }
  7394. module.exports = resolveCommand;
  7395. /***/ }),
  7396. /***/ 500:
  7397. /***/ (function(module, __unusedexports, __webpack_require__) {
  7398. module.exports = graphql
  7399. const GraphqlError = __webpack_require__(862)
  7400. const NON_VARIABLE_OPTIONS = ['method', 'baseUrl', 'url', 'headers', 'request', 'query']
  7401. function graphql (request, query, options) {
  7402. if (typeof query === 'string') {
  7403. options = Object.assign({ query }, options)
  7404. } else {
  7405. options = query
  7406. }
  7407. const requestOptions = Object.keys(options).reduce((result, key) => {
  7408. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7409. result[key] = options[key]
  7410. return result
  7411. }
  7412. if (!result.variables) {
  7413. result.variables = {}
  7414. }
  7415. result.variables[key] = options[key]
  7416. return result
  7417. }, {})
  7418. return request(requestOptions)
  7419. .then(response => {
  7420. if (response.data.errors) {
  7421. throw new GraphqlError(requestOptions, response)
  7422. }
  7423. return response.data.data
  7424. })
  7425. }
  7426. /***/ }),
  7427. /***/ 503:
  7428. /***/ (function(module, __unusedexports, __webpack_require__) {
  7429. const { request } = __webpack_require__(753)
  7430. const getUserAgent = __webpack_require__(46)
  7431. const version = __webpack_require__(314).version
  7432. const userAgent = `octokit-graphql.js/${version} ${getUserAgent()}`
  7433. const withDefaults = __webpack_require__(0)
  7434. module.exports = withDefaults(request, {
  7435. method: 'POST',
  7436. url: '/graphql',
  7437. headers: {
  7438. 'user-agent': userAgent
  7439. }
  7440. })
  7441. /***/ }),
  7442. /***/ 510:
  7443. /***/ (function(module) {
  7444. module.exports = addHook
  7445. function addHook (state, kind, name, hook) {
  7446. var orig = hook
  7447. if (!state.registry[name]) {
  7448. state.registry[name] = []
  7449. }
  7450. if (kind === 'before') {
  7451. hook = function (method, options) {
  7452. return Promise.resolve()
  7453. .then(orig.bind(null, options))
  7454. .then(method.bind(null, options))
  7455. }
  7456. }
  7457. if (kind === 'after') {
  7458. hook = function (method, options) {
  7459. var result
  7460. return Promise.resolve()
  7461. .then(method.bind(null, options))
  7462. .then(function (result_) {
  7463. result = result_
  7464. return orig(result, options)
  7465. })
  7466. .then(function () {
  7467. return result
  7468. })
  7469. }
  7470. }
  7471. if (kind === 'error') {
  7472. hook = function (method, options) {
  7473. return Promise.resolve()
  7474. .then(method.bind(null, options))
  7475. .catch(function (error) {
  7476. return orig(error, options)
  7477. })
  7478. }
  7479. }
  7480. state.registry[name].push({
  7481. hook: hook,
  7482. orig: orig
  7483. })
  7484. }
  7485. /***/ }),
  7486. /***/ 523:
  7487. /***/ (function(module, __unusedexports, __webpack_require__) {
  7488. var register = __webpack_require__(363)
  7489. var addHook = __webpack_require__(510)
  7490. var removeHook = __webpack_require__(763)
  7491. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7492. var bind = Function.bind
  7493. var bindable = bind.bind(bind)
  7494. function bindApi (hook, state, name) {
  7495. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7496. hook.api = { remove: removeHookRef }
  7497. hook.remove = removeHookRef
  7498. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7499. var args = name ? [state, kind, name] : [state, kind]
  7500. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7501. })
  7502. }
  7503. function HookSingular () {
  7504. var singularHookName = 'h'
  7505. var singularHookState = {
  7506. registry: {}
  7507. }
  7508. var singularHook = register.bind(null, singularHookState, singularHookName)
  7509. bindApi(singularHook, singularHookState, singularHookName)
  7510. return singularHook
  7511. }
  7512. function HookCollection () {
  7513. var state = {
  7514. registry: {}
  7515. }
  7516. var hook = register.bind(null, state)
  7517. bindApi(hook, state)
  7518. return hook
  7519. }
  7520. var collectionHookDeprecationMessageDisplayed = false
  7521. function Hook () {
  7522. if (!collectionHookDeprecationMessageDisplayed) {
  7523. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7524. collectionHookDeprecationMessageDisplayed = true
  7525. }
  7526. return HookCollection()
  7527. }
  7528. Hook.Singular = HookSingular.bind()
  7529. Hook.Collection = HookCollection.bind()
  7530. module.exports = Hook
  7531. // expose constructors as a named property for TypeScript
  7532. module.exports.Hook = Hook
  7533. module.exports.Singular = Hook.Singular
  7534. module.exports.Collection = Hook.Collection
  7535. /***/ }),
  7536. /***/ 529:
  7537. /***/ (function(module, __unusedexports, __webpack_require__) {
  7538. const factory = __webpack_require__(47);
  7539. module.exports = factory();
  7540. /***/ }),
  7541. /***/ 536:
  7542. /***/ (function(module, __unusedexports, __webpack_require__) {
  7543. module.exports = hasFirstPage
  7544. const deprecate = __webpack_require__(370)
  7545. const getPageLinks = __webpack_require__(577)
  7546. function hasFirstPage (link) {
  7547. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7548. return getPageLinks(link).first
  7549. }
  7550. /***/ }),
  7551. /***/ 550:
  7552. /***/ (function(module, __unusedexports, __webpack_require__) {
  7553. module.exports = getNextPage
  7554. const getPage = __webpack_require__(265)
  7555. function getNextPage (octokit, link, headers) {
  7556. return getPage(octokit, link, 'next', headers)
  7557. }
  7558. /***/ }),
  7559. /***/ 558:
  7560. /***/ (function(module, __unusedexports, __webpack_require__) {
  7561. module.exports = hasPreviousPage
  7562. const deprecate = __webpack_require__(370)
  7563. const getPageLinks = __webpack_require__(577)
  7564. function hasPreviousPage (link) {
  7565. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7566. return getPageLinks(link).prev
  7567. }
  7568. /***/ }),
  7569. /***/ 559:
  7570. /***/ (function(__unusedmodule, exports) {
  7571. "use strict";
  7572. Object.defineProperty(exports, "__esModule", { value: true });
  7573. class GitVersion {
  7574. /**
  7575. * Used for comparing the version of git and git-lfs against the minimum required version
  7576. * @param version the version string, e.g. 1.2 or 1.2.3
  7577. */
  7578. constructor(version) {
  7579. this.major = NaN;
  7580. this.minor = NaN;
  7581. this.patch = NaN;
  7582. if (version) {
  7583. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  7584. if (match) {
  7585. this.major = Number(match[1]);
  7586. this.minor = Number(match[2]);
  7587. if (match[4]) {
  7588. this.patch = Number(match[4]);
  7589. }
  7590. }
  7591. }
  7592. }
  7593. /**
  7594. * Compares the instance against a minimum required version
  7595. * @param minimum Minimum version
  7596. */
  7597. checkMinimum(minimum) {
  7598. if (!minimum.isValid()) {
  7599. throw new Error('Arg minimum is not a valid version');
  7600. }
  7601. // Major is insufficient
  7602. if (this.major < minimum.major) {
  7603. return false;
  7604. }
  7605. // Major is equal
  7606. if (this.major === minimum.major) {
  7607. // Minor is insufficient
  7608. if (this.minor < minimum.minor) {
  7609. return false;
  7610. }
  7611. // Minor is equal
  7612. if (this.minor === minimum.minor) {
  7613. // Patch is insufficient
  7614. if (this.patch && this.patch < (minimum.patch || 0)) {
  7615. return false;
  7616. }
  7617. }
  7618. }
  7619. return true;
  7620. }
  7621. /**
  7622. * Indicates whether the instance was constructed from a valid version string
  7623. */
  7624. isValid() {
  7625. return !isNaN(this.major);
  7626. }
  7627. /**
  7628. * Returns the version as a string, e.g. 1.2 or 1.2.3
  7629. */
  7630. toString() {
  7631. let result = '';
  7632. if (this.isValid()) {
  7633. result = `${this.major}.${this.minor}`;
  7634. if (!isNaN(this.patch)) {
  7635. result += `.${this.patch}`;
  7636. }
  7637. }
  7638. return result;
  7639. }
  7640. }
  7641. exports.GitVersion = GitVersion;
  7642. /***/ }),
  7643. /***/ 562:
  7644. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7645. "use strict";
  7646. Object.defineProperty(exports, '__esModule', { value: true });
  7647. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7648. var osName = _interopDefault(__webpack_require__(2));
  7649. function getUserAgent() {
  7650. try {
  7651. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  7652. } catch (error) {
  7653. if (/wmic os get Caption/.test(error.message)) {
  7654. return "Windows <version undetectable>";
  7655. }
  7656. throw error;
  7657. }
  7658. }
  7659. exports.getUserAgent = getUserAgent;
  7660. //# sourceMappingURL=index.js.map
  7661. /***/ }),
  7662. /***/ 563:
  7663. /***/ (function(module, __unusedexports, __webpack_require__) {
  7664. module.exports = getPreviousPage
  7665. const getPage = __webpack_require__(265)
  7666. function getPreviousPage (octokit, link, headers) {
  7667. return getPage(octokit, link, 'prev', headers)
  7668. }
  7669. /***/ }),
  7670. /***/ 568:
  7671. /***/ (function(module, __unusedexports, __webpack_require__) {
  7672. "use strict";
  7673. const path = __webpack_require__(622);
  7674. const niceTry = __webpack_require__(948);
  7675. const resolveCommand = __webpack_require__(489);
  7676. const escape = __webpack_require__(462);
  7677. const readShebang = __webpack_require__(389);
  7678. const semver = __webpack_require__(280);
  7679. const isWin = process.platform === 'win32';
  7680. const isExecutableRegExp = /\.(?:com|exe)$/i;
  7681. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  7682. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  7683. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  7684. function detectShebang(parsed) {
  7685. parsed.file = resolveCommand(parsed);
  7686. const shebang = parsed.file && readShebang(parsed.file);
  7687. if (shebang) {
  7688. parsed.args.unshift(parsed.file);
  7689. parsed.command = shebang;
  7690. return resolveCommand(parsed);
  7691. }
  7692. return parsed.file;
  7693. }
  7694. function parseNonShell(parsed) {
  7695. if (!isWin) {
  7696. return parsed;
  7697. }
  7698. // Detect & add support for shebangs
  7699. const commandFile = detectShebang(parsed);
  7700. // We don't need a shell if the command filename is an executable
  7701. const needsShell = !isExecutableRegExp.test(commandFile);
  7702. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  7703. // Note that `forceShell` is an hidden option used only in tests
  7704. if (parsed.options.forceShell || needsShell) {
  7705. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  7706. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  7707. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  7708. // we need to double escape them
  7709. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  7710. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  7711. // This is necessary otherwise it will always fail with ENOENT in those cases
  7712. parsed.command = path.normalize(parsed.command);
  7713. // Escape command & arguments
  7714. parsed.command = escape.command(parsed.command);
  7715. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  7716. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7717. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7718. parsed.command = process.env.comspec || 'cmd.exe';
  7719. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7720. }
  7721. return parsed;
  7722. }
  7723. function parseShell(parsed) {
  7724. // If node supports the shell option, there's no need to mimic its behavior
  7725. if (supportsShellOption) {
  7726. return parsed;
  7727. }
  7728. // Mimic node shell option
  7729. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  7730. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7731. if (isWin) {
  7732. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  7733. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7734. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7735. } else {
  7736. if (typeof parsed.options.shell === 'string') {
  7737. parsed.command = parsed.options.shell;
  7738. } else if (process.platform === 'android') {
  7739. parsed.command = '/system/bin/sh';
  7740. } else {
  7741. parsed.command = '/bin/sh';
  7742. }
  7743. parsed.args = ['-c', shellCommand];
  7744. }
  7745. return parsed;
  7746. }
  7747. function parse(command, args, options) {
  7748. // Normalize arguments, similar to nodejs
  7749. if (args && !Array.isArray(args)) {
  7750. options = args;
  7751. args = null;
  7752. }
  7753. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  7754. options = Object.assign({}, options); // Clone object to avoid changing the original
  7755. // Build our parsed object
  7756. const parsed = {
  7757. command,
  7758. args,
  7759. options,
  7760. file: undefined,
  7761. original: {
  7762. command,
  7763. args,
  7764. },
  7765. };
  7766. // Delegate further parsing to shell or non-shell
  7767. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  7768. }
  7769. module.exports = parse;
  7770. /***/ }),
  7771. /***/ 577:
  7772. /***/ (function(module) {
  7773. module.exports = getPageLinks
  7774. function getPageLinks (link) {
  7775. link = link.link || link.headers.link || ''
  7776. const links = {}
  7777. // link format:
  7778. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  7779. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  7780. links[type] = uri
  7781. })
  7782. return links
  7783. }
  7784. /***/ }),
  7785. /***/ 586:
  7786. /***/ (function(module, __unusedexports, __webpack_require__) {
  7787. module.exports = octokitRestApiEndpoints;
  7788. const ROUTES = __webpack_require__(705);
  7789. function octokitRestApiEndpoints(octokit) {
  7790. // Aliasing scopes for backward compatibility
  7791. // See https://github.com/octokit/rest.js/pull/1134
  7792. ROUTES.gitdata = ROUTES.git;
  7793. ROUTES.authorization = ROUTES.oauthAuthorizations;
  7794. ROUTES.pullRequests = ROUTES.pulls;
  7795. octokit.registerEndpoints(ROUTES);
  7796. }
  7797. /***/ }),
  7798. /***/ 605:
  7799. /***/ (function(module) {
  7800. module.exports = require("http");
  7801. /***/ }),
  7802. /***/ 613:
  7803. /***/ (function(module, __unusedexports, __webpack_require__) {
  7804. const Octokit = __webpack_require__(529);
  7805. const CORE_PLUGINS = [
  7806. __webpack_require__(372),
  7807. __webpack_require__(19), // deprecated: remove in v17
  7808. __webpack_require__(190),
  7809. __webpack_require__(148),
  7810. __webpack_require__(309),
  7811. __webpack_require__(248),
  7812. __webpack_require__(586),
  7813. __webpack_require__(430),
  7814. __webpack_require__(850) // deprecated: remove in v17
  7815. ];
  7816. module.exports = Octokit.plugin(CORE_PLUGINS);
  7817. /***/ }),
  7818. /***/ 614:
  7819. /***/ (function(module) {
  7820. module.exports = require("events");
  7821. /***/ }),
  7822. /***/ 618:
  7823. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7824. "use strict";
  7825. var __importStar = (this && this.__importStar) || function (mod) {
  7826. if (mod && mod.__esModule) return mod;
  7827. var result = {};
  7828. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7829. result["default"] = mod;
  7830. return result;
  7831. };
  7832. Object.defineProperty(exports, "__esModule", { value: true });
  7833. const fs = __importStar(__webpack_require__(747));
  7834. function directoryExistsSync(path, required) {
  7835. if (!path) {
  7836. throw new Error("Arg 'path' must not be empty");
  7837. }
  7838. let stats;
  7839. try {
  7840. stats = fs.statSync(path);
  7841. }
  7842. catch (error) {
  7843. if (error.code === 'ENOENT') {
  7844. if (!required) {
  7845. return false;
  7846. }
  7847. throw new Error(`Directory '${path}' does not exist`);
  7848. }
  7849. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7850. }
  7851. if (stats.isDirectory()) {
  7852. return true;
  7853. }
  7854. else if (!required) {
  7855. return false;
  7856. }
  7857. throw new Error(`Directory '${path}' does not exist`);
  7858. }
  7859. exports.directoryExistsSync = directoryExistsSync;
  7860. function existsSync(path) {
  7861. if (!path) {
  7862. throw new Error("Arg 'path' must not be empty");
  7863. }
  7864. try {
  7865. fs.statSync(path);
  7866. }
  7867. catch (error) {
  7868. if (error.code === 'ENOENT') {
  7869. return false;
  7870. }
  7871. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7872. }
  7873. return true;
  7874. }
  7875. exports.existsSync = existsSync;
  7876. function fileExistsSync(path) {
  7877. if (!path) {
  7878. throw new Error("Arg 'path' must not be empty");
  7879. }
  7880. let stats;
  7881. try {
  7882. stats = fs.statSync(path);
  7883. }
  7884. catch (error) {
  7885. if (error.code === 'ENOENT') {
  7886. return false;
  7887. }
  7888. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7889. }
  7890. if (!stats.isDirectory()) {
  7891. return true;
  7892. }
  7893. return false;
  7894. }
  7895. exports.fileExistsSync = fileExistsSync;
  7896. /***/ }),
  7897. /***/ 619:
  7898. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7899. "use strict";
  7900. Object.defineProperty(exports, '__esModule', { value: true });
  7901. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7902. var osName = _interopDefault(__webpack_require__(2));
  7903. function getUserAgent() {
  7904. try {
  7905. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  7906. } catch (error) {
  7907. if (/wmic os get Caption/.test(error.message)) {
  7908. return "Windows <version undetectable>";
  7909. }
  7910. throw error;
  7911. }
  7912. }
  7913. exports.getUserAgent = getUserAgent;
  7914. //# sourceMappingURL=index.js.map
  7915. /***/ }),
  7916. /***/ 621:
  7917. /***/ (function(module, __unusedexports, __webpack_require__) {
  7918. "use strict";
  7919. const path = __webpack_require__(622);
  7920. const pathKey = __webpack_require__(39);
  7921. module.exports = opts => {
  7922. opts = Object.assign({
  7923. cwd: process.cwd(),
  7924. path: process.env[pathKey()]
  7925. }, opts);
  7926. let prev;
  7927. let pth = path.resolve(opts.cwd);
  7928. const ret = [];
  7929. while (prev !== pth) {
  7930. ret.push(path.join(pth, 'node_modules/.bin'));
  7931. prev = pth;
  7932. pth = path.resolve(pth, '..');
  7933. }
  7934. // ensure the running `node` binary is used
  7935. ret.push(path.dirname(process.execPath));
  7936. return ret.concat(opts.path).join(path.delimiter);
  7937. };
  7938. module.exports.env = opts => {
  7939. opts = Object.assign({
  7940. env: process.env
  7941. }, opts);
  7942. const env = Object.assign({}, opts.env);
  7943. const path = pathKey({env});
  7944. opts.path = env[path];
  7945. env[path] = module.exports(opts);
  7946. return env;
  7947. };
  7948. /***/ }),
  7949. /***/ 622:
  7950. /***/ (function(module) {
  7951. module.exports = require("path");
  7952. /***/ }),
  7953. /***/ 649:
  7954. /***/ (function(module, __unusedexports, __webpack_require__) {
  7955. module.exports = getLastPage
  7956. const getPage = __webpack_require__(265)
  7957. function getLastPage (octokit, link, headers) {
  7958. return getPage(octokit, link, 'last', headers)
  7959. }
  7960. /***/ }),
  7961. /***/ 654:
  7962. /***/ (function(module) {
  7963. // This is not the set of all possible signals.
  7964. //
  7965. // It IS, however, the set of all signals that trigger
  7966. // an exit on either Linux or BSD systems. Linux is a
  7967. // superset of the signal names supported on BSD, and
  7968. // the unknown signals just fail to register, so we can
  7969. // catch that easily enough.
  7970. //
  7971. // Don't bother with SIGKILL. It's uncatchable, which
  7972. // means that we can't fire any callbacks anyway.
  7973. //
  7974. // If a user does happen to register a handler on a non-
  7975. // fatal signal like SIGWINCH or something, and then
  7976. // exit, it'll end up firing `process.emit('exit')`, so
  7977. // the handler will be fired anyway.
  7978. //
  7979. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  7980. // artificially, inherently leave the process in a
  7981. // state from which it is not safe to try and enter JS
  7982. // listeners.
  7983. module.exports = [
  7984. 'SIGABRT',
  7985. 'SIGALRM',
  7986. 'SIGHUP',
  7987. 'SIGINT',
  7988. 'SIGTERM'
  7989. ]
  7990. if (process.platform !== 'win32') {
  7991. module.exports.push(
  7992. 'SIGVTALRM',
  7993. 'SIGXCPU',
  7994. 'SIGXFSZ',
  7995. 'SIGUSR2',
  7996. 'SIGTRAP',
  7997. 'SIGSYS',
  7998. 'SIGQUIT',
  7999. 'SIGIOT'
  8000. // should detect profiler and enable/disable accordingly.
  8001. // see #21
  8002. // 'SIGPROF'
  8003. )
  8004. }
  8005. if (process.platform === 'linux') {
  8006. module.exports.push(
  8007. 'SIGIO',
  8008. 'SIGPOLL',
  8009. 'SIGPWR',
  8010. 'SIGSTKFLT',
  8011. 'SIGUNUSED'
  8012. )
  8013. }
  8014. /***/ }),
  8015. /***/ 669:
  8016. /***/ (function(module) {
  8017. module.exports = require("util");
  8018. /***/ }),
  8019. /***/ 672:
  8020. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8021. "use strict";
  8022. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8023. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8024. return new (P || (P = Promise))(function (resolve, reject) {
  8025. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8026. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8027. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8028. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8029. });
  8030. };
  8031. var _a;
  8032. Object.defineProperty(exports, "__esModule", { value: true });
  8033. const assert_1 = __webpack_require__(357);
  8034. const fs = __webpack_require__(747);
  8035. const path = __webpack_require__(622);
  8036. _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;
  8037. exports.IS_WINDOWS = process.platform === 'win32';
  8038. function exists(fsPath) {
  8039. return __awaiter(this, void 0, void 0, function* () {
  8040. try {
  8041. yield exports.stat(fsPath);
  8042. }
  8043. catch (err) {
  8044. if (err.code === 'ENOENT') {
  8045. return false;
  8046. }
  8047. throw err;
  8048. }
  8049. return true;
  8050. });
  8051. }
  8052. exports.exists = exists;
  8053. function isDirectory(fsPath, useStat = false) {
  8054. return __awaiter(this, void 0, void 0, function* () {
  8055. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  8056. return stats.isDirectory();
  8057. });
  8058. }
  8059. exports.isDirectory = isDirectory;
  8060. /**
  8061. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  8062. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  8063. */
  8064. function isRooted(p) {
  8065. p = normalizeSeparators(p);
  8066. if (!p) {
  8067. throw new Error('isRooted() parameter "p" cannot be empty');
  8068. }
  8069. if (exports.IS_WINDOWS) {
  8070. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  8071. ); // e.g. C: or C:\hello
  8072. }
  8073. return p.startsWith('/');
  8074. }
  8075. exports.isRooted = isRooted;
  8076. /**
  8077. * Recursively create a directory at `fsPath`.
  8078. *
  8079. * This implementation is optimistic, meaning it attempts to create the full
  8080. * path first, and backs up the path stack from there.
  8081. *
  8082. * @param fsPath The path to create
  8083. * @param maxDepth The maximum recursion depth
  8084. * @param depth The current recursion depth
  8085. */
  8086. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  8087. return __awaiter(this, void 0, void 0, function* () {
  8088. assert_1.ok(fsPath, 'a path argument must be provided');
  8089. fsPath = path.resolve(fsPath);
  8090. if (depth >= maxDepth)
  8091. return exports.mkdir(fsPath);
  8092. try {
  8093. yield exports.mkdir(fsPath);
  8094. return;
  8095. }
  8096. catch (err) {
  8097. switch (err.code) {
  8098. case 'ENOENT': {
  8099. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  8100. yield exports.mkdir(fsPath);
  8101. return;
  8102. }
  8103. default: {
  8104. let stats;
  8105. try {
  8106. stats = yield exports.stat(fsPath);
  8107. }
  8108. catch (err2) {
  8109. throw err;
  8110. }
  8111. if (!stats.isDirectory())
  8112. throw err;
  8113. }
  8114. }
  8115. }
  8116. });
  8117. }
  8118. exports.mkdirP = mkdirP;
  8119. /**
  8120. * Best effort attempt to determine whether a file exists and is executable.
  8121. * @param filePath file path to check
  8122. * @param extensions additional file extensions to try
  8123. * @return if file exists and is executable, returns the file path. otherwise empty string.
  8124. */
  8125. function tryGetExecutablePath(filePath, extensions) {
  8126. return __awaiter(this, void 0, void 0, function* () {
  8127. let stats = undefined;
  8128. try {
  8129. // test file exists
  8130. stats = yield exports.stat(filePath);
  8131. }
  8132. catch (err) {
  8133. if (err.code !== 'ENOENT') {
  8134. // eslint-disable-next-line no-console
  8135. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8136. }
  8137. }
  8138. if (stats && stats.isFile()) {
  8139. if (exports.IS_WINDOWS) {
  8140. // on Windows, test for valid extension
  8141. const upperExt = path.extname(filePath).toUpperCase();
  8142. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  8143. return filePath;
  8144. }
  8145. }
  8146. else {
  8147. if (isUnixExecutable(stats)) {
  8148. return filePath;
  8149. }
  8150. }
  8151. }
  8152. // try each extension
  8153. const originalFilePath = filePath;
  8154. for (const extension of extensions) {
  8155. filePath = originalFilePath + extension;
  8156. stats = undefined;
  8157. try {
  8158. stats = yield exports.stat(filePath);
  8159. }
  8160. catch (err) {
  8161. if (err.code !== 'ENOENT') {
  8162. // eslint-disable-next-line no-console
  8163. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8164. }
  8165. }
  8166. if (stats && stats.isFile()) {
  8167. if (exports.IS_WINDOWS) {
  8168. // preserve the case of the actual file (since an extension was appended)
  8169. try {
  8170. const directory = path.dirname(filePath);
  8171. const upperName = path.basename(filePath).toUpperCase();
  8172. for (const actualName of yield exports.readdir(directory)) {
  8173. if (upperName === actualName.toUpperCase()) {
  8174. filePath = path.join(directory, actualName);
  8175. break;
  8176. }
  8177. }
  8178. }
  8179. catch (err) {
  8180. // eslint-disable-next-line no-console
  8181. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  8182. }
  8183. return filePath;
  8184. }
  8185. else {
  8186. if (isUnixExecutable(stats)) {
  8187. return filePath;
  8188. }
  8189. }
  8190. }
  8191. }
  8192. return '';
  8193. });
  8194. }
  8195. exports.tryGetExecutablePath = tryGetExecutablePath;
  8196. function normalizeSeparators(p) {
  8197. p = p || '';
  8198. if (exports.IS_WINDOWS) {
  8199. // convert slashes on Windows
  8200. p = p.replace(/\//g, '\\');
  8201. // remove redundant slashes
  8202. return p.replace(/\\\\+/g, '\\');
  8203. }
  8204. // remove redundant slashes
  8205. return p.replace(/\/\/+/g, '/');
  8206. }
  8207. // on Mac/Linux, test the execute bit
  8208. // R W X R W X R W X
  8209. // 256 128 64 32 16 8 4 2 1
  8210. function isUnixExecutable(stats) {
  8211. return ((stats.mode & 1) > 0 ||
  8212. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  8213. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  8214. }
  8215. //# sourceMappingURL=io-util.js.map
  8216. /***/ }),
  8217. /***/ 674:
  8218. /***/ (function(module, __unusedexports, __webpack_require__) {
  8219. module.exports = authenticate;
  8220. const { Deprecation } = __webpack_require__(692);
  8221. const once = __webpack_require__(969);
  8222. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  8223. function authenticate(state, options) {
  8224. deprecateAuthenticate(
  8225. state.octokit.log,
  8226. new Deprecation(
  8227. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  8228. )
  8229. );
  8230. if (!options) {
  8231. state.auth = false;
  8232. return;
  8233. }
  8234. switch (options.type) {
  8235. case "basic":
  8236. if (!options.username || !options.password) {
  8237. throw new Error(
  8238. "Basic authentication requires both a username and password to be set"
  8239. );
  8240. }
  8241. break;
  8242. case "oauth":
  8243. if (!options.token && !(options.key && options.secret)) {
  8244. throw new Error(
  8245. "OAuth2 authentication requires a token or key & secret to be set"
  8246. );
  8247. }
  8248. break;
  8249. case "token":
  8250. case "app":
  8251. if (!options.token) {
  8252. throw new Error("Token authentication requires a token to be set");
  8253. }
  8254. break;
  8255. default:
  8256. throw new Error(
  8257. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  8258. );
  8259. }
  8260. state.auth = options;
  8261. }
  8262. /***/ }),
  8263. /***/ 675:
  8264. /***/ (function(module) {
  8265. module.exports = function btoa(str) {
  8266. return new Buffer(str).toString('base64')
  8267. }
  8268. /***/ }),
  8269. /***/ 692:
  8270. /***/ (function(__unusedmodule, exports) {
  8271. "use strict";
  8272. Object.defineProperty(exports, '__esModule', { value: true });
  8273. class Deprecation extends Error {
  8274. constructor(message) {
  8275. super(message); // Maintains proper stack trace (only available on V8)
  8276. /* istanbul ignore next */
  8277. if (Error.captureStackTrace) {
  8278. Error.captureStackTrace(this, this.constructor);
  8279. }
  8280. this.name = 'Deprecation';
  8281. }
  8282. }
  8283. exports.Deprecation = Deprecation;
  8284. /***/ }),
  8285. /***/ 696:
  8286. /***/ (function(module) {
  8287. "use strict";
  8288. /*!
  8289. * isobject <https://github.com/jonschlinkert/isobject>
  8290. *
  8291. * Copyright (c) 2014-2017, Jon Schlinkert.
  8292. * Released under the MIT License.
  8293. */
  8294. function isObject(val) {
  8295. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  8296. }
  8297. /*!
  8298. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  8299. *
  8300. * Copyright (c) 2014-2017, Jon Schlinkert.
  8301. * Released under the MIT License.
  8302. */
  8303. function isObjectObject(o) {
  8304. return isObject(o) === true
  8305. && Object.prototype.toString.call(o) === '[object Object]';
  8306. }
  8307. function isPlainObject(o) {
  8308. var ctor,prot;
  8309. if (isObjectObject(o) === false) return false;
  8310. // If has modified constructor
  8311. ctor = o.constructor;
  8312. if (typeof ctor !== 'function') return false;
  8313. // If has modified prototype
  8314. prot = ctor.prototype;
  8315. if (isObjectObject(prot) === false) return false;
  8316. // If constructor does not have an Object-specific method
  8317. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  8318. return false;
  8319. }
  8320. // Most likely a plain Object
  8321. return true;
  8322. }
  8323. module.exports = isPlainObject;
  8324. /***/ }),
  8325. /***/ 697:
  8326. /***/ (function(module) {
  8327. "use strict";
  8328. module.exports = (promise, onFinally) => {
  8329. onFinally = onFinally || (() => {});
  8330. return promise.then(
  8331. val => new Promise(resolve => {
  8332. resolve(onFinally());
  8333. }).then(() => val),
  8334. err => new Promise(resolve => {
  8335. resolve(onFinally());
  8336. }).then(() => {
  8337. throw err;
  8338. })
  8339. );
  8340. };
  8341. /***/ }),
  8342. /***/ 705:
  8343. /***/ (function(module) {
  8344. 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"},"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"},"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"},"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"}},"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":{"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/refs/: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"},"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":{"method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"createAuthorization":{"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":{"method":"DELETE","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"deleteGrant":{"method":"DELETE","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getAuthorization":{"method":"GET","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"getGrant":{"method":"GET","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getOrCreateAuthorizationForApp":{"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":{"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":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/authorizations"},"listGrants":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/applications/grants"},"resetAuthorization":{"method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeAuthorizationForApplication":{"method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"updateAuthorization":{"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"},"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"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"required":true,"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"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"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"required":true,"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"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":{"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":{"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":{"method":"PUT","params":{"names":{"required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"requestPageBuild":{"headers":{"accept":"application/vnd.github.mister-fantastic-preview+json"},"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"}}};
  8345. /***/ }),
  8346. /***/ 742:
  8347. /***/ (function(module, __unusedexports, __webpack_require__) {
  8348. var fs = __webpack_require__(747)
  8349. var core
  8350. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  8351. core = __webpack_require__(818)
  8352. } else {
  8353. core = __webpack_require__(197)
  8354. }
  8355. module.exports = isexe
  8356. isexe.sync = sync
  8357. function isexe (path, options, cb) {
  8358. if (typeof options === 'function') {
  8359. cb = options
  8360. options = {}
  8361. }
  8362. if (!cb) {
  8363. if (typeof Promise !== 'function') {
  8364. throw new TypeError('callback not provided')
  8365. }
  8366. return new Promise(function (resolve, reject) {
  8367. isexe(path, options || {}, function (er, is) {
  8368. if (er) {
  8369. reject(er)
  8370. } else {
  8371. resolve(is)
  8372. }
  8373. })
  8374. })
  8375. }
  8376. core(path, options || {}, function (er, is) {
  8377. // ignore EACCES because that just means we aren't allowed to run it
  8378. if (er) {
  8379. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  8380. er = null
  8381. is = false
  8382. }
  8383. }
  8384. cb(er, is)
  8385. })
  8386. }
  8387. function sync (path, options) {
  8388. // my kingdom for a filtered catch
  8389. try {
  8390. return core.sync(path, options || {})
  8391. } catch (er) {
  8392. if (options && options.ignoreErrors || er.code === 'EACCES') {
  8393. return false
  8394. } else {
  8395. throw er
  8396. }
  8397. }
  8398. }
  8399. /***/ }),
  8400. /***/ 747:
  8401. /***/ (function(module) {
  8402. module.exports = require("fs");
  8403. /***/ }),
  8404. /***/ 753:
  8405. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8406. "use strict";
  8407. Object.defineProperty(exports, '__esModule', { value: true });
  8408. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8409. var endpoint = __webpack_require__(385);
  8410. var universalUserAgent = __webpack_require__(211);
  8411. var isPlainObject = _interopDefault(__webpack_require__(696));
  8412. var nodeFetch = _interopDefault(__webpack_require__(454));
  8413. var requestError = __webpack_require__(463);
  8414. const VERSION = "0.0.0-development";
  8415. function getBufferResponse(response) {
  8416. return response.arrayBuffer();
  8417. }
  8418. function fetchWrapper(requestOptions) {
  8419. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  8420. requestOptions.body = JSON.stringify(requestOptions.body);
  8421. }
  8422. let headers = {};
  8423. let status;
  8424. let url;
  8425. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  8426. return fetch(requestOptions.url, Object.assign({
  8427. method: requestOptions.method,
  8428. body: requestOptions.body,
  8429. headers: requestOptions.headers,
  8430. redirect: requestOptions.redirect
  8431. }, requestOptions.request)).then(response => {
  8432. url = response.url;
  8433. status = response.status;
  8434. for (const keyAndValue of response.headers) {
  8435. headers[keyAndValue[0]] = keyAndValue[1];
  8436. }
  8437. if (status === 204 || status === 205) {
  8438. return;
  8439. } // GitHub API returns 200 for HEAD requsets
  8440. if (requestOptions.method === "HEAD") {
  8441. if (status < 400) {
  8442. return;
  8443. }
  8444. throw new requestError.RequestError(response.statusText, status, {
  8445. headers,
  8446. request: requestOptions
  8447. });
  8448. }
  8449. if (status === 304) {
  8450. throw new requestError.RequestError("Not modified", status, {
  8451. headers,
  8452. request: requestOptions
  8453. });
  8454. }
  8455. if (status >= 400) {
  8456. return response.text().then(message => {
  8457. const error = new requestError.RequestError(message, status, {
  8458. headers,
  8459. request: requestOptions
  8460. });
  8461. try {
  8462. Object.assign(error, JSON.parse(error.message));
  8463. } catch (e) {// ignore, see octokit/rest.js#684
  8464. }
  8465. throw error;
  8466. });
  8467. }
  8468. const contentType = response.headers.get("content-type");
  8469. if (/application\/json/.test(contentType)) {
  8470. return response.json();
  8471. }
  8472. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  8473. return response.text();
  8474. }
  8475. return getBufferResponse(response);
  8476. }).then(data => {
  8477. return {
  8478. status,
  8479. url,
  8480. headers,
  8481. data
  8482. };
  8483. }).catch(error => {
  8484. if (error instanceof requestError.RequestError) {
  8485. throw error;
  8486. }
  8487. throw new requestError.RequestError(error.message, 500, {
  8488. headers,
  8489. request: requestOptions
  8490. });
  8491. });
  8492. }
  8493. function withDefaults(oldEndpoint, newDefaults) {
  8494. const endpoint = oldEndpoint.defaults(newDefaults);
  8495. const newApi = function (route, parameters) {
  8496. const endpointOptions = endpoint.merge(route, parameters);
  8497. if (!endpointOptions.request || !endpointOptions.request.hook) {
  8498. return fetchWrapper(endpoint.parse(endpointOptions));
  8499. }
  8500. const request = (route, parameters) => {
  8501. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  8502. };
  8503. Object.assign(request, {
  8504. endpoint,
  8505. defaults: withDefaults.bind(null, endpoint)
  8506. });
  8507. return endpointOptions.request.hook(request, endpointOptions);
  8508. };
  8509. return Object.assign(newApi, {
  8510. endpoint,
  8511. defaults: withDefaults.bind(null, endpoint)
  8512. });
  8513. }
  8514. const request = withDefaults(endpoint.endpoint, {
  8515. headers: {
  8516. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  8517. }
  8518. });
  8519. exports.request = request;
  8520. //# sourceMappingURL=index.js.map
  8521. /***/ }),
  8522. /***/ 761:
  8523. /***/ (function(module) {
  8524. module.exports = require("zlib");
  8525. /***/ }),
  8526. /***/ 763:
  8527. /***/ (function(module) {
  8528. module.exports = removeHook
  8529. function removeHook (state, name, method) {
  8530. if (!state.registry[name]) {
  8531. return
  8532. }
  8533. var index = state.registry[name]
  8534. .map(function (registered) { return registered.orig })
  8535. .indexOf(method)
  8536. if (index === -1) {
  8537. return
  8538. }
  8539. state.registry[name].splice(index, 1)
  8540. }
  8541. /***/ }),
  8542. /***/ 768:
  8543. /***/ (function(module) {
  8544. "use strict";
  8545. module.exports = function (x) {
  8546. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  8547. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  8548. if (x[x.length - 1] === lf) {
  8549. x = x.slice(0, x.length - 1);
  8550. }
  8551. if (x[x.length - 1] === cr) {
  8552. x = x.slice(0, x.length - 1);
  8553. }
  8554. return x;
  8555. };
  8556. /***/ }),
  8557. /***/ 777:
  8558. /***/ (function(module, __unusedexports, __webpack_require__) {
  8559. module.exports = getFirstPage
  8560. const getPage = __webpack_require__(265)
  8561. function getFirstPage (octokit, link, headers) {
  8562. return getPage(octokit, link, 'first', headers)
  8563. }
  8564. /***/ }),
  8565. /***/ 807:
  8566. /***/ (function(module, __unusedexports, __webpack_require__) {
  8567. module.exports = paginate;
  8568. const iterator = __webpack_require__(8);
  8569. function paginate(octokit, route, options, mapFn) {
  8570. if (typeof options === "function") {
  8571. mapFn = options;
  8572. options = undefined;
  8573. }
  8574. options = octokit.request.endpoint.merge(route, options);
  8575. return gather(
  8576. octokit,
  8577. [],
  8578. iterator(octokit, options)[Symbol.asyncIterator](),
  8579. mapFn
  8580. );
  8581. }
  8582. function gather(octokit, results, iterator, mapFn) {
  8583. return iterator.next().then(result => {
  8584. if (result.done) {
  8585. return results;
  8586. }
  8587. let earlyExit = false;
  8588. function done() {
  8589. earlyExit = true;
  8590. }
  8591. results = results.concat(
  8592. mapFn ? mapFn(result.value, done) : result.value.data
  8593. );
  8594. if (earlyExit) {
  8595. return results;
  8596. }
  8597. return gather(octokit, results, iterator, mapFn);
  8598. });
  8599. }
  8600. /***/ }),
  8601. /***/ 814:
  8602. /***/ (function(module, __unusedexports, __webpack_require__) {
  8603. module.exports = which
  8604. which.sync = whichSync
  8605. var isWindows = process.platform === 'win32' ||
  8606. process.env.OSTYPE === 'cygwin' ||
  8607. process.env.OSTYPE === 'msys'
  8608. var path = __webpack_require__(622)
  8609. var COLON = isWindows ? ';' : ':'
  8610. var isexe = __webpack_require__(742)
  8611. function getNotFoundError (cmd) {
  8612. var er = new Error('not found: ' + cmd)
  8613. er.code = 'ENOENT'
  8614. return er
  8615. }
  8616. function getPathInfo (cmd, opt) {
  8617. var colon = opt.colon || COLON
  8618. var pathEnv = opt.path || process.env.PATH || ''
  8619. var pathExt = ['']
  8620. pathEnv = pathEnv.split(colon)
  8621. var pathExtExe = ''
  8622. if (isWindows) {
  8623. pathEnv.unshift(process.cwd())
  8624. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  8625. pathExt = pathExtExe.split(colon)
  8626. // Always test the cmd itself first. isexe will check to make sure
  8627. // it's found in the pathExt set.
  8628. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  8629. pathExt.unshift('')
  8630. }
  8631. // If it has a slash, then we don't bother searching the pathenv.
  8632. // just check the file itself, and that's it.
  8633. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  8634. pathEnv = ['']
  8635. return {
  8636. env: pathEnv,
  8637. ext: pathExt,
  8638. extExe: pathExtExe
  8639. }
  8640. }
  8641. function which (cmd, opt, cb) {
  8642. if (typeof opt === 'function') {
  8643. cb = opt
  8644. opt = {}
  8645. }
  8646. var info = getPathInfo(cmd, opt)
  8647. var pathEnv = info.env
  8648. var pathExt = info.ext
  8649. var pathExtExe = info.extExe
  8650. var found = []
  8651. ;(function F (i, l) {
  8652. if (i === l) {
  8653. if (opt.all && found.length)
  8654. return cb(null, found)
  8655. else
  8656. return cb(getNotFoundError(cmd))
  8657. }
  8658. var pathPart = pathEnv[i]
  8659. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8660. pathPart = pathPart.slice(1, -1)
  8661. var p = path.join(pathPart, cmd)
  8662. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  8663. p = cmd.slice(0, 2) + p
  8664. }
  8665. ;(function E (ii, ll) {
  8666. if (ii === ll) return F(i + 1, l)
  8667. var ext = pathExt[ii]
  8668. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  8669. if (!er && is) {
  8670. if (opt.all)
  8671. found.push(p + ext)
  8672. else
  8673. return cb(null, p + ext)
  8674. }
  8675. return E(ii + 1, ll)
  8676. })
  8677. })(0, pathExt.length)
  8678. })(0, pathEnv.length)
  8679. }
  8680. function whichSync (cmd, opt) {
  8681. opt = opt || {}
  8682. var info = getPathInfo(cmd, opt)
  8683. var pathEnv = info.env
  8684. var pathExt = info.ext
  8685. var pathExtExe = info.extExe
  8686. var found = []
  8687. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  8688. var pathPart = pathEnv[i]
  8689. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8690. pathPart = pathPart.slice(1, -1)
  8691. var p = path.join(pathPart, cmd)
  8692. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  8693. p = cmd.slice(0, 2) + p
  8694. }
  8695. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  8696. var cur = p + pathExt[j]
  8697. var is
  8698. try {
  8699. is = isexe.sync(cur, { pathExt: pathExtExe })
  8700. if (is) {
  8701. if (opt.all)
  8702. found.push(cur)
  8703. else
  8704. return cur
  8705. }
  8706. } catch (ex) {}
  8707. }
  8708. }
  8709. if (opt.all && found.length)
  8710. return found
  8711. if (opt.nothrow)
  8712. return null
  8713. throw getNotFoundError(cmd)
  8714. }
  8715. /***/ }),
  8716. /***/ 816:
  8717. /***/ (function(module) {
  8718. "use strict";
  8719. module.exports = /^#!.*/;
  8720. /***/ }),
  8721. /***/ 818:
  8722. /***/ (function(module, __unusedexports, __webpack_require__) {
  8723. module.exports = isexe
  8724. isexe.sync = sync
  8725. var fs = __webpack_require__(747)
  8726. function checkPathExt (path, options) {
  8727. var pathext = options.pathExt !== undefined ?
  8728. options.pathExt : process.env.PATHEXT
  8729. if (!pathext) {
  8730. return true
  8731. }
  8732. pathext = pathext.split(';')
  8733. if (pathext.indexOf('') !== -1) {
  8734. return true
  8735. }
  8736. for (var i = 0; i < pathext.length; i++) {
  8737. var p = pathext[i].toLowerCase()
  8738. if (p && path.substr(-p.length).toLowerCase() === p) {
  8739. return true
  8740. }
  8741. }
  8742. return false
  8743. }
  8744. function checkStat (stat, path, options) {
  8745. if (!stat.isSymbolicLink() && !stat.isFile()) {
  8746. return false
  8747. }
  8748. return checkPathExt(path, options)
  8749. }
  8750. function isexe (path, options, cb) {
  8751. fs.stat(path, function (er, stat) {
  8752. cb(er, er ? false : checkStat(stat, path, options))
  8753. })
  8754. }
  8755. function sync (path, options) {
  8756. return checkStat(fs.statSync(path), path, options)
  8757. }
  8758. /***/ }),
  8759. /***/ 821:
  8760. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8761. "use strict";
  8762. var __importStar = (this && this.__importStar) || function (mod) {
  8763. if (mod && mod.__esModule) return mod;
  8764. var result = {};
  8765. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8766. result["default"] = mod;
  8767. return result;
  8768. };
  8769. Object.defineProperty(exports, "__esModule", { value: true });
  8770. const core = __importStar(__webpack_require__(470));
  8771. const fsHelper = __importStar(__webpack_require__(618));
  8772. const github = __importStar(__webpack_require__(469));
  8773. const path = __importStar(__webpack_require__(622));
  8774. function getInputs() {
  8775. const result = {};
  8776. // GitHub workspace
  8777. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  8778. if (!githubWorkspacePath) {
  8779. throw new Error('GITHUB_WORKSPACE not defined');
  8780. }
  8781. githubWorkspacePath = path.resolve(githubWorkspacePath);
  8782. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  8783. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  8784. // Qualified repository
  8785. const qualifiedRepository = core.getInput('repository') ||
  8786. `${github.context.repo.owner}/${github.context.repo.repo}`;
  8787. core.debug(`qualified repository = '${qualifiedRepository}'`);
  8788. const splitRepository = qualifiedRepository.split('/');
  8789. if (splitRepository.length !== 2 ||
  8790. !splitRepository[0] ||
  8791. !splitRepository[1]) {
  8792. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  8793. }
  8794. result.repositoryOwner = splitRepository[0];
  8795. result.repositoryName = splitRepository[1];
  8796. // Repository path
  8797. result.repositoryPath = core.getInput('path') || '.';
  8798. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  8799. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  8800. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  8801. }
  8802. // Workflow repository?
  8803. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  8804. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  8805. // Source branch, source version
  8806. result.ref = core.getInput('ref');
  8807. if (!result.ref) {
  8808. if (isWorkflowRepository) {
  8809. result.ref = github.context.ref;
  8810. result.commit = github.context.sha;
  8811. }
  8812. if (!result.ref && !result.commit) {
  8813. result.ref = 'refs/heads/master';
  8814. }
  8815. }
  8816. // SHA?
  8817. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  8818. result.commit = result.ref;
  8819. result.ref = '';
  8820. }
  8821. core.debug(`ref = '${result.ref}'`);
  8822. core.debug(`commit = '${result.commit}'`);
  8823. // Clean
  8824. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  8825. core.debug(`clean = ${result.clean}`);
  8826. // Submodules
  8827. if (core.getInput('submodules')) {
  8828. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  8829. }
  8830. // Fetch depth
  8831. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  8832. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  8833. result.fetchDepth = 0;
  8834. }
  8835. core.debug(`fetch depth = ${result.fetchDepth}`);
  8836. // LFS
  8837. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  8838. core.debug(`lfs = ${result.lfs}`);
  8839. // Access token
  8840. result.accessToken = core.getInput('token');
  8841. return result;
  8842. }
  8843. exports.getInputs = getInputs;
  8844. /***/ }),
  8845. /***/ 835:
  8846. /***/ (function(module) {
  8847. module.exports = require("url");
  8848. /***/ }),
  8849. /***/ 850:
  8850. /***/ (function(module, __unusedexports, __webpack_require__) {
  8851. module.exports = paginationMethodsPlugin
  8852. function paginationMethodsPlugin (octokit) {
  8853. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  8854. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  8855. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  8856. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  8857. octokit.hasFirstPage = __webpack_require__(536)
  8858. octokit.hasLastPage = __webpack_require__(336)
  8859. octokit.hasNextPage = __webpack_require__(929)
  8860. octokit.hasPreviousPage = __webpack_require__(558)
  8861. }
  8862. /***/ }),
  8863. /***/ 854:
  8864. /***/ (function(module) {
  8865. /**
  8866. * lodash (Custom Build) <https://lodash.com/>
  8867. * Build: `lodash modularize exports="npm" -o ./`
  8868. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8869. * Released under MIT license <https://lodash.com/license>
  8870. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8871. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8872. */
  8873. /** Used as the `TypeError` message for "Functions" methods. */
  8874. var FUNC_ERROR_TEXT = 'Expected a function';
  8875. /** Used to stand-in for `undefined` hash values. */
  8876. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8877. /** Used as references for various `Number` constants. */
  8878. var INFINITY = 1 / 0;
  8879. /** `Object#toString` result references. */
  8880. var funcTag = '[object Function]',
  8881. genTag = '[object GeneratorFunction]',
  8882. symbolTag = '[object Symbol]';
  8883. /** Used to match property names within property paths. */
  8884. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8885. reIsPlainProp = /^\w*$/,
  8886. reLeadingDot = /^\./,
  8887. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8888. /**
  8889. * Used to match `RegExp`
  8890. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8891. */
  8892. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8893. /** Used to match backslashes in property paths. */
  8894. var reEscapeChar = /\\(\\)?/g;
  8895. /** Used to detect host constructors (Safari). */
  8896. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8897. /** Detect free variable `global` from Node.js. */
  8898. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  8899. /** Detect free variable `self`. */
  8900. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8901. /** Used as a reference to the global object. */
  8902. var root = freeGlobal || freeSelf || Function('return this')();
  8903. /**
  8904. * Gets the value at `key` of `object`.
  8905. *
  8906. * @private
  8907. * @param {Object} [object] The object to query.
  8908. * @param {string} key The key of the property to get.
  8909. * @returns {*} Returns the property value.
  8910. */
  8911. function getValue(object, key) {
  8912. return object == null ? undefined : object[key];
  8913. }
  8914. /**
  8915. * Checks if `value` is a host object in IE < 9.
  8916. *
  8917. * @private
  8918. * @param {*} value The value to check.
  8919. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  8920. */
  8921. function isHostObject(value) {
  8922. // Many host objects are `Object` objects that can coerce to strings
  8923. // despite having improperly defined `toString` methods.
  8924. var result = false;
  8925. if (value != null && typeof value.toString != 'function') {
  8926. try {
  8927. result = !!(value + '');
  8928. } catch (e) {}
  8929. }
  8930. return result;
  8931. }
  8932. /** Used for built-in method references. */
  8933. var arrayProto = Array.prototype,
  8934. funcProto = Function.prototype,
  8935. objectProto = Object.prototype;
  8936. /** Used to detect overreaching core-js shims. */
  8937. var coreJsData = root['__core-js_shared__'];
  8938. /** Used to detect methods masquerading as native. */
  8939. var maskSrcKey = (function() {
  8940. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8941. return uid ? ('Symbol(src)_1.' + uid) : '';
  8942. }());
  8943. /** Used to resolve the decompiled source of functions. */
  8944. var funcToString = funcProto.toString;
  8945. /** Used to check objects for own properties. */
  8946. var hasOwnProperty = objectProto.hasOwnProperty;
  8947. /**
  8948. * Used to resolve the
  8949. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8950. * of values.
  8951. */
  8952. var objectToString = objectProto.toString;
  8953. /** Used to detect if a method is native. */
  8954. var reIsNative = RegExp('^' +
  8955. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8956. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8957. );
  8958. /** Built-in value references. */
  8959. var Symbol = root.Symbol,
  8960. splice = arrayProto.splice;
  8961. /* Built-in method references that are verified to be native. */
  8962. var Map = getNative(root, 'Map'),
  8963. nativeCreate = getNative(Object, 'create');
  8964. /** Used to convert symbols to primitives and strings. */
  8965. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8966. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8967. /**
  8968. * Creates a hash object.
  8969. *
  8970. * @private
  8971. * @constructor
  8972. * @param {Array} [entries] The key-value pairs to cache.
  8973. */
  8974. function Hash(entries) {
  8975. var index = -1,
  8976. length = entries ? entries.length : 0;
  8977. this.clear();
  8978. while (++index < length) {
  8979. var entry = entries[index];
  8980. this.set(entry[0], entry[1]);
  8981. }
  8982. }
  8983. /**
  8984. * Removes all key-value entries from the hash.
  8985. *
  8986. * @private
  8987. * @name clear
  8988. * @memberOf Hash
  8989. */
  8990. function hashClear() {
  8991. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8992. }
  8993. /**
  8994. * Removes `key` and its value from the hash.
  8995. *
  8996. * @private
  8997. * @name delete
  8998. * @memberOf Hash
  8999. * @param {Object} hash The hash to modify.
  9000. * @param {string} key The key of the value to remove.
  9001. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9002. */
  9003. function hashDelete(key) {
  9004. return this.has(key) && delete this.__data__[key];
  9005. }
  9006. /**
  9007. * Gets the hash value for `key`.
  9008. *
  9009. * @private
  9010. * @name get
  9011. * @memberOf Hash
  9012. * @param {string} key The key of the value to get.
  9013. * @returns {*} Returns the entry value.
  9014. */
  9015. function hashGet(key) {
  9016. var data = this.__data__;
  9017. if (nativeCreate) {
  9018. var result = data[key];
  9019. return result === HASH_UNDEFINED ? undefined : result;
  9020. }
  9021. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  9022. }
  9023. /**
  9024. * Checks if a hash value for `key` exists.
  9025. *
  9026. * @private
  9027. * @name has
  9028. * @memberOf Hash
  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 hashHas(key) {
  9033. var data = this.__data__;
  9034. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  9035. }
  9036. /**
  9037. * Sets the hash `key` to `value`.
  9038. *
  9039. * @private
  9040. * @name set
  9041. * @memberOf Hash
  9042. * @param {string} key The key of the value to set.
  9043. * @param {*} value The value to set.
  9044. * @returns {Object} Returns the hash instance.
  9045. */
  9046. function hashSet(key, value) {
  9047. var data = this.__data__;
  9048. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  9049. return this;
  9050. }
  9051. // Add methods to `Hash`.
  9052. Hash.prototype.clear = hashClear;
  9053. Hash.prototype['delete'] = hashDelete;
  9054. Hash.prototype.get = hashGet;
  9055. Hash.prototype.has = hashHas;
  9056. Hash.prototype.set = hashSet;
  9057. /**
  9058. * Creates an list cache object.
  9059. *
  9060. * @private
  9061. * @constructor
  9062. * @param {Array} [entries] The key-value pairs to cache.
  9063. */
  9064. function ListCache(entries) {
  9065. var index = -1,
  9066. length = entries ? entries.length : 0;
  9067. this.clear();
  9068. while (++index < length) {
  9069. var entry = entries[index];
  9070. this.set(entry[0], entry[1]);
  9071. }
  9072. }
  9073. /**
  9074. * Removes all key-value entries from the list cache.
  9075. *
  9076. * @private
  9077. * @name clear
  9078. * @memberOf ListCache
  9079. */
  9080. function listCacheClear() {
  9081. this.__data__ = [];
  9082. }
  9083. /**
  9084. * Removes `key` and its value from the list cache.
  9085. *
  9086. * @private
  9087. * @name delete
  9088. * @memberOf ListCache
  9089. * @param {string} key The key of the value to remove.
  9090. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9091. */
  9092. function listCacheDelete(key) {
  9093. var data = this.__data__,
  9094. index = assocIndexOf(data, key);
  9095. if (index < 0) {
  9096. return false;
  9097. }
  9098. var lastIndex = data.length - 1;
  9099. if (index == lastIndex) {
  9100. data.pop();
  9101. } else {
  9102. splice.call(data, index, 1);
  9103. }
  9104. return true;
  9105. }
  9106. /**
  9107. * Gets the list cache value for `key`.
  9108. *
  9109. * @private
  9110. * @name get
  9111. * @memberOf ListCache
  9112. * @param {string} key The key of the value to get.
  9113. * @returns {*} Returns the entry value.
  9114. */
  9115. function listCacheGet(key) {
  9116. var data = this.__data__,
  9117. index = assocIndexOf(data, key);
  9118. return index < 0 ? undefined : data[index][1];
  9119. }
  9120. /**
  9121. * Checks if a list cache value for `key` exists.
  9122. *
  9123. * @private
  9124. * @name has
  9125. * @memberOf ListCache
  9126. * @param {string} key The key of the entry to check.
  9127. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9128. */
  9129. function listCacheHas(key) {
  9130. return assocIndexOf(this.__data__, key) > -1;
  9131. }
  9132. /**
  9133. * Sets the list cache `key` to `value`.
  9134. *
  9135. * @private
  9136. * @name set
  9137. * @memberOf ListCache
  9138. * @param {string} key The key of the value to set.
  9139. * @param {*} value The value to set.
  9140. * @returns {Object} Returns the list cache instance.
  9141. */
  9142. function listCacheSet(key, value) {
  9143. var data = this.__data__,
  9144. index = assocIndexOf(data, key);
  9145. if (index < 0) {
  9146. data.push([key, value]);
  9147. } else {
  9148. data[index][1] = value;
  9149. }
  9150. return this;
  9151. }
  9152. // Add methods to `ListCache`.
  9153. ListCache.prototype.clear = listCacheClear;
  9154. ListCache.prototype['delete'] = listCacheDelete;
  9155. ListCache.prototype.get = listCacheGet;
  9156. ListCache.prototype.has = listCacheHas;
  9157. ListCache.prototype.set = listCacheSet;
  9158. /**
  9159. * Creates a map cache object to store key-value pairs.
  9160. *
  9161. * @private
  9162. * @constructor
  9163. * @param {Array} [entries] The key-value pairs to cache.
  9164. */
  9165. function MapCache(entries) {
  9166. var index = -1,
  9167. length = entries ? entries.length : 0;
  9168. this.clear();
  9169. while (++index < length) {
  9170. var entry = entries[index];
  9171. this.set(entry[0], entry[1]);
  9172. }
  9173. }
  9174. /**
  9175. * Removes all key-value entries from the map.
  9176. *
  9177. * @private
  9178. * @name clear
  9179. * @memberOf MapCache
  9180. */
  9181. function mapCacheClear() {
  9182. this.__data__ = {
  9183. 'hash': new Hash,
  9184. 'map': new (Map || ListCache),
  9185. 'string': new Hash
  9186. };
  9187. }
  9188. /**
  9189. * Removes `key` and its value from the map.
  9190. *
  9191. * @private
  9192. * @name delete
  9193. * @memberOf MapCache
  9194. * @param {string} key The key of the value to remove.
  9195. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9196. */
  9197. function mapCacheDelete(key) {
  9198. return getMapData(this, key)['delete'](key);
  9199. }
  9200. /**
  9201. * Gets the map value for `key`.
  9202. *
  9203. * @private
  9204. * @name get
  9205. * @memberOf MapCache
  9206. * @param {string} key The key of the value to get.
  9207. * @returns {*} Returns the entry value.
  9208. */
  9209. function mapCacheGet(key) {
  9210. return getMapData(this, key).get(key);
  9211. }
  9212. /**
  9213. * Checks if a map value for `key` exists.
  9214. *
  9215. * @private
  9216. * @name has
  9217. * @memberOf MapCache
  9218. * @param {string} key The key of the entry to check.
  9219. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9220. */
  9221. function mapCacheHas(key) {
  9222. return getMapData(this, key).has(key);
  9223. }
  9224. /**
  9225. * Sets the map `key` to `value`.
  9226. *
  9227. * @private
  9228. * @name set
  9229. * @memberOf MapCache
  9230. * @param {string} key The key of the value to set.
  9231. * @param {*} value The value to set.
  9232. * @returns {Object} Returns the map cache instance.
  9233. */
  9234. function mapCacheSet(key, value) {
  9235. getMapData(this, key).set(key, value);
  9236. return this;
  9237. }
  9238. // Add methods to `MapCache`.
  9239. MapCache.prototype.clear = mapCacheClear;
  9240. MapCache.prototype['delete'] = mapCacheDelete;
  9241. MapCache.prototype.get = mapCacheGet;
  9242. MapCache.prototype.has = mapCacheHas;
  9243. MapCache.prototype.set = mapCacheSet;
  9244. /**
  9245. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9246. *
  9247. * @private
  9248. * @param {Array} array The array to inspect.
  9249. * @param {*} key The key to search for.
  9250. * @returns {number} Returns the index of the matched value, else `-1`.
  9251. */
  9252. function assocIndexOf(array, key) {
  9253. var length = array.length;
  9254. while (length--) {
  9255. if (eq(array[length][0], key)) {
  9256. return length;
  9257. }
  9258. }
  9259. return -1;
  9260. }
  9261. /**
  9262. * The base implementation of `_.get` without support for default values.
  9263. *
  9264. * @private
  9265. * @param {Object} object The object to query.
  9266. * @param {Array|string} path The path of the property to get.
  9267. * @returns {*} Returns the resolved value.
  9268. */
  9269. function baseGet(object, path) {
  9270. path = isKey(path, object) ? [path] : castPath(path);
  9271. var index = 0,
  9272. length = path.length;
  9273. while (object != null && index < length) {
  9274. object = object[toKey(path[index++])];
  9275. }
  9276. return (index && index == length) ? object : undefined;
  9277. }
  9278. /**
  9279. * The base implementation of `_.isNative` without bad shim checks.
  9280. *
  9281. * @private
  9282. * @param {*} value The value to check.
  9283. * @returns {boolean} Returns `true` if `value` is a native function,
  9284. * else `false`.
  9285. */
  9286. function baseIsNative(value) {
  9287. if (!isObject(value) || isMasked(value)) {
  9288. return false;
  9289. }
  9290. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  9291. return pattern.test(toSource(value));
  9292. }
  9293. /**
  9294. * The base implementation of `_.toString` which doesn't convert nullish
  9295. * values to empty strings.
  9296. *
  9297. * @private
  9298. * @param {*} value The value to process.
  9299. * @returns {string} Returns the string.
  9300. */
  9301. function baseToString(value) {
  9302. // Exit early for strings to avoid a performance hit in some environments.
  9303. if (typeof value == 'string') {
  9304. return value;
  9305. }
  9306. if (isSymbol(value)) {
  9307. return symbolToString ? symbolToString.call(value) : '';
  9308. }
  9309. var result = (value + '');
  9310. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9311. }
  9312. /**
  9313. * Casts `value` to a path array if it's not one.
  9314. *
  9315. * @private
  9316. * @param {*} value The value to inspect.
  9317. * @returns {Array} Returns the cast property path array.
  9318. */
  9319. function castPath(value) {
  9320. return isArray(value) ? value : stringToPath(value);
  9321. }
  9322. /**
  9323. * Gets the data for `map`.
  9324. *
  9325. * @private
  9326. * @param {Object} map The map to query.
  9327. * @param {string} key The reference key.
  9328. * @returns {*} Returns the map data.
  9329. */
  9330. function getMapData(map, key) {
  9331. var data = map.__data__;
  9332. return isKeyable(key)
  9333. ? data[typeof key == 'string' ? 'string' : 'hash']
  9334. : data.map;
  9335. }
  9336. /**
  9337. * Gets the native function at `key` of `object`.
  9338. *
  9339. * @private
  9340. * @param {Object} object The object to query.
  9341. * @param {string} key The key of the method to get.
  9342. * @returns {*} Returns the function if it's native, else `undefined`.
  9343. */
  9344. function getNative(object, key) {
  9345. var value = getValue(object, key);
  9346. return baseIsNative(value) ? value : undefined;
  9347. }
  9348. /**
  9349. * Checks if `value` is a property name and not a property path.
  9350. *
  9351. * @private
  9352. * @param {*} value The value to check.
  9353. * @param {Object} [object] The object to query keys on.
  9354. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9355. */
  9356. function isKey(value, object) {
  9357. if (isArray(value)) {
  9358. return false;
  9359. }
  9360. var type = typeof value;
  9361. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  9362. value == null || isSymbol(value)) {
  9363. return true;
  9364. }
  9365. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  9366. (object != null && value in Object(object));
  9367. }
  9368. /**
  9369. * Checks if `value` is suitable for use as unique object key.
  9370. *
  9371. * @private
  9372. * @param {*} value The value to check.
  9373. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  9374. */
  9375. function isKeyable(value) {
  9376. var type = typeof value;
  9377. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  9378. ? (value !== '__proto__')
  9379. : (value === null);
  9380. }
  9381. /**
  9382. * Checks if `func` has its source masked.
  9383. *
  9384. * @private
  9385. * @param {Function} func The function to check.
  9386. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  9387. */
  9388. function isMasked(func) {
  9389. return !!maskSrcKey && (maskSrcKey in func);
  9390. }
  9391. /**
  9392. * Converts `string` to a property path array.
  9393. *
  9394. * @private
  9395. * @param {string} string The string to convert.
  9396. * @returns {Array} Returns the property path array.
  9397. */
  9398. var stringToPath = memoize(function(string) {
  9399. string = toString(string);
  9400. var result = [];
  9401. if (reLeadingDot.test(string)) {
  9402. result.push('');
  9403. }
  9404. string.replace(rePropName, function(match, number, quote, string) {
  9405. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  9406. });
  9407. return result;
  9408. });
  9409. /**
  9410. * Converts `value` to a string key if it's not a string or symbol.
  9411. *
  9412. * @private
  9413. * @param {*} value The value to inspect.
  9414. * @returns {string|symbol} Returns the key.
  9415. */
  9416. function toKey(value) {
  9417. if (typeof value == 'string' || isSymbol(value)) {
  9418. return value;
  9419. }
  9420. var result = (value + '');
  9421. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9422. }
  9423. /**
  9424. * Converts `func` to its source code.
  9425. *
  9426. * @private
  9427. * @param {Function} func The function to process.
  9428. * @returns {string} Returns the source code.
  9429. */
  9430. function toSource(func) {
  9431. if (func != null) {
  9432. try {
  9433. return funcToString.call(func);
  9434. } catch (e) {}
  9435. try {
  9436. return (func + '');
  9437. } catch (e) {}
  9438. }
  9439. return '';
  9440. }
  9441. /**
  9442. * Creates a function that memoizes the result of `func`. If `resolver` is
  9443. * provided, it determines the cache key for storing the result based on the
  9444. * arguments provided to the memoized function. By default, the first argument
  9445. * provided to the memoized function is used as the map cache key. The `func`
  9446. * is invoked with the `this` binding of the memoized function.
  9447. *
  9448. * **Note:** The cache is exposed as the `cache` property on the memoized
  9449. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  9450. * constructor with one whose instances implement the
  9451. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  9452. * method interface of `delete`, `get`, `has`, and `set`.
  9453. *
  9454. * @static
  9455. * @memberOf _
  9456. * @since 0.1.0
  9457. * @category Function
  9458. * @param {Function} func The function to have its output memoized.
  9459. * @param {Function} [resolver] The function to resolve the cache key.
  9460. * @returns {Function} Returns the new memoized function.
  9461. * @example
  9462. *
  9463. * var object = { 'a': 1, 'b': 2 };
  9464. * var other = { 'c': 3, 'd': 4 };
  9465. *
  9466. * var values = _.memoize(_.values);
  9467. * values(object);
  9468. * // => [1, 2]
  9469. *
  9470. * values(other);
  9471. * // => [3, 4]
  9472. *
  9473. * object.a = 2;
  9474. * values(object);
  9475. * // => [1, 2]
  9476. *
  9477. * // Modify the result cache.
  9478. * values.cache.set(object, ['a', 'b']);
  9479. * values(object);
  9480. * // => ['a', 'b']
  9481. *
  9482. * // Replace `_.memoize.Cache`.
  9483. * _.memoize.Cache = WeakMap;
  9484. */
  9485. function memoize(func, resolver) {
  9486. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  9487. throw new TypeError(FUNC_ERROR_TEXT);
  9488. }
  9489. var memoized = function() {
  9490. var args = arguments,
  9491. key = resolver ? resolver.apply(this, args) : args[0],
  9492. cache = memoized.cache;
  9493. if (cache.has(key)) {
  9494. return cache.get(key);
  9495. }
  9496. var result = func.apply(this, args);
  9497. memoized.cache = cache.set(key, result);
  9498. return result;
  9499. };
  9500. memoized.cache = new (memoize.Cache || MapCache);
  9501. return memoized;
  9502. }
  9503. // Assign cache to `_.memoize`.
  9504. memoize.Cache = MapCache;
  9505. /**
  9506. * Performs a
  9507. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9508. * comparison between two values to determine if they are equivalent.
  9509. *
  9510. * @static
  9511. * @memberOf _
  9512. * @since 4.0.0
  9513. * @category Lang
  9514. * @param {*} value The value to compare.
  9515. * @param {*} other The other value to compare.
  9516. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9517. * @example
  9518. *
  9519. * var object = { 'a': 1 };
  9520. * var other = { 'a': 1 };
  9521. *
  9522. * _.eq(object, object);
  9523. * // => true
  9524. *
  9525. * _.eq(object, other);
  9526. * // => false
  9527. *
  9528. * _.eq('a', 'a');
  9529. * // => true
  9530. *
  9531. * _.eq('a', Object('a'));
  9532. * // => false
  9533. *
  9534. * _.eq(NaN, NaN);
  9535. * // => true
  9536. */
  9537. function eq(value, other) {
  9538. return value === other || (value !== value && other !== other);
  9539. }
  9540. /**
  9541. * Checks if `value` is classified as an `Array` object.
  9542. *
  9543. * @static
  9544. * @memberOf _
  9545. * @since 0.1.0
  9546. * @category Lang
  9547. * @param {*} value The value to check.
  9548. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  9549. * @example
  9550. *
  9551. * _.isArray([1, 2, 3]);
  9552. * // => true
  9553. *
  9554. * _.isArray(document.body.children);
  9555. * // => false
  9556. *
  9557. * _.isArray('abc');
  9558. * // => false
  9559. *
  9560. * _.isArray(_.noop);
  9561. * // => false
  9562. */
  9563. var isArray = Array.isArray;
  9564. /**
  9565. * Checks if `value` is classified as a `Function` object.
  9566. *
  9567. * @static
  9568. * @memberOf _
  9569. * @since 0.1.0
  9570. * @category Lang
  9571. * @param {*} value The value to check.
  9572. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  9573. * @example
  9574. *
  9575. * _.isFunction(_);
  9576. * // => true
  9577. *
  9578. * _.isFunction(/abc/);
  9579. * // => false
  9580. */
  9581. function isFunction(value) {
  9582. // The use of `Object#toString` avoids issues with the `typeof` operator
  9583. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  9584. var tag = isObject(value) ? objectToString.call(value) : '';
  9585. return tag == funcTag || tag == genTag;
  9586. }
  9587. /**
  9588. * Checks if `value` is the
  9589. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  9590. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  9591. *
  9592. * @static
  9593. * @memberOf _
  9594. * @since 0.1.0
  9595. * @category Lang
  9596. * @param {*} value The value to check.
  9597. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  9598. * @example
  9599. *
  9600. * _.isObject({});
  9601. * // => true
  9602. *
  9603. * _.isObject([1, 2, 3]);
  9604. * // => true
  9605. *
  9606. * _.isObject(_.noop);
  9607. * // => true
  9608. *
  9609. * _.isObject(null);
  9610. * // => false
  9611. */
  9612. function isObject(value) {
  9613. var type = typeof value;
  9614. return !!value && (type == 'object' || type == 'function');
  9615. }
  9616. /**
  9617. * Checks if `value` is object-like. A value is object-like if it's not `null`
  9618. * and has a `typeof` result of "object".
  9619. *
  9620. * @static
  9621. * @memberOf _
  9622. * @since 4.0.0
  9623. * @category Lang
  9624. * @param {*} value The value to check.
  9625. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  9626. * @example
  9627. *
  9628. * _.isObjectLike({});
  9629. * // => true
  9630. *
  9631. * _.isObjectLike([1, 2, 3]);
  9632. * // => true
  9633. *
  9634. * _.isObjectLike(_.noop);
  9635. * // => false
  9636. *
  9637. * _.isObjectLike(null);
  9638. * // => false
  9639. */
  9640. function isObjectLike(value) {
  9641. return !!value && typeof value == 'object';
  9642. }
  9643. /**
  9644. * Checks if `value` is classified as a `Symbol` primitive or object.
  9645. *
  9646. * @static
  9647. * @memberOf _
  9648. * @since 4.0.0
  9649. * @category Lang
  9650. * @param {*} value The value to check.
  9651. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  9652. * @example
  9653. *
  9654. * _.isSymbol(Symbol.iterator);
  9655. * // => true
  9656. *
  9657. * _.isSymbol('abc');
  9658. * // => false
  9659. */
  9660. function isSymbol(value) {
  9661. return typeof value == 'symbol' ||
  9662. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  9663. }
  9664. /**
  9665. * Converts `value` to a string. An empty string is returned for `null`
  9666. * and `undefined` values. The sign of `-0` is preserved.
  9667. *
  9668. * @static
  9669. * @memberOf _
  9670. * @since 4.0.0
  9671. * @category Lang
  9672. * @param {*} value The value to process.
  9673. * @returns {string} Returns the string.
  9674. * @example
  9675. *
  9676. * _.toString(null);
  9677. * // => ''
  9678. *
  9679. * _.toString(-0);
  9680. * // => '-0'
  9681. *
  9682. * _.toString([1, 2, 3]);
  9683. * // => '1,2,3'
  9684. */
  9685. function toString(value) {
  9686. return value == null ? '' : baseToString(value);
  9687. }
  9688. /**
  9689. * Gets the value at `path` of `object`. If the resolved value is
  9690. * `undefined`, the `defaultValue` is returned in its place.
  9691. *
  9692. * @static
  9693. * @memberOf _
  9694. * @since 3.7.0
  9695. * @category Object
  9696. * @param {Object} object The object to query.
  9697. * @param {Array|string} path The path of the property to get.
  9698. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  9699. * @returns {*} Returns the resolved value.
  9700. * @example
  9701. *
  9702. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  9703. *
  9704. * _.get(object, 'a[0].b.c');
  9705. * // => 3
  9706. *
  9707. * _.get(object, ['a', '0', 'b', 'c']);
  9708. * // => 3
  9709. *
  9710. * _.get(object, 'a.b.c', 'default');
  9711. * // => 'default'
  9712. */
  9713. function get(object, path, defaultValue) {
  9714. var result = object == null ? undefined : baseGet(object, path);
  9715. return result === undefined ? defaultValue : result;
  9716. }
  9717. module.exports = get;
  9718. /***/ }),
  9719. /***/ 855:
  9720. /***/ (function(module, __unusedexports, __webpack_require__) {
  9721. module.exports = registerPlugin;
  9722. const factory = __webpack_require__(47);
  9723. function registerPlugin(plugins, pluginFunction) {
  9724. return factory(
  9725. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  9726. );
  9727. }
  9728. /***/ }),
  9729. /***/ 862:
  9730. /***/ (function(module) {
  9731. module.exports = class GraphqlError extends Error {
  9732. constructor (request, response) {
  9733. const message = response.data.errors[0].message
  9734. super(message)
  9735. Object.assign(this, response.data)
  9736. this.name = 'GraphqlError'
  9737. this.request = request
  9738. // Maintains proper stack trace (only available on V8)
  9739. /* istanbul ignore next */
  9740. if (Error.captureStackTrace) {
  9741. Error.captureStackTrace(this, this.constructor)
  9742. }
  9743. }
  9744. }
  9745. /***/ }),
  9746. /***/ 863:
  9747. /***/ (function(module, __unusedexports, __webpack_require__) {
  9748. module.exports = authenticationBeforeRequest;
  9749. const btoa = __webpack_require__(675);
  9750. const withAuthorizationPrefix = __webpack_require__(143);
  9751. function authenticationBeforeRequest(state, options) {
  9752. if (typeof state.auth === "string") {
  9753. options.headers.authorization = withAuthorizationPrefix(state.auth);
  9754. // https://developer.github.com/v3/previews/#integrations
  9755. if (
  9756. /^bearer /i.test(state.auth) &&
  9757. !/machine-man/.test(options.headers.accept)
  9758. ) {
  9759. const acceptHeaders = options.headers.accept
  9760. .split(",")
  9761. .concat("application/vnd.github.machine-man-preview+json");
  9762. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  9763. }
  9764. return;
  9765. }
  9766. if (state.auth.username) {
  9767. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  9768. options.headers.authorization = `Basic ${hash}`;
  9769. if (state.otp) {
  9770. options.headers["x-github-otp"] = state.otp;
  9771. }
  9772. return;
  9773. }
  9774. if (state.auth.clientId) {
  9775. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  9776. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  9777. // URL though: `/applications/:client_id/tokens/:access_token`.
  9778. //
  9779. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  9780. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  9781. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  9782. //
  9783. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  9784. // as well as "/applications/123/tokens/token456"
  9785. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  9786. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  9787. options.headers.authorization = `Basic ${hash}`;
  9788. return;
  9789. }
  9790. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  9791. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  9792. return;
  9793. }
  9794. return Promise.resolve()
  9795. .then(() => {
  9796. return state.auth();
  9797. })
  9798. .then(authorization => {
  9799. options.headers.authorization = withAuthorizationPrefix(authorization);
  9800. });
  9801. }
  9802. /***/ }),
  9803. /***/ 866:
  9804. /***/ (function(module, __unusedexports, __webpack_require__) {
  9805. "use strict";
  9806. var shebangRegex = __webpack_require__(816);
  9807. module.exports = function (str) {
  9808. var match = str.match(shebangRegex);
  9809. if (!match) {
  9810. return null;
  9811. }
  9812. var arr = match[0].replace(/#! ?/, '').split(' ');
  9813. var bin = arr[0].split('/').pop();
  9814. var arg = arr[1];
  9815. return (bin === 'env' ?
  9816. arg :
  9817. bin + (arg ? ' ' + arg : '')
  9818. );
  9819. };
  9820. /***/ }),
  9821. /***/ 881:
  9822. /***/ (function(module) {
  9823. "use strict";
  9824. const isWin = process.platform === 'win32';
  9825. function notFoundError(original, syscall) {
  9826. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  9827. code: 'ENOENT',
  9828. errno: 'ENOENT',
  9829. syscall: `${syscall} ${original.command}`,
  9830. path: original.command,
  9831. spawnargs: original.args,
  9832. });
  9833. }
  9834. function hookChildProcess(cp, parsed) {
  9835. if (!isWin) {
  9836. return;
  9837. }
  9838. const originalEmit = cp.emit;
  9839. cp.emit = function (name, arg1) {
  9840. // If emitting "exit" event and exit code is 1, we need to check if
  9841. // the command exists and emit an "error" instead
  9842. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  9843. if (name === 'exit') {
  9844. const err = verifyENOENT(arg1, parsed, 'spawn');
  9845. if (err) {
  9846. return originalEmit.call(cp, 'error', err);
  9847. }
  9848. }
  9849. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  9850. };
  9851. }
  9852. function verifyENOENT(status, parsed) {
  9853. if (isWin && status === 1 && !parsed.file) {
  9854. return notFoundError(parsed.original, 'spawn');
  9855. }
  9856. return null;
  9857. }
  9858. function verifyENOENTSync(status, parsed) {
  9859. if (isWin && status === 1 && !parsed.file) {
  9860. return notFoundError(parsed.original, 'spawnSync');
  9861. }
  9862. return null;
  9863. }
  9864. module.exports = {
  9865. hookChildProcess,
  9866. verifyENOENT,
  9867. verifyENOENTSync,
  9868. notFoundError,
  9869. };
  9870. /***/ }),
  9871. /***/ 883:
  9872. /***/ (function(module) {
  9873. /**
  9874. * lodash (Custom Build) <https://lodash.com/>
  9875. * Build: `lodash modularize exports="npm" -o ./`
  9876. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  9877. * Released under MIT license <https://lodash.com/license>
  9878. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  9879. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  9880. */
  9881. /** Used as the `TypeError` message for "Functions" methods. */
  9882. var FUNC_ERROR_TEXT = 'Expected a function';
  9883. /** Used to stand-in for `undefined` hash values. */
  9884. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  9885. /** Used as references for various `Number` constants. */
  9886. var INFINITY = 1 / 0,
  9887. MAX_SAFE_INTEGER = 9007199254740991;
  9888. /** `Object#toString` result references. */
  9889. var funcTag = '[object Function]',
  9890. genTag = '[object GeneratorFunction]',
  9891. symbolTag = '[object Symbol]';
  9892. /** Used to match property names within property paths. */
  9893. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  9894. reIsPlainProp = /^\w*$/,
  9895. reLeadingDot = /^\./,
  9896. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  9897. /**
  9898. * Used to match `RegExp`
  9899. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  9900. */
  9901. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  9902. /** Used to match backslashes in property paths. */
  9903. var reEscapeChar = /\\(\\)?/g;
  9904. /** Used to detect host constructors (Safari). */
  9905. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  9906. /** Used to detect unsigned integer values. */
  9907. var reIsUint = /^(?:0|[1-9]\d*)$/;
  9908. /** Detect free variable `global` from Node.js. */
  9909. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  9910. /** Detect free variable `self`. */
  9911. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  9912. /** Used as a reference to the global object. */
  9913. var root = freeGlobal || freeSelf || Function('return this')();
  9914. /**
  9915. * Gets the value at `key` of `object`.
  9916. *
  9917. * @private
  9918. * @param {Object} [object] The object to query.
  9919. * @param {string} key The key of the property to get.
  9920. * @returns {*} Returns the property value.
  9921. */
  9922. function getValue(object, key) {
  9923. return object == null ? undefined : object[key];
  9924. }
  9925. /**
  9926. * Checks if `value` is a host object in IE < 9.
  9927. *
  9928. * @private
  9929. * @param {*} value The value to check.
  9930. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  9931. */
  9932. function isHostObject(value) {
  9933. // Many host objects are `Object` objects that can coerce to strings
  9934. // despite having improperly defined `toString` methods.
  9935. var result = false;
  9936. if (value != null && typeof value.toString != 'function') {
  9937. try {
  9938. result = !!(value + '');
  9939. } catch (e) {}
  9940. }
  9941. return result;
  9942. }
  9943. /** Used for built-in method references. */
  9944. var arrayProto = Array.prototype,
  9945. funcProto = Function.prototype,
  9946. objectProto = Object.prototype;
  9947. /** Used to detect overreaching core-js shims. */
  9948. var coreJsData = root['__core-js_shared__'];
  9949. /** Used to detect methods masquerading as native. */
  9950. var maskSrcKey = (function() {
  9951. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  9952. return uid ? ('Symbol(src)_1.' + uid) : '';
  9953. }());
  9954. /** Used to resolve the decompiled source of functions. */
  9955. var funcToString = funcProto.toString;
  9956. /** Used to check objects for own properties. */
  9957. var hasOwnProperty = objectProto.hasOwnProperty;
  9958. /**
  9959. * Used to resolve the
  9960. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  9961. * of values.
  9962. */
  9963. var objectToString = objectProto.toString;
  9964. /** Used to detect if a method is native. */
  9965. var reIsNative = RegExp('^' +
  9966. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  9967. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  9968. );
  9969. /** Built-in value references. */
  9970. var Symbol = root.Symbol,
  9971. splice = arrayProto.splice;
  9972. /* Built-in method references that are verified to be native. */
  9973. var Map = getNative(root, 'Map'),
  9974. nativeCreate = getNative(Object, 'create');
  9975. /** Used to convert symbols to primitives and strings. */
  9976. var symbolProto = Symbol ? Symbol.prototype : undefined,
  9977. symbolToString = symbolProto ? symbolProto.toString : undefined;
  9978. /**
  9979. * Creates a hash object.
  9980. *
  9981. * @private
  9982. * @constructor
  9983. * @param {Array} [entries] The key-value pairs to cache.
  9984. */
  9985. function Hash(entries) {
  9986. var index = -1,
  9987. length = entries ? entries.length : 0;
  9988. this.clear();
  9989. while (++index < length) {
  9990. var entry = entries[index];
  9991. this.set(entry[0], entry[1]);
  9992. }
  9993. }
  9994. /**
  9995. * Removes all key-value entries from the hash.
  9996. *
  9997. * @private
  9998. * @name clear
  9999. * @memberOf Hash
  10000. */
  10001. function hashClear() {
  10002. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  10003. }
  10004. /**
  10005. * Removes `key` and its value from the hash.
  10006. *
  10007. * @private
  10008. * @name delete
  10009. * @memberOf Hash
  10010. * @param {Object} hash The hash to modify.
  10011. * @param {string} key The key of the value to remove.
  10012. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10013. */
  10014. function hashDelete(key) {
  10015. return this.has(key) && delete this.__data__[key];
  10016. }
  10017. /**
  10018. * Gets the hash value for `key`.
  10019. *
  10020. * @private
  10021. * @name get
  10022. * @memberOf Hash
  10023. * @param {string} key The key of the value to get.
  10024. * @returns {*} Returns the entry value.
  10025. */
  10026. function hashGet(key) {
  10027. var data = this.__data__;
  10028. if (nativeCreate) {
  10029. var result = data[key];
  10030. return result === HASH_UNDEFINED ? undefined : result;
  10031. }
  10032. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  10033. }
  10034. /**
  10035. * Checks if a hash value for `key` exists.
  10036. *
  10037. * @private
  10038. * @name has
  10039. * @memberOf Hash
  10040. * @param {string} key The key of the entry to check.
  10041. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10042. */
  10043. function hashHas(key) {
  10044. var data = this.__data__;
  10045. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  10046. }
  10047. /**
  10048. * Sets the hash `key` to `value`.
  10049. *
  10050. * @private
  10051. * @name set
  10052. * @memberOf Hash
  10053. * @param {string} key The key of the value to set.
  10054. * @param {*} value The value to set.
  10055. * @returns {Object} Returns the hash instance.
  10056. */
  10057. function hashSet(key, value) {
  10058. var data = this.__data__;
  10059. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  10060. return this;
  10061. }
  10062. // Add methods to `Hash`.
  10063. Hash.prototype.clear = hashClear;
  10064. Hash.prototype['delete'] = hashDelete;
  10065. Hash.prototype.get = hashGet;
  10066. Hash.prototype.has = hashHas;
  10067. Hash.prototype.set = hashSet;
  10068. /**
  10069. * Creates an list cache object.
  10070. *
  10071. * @private
  10072. * @constructor
  10073. * @param {Array} [entries] The key-value pairs to cache.
  10074. */
  10075. function ListCache(entries) {
  10076. var index = -1,
  10077. length = entries ? entries.length : 0;
  10078. this.clear();
  10079. while (++index < length) {
  10080. var entry = entries[index];
  10081. this.set(entry[0], entry[1]);
  10082. }
  10083. }
  10084. /**
  10085. * Removes all key-value entries from the list cache.
  10086. *
  10087. * @private
  10088. * @name clear
  10089. * @memberOf ListCache
  10090. */
  10091. function listCacheClear() {
  10092. this.__data__ = [];
  10093. }
  10094. /**
  10095. * Removes `key` and its value from the list cache.
  10096. *
  10097. * @private
  10098. * @name delete
  10099. * @memberOf ListCache
  10100. * @param {string} key The key of the value to remove.
  10101. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10102. */
  10103. function listCacheDelete(key) {
  10104. var data = this.__data__,
  10105. index = assocIndexOf(data, key);
  10106. if (index < 0) {
  10107. return false;
  10108. }
  10109. var lastIndex = data.length - 1;
  10110. if (index == lastIndex) {
  10111. data.pop();
  10112. } else {
  10113. splice.call(data, index, 1);
  10114. }
  10115. return true;
  10116. }
  10117. /**
  10118. * Gets the list cache value for `key`.
  10119. *
  10120. * @private
  10121. * @name get
  10122. * @memberOf ListCache
  10123. * @param {string} key The key of the value to get.
  10124. * @returns {*} Returns the entry value.
  10125. */
  10126. function listCacheGet(key) {
  10127. var data = this.__data__,
  10128. index = assocIndexOf(data, key);
  10129. return index < 0 ? undefined : data[index][1];
  10130. }
  10131. /**
  10132. * Checks if a list cache value for `key` exists.
  10133. *
  10134. * @private
  10135. * @name has
  10136. * @memberOf ListCache
  10137. * @param {string} key The key of the entry to check.
  10138. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10139. */
  10140. function listCacheHas(key) {
  10141. return assocIndexOf(this.__data__, key) > -1;
  10142. }
  10143. /**
  10144. * Sets the list cache `key` to `value`.
  10145. *
  10146. * @private
  10147. * @name set
  10148. * @memberOf ListCache
  10149. * @param {string} key The key of the value to set.
  10150. * @param {*} value The value to set.
  10151. * @returns {Object} Returns the list cache instance.
  10152. */
  10153. function listCacheSet(key, value) {
  10154. var data = this.__data__,
  10155. index = assocIndexOf(data, key);
  10156. if (index < 0) {
  10157. data.push([key, value]);
  10158. } else {
  10159. data[index][1] = value;
  10160. }
  10161. return this;
  10162. }
  10163. // Add methods to `ListCache`.
  10164. ListCache.prototype.clear = listCacheClear;
  10165. ListCache.prototype['delete'] = listCacheDelete;
  10166. ListCache.prototype.get = listCacheGet;
  10167. ListCache.prototype.has = listCacheHas;
  10168. ListCache.prototype.set = listCacheSet;
  10169. /**
  10170. * Creates a map cache object to store key-value pairs.
  10171. *
  10172. * @private
  10173. * @constructor
  10174. * @param {Array} [entries] The key-value pairs to cache.
  10175. */
  10176. function MapCache(entries) {
  10177. var index = -1,
  10178. length = entries ? entries.length : 0;
  10179. this.clear();
  10180. while (++index < length) {
  10181. var entry = entries[index];
  10182. this.set(entry[0], entry[1]);
  10183. }
  10184. }
  10185. /**
  10186. * Removes all key-value entries from the map.
  10187. *
  10188. * @private
  10189. * @name clear
  10190. * @memberOf MapCache
  10191. */
  10192. function mapCacheClear() {
  10193. this.__data__ = {
  10194. 'hash': new Hash,
  10195. 'map': new (Map || ListCache),
  10196. 'string': new Hash
  10197. };
  10198. }
  10199. /**
  10200. * Removes `key` and its value from the map.
  10201. *
  10202. * @private
  10203. * @name delete
  10204. * @memberOf MapCache
  10205. * @param {string} key The key of the value to remove.
  10206. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10207. */
  10208. function mapCacheDelete(key) {
  10209. return getMapData(this, key)['delete'](key);
  10210. }
  10211. /**
  10212. * Gets the map value for `key`.
  10213. *
  10214. * @private
  10215. * @name get
  10216. * @memberOf MapCache
  10217. * @param {string} key The key of the value to get.
  10218. * @returns {*} Returns the entry value.
  10219. */
  10220. function mapCacheGet(key) {
  10221. return getMapData(this, key).get(key);
  10222. }
  10223. /**
  10224. * Checks if a map value for `key` exists.
  10225. *
  10226. * @private
  10227. * @name has
  10228. * @memberOf MapCache
  10229. * @param {string} key The key of the entry to check.
  10230. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10231. */
  10232. function mapCacheHas(key) {
  10233. return getMapData(this, key).has(key);
  10234. }
  10235. /**
  10236. * Sets the map `key` to `value`.
  10237. *
  10238. * @private
  10239. * @name set
  10240. * @memberOf MapCache
  10241. * @param {string} key The key of the value to set.
  10242. * @param {*} value The value to set.
  10243. * @returns {Object} Returns the map cache instance.
  10244. */
  10245. function mapCacheSet(key, value) {
  10246. getMapData(this, key).set(key, value);
  10247. return this;
  10248. }
  10249. // Add methods to `MapCache`.
  10250. MapCache.prototype.clear = mapCacheClear;
  10251. MapCache.prototype['delete'] = mapCacheDelete;
  10252. MapCache.prototype.get = mapCacheGet;
  10253. MapCache.prototype.has = mapCacheHas;
  10254. MapCache.prototype.set = mapCacheSet;
  10255. /**
  10256. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  10257. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10258. * for equality comparisons.
  10259. *
  10260. * @private
  10261. * @param {Object} object The object to modify.
  10262. * @param {string} key The key of the property to assign.
  10263. * @param {*} value The value to assign.
  10264. */
  10265. function assignValue(object, key, value) {
  10266. var objValue = object[key];
  10267. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  10268. (value === undefined && !(key in object))) {
  10269. object[key] = value;
  10270. }
  10271. }
  10272. /**
  10273. * Gets the index at which the `key` is found in `array` of key-value pairs.
  10274. *
  10275. * @private
  10276. * @param {Array} array The array to inspect.
  10277. * @param {*} key The key to search for.
  10278. * @returns {number} Returns the index of the matched value, else `-1`.
  10279. */
  10280. function assocIndexOf(array, key) {
  10281. var length = array.length;
  10282. while (length--) {
  10283. if (eq(array[length][0], key)) {
  10284. return length;
  10285. }
  10286. }
  10287. return -1;
  10288. }
  10289. /**
  10290. * The base implementation of `_.isNative` without bad shim checks.
  10291. *
  10292. * @private
  10293. * @param {*} value The value to check.
  10294. * @returns {boolean} Returns `true` if `value` is a native function,
  10295. * else `false`.
  10296. */
  10297. function baseIsNative(value) {
  10298. if (!isObject(value) || isMasked(value)) {
  10299. return false;
  10300. }
  10301. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  10302. return pattern.test(toSource(value));
  10303. }
  10304. /**
  10305. * The base implementation of `_.set`.
  10306. *
  10307. * @private
  10308. * @param {Object} object The object to modify.
  10309. * @param {Array|string} path The path of the property to set.
  10310. * @param {*} value The value to set.
  10311. * @param {Function} [customizer] The function to customize path creation.
  10312. * @returns {Object} Returns `object`.
  10313. */
  10314. function baseSet(object, path, value, customizer) {
  10315. if (!isObject(object)) {
  10316. return object;
  10317. }
  10318. path = isKey(path, object) ? [path] : castPath(path);
  10319. var index = -1,
  10320. length = path.length,
  10321. lastIndex = length - 1,
  10322. nested = object;
  10323. while (nested != null && ++index < length) {
  10324. var key = toKey(path[index]),
  10325. newValue = value;
  10326. if (index != lastIndex) {
  10327. var objValue = nested[key];
  10328. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10329. if (newValue === undefined) {
  10330. newValue = isObject(objValue)
  10331. ? objValue
  10332. : (isIndex(path[index + 1]) ? [] : {});
  10333. }
  10334. }
  10335. assignValue(nested, key, newValue);
  10336. nested = nested[key];
  10337. }
  10338. return object;
  10339. }
  10340. /**
  10341. * The base implementation of `_.toString` which doesn't convert nullish
  10342. * values to empty strings.
  10343. *
  10344. * @private
  10345. * @param {*} value The value to process.
  10346. * @returns {string} Returns the string.
  10347. */
  10348. function baseToString(value) {
  10349. // Exit early for strings to avoid a performance hit in some environments.
  10350. if (typeof value == 'string') {
  10351. return value;
  10352. }
  10353. if (isSymbol(value)) {
  10354. return symbolToString ? symbolToString.call(value) : '';
  10355. }
  10356. var result = (value + '');
  10357. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10358. }
  10359. /**
  10360. * Casts `value` to a path array if it's not one.
  10361. *
  10362. * @private
  10363. * @param {*} value The value to inspect.
  10364. * @returns {Array} Returns the cast property path array.
  10365. */
  10366. function castPath(value) {
  10367. return isArray(value) ? value : stringToPath(value);
  10368. }
  10369. /**
  10370. * Gets the data for `map`.
  10371. *
  10372. * @private
  10373. * @param {Object} map The map to query.
  10374. * @param {string} key The reference key.
  10375. * @returns {*} Returns the map data.
  10376. */
  10377. function getMapData(map, key) {
  10378. var data = map.__data__;
  10379. return isKeyable(key)
  10380. ? data[typeof key == 'string' ? 'string' : 'hash']
  10381. : data.map;
  10382. }
  10383. /**
  10384. * Gets the native function at `key` of `object`.
  10385. *
  10386. * @private
  10387. * @param {Object} object The object to query.
  10388. * @param {string} key The key of the method to get.
  10389. * @returns {*} Returns the function if it's native, else `undefined`.
  10390. */
  10391. function getNative(object, key) {
  10392. var value = getValue(object, key);
  10393. return baseIsNative(value) ? value : undefined;
  10394. }
  10395. /**
  10396. * Checks if `value` is a valid array-like index.
  10397. *
  10398. * @private
  10399. * @param {*} value The value to check.
  10400. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  10401. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  10402. */
  10403. function isIndex(value, length) {
  10404. length = length == null ? MAX_SAFE_INTEGER : length;
  10405. return !!length &&
  10406. (typeof value == 'number' || reIsUint.test(value)) &&
  10407. (value > -1 && value % 1 == 0 && value < length);
  10408. }
  10409. /**
  10410. * Checks if `value` is a property name and not a property path.
  10411. *
  10412. * @private
  10413. * @param {*} value The value to check.
  10414. * @param {Object} [object] The object to query keys on.
  10415. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  10416. */
  10417. function isKey(value, object) {
  10418. if (isArray(value)) {
  10419. return false;
  10420. }
  10421. var type = typeof value;
  10422. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  10423. value == null || isSymbol(value)) {
  10424. return true;
  10425. }
  10426. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  10427. (object != null && value in Object(object));
  10428. }
  10429. /**
  10430. * Checks if `value` is suitable for use as unique object key.
  10431. *
  10432. * @private
  10433. * @param {*} value The value to check.
  10434. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  10435. */
  10436. function isKeyable(value) {
  10437. var type = typeof value;
  10438. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  10439. ? (value !== '__proto__')
  10440. : (value === null);
  10441. }
  10442. /**
  10443. * Checks if `func` has its source masked.
  10444. *
  10445. * @private
  10446. * @param {Function} func The function to check.
  10447. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  10448. */
  10449. function isMasked(func) {
  10450. return !!maskSrcKey && (maskSrcKey in func);
  10451. }
  10452. /**
  10453. * Converts `string` to a property path array.
  10454. *
  10455. * @private
  10456. * @param {string} string The string to convert.
  10457. * @returns {Array} Returns the property path array.
  10458. */
  10459. var stringToPath = memoize(function(string) {
  10460. string = toString(string);
  10461. var result = [];
  10462. if (reLeadingDot.test(string)) {
  10463. result.push('');
  10464. }
  10465. string.replace(rePropName, function(match, number, quote, string) {
  10466. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  10467. });
  10468. return result;
  10469. });
  10470. /**
  10471. * Converts `value` to a string key if it's not a string or symbol.
  10472. *
  10473. * @private
  10474. * @param {*} value The value to inspect.
  10475. * @returns {string|symbol} Returns the key.
  10476. */
  10477. function toKey(value) {
  10478. if (typeof value == 'string' || isSymbol(value)) {
  10479. return value;
  10480. }
  10481. var result = (value + '');
  10482. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10483. }
  10484. /**
  10485. * Converts `func` to its source code.
  10486. *
  10487. * @private
  10488. * @param {Function} func The function to process.
  10489. * @returns {string} Returns the source code.
  10490. */
  10491. function toSource(func) {
  10492. if (func != null) {
  10493. try {
  10494. return funcToString.call(func);
  10495. } catch (e) {}
  10496. try {
  10497. return (func + '');
  10498. } catch (e) {}
  10499. }
  10500. return '';
  10501. }
  10502. /**
  10503. * Creates a function that memoizes the result of `func`. If `resolver` is
  10504. * provided, it determines the cache key for storing the result based on the
  10505. * arguments provided to the memoized function. By default, the first argument
  10506. * provided to the memoized function is used as the map cache key. The `func`
  10507. * is invoked with the `this` binding of the memoized function.
  10508. *
  10509. * **Note:** The cache is exposed as the `cache` property on the memoized
  10510. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10511. * constructor with one whose instances implement the
  10512. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10513. * method interface of `delete`, `get`, `has`, and `set`.
  10514. *
  10515. * @static
  10516. * @memberOf _
  10517. * @since 0.1.0
  10518. * @category Function
  10519. * @param {Function} func The function to have its output memoized.
  10520. * @param {Function} [resolver] The function to resolve the cache key.
  10521. * @returns {Function} Returns the new memoized function.
  10522. * @example
  10523. *
  10524. * var object = { 'a': 1, 'b': 2 };
  10525. * var other = { 'c': 3, 'd': 4 };
  10526. *
  10527. * var values = _.memoize(_.values);
  10528. * values(object);
  10529. * // => [1, 2]
  10530. *
  10531. * values(other);
  10532. * // => [3, 4]
  10533. *
  10534. * object.a = 2;
  10535. * values(object);
  10536. * // => [1, 2]
  10537. *
  10538. * // Modify the result cache.
  10539. * values.cache.set(object, ['a', 'b']);
  10540. * values(object);
  10541. * // => ['a', 'b']
  10542. *
  10543. * // Replace `_.memoize.Cache`.
  10544. * _.memoize.Cache = WeakMap;
  10545. */
  10546. function memoize(func, resolver) {
  10547. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  10548. throw new TypeError(FUNC_ERROR_TEXT);
  10549. }
  10550. var memoized = function() {
  10551. var args = arguments,
  10552. key = resolver ? resolver.apply(this, args) : args[0],
  10553. cache = memoized.cache;
  10554. if (cache.has(key)) {
  10555. return cache.get(key);
  10556. }
  10557. var result = func.apply(this, args);
  10558. memoized.cache = cache.set(key, result);
  10559. return result;
  10560. };
  10561. memoized.cache = new (memoize.Cache || MapCache);
  10562. return memoized;
  10563. }
  10564. // Assign cache to `_.memoize`.
  10565. memoize.Cache = MapCache;
  10566. /**
  10567. * Performs a
  10568. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10569. * comparison between two values to determine if they are equivalent.
  10570. *
  10571. * @static
  10572. * @memberOf _
  10573. * @since 4.0.0
  10574. * @category Lang
  10575. * @param {*} value The value to compare.
  10576. * @param {*} other The other value to compare.
  10577. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  10578. * @example
  10579. *
  10580. * var object = { 'a': 1 };
  10581. * var other = { 'a': 1 };
  10582. *
  10583. * _.eq(object, object);
  10584. * // => true
  10585. *
  10586. * _.eq(object, other);
  10587. * // => false
  10588. *
  10589. * _.eq('a', 'a');
  10590. * // => true
  10591. *
  10592. * _.eq('a', Object('a'));
  10593. * // => false
  10594. *
  10595. * _.eq(NaN, NaN);
  10596. * // => true
  10597. */
  10598. function eq(value, other) {
  10599. return value === other || (value !== value && other !== other);
  10600. }
  10601. /**
  10602. * Checks if `value` is classified as an `Array` object.
  10603. *
  10604. * @static
  10605. * @memberOf _
  10606. * @since 0.1.0
  10607. * @category Lang
  10608. * @param {*} value The value to check.
  10609. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  10610. * @example
  10611. *
  10612. * _.isArray([1, 2, 3]);
  10613. * // => true
  10614. *
  10615. * _.isArray(document.body.children);
  10616. * // => false
  10617. *
  10618. * _.isArray('abc');
  10619. * // => false
  10620. *
  10621. * _.isArray(_.noop);
  10622. * // => false
  10623. */
  10624. var isArray = Array.isArray;
  10625. /**
  10626. * Checks if `value` is classified as a `Function` object.
  10627. *
  10628. * @static
  10629. * @memberOf _
  10630. * @since 0.1.0
  10631. * @category Lang
  10632. * @param {*} value The value to check.
  10633. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10634. * @example
  10635. *
  10636. * _.isFunction(_);
  10637. * // => true
  10638. *
  10639. * _.isFunction(/abc/);
  10640. * // => false
  10641. */
  10642. function isFunction(value) {
  10643. // The use of `Object#toString` avoids issues with the `typeof` operator
  10644. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  10645. var tag = isObject(value) ? objectToString.call(value) : '';
  10646. return tag == funcTag || tag == genTag;
  10647. }
  10648. /**
  10649. * Checks if `value` is the
  10650. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10651. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10652. *
  10653. * @static
  10654. * @memberOf _
  10655. * @since 0.1.0
  10656. * @category Lang
  10657. * @param {*} value The value to check.
  10658. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10659. * @example
  10660. *
  10661. * _.isObject({});
  10662. * // => true
  10663. *
  10664. * _.isObject([1, 2, 3]);
  10665. * // => true
  10666. *
  10667. * _.isObject(_.noop);
  10668. * // => true
  10669. *
  10670. * _.isObject(null);
  10671. * // => false
  10672. */
  10673. function isObject(value) {
  10674. var type = typeof value;
  10675. return !!value && (type == 'object' || type == 'function');
  10676. }
  10677. /**
  10678. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10679. * and has a `typeof` result of "object".
  10680. *
  10681. * @static
  10682. * @memberOf _
  10683. * @since 4.0.0
  10684. * @category Lang
  10685. * @param {*} value The value to check.
  10686. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10687. * @example
  10688. *
  10689. * _.isObjectLike({});
  10690. * // => true
  10691. *
  10692. * _.isObjectLike([1, 2, 3]);
  10693. * // => true
  10694. *
  10695. * _.isObjectLike(_.noop);
  10696. * // => false
  10697. *
  10698. * _.isObjectLike(null);
  10699. * // => false
  10700. */
  10701. function isObjectLike(value) {
  10702. return !!value && typeof value == 'object';
  10703. }
  10704. /**
  10705. * Checks if `value` is classified as a `Symbol` primitive or object.
  10706. *
  10707. * @static
  10708. * @memberOf _
  10709. * @since 4.0.0
  10710. * @category Lang
  10711. * @param {*} value The value to check.
  10712. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10713. * @example
  10714. *
  10715. * _.isSymbol(Symbol.iterator);
  10716. * // => true
  10717. *
  10718. * _.isSymbol('abc');
  10719. * // => false
  10720. */
  10721. function isSymbol(value) {
  10722. return typeof value == 'symbol' ||
  10723. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  10724. }
  10725. /**
  10726. * Converts `value` to a string. An empty string is returned for `null`
  10727. * and `undefined` values. The sign of `-0` is preserved.
  10728. *
  10729. * @static
  10730. * @memberOf _
  10731. * @since 4.0.0
  10732. * @category Lang
  10733. * @param {*} value The value to process.
  10734. * @returns {string} Returns the string.
  10735. * @example
  10736. *
  10737. * _.toString(null);
  10738. * // => ''
  10739. *
  10740. * _.toString(-0);
  10741. * // => '-0'
  10742. *
  10743. * _.toString([1, 2, 3]);
  10744. * // => '1,2,3'
  10745. */
  10746. function toString(value) {
  10747. return value == null ? '' : baseToString(value);
  10748. }
  10749. /**
  10750. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  10751. * it's created. Arrays are created for missing index properties while objects
  10752. * are created for all other missing properties. Use `_.setWith` to customize
  10753. * `path` creation.
  10754. *
  10755. * **Note:** This method mutates `object`.
  10756. *
  10757. * @static
  10758. * @memberOf _
  10759. * @since 3.7.0
  10760. * @category Object
  10761. * @param {Object} object The object to modify.
  10762. * @param {Array|string} path The path of the property to set.
  10763. * @param {*} value The value to set.
  10764. * @returns {Object} Returns `object`.
  10765. * @example
  10766. *
  10767. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  10768. *
  10769. * _.set(object, 'a[0].b.c', 4);
  10770. * console.log(object.a[0].b.c);
  10771. * // => 4
  10772. *
  10773. * _.set(object, ['x', '0', 'y', 'z'], 5);
  10774. * console.log(object.x[0].y.z);
  10775. * // => 5
  10776. */
  10777. function set(object, path, value) {
  10778. return object == null ? object : baseSet(object, path, value);
  10779. }
  10780. module.exports = set;
  10781. /***/ }),
  10782. /***/ 899:
  10783. /***/ (function(module, __unusedexports, __webpack_require__) {
  10784. module.exports = registerEndpoints;
  10785. const { Deprecation } = __webpack_require__(692);
  10786. function registerEndpoints(octokit, routes) {
  10787. Object.keys(routes).forEach(namespaceName => {
  10788. if (!octokit[namespaceName]) {
  10789. octokit[namespaceName] = {};
  10790. }
  10791. Object.keys(routes[namespaceName]).forEach(apiName => {
  10792. const apiOptions = routes[namespaceName][apiName];
  10793. const endpointDefaults = ["method", "url", "headers"].reduce(
  10794. (map, key) => {
  10795. if (typeof apiOptions[key] !== "undefined") {
  10796. map[key] = apiOptions[key];
  10797. }
  10798. return map;
  10799. },
  10800. {}
  10801. );
  10802. endpointDefaults.request = {
  10803. validate: apiOptions.params
  10804. };
  10805. let request = octokit.request.defaults(endpointDefaults);
  10806. // patch request & endpoint methods to support deprecated parameters.
  10807. // Not the most elegant solution, but we don’t want to move deprecation
  10808. // logic into octokit/endpoint.js as it’s out of scope
  10809. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  10810. key => apiOptions.params[key].deprecated
  10811. );
  10812. if (hasDeprecatedParam) {
  10813. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  10814. request = patch(
  10815. octokit.request.defaults(endpointDefaults),
  10816. `.${namespaceName}.${apiName}()`
  10817. );
  10818. request.endpoint = patch(
  10819. request.endpoint,
  10820. `.${namespaceName}.${apiName}.endpoint()`
  10821. );
  10822. request.endpoint.merge = patch(
  10823. request.endpoint.merge,
  10824. `.${namespaceName}.${apiName}.endpoint.merge()`
  10825. );
  10826. }
  10827. if (apiOptions.deprecated) {
  10828. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  10829. octokit.log.warn(
  10830. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  10831. );
  10832. octokit[namespaceName][apiName] = request;
  10833. return request.apply(null, arguments);
  10834. };
  10835. return;
  10836. }
  10837. octokit[namespaceName][apiName] = request;
  10838. });
  10839. });
  10840. }
  10841. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  10842. const patchedMethod = options => {
  10843. options = Object.assign({}, options);
  10844. Object.keys(options).forEach(key => {
  10845. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  10846. const aliasKey = apiOptions.params[key].alias;
  10847. octokit.log.warn(
  10848. new Deprecation(
  10849. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  10850. )
  10851. );
  10852. if (!(aliasKey in options)) {
  10853. options[aliasKey] = options[key];
  10854. }
  10855. delete options[key];
  10856. }
  10857. });
  10858. return method(options);
  10859. };
  10860. Object.keys(method).forEach(key => {
  10861. patchedMethod[key] = method[key];
  10862. });
  10863. return patchedMethod;
  10864. }
  10865. /***/ }),
  10866. /***/ 929:
  10867. /***/ (function(module, __unusedexports, __webpack_require__) {
  10868. module.exports = hasNextPage
  10869. const deprecate = __webpack_require__(370)
  10870. const getPageLinks = __webpack_require__(577)
  10871. function hasNextPage (link) {
  10872. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10873. return getPageLinks(link).next
  10874. }
  10875. /***/ }),
  10876. /***/ 948:
  10877. /***/ (function(module) {
  10878. "use strict";
  10879. /**
  10880. * Tries to execute a function and discards any error that occurs.
  10881. * @param {Function} fn - Function that might or might not throw an error.
  10882. * @returns {?*} Return-value of the function when no error occurred.
  10883. */
  10884. module.exports = function(fn) {
  10885. try { return fn() } catch (e) {}
  10886. }
  10887. /***/ }),
  10888. /***/ 954:
  10889. /***/ (function(module) {
  10890. module.exports = validateAuth;
  10891. function validateAuth(auth) {
  10892. if (typeof auth === "string") {
  10893. return;
  10894. }
  10895. if (typeof auth === "function") {
  10896. return;
  10897. }
  10898. if (auth.username && auth.password) {
  10899. return;
  10900. }
  10901. if (auth.clientId && auth.clientSecret) {
  10902. return;
  10903. }
  10904. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  10905. }
  10906. /***/ }),
  10907. /***/ 955:
  10908. /***/ (function(module, __unusedexports, __webpack_require__) {
  10909. "use strict";
  10910. const path = __webpack_require__(622);
  10911. const childProcess = __webpack_require__(129);
  10912. const crossSpawn = __webpack_require__(20);
  10913. const stripEof = __webpack_require__(768);
  10914. const npmRunPath = __webpack_require__(621);
  10915. const isStream = __webpack_require__(323);
  10916. const _getStream = __webpack_require__(145);
  10917. const pFinally = __webpack_require__(697);
  10918. const onExit = __webpack_require__(260);
  10919. const errname = __webpack_require__(427);
  10920. const stdio = __webpack_require__(168);
  10921. const TEN_MEGABYTES = 1000 * 1000 * 10;
  10922. function handleArgs(cmd, args, opts) {
  10923. let parsed;
  10924. opts = Object.assign({
  10925. extendEnv: true,
  10926. env: {}
  10927. }, opts);
  10928. if (opts.extendEnv) {
  10929. opts.env = Object.assign({}, process.env, opts.env);
  10930. }
  10931. if (opts.__winShell === true) {
  10932. delete opts.__winShell;
  10933. parsed = {
  10934. command: cmd,
  10935. args,
  10936. options: opts,
  10937. file: cmd,
  10938. original: {
  10939. cmd,
  10940. args
  10941. }
  10942. };
  10943. } else {
  10944. parsed = crossSpawn._parse(cmd, args, opts);
  10945. }
  10946. opts = Object.assign({
  10947. maxBuffer: TEN_MEGABYTES,
  10948. buffer: true,
  10949. stripEof: true,
  10950. preferLocal: true,
  10951. localDir: parsed.options.cwd || process.cwd(),
  10952. encoding: 'utf8',
  10953. reject: true,
  10954. cleanup: true
  10955. }, parsed.options);
  10956. opts.stdio = stdio(opts);
  10957. if (opts.preferLocal) {
  10958. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  10959. }
  10960. if (opts.detached) {
  10961. // #115
  10962. opts.cleanup = false;
  10963. }
  10964. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  10965. // #116
  10966. parsed.args.unshift('/q');
  10967. }
  10968. return {
  10969. cmd: parsed.command,
  10970. args: parsed.args,
  10971. opts,
  10972. parsed
  10973. };
  10974. }
  10975. function handleInput(spawned, input) {
  10976. if (input === null || input === undefined) {
  10977. return;
  10978. }
  10979. if (isStream(input)) {
  10980. input.pipe(spawned.stdin);
  10981. } else {
  10982. spawned.stdin.end(input);
  10983. }
  10984. }
  10985. function handleOutput(opts, val) {
  10986. if (val && opts.stripEof) {
  10987. val = stripEof(val);
  10988. }
  10989. return val;
  10990. }
  10991. function handleShell(fn, cmd, opts) {
  10992. let file = '/bin/sh';
  10993. let args = ['-c', cmd];
  10994. opts = Object.assign({}, opts);
  10995. if (process.platform === 'win32') {
  10996. opts.__winShell = true;
  10997. file = process.env.comspec || 'cmd.exe';
  10998. args = ['/s', '/c', `"${cmd}"`];
  10999. opts.windowsVerbatimArguments = true;
  11000. }
  11001. if (opts.shell) {
  11002. file = opts.shell;
  11003. delete opts.shell;
  11004. }
  11005. return fn(file, args, opts);
  11006. }
  11007. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  11008. if (!process[stream]) {
  11009. return null;
  11010. }
  11011. let ret;
  11012. if (!buffer) {
  11013. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  11014. ret = new Promise((resolve, reject) => {
  11015. process[stream]
  11016. .once('end', resolve)
  11017. .once('error', reject);
  11018. });
  11019. } else if (encoding) {
  11020. ret = _getStream(process[stream], {
  11021. encoding,
  11022. maxBuffer
  11023. });
  11024. } else {
  11025. ret = _getStream.buffer(process[stream], {maxBuffer});
  11026. }
  11027. return ret.catch(err => {
  11028. err.stream = stream;
  11029. err.message = `${stream} ${err.message}`;
  11030. throw err;
  11031. });
  11032. }
  11033. function makeError(result, options) {
  11034. const {stdout, stderr} = result;
  11035. let err = result.error;
  11036. const {code, signal} = result;
  11037. const {parsed, joinedCmd} = options;
  11038. const timedOut = options.timedOut || false;
  11039. if (!err) {
  11040. let output = '';
  11041. if (Array.isArray(parsed.opts.stdio)) {
  11042. if (parsed.opts.stdio[2] !== 'inherit') {
  11043. output += output.length > 0 ? stderr : `\n${stderr}`;
  11044. }
  11045. if (parsed.opts.stdio[1] !== 'inherit') {
  11046. output += `\n${stdout}`;
  11047. }
  11048. } else if (parsed.opts.stdio !== 'inherit') {
  11049. output = `\n${stderr}${stdout}`;
  11050. }
  11051. err = new Error(`Command failed: ${joinedCmd}${output}`);
  11052. err.code = code < 0 ? errname(code) : code;
  11053. }
  11054. err.stdout = stdout;
  11055. err.stderr = stderr;
  11056. err.failed = true;
  11057. err.signal = signal || null;
  11058. err.cmd = joinedCmd;
  11059. err.timedOut = timedOut;
  11060. return err;
  11061. }
  11062. function joinCmd(cmd, args) {
  11063. let joinedCmd = cmd;
  11064. if (Array.isArray(args) && args.length > 0) {
  11065. joinedCmd += ' ' + args.join(' ');
  11066. }
  11067. return joinedCmd;
  11068. }
  11069. module.exports = (cmd, args, opts) => {
  11070. const parsed = handleArgs(cmd, args, opts);
  11071. const {encoding, buffer, maxBuffer} = parsed.opts;
  11072. const joinedCmd = joinCmd(cmd, args);
  11073. let spawned;
  11074. try {
  11075. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  11076. } catch (err) {
  11077. return Promise.reject(err);
  11078. }
  11079. let removeExitHandler;
  11080. if (parsed.opts.cleanup) {
  11081. removeExitHandler = onExit(() => {
  11082. spawned.kill();
  11083. });
  11084. }
  11085. let timeoutId = null;
  11086. let timedOut = false;
  11087. const cleanup = () => {
  11088. if (timeoutId) {
  11089. clearTimeout(timeoutId);
  11090. timeoutId = null;
  11091. }
  11092. if (removeExitHandler) {
  11093. removeExitHandler();
  11094. }
  11095. };
  11096. if (parsed.opts.timeout > 0) {
  11097. timeoutId = setTimeout(() => {
  11098. timeoutId = null;
  11099. timedOut = true;
  11100. spawned.kill(parsed.opts.killSignal);
  11101. }, parsed.opts.timeout);
  11102. }
  11103. const processDone = new Promise(resolve => {
  11104. spawned.on('exit', (code, signal) => {
  11105. cleanup();
  11106. resolve({code, signal});
  11107. });
  11108. spawned.on('error', err => {
  11109. cleanup();
  11110. resolve({error: err});
  11111. });
  11112. if (spawned.stdin) {
  11113. spawned.stdin.on('error', err => {
  11114. cleanup();
  11115. resolve({error: err});
  11116. });
  11117. }
  11118. });
  11119. function destroy() {
  11120. if (spawned.stdout) {
  11121. spawned.stdout.destroy();
  11122. }
  11123. if (spawned.stderr) {
  11124. spawned.stderr.destroy();
  11125. }
  11126. }
  11127. const handlePromise = () => pFinally(Promise.all([
  11128. processDone,
  11129. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  11130. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  11131. ]).then(arr => {
  11132. const result = arr[0];
  11133. result.stdout = arr[1];
  11134. result.stderr = arr[2];
  11135. if (result.error || result.code !== 0 || result.signal !== null) {
  11136. const err = makeError(result, {
  11137. joinedCmd,
  11138. parsed,
  11139. timedOut
  11140. });
  11141. // TODO: missing some timeout logic for killed
  11142. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  11143. // err.killed = spawned.killed || killed;
  11144. err.killed = err.killed || spawned.killed;
  11145. if (!parsed.opts.reject) {
  11146. return err;
  11147. }
  11148. throw err;
  11149. }
  11150. return {
  11151. stdout: handleOutput(parsed.opts, result.stdout),
  11152. stderr: handleOutput(parsed.opts, result.stderr),
  11153. code: 0,
  11154. failed: false,
  11155. killed: false,
  11156. signal: null,
  11157. cmd: joinedCmd,
  11158. timedOut: false
  11159. };
  11160. }), destroy);
  11161. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  11162. handleInput(spawned, parsed.opts.input);
  11163. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  11164. spawned.catch = onrejected => handlePromise().catch(onrejected);
  11165. return spawned;
  11166. };
  11167. // TODO: set `stderr: 'ignore'` when that option is implemented
  11168. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  11169. // TODO: set `stdout: 'ignore'` when that option is implemented
  11170. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  11171. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  11172. module.exports.sync = (cmd, args, opts) => {
  11173. const parsed = handleArgs(cmd, args, opts);
  11174. const joinedCmd = joinCmd(cmd, args);
  11175. if (isStream(parsed.opts.input)) {
  11176. throw new TypeError('The `input` option cannot be a stream in sync mode');
  11177. }
  11178. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  11179. result.code = result.status;
  11180. if (result.error || result.status !== 0 || result.signal !== null) {
  11181. const err = makeError(result, {
  11182. joinedCmd,
  11183. parsed
  11184. });
  11185. if (!parsed.opts.reject) {
  11186. return err;
  11187. }
  11188. throw err;
  11189. }
  11190. return {
  11191. stdout: handleOutput(parsed.opts, result.stdout),
  11192. stderr: handleOutput(parsed.opts, result.stderr),
  11193. code: 0,
  11194. failed: false,
  11195. signal: null,
  11196. cmd: joinedCmd,
  11197. timedOut: false
  11198. };
  11199. };
  11200. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  11201. /***/ }),
  11202. /***/ 966:
  11203. /***/ (function(module, __unusedexports, __webpack_require__) {
  11204. "use strict";
  11205. const {PassThrough} = __webpack_require__(413);
  11206. module.exports = options => {
  11207. options = Object.assign({}, options);
  11208. const {array} = options;
  11209. let {encoding} = options;
  11210. const buffer = encoding === 'buffer';
  11211. let objectMode = false;
  11212. if (array) {
  11213. objectMode = !(encoding || buffer);
  11214. } else {
  11215. encoding = encoding || 'utf8';
  11216. }
  11217. if (buffer) {
  11218. encoding = null;
  11219. }
  11220. let len = 0;
  11221. const ret = [];
  11222. const stream = new PassThrough({objectMode});
  11223. if (encoding) {
  11224. stream.setEncoding(encoding);
  11225. }
  11226. stream.on('data', chunk => {
  11227. ret.push(chunk);
  11228. if (objectMode) {
  11229. len = ret.length;
  11230. } else {
  11231. len += chunk.length;
  11232. }
  11233. });
  11234. stream.getBufferedValue = () => {
  11235. if (array) {
  11236. return ret;
  11237. }
  11238. return buffer ? Buffer.concat(ret, len) : ret.join('');
  11239. };
  11240. stream.getBufferedLength = () => len;
  11241. return stream;
  11242. };
  11243. /***/ }),
  11244. /***/ 969:
  11245. /***/ (function(module, __unusedexports, __webpack_require__) {
  11246. var wrappy = __webpack_require__(11)
  11247. module.exports = wrappy(once)
  11248. module.exports.strict = wrappy(onceStrict)
  11249. once.proto = once(function () {
  11250. Object.defineProperty(Function.prototype, 'once', {
  11251. value: function () {
  11252. return once(this)
  11253. },
  11254. configurable: true
  11255. })
  11256. Object.defineProperty(Function.prototype, 'onceStrict', {
  11257. value: function () {
  11258. return onceStrict(this)
  11259. },
  11260. configurable: true
  11261. })
  11262. })
  11263. function once (fn) {
  11264. var f = function () {
  11265. if (f.called) return f.value
  11266. f.called = true
  11267. return f.value = fn.apply(this, arguments)
  11268. }
  11269. f.called = false
  11270. return f
  11271. }
  11272. function onceStrict (fn) {
  11273. var f = function () {
  11274. if (f.called)
  11275. throw new Error(f.onceError)
  11276. f.called = true
  11277. return f.value = fn.apply(this, arguments)
  11278. }
  11279. var name = fn.name || 'Function wrapped with `once`'
  11280. f.onceError = name + " shouldn't be called more than once"
  11281. f.called = false
  11282. return f
  11283. }
  11284. /***/ }),
  11285. /***/ 986:
  11286. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11287. "use strict";
  11288. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11289. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11290. return new (P || (P = Promise))(function (resolve, reject) {
  11291. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11292. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11293. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11294. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11295. });
  11296. };
  11297. Object.defineProperty(exports, "__esModule", { value: true });
  11298. const tr = __webpack_require__(9);
  11299. /**
  11300. * Exec a command.
  11301. * Output will be streamed to the live console.
  11302. * Returns promise with return code
  11303. *
  11304. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  11305. * @param args optional arguments for tool. Escaping is handled by the lib.
  11306. * @param options optional exec options. See ExecOptions
  11307. * @returns Promise<number> exit code
  11308. */
  11309. function exec(commandLine, args, options) {
  11310. return __awaiter(this, void 0, void 0, function* () {
  11311. const commandArgs = tr.argStringToArray(commandLine);
  11312. if (commandArgs.length === 0) {
  11313. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  11314. }
  11315. // Path to tool to execute should be first arg
  11316. const toolPath = commandArgs[0];
  11317. args = commandArgs.slice(1).concat(args || []);
  11318. const runner = new tr.ToolRunner(toolPath, args, options);
  11319. return runner.exec();
  11320. });
  11321. }
  11322. exports.exec = exec;
  11323. //# sourceMappingURL=exec.js.map
  11324. /***/ }),
  11325. /***/ 991:
  11326. /***/ (function(module, __unusedexports, __webpack_require__) {
  11327. module.exports = authenticationRequestError;
  11328. const { RequestError } = __webpack_require__(463);
  11329. function authenticationRequestError(state, error, options) {
  11330. if (!error.headers) throw error;
  11331. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  11332. // handle "2FA required" error only
  11333. if (error.status !== 401 || !otpRequired) {
  11334. throw error;
  11335. }
  11336. if (
  11337. error.status === 401 &&
  11338. otpRequired &&
  11339. error.request &&
  11340. error.request.headers["x-github-otp"]
  11341. ) {
  11342. if (state.otp) {
  11343. delete state.otp; // no longer valid, request again
  11344. } else {
  11345. throw new RequestError(
  11346. "Invalid one-time password for two-factor authentication",
  11347. 401,
  11348. {
  11349. headers: error.headers,
  11350. request: options
  11351. }
  11352. );
  11353. }
  11354. }
  11355. if (typeof state.auth.on2fa !== "function") {
  11356. throw new RequestError(
  11357. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  11358. 401,
  11359. {
  11360. headers: error.headers,
  11361. request: options
  11362. }
  11363. );
  11364. }
  11365. return Promise.resolve()
  11366. .then(() => {
  11367. return state.auth.on2fa();
  11368. })
  11369. .then(oneTimePassword => {
  11370. const newOptions = Object.assign(options, {
  11371. headers: Object.assign(options.headers, {
  11372. "x-github-otp": oneTimePassword
  11373. })
  11374. });
  11375. return state.octokit.request(newOptions).then(response => {
  11376. // If OTP still valid, then persist it for following requests
  11377. state.otp = oneTimePassword;
  11378. return response;
  11379. });
  11380. });
  11381. }
  11382. /***/ })
  11383. /******/ });