index.js 506 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(372),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(190),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 18:
  1031. /***/ (function() {
  1032. eval("require")("encoding");
  1033. /***/ }),
  1034. /***/ 19:
  1035. /***/ (function(module, __unusedexports, __webpack_require__) {
  1036. module.exports = authenticationPlugin;
  1037. const { Deprecation } = __webpack_require__(692);
  1038. const once = __webpack_require__(969);
  1039. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1040. const authenticate = __webpack_require__(674);
  1041. const beforeRequest = __webpack_require__(471);
  1042. const requestError = __webpack_require__(349);
  1043. function authenticationPlugin(octokit, options) {
  1044. if (options.auth) {
  1045. octokit.authenticate = () => {
  1046. deprecateAuthenticate(
  1047. octokit.log,
  1048. new Deprecation(
  1049. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1050. )
  1051. );
  1052. };
  1053. return;
  1054. }
  1055. const state = {
  1056. octokit,
  1057. auth: false
  1058. };
  1059. octokit.authenticate = authenticate.bind(null, state);
  1060. octokit.hook.before("request", beforeRequest.bind(null, state));
  1061. octokit.hook.error("request", requestError.bind(null, state));
  1062. }
  1063. /***/ }),
  1064. /***/ 20:
  1065. /***/ (function(module, __unusedexports, __webpack_require__) {
  1066. "use strict";
  1067. const cp = __webpack_require__(129);
  1068. const parse = __webpack_require__(568);
  1069. const enoent = __webpack_require__(881);
  1070. function spawn(command, args, options) {
  1071. // Parse the arguments
  1072. const parsed = parse(command, args, options);
  1073. // Spawn the child process
  1074. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1075. // Hook into child process "exit" event to emit an error if the command
  1076. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1077. enoent.hookChildProcess(spawned, parsed);
  1078. return spawned;
  1079. }
  1080. function spawnSync(command, args, options) {
  1081. // Parse the arguments
  1082. const parsed = parse(command, args, options);
  1083. // Spawn the child process
  1084. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1085. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1086. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1087. return result;
  1088. }
  1089. module.exports = spawn;
  1090. module.exports.spawn = spawn;
  1091. module.exports.sync = spawnSync;
  1092. module.exports._parse = parse;
  1093. module.exports._enoent = enoent;
  1094. /***/ }),
  1095. /***/ 39:
  1096. /***/ (function(module) {
  1097. "use strict";
  1098. module.exports = opts => {
  1099. opts = opts || {};
  1100. const env = opts.env || process.env;
  1101. const platform = opts.platform || process.platform;
  1102. if (platform !== 'win32') {
  1103. return 'PATH';
  1104. }
  1105. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1106. };
  1107. /***/ }),
  1108. /***/ 47:
  1109. /***/ (function(module, __unusedexports, __webpack_require__) {
  1110. module.exports = factory;
  1111. const Octokit = __webpack_require__(402);
  1112. const registerPlugin = __webpack_require__(855);
  1113. function factory(plugins) {
  1114. const Api = Octokit.bind(null, plugins || []);
  1115. Api.plugin = registerPlugin.bind(null, plugins || []);
  1116. return Api;
  1117. }
  1118. /***/ }),
  1119. /***/ 49:
  1120. /***/ (function(module, __unusedexports, __webpack_require__) {
  1121. "use strict";
  1122. const os = __webpack_require__(87);
  1123. const execa = __webpack_require__(955);
  1124. // Reference: https://www.gaijin.at/en/lstwinver.php
  1125. const names = new Map([
  1126. ['10.0', '10'],
  1127. ['6.3', '8.1'],
  1128. ['6.2', '8'],
  1129. ['6.1', '7'],
  1130. ['6.0', 'Vista'],
  1131. ['5.2', 'Server 2003'],
  1132. ['5.1', 'XP'],
  1133. ['5.0', '2000'],
  1134. ['4.9', 'ME'],
  1135. ['4.1', '98'],
  1136. ['4.0', '95']
  1137. ]);
  1138. const windowsRelease = release => {
  1139. const version = /\d+\.\d/.exec(release || os.release());
  1140. if (release && !version) {
  1141. throw new Error('`release` argument doesn\'t match `n.n`');
  1142. }
  1143. const ver = (version || [])[0];
  1144. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1145. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1146. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1147. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1148. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1149. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1150. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1151. if (year) {
  1152. return `Server ${year}`;
  1153. }
  1154. }
  1155. return names.get(ver);
  1156. };
  1157. module.exports = windowsRelease;
  1158. /***/ }),
  1159. /***/ 87:
  1160. /***/ (function(module) {
  1161. module.exports = require("os");
  1162. /***/ }),
  1163. /***/ 118:
  1164. /***/ (function(module, __unusedexports, __webpack_require__) {
  1165. "use strict";
  1166. const os = __webpack_require__(87);
  1167. const nameMap = new Map([
  1168. [19, 'Catalina'],
  1169. [18, 'Mojave'],
  1170. [17, 'High Sierra'],
  1171. [16, 'Sierra'],
  1172. [15, 'El Capitan'],
  1173. [14, 'Yosemite'],
  1174. [13, 'Mavericks'],
  1175. [12, 'Mountain Lion'],
  1176. [11, 'Lion'],
  1177. [10, 'Snow Leopard'],
  1178. [9, 'Leopard'],
  1179. [8, 'Tiger'],
  1180. [7, 'Panther'],
  1181. [6, 'Jaguar'],
  1182. [5, 'Puma']
  1183. ]);
  1184. const macosRelease = release => {
  1185. release = Number((release || os.release()).split('.')[0]);
  1186. return {
  1187. name: nameMap.get(release),
  1188. version: '10.' + (release - 4)
  1189. };
  1190. };
  1191. module.exports = macosRelease;
  1192. // TODO: remove this in the next major version
  1193. module.exports.default = macosRelease;
  1194. /***/ }),
  1195. /***/ 126:
  1196. /***/ (function(module) {
  1197. /**
  1198. * lodash (Custom Build) <https://lodash.com/>
  1199. * Build: `lodash modularize exports="npm" -o ./`
  1200. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1201. * Released under MIT license <https://lodash.com/license>
  1202. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1203. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1204. */
  1205. /** Used as the size to enable large array optimizations. */
  1206. var LARGE_ARRAY_SIZE = 200;
  1207. /** Used to stand-in for `undefined` hash values. */
  1208. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1209. /** Used as references for various `Number` constants. */
  1210. var INFINITY = 1 / 0;
  1211. /** `Object#toString` result references. */
  1212. var funcTag = '[object Function]',
  1213. genTag = '[object GeneratorFunction]';
  1214. /**
  1215. * Used to match `RegExp`
  1216. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1217. */
  1218. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1219. /** Used to detect host constructors (Safari). */
  1220. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1221. /** Detect free variable `global` from Node.js. */
  1222. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1223. /** Detect free variable `self`. */
  1224. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1225. /** Used as a reference to the global object. */
  1226. var root = freeGlobal || freeSelf || Function('return this')();
  1227. /**
  1228. * A specialized version of `_.includes` for arrays without support for
  1229. * specifying an index to search from.
  1230. *
  1231. * @private
  1232. * @param {Array} [array] The array to inspect.
  1233. * @param {*} target The value to search for.
  1234. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1235. */
  1236. function arrayIncludes(array, value) {
  1237. var length = array ? array.length : 0;
  1238. return !!length && baseIndexOf(array, value, 0) > -1;
  1239. }
  1240. /**
  1241. * This function is like `arrayIncludes` except that it accepts a comparator.
  1242. *
  1243. * @private
  1244. * @param {Array} [array] The array to inspect.
  1245. * @param {*} target The value to search for.
  1246. * @param {Function} comparator The comparator invoked per element.
  1247. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1248. */
  1249. function arrayIncludesWith(array, value, comparator) {
  1250. var index = -1,
  1251. length = array ? array.length : 0;
  1252. while (++index < length) {
  1253. if (comparator(value, array[index])) {
  1254. return true;
  1255. }
  1256. }
  1257. return false;
  1258. }
  1259. /**
  1260. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1261. * support for iteratee shorthands.
  1262. *
  1263. * @private
  1264. * @param {Array} array The array to inspect.
  1265. * @param {Function} predicate The function invoked per iteration.
  1266. * @param {number} fromIndex The index to search from.
  1267. * @param {boolean} [fromRight] Specify iterating from right to left.
  1268. * @returns {number} Returns the index of the matched value, else `-1`.
  1269. */
  1270. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1271. var length = array.length,
  1272. index = fromIndex + (fromRight ? 1 : -1);
  1273. while ((fromRight ? index-- : ++index < length)) {
  1274. if (predicate(array[index], index, array)) {
  1275. return index;
  1276. }
  1277. }
  1278. return -1;
  1279. }
  1280. /**
  1281. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1282. *
  1283. * @private
  1284. * @param {Array} array The array to inspect.
  1285. * @param {*} value The value to search for.
  1286. * @param {number} fromIndex The index to search from.
  1287. * @returns {number} Returns the index of the matched value, else `-1`.
  1288. */
  1289. function baseIndexOf(array, value, fromIndex) {
  1290. if (value !== value) {
  1291. return baseFindIndex(array, baseIsNaN, fromIndex);
  1292. }
  1293. var index = fromIndex - 1,
  1294. length = array.length;
  1295. while (++index < length) {
  1296. if (array[index] === value) {
  1297. return index;
  1298. }
  1299. }
  1300. return -1;
  1301. }
  1302. /**
  1303. * The base implementation of `_.isNaN` without support for number objects.
  1304. *
  1305. * @private
  1306. * @param {*} value The value to check.
  1307. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1308. */
  1309. function baseIsNaN(value) {
  1310. return value !== value;
  1311. }
  1312. /**
  1313. * Checks if a cache value for `key` exists.
  1314. *
  1315. * @private
  1316. * @param {Object} cache The cache to query.
  1317. * @param {string} key The key of the entry to check.
  1318. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1319. */
  1320. function cacheHas(cache, key) {
  1321. return cache.has(key);
  1322. }
  1323. /**
  1324. * Gets the value at `key` of `object`.
  1325. *
  1326. * @private
  1327. * @param {Object} [object] The object to query.
  1328. * @param {string} key The key of the property to get.
  1329. * @returns {*} Returns the property value.
  1330. */
  1331. function getValue(object, key) {
  1332. return object == null ? undefined : object[key];
  1333. }
  1334. /**
  1335. * Checks if `value` is a host object in IE < 9.
  1336. *
  1337. * @private
  1338. * @param {*} value The value to check.
  1339. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1340. */
  1341. function isHostObject(value) {
  1342. // Many host objects are `Object` objects that can coerce to strings
  1343. // despite having improperly defined `toString` methods.
  1344. var result = false;
  1345. if (value != null && typeof value.toString != 'function') {
  1346. try {
  1347. result = !!(value + '');
  1348. } catch (e) {}
  1349. }
  1350. return result;
  1351. }
  1352. /**
  1353. * Converts `set` to an array of its values.
  1354. *
  1355. * @private
  1356. * @param {Object} set The set to convert.
  1357. * @returns {Array} Returns the values.
  1358. */
  1359. function setToArray(set) {
  1360. var index = -1,
  1361. result = Array(set.size);
  1362. set.forEach(function(value) {
  1363. result[++index] = value;
  1364. });
  1365. return result;
  1366. }
  1367. /** Used for built-in method references. */
  1368. var arrayProto = Array.prototype,
  1369. funcProto = Function.prototype,
  1370. objectProto = Object.prototype;
  1371. /** Used to detect overreaching core-js shims. */
  1372. var coreJsData = root['__core-js_shared__'];
  1373. /** Used to detect methods masquerading as native. */
  1374. var maskSrcKey = (function() {
  1375. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1376. return uid ? ('Symbol(src)_1.' + uid) : '';
  1377. }());
  1378. /** Used to resolve the decompiled source of functions. */
  1379. var funcToString = funcProto.toString;
  1380. /** Used to check objects for own properties. */
  1381. var hasOwnProperty = objectProto.hasOwnProperty;
  1382. /**
  1383. * Used to resolve the
  1384. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1385. * of values.
  1386. */
  1387. var objectToString = objectProto.toString;
  1388. /** Used to detect if a method is native. */
  1389. var reIsNative = RegExp('^' +
  1390. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1391. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1392. );
  1393. /** Built-in value references. */
  1394. var splice = arrayProto.splice;
  1395. /* Built-in method references that are verified to be native. */
  1396. var Map = getNative(root, 'Map'),
  1397. Set = getNative(root, 'Set'),
  1398. nativeCreate = getNative(Object, 'create');
  1399. /**
  1400. * Creates a hash object.
  1401. *
  1402. * @private
  1403. * @constructor
  1404. * @param {Array} [entries] The key-value pairs to cache.
  1405. */
  1406. function Hash(entries) {
  1407. var index = -1,
  1408. length = entries ? entries.length : 0;
  1409. this.clear();
  1410. while (++index < length) {
  1411. var entry = entries[index];
  1412. this.set(entry[0], entry[1]);
  1413. }
  1414. }
  1415. /**
  1416. * Removes all key-value entries from the hash.
  1417. *
  1418. * @private
  1419. * @name clear
  1420. * @memberOf Hash
  1421. */
  1422. function hashClear() {
  1423. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1424. }
  1425. /**
  1426. * Removes `key` and its value from the hash.
  1427. *
  1428. * @private
  1429. * @name delete
  1430. * @memberOf Hash
  1431. * @param {Object} hash The hash to modify.
  1432. * @param {string} key The key of the value to remove.
  1433. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1434. */
  1435. function hashDelete(key) {
  1436. return this.has(key) && delete this.__data__[key];
  1437. }
  1438. /**
  1439. * Gets the hash value for `key`.
  1440. *
  1441. * @private
  1442. * @name get
  1443. * @memberOf Hash
  1444. * @param {string} key The key of the value to get.
  1445. * @returns {*} Returns the entry value.
  1446. */
  1447. function hashGet(key) {
  1448. var data = this.__data__;
  1449. if (nativeCreate) {
  1450. var result = data[key];
  1451. return result === HASH_UNDEFINED ? undefined : result;
  1452. }
  1453. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1454. }
  1455. /**
  1456. * Checks if a hash value for `key` exists.
  1457. *
  1458. * @private
  1459. * @name has
  1460. * @memberOf Hash
  1461. * @param {string} key The key of the entry to check.
  1462. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1463. */
  1464. function hashHas(key) {
  1465. var data = this.__data__;
  1466. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1467. }
  1468. /**
  1469. * Sets the hash `key` to `value`.
  1470. *
  1471. * @private
  1472. * @name set
  1473. * @memberOf Hash
  1474. * @param {string} key The key of the value to set.
  1475. * @param {*} value The value to set.
  1476. * @returns {Object} Returns the hash instance.
  1477. */
  1478. function hashSet(key, value) {
  1479. var data = this.__data__;
  1480. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1481. return this;
  1482. }
  1483. // Add methods to `Hash`.
  1484. Hash.prototype.clear = hashClear;
  1485. Hash.prototype['delete'] = hashDelete;
  1486. Hash.prototype.get = hashGet;
  1487. Hash.prototype.has = hashHas;
  1488. Hash.prototype.set = hashSet;
  1489. /**
  1490. * Creates an list cache object.
  1491. *
  1492. * @private
  1493. * @constructor
  1494. * @param {Array} [entries] The key-value pairs to cache.
  1495. */
  1496. function ListCache(entries) {
  1497. var index = -1,
  1498. length = entries ? entries.length : 0;
  1499. this.clear();
  1500. while (++index < length) {
  1501. var entry = entries[index];
  1502. this.set(entry[0], entry[1]);
  1503. }
  1504. }
  1505. /**
  1506. * Removes all key-value entries from the list cache.
  1507. *
  1508. * @private
  1509. * @name clear
  1510. * @memberOf ListCache
  1511. */
  1512. function listCacheClear() {
  1513. this.__data__ = [];
  1514. }
  1515. /**
  1516. * Removes `key` and its value from the list cache.
  1517. *
  1518. * @private
  1519. * @name delete
  1520. * @memberOf ListCache
  1521. * @param {string} key The key of the value to remove.
  1522. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1523. */
  1524. function listCacheDelete(key) {
  1525. var data = this.__data__,
  1526. index = assocIndexOf(data, key);
  1527. if (index < 0) {
  1528. return false;
  1529. }
  1530. var lastIndex = data.length - 1;
  1531. if (index == lastIndex) {
  1532. data.pop();
  1533. } else {
  1534. splice.call(data, index, 1);
  1535. }
  1536. return true;
  1537. }
  1538. /**
  1539. * Gets the list cache value for `key`.
  1540. *
  1541. * @private
  1542. * @name get
  1543. * @memberOf ListCache
  1544. * @param {string} key The key of the value to get.
  1545. * @returns {*} Returns the entry value.
  1546. */
  1547. function listCacheGet(key) {
  1548. var data = this.__data__,
  1549. index = assocIndexOf(data, key);
  1550. return index < 0 ? undefined : data[index][1];
  1551. }
  1552. /**
  1553. * Checks if a list cache value for `key` exists.
  1554. *
  1555. * @private
  1556. * @name has
  1557. * @memberOf ListCache
  1558. * @param {string} key The key of the entry to check.
  1559. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1560. */
  1561. function listCacheHas(key) {
  1562. return assocIndexOf(this.__data__, key) > -1;
  1563. }
  1564. /**
  1565. * Sets the list cache `key` to `value`.
  1566. *
  1567. * @private
  1568. * @name set
  1569. * @memberOf ListCache
  1570. * @param {string} key The key of the value to set.
  1571. * @param {*} value The value to set.
  1572. * @returns {Object} Returns the list cache instance.
  1573. */
  1574. function listCacheSet(key, value) {
  1575. var data = this.__data__,
  1576. index = assocIndexOf(data, key);
  1577. if (index < 0) {
  1578. data.push([key, value]);
  1579. } else {
  1580. data[index][1] = value;
  1581. }
  1582. return this;
  1583. }
  1584. // Add methods to `ListCache`.
  1585. ListCache.prototype.clear = listCacheClear;
  1586. ListCache.prototype['delete'] = listCacheDelete;
  1587. ListCache.prototype.get = listCacheGet;
  1588. ListCache.prototype.has = listCacheHas;
  1589. ListCache.prototype.set = listCacheSet;
  1590. /**
  1591. * Creates a map cache object to store key-value pairs.
  1592. *
  1593. * @private
  1594. * @constructor
  1595. * @param {Array} [entries] The key-value pairs to cache.
  1596. */
  1597. function MapCache(entries) {
  1598. var index = -1,
  1599. length = entries ? entries.length : 0;
  1600. this.clear();
  1601. while (++index < length) {
  1602. var entry = entries[index];
  1603. this.set(entry[0], entry[1]);
  1604. }
  1605. }
  1606. /**
  1607. * Removes all key-value entries from the map.
  1608. *
  1609. * @private
  1610. * @name clear
  1611. * @memberOf MapCache
  1612. */
  1613. function mapCacheClear() {
  1614. this.__data__ = {
  1615. 'hash': new Hash,
  1616. 'map': new (Map || ListCache),
  1617. 'string': new Hash
  1618. };
  1619. }
  1620. /**
  1621. * Removes `key` and its value from the map.
  1622. *
  1623. * @private
  1624. * @name delete
  1625. * @memberOf MapCache
  1626. * @param {string} key The key of the value to remove.
  1627. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1628. */
  1629. function mapCacheDelete(key) {
  1630. return getMapData(this, key)['delete'](key);
  1631. }
  1632. /**
  1633. * Gets the map value for `key`.
  1634. *
  1635. * @private
  1636. * @name get
  1637. * @memberOf MapCache
  1638. * @param {string} key The key of the value to get.
  1639. * @returns {*} Returns the entry value.
  1640. */
  1641. function mapCacheGet(key) {
  1642. return getMapData(this, key).get(key);
  1643. }
  1644. /**
  1645. * Checks if a map value for `key` exists.
  1646. *
  1647. * @private
  1648. * @name has
  1649. * @memberOf MapCache
  1650. * @param {string} key The key of the entry to check.
  1651. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1652. */
  1653. function mapCacheHas(key) {
  1654. return getMapData(this, key).has(key);
  1655. }
  1656. /**
  1657. * Sets the map `key` to `value`.
  1658. *
  1659. * @private
  1660. * @name set
  1661. * @memberOf MapCache
  1662. * @param {string} key The key of the value to set.
  1663. * @param {*} value The value to set.
  1664. * @returns {Object} Returns the map cache instance.
  1665. */
  1666. function mapCacheSet(key, value) {
  1667. getMapData(this, key).set(key, value);
  1668. return this;
  1669. }
  1670. // Add methods to `MapCache`.
  1671. MapCache.prototype.clear = mapCacheClear;
  1672. MapCache.prototype['delete'] = mapCacheDelete;
  1673. MapCache.prototype.get = mapCacheGet;
  1674. MapCache.prototype.has = mapCacheHas;
  1675. MapCache.prototype.set = mapCacheSet;
  1676. /**
  1677. *
  1678. * Creates an array cache object to store unique values.
  1679. *
  1680. * @private
  1681. * @constructor
  1682. * @param {Array} [values] The values to cache.
  1683. */
  1684. function SetCache(values) {
  1685. var index = -1,
  1686. length = values ? values.length : 0;
  1687. this.__data__ = new MapCache;
  1688. while (++index < length) {
  1689. this.add(values[index]);
  1690. }
  1691. }
  1692. /**
  1693. * Adds `value` to the array cache.
  1694. *
  1695. * @private
  1696. * @name add
  1697. * @memberOf SetCache
  1698. * @alias push
  1699. * @param {*} value The value to cache.
  1700. * @returns {Object} Returns the cache instance.
  1701. */
  1702. function setCacheAdd(value) {
  1703. this.__data__.set(value, HASH_UNDEFINED);
  1704. return this;
  1705. }
  1706. /**
  1707. * Checks if `value` is in the array cache.
  1708. *
  1709. * @private
  1710. * @name has
  1711. * @memberOf SetCache
  1712. * @param {*} value The value to search for.
  1713. * @returns {number} Returns `true` if `value` is found, else `false`.
  1714. */
  1715. function setCacheHas(value) {
  1716. return this.__data__.has(value);
  1717. }
  1718. // Add methods to `SetCache`.
  1719. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1720. SetCache.prototype.has = setCacheHas;
  1721. /**
  1722. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1723. *
  1724. * @private
  1725. * @param {Array} array The array to inspect.
  1726. * @param {*} key The key to search for.
  1727. * @returns {number} Returns the index of the matched value, else `-1`.
  1728. */
  1729. function assocIndexOf(array, key) {
  1730. var length = array.length;
  1731. while (length--) {
  1732. if (eq(array[length][0], key)) {
  1733. return length;
  1734. }
  1735. }
  1736. return -1;
  1737. }
  1738. /**
  1739. * The base implementation of `_.isNative` without bad shim checks.
  1740. *
  1741. * @private
  1742. * @param {*} value The value to check.
  1743. * @returns {boolean} Returns `true` if `value` is a native function,
  1744. * else `false`.
  1745. */
  1746. function baseIsNative(value) {
  1747. if (!isObject(value) || isMasked(value)) {
  1748. return false;
  1749. }
  1750. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1751. return pattern.test(toSource(value));
  1752. }
  1753. /**
  1754. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1755. *
  1756. * @private
  1757. * @param {Array} array The array to inspect.
  1758. * @param {Function} [iteratee] The iteratee invoked per element.
  1759. * @param {Function} [comparator] The comparator invoked per element.
  1760. * @returns {Array} Returns the new duplicate free array.
  1761. */
  1762. function baseUniq(array, iteratee, comparator) {
  1763. var index = -1,
  1764. includes = arrayIncludes,
  1765. length = array.length,
  1766. isCommon = true,
  1767. result = [],
  1768. seen = result;
  1769. if (comparator) {
  1770. isCommon = false;
  1771. includes = arrayIncludesWith;
  1772. }
  1773. else if (length >= LARGE_ARRAY_SIZE) {
  1774. var set = iteratee ? null : createSet(array);
  1775. if (set) {
  1776. return setToArray(set);
  1777. }
  1778. isCommon = false;
  1779. includes = cacheHas;
  1780. seen = new SetCache;
  1781. }
  1782. else {
  1783. seen = iteratee ? [] : result;
  1784. }
  1785. outer:
  1786. while (++index < length) {
  1787. var value = array[index],
  1788. computed = iteratee ? iteratee(value) : value;
  1789. value = (comparator || value !== 0) ? value : 0;
  1790. if (isCommon && computed === computed) {
  1791. var seenIndex = seen.length;
  1792. while (seenIndex--) {
  1793. if (seen[seenIndex] === computed) {
  1794. continue outer;
  1795. }
  1796. }
  1797. if (iteratee) {
  1798. seen.push(computed);
  1799. }
  1800. result.push(value);
  1801. }
  1802. else if (!includes(seen, computed, comparator)) {
  1803. if (seen !== result) {
  1804. seen.push(computed);
  1805. }
  1806. result.push(value);
  1807. }
  1808. }
  1809. return result;
  1810. }
  1811. /**
  1812. * Creates a set object of `values`.
  1813. *
  1814. * @private
  1815. * @param {Array} values The values to add to the set.
  1816. * @returns {Object} Returns the new set.
  1817. */
  1818. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1819. return new Set(values);
  1820. };
  1821. /**
  1822. * Gets the data for `map`.
  1823. *
  1824. * @private
  1825. * @param {Object} map The map to query.
  1826. * @param {string} key The reference key.
  1827. * @returns {*} Returns the map data.
  1828. */
  1829. function getMapData(map, key) {
  1830. var data = map.__data__;
  1831. return isKeyable(key)
  1832. ? data[typeof key == 'string' ? 'string' : 'hash']
  1833. : data.map;
  1834. }
  1835. /**
  1836. * Gets the native function at `key` of `object`.
  1837. *
  1838. * @private
  1839. * @param {Object} object The object to query.
  1840. * @param {string} key The key of the method to get.
  1841. * @returns {*} Returns the function if it's native, else `undefined`.
  1842. */
  1843. function getNative(object, key) {
  1844. var value = getValue(object, key);
  1845. return baseIsNative(value) ? value : undefined;
  1846. }
  1847. /**
  1848. * Checks if `value` is suitable for use as unique object key.
  1849. *
  1850. * @private
  1851. * @param {*} value The value to check.
  1852. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1853. */
  1854. function isKeyable(value) {
  1855. var type = typeof value;
  1856. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1857. ? (value !== '__proto__')
  1858. : (value === null);
  1859. }
  1860. /**
  1861. * Checks if `func` has its source masked.
  1862. *
  1863. * @private
  1864. * @param {Function} func The function to check.
  1865. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1866. */
  1867. function isMasked(func) {
  1868. return !!maskSrcKey && (maskSrcKey in func);
  1869. }
  1870. /**
  1871. * Converts `func` to its source code.
  1872. *
  1873. * @private
  1874. * @param {Function} func The function to process.
  1875. * @returns {string} Returns the source code.
  1876. */
  1877. function toSource(func) {
  1878. if (func != null) {
  1879. try {
  1880. return funcToString.call(func);
  1881. } catch (e) {}
  1882. try {
  1883. return (func + '');
  1884. } catch (e) {}
  1885. }
  1886. return '';
  1887. }
  1888. /**
  1889. * Creates a duplicate-free version of an array, using
  1890. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1891. * for equality comparisons, in which only the first occurrence of each
  1892. * element is kept.
  1893. *
  1894. * @static
  1895. * @memberOf _
  1896. * @since 0.1.0
  1897. * @category Array
  1898. * @param {Array} array The array to inspect.
  1899. * @returns {Array} Returns the new duplicate free array.
  1900. * @example
  1901. *
  1902. * _.uniq([2, 1, 2]);
  1903. * // => [2, 1]
  1904. */
  1905. function uniq(array) {
  1906. return (array && array.length)
  1907. ? baseUniq(array)
  1908. : [];
  1909. }
  1910. /**
  1911. * Performs a
  1912. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1913. * comparison between two values to determine if they are equivalent.
  1914. *
  1915. * @static
  1916. * @memberOf _
  1917. * @since 4.0.0
  1918. * @category Lang
  1919. * @param {*} value The value to compare.
  1920. * @param {*} other The other value to compare.
  1921. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1922. * @example
  1923. *
  1924. * var object = { 'a': 1 };
  1925. * var other = { 'a': 1 };
  1926. *
  1927. * _.eq(object, object);
  1928. * // => true
  1929. *
  1930. * _.eq(object, other);
  1931. * // => false
  1932. *
  1933. * _.eq('a', 'a');
  1934. * // => true
  1935. *
  1936. * _.eq('a', Object('a'));
  1937. * // => false
  1938. *
  1939. * _.eq(NaN, NaN);
  1940. * // => true
  1941. */
  1942. function eq(value, other) {
  1943. return value === other || (value !== value && other !== other);
  1944. }
  1945. /**
  1946. * Checks if `value` is classified as a `Function` object.
  1947. *
  1948. * @static
  1949. * @memberOf _
  1950. * @since 0.1.0
  1951. * @category Lang
  1952. * @param {*} value The value to check.
  1953. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1954. * @example
  1955. *
  1956. * _.isFunction(_);
  1957. * // => true
  1958. *
  1959. * _.isFunction(/abc/);
  1960. * // => false
  1961. */
  1962. function isFunction(value) {
  1963. // The use of `Object#toString` avoids issues with the `typeof` operator
  1964. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1965. var tag = isObject(value) ? objectToString.call(value) : '';
  1966. return tag == funcTag || tag == genTag;
  1967. }
  1968. /**
  1969. * Checks if `value` is the
  1970. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1971. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1972. *
  1973. * @static
  1974. * @memberOf _
  1975. * @since 0.1.0
  1976. * @category Lang
  1977. * @param {*} value The value to check.
  1978. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1979. * @example
  1980. *
  1981. * _.isObject({});
  1982. * // => true
  1983. *
  1984. * _.isObject([1, 2, 3]);
  1985. * // => true
  1986. *
  1987. * _.isObject(_.noop);
  1988. * // => true
  1989. *
  1990. * _.isObject(null);
  1991. * // => false
  1992. */
  1993. function isObject(value) {
  1994. var type = typeof value;
  1995. return !!value && (type == 'object' || type == 'function');
  1996. }
  1997. /**
  1998. * This method returns `undefined`.
  1999. *
  2000. * @static
  2001. * @memberOf _
  2002. * @since 2.3.0
  2003. * @category Util
  2004. * @example
  2005. *
  2006. * _.times(2, _.noop);
  2007. * // => [undefined, undefined]
  2008. */
  2009. function noop() {
  2010. // No operation performed.
  2011. }
  2012. module.exports = uniq;
  2013. /***/ }),
  2014. /***/ 129:
  2015. /***/ (function(module) {
  2016. module.exports = require("child_process");
  2017. /***/ }),
  2018. /***/ 143:
  2019. /***/ (function(module, __unusedexports, __webpack_require__) {
  2020. module.exports = withAuthorizationPrefix;
  2021. const atob = __webpack_require__(368);
  2022. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2023. function withAuthorizationPrefix(authorization) {
  2024. if (/^(basic|bearer|token) /i.test(authorization)) {
  2025. return authorization;
  2026. }
  2027. try {
  2028. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2029. return `basic ${authorization}`;
  2030. }
  2031. } catch (error) {}
  2032. if (authorization.split(/\./).length === 3) {
  2033. return `bearer ${authorization}`;
  2034. }
  2035. return `token ${authorization}`;
  2036. }
  2037. /***/ }),
  2038. /***/ 145:
  2039. /***/ (function(module, __unusedexports, __webpack_require__) {
  2040. "use strict";
  2041. const pump = __webpack_require__(453);
  2042. const bufferStream = __webpack_require__(966);
  2043. class MaxBufferError extends Error {
  2044. constructor() {
  2045. super('maxBuffer exceeded');
  2046. this.name = 'MaxBufferError';
  2047. }
  2048. }
  2049. function getStream(inputStream, options) {
  2050. if (!inputStream) {
  2051. return Promise.reject(new Error('Expected a stream'));
  2052. }
  2053. options = Object.assign({maxBuffer: Infinity}, options);
  2054. const {maxBuffer} = options;
  2055. let stream;
  2056. return new Promise((resolve, reject) => {
  2057. const rejectPromise = error => {
  2058. if (error) { // A null check
  2059. error.bufferedData = stream.getBufferedValue();
  2060. }
  2061. reject(error);
  2062. };
  2063. stream = pump(inputStream, bufferStream(options), error => {
  2064. if (error) {
  2065. rejectPromise(error);
  2066. return;
  2067. }
  2068. resolve();
  2069. });
  2070. stream.on('data', () => {
  2071. if (stream.getBufferedLength() > maxBuffer) {
  2072. rejectPromise(new MaxBufferError());
  2073. }
  2074. });
  2075. }).then(() => stream.getBufferedValue());
  2076. }
  2077. module.exports = getStream;
  2078. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2079. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2080. module.exports.MaxBufferError = MaxBufferError;
  2081. /***/ }),
  2082. /***/ 148:
  2083. /***/ (function(module, __unusedexports, __webpack_require__) {
  2084. module.exports = paginatePlugin;
  2085. const iterator = __webpack_require__(8);
  2086. const paginate = __webpack_require__(807);
  2087. function paginatePlugin(octokit) {
  2088. octokit.paginate = paginate.bind(null, octokit);
  2089. octokit.paginate.iterator = iterator.bind(null, octokit);
  2090. }
  2091. /***/ }),
  2092. /***/ 168:
  2093. /***/ (function(module) {
  2094. "use strict";
  2095. const alias = ['stdin', 'stdout', 'stderr'];
  2096. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2097. module.exports = opts => {
  2098. if (!opts) {
  2099. return null;
  2100. }
  2101. if (opts.stdio && hasAlias(opts)) {
  2102. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2103. }
  2104. if (typeof opts.stdio === 'string') {
  2105. return opts.stdio;
  2106. }
  2107. const stdio = opts.stdio || [];
  2108. if (!Array.isArray(stdio)) {
  2109. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2110. }
  2111. const result = [];
  2112. const len = Math.max(stdio.length, alias.length);
  2113. for (let i = 0; i < len; i++) {
  2114. let value = null;
  2115. if (stdio[i] !== undefined) {
  2116. value = stdio[i];
  2117. } else if (opts[alias[i]] !== undefined) {
  2118. value = opts[alias[i]];
  2119. }
  2120. result[i] = value;
  2121. }
  2122. return result;
  2123. };
  2124. /***/ }),
  2125. /***/ 190:
  2126. /***/ (function(module, __unusedexports, __webpack_require__) {
  2127. module.exports = authenticationPlugin;
  2128. const beforeRequest = __webpack_require__(863);
  2129. const requestError = __webpack_require__(991);
  2130. const validate = __webpack_require__(954);
  2131. function authenticationPlugin(octokit, options) {
  2132. if (!options.auth) {
  2133. return;
  2134. }
  2135. validate(options.auth);
  2136. const state = {
  2137. octokit,
  2138. auth: options.auth
  2139. };
  2140. octokit.hook.before("request", beforeRequest.bind(null, state));
  2141. octokit.hook.error("request", requestError.bind(null, state));
  2142. }
  2143. /***/ }),
  2144. /***/ 197:
  2145. /***/ (function(module, __unusedexports, __webpack_require__) {
  2146. module.exports = isexe
  2147. isexe.sync = sync
  2148. var fs = __webpack_require__(747)
  2149. function isexe (path, options, cb) {
  2150. fs.stat(path, function (er, stat) {
  2151. cb(er, er ? false : checkStat(stat, options))
  2152. })
  2153. }
  2154. function sync (path, options) {
  2155. return checkStat(fs.statSync(path), options)
  2156. }
  2157. function checkStat (stat, options) {
  2158. return stat.isFile() && checkMode(stat, options)
  2159. }
  2160. function checkMode (stat, options) {
  2161. var mod = stat.mode
  2162. var uid = stat.uid
  2163. var gid = stat.gid
  2164. var myUid = options.uid !== undefined ?
  2165. options.uid : process.getuid && process.getuid()
  2166. var myGid = options.gid !== undefined ?
  2167. options.gid : process.getgid && process.getgid()
  2168. var u = parseInt('100', 8)
  2169. var g = parseInt('010', 8)
  2170. var o = parseInt('001', 8)
  2171. var ug = u | g
  2172. var ret = (mod & o) ||
  2173. (mod & g) && gid === myGid ||
  2174. (mod & u) && uid === myUid ||
  2175. (mod & ug) && myUid === 0
  2176. return ret
  2177. }
  2178. /***/ }),
  2179. /***/ 198:
  2180. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2181. "use strict";
  2182. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2183. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2184. return new (P || (P = Promise))(function (resolve, reject) {
  2185. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2186. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2187. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2188. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2189. });
  2190. };
  2191. var __importStar = (this && this.__importStar) || function (mod) {
  2192. if (mod && mod.__esModule) return mod;
  2193. var result = {};
  2194. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2195. result["default"] = mod;
  2196. return result;
  2197. };
  2198. Object.defineProperty(exports, "__esModule", { value: true });
  2199. const core = __importStar(__webpack_require__(470));
  2200. const coreCommand = __importStar(__webpack_require__(431));
  2201. const gitSourceProvider = __importStar(__webpack_require__(293));
  2202. const inputHelper = __importStar(__webpack_require__(821));
  2203. const path = __importStar(__webpack_require__(622));
  2204. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2205. function run() {
  2206. return __awaiter(this, void 0, void 0, function* () {
  2207. try {
  2208. const sourceSettings = inputHelper.getInputs();
  2209. try {
  2210. // Register problem matcher
  2211. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2212. // Get sources
  2213. yield gitSourceProvider.getSource(sourceSettings);
  2214. }
  2215. finally {
  2216. // Unregister problem matcher
  2217. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2218. }
  2219. }
  2220. catch (error) {
  2221. core.setFailed(error.message);
  2222. }
  2223. });
  2224. }
  2225. function cleanup() {
  2226. return __awaiter(this, void 0, void 0, function* () {
  2227. try {
  2228. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2229. }
  2230. catch (error) {
  2231. core.warning(error.message);
  2232. }
  2233. });
  2234. }
  2235. // Main
  2236. if (!cleanupRepositoryPath) {
  2237. run();
  2238. }
  2239. // Post
  2240. else {
  2241. cleanup();
  2242. }
  2243. /***/ }),
  2244. /***/ 211:
  2245. /***/ (function(module) {
  2246. module.exports = require("https");
  2247. /***/ }),
  2248. /***/ 215:
  2249. /***/ (function(module) {
  2250. module.exports = {"name":"@octokit/rest","version":"16.35.0","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^12.0.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.0.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^2.1.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^3.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^14.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^15.0.0","sinon":"^7.2.4","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.35.0.tgz","_integrity":"sha512-9ShFqYWo0CLoGYhA1FdtdykJuMzS/9H6vSbbQWDX4pWr4p9v+15MsH/wpd/3fIU+tSxylaNO48+PIHqOkBRx3w==","_from":"@octokit/rest@16.35.0"};
  2251. /***/ }),
  2252. /***/ 227:
  2253. /***/ (function(__unusedmodule, exports) {
  2254. "use strict";
  2255. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2256. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2257. return new (P || (P = Promise))(function (resolve, reject) {
  2258. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2259. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2260. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2261. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2262. });
  2263. };
  2264. Object.defineProperty(exports, "__esModule", { value: true });
  2265. function getCheckoutInfo(git, ref, commit) {
  2266. return __awaiter(this, void 0, void 0, function* () {
  2267. if (!git) {
  2268. throw new Error('Arg git cannot be empty');
  2269. }
  2270. if (!ref && !commit) {
  2271. throw new Error('Args ref and commit cannot both be empty');
  2272. }
  2273. const result = {};
  2274. const upperRef = (ref || '').toUpperCase();
  2275. // SHA only
  2276. if (!ref) {
  2277. result.ref = commit;
  2278. }
  2279. // refs/heads/
  2280. else if (upperRef.startsWith('REFS/HEADS/')) {
  2281. const branch = ref.substring('refs/heads/'.length);
  2282. result.ref = branch;
  2283. result.startPoint = `refs/remotes/origin/${branch}`;
  2284. }
  2285. // refs/pull/
  2286. else if (upperRef.startsWith('REFS/PULL/')) {
  2287. const branch = ref.substring('refs/pull/'.length);
  2288. result.ref = `refs/remotes/pull/${branch}`;
  2289. }
  2290. // refs/tags/
  2291. else if (upperRef.startsWith('REFS/')) {
  2292. result.ref = ref;
  2293. }
  2294. // Unqualified ref, check for a matching branch or tag
  2295. else {
  2296. if (yield git.branchExists(true, `origin/${ref}`)) {
  2297. result.ref = ref;
  2298. result.startPoint = `refs/remotes/origin/${ref}`;
  2299. }
  2300. else if (yield git.tagExists(`${ref}`)) {
  2301. result.ref = `refs/tags/${ref}`;
  2302. }
  2303. else {
  2304. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2305. }
  2306. }
  2307. return result;
  2308. });
  2309. }
  2310. exports.getCheckoutInfo = getCheckoutInfo;
  2311. function getRefSpec(ref, commit) {
  2312. if (!ref && !commit) {
  2313. throw new Error('Args ref and commit cannot both be empty');
  2314. }
  2315. const upperRef = (ref || '').toUpperCase();
  2316. // SHA
  2317. if (commit) {
  2318. // refs/heads
  2319. if (upperRef.startsWith('REFS/HEADS/')) {
  2320. const branch = ref.substring('refs/heads/'.length);
  2321. return [`+${commit}:refs/remotes/origin/${branch}`];
  2322. }
  2323. // refs/pull/
  2324. else if (upperRef.startsWith('REFS/PULL/')) {
  2325. const branch = ref.substring('refs/pull/'.length);
  2326. return [`+${commit}:refs/remotes/pull/${branch}`];
  2327. }
  2328. // refs/tags/
  2329. else if (upperRef.startsWith('REFS/TAGS/')) {
  2330. return [`+${commit}:${ref}`];
  2331. }
  2332. // Otherwise no destination ref
  2333. else {
  2334. return [commit];
  2335. }
  2336. }
  2337. // Unqualified ref, check for a matching branch or tag
  2338. else if (!upperRef.startsWith('REFS/')) {
  2339. return [
  2340. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2341. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2342. ];
  2343. }
  2344. // refs/heads/
  2345. else if (upperRef.startsWith('REFS/HEADS/')) {
  2346. const branch = ref.substring('refs/heads/'.length);
  2347. return [`+${ref}:refs/remotes/origin/${branch}`];
  2348. }
  2349. // refs/pull/
  2350. else if (upperRef.startsWith('REFS/PULL/')) {
  2351. const branch = ref.substring('refs/pull/'.length);
  2352. return [`+${ref}:refs/remotes/pull/${branch}`];
  2353. }
  2354. // refs/tags/
  2355. else {
  2356. return [`+${ref}:${ref}`];
  2357. }
  2358. }
  2359. exports.getRefSpec = getRefSpec;
  2360. /***/ }),
  2361. /***/ 248:
  2362. /***/ (function(module, __unusedexports, __webpack_require__) {
  2363. module.exports = octokitRegisterEndpoints;
  2364. const registerEndpoints = __webpack_require__(899);
  2365. function octokitRegisterEndpoints(octokit) {
  2366. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2367. }
  2368. /***/ }),
  2369. /***/ 260:
  2370. /***/ (function(module, __unusedexports, __webpack_require__) {
  2371. // Note: since nyc uses this module to output coverage, any lines
  2372. // that are in the direct sync flow of nyc's outputCoverage are
  2373. // ignored, since we can never get coverage for them.
  2374. var assert = __webpack_require__(357)
  2375. var signals = __webpack_require__(654)
  2376. var EE = __webpack_require__(614)
  2377. /* istanbul ignore if */
  2378. if (typeof EE !== 'function') {
  2379. EE = EE.EventEmitter
  2380. }
  2381. var emitter
  2382. if (process.__signal_exit_emitter__) {
  2383. emitter = process.__signal_exit_emitter__
  2384. } else {
  2385. emitter = process.__signal_exit_emitter__ = new EE()
  2386. emitter.count = 0
  2387. emitter.emitted = {}
  2388. }
  2389. // Because this emitter is a global, we have to check to see if a
  2390. // previous version of this library failed to enable infinite listeners.
  2391. // I know what you're about to say. But literally everything about
  2392. // signal-exit is a compromise with evil. Get used to it.
  2393. if (!emitter.infinite) {
  2394. emitter.setMaxListeners(Infinity)
  2395. emitter.infinite = true
  2396. }
  2397. module.exports = function (cb, opts) {
  2398. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2399. if (loaded === false) {
  2400. load()
  2401. }
  2402. var ev = 'exit'
  2403. if (opts && opts.alwaysLast) {
  2404. ev = 'afterexit'
  2405. }
  2406. var remove = function () {
  2407. emitter.removeListener(ev, cb)
  2408. if (emitter.listeners('exit').length === 0 &&
  2409. emitter.listeners('afterexit').length === 0) {
  2410. unload()
  2411. }
  2412. }
  2413. emitter.on(ev, cb)
  2414. return remove
  2415. }
  2416. module.exports.unload = unload
  2417. function unload () {
  2418. if (!loaded) {
  2419. return
  2420. }
  2421. loaded = false
  2422. signals.forEach(function (sig) {
  2423. try {
  2424. process.removeListener(sig, sigListeners[sig])
  2425. } catch (er) {}
  2426. })
  2427. process.emit = originalProcessEmit
  2428. process.reallyExit = originalProcessReallyExit
  2429. emitter.count -= 1
  2430. }
  2431. function emit (event, code, signal) {
  2432. if (emitter.emitted[event]) {
  2433. return
  2434. }
  2435. emitter.emitted[event] = true
  2436. emitter.emit(event, code, signal)
  2437. }
  2438. // { <signal>: <listener fn>, ... }
  2439. var sigListeners = {}
  2440. signals.forEach(function (sig) {
  2441. sigListeners[sig] = function listener () {
  2442. // If there are no other listeners, an exit is coming!
  2443. // Simplest way: remove us and then re-send the signal.
  2444. // We know that this will kill the process, so we can
  2445. // safely emit now.
  2446. var listeners = process.listeners(sig)
  2447. if (listeners.length === emitter.count) {
  2448. unload()
  2449. emit('exit', null, sig)
  2450. /* istanbul ignore next */
  2451. emit('afterexit', null, sig)
  2452. /* istanbul ignore next */
  2453. process.kill(process.pid, sig)
  2454. }
  2455. }
  2456. })
  2457. module.exports.signals = function () {
  2458. return signals
  2459. }
  2460. module.exports.load = load
  2461. var loaded = false
  2462. function load () {
  2463. if (loaded) {
  2464. return
  2465. }
  2466. loaded = true
  2467. // This is the number of onSignalExit's that are in play.
  2468. // It's important so that we can count the correct number of
  2469. // listeners on signals, and don't wait for the other one to
  2470. // handle it instead of us.
  2471. emitter.count += 1
  2472. signals = signals.filter(function (sig) {
  2473. try {
  2474. process.on(sig, sigListeners[sig])
  2475. return true
  2476. } catch (er) {
  2477. return false
  2478. }
  2479. })
  2480. process.emit = processEmit
  2481. process.reallyExit = processReallyExit
  2482. }
  2483. var originalProcessReallyExit = process.reallyExit
  2484. function processReallyExit (code) {
  2485. process.exitCode = code || 0
  2486. emit('exit', process.exitCode, null)
  2487. /* istanbul ignore next */
  2488. emit('afterexit', process.exitCode, null)
  2489. /* istanbul ignore next */
  2490. originalProcessReallyExit.call(process, process.exitCode)
  2491. }
  2492. var originalProcessEmit = process.emit
  2493. function processEmit (ev, arg) {
  2494. if (ev === 'exit') {
  2495. if (arg !== undefined) {
  2496. process.exitCode = arg
  2497. }
  2498. var ret = originalProcessEmit.apply(this, arguments)
  2499. emit('exit', process.exitCode, null)
  2500. /* istanbul ignore next */
  2501. emit('afterexit', process.exitCode, null)
  2502. return ret
  2503. } else {
  2504. return originalProcessEmit.apply(this, arguments)
  2505. }
  2506. }
  2507. /***/ }),
  2508. /***/ 262:
  2509. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2510. "use strict";
  2511. Object.defineProperty(exports, "__esModule", { value: true });
  2512. const fs_1 = __webpack_require__(747);
  2513. const os_1 = __webpack_require__(87);
  2514. class Context {
  2515. /**
  2516. * Hydrate the context from the environment
  2517. */
  2518. constructor() {
  2519. this.payload = {};
  2520. if (process.env.GITHUB_EVENT_PATH) {
  2521. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2522. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2523. }
  2524. else {
  2525. const path = process.env.GITHUB_EVENT_PATH;
  2526. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  2527. }
  2528. }
  2529. this.eventName = process.env.GITHUB_EVENT_NAME;
  2530. this.sha = process.env.GITHUB_SHA;
  2531. this.ref = process.env.GITHUB_REF;
  2532. this.workflow = process.env.GITHUB_WORKFLOW;
  2533. this.action = process.env.GITHUB_ACTION;
  2534. this.actor = process.env.GITHUB_ACTOR;
  2535. }
  2536. get issue() {
  2537. const payload = this.payload;
  2538. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2539. }
  2540. get repo() {
  2541. if (process.env.GITHUB_REPOSITORY) {
  2542. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2543. return { owner, repo };
  2544. }
  2545. if (this.payload.repository) {
  2546. return {
  2547. owner: this.payload.repository.owner.login,
  2548. repo: this.payload.repository.name
  2549. };
  2550. }
  2551. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2552. }
  2553. }
  2554. exports.Context = Context;
  2555. //# sourceMappingURL=context.js.map
  2556. /***/ }),
  2557. /***/ 265:
  2558. /***/ (function(module, __unusedexports, __webpack_require__) {
  2559. module.exports = getPage
  2560. const deprecate = __webpack_require__(370)
  2561. const getPageLinks = __webpack_require__(577)
  2562. const HttpError = __webpack_require__(297)
  2563. function getPage (octokit, link, which, headers) {
  2564. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  2565. const url = getPageLinks(link)[which]
  2566. if (!url) {
  2567. const urlError = new HttpError(`No ${which} page found`, 404)
  2568. return Promise.reject(urlError)
  2569. }
  2570. const requestOptions = {
  2571. url,
  2572. headers: applyAcceptHeader(link, headers)
  2573. }
  2574. const promise = octokit.request(requestOptions)
  2575. return promise
  2576. }
  2577. function applyAcceptHeader (res, headers) {
  2578. const previous = res.headers && res.headers['x-github-media-type']
  2579. if (!previous || (headers && headers.accept)) {
  2580. return headers
  2581. }
  2582. headers = headers || {}
  2583. headers.accept = 'application/vnd.' + previous
  2584. .replace('; param=', '.')
  2585. .replace('; format=', '+')
  2586. return headers
  2587. }
  2588. /***/ }),
  2589. /***/ 280:
  2590. /***/ (function(module, exports) {
  2591. exports = module.exports = SemVer
  2592. var debug
  2593. /* istanbul ignore next */
  2594. if (typeof process === 'object' &&
  2595. process.env &&
  2596. process.env.NODE_DEBUG &&
  2597. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2598. debug = function () {
  2599. var args = Array.prototype.slice.call(arguments, 0)
  2600. args.unshift('SEMVER')
  2601. console.log.apply(console, args)
  2602. }
  2603. } else {
  2604. debug = function () {}
  2605. }
  2606. // Note: this is the semver.org version of the spec that it implements
  2607. // Not necessarily the package version of this code.
  2608. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2609. var MAX_LENGTH = 256
  2610. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2611. /* istanbul ignore next */ 9007199254740991
  2612. // Max safe segment length for coercion.
  2613. var MAX_SAFE_COMPONENT_LENGTH = 16
  2614. // The actual regexps go on exports.re
  2615. var re = exports.re = []
  2616. var src = exports.src = []
  2617. var R = 0
  2618. // The following Regular Expressions can be used for tokenizing,
  2619. // validating, and parsing SemVer version strings.
  2620. // ## Numeric Identifier
  2621. // A single `0`, or a non-zero digit followed by zero or more digits.
  2622. var NUMERICIDENTIFIER = R++
  2623. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2624. var NUMERICIDENTIFIERLOOSE = R++
  2625. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2626. // ## Non-numeric Identifier
  2627. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2628. // more letters, digits, or hyphens.
  2629. var NONNUMERICIDENTIFIER = R++
  2630. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2631. // ## Main Version
  2632. // Three dot-separated numeric identifiers.
  2633. var MAINVERSION = R++
  2634. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2635. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2636. '(' + src[NUMERICIDENTIFIER] + ')'
  2637. var MAINVERSIONLOOSE = R++
  2638. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2639. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2640. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2641. // ## Pre-release Version Identifier
  2642. // A numeric identifier, or a non-numeric identifier.
  2643. var PRERELEASEIDENTIFIER = R++
  2644. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2645. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2646. var PRERELEASEIDENTIFIERLOOSE = R++
  2647. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2648. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2649. // ## Pre-release Version
  2650. // Hyphen, followed by one or more dot-separated pre-release version
  2651. // identifiers.
  2652. var PRERELEASE = R++
  2653. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2654. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2655. var PRERELEASELOOSE = R++
  2656. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2657. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2658. // ## Build Metadata Identifier
  2659. // Any combination of digits, letters, or hyphens.
  2660. var BUILDIDENTIFIER = R++
  2661. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2662. // ## Build Metadata
  2663. // Plus sign, followed by one or more period-separated build metadata
  2664. // identifiers.
  2665. var BUILD = R++
  2666. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2667. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2668. // ## Full Version String
  2669. // A main version, followed optionally by a pre-release version and
  2670. // build metadata.
  2671. // Note that the only major, minor, patch, and pre-release sections of
  2672. // the version string are capturing groups. The build metadata is not a
  2673. // capturing group, because it should not ever be used in version
  2674. // comparison.
  2675. var FULL = R++
  2676. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2677. src[PRERELEASE] + '?' +
  2678. src[BUILD] + '?'
  2679. src[FULL] = '^' + FULLPLAIN + '$'
  2680. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2681. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2682. // common in the npm registry.
  2683. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2684. src[PRERELEASELOOSE] + '?' +
  2685. src[BUILD] + '?'
  2686. var LOOSE = R++
  2687. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2688. var GTLT = R++
  2689. src[GTLT] = '((?:<|>)?=?)'
  2690. // Something like "2.*" or "1.2.x".
  2691. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2692. // Only the first item is strictly required.
  2693. var XRANGEIDENTIFIERLOOSE = R++
  2694. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2695. var XRANGEIDENTIFIER = R++
  2696. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2697. var XRANGEPLAIN = R++
  2698. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2699. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2700. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2701. '(?:' + src[PRERELEASE] + ')?' +
  2702. src[BUILD] + '?' +
  2703. ')?)?'
  2704. var XRANGEPLAINLOOSE = R++
  2705. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2706. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2707. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2708. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2709. src[BUILD] + '?' +
  2710. ')?)?'
  2711. var XRANGE = R++
  2712. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2713. var XRANGELOOSE = R++
  2714. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2715. // Coercion.
  2716. // Extract anything that could conceivably be a part of a valid semver
  2717. var COERCE = R++
  2718. src[COERCE] = '(?:^|[^\\d])' +
  2719. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2720. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2721. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2722. '(?:$|[^\\d])'
  2723. // Tilde ranges.
  2724. // Meaning is "reasonably at or greater than"
  2725. var LONETILDE = R++
  2726. src[LONETILDE] = '(?:~>?)'
  2727. var TILDETRIM = R++
  2728. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2729. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2730. var tildeTrimReplace = '$1~'
  2731. var TILDE = R++
  2732. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2733. var TILDELOOSE = R++
  2734. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2735. // Caret ranges.
  2736. // Meaning is "at least and backwards compatible with"
  2737. var LONECARET = R++
  2738. src[LONECARET] = '(?:\\^)'
  2739. var CARETTRIM = R++
  2740. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2741. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2742. var caretTrimReplace = '$1^'
  2743. var CARET = R++
  2744. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2745. var CARETLOOSE = R++
  2746. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2747. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2748. var COMPARATORLOOSE = R++
  2749. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2750. var COMPARATOR = R++
  2751. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2752. // An expression to strip any whitespace between the gtlt and the thing
  2753. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2754. var COMPARATORTRIM = R++
  2755. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2756. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2757. // this one has to use the /g flag
  2758. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2759. var comparatorTrimReplace = '$1$2$3'
  2760. // Something like `1.2.3 - 1.2.4`
  2761. // Note that these all use the loose form, because they'll be
  2762. // checked against either the strict or loose comparator form
  2763. // later.
  2764. var HYPHENRANGE = R++
  2765. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  2766. '\\s+-\\s+' +
  2767. '(' + src[XRANGEPLAIN] + ')' +
  2768. '\\s*$'
  2769. var HYPHENRANGELOOSE = R++
  2770. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  2771. '\\s+-\\s+' +
  2772. '(' + src[XRANGEPLAINLOOSE] + ')' +
  2773. '\\s*$'
  2774. // Star ranges basically just allow anything at all.
  2775. var STAR = R++
  2776. src[STAR] = '(<|>)?=?\\s*\\*'
  2777. // Compile to actual regexp objects.
  2778. // All are flag-free, unless they were created above with a flag.
  2779. for (var i = 0; i < R; i++) {
  2780. debug(i, src[i])
  2781. if (!re[i]) {
  2782. re[i] = new RegExp(src[i])
  2783. }
  2784. }
  2785. exports.parse = parse
  2786. function parse (version, options) {
  2787. if (!options || typeof options !== 'object') {
  2788. options = {
  2789. loose: !!options,
  2790. includePrerelease: false
  2791. }
  2792. }
  2793. if (version instanceof SemVer) {
  2794. return version
  2795. }
  2796. if (typeof version !== 'string') {
  2797. return null
  2798. }
  2799. if (version.length > MAX_LENGTH) {
  2800. return null
  2801. }
  2802. var r = options.loose ? re[LOOSE] : re[FULL]
  2803. if (!r.test(version)) {
  2804. return null
  2805. }
  2806. try {
  2807. return new SemVer(version, options)
  2808. } catch (er) {
  2809. return null
  2810. }
  2811. }
  2812. exports.valid = valid
  2813. function valid (version, options) {
  2814. var v = parse(version, options)
  2815. return v ? v.version : null
  2816. }
  2817. exports.clean = clean
  2818. function clean (version, options) {
  2819. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  2820. return s ? s.version : null
  2821. }
  2822. exports.SemVer = SemVer
  2823. function SemVer (version, options) {
  2824. if (!options || typeof options !== 'object') {
  2825. options = {
  2826. loose: !!options,
  2827. includePrerelease: false
  2828. }
  2829. }
  2830. if (version instanceof SemVer) {
  2831. if (version.loose === options.loose) {
  2832. return version
  2833. } else {
  2834. version = version.version
  2835. }
  2836. } else if (typeof version !== 'string') {
  2837. throw new TypeError('Invalid Version: ' + version)
  2838. }
  2839. if (version.length > MAX_LENGTH) {
  2840. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  2841. }
  2842. if (!(this instanceof SemVer)) {
  2843. return new SemVer(version, options)
  2844. }
  2845. debug('SemVer', version, options)
  2846. this.options = options
  2847. this.loose = !!options.loose
  2848. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  2849. if (!m) {
  2850. throw new TypeError('Invalid Version: ' + version)
  2851. }
  2852. this.raw = version
  2853. // these are actually numbers
  2854. this.major = +m[1]
  2855. this.minor = +m[2]
  2856. this.patch = +m[3]
  2857. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  2858. throw new TypeError('Invalid major version')
  2859. }
  2860. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  2861. throw new TypeError('Invalid minor version')
  2862. }
  2863. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  2864. throw new TypeError('Invalid patch version')
  2865. }
  2866. // numberify any prerelease numeric ids
  2867. if (!m[4]) {
  2868. this.prerelease = []
  2869. } else {
  2870. this.prerelease = m[4].split('.').map(function (id) {
  2871. if (/^[0-9]+$/.test(id)) {
  2872. var num = +id
  2873. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  2874. return num
  2875. }
  2876. }
  2877. return id
  2878. })
  2879. }
  2880. this.build = m[5] ? m[5].split('.') : []
  2881. this.format()
  2882. }
  2883. SemVer.prototype.format = function () {
  2884. this.version = this.major + '.' + this.minor + '.' + this.patch
  2885. if (this.prerelease.length) {
  2886. this.version += '-' + this.prerelease.join('.')
  2887. }
  2888. return this.version
  2889. }
  2890. SemVer.prototype.toString = function () {
  2891. return this.version
  2892. }
  2893. SemVer.prototype.compare = function (other) {
  2894. debug('SemVer.compare', this.version, this.options, other)
  2895. if (!(other instanceof SemVer)) {
  2896. other = new SemVer(other, this.options)
  2897. }
  2898. return this.compareMain(other) || this.comparePre(other)
  2899. }
  2900. SemVer.prototype.compareMain = function (other) {
  2901. if (!(other instanceof SemVer)) {
  2902. other = new SemVer(other, this.options)
  2903. }
  2904. return compareIdentifiers(this.major, other.major) ||
  2905. compareIdentifiers(this.minor, other.minor) ||
  2906. compareIdentifiers(this.patch, other.patch)
  2907. }
  2908. SemVer.prototype.comparePre = function (other) {
  2909. if (!(other instanceof SemVer)) {
  2910. other = new SemVer(other, this.options)
  2911. }
  2912. // NOT having a prerelease is > having one
  2913. if (this.prerelease.length && !other.prerelease.length) {
  2914. return -1
  2915. } else if (!this.prerelease.length && other.prerelease.length) {
  2916. return 1
  2917. } else if (!this.prerelease.length && !other.prerelease.length) {
  2918. return 0
  2919. }
  2920. var i = 0
  2921. do {
  2922. var a = this.prerelease[i]
  2923. var b = other.prerelease[i]
  2924. debug('prerelease compare', i, a, b)
  2925. if (a === undefined && b === undefined) {
  2926. return 0
  2927. } else if (b === undefined) {
  2928. return 1
  2929. } else if (a === undefined) {
  2930. return -1
  2931. } else if (a === b) {
  2932. continue
  2933. } else {
  2934. return compareIdentifiers(a, b)
  2935. }
  2936. } while (++i)
  2937. }
  2938. // preminor will bump the version up to the next minor release, and immediately
  2939. // down to pre-release. premajor and prepatch work the same way.
  2940. SemVer.prototype.inc = function (release, identifier) {
  2941. switch (release) {
  2942. case 'premajor':
  2943. this.prerelease.length = 0
  2944. this.patch = 0
  2945. this.minor = 0
  2946. this.major++
  2947. this.inc('pre', identifier)
  2948. break
  2949. case 'preminor':
  2950. this.prerelease.length = 0
  2951. this.patch = 0
  2952. this.minor++
  2953. this.inc('pre', identifier)
  2954. break
  2955. case 'prepatch':
  2956. // If this is already a prerelease, it will bump to the next version
  2957. // drop any prereleases that might already exist, since they are not
  2958. // relevant at this point.
  2959. this.prerelease.length = 0
  2960. this.inc('patch', identifier)
  2961. this.inc('pre', identifier)
  2962. break
  2963. // If the input is a non-prerelease version, this acts the same as
  2964. // prepatch.
  2965. case 'prerelease':
  2966. if (this.prerelease.length === 0) {
  2967. this.inc('patch', identifier)
  2968. }
  2969. this.inc('pre', identifier)
  2970. break
  2971. case 'major':
  2972. // If this is a pre-major version, bump up to the same major version.
  2973. // Otherwise increment major.
  2974. // 1.0.0-5 bumps to 1.0.0
  2975. // 1.1.0 bumps to 2.0.0
  2976. if (this.minor !== 0 ||
  2977. this.patch !== 0 ||
  2978. this.prerelease.length === 0) {
  2979. this.major++
  2980. }
  2981. this.minor = 0
  2982. this.patch = 0
  2983. this.prerelease = []
  2984. break
  2985. case 'minor':
  2986. // If this is a pre-minor version, bump up to the same minor version.
  2987. // Otherwise increment minor.
  2988. // 1.2.0-5 bumps to 1.2.0
  2989. // 1.2.1 bumps to 1.3.0
  2990. if (this.patch !== 0 || this.prerelease.length === 0) {
  2991. this.minor++
  2992. }
  2993. this.patch = 0
  2994. this.prerelease = []
  2995. break
  2996. case 'patch':
  2997. // If this is not a pre-release version, it will increment the patch.
  2998. // If it is a pre-release it will bump up to the same patch version.
  2999. // 1.2.0-5 patches to 1.2.0
  3000. // 1.2.0 patches to 1.2.1
  3001. if (this.prerelease.length === 0) {
  3002. this.patch++
  3003. }
  3004. this.prerelease = []
  3005. break
  3006. // This probably shouldn't be used publicly.
  3007. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3008. case 'pre':
  3009. if (this.prerelease.length === 0) {
  3010. this.prerelease = [0]
  3011. } else {
  3012. var i = this.prerelease.length
  3013. while (--i >= 0) {
  3014. if (typeof this.prerelease[i] === 'number') {
  3015. this.prerelease[i]++
  3016. i = -2
  3017. }
  3018. }
  3019. if (i === -1) {
  3020. // didn't increment anything
  3021. this.prerelease.push(0)
  3022. }
  3023. }
  3024. if (identifier) {
  3025. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3026. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3027. if (this.prerelease[0] === identifier) {
  3028. if (isNaN(this.prerelease[1])) {
  3029. this.prerelease = [identifier, 0]
  3030. }
  3031. } else {
  3032. this.prerelease = [identifier, 0]
  3033. }
  3034. }
  3035. break
  3036. default:
  3037. throw new Error('invalid increment argument: ' + release)
  3038. }
  3039. this.format()
  3040. this.raw = this.version
  3041. return this
  3042. }
  3043. exports.inc = inc
  3044. function inc (version, release, loose, identifier) {
  3045. if (typeof (loose) === 'string') {
  3046. identifier = loose
  3047. loose = undefined
  3048. }
  3049. try {
  3050. return new SemVer(version, loose).inc(release, identifier).version
  3051. } catch (er) {
  3052. return null
  3053. }
  3054. }
  3055. exports.diff = diff
  3056. function diff (version1, version2) {
  3057. if (eq(version1, version2)) {
  3058. return null
  3059. } else {
  3060. var v1 = parse(version1)
  3061. var v2 = parse(version2)
  3062. var prefix = ''
  3063. if (v1.prerelease.length || v2.prerelease.length) {
  3064. prefix = 'pre'
  3065. var defaultResult = 'prerelease'
  3066. }
  3067. for (var key in v1) {
  3068. if (key === 'major' || key === 'minor' || key === 'patch') {
  3069. if (v1[key] !== v2[key]) {
  3070. return prefix + key
  3071. }
  3072. }
  3073. }
  3074. return defaultResult // may be undefined
  3075. }
  3076. }
  3077. exports.compareIdentifiers = compareIdentifiers
  3078. var numeric = /^[0-9]+$/
  3079. function compareIdentifiers (a, b) {
  3080. var anum = numeric.test(a)
  3081. var bnum = numeric.test(b)
  3082. if (anum && bnum) {
  3083. a = +a
  3084. b = +b
  3085. }
  3086. return a === b ? 0
  3087. : (anum && !bnum) ? -1
  3088. : (bnum && !anum) ? 1
  3089. : a < b ? -1
  3090. : 1
  3091. }
  3092. exports.rcompareIdentifiers = rcompareIdentifiers
  3093. function rcompareIdentifiers (a, b) {
  3094. return compareIdentifiers(b, a)
  3095. }
  3096. exports.major = major
  3097. function major (a, loose) {
  3098. return new SemVer(a, loose).major
  3099. }
  3100. exports.minor = minor
  3101. function minor (a, loose) {
  3102. return new SemVer(a, loose).minor
  3103. }
  3104. exports.patch = patch
  3105. function patch (a, loose) {
  3106. return new SemVer(a, loose).patch
  3107. }
  3108. exports.compare = compare
  3109. function compare (a, b, loose) {
  3110. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3111. }
  3112. exports.compareLoose = compareLoose
  3113. function compareLoose (a, b) {
  3114. return compare(a, b, true)
  3115. }
  3116. exports.rcompare = rcompare
  3117. function rcompare (a, b, loose) {
  3118. return compare(b, a, loose)
  3119. }
  3120. exports.sort = sort
  3121. function sort (list, loose) {
  3122. return list.sort(function (a, b) {
  3123. return exports.compare(a, b, loose)
  3124. })
  3125. }
  3126. exports.rsort = rsort
  3127. function rsort (list, loose) {
  3128. return list.sort(function (a, b) {
  3129. return exports.rcompare(a, b, loose)
  3130. })
  3131. }
  3132. exports.gt = gt
  3133. function gt (a, b, loose) {
  3134. return compare(a, b, loose) > 0
  3135. }
  3136. exports.lt = lt
  3137. function lt (a, b, loose) {
  3138. return compare(a, b, loose) < 0
  3139. }
  3140. exports.eq = eq
  3141. function eq (a, b, loose) {
  3142. return compare(a, b, loose) === 0
  3143. }
  3144. exports.neq = neq
  3145. function neq (a, b, loose) {
  3146. return compare(a, b, loose) !== 0
  3147. }
  3148. exports.gte = gte
  3149. function gte (a, b, loose) {
  3150. return compare(a, b, loose) >= 0
  3151. }
  3152. exports.lte = lte
  3153. function lte (a, b, loose) {
  3154. return compare(a, b, loose) <= 0
  3155. }
  3156. exports.cmp = cmp
  3157. function cmp (a, op, b, loose) {
  3158. switch (op) {
  3159. case '===':
  3160. if (typeof a === 'object')
  3161. a = a.version
  3162. if (typeof b === 'object')
  3163. b = b.version
  3164. return a === b
  3165. case '!==':
  3166. if (typeof a === 'object')
  3167. a = a.version
  3168. if (typeof b === 'object')
  3169. b = b.version
  3170. return a !== b
  3171. case '':
  3172. case '=':
  3173. case '==':
  3174. return eq(a, b, loose)
  3175. case '!=':
  3176. return neq(a, b, loose)
  3177. case '>':
  3178. return gt(a, b, loose)
  3179. case '>=':
  3180. return gte(a, b, loose)
  3181. case '<':
  3182. return lt(a, b, loose)
  3183. case '<=':
  3184. return lte(a, b, loose)
  3185. default:
  3186. throw new TypeError('Invalid operator: ' + op)
  3187. }
  3188. }
  3189. exports.Comparator = Comparator
  3190. function Comparator (comp, options) {
  3191. if (!options || typeof options !== 'object') {
  3192. options = {
  3193. loose: !!options,
  3194. includePrerelease: false
  3195. }
  3196. }
  3197. if (comp instanceof Comparator) {
  3198. if (comp.loose === !!options.loose) {
  3199. return comp
  3200. } else {
  3201. comp = comp.value
  3202. }
  3203. }
  3204. if (!(this instanceof Comparator)) {
  3205. return new Comparator(comp, options)
  3206. }
  3207. debug('comparator', comp, options)
  3208. this.options = options
  3209. this.loose = !!options.loose
  3210. this.parse(comp)
  3211. if (this.semver === ANY) {
  3212. this.value = ''
  3213. } else {
  3214. this.value = this.operator + this.semver.version
  3215. }
  3216. debug('comp', this)
  3217. }
  3218. var ANY = {}
  3219. Comparator.prototype.parse = function (comp) {
  3220. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3221. var m = comp.match(r)
  3222. if (!m) {
  3223. throw new TypeError('Invalid comparator: ' + comp)
  3224. }
  3225. this.operator = m[1]
  3226. if (this.operator === '=') {
  3227. this.operator = ''
  3228. }
  3229. // if it literally is just '>' or '' then allow anything.
  3230. if (!m[2]) {
  3231. this.semver = ANY
  3232. } else {
  3233. this.semver = new SemVer(m[2], this.options.loose)
  3234. }
  3235. }
  3236. Comparator.prototype.toString = function () {
  3237. return this.value
  3238. }
  3239. Comparator.prototype.test = function (version) {
  3240. debug('Comparator.test', version, this.options.loose)
  3241. if (this.semver === ANY) {
  3242. return true
  3243. }
  3244. if (typeof version === 'string') {
  3245. version = new SemVer(version, this.options)
  3246. }
  3247. return cmp(version, this.operator, this.semver, this.options)
  3248. }
  3249. Comparator.prototype.intersects = function (comp, options) {
  3250. if (!(comp instanceof Comparator)) {
  3251. throw new TypeError('a Comparator is required')
  3252. }
  3253. if (!options || typeof options !== 'object') {
  3254. options = {
  3255. loose: !!options,
  3256. includePrerelease: false
  3257. }
  3258. }
  3259. var rangeTmp
  3260. if (this.operator === '') {
  3261. rangeTmp = new Range(comp.value, options)
  3262. return satisfies(this.value, rangeTmp, options)
  3263. } else if (comp.operator === '') {
  3264. rangeTmp = new Range(this.value, options)
  3265. return satisfies(comp.semver, rangeTmp, options)
  3266. }
  3267. var sameDirectionIncreasing =
  3268. (this.operator === '>=' || this.operator === '>') &&
  3269. (comp.operator === '>=' || comp.operator === '>')
  3270. var sameDirectionDecreasing =
  3271. (this.operator === '<=' || this.operator === '<') &&
  3272. (comp.operator === '<=' || comp.operator === '<')
  3273. var sameSemVer = this.semver.version === comp.semver.version
  3274. var differentDirectionsInclusive =
  3275. (this.operator === '>=' || this.operator === '<=') &&
  3276. (comp.operator === '>=' || comp.operator === '<=')
  3277. var oppositeDirectionsLessThan =
  3278. cmp(this.semver, '<', comp.semver, options) &&
  3279. ((this.operator === '>=' || this.operator === '>') &&
  3280. (comp.operator === '<=' || comp.operator === '<'))
  3281. var oppositeDirectionsGreaterThan =
  3282. cmp(this.semver, '>', comp.semver, options) &&
  3283. ((this.operator === '<=' || this.operator === '<') &&
  3284. (comp.operator === '>=' || comp.operator === '>'))
  3285. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3286. (sameSemVer && differentDirectionsInclusive) ||
  3287. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3288. }
  3289. exports.Range = Range
  3290. function Range (range, options) {
  3291. if (!options || typeof options !== 'object') {
  3292. options = {
  3293. loose: !!options,
  3294. includePrerelease: false
  3295. }
  3296. }
  3297. if (range instanceof Range) {
  3298. if (range.loose === !!options.loose &&
  3299. range.includePrerelease === !!options.includePrerelease) {
  3300. return range
  3301. } else {
  3302. return new Range(range.raw, options)
  3303. }
  3304. }
  3305. if (range instanceof Comparator) {
  3306. return new Range(range.value, options)
  3307. }
  3308. if (!(this instanceof Range)) {
  3309. return new Range(range, options)
  3310. }
  3311. this.options = options
  3312. this.loose = !!options.loose
  3313. this.includePrerelease = !!options.includePrerelease
  3314. // First, split based on boolean or ||
  3315. this.raw = range
  3316. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3317. return this.parseRange(range.trim())
  3318. }, this).filter(function (c) {
  3319. // throw out any that are not relevant for whatever reason
  3320. return c.length
  3321. })
  3322. if (!this.set.length) {
  3323. throw new TypeError('Invalid SemVer Range: ' + range)
  3324. }
  3325. this.format()
  3326. }
  3327. Range.prototype.format = function () {
  3328. this.range = this.set.map(function (comps) {
  3329. return comps.join(' ').trim()
  3330. }).join('||').trim()
  3331. return this.range
  3332. }
  3333. Range.prototype.toString = function () {
  3334. return this.range
  3335. }
  3336. Range.prototype.parseRange = function (range) {
  3337. var loose = this.options.loose
  3338. range = range.trim()
  3339. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3340. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3341. range = range.replace(hr, hyphenReplace)
  3342. debug('hyphen replace', range)
  3343. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3344. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3345. debug('comparator trim', range, re[COMPARATORTRIM])
  3346. // `~ 1.2.3` => `~1.2.3`
  3347. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3348. // `^ 1.2.3` => `^1.2.3`
  3349. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3350. // normalize spaces
  3351. range = range.split(/\s+/).join(' ')
  3352. // At this point, the range is completely trimmed and
  3353. // ready to be split into comparators.
  3354. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3355. var set = range.split(' ').map(function (comp) {
  3356. return parseComparator(comp, this.options)
  3357. }, this).join(' ').split(/\s+/)
  3358. if (this.options.loose) {
  3359. // in loose mode, throw out any that are not valid comparators
  3360. set = set.filter(function (comp) {
  3361. return !!comp.match(compRe)
  3362. })
  3363. }
  3364. set = set.map(function (comp) {
  3365. return new Comparator(comp, this.options)
  3366. }, this)
  3367. return set
  3368. }
  3369. Range.prototype.intersects = function (range, options) {
  3370. if (!(range instanceof Range)) {
  3371. throw new TypeError('a Range is required')
  3372. }
  3373. return this.set.some(function (thisComparators) {
  3374. return thisComparators.every(function (thisComparator) {
  3375. return range.set.some(function (rangeComparators) {
  3376. return rangeComparators.every(function (rangeComparator) {
  3377. return thisComparator.intersects(rangeComparator, options)
  3378. })
  3379. })
  3380. })
  3381. })
  3382. }
  3383. // Mostly just for testing and legacy API reasons
  3384. exports.toComparators = toComparators
  3385. function toComparators (range, options) {
  3386. return new Range(range, options).set.map(function (comp) {
  3387. return comp.map(function (c) {
  3388. return c.value
  3389. }).join(' ').trim().split(' ')
  3390. })
  3391. }
  3392. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3393. // already replaced the hyphen ranges
  3394. // turn into a set of JUST comparators.
  3395. function parseComparator (comp, options) {
  3396. debug('comp', comp, options)
  3397. comp = replaceCarets(comp, options)
  3398. debug('caret', comp)
  3399. comp = replaceTildes(comp, options)
  3400. debug('tildes', comp)
  3401. comp = replaceXRanges(comp, options)
  3402. debug('xrange', comp)
  3403. comp = replaceStars(comp, options)
  3404. debug('stars', comp)
  3405. return comp
  3406. }
  3407. function isX (id) {
  3408. return !id || id.toLowerCase() === 'x' || id === '*'
  3409. }
  3410. // ~, ~> --> * (any, kinda silly)
  3411. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3412. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3413. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3414. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3415. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3416. function replaceTildes (comp, options) {
  3417. return comp.trim().split(/\s+/).map(function (comp) {
  3418. return replaceTilde(comp, options)
  3419. }).join(' ')
  3420. }
  3421. function replaceTilde (comp, options) {
  3422. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3423. return comp.replace(r, function (_, M, m, p, pr) {
  3424. debug('tilde', comp, _, M, m, p, pr)
  3425. var ret
  3426. if (isX(M)) {
  3427. ret = ''
  3428. } else if (isX(m)) {
  3429. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3430. } else if (isX(p)) {
  3431. // ~1.2 == >=1.2.0 <1.3.0
  3432. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3433. } else if (pr) {
  3434. debug('replaceTilde pr', pr)
  3435. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3436. ' <' + M + '.' + (+m + 1) + '.0'
  3437. } else {
  3438. // ~1.2.3 == >=1.2.3 <1.3.0
  3439. ret = '>=' + M + '.' + m + '.' + p +
  3440. ' <' + M + '.' + (+m + 1) + '.0'
  3441. }
  3442. debug('tilde return', ret)
  3443. return ret
  3444. })
  3445. }
  3446. // ^ --> * (any, kinda silly)
  3447. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3448. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3449. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3450. // ^1.2.3 --> >=1.2.3 <2.0.0
  3451. // ^1.2.0 --> >=1.2.0 <2.0.0
  3452. function replaceCarets (comp, options) {
  3453. return comp.trim().split(/\s+/).map(function (comp) {
  3454. return replaceCaret(comp, options)
  3455. }).join(' ')
  3456. }
  3457. function replaceCaret (comp, options) {
  3458. debug('caret', comp, options)
  3459. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3460. return comp.replace(r, function (_, M, m, p, pr) {
  3461. debug('caret', comp, _, M, m, p, pr)
  3462. var ret
  3463. if (isX(M)) {
  3464. ret = ''
  3465. } else if (isX(m)) {
  3466. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3467. } else if (isX(p)) {
  3468. if (M === '0') {
  3469. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3470. } else {
  3471. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3472. }
  3473. } else if (pr) {
  3474. debug('replaceCaret pr', pr)
  3475. if (M === '0') {
  3476. if (m === '0') {
  3477. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3478. ' <' + M + '.' + m + '.' + (+p + 1)
  3479. } else {
  3480. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3481. ' <' + M + '.' + (+m + 1) + '.0'
  3482. }
  3483. } else {
  3484. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3485. ' <' + (+M + 1) + '.0.0'
  3486. }
  3487. } else {
  3488. debug('no pr')
  3489. if (M === '0') {
  3490. if (m === '0') {
  3491. ret = '>=' + M + '.' + m + '.' + p +
  3492. ' <' + M + '.' + m + '.' + (+p + 1)
  3493. } else {
  3494. ret = '>=' + M + '.' + m + '.' + p +
  3495. ' <' + M + '.' + (+m + 1) + '.0'
  3496. }
  3497. } else {
  3498. ret = '>=' + M + '.' + m + '.' + p +
  3499. ' <' + (+M + 1) + '.0.0'
  3500. }
  3501. }
  3502. debug('caret return', ret)
  3503. return ret
  3504. })
  3505. }
  3506. function replaceXRanges (comp, options) {
  3507. debug('replaceXRanges', comp, options)
  3508. return comp.split(/\s+/).map(function (comp) {
  3509. return replaceXRange(comp, options)
  3510. }).join(' ')
  3511. }
  3512. function replaceXRange (comp, options) {
  3513. comp = comp.trim()
  3514. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3515. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3516. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3517. var xM = isX(M)
  3518. var xm = xM || isX(m)
  3519. var xp = xm || isX(p)
  3520. var anyX = xp
  3521. if (gtlt === '=' && anyX) {
  3522. gtlt = ''
  3523. }
  3524. if (xM) {
  3525. if (gtlt === '>' || gtlt === '<') {
  3526. // nothing is allowed
  3527. ret = '<0.0.0'
  3528. } else {
  3529. // nothing is forbidden
  3530. ret = '*'
  3531. }
  3532. } else if (gtlt && anyX) {
  3533. // we know patch is an x, because we have any x at all.
  3534. // replace X with 0
  3535. if (xm) {
  3536. m = 0
  3537. }
  3538. p = 0
  3539. if (gtlt === '>') {
  3540. // >1 => >=2.0.0
  3541. // >1.2 => >=1.3.0
  3542. // >1.2.3 => >= 1.2.4
  3543. gtlt = '>='
  3544. if (xm) {
  3545. M = +M + 1
  3546. m = 0
  3547. p = 0
  3548. } else {
  3549. m = +m + 1
  3550. p = 0
  3551. }
  3552. } else if (gtlt === '<=') {
  3553. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3554. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3555. gtlt = '<'
  3556. if (xm) {
  3557. M = +M + 1
  3558. } else {
  3559. m = +m + 1
  3560. }
  3561. }
  3562. ret = gtlt + M + '.' + m + '.' + p
  3563. } else if (xm) {
  3564. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3565. } else if (xp) {
  3566. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3567. }
  3568. debug('xRange return', ret)
  3569. return ret
  3570. })
  3571. }
  3572. // Because * is AND-ed with everything else in the comparator,
  3573. // and '' means "any version", just remove the *s entirely.
  3574. function replaceStars (comp, options) {
  3575. debug('replaceStars', comp, options)
  3576. // Looseness is ignored here. star is always as loose as it gets!
  3577. return comp.trim().replace(re[STAR], '')
  3578. }
  3579. // This function is passed to string.replace(re[HYPHENRANGE])
  3580. // M, m, patch, prerelease, build
  3581. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3582. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3583. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3584. function hyphenReplace ($0,
  3585. from, fM, fm, fp, fpr, fb,
  3586. to, tM, tm, tp, tpr, tb) {
  3587. if (isX(fM)) {
  3588. from = ''
  3589. } else if (isX(fm)) {
  3590. from = '>=' + fM + '.0.0'
  3591. } else if (isX(fp)) {
  3592. from = '>=' + fM + '.' + fm + '.0'
  3593. } else {
  3594. from = '>=' + from
  3595. }
  3596. if (isX(tM)) {
  3597. to = ''
  3598. } else if (isX(tm)) {
  3599. to = '<' + (+tM + 1) + '.0.0'
  3600. } else if (isX(tp)) {
  3601. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3602. } else if (tpr) {
  3603. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3604. } else {
  3605. to = '<=' + to
  3606. }
  3607. return (from + ' ' + to).trim()
  3608. }
  3609. // if ANY of the sets match ALL of its comparators, then pass
  3610. Range.prototype.test = function (version) {
  3611. if (!version) {
  3612. return false
  3613. }
  3614. if (typeof version === 'string') {
  3615. version = new SemVer(version, this.options)
  3616. }
  3617. for (var i = 0; i < this.set.length; i++) {
  3618. if (testSet(this.set[i], version, this.options)) {
  3619. return true
  3620. }
  3621. }
  3622. return false
  3623. }
  3624. function testSet (set, version, options) {
  3625. for (var i = 0; i < set.length; i++) {
  3626. if (!set[i].test(version)) {
  3627. return false
  3628. }
  3629. }
  3630. if (version.prerelease.length && !options.includePrerelease) {
  3631. // Find the set of versions that are allowed to have prereleases
  3632. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3633. // That should allow `1.2.3-pr.2` to pass.
  3634. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3635. // even though it's within the range set by the comparators.
  3636. for (i = 0; i < set.length; i++) {
  3637. debug(set[i].semver)
  3638. if (set[i].semver === ANY) {
  3639. continue
  3640. }
  3641. if (set[i].semver.prerelease.length > 0) {
  3642. var allowed = set[i].semver
  3643. if (allowed.major === version.major &&
  3644. allowed.minor === version.minor &&
  3645. allowed.patch === version.patch) {
  3646. return true
  3647. }
  3648. }
  3649. }
  3650. // Version has a -pre, but it's not one of the ones we like.
  3651. return false
  3652. }
  3653. return true
  3654. }
  3655. exports.satisfies = satisfies
  3656. function satisfies (version, range, options) {
  3657. try {
  3658. range = new Range(range, options)
  3659. } catch (er) {
  3660. return false
  3661. }
  3662. return range.test(version)
  3663. }
  3664. exports.maxSatisfying = maxSatisfying
  3665. function maxSatisfying (versions, range, options) {
  3666. var max = null
  3667. var maxSV = null
  3668. try {
  3669. var rangeObj = new Range(range, options)
  3670. } catch (er) {
  3671. return null
  3672. }
  3673. versions.forEach(function (v) {
  3674. if (rangeObj.test(v)) {
  3675. // satisfies(v, range, options)
  3676. if (!max || maxSV.compare(v) === -1) {
  3677. // compare(max, v, true)
  3678. max = v
  3679. maxSV = new SemVer(max, options)
  3680. }
  3681. }
  3682. })
  3683. return max
  3684. }
  3685. exports.minSatisfying = minSatisfying
  3686. function minSatisfying (versions, range, options) {
  3687. var min = null
  3688. var minSV = null
  3689. try {
  3690. var rangeObj = new Range(range, options)
  3691. } catch (er) {
  3692. return null
  3693. }
  3694. versions.forEach(function (v) {
  3695. if (rangeObj.test(v)) {
  3696. // satisfies(v, range, options)
  3697. if (!min || minSV.compare(v) === 1) {
  3698. // compare(min, v, true)
  3699. min = v
  3700. minSV = new SemVer(min, options)
  3701. }
  3702. }
  3703. })
  3704. return min
  3705. }
  3706. exports.minVersion = minVersion
  3707. function minVersion (range, loose) {
  3708. range = new Range(range, loose)
  3709. var minver = new SemVer('0.0.0')
  3710. if (range.test(minver)) {
  3711. return minver
  3712. }
  3713. minver = new SemVer('0.0.0-0')
  3714. if (range.test(minver)) {
  3715. return minver
  3716. }
  3717. minver = null
  3718. for (var i = 0; i < range.set.length; ++i) {
  3719. var comparators = range.set[i]
  3720. comparators.forEach(function (comparator) {
  3721. // Clone to avoid manipulating the comparator's semver object.
  3722. var compver = new SemVer(comparator.semver.version)
  3723. switch (comparator.operator) {
  3724. case '>':
  3725. if (compver.prerelease.length === 0) {
  3726. compver.patch++
  3727. } else {
  3728. compver.prerelease.push(0)
  3729. }
  3730. compver.raw = compver.format()
  3731. /* fallthrough */
  3732. case '':
  3733. case '>=':
  3734. if (!minver || gt(minver, compver)) {
  3735. minver = compver
  3736. }
  3737. break
  3738. case '<':
  3739. case '<=':
  3740. /* Ignore maximum versions */
  3741. break
  3742. /* istanbul ignore next */
  3743. default:
  3744. throw new Error('Unexpected operation: ' + comparator.operator)
  3745. }
  3746. })
  3747. }
  3748. if (minver && range.test(minver)) {
  3749. return minver
  3750. }
  3751. return null
  3752. }
  3753. exports.validRange = validRange
  3754. function validRange (range, options) {
  3755. try {
  3756. // Return '*' instead of '' so that truthiness works.
  3757. // This will throw if it's invalid anyway
  3758. return new Range(range, options).range || '*'
  3759. } catch (er) {
  3760. return null
  3761. }
  3762. }
  3763. // Determine if version is less than all the versions possible in the range
  3764. exports.ltr = ltr
  3765. function ltr (version, range, options) {
  3766. return outside(version, range, '<', options)
  3767. }
  3768. // Determine if version is greater than all the versions possible in the range.
  3769. exports.gtr = gtr
  3770. function gtr (version, range, options) {
  3771. return outside(version, range, '>', options)
  3772. }
  3773. exports.outside = outside
  3774. function outside (version, range, hilo, options) {
  3775. version = new SemVer(version, options)
  3776. range = new Range(range, options)
  3777. var gtfn, ltefn, ltfn, comp, ecomp
  3778. switch (hilo) {
  3779. case '>':
  3780. gtfn = gt
  3781. ltefn = lte
  3782. ltfn = lt
  3783. comp = '>'
  3784. ecomp = '>='
  3785. break
  3786. case '<':
  3787. gtfn = lt
  3788. ltefn = gte
  3789. ltfn = gt
  3790. comp = '<'
  3791. ecomp = '<='
  3792. break
  3793. default:
  3794. throw new TypeError('Must provide a hilo val of "<" or ">"')
  3795. }
  3796. // If it satisifes the range it is not outside
  3797. if (satisfies(version, range, options)) {
  3798. return false
  3799. }
  3800. // From now on, variable terms are as if we're in "gtr" mode.
  3801. // but note that everything is flipped for the "ltr" function.
  3802. for (var i = 0; i < range.set.length; ++i) {
  3803. var comparators = range.set[i]
  3804. var high = null
  3805. var low = null
  3806. comparators.forEach(function (comparator) {
  3807. if (comparator.semver === ANY) {
  3808. comparator = new Comparator('>=0.0.0')
  3809. }
  3810. high = high || comparator
  3811. low = low || comparator
  3812. if (gtfn(comparator.semver, high.semver, options)) {
  3813. high = comparator
  3814. } else if (ltfn(comparator.semver, low.semver, options)) {
  3815. low = comparator
  3816. }
  3817. })
  3818. // If the edge version comparator has a operator then our version
  3819. // isn't outside it
  3820. if (high.operator === comp || high.operator === ecomp) {
  3821. return false
  3822. }
  3823. // If the lowest version comparator has an operator and our version
  3824. // is less than it then it isn't higher than the range
  3825. if ((!low.operator || low.operator === comp) &&
  3826. ltefn(version, low.semver)) {
  3827. return false
  3828. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  3829. return false
  3830. }
  3831. }
  3832. return true
  3833. }
  3834. exports.prerelease = prerelease
  3835. function prerelease (version, options) {
  3836. var parsed = parse(version, options)
  3837. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  3838. }
  3839. exports.intersects = intersects
  3840. function intersects (r1, r2, options) {
  3841. r1 = new Range(r1, options)
  3842. r2 = new Range(r2, options)
  3843. return r1.intersects(r2)
  3844. }
  3845. exports.coerce = coerce
  3846. function coerce (version) {
  3847. if (version instanceof SemVer) {
  3848. return version
  3849. }
  3850. if (typeof version !== 'string') {
  3851. return null
  3852. }
  3853. var match = version.match(re[COERCE])
  3854. if (match == null) {
  3855. return null
  3856. }
  3857. return parse(match[1] +
  3858. '.' + (match[2] || '0') +
  3859. '.' + (match[3] || '0'))
  3860. }
  3861. /***/ }),
  3862. /***/ 289:
  3863. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3864. "use strict";
  3865. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3866. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3867. return new (P || (P = Promise))(function (resolve, reject) {
  3868. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3869. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3870. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3871. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3872. });
  3873. };
  3874. var __importStar = (this && this.__importStar) || function (mod) {
  3875. if (mod && mod.__esModule) return mod;
  3876. var result = {};
  3877. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  3878. result["default"] = mod;
  3879. return result;
  3880. };
  3881. Object.defineProperty(exports, "__esModule", { value: true });
  3882. const core = __importStar(__webpack_require__(470));
  3883. const exec = __importStar(__webpack_require__(986));
  3884. const fshelper = __importStar(__webpack_require__(618));
  3885. const io = __importStar(__webpack_require__(1));
  3886. const path = __importStar(__webpack_require__(622));
  3887. const git_version_1 = __webpack_require__(559);
  3888. // Auth header not supported before 2.9
  3889. // Wire protocol v2 not supported before 2.18
  3890. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  3891. function CreateCommandManager(workingDirectory, lfs) {
  3892. return __awaiter(this, void 0, void 0, function* () {
  3893. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  3894. });
  3895. }
  3896. exports.CreateCommandManager = CreateCommandManager;
  3897. class GitCommandManager {
  3898. // Private constructor; use createCommandManager()
  3899. constructor() {
  3900. this.gitEnv = {
  3901. GIT_TERMINAL_PROMPT: '0',
  3902. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  3903. };
  3904. this.gitPath = '';
  3905. this.lfs = false;
  3906. this.workingDirectory = '';
  3907. }
  3908. branchDelete(remote, branch) {
  3909. return __awaiter(this, void 0, void 0, function* () {
  3910. const args = ['branch', '--delete', '--force'];
  3911. if (remote) {
  3912. args.push('--remote');
  3913. }
  3914. args.push(branch);
  3915. yield this.execGit(args);
  3916. });
  3917. }
  3918. branchExists(remote, pattern) {
  3919. return __awaiter(this, void 0, void 0, function* () {
  3920. const args = ['branch', '--list'];
  3921. if (remote) {
  3922. args.push('--remote');
  3923. }
  3924. args.push(pattern);
  3925. const output = yield this.execGit(args);
  3926. return !!output.stdout.trim();
  3927. });
  3928. }
  3929. branchList(remote) {
  3930. return __awaiter(this, void 0, void 0, function* () {
  3931. const result = [];
  3932. // Note, this implementation uses "rev-parse --symbolic" because the output from
  3933. // "branch --list" is more difficult when in a detached HEAD state.
  3934. const args = ['rev-parse', '--symbolic'];
  3935. if (remote) {
  3936. args.push('--remotes=origin');
  3937. }
  3938. else {
  3939. args.push('--branches');
  3940. }
  3941. const output = yield this.execGit(args);
  3942. for (let branch of output.stdout.trim().split('\n')) {
  3943. branch = branch.trim();
  3944. if (branch) {
  3945. result.push(branch);
  3946. }
  3947. }
  3948. return result;
  3949. });
  3950. }
  3951. checkout(ref, startPoint) {
  3952. return __awaiter(this, void 0, void 0, function* () {
  3953. const args = ['checkout', '--progress', '--force'];
  3954. if (startPoint) {
  3955. args.push('-B', ref, startPoint);
  3956. }
  3957. else {
  3958. args.push(ref);
  3959. }
  3960. yield this.execGit(args);
  3961. });
  3962. }
  3963. checkoutDetach() {
  3964. return __awaiter(this, void 0, void 0, function* () {
  3965. const args = ['checkout', '--detach'];
  3966. yield this.execGit(args);
  3967. });
  3968. }
  3969. config(configKey, configValue) {
  3970. return __awaiter(this, void 0, void 0, function* () {
  3971. yield this.execGit(['config', configKey, configValue]);
  3972. });
  3973. }
  3974. configExists(configKey) {
  3975. return __awaiter(this, void 0, void 0, function* () {
  3976. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  3977. return `\\${x}`;
  3978. });
  3979. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  3980. return output.exitCode === 0;
  3981. });
  3982. }
  3983. fetch(fetchDepth, refSpec) {
  3984. return __awaiter(this, void 0, void 0, function* () {
  3985. const args = [
  3986. '-c',
  3987. 'protocol.version=2',
  3988. 'fetch',
  3989. '--no-tags',
  3990. '--prune',
  3991. '--progress',
  3992. '--no-recurse-submodules'
  3993. ];
  3994. if (fetchDepth > 0) {
  3995. args.push(`--depth=${fetchDepth}`);
  3996. }
  3997. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  3998. args.push('--unshallow');
  3999. }
  4000. args.push('origin');
  4001. for (const arg of refSpec) {
  4002. args.push(arg);
  4003. }
  4004. let attempt = 1;
  4005. const maxAttempts = 3;
  4006. while (attempt <= maxAttempts) {
  4007. const allowAllExitCodes = attempt < maxAttempts;
  4008. const output = yield this.execGit(args, allowAllExitCodes);
  4009. if (output.exitCode === 0) {
  4010. break;
  4011. }
  4012. const seconds = this.getRandomIntInclusive(1, 10);
  4013. core.warning(`Git fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4014. yield this.sleep(seconds * 1000);
  4015. attempt++;
  4016. }
  4017. });
  4018. }
  4019. getWorkingDirectory() {
  4020. return this.workingDirectory;
  4021. }
  4022. init() {
  4023. return __awaiter(this, void 0, void 0, function* () {
  4024. yield this.execGit(['init', this.workingDirectory]);
  4025. });
  4026. }
  4027. isDetached() {
  4028. return __awaiter(this, void 0, void 0, function* () {
  4029. // Note, this implementation uses "branch --show-current" because
  4030. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4031. // with nothing checked out.
  4032. const output = yield this.execGit(['branch', '--show-current']);
  4033. return output.stdout.trim() === '';
  4034. });
  4035. }
  4036. lfsFetch(ref) {
  4037. return __awaiter(this, void 0, void 0, function* () {
  4038. const args = ['lfs', 'fetch', 'origin', ref];
  4039. let attempt = 1;
  4040. const maxAttempts = 3;
  4041. while (attempt <= maxAttempts) {
  4042. const allowAllExitCodes = attempt < maxAttempts;
  4043. const output = yield this.execGit(args, allowAllExitCodes);
  4044. if (output.exitCode === 0) {
  4045. break;
  4046. }
  4047. const seconds = this.getRandomIntInclusive(1, 10);
  4048. core.warning(`Git lfs fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4049. yield this.sleep(seconds * 1000);
  4050. attempt++;
  4051. }
  4052. });
  4053. }
  4054. lfsInstall() {
  4055. return __awaiter(this, void 0, void 0, function* () {
  4056. yield this.execGit(['lfs', 'install', '--local']);
  4057. });
  4058. }
  4059. log1() {
  4060. return __awaiter(this, void 0, void 0, function* () {
  4061. yield this.execGit(['log', '-1']);
  4062. });
  4063. }
  4064. remoteAdd(remoteName, remoteUrl) {
  4065. return __awaiter(this, void 0, void 0, function* () {
  4066. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4067. });
  4068. }
  4069. tagExists(pattern) {
  4070. return __awaiter(this, void 0, void 0, function* () {
  4071. const output = yield this.execGit(['tag', '--list', pattern]);
  4072. return !!output.stdout.trim();
  4073. });
  4074. }
  4075. tryClean() {
  4076. return __awaiter(this, void 0, void 0, function* () {
  4077. const output = yield this.execGit(['clean', '-ffdx'], true);
  4078. return output.exitCode === 0;
  4079. });
  4080. }
  4081. tryConfigUnset(configKey) {
  4082. return __awaiter(this, void 0, void 0, function* () {
  4083. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4084. return output.exitCode === 0;
  4085. });
  4086. }
  4087. tryDisableAutomaticGarbageCollection() {
  4088. return __awaiter(this, void 0, void 0, function* () {
  4089. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4090. return output.exitCode === 0;
  4091. });
  4092. }
  4093. tryGetFetchUrl() {
  4094. return __awaiter(this, void 0, void 0, function* () {
  4095. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4096. if (output.exitCode !== 0) {
  4097. return '';
  4098. }
  4099. const stdout = output.stdout.trim();
  4100. if (stdout.includes('\n')) {
  4101. return '';
  4102. }
  4103. return stdout;
  4104. });
  4105. }
  4106. tryReset() {
  4107. return __awaiter(this, void 0, void 0, function* () {
  4108. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4109. return output.exitCode === 0;
  4110. });
  4111. }
  4112. static createCommandManager(workingDirectory, lfs) {
  4113. return __awaiter(this, void 0, void 0, function* () {
  4114. const result = new GitCommandManager();
  4115. yield result.initializeCommandManager(workingDirectory, lfs);
  4116. return result;
  4117. });
  4118. }
  4119. execGit(args, allowAllExitCodes = false) {
  4120. return __awaiter(this, void 0, void 0, function* () {
  4121. fshelper.directoryExistsSync(this.workingDirectory, true);
  4122. const result = new GitOutput();
  4123. const env = {};
  4124. for (const key of Object.keys(process.env)) {
  4125. env[key] = process.env[key];
  4126. }
  4127. for (const key of Object.keys(this.gitEnv)) {
  4128. env[key] = this.gitEnv[key];
  4129. }
  4130. const stdout = [];
  4131. const options = {
  4132. cwd: this.workingDirectory,
  4133. env,
  4134. ignoreReturnCode: allowAllExitCodes,
  4135. listeners: {
  4136. stdout: (data) => {
  4137. stdout.push(data.toString());
  4138. }
  4139. }
  4140. };
  4141. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4142. result.stdout = stdout.join('');
  4143. return result;
  4144. });
  4145. }
  4146. initializeCommandManager(workingDirectory, lfs) {
  4147. return __awaiter(this, void 0, void 0, function* () {
  4148. this.workingDirectory = workingDirectory;
  4149. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4150. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4151. this.lfs = lfs;
  4152. if (!this.lfs) {
  4153. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4154. }
  4155. this.gitPath = yield io.which('git', true);
  4156. // Git version
  4157. core.debug('Getting git version');
  4158. let gitVersion = new git_version_1.GitVersion();
  4159. let gitOutput = yield this.execGit(['version']);
  4160. let stdout = gitOutput.stdout.trim();
  4161. if (!stdout.includes('\n')) {
  4162. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4163. if (match) {
  4164. gitVersion = new git_version_1.GitVersion(match[0]);
  4165. }
  4166. }
  4167. if (!gitVersion.isValid()) {
  4168. throw new Error('Unable to determine git version');
  4169. }
  4170. // Minimum git version
  4171. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4172. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4173. }
  4174. if (this.lfs) {
  4175. // Git-lfs version
  4176. core.debug('Getting git-lfs version');
  4177. let gitLfsVersion = new git_version_1.GitVersion();
  4178. const gitLfsPath = yield io.which('git-lfs', true);
  4179. gitOutput = yield this.execGit(['lfs', 'version']);
  4180. stdout = gitOutput.stdout.trim();
  4181. if (!stdout.includes('\n')) {
  4182. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4183. if (match) {
  4184. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4185. }
  4186. }
  4187. if (!gitLfsVersion.isValid()) {
  4188. throw new Error('Unable to determine git-lfs version');
  4189. }
  4190. // Minimum git-lfs version
  4191. // Note:
  4192. // - Auth header not supported before 2.1
  4193. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4194. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4195. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4196. }
  4197. }
  4198. // Set the user agent
  4199. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4200. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4201. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4202. });
  4203. }
  4204. getRandomIntInclusive(minimum, maximum) {
  4205. minimum = Math.floor(minimum);
  4206. maximum = Math.floor(maximum);
  4207. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  4208. }
  4209. sleep(milliseconds) {
  4210. return __awaiter(this, void 0, void 0, function* () {
  4211. return new Promise(resolve => setTimeout(resolve, milliseconds));
  4212. });
  4213. }
  4214. }
  4215. class GitOutput {
  4216. constructor() {
  4217. this.stdout = '';
  4218. this.exitCode = 0;
  4219. }
  4220. }
  4221. /***/ }),
  4222. /***/ 293:
  4223. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4224. "use strict";
  4225. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4226. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4227. return new (P || (P = Promise))(function (resolve, reject) {
  4228. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4229. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4230. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4231. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4232. });
  4233. };
  4234. var __importStar = (this && this.__importStar) || function (mod) {
  4235. if (mod && mod.__esModule) return mod;
  4236. var result = {};
  4237. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4238. result["default"] = mod;
  4239. return result;
  4240. };
  4241. Object.defineProperty(exports, "__esModule", { value: true });
  4242. const core = __importStar(__webpack_require__(470));
  4243. const coreCommand = __importStar(__webpack_require__(431));
  4244. const fs = __importStar(__webpack_require__(747));
  4245. const fsHelper = __importStar(__webpack_require__(618));
  4246. const gitCommandManager = __importStar(__webpack_require__(289));
  4247. const io = __importStar(__webpack_require__(1));
  4248. const path = __importStar(__webpack_require__(622));
  4249. const refHelper = __importStar(__webpack_require__(227));
  4250. const githubApiHelper = __importStar(__webpack_require__(464));
  4251. const authConfigKey = `http.https://github.com/.extraheader`;
  4252. function getSource(settings) {
  4253. return __awaiter(this, void 0, void 0, function* () {
  4254. // Repository URL
  4255. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4256. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4257. // Set intra-task state for cleanup
  4258. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4259. // Remove conflicting file path
  4260. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4261. yield io.rmRF(settings.repositoryPath);
  4262. }
  4263. // Create directory
  4264. let isExisting = true;
  4265. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4266. isExisting = false;
  4267. yield io.mkdirP(settings.repositoryPath);
  4268. }
  4269. // Git command manager
  4270. core.info(`Working directory is '${settings.repositoryPath}'`);
  4271. let git = null;
  4272. try {
  4273. git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4274. }
  4275. catch (err) {
  4276. // Git is required for LFS
  4277. if (settings.lfs) {
  4278. throw err;
  4279. }
  4280. // Otherwise fallback to REST API
  4281. }
  4282. // Prepare existing directory, otherwise recreate
  4283. if (isExisting) {
  4284. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4285. }
  4286. if (!git || `${1}` == '1') {
  4287. core.info(`Add git Git version ${gitCommandManager.MinimumGitVersion} was not found in the PATH.`);
  4288. core.info(`Instead downloading the repository files using the GitHub REST API.`);
  4289. yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
  4290. }
  4291. else {
  4292. // Initialize the repository
  4293. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4294. yield git.init();
  4295. yield git.remoteAdd('origin', repositoryUrl);
  4296. }
  4297. // Disable automatic garbage collection
  4298. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4299. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4300. }
  4301. // Remove possible previous extraheader
  4302. yield removeGitConfig(git, authConfigKey);
  4303. // Add extraheader (auth)
  4304. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4305. core.setSecret(base64Credentials);
  4306. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4307. yield git.config(authConfigKey, authConfigValue);
  4308. // LFS install
  4309. if (settings.lfs) {
  4310. yield git.lfsInstall();
  4311. }
  4312. // Fetch
  4313. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4314. yield git.fetch(settings.fetchDepth, refSpec);
  4315. // Checkout info
  4316. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4317. // LFS fetch
  4318. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4319. // Explicit lfs fetch will fetch lfs objects in parallel.
  4320. if (settings.lfs) {
  4321. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4322. }
  4323. // Checkout
  4324. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4325. // Dump some info about the checked out commit
  4326. yield git.log1();
  4327. }
  4328. });
  4329. }
  4330. exports.getSource = getSource;
  4331. function cleanup(repositoryPath) {
  4332. return __awaiter(this, void 0, void 0, function* () {
  4333. // Repo exists?
  4334. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4335. return;
  4336. }
  4337. fsHelper.directoryExistsSync(repositoryPath, true);
  4338. // Remove the config key
  4339. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4340. yield removeGitConfig(git, authConfigKey);
  4341. });
  4342. }
  4343. exports.cleanup = cleanup;
  4344. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4345. return __awaiter(this, void 0, void 0, function* () {
  4346. let remove = false;
  4347. // Check whether using git or REST API
  4348. if (!git) {
  4349. remove = true;
  4350. }
  4351. // Fetch URL does not match
  4352. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4353. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4354. remove = true;
  4355. }
  4356. else {
  4357. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4358. const lockPaths = [
  4359. path.join(repositoryPath, '.git', 'index.lock'),
  4360. path.join(repositoryPath, '.git', 'shallow.lock')
  4361. ];
  4362. for (const lockPath of lockPaths) {
  4363. try {
  4364. yield io.rmRF(lockPath);
  4365. }
  4366. catch (error) {
  4367. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4368. }
  4369. }
  4370. try {
  4371. // Checkout detached HEAD
  4372. if (!(yield git.isDetached())) {
  4373. yield git.checkoutDetach();
  4374. }
  4375. // Remove all refs/heads/*
  4376. let branches = yield git.branchList(false);
  4377. for (const branch of branches) {
  4378. yield git.branchDelete(false, branch);
  4379. }
  4380. // Remove all refs/remotes/origin/* to avoid conflicts
  4381. branches = yield git.branchList(true);
  4382. for (const branch of branches) {
  4383. yield git.branchDelete(true, branch);
  4384. }
  4385. // Clean
  4386. if (clean) {
  4387. if (!(yield git.tryClean())) {
  4388. 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}'.`);
  4389. remove = true;
  4390. }
  4391. else if (!(yield git.tryReset())) {
  4392. remove = true;
  4393. }
  4394. if (remove) {
  4395. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4396. }
  4397. }
  4398. }
  4399. catch (error) {
  4400. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4401. remove = true;
  4402. }
  4403. }
  4404. if (remove) {
  4405. // Delete the contents of the directory. Don't delete the directory itself
  4406. // since it might be the current working directory.
  4407. core.info(`Deleting the contents of '${repositoryPath}'`);
  4408. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4409. yield io.rmRF(path.join(repositoryPath, file));
  4410. }
  4411. }
  4412. });
  4413. }
  4414. function removeGitConfig(git, configKey) {
  4415. return __awaiter(this, void 0, void 0, function* () {
  4416. if ((yield git.configExists(configKey)) &&
  4417. !(yield git.tryConfigUnset(configKey))) {
  4418. // Load the config contents
  4419. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4420. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4421. fsHelper.fileExistsSync(configPath);
  4422. let contents = fs.readFileSync(configPath).toString() || '';
  4423. // Filter - only includes lines that do not contain the config key
  4424. const upperConfigKey = configKey.toUpperCase();
  4425. const split = contents
  4426. .split('\n')
  4427. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4428. contents = split.join('\n');
  4429. // Rewrite the config file
  4430. fs.writeFileSync(configPath, contents);
  4431. }
  4432. });
  4433. }
  4434. /***/ }),
  4435. /***/ 294:
  4436. /***/ (function(module, __unusedexports, __webpack_require__) {
  4437. module.exports = parseOptions;
  4438. const { Deprecation } = __webpack_require__(692);
  4439. const { getUserAgent } = __webpack_require__(796);
  4440. const once = __webpack_require__(969);
  4441. const pkg = __webpack_require__(215);
  4442. const deprecateOptionsTimeout = once((log, deprecation) =>
  4443. log.warn(deprecation)
  4444. );
  4445. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4446. const deprecateOptionsHeaders = once((log, deprecation) =>
  4447. log.warn(deprecation)
  4448. );
  4449. function parseOptions(options, log, hook) {
  4450. if (options.headers) {
  4451. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4452. newObj[key.toLowerCase()] = options.headers[key];
  4453. return newObj;
  4454. }, {});
  4455. }
  4456. const clientDefaults = {
  4457. headers: options.headers || {},
  4458. request: options.request || {},
  4459. mediaType: {
  4460. previews: [],
  4461. format: ""
  4462. }
  4463. };
  4464. if (options.baseUrl) {
  4465. clientDefaults.baseUrl = options.baseUrl;
  4466. }
  4467. if (options.userAgent) {
  4468. clientDefaults.headers["user-agent"] = options.userAgent;
  4469. }
  4470. if (options.previews) {
  4471. clientDefaults.mediaType.previews = options.previews;
  4472. }
  4473. if (options.timeZone) {
  4474. clientDefaults.headers["time-zone"] = options.timeZone;
  4475. }
  4476. if (options.timeout) {
  4477. deprecateOptionsTimeout(
  4478. log,
  4479. new Deprecation(
  4480. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4481. )
  4482. );
  4483. clientDefaults.request.timeout = options.timeout;
  4484. }
  4485. if (options.agent) {
  4486. deprecateOptionsAgent(
  4487. log,
  4488. new Deprecation(
  4489. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4490. )
  4491. );
  4492. clientDefaults.request.agent = options.agent;
  4493. }
  4494. if (options.headers) {
  4495. deprecateOptionsHeaders(
  4496. log,
  4497. new Deprecation(
  4498. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4499. )
  4500. );
  4501. }
  4502. const userAgentOption = clientDefaults.headers["user-agent"];
  4503. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4504. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4505. .filter(Boolean)
  4506. .join(" ");
  4507. clientDefaults.request.hook = hook.bind(null, "request");
  4508. return clientDefaults;
  4509. }
  4510. /***/ }),
  4511. /***/ 297:
  4512. /***/ (function(module) {
  4513. module.exports = class HttpError extends Error {
  4514. constructor (message, code, headers) {
  4515. super(message)
  4516. // Maintains proper stack trace (only available on V8)
  4517. /* istanbul ignore next */
  4518. if (Error.captureStackTrace) {
  4519. Error.captureStackTrace(this, this.constructor)
  4520. }
  4521. this.name = 'HttpError'
  4522. this.code = code
  4523. this.headers = headers
  4524. }
  4525. }
  4526. /***/ }),
  4527. /***/ 301:
  4528. /***/ (function(module, __unusedexports, __webpack_require__) {
  4529. /**
  4530. * Some “list” response that can be paginated have a different response structure
  4531. *
  4532. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4533. * /installation/repositories also has `repository_selection`), as well as a key with
  4534. * the list of the items which name varies from endpoint to endpoint:
  4535. *
  4536. * - https://developer.github.com/v3/search/#example (key `items`)
  4537. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4538. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4539. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4540. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4541. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  4542. *
  4543. * Octokit normalizes these responses so that paginated results are always returned following
  4544. * the same structure. One challenge is that if the list response has only one page, no Link
  4545. * header is provided, so this header alone is not sufficient to check wether a response is
  4546. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4547. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4548. * property because it also exists in the response of Get the combined status for a specific ref.
  4549. */
  4550. module.exports = normalizePaginatedListResponse;
  4551. const { Deprecation } = __webpack_require__(692);
  4552. const once = __webpack_require__(969);
  4553. const deprecateIncompleteResults = once((log, deprecation) =>
  4554. log.warn(deprecation)
  4555. );
  4556. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4557. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4558. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4559. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4560. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4561. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4562. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  4563. function normalizePaginatedListResponse(octokit, url, response) {
  4564. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4565. if (
  4566. !REGEX_IS_SEARCH_PATH.test(path) &&
  4567. !REGEX_IS_CHECKS_PATH.test(path) &&
  4568. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4569. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  4570. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  4571. ) {
  4572. return;
  4573. }
  4574. // keep the additional properties intact to avoid a breaking change,
  4575. // but log a deprecation warning when accessed
  4576. const incompleteResults = response.data.incomplete_results;
  4577. const repositorySelection = response.data.repository_selection;
  4578. const totalCount = response.data.total_count;
  4579. delete response.data.incomplete_results;
  4580. delete response.data.repository_selection;
  4581. delete response.data.total_count;
  4582. const namespaceKey = Object.keys(response.data)[0];
  4583. response.data = response.data[namespaceKey];
  4584. Object.defineProperty(response.data, namespaceKey, {
  4585. get() {
  4586. deprecateNamespace(
  4587. octokit.log,
  4588. new Deprecation(
  4589. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4590. )
  4591. );
  4592. return response.data;
  4593. }
  4594. });
  4595. if (typeof incompleteResults !== "undefined") {
  4596. Object.defineProperty(response.data, "incomplete_results", {
  4597. get() {
  4598. deprecateIncompleteResults(
  4599. octokit.log,
  4600. new Deprecation(
  4601. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4602. )
  4603. );
  4604. return incompleteResults;
  4605. }
  4606. });
  4607. }
  4608. if (typeof repositorySelection !== "undefined") {
  4609. Object.defineProperty(response.data, "repository_selection", {
  4610. get() {
  4611. deprecateTotalCount(
  4612. octokit.log,
  4613. new Deprecation(
  4614. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4615. )
  4616. );
  4617. return repositorySelection;
  4618. }
  4619. });
  4620. }
  4621. Object.defineProperty(response.data, "total_count", {
  4622. get() {
  4623. deprecateTotalCount(
  4624. octokit.log,
  4625. new Deprecation(
  4626. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4627. )
  4628. );
  4629. return totalCount;
  4630. }
  4631. });
  4632. }
  4633. /***/ }),
  4634. /***/ 323:
  4635. /***/ (function(module) {
  4636. "use strict";
  4637. var isStream = module.exports = function (stream) {
  4638. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4639. };
  4640. isStream.writable = function (stream) {
  4641. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4642. };
  4643. isStream.readable = function (stream) {
  4644. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4645. };
  4646. isStream.duplex = function (stream) {
  4647. return isStream.writable(stream) && isStream.readable(stream);
  4648. };
  4649. isStream.transform = function (stream) {
  4650. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4651. };
  4652. /***/ }),
  4653. /***/ 336:
  4654. /***/ (function(module, __unusedexports, __webpack_require__) {
  4655. module.exports = hasLastPage
  4656. const deprecate = __webpack_require__(370)
  4657. const getPageLinks = __webpack_require__(577)
  4658. function hasLastPage (link) {
  4659. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4660. return getPageLinks(link).last
  4661. }
  4662. /***/ }),
  4663. /***/ 348:
  4664. /***/ (function(module, __unusedexports, __webpack_require__) {
  4665. "use strict";
  4666. module.exports = validate;
  4667. const { RequestError } = __webpack_require__(463);
  4668. const get = __webpack_require__(854);
  4669. const set = __webpack_require__(883);
  4670. function validate(octokit, options) {
  4671. if (!options.request.validate) {
  4672. return;
  4673. }
  4674. const { validate: params } = options.request;
  4675. Object.keys(params).forEach(parameterName => {
  4676. const parameter = get(params, parameterName);
  4677. const expectedType = parameter.type;
  4678. let parentParameterName;
  4679. let parentValue;
  4680. let parentParamIsPresent = true;
  4681. let parentParameterIsArray = false;
  4682. if (/\./.test(parameterName)) {
  4683. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4684. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4685. if (parentParameterIsArray) {
  4686. parentParameterName = parentParameterName.slice(0, -2);
  4687. }
  4688. parentValue = get(options, parentParameterName);
  4689. parentParamIsPresent =
  4690. parentParameterName === "headers" ||
  4691. (typeof parentValue === "object" && parentValue !== null);
  4692. }
  4693. const values = parentParameterIsArray
  4694. ? (get(options, parentParameterName) || []).map(
  4695. value => value[parameterName.split(/\./).pop()]
  4696. )
  4697. : [get(options, parameterName)];
  4698. values.forEach((value, i) => {
  4699. const valueIsPresent = typeof value !== "undefined";
  4700. const valueIsNull = value === null;
  4701. const currentParameterName = parentParameterIsArray
  4702. ? parameterName.replace(/\[\]/, `[${i}]`)
  4703. : parameterName;
  4704. if (!parameter.required && !valueIsPresent) {
  4705. return;
  4706. }
  4707. // if the parent parameter is of type object but allows null
  4708. // then the child parameters can be ignored
  4709. if (!parentParamIsPresent) {
  4710. return;
  4711. }
  4712. if (parameter.allowNull && valueIsNull) {
  4713. return;
  4714. }
  4715. if (!parameter.allowNull && valueIsNull) {
  4716. throw new RequestError(
  4717. `'${currentParameterName}' cannot be null`,
  4718. 400,
  4719. {
  4720. request: options
  4721. }
  4722. );
  4723. }
  4724. if (parameter.required && !valueIsPresent) {
  4725. throw new RequestError(
  4726. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4727. value
  4728. )}`,
  4729. 400,
  4730. {
  4731. request: options
  4732. }
  4733. );
  4734. }
  4735. // parse to integer before checking for enum
  4736. // so that string "1" will match enum with number 1
  4737. if (expectedType === "integer") {
  4738. const unparsedValue = value;
  4739. value = parseInt(value, 10);
  4740. if (isNaN(value)) {
  4741. throw new RequestError(
  4742. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4743. unparsedValue
  4744. )} is NaN`,
  4745. 400,
  4746. {
  4747. request: options
  4748. }
  4749. );
  4750. }
  4751. }
  4752. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4753. throw new RequestError(
  4754. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4755. value
  4756. )}`,
  4757. 400,
  4758. {
  4759. request: options
  4760. }
  4761. );
  4762. }
  4763. if (parameter.validation) {
  4764. const regex = new RegExp(parameter.validation);
  4765. if (!regex.test(value)) {
  4766. throw new RequestError(
  4767. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4768. value
  4769. )}`,
  4770. 400,
  4771. {
  4772. request: options
  4773. }
  4774. );
  4775. }
  4776. }
  4777. if (expectedType === "object" && typeof value === "string") {
  4778. try {
  4779. value = JSON.parse(value);
  4780. } catch (exception) {
  4781. throw new RequestError(
  4782. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4783. value
  4784. )}`,
  4785. 400,
  4786. {
  4787. request: options
  4788. }
  4789. );
  4790. }
  4791. }
  4792. set(options, parameter.mapTo || currentParameterName, value);
  4793. });
  4794. });
  4795. return options;
  4796. }
  4797. /***/ }),
  4798. /***/ 349:
  4799. /***/ (function(module, __unusedexports, __webpack_require__) {
  4800. module.exports = authenticationRequestError;
  4801. const { RequestError } = __webpack_require__(463);
  4802. function authenticationRequestError(state, error, options) {
  4803. /* istanbul ignore next */
  4804. if (!error.headers) throw error;
  4805. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  4806. // handle "2FA required" error only
  4807. if (error.status !== 401 || !otpRequired) {
  4808. throw error;
  4809. }
  4810. if (
  4811. error.status === 401 &&
  4812. otpRequired &&
  4813. error.request &&
  4814. error.request.headers["x-github-otp"]
  4815. ) {
  4816. throw new RequestError(
  4817. "Invalid one-time password for two-factor authentication",
  4818. 401,
  4819. {
  4820. headers: error.headers,
  4821. request: options
  4822. }
  4823. );
  4824. }
  4825. if (typeof state.auth.on2fa !== "function") {
  4826. throw new RequestError(
  4827. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  4828. 401,
  4829. {
  4830. headers: error.headers,
  4831. request: options
  4832. }
  4833. );
  4834. }
  4835. return Promise.resolve()
  4836. .then(() => {
  4837. return state.auth.on2fa();
  4838. })
  4839. .then(oneTimePassword => {
  4840. const newOptions = Object.assign(options, {
  4841. headers: Object.assign(
  4842. { "x-github-otp": oneTimePassword },
  4843. options.headers
  4844. )
  4845. });
  4846. return state.octokit.request(newOptions);
  4847. });
  4848. }
  4849. /***/ }),
  4850. /***/ 357:
  4851. /***/ (function(module) {
  4852. module.exports = require("assert");
  4853. /***/ }),
  4854. /***/ 363:
  4855. /***/ (function(module) {
  4856. module.exports = register
  4857. function register (state, name, method, options) {
  4858. if (typeof method !== 'function') {
  4859. throw new Error('method for before hook must be a function')
  4860. }
  4861. if (!options) {
  4862. options = {}
  4863. }
  4864. if (Array.isArray(name)) {
  4865. return name.reverse().reduce(function (callback, name) {
  4866. return register.bind(null, state, name, callback, options)
  4867. }, method)()
  4868. }
  4869. return Promise.resolve()
  4870. .then(function () {
  4871. if (!state.registry[name]) {
  4872. return method(options)
  4873. }
  4874. return (state.registry[name]).reduce(function (method, registered) {
  4875. return registered.hook.bind(null, method, options)
  4876. }, method)()
  4877. })
  4878. }
  4879. /***/ }),
  4880. /***/ 368:
  4881. /***/ (function(module) {
  4882. module.exports = function atob(str) {
  4883. return Buffer.from(str, 'base64').toString('binary')
  4884. }
  4885. /***/ }),
  4886. /***/ 370:
  4887. /***/ (function(module) {
  4888. module.exports = deprecate
  4889. const loggedMessages = {}
  4890. function deprecate (message) {
  4891. if (loggedMessages[message]) {
  4892. return
  4893. }
  4894. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  4895. loggedMessages[message] = 1
  4896. }
  4897. /***/ }),
  4898. /***/ 372:
  4899. /***/ (function(module) {
  4900. module.exports = octokitDebug;
  4901. function octokitDebug(octokit) {
  4902. octokit.hook.wrap("request", (request, options) => {
  4903. octokit.log.debug("request", options);
  4904. const start = Date.now();
  4905. const requestOptions = octokit.request.endpoint.parse(options);
  4906. const path = requestOptions.url.replace(options.baseUrl, "");
  4907. return request(options)
  4908. .then(response => {
  4909. octokit.log.info(
  4910. `${requestOptions.method} ${path} - ${
  4911. response.status
  4912. } in ${Date.now() - start}ms`
  4913. );
  4914. return response;
  4915. })
  4916. .catch(error => {
  4917. octokit.log.info(
  4918. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  4919. start}ms`
  4920. );
  4921. throw error;
  4922. });
  4923. });
  4924. }
  4925. /***/ }),
  4926. /***/ 385:
  4927. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4928. "use strict";
  4929. Object.defineProperty(exports, '__esModule', { value: true });
  4930. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  4931. var isPlainObject = _interopDefault(__webpack_require__(696));
  4932. var universalUserAgent = __webpack_require__(796);
  4933. function lowercaseKeys(object) {
  4934. if (!object) {
  4935. return {};
  4936. }
  4937. return Object.keys(object).reduce((newObj, key) => {
  4938. newObj[key.toLowerCase()] = object[key];
  4939. return newObj;
  4940. }, {});
  4941. }
  4942. function mergeDeep(defaults, options) {
  4943. const result = Object.assign({}, defaults);
  4944. Object.keys(options).forEach(key => {
  4945. if (isPlainObject(options[key])) {
  4946. if (!(key in defaults)) Object.assign(result, {
  4947. [key]: options[key]
  4948. });else result[key] = mergeDeep(defaults[key], options[key]);
  4949. } else {
  4950. Object.assign(result, {
  4951. [key]: options[key]
  4952. });
  4953. }
  4954. });
  4955. return result;
  4956. }
  4957. function merge(defaults, route, options) {
  4958. if (typeof route === "string") {
  4959. let [method, url] = route.split(" ");
  4960. options = Object.assign(url ? {
  4961. method,
  4962. url
  4963. } : {
  4964. url: method
  4965. }, options);
  4966. } else {
  4967. options = Object.assign({}, route);
  4968. } // lowercase header names before merging with defaults to avoid duplicates
  4969. options.headers = lowercaseKeys(options.headers);
  4970. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  4971. if (defaults && defaults.mediaType.previews.length) {
  4972. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  4973. }
  4974. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  4975. return mergedOptions;
  4976. }
  4977. function addQueryParameters(url, parameters) {
  4978. const separator = /\?/.test(url) ? "&" : "?";
  4979. const names = Object.keys(parameters);
  4980. if (names.length === 0) {
  4981. return url;
  4982. }
  4983. return url + separator + names.map(name => {
  4984. if (name === "q") {
  4985. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  4986. }
  4987. return `${name}=${encodeURIComponent(parameters[name])}`;
  4988. }).join("&");
  4989. }
  4990. const urlVariableRegex = /\{[^}]+\}/g;
  4991. function removeNonChars(variableName) {
  4992. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  4993. }
  4994. function extractUrlVariableNames(url) {
  4995. const matches = url.match(urlVariableRegex);
  4996. if (!matches) {
  4997. return [];
  4998. }
  4999. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5000. }
  5001. function omit(object, keysToOmit) {
  5002. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5003. obj[key] = object[key];
  5004. return obj;
  5005. }, {});
  5006. }
  5007. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5008. // TODO: create separate package.
  5009. //
  5010. // Copyright (c) 2012-2014, Bram Stein
  5011. // All rights reserved.
  5012. // Redistribution and use in source and binary forms, with or without
  5013. // modification, are permitted provided that the following conditions
  5014. // are met:
  5015. // 1. Redistributions of source code must retain the above copyright
  5016. // notice, this list of conditions and the following disclaimer.
  5017. // 2. Redistributions in binary form must reproduce the above copyright
  5018. // notice, this list of conditions and the following disclaimer in the
  5019. // documentation and/or other materials provided with the distribution.
  5020. // 3. The name of the author may not be used to endorse or promote products
  5021. // derived from this software without specific prior written permission.
  5022. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5023. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5024. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5025. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5026. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5027. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5028. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5029. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5030. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5031. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5032. /* istanbul ignore file */
  5033. function encodeReserved(str) {
  5034. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5035. if (!/%[0-9A-Fa-f]/.test(part)) {
  5036. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5037. }
  5038. return part;
  5039. }).join("");
  5040. }
  5041. function encodeUnreserved(str) {
  5042. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5043. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5044. });
  5045. }
  5046. function encodeValue(operator, value, key) {
  5047. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5048. if (key) {
  5049. return encodeUnreserved(key) + "=" + value;
  5050. } else {
  5051. return value;
  5052. }
  5053. }
  5054. function isDefined(value) {
  5055. return value !== undefined && value !== null;
  5056. }
  5057. function isKeyOperator(operator) {
  5058. return operator === ";" || operator === "&" || operator === "?";
  5059. }
  5060. function getValues(context, operator, key, modifier) {
  5061. var value = context[key],
  5062. result = [];
  5063. if (isDefined(value) && value !== "") {
  5064. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5065. value = value.toString();
  5066. if (modifier && modifier !== "*") {
  5067. value = value.substring(0, parseInt(modifier, 10));
  5068. }
  5069. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5070. } else {
  5071. if (modifier === "*") {
  5072. if (Array.isArray(value)) {
  5073. value.filter(isDefined).forEach(function (value) {
  5074. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5075. });
  5076. } else {
  5077. Object.keys(value).forEach(function (k) {
  5078. if (isDefined(value[k])) {
  5079. result.push(encodeValue(operator, value[k], k));
  5080. }
  5081. });
  5082. }
  5083. } else {
  5084. const tmp = [];
  5085. if (Array.isArray(value)) {
  5086. value.filter(isDefined).forEach(function (value) {
  5087. tmp.push(encodeValue(operator, value));
  5088. });
  5089. } else {
  5090. Object.keys(value).forEach(function (k) {
  5091. if (isDefined(value[k])) {
  5092. tmp.push(encodeUnreserved(k));
  5093. tmp.push(encodeValue(operator, value[k].toString()));
  5094. }
  5095. });
  5096. }
  5097. if (isKeyOperator(operator)) {
  5098. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5099. } else if (tmp.length !== 0) {
  5100. result.push(tmp.join(","));
  5101. }
  5102. }
  5103. }
  5104. } else {
  5105. if (operator === ";") {
  5106. if (isDefined(value)) {
  5107. result.push(encodeUnreserved(key));
  5108. }
  5109. } else if (value === "" && (operator === "&" || operator === "?")) {
  5110. result.push(encodeUnreserved(key) + "=");
  5111. } else if (value === "") {
  5112. result.push("");
  5113. }
  5114. }
  5115. return result;
  5116. }
  5117. function parseUrl(template) {
  5118. return {
  5119. expand: expand.bind(null, template)
  5120. };
  5121. }
  5122. function expand(template, context) {
  5123. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5124. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5125. if (expression) {
  5126. let operator = "";
  5127. const values = [];
  5128. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5129. operator = expression.charAt(0);
  5130. expression = expression.substr(1);
  5131. }
  5132. expression.split(/,/g).forEach(function (variable) {
  5133. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5134. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5135. });
  5136. if (operator && operator !== "+") {
  5137. var separator = ",";
  5138. if (operator === "?") {
  5139. separator = "&";
  5140. } else if (operator !== "#") {
  5141. separator = operator;
  5142. }
  5143. return (values.length !== 0 ? operator : "") + values.join(separator);
  5144. } else {
  5145. return values.join(",");
  5146. }
  5147. } else {
  5148. return encodeReserved(literal);
  5149. }
  5150. });
  5151. }
  5152. function parse(options) {
  5153. // https://fetch.spec.whatwg.org/#methods
  5154. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5155. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5156. let headers = Object.assign({}, options.headers);
  5157. let body;
  5158. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5159. const urlVariableNames = extractUrlVariableNames(url);
  5160. url = parseUrl(url).expand(parameters);
  5161. if (!/^http/.test(url)) {
  5162. url = options.baseUrl + url;
  5163. }
  5164. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5165. const remainingParameters = omit(parameters, omittedParameters);
  5166. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5167. if (!isBinaryRequset) {
  5168. if (options.mediaType.format) {
  5169. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5170. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5171. }
  5172. if (options.mediaType.previews.length) {
  5173. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5174. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5175. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5176. return `application/vnd.github.${preview}-preview${format}`;
  5177. }).join(",");
  5178. }
  5179. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5180. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5181. if (["GET", "HEAD"].includes(method)) {
  5182. url = addQueryParameters(url, remainingParameters);
  5183. } else {
  5184. if ("data" in remainingParameters) {
  5185. body = remainingParameters.data;
  5186. } else {
  5187. if (Object.keys(remainingParameters).length) {
  5188. body = remainingParameters;
  5189. } else {
  5190. headers["content-length"] = 0;
  5191. }
  5192. }
  5193. } // default content-type for JSON if body is set
  5194. if (!headers["content-type"] && typeof body !== "undefined") {
  5195. headers["content-type"] = "application/json; charset=utf-8";
  5196. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5197. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5198. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5199. body = "";
  5200. } // Only return body/request keys if present
  5201. return Object.assign({
  5202. method,
  5203. url,
  5204. headers
  5205. }, typeof body !== "undefined" ? {
  5206. body
  5207. } : null, options.request ? {
  5208. request: options.request
  5209. } : null);
  5210. }
  5211. function endpointWithDefaults(defaults, route, options) {
  5212. return parse(merge(defaults, route, options));
  5213. }
  5214. function withDefaults(oldDefaults, newDefaults) {
  5215. const DEFAULTS = merge(oldDefaults, newDefaults);
  5216. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5217. return Object.assign(endpoint, {
  5218. DEFAULTS,
  5219. defaults: withDefaults.bind(null, DEFAULTS),
  5220. merge: merge.bind(null, DEFAULTS),
  5221. parse
  5222. });
  5223. }
  5224. const VERSION = "5.5.1";
  5225. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5226. // So we use RequestParameters and add method as additional required property.
  5227. const DEFAULTS = {
  5228. method: "GET",
  5229. baseUrl: "https://api.github.com",
  5230. headers: {
  5231. accept: "application/vnd.github.v3+json",
  5232. "user-agent": userAgent
  5233. },
  5234. mediaType: {
  5235. format: "",
  5236. previews: []
  5237. }
  5238. };
  5239. const endpoint = withDefaults(null, DEFAULTS);
  5240. exports.endpoint = endpoint;
  5241. //# sourceMappingURL=index.js.map
  5242. /***/ }),
  5243. /***/ 389:
  5244. /***/ (function(module, __unusedexports, __webpack_require__) {
  5245. "use strict";
  5246. const fs = __webpack_require__(747);
  5247. const shebangCommand = __webpack_require__(866);
  5248. function readShebang(command) {
  5249. // Read the first 150 bytes from the file
  5250. const size = 150;
  5251. let buffer;
  5252. if (Buffer.alloc) {
  5253. // Node.js v4.5+ / v5.10+
  5254. buffer = Buffer.alloc(size);
  5255. } else {
  5256. // Old Node.js API
  5257. buffer = new Buffer(size);
  5258. buffer.fill(0); // zero-fill
  5259. }
  5260. let fd;
  5261. try {
  5262. fd = fs.openSync(command, 'r');
  5263. fs.readSync(fd, buffer, 0, size, 0);
  5264. fs.closeSync(fd);
  5265. } catch (e) { /* Empty */ }
  5266. // Attempt to extract shebang (null is returned if not a shebang)
  5267. return shebangCommand(buffer.toString());
  5268. }
  5269. module.exports = readShebang;
  5270. /***/ }),
  5271. /***/ 402:
  5272. /***/ (function(module, __unusedexports, __webpack_require__) {
  5273. module.exports = Octokit;
  5274. const { request } = __webpack_require__(753);
  5275. const Hook = __webpack_require__(523);
  5276. const parseClientOptions = __webpack_require__(294);
  5277. function Octokit(plugins, options) {
  5278. options = options || {};
  5279. const hook = new Hook.Collection();
  5280. const log = Object.assign(
  5281. {
  5282. debug: () => {},
  5283. info: () => {},
  5284. warn: console.warn,
  5285. error: console.error
  5286. },
  5287. options && options.log
  5288. );
  5289. const api = {
  5290. hook,
  5291. log,
  5292. request: request.defaults(parseClientOptions(options, log, hook))
  5293. };
  5294. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5295. return api;
  5296. }
  5297. /***/ }),
  5298. /***/ 413:
  5299. /***/ (function(module) {
  5300. module.exports = require("stream");
  5301. /***/ }),
  5302. /***/ 427:
  5303. /***/ (function(module, __unusedexports, __webpack_require__) {
  5304. "use strict";
  5305. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5306. // In that case, fall back to a deprecated internal.
  5307. const util = __webpack_require__(669);
  5308. let uv;
  5309. if (typeof util.getSystemErrorName === 'function') {
  5310. module.exports = util.getSystemErrorName;
  5311. } else {
  5312. try {
  5313. uv = process.binding('uv');
  5314. if (typeof uv.errname !== 'function') {
  5315. throw new TypeError('uv.errname is not a function');
  5316. }
  5317. } catch (err) {
  5318. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5319. uv = null;
  5320. }
  5321. module.exports = code => errname(uv, code);
  5322. }
  5323. // Used for testing the fallback behavior
  5324. module.exports.__test__ = errname;
  5325. function errname(uv, code) {
  5326. if (uv) {
  5327. return uv.errname(code);
  5328. }
  5329. if (!(code < 0)) {
  5330. throw new Error('err >= 0');
  5331. }
  5332. return `Unknown system error ${code}`;
  5333. }
  5334. /***/ }),
  5335. /***/ 430:
  5336. /***/ (function(module, __unusedexports, __webpack_require__) {
  5337. module.exports = octokitValidate;
  5338. const validate = __webpack_require__(348);
  5339. function octokitValidate(octokit) {
  5340. octokit.hook.before("request", validate.bind(null, octokit));
  5341. }
  5342. /***/ }),
  5343. /***/ 431:
  5344. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5345. "use strict";
  5346. Object.defineProperty(exports, "__esModule", { value: true });
  5347. const os = __webpack_require__(87);
  5348. /**
  5349. * Commands
  5350. *
  5351. * Command Format:
  5352. * ##[name key=value;key=value]message
  5353. *
  5354. * Examples:
  5355. * ##[warning]This is the user warning message
  5356. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5357. */
  5358. function issueCommand(command, properties, message) {
  5359. const cmd = new Command(command, properties, message);
  5360. process.stdout.write(cmd.toString() + os.EOL);
  5361. }
  5362. exports.issueCommand = issueCommand;
  5363. function issue(name, message = '') {
  5364. issueCommand(name, {}, message);
  5365. }
  5366. exports.issue = issue;
  5367. const CMD_STRING = '::';
  5368. class Command {
  5369. constructor(command, properties, message) {
  5370. if (!command) {
  5371. command = 'missing.command';
  5372. }
  5373. this.command = command;
  5374. this.properties = properties;
  5375. this.message = message;
  5376. }
  5377. toString() {
  5378. let cmdStr = CMD_STRING + this.command;
  5379. if (this.properties && Object.keys(this.properties).length > 0) {
  5380. cmdStr += ' ';
  5381. for (const key in this.properties) {
  5382. if (this.properties.hasOwnProperty(key)) {
  5383. const val = this.properties[key];
  5384. if (val) {
  5385. // safely append the val - avoid blowing up when attempting to
  5386. // call .replace() if message is not a string for some reason
  5387. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5388. }
  5389. }
  5390. }
  5391. }
  5392. cmdStr += CMD_STRING;
  5393. // safely append the message - avoid blowing up when attempting to
  5394. // call .replace() if message is not a string for some reason
  5395. const message = `${this.message || ''}`;
  5396. cmdStr += escapeData(message);
  5397. return cmdStr;
  5398. }
  5399. }
  5400. function escapeData(s) {
  5401. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5402. }
  5403. function escape(s) {
  5404. return s
  5405. .replace(/\r/g, '%0D')
  5406. .replace(/\n/g, '%0A')
  5407. .replace(/]/g, '%5D')
  5408. .replace(/;/g, '%3B');
  5409. }
  5410. //# sourceMappingURL=command.js.map
  5411. /***/ }),
  5412. /***/ 453:
  5413. /***/ (function(module, __unusedexports, __webpack_require__) {
  5414. var once = __webpack_require__(969)
  5415. var eos = __webpack_require__(562)
  5416. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5417. var noop = function () {}
  5418. var ancient = /^v?\.0/.test(process.version)
  5419. var isFn = function (fn) {
  5420. return typeof fn === 'function'
  5421. }
  5422. var isFS = function (stream) {
  5423. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5424. if (!fs) return false // browser
  5425. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5426. }
  5427. var isRequest = function (stream) {
  5428. return stream.setHeader && isFn(stream.abort)
  5429. }
  5430. var destroyer = function (stream, reading, writing, callback) {
  5431. callback = once(callback)
  5432. var closed = false
  5433. stream.on('close', function () {
  5434. closed = true
  5435. })
  5436. eos(stream, {readable: reading, writable: writing}, function (err) {
  5437. if (err) return callback(err)
  5438. closed = true
  5439. callback()
  5440. })
  5441. var destroyed = false
  5442. return function (err) {
  5443. if (closed) return
  5444. if (destroyed) return
  5445. destroyed = true
  5446. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5447. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5448. if (isFn(stream.destroy)) return stream.destroy()
  5449. callback(err || new Error('stream was destroyed'))
  5450. }
  5451. }
  5452. var call = function (fn) {
  5453. fn()
  5454. }
  5455. var pipe = function (from, to) {
  5456. return from.pipe(to)
  5457. }
  5458. var pump = function () {
  5459. var streams = Array.prototype.slice.call(arguments)
  5460. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5461. if (Array.isArray(streams[0])) streams = streams[0]
  5462. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5463. var error
  5464. var destroys = streams.map(function (stream, i) {
  5465. var reading = i < streams.length - 1
  5466. var writing = i > 0
  5467. return destroyer(stream, reading, writing, function (err) {
  5468. if (!error) error = err
  5469. if (err) destroys.forEach(call)
  5470. if (reading) return
  5471. destroys.forEach(call)
  5472. callback(error)
  5473. })
  5474. })
  5475. return streams.reduce(pipe)
  5476. }
  5477. module.exports = pump
  5478. /***/ }),
  5479. /***/ 454:
  5480. /***/ (function(module, exports, __webpack_require__) {
  5481. "use strict";
  5482. Object.defineProperty(exports, '__esModule', { value: true });
  5483. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5484. var Stream = _interopDefault(__webpack_require__(413));
  5485. var http = _interopDefault(__webpack_require__(605));
  5486. var Url = _interopDefault(__webpack_require__(835));
  5487. var https = _interopDefault(__webpack_require__(211));
  5488. var zlib = _interopDefault(__webpack_require__(761));
  5489. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5490. // fix for "Readable" isn't a named export issue
  5491. const Readable = Stream.Readable;
  5492. const BUFFER = Symbol('buffer');
  5493. const TYPE = Symbol('type');
  5494. class Blob {
  5495. constructor() {
  5496. this[TYPE] = '';
  5497. const blobParts = arguments[0];
  5498. const options = arguments[1];
  5499. const buffers = [];
  5500. let size = 0;
  5501. if (blobParts) {
  5502. const a = blobParts;
  5503. const length = Number(a.length);
  5504. for (let i = 0; i < length; i++) {
  5505. const element = a[i];
  5506. let buffer;
  5507. if (element instanceof Buffer) {
  5508. buffer = element;
  5509. } else if (ArrayBuffer.isView(element)) {
  5510. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5511. } else if (element instanceof ArrayBuffer) {
  5512. buffer = Buffer.from(element);
  5513. } else if (element instanceof Blob) {
  5514. buffer = element[BUFFER];
  5515. } else {
  5516. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5517. }
  5518. size += buffer.length;
  5519. buffers.push(buffer);
  5520. }
  5521. }
  5522. this[BUFFER] = Buffer.concat(buffers);
  5523. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5524. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5525. this[TYPE] = type;
  5526. }
  5527. }
  5528. get size() {
  5529. return this[BUFFER].length;
  5530. }
  5531. get type() {
  5532. return this[TYPE];
  5533. }
  5534. text() {
  5535. return Promise.resolve(this[BUFFER].toString());
  5536. }
  5537. arrayBuffer() {
  5538. const buf = this[BUFFER];
  5539. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5540. return Promise.resolve(ab);
  5541. }
  5542. stream() {
  5543. const readable = new Readable();
  5544. readable._read = function () {};
  5545. readable.push(this[BUFFER]);
  5546. readable.push(null);
  5547. return readable;
  5548. }
  5549. toString() {
  5550. return '[object Blob]';
  5551. }
  5552. slice() {
  5553. const size = this.size;
  5554. const start = arguments[0];
  5555. const end = arguments[1];
  5556. let relativeStart, relativeEnd;
  5557. if (start === undefined) {
  5558. relativeStart = 0;
  5559. } else if (start < 0) {
  5560. relativeStart = Math.max(size + start, 0);
  5561. } else {
  5562. relativeStart = Math.min(start, size);
  5563. }
  5564. if (end === undefined) {
  5565. relativeEnd = size;
  5566. } else if (end < 0) {
  5567. relativeEnd = Math.max(size + end, 0);
  5568. } else {
  5569. relativeEnd = Math.min(end, size);
  5570. }
  5571. const span = Math.max(relativeEnd - relativeStart, 0);
  5572. const buffer = this[BUFFER];
  5573. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5574. const blob = new Blob([], { type: arguments[2] });
  5575. blob[BUFFER] = slicedBuffer;
  5576. return blob;
  5577. }
  5578. }
  5579. Object.defineProperties(Blob.prototype, {
  5580. size: { enumerable: true },
  5581. type: { enumerable: true },
  5582. slice: { enumerable: true }
  5583. });
  5584. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5585. value: 'Blob',
  5586. writable: false,
  5587. enumerable: false,
  5588. configurable: true
  5589. });
  5590. /**
  5591. * fetch-error.js
  5592. *
  5593. * FetchError interface for operational errors
  5594. */
  5595. /**
  5596. * Create FetchError instance
  5597. *
  5598. * @param String message Error message for human
  5599. * @param String type Error type for machine
  5600. * @param String systemError For Node.js system error
  5601. * @return FetchError
  5602. */
  5603. function FetchError(message, type, systemError) {
  5604. Error.call(this, message);
  5605. this.message = message;
  5606. this.type = type;
  5607. // when err.type is `system`, err.code contains system error code
  5608. if (systemError) {
  5609. this.code = this.errno = systemError.code;
  5610. }
  5611. // hide custom error implementation details from end-users
  5612. Error.captureStackTrace(this, this.constructor);
  5613. }
  5614. FetchError.prototype = Object.create(Error.prototype);
  5615. FetchError.prototype.constructor = FetchError;
  5616. FetchError.prototype.name = 'FetchError';
  5617. let convert;
  5618. try {
  5619. convert = __webpack_require__(18).convert;
  5620. } catch (e) {}
  5621. const INTERNALS = Symbol('Body internals');
  5622. // fix an issue where "PassThrough" isn't a named export for node <10
  5623. const PassThrough = Stream.PassThrough;
  5624. /**
  5625. * Body mixin
  5626. *
  5627. * Ref: https://fetch.spec.whatwg.org/#body
  5628. *
  5629. * @param Stream body Readable stream
  5630. * @param Object opts Response options
  5631. * @return Void
  5632. */
  5633. function Body(body) {
  5634. var _this = this;
  5635. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5636. _ref$size = _ref.size;
  5637. let size = _ref$size === undefined ? 0 : _ref$size;
  5638. var _ref$timeout = _ref.timeout;
  5639. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5640. if (body == null) {
  5641. // body is undefined or null
  5642. body = null;
  5643. } else if (isURLSearchParams(body)) {
  5644. // body is a URLSearchParams
  5645. body = Buffer.from(body.toString());
  5646. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5647. // body is ArrayBuffer
  5648. body = Buffer.from(body);
  5649. } else if (ArrayBuffer.isView(body)) {
  5650. // body is ArrayBufferView
  5651. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5652. } else if (body instanceof Stream) ; else {
  5653. // none of the above
  5654. // coerce to string then buffer
  5655. body = Buffer.from(String(body));
  5656. }
  5657. this[INTERNALS] = {
  5658. body,
  5659. disturbed: false,
  5660. error: null
  5661. };
  5662. this.size = size;
  5663. this.timeout = timeout;
  5664. if (body instanceof Stream) {
  5665. body.on('error', function (err) {
  5666. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5667. _this[INTERNALS].error = error;
  5668. });
  5669. }
  5670. }
  5671. Body.prototype = {
  5672. get body() {
  5673. return this[INTERNALS].body;
  5674. },
  5675. get bodyUsed() {
  5676. return this[INTERNALS].disturbed;
  5677. },
  5678. /**
  5679. * Decode response as ArrayBuffer
  5680. *
  5681. * @return Promise
  5682. */
  5683. arrayBuffer() {
  5684. return consumeBody.call(this).then(function (buf) {
  5685. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5686. });
  5687. },
  5688. /**
  5689. * Return raw response as Blob
  5690. *
  5691. * @return Promise
  5692. */
  5693. blob() {
  5694. let ct = this.headers && this.headers.get('content-type') || '';
  5695. return consumeBody.call(this).then(function (buf) {
  5696. return Object.assign(
  5697. // Prevent copying
  5698. new Blob([], {
  5699. type: ct.toLowerCase()
  5700. }), {
  5701. [BUFFER]: buf
  5702. });
  5703. });
  5704. },
  5705. /**
  5706. * Decode response as json
  5707. *
  5708. * @return Promise
  5709. */
  5710. json() {
  5711. var _this2 = this;
  5712. return consumeBody.call(this).then(function (buffer) {
  5713. try {
  5714. return JSON.parse(buffer.toString());
  5715. } catch (err) {
  5716. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5717. }
  5718. });
  5719. },
  5720. /**
  5721. * Decode response as text
  5722. *
  5723. * @return Promise
  5724. */
  5725. text() {
  5726. return consumeBody.call(this).then(function (buffer) {
  5727. return buffer.toString();
  5728. });
  5729. },
  5730. /**
  5731. * Decode response as buffer (non-spec api)
  5732. *
  5733. * @return Promise
  5734. */
  5735. buffer() {
  5736. return consumeBody.call(this);
  5737. },
  5738. /**
  5739. * Decode response as text, while automatically detecting the encoding and
  5740. * trying to decode to UTF-8 (non-spec api)
  5741. *
  5742. * @return Promise
  5743. */
  5744. textConverted() {
  5745. var _this3 = this;
  5746. return consumeBody.call(this).then(function (buffer) {
  5747. return convertBody(buffer, _this3.headers);
  5748. });
  5749. }
  5750. };
  5751. // In browsers, all properties are enumerable.
  5752. Object.defineProperties(Body.prototype, {
  5753. body: { enumerable: true },
  5754. bodyUsed: { enumerable: true },
  5755. arrayBuffer: { enumerable: true },
  5756. blob: { enumerable: true },
  5757. json: { enumerable: true },
  5758. text: { enumerable: true }
  5759. });
  5760. Body.mixIn = function (proto) {
  5761. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5762. // istanbul ignore else: future proof
  5763. if (!(name in proto)) {
  5764. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5765. Object.defineProperty(proto, name, desc);
  5766. }
  5767. }
  5768. };
  5769. /**
  5770. * Consume and convert an entire Body to a Buffer.
  5771. *
  5772. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5773. *
  5774. * @return Promise
  5775. */
  5776. function consumeBody() {
  5777. var _this4 = this;
  5778. if (this[INTERNALS].disturbed) {
  5779. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5780. }
  5781. this[INTERNALS].disturbed = true;
  5782. if (this[INTERNALS].error) {
  5783. return Body.Promise.reject(this[INTERNALS].error);
  5784. }
  5785. let body = this.body;
  5786. // body is null
  5787. if (body === null) {
  5788. return Body.Promise.resolve(Buffer.alloc(0));
  5789. }
  5790. // body is blob
  5791. if (isBlob(body)) {
  5792. body = body.stream();
  5793. }
  5794. // body is buffer
  5795. if (Buffer.isBuffer(body)) {
  5796. return Body.Promise.resolve(body);
  5797. }
  5798. // istanbul ignore if: should never happen
  5799. if (!(body instanceof Stream)) {
  5800. return Body.Promise.resolve(Buffer.alloc(0));
  5801. }
  5802. // body is stream
  5803. // get ready to actually consume the body
  5804. let accum = [];
  5805. let accumBytes = 0;
  5806. let abort = false;
  5807. return new Body.Promise(function (resolve, reject) {
  5808. let resTimeout;
  5809. // allow timeout on slow response body
  5810. if (_this4.timeout) {
  5811. resTimeout = setTimeout(function () {
  5812. abort = true;
  5813. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  5814. }, _this4.timeout);
  5815. }
  5816. // handle stream errors
  5817. body.on('error', function (err) {
  5818. if (err.name === 'AbortError') {
  5819. // if the request was aborted, reject with this Error
  5820. abort = true;
  5821. reject(err);
  5822. } else {
  5823. // other errors, such as incorrect content-encoding
  5824. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  5825. }
  5826. });
  5827. body.on('data', function (chunk) {
  5828. if (abort || chunk === null) {
  5829. return;
  5830. }
  5831. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  5832. abort = true;
  5833. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  5834. return;
  5835. }
  5836. accumBytes += chunk.length;
  5837. accum.push(chunk);
  5838. });
  5839. body.on('end', function () {
  5840. if (abort) {
  5841. return;
  5842. }
  5843. clearTimeout(resTimeout);
  5844. try {
  5845. resolve(Buffer.concat(accum, accumBytes));
  5846. } catch (err) {
  5847. // handle streams that have accumulated too much data (issue #414)
  5848. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  5849. }
  5850. });
  5851. });
  5852. }
  5853. /**
  5854. * Detect buffer encoding and convert to target encoding
  5855. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  5856. *
  5857. * @param Buffer buffer Incoming buffer
  5858. * @param String encoding Target encoding
  5859. * @return String
  5860. */
  5861. function convertBody(buffer, headers) {
  5862. if (typeof convert !== 'function') {
  5863. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  5864. }
  5865. const ct = headers.get('content-type');
  5866. let charset = 'utf-8';
  5867. let res, str;
  5868. // header
  5869. if (ct) {
  5870. res = /charset=([^;]*)/i.exec(ct);
  5871. }
  5872. // no charset in content type, peek at response body for at most 1024 bytes
  5873. str = buffer.slice(0, 1024).toString();
  5874. // html5
  5875. if (!res && str) {
  5876. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  5877. }
  5878. // html4
  5879. if (!res && str) {
  5880. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  5881. if (res) {
  5882. res = /charset=(.*)/i.exec(res.pop());
  5883. }
  5884. }
  5885. // xml
  5886. if (!res && str) {
  5887. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  5888. }
  5889. // found charset
  5890. if (res) {
  5891. charset = res.pop();
  5892. // prevent decode issues when sites use incorrect encoding
  5893. // ref: https://hsivonen.fi/encoding-menu/
  5894. if (charset === 'gb2312' || charset === 'gbk') {
  5895. charset = 'gb18030';
  5896. }
  5897. }
  5898. // turn raw buffers into a single utf-8 buffer
  5899. return convert(buffer, 'UTF-8', charset).toString();
  5900. }
  5901. /**
  5902. * Detect a URLSearchParams object
  5903. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  5904. *
  5905. * @param Object obj Object to detect by type or brand
  5906. * @return String
  5907. */
  5908. function isURLSearchParams(obj) {
  5909. // Duck-typing as a necessary condition.
  5910. 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') {
  5911. return false;
  5912. }
  5913. // Brand-checking and more duck-typing as optional condition.
  5914. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  5915. }
  5916. /**
  5917. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  5918. * @param {*} obj
  5919. * @return {boolean}
  5920. */
  5921. function isBlob(obj) {
  5922. 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]);
  5923. }
  5924. /**
  5925. * Clone body given Res/Req instance
  5926. *
  5927. * @param Mixed instance Response or Request instance
  5928. * @return Mixed
  5929. */
  5930. function clone(instance) {
  5931. let p1, p2;
  5932. let body = instance.body;
  5933. // don't allow cloning a used body
  5934. if (instance.bodyUsed) {
  5935. throw new Error('cannot clone body after it is used');
  5936. }
  5937. // check that body is a stream and not form-data object
  5938. // note: we can't clone the form-data object without having it as a dependency
  5939. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  5940. // tee instance body
  5941. p1 = new PassThrough();
  5942. p2 = new PassThrough();
  5943. body.pipe(p1);
  5944. body.pipe(p2);
  5945. // set instance body to teed body and return the other teed body
  5946. instance[INTERNALS].body = p1;
  5947. body = p2;
  5948. }
  5949. return body;
  5950. }
  5951. /**
  5952. * Performs the operation "extract a `Content-Type` value from |object|" as
  5953. * specified in the specification:
  5954. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  5955. *
  5956. * This function assumes that instance.body is present.
  5957. *
  5958. * @param Mixed instance Any options.body input
  5959. */
  5960. function extractContentType(body) {
  5961. if (body === null) {
  5962. // body is null
  5963. return null;
  5964. } else if (typeof body === 'string') {
  5965. // body is string
  5966. return 'text/plain;charset=UTF-8';
  5967. } else if (isURLSearchParams(body)) {
  5968. // body is a URLSearchParams
  5969. return 'application/x-www-form-urlencoded;charset=UTF-8';
  5970. } else if (isBlob(body)) {
  5971. // body is blob
  5972. return body.type || null;
  5973. } else if (Buffer.isBuffer(body)) {
  5974. // body is buffer
  5975. return null;
  5976. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5977. // body is ArrayBuffer
  5978. return null;
  5979. } else if (ArrayBuffer.isView(body)) {
  5980. // body is ArrayBufferView
  5981. return null;
  5982. } else if (typeof body.getBoundary === 'function') {
  5983. // detect form data input from form-data module
  5984. return `multipart/form-data;boundary=${body.getBoundary()}`;
  5985. } else if (body instanceof Stream) {
  5986. // body is stream
  5987. // can't really do much about this
  5988. return null;
  5989. } else {
  5990. // Body constructor defaults other things to string
  5991. return 'text/plain;charset=UTF-8';
  5992. }
  5993. }
  5994. /**
  5995. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  5996. * For us, we have to explicitly get it with a function.
  5997. *
  5998. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  5999. *
  6000. * @param Body instance Instance of Body
  6001. * @return Number? Number of bytes, or null if not possible
  6002. */
  6003. function getTotalBytes(instance) {
  6004. const body = instance.body;
  6005. if (body === null) {
  6006. // body is null
  6007. return 0;
  6008. } else if (isBlob(body)) {
  6009. return body.size;
  6010. } else if (Buffer.isBuffer(body)) {
  6011. // body is buffer
  6012. return body.length;
  6013. } else if (body && typeof body.getLengthSync === 'function') {
  6014. // detect form data input from form-data module
  6015. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6016. body.hasKnownLength && body.hasKnownLength()) {
  6017. // 2.x
  6018. return body.getLengthSync();
  6019. }
  6020. return null;
  6021. } else {
  6022. // body is stream
  6023. return null;
  6024. }
  6025. }
  6026. /**
  6027. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6028. *
  6029. * @param Body instance Instance of Body
  6030. * @return Void
  6031. */
  6032. function writeToStream(dest, instance) {
  6033. const body = instance.body;
  6034. if (body === null) {
  6035. // body is null
  6036. dest.end();
  6037. } else if (isBlob(body)) {
  6038. body.stream().pipe(dest);
  6039. } else if (Buffer.isBuffer(body)) {
  6040. // body is buffer
  6041. dest.write(body);
  6042. dest.end();
  6043. } else {
  6044. // body is stream
  6045. body.pipe(dest);
  6046. }
  6047. }
  6048. // expose Promise
  6049. Body.Promise = global.Promise;
  6050. /**
  6051. * headers.js
  6052. *
  6053. * Headers class offers convenient helpers
  6054. */
  6055. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6056. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6057. function validateName(name) {
  6058. name = `${name}`;
  6059. if (invalidTokenRegex.test(name) || name === '') {
  6060. throw new TypeError(`${name} is not a legal HTTP header name`);
  6061. }
  6062. }
  6063. function validateValue(value) {
  6064. value = `${value}`;
  6065. if (invalidHeaderCharRegex.test(value)) {
  6066. throw new TypeError(`${value} is not a legal HTTP header value`);
  6067. }
  6068. }
  6069. /**
  6070. * Find the key in the map object given a header name.
  6071. *
  6072. * Returns undefined if not found.
  6073. *
  6074. * @param String name Header name
  6075. * @return String|Undefined
  6076. */
  6077. function find(map, name) {
  6078. name = name.toLowerCase();
  6079. for (const key in map) {
  6080. if (key.toLowerCase() === name) {
  6081. return key;
  6082. }
  6083. }
  6084. return undefined;
  6085. }
  6086. const MAP = Symbol('map');
  6087. class Headers {
  6088. /**
  6089. * Headers class
  6090. *
  6091. * @param Object headers Response headers
  6092. * @return Void
  6093. */
  6094. constructor() {
  6095. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6096. this[MAP] = Object.create(null);
  6097. if (init instanceof Headers) {
  6098. const rawHeaders = init.raw();
  6099. const headerNames = Object.keys(rawHeaders);
  6100. for (const headerName of headerNames) {
  6101. for (const value of rawHeaders[headerName]) {
  6102. this.append(headerName, value);
  6103. }
  6104. }
  6105. return;
  6106. }
  6107. // We don't worry about converting prop to ByteString here as append()
  6108. // will handle it.
  6109. if (init == null) ; else if (typeof init === 'object') {
  6110. const method = init[Symbol.iterator];
  6111. if (method != null) {
  6112. if (typeof method !== 'function') {
  6113. throw new TypeError('Header pairs must be iterable');
  6114. }
  6115. // sequence<sequence<ByteString>>
  6116. // Note: per spec we have to first exhaust the lists then process them
  6117. const pairs = [];
  6118. for (const pair of init) {
  6119. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6120. throw new TypeError('Each header pair must be iterable');
  6121. }
  6122. pairs.push(Array.from(pair));
  6123. }
  6124. for (const pair of pairs) {
  6125. if (pair.length !== 2) {
  6126. throw new TypeError('Each header pair must be a name/value tuple');
  6127. }
  6128. this.append(pair[0], pair[1]);
  6129. }
  6130. } else {
  6131. // record<ByteString, ByteString>
  6132. for (const key of Object.keys(init)) {
  6133. const value = init[key];
  6134. this.append(key, value);
  6135. }
  6136. }
  6137. } else {
  6138. throw new TypeError('Provided initializer must be an object');
  6139. }
  6140. }
  6141. /**
  6142. * Return combined header value given name
  6143. *
  6144. * @param String name Header name
  6145. * @return Mixed
  6146. */
  6147. get(name) {
  6148. name = `${name}`;
  6149. validateName(name);
  6150. const key = find(this[MAP], name);
  6151. if (key === undefined) {
  6152. return null;
  6153. }
  6154. return this[MAP][key].join(', ');
  6155. }
  6156. /**
  6157. * Iterate over all headers
  6158. *
  6159. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6160. * @param Boolean thisArg `this` context for callback function
  6161. * @return Void
  6162. */
  6163. forEach(callback) {
  6164. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6165. let pairs = getHeaders(this);
  6166. let i = 0;
  6167. while (i < pairs.length) {
  6168. var _pairs$i = pairs[i];
  6169. const name = _pairs$i[0],
  6170. value = _pairs$i[1];
  6171. callback.call(thisArg, value, name, this);
  6172. pairs = getHeaders(this);
  6173. i++;
  6174. }
  6175. }
  6176. /**
  6177. * Overwrite header values given name
  6178. *
  6179. * @param String name Header name
  6180. * @param String value Header value
  6181. * @return Void
  6182. */
  6183. set(name, value) {
  6184. name = `${name}`;
  6185. value = `${value}`;
  6186. validateName(name);
  6187. validateValue(value);
  6188. const key = find(this[MAP], name);
  6189. this[MAP][key !== undefined ? key : name] = [value];
  6190. }
  6191. /**
  6192. * Append a value onto existing header
  6193. *
  6194. * @param String name Header name
  6195. * @param String value Header value
  6196. * @return Void
  6197. */
  6198. append(name, value) {
  6199. name = `${name}`;
  6200. value = `${value}`;
  6201. validateName(name);
  6202. validateValue(value);
  6203. const key = find(this[MAP], name);
  6204. if (key !== undefined) {
  6205. this[MAP][key].push(value);
  6206. } else {
  6207. this[MAP][name] = [value];
  6208. }
  6209. }
  6210. /**
  6211. * Check for header name existence
  6212. *
  6213. * @param String name Header name
  6214. * @return Boolean
  6215. */
  6216. has(name) {
  6217. name = `${name}`;
  6218. validateName(name);
  6219. return find(this[MAP], name) !== undefined;
  6220. }
  6221. /**
  6222. * Delete all header values given name
  6223. *
  6224. * @param String name Header name
  6225. * @return Void
  6226. */
  6227. delete(name) {
  6228. name = `${name}`;
  6229. validateName(name);
  6230. const key = find(this[MAP], name);
  6231. if (key !== undefined) {
  6232. delete this[MAP][key];
  6233. }
  6234. }
  6235. /**
  6236. * Return raw headers (non-spec api)
  6237. *
  6238. * @return Object
  6239. */
  6240. raw() {
  6241. return this[MAP];
  6242. }
  6243. /**
  6244. * Get an iterator on keys.
  6245. *
  6246. * @return Iterator
  6247. */
  6248. keys() {
  6249. return createHeadersIterator(this, 'key');
  6250. }
  6251. /**
  6252. * Get an iterator on values.
  6253. *
  6254. * @return Iterator
  6255. */
  6256. values() {
  6257. return createHeadersIterator(this, 'value');
  6258. }
  6259. /**
  6260. * Get an iterator on entries.
  6261. *
  6262. * This is the default iterator of the Headers object.
  6263. *
  6264. * @return Iterator
  6265. */
  6266. [Symbol.iterator]() {
  6267. return createHeadersIterator(this, 'key+value');
  6268. }
  6269. }
  6270. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6271. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6272. value: 'Headers',
  6273. writable: false,
  6274. enumerable: false,
  6275. configurable: true
  6276. });
  6277. Object.defineProperties(Headers.prototype, {
  6278. get: { enumerable: true },
  6279. forEach: { enumerable: true },
  6280. set: { enumerable: true },
  6281. append: { enumerable: true },
  6282. has: { enumerable: true },
  6283. delete: { enumerable: true },
  6284. keys: { enumerable: true },
  6285. values: { enumerable: true },
  6286. entries: { enumerable: true }
  6287. });
  6288. function getHeaders(headers) {
  6289. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6290. const keys = Object.keys(headers[MAP]).sort();
  6291. return keys.map(kind === 'key' ? function (k) {
  6292. return k.toLowerCase();
  6293. } : kind === 'value' ? function (k) {
  6294. return headers[MAP][k].join(', ');
  6295. } : function (k) {
  6296. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6297. });
  6298. }
  6299. const INTERNAL = Symbol('internal');
  6300. function createHeadersIterator(target, kind) {
  6301. const iterator = Object.create(HeadersIteratorPrototype);
  6302. iterator[INTERNAL] = {
  6303. target,
  6304. kind,
  6305. index: 0
  6306. };
  6307. return iterator;
  6308. }
  6309. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6310. next() {
  6311. // istanbul ignore if
  6312. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6313. throw new TypeError('Value of `this` is not a HeadersIterator');
  6314. }
  6315. var _INTERNAL = this[INTERNAL];
  6316. const target = _INTERNAL.target,
  6317. kind = _INTERNAL.kind,
  6318. index = _INTERNAL.index;
  6319. const values = getHeaders(target, kind);
  6320. const len = values.length;
  6321. if (index >= len) {
  6322. return {
  6323. value: undefined,
  6324. done: true
  6325. };
  6326. }
  6327. this[INTERNAL].index = index + 1;
  6328. return {
  6329. value: values[index],
  6330. done: false
  6331. };
  6332. }
  6333. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6334. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6335. value: 'HeadersIterator',
  6336. writable: false,
  6337. enumerable: false,
  6338. configurable: true
  6339. });
  6340. /**
  6341. * Export the Headers object in a form that Node.js can consume.
  6342. *
  6343. * @param Headers headers
  6344. * @return Object
  6345. */
  6346. function exportNodeCompatibleHeaders(headers) {
  6347. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6348. // http.request() only supports string as Host header. This hack makes
  6349. // specifying custom Host header possible.
  6350. const hostHeaderKey = find(headers[MAP], 'Host');
  6351. if (hostHeaderKey !== undefined) {
  6352. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6353. }
  6354. return obj;
  6355. }
  6356. /**
  6357. * Create a Headers object from an object of headers, ignoring those that do
  6358. * not conform to HTTP grammar productions.
  6359. *
  6360. * @param Object obj Object of headers
  6361. * @return Headers
  6362. */
  6363. function createHeadersLenient(obj) {
  6364. const headers = new Headers();
  6365. for (const name of Object.keys(obj)) {
  6366. if (invalidTokenRegex.test(name)) {
  6367. continue;
  6368. }
  6369. if (Array.isArray(obj[name])) {
  6370. for (const val of obj[name]) {
  6371. if (invalidHeaderCharRegex.test(val)) {
  6372. continue;
  6373. }
  6374. if (headers[MAP][name] === undefined) {
  6375. headers[MAP][name] = [val];
  6376. } else {
  6377. headers[MAP][name].push(val);
  6378. }
  6379. }
  6380. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6381. headers[MAP][name] = [obj[name]];
  6382. }
  6383. }
  6384. return headers;
  6385. }
  6386. const INTERNALS$1 = Symbol('Response internals');
  6387. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6388. const STATUS_CODES = http.STATUS_CODES;
  6389. /**
  6390. * Response class
  6391. *
  6392. * @param Stream body Readable stream
  6393. * @param Object opts Response options
  6394. * @return Void
  6395. */
  6396. class Response {
  6397. constructor() {
  6398. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6399. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6400. Body.call(this, body, opts);
  6401. const status = opts.status || 200;
  6402. const headers = new Headers(opts.headers);
  6403. if (body != null && !headers.has('Content-Type')) {
  6404. const contentType = extractContentType(body);
  6405. if (contentType) {
  6406. headers.append('Content-Type', contentType);
  6407. }
  6408. }
  6409. this[INTERNALS$1] = {
  6410. url: opts.url,
  6411. status,
  6412. statusText: opts.statusText || STATUS_CODES[status],
  6413. headers,
  6414. counter: opts.counter
  6415. };
  6416. }
  6417. get url() {
  6418. return this[INTERNALS$1].url || '';
  6419. }
  6420. get status() {
  6421. return this[INTERNALS$1].status;
  6422. }
  6423. /**
  6424. * Convenience property representing if the request ended normally
  6425. */
  6426. get ok() {
  6427. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6428. }
  6429. get redirected() {
  6430. return this[INTERNALS$1].counter > 0;
  6431. }
  6432. get statusText() {
  6433. return this[INTERNALS$1].statusText;
  6434. }
  6435. get headers() {
  6436. return this[INTERNALS$1].headers;
  6437. }
  6438. /**
  6439. * Clone this response
  6440. *
  6441. * @return Response
  6442. */
  6443. clone() {
  6444. return new Response(clone(this), {
  6445. url: this.url,
  6446. status: this.status,
  6447. statusText: this.statusText,
  6448. headers: this.headers,
  6449. ok: this.ok,
  6450. redirected: this.redirected
  6451. });
  6452. }
  6453. }
  6454. Body.mixIn(Response.prototype);
  6455. Object.defineProperties(Response.prototype, {
  6456. url: { enumerable: true },
  6457. status: { enumerable: true },
  6458. ok: { enumerable: true },
  6459. redirected: { enumerable: true },
  6460. statusText: { enumerable: true },
  6461. headers: { enumerable: true },
  6462. clone: { enumerable: true }
  6463. });
  6464. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6465. value: 'Response',
  6466. writable: false,
  6467. enumerable: false,
  6468. configurable: true
  6469. });
  6470. const INTERNALS$2 = Symbol('Request internals');
  6471. // fix an issue where "format", "parse" aren't a named export for node <10
  6472. const parse_url = Url.parse;
  6473. const format_url = Url.format;
  6474. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6475. /**
  6476. * Check if a value is an instance of Request.
  6477. *
  6478. * @param Mixed input
  6479. * @return Boolean
  6480. */
  6481. function isRequest(input) {
  6482. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6483. }
  6484. function isAbortSignal(signal) {
  6485. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6486. return !!(proto && proto.constructor.name === 'AbortSignal');
  6487. }
  6488. /**
  6489. * Request class
  6490. *
  6491. * @param Mixed input Url or Request instance
  6492. * @param Object init Custom options
  6493. * @return Void
  6494. */
  6495. class Request {
  6496. constructor(input) {
  6497. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6498. let parsedURL;
  6499. // normalize input
  6500. if (!isRequest(input)) {
  6501. if (input && input.href) {
  6502. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6503. // will fall into this branch also (since their `toString()` will return
  6504. // `href` property anyway)
  6505. parsedURL = parse_url(input.href);
  6506. } else {
  6507. // coerce input to a string before attempting to parse
  6508. parsedURL = parse_url(`${input}`);
  6509. }
  6510. input = {};
  6511. } else {
  6512. parsedURL = parse_url(input.url);
  6513. }
  6514. let method = init.method || input.method || 'GET';
  6515. method = method.toUpperCase();
  6516. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6517. throw new TypeError('Request with GET/HEAD method cannot have body');
  6518. }
  6519. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6520. Body.call(this, inputBody, {
  6521. timeout: init.timeout || input.timeout || 0,
  6522. size: init.size || input.size || 0
  6523. });
  6524. const headers = new Headers(init.headers || input.headers || {});
  6525. if (inputBody != null && !headers.has('Content-Type')) {
  6526. const contentType = extractContentType(inputBody);
  6527. if (contentType) {
  6528. headers.append('Content-Type', contentType);
  6529. }
  6530. }
  6531. let signal = isRequest(input) ? input.signal : null;
  6532. if ('signal' in init) signal = init.signal;
  6533. if (signal != null && !isAbortSignal(signal)) {
  6534. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6535. }
  6536. this[INTERNALS$2] = {
  6537. method,
  6538. redirect: init.redirect || input.redirect || 'follow',
  6539. headers,
  6540. parsedURL,
  6541. signal
  6542. };
  6543. // node-fetch-only options
  6544. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6545. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6546. this.counter = init.counter || input.counter || 0;
  6547. this.agent = init.agent || input.agent;
  6548. }
  6549. get method() {
  6550. return this[INTERNALS$2].method;
  6551. }
  6552. get url() {
  6553. return format_url(this[INTERNALS$2].parsedURL);
  6554. }
  6555. get headers() {
  6556. return this[INTERNALS$2].headers;
  6557. }
  6558. get redirect() {
  6559. return this[INTERNALS$2].redirect;
  6560. }
  6561. get signal() {
  6562. return this[INTERNALS$2].signal;
  6563. }
  6564. /**
  6565. * Clone this request
  6566. *
  6567. * @return Request
  6568. */
  6569. clone() {
  6570. return new Request(this);
  6571. }
  6572. }
  6573. Body.mixIn(Request.prototype);
  6574. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6575. value: 'Request',
  6576. writable: false,
  6577. enumerable: false,
  6578. configurable: true
  6579. });
  6580. Object.defineProperties(Request.prototype, {
  6581. method: { enumerable: true },
  6582. url: { enumerable: true },
  6583. headers: { enumerable: true },
  6584. redirect: { enumerable: true },
  6585. clone: { enumerable: true },
  6586. signal: { enumerable: true }
  6587. });
  6588. /**
  6589. * Convert a Request to Node.js http request options.
  6590. *
  6591. * @param Request A Request instance
  6592. * @return Object The options object to be passed to http.request
  6593. */
  6594. function getNodeRequestOptions(request) {
  6595. const parsedURL = request[INTERNALS$2].parsedURL;
  6596. const headers = new Headers(request[INTERNALS$2].headers);
  6597. // fetch step 1.3
  6598. if (!headers.has('Accept')) {
  6599. headers.set('Accept', '*/*');
  6600. }
  6601. // Basic fetch
  6602. if (!parsedURL.protocol || !parsedURL.hostname) {
  6603. throw new TypeError('Only absolute URLs are supported');
  6604. }
  6605. if (!/^https?:$/.test(parsedURL.protocol)) {
  6606. throw new TypeError('Only HTTP(S) protocols are supported');
  6607. }
  6608. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6609. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6610. }
  6611. // HTTP-network-or-cache fetch steps 2.4-2.7
  6612. let contentLengthValue = null;
  6613. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6614. contentLengthValue = '0';
  6615. }
  6616. if (request.body != null) {
  6617. const totalBytes = getTotalBytes(request);
  6618. if (typeof totalBytes === 'number') {
  6619. contentLengthValue = String(totalBytes);
  6620. }
  6621. }
  6622. if (contentLengthValue) {
  6623. headers.set('Content-Length', contentLengthValue);
  6624. }
  6625. // HTTP-network-or-cache fetch step 2.11
  6626. if (!headers.has('User-Agent')) {
  6627. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6628. }
  6629. // HTTP-network-or-cache fetch step 2.15
  6630. if (request.compress && !headers.has('Accept-Encoding')) {
  6631. headers.set('Accept-Encoding', 'gzip,deflate');
  6632. }
  6633. let agent = request.agent;
  6634. if (typeof agent === 'function') {
  6635. agent = agent(parsedURL);
  6636. }
  6637. if (!headers.has('Connection') && !agent) {
  6638. headers.set('Connection', 'close');
  6639. }
  6640. // HTTP-network fetch step 4.2
  6641. // chunked encoding is handled by Node.js
  6642. return Object.assign({}, parsedURL, {
  6643. method: request.method,
  6644. headers: exportNodeCompatibleHeaders(headers),
  6645. agent
  6646. });
  6647. }
  6648. /**
  6649. * abort-error.js
  6650. *
  6651. * AbortError interface for cancelled requests
  6652. */
  6653. /**
  6654. * Create AbortError instance
  6655. *
  6656. * @param String message Error message for human
  6657. * @return AbortError
  6658. */
  6659. function AbortError(message) {
  6660. Error.call(this, message);
  6661. this.type = 'aborted';
  6662. this.message = message;
  6663. // hide custom error implementation details from end-users
  6664. Error.captureStackTrace(this, this.constructor);
  6665. }
  6666. AbortError.prototype = Object.create(Error.prototype);
  6667. AbortError.prototype.constructor = AbortError;
  6668. AbortError.prototype.name = 'AbortError';
  6669. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6670. const PassThrough$1 = Stream.PassThrough;
  6671. const resolve_url = Url.resolve;
  6672. /**
  6673. * Fetch function
  6674. *
  6675. * @param Mixed url Absolute url or Request instance
  6676. * @param Object opts Fetch options
  6677. * @return Promise
  6678. */
  6679. function fetch(url, opts) {
  6680. // allow custom promise
  6681. if (!fetch.Promise) {
  6682. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6683. }
  6684. Body.Promise = fetch.Promise;
  6685. // wrap http.request into fetch
  6686. return new fetch.Promise(function (resolve, reject) {
  6687. // build request object
  6688. const request = new Request(url, opts);
  6689. const options = getNodeRequestOptions(request);
  6690. const send = (options.protocol === 'https:' ? https : http).request;
  6691. const signal = request.signal;
  6692. let response = null;
  6693. const abort = function abort() {
  6694. let error = new AbortError('The user aborted a request.');
  6695. reject(error);
  6696. if (request.body && request.body instanceof Stream.Readable) {
  6697. request.body.destroy(error);
  6698. }
  6699. if (!response || !response.body) return;
  6700. response.body.emit('error', error);
  6701. };
  6702. if (signal && signal.aborted) {
  6703. abort();
  6704. return;
  6705. }
  6706. const abortAndFinalize = function abortAndFinalize() {
  6707. abort();
  6708. finalize();
  6709. };
  6710. // send request
  6711. const req = send(options);
  6712. let reqTimeout;
  6713. if (signal) {
  6714. signal.addEventListener('abort', abortAndFinalize);
  6715. }
  6716. function finalize() {
  6717. req.abort();
  6718. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6719. clearTimeout(reqTimeout);
  6720. }
  6721. if (request.timeout) {
  6722. req.once('socket', function (socket) {
  6723. reqTimeout = setTimeout(function () {
  6724. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6725. finalize();
  6726. }, request.timeout);
  6727. });
  6728. }
  6729. req.on('error', function (err) {
  6730. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6731. finalize();
  6732. });
  6733. req.on('response', function (res) {
  6734. clearTimeout(reqTimeout);
  6735. const headers = createHeadersLenient(res.headers);
  6736. // HTTP fetch step 5
  6737. if (fetch.isRedirect(res.statusCode)) {
  6738. // HTTP fetch step 5.2
  6739. const location = headers.get('Location');
  6740. // HTTP fetch step 5.3
  6741. const locationURL = location === null ? null : resolve_url(request.url, location);
  6742. // HTTP fetch step 5.5
  6743. switch (request.redirect) {
  6744. case 'error':
  6745. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6746. finalize();
  6747. return;
  6748. case 'manual':
  6749. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6750. if (locationURL !== null) {
  6751. // handle corrupted header
  6752. try {
  6753. headers.set('Location', locationURL);
  6754. } catch (err) {
  6755. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6756. reject(err);
  6757. }
  6758. }
  6759. break;
  6760. case 'follow':
  6761. // HTTP-redirect fetch step 2
  6762. if (locationURL === null) {
  6763. break;
  6764. }
  6765. // HTTP-redirect fetch step 5
  6766. if (request.counter >= request.follow) {
  6767. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6768. finalize();
  6769. return;
  6770. }
  6771. // HTTP-redirect fetch step 6 (counter increment)
  6772. // Create a new Request object.
  6773. const requestOpts = {
  6774. headers: new Headers(request.headers),
  6775. follow: request.follow,
  6776. counter: request.counter + 1,
  6777. agent: request.agent,
  6778. compress: request.compress,
  6779. method: request.method,
  6780. body: request.body,
  6781. signal: request.signal,
  6782. timeout: request.timeout
  6783. };
  6784. // HTTP-redirect fetch step 9
  6785. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  6786. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  6787. finalize();
  6788. return;
  6789. }
  6790. // HTTP-redirect fetch step 11
  6791. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  6792. requestOpts.method = 'GET';
  6793. requestOpts.body = undefined;
  6794. requestOpts.headers.delete('content-length');
  6795. }
  6796. // HTTP-redirect fetch step 15
  6797. resolve(fetch(new Request(locationURL, requestOpts)));
  6798. finalize();
  6799. return;
  6800. }
  6801. }
  6802. // prepare response
  6803. res.once('end', function () {
  6804. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6805. });
  6806. let body = res.pipe(new PassThrough$1());
  6807. const response_options = {
  6808. url: request.url,
  6809. status: res.statusCode,
  6810. statusText: res.statusMessage,
  6811. headers: headers,
  6812. size: request.size,
  6813. timeout: request.timeout,
  6814. counter: request.counter
  6815. };
  6816. // HTTP-network fetch step 12.1.1.3
  6817. const codings = headers.get('Content-Encoding');
  6818. // HTTP-network fetch step 12.1.1.4: handle content codings
  6819. // in following scenarios we ignore compression support
  6820. // 1. compression support is disabled
  6821. // 2. HEAD request
  6822. // 3. no Content-Encoding header
  6823. // 4. no content response (204)
  6824. // 5. content not modified response (304)
  6825. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  6826. response = new Response(body, response_options);
  6827. resolve(response);
  6828. return;
  6829. }
  6830. // For Node v6+
  6831. // Be less strict when decoding compressed responses, since sometimes
  6832. // servers send slightly invalid responses that are still accepted
  6833. // by common browsers.
  6834. // Always using Z_SYNC_FLUSH is what cURL does.
  6835. const zlibOptions = {
  6836. flush: zlib.Z_SYNC_FLUSH,
  6837. finishFlush: zlib.Z_SYNC_FLUSH
  6838. };
  6839. // for gzip
  6840. if (codings == 'gzip' || codings == 'x-gzip') {
  6841. body = body.pipe(zlib.createGunzip(zlibOptions));
  6842. response = new Response(body, response_options);
  6843. resolve(response);
  6844. return;
  6845. }
  6846. // for deflate
  6847. if (codings == 'deflate' || codings == 'x-deflate') {
  6848. // handle the infamous raw deflate response from old servers
  6849. // a hack for old IIS and Apache servers
  6850. const raw = res.pipe(new PassThrough$1());
  6851. raw.once('data', function (chunk) {
  6852. // see http://stackoverflow.com/questions/37519828
  6853. if ((chunk[0] & 0x0F) === 0x08) {
  6854. body = body.pipe(zlib.createInflate());
  6855. } else {
  6856. body = body.pipe(zlib.createInflateRaw());
  6857. }
  6858. response = new Response(body, response_options);
  6859. resolve(response);
  6860. });
  6861. return;
  6862. }
  6863. // for br
  6864. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  6865. body = body.pipe(zlib.createBrotliDecompress());
  6866. response = new Response(body, response_options);
  6867. resolve(response);
  6868. return;
  6869. }
  6870. // otherwise, use response as-is
  6871. response = new Response(body, response_options);
  6872. resolve(response);
  6873. });
  6874. writeToStream(req, request);
  6875. });
  6876. }
  6877. /**
  6878. * Redirect code matching
  6879. *
  6880. * @param Number code Status code
  6881. * @return Boolean
  6882. */
  6883. fetch.isRedirect = function (code) {
  6884. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  6885. };
  6886. // expose Promise
  6887. fetch.Promise = global.Promise;
  6888. module.exports = exports = fetch;
  6889. Object.defineProperty(exports, "__esModule", { value: true });
  6890. exports.default = exports;
  6891. exports.Headers = Headers;
  6892. exports.Request = Request;
  6893. exports.Response = Response;
  6894. exports.FetchError = FetchError;
  6895. /***/ }),
  6896. /***/ 462:
  6897. /***/ (function(module) {
  6898. "use strict";
  6899. // See http://www.robvanderwoude.com/escapechars.php
  6900. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  6901. function escapeCommand(arg) {
  6902. // Escape meta chars
  6903. arg = arg.replace(metaCharsRegExp, '^$1');
  6904. return arg;
  6905. }
  6906. function escapeArgument(arg, doubleEscapeMetaChars) {
  6907. // Convert to string
  6908. arg = `${arg}`;
  6909. // Algorithm below is based on https://qntm.org/cmd
  6910. // Sequence of backslashes followed by a double quote:
  6911. // double up all the backslashes and escape the double quote
  6912. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  6913. // Sequence of backslashes followed by the end of the string
  6914. // (which will become a double quote later):
  6915. // double up all the backslashes
  6916. arg = arg.replace(/(\\*)$/, '$1$1');
  6917. // All other backslashes occur literally
  6918. // Quote the whole thing:
  6919. arg = `"${arg}"`;
  6920. // Escape meta chars
  6921. arg = arg.replace(metaCharsRegExp, '^$1');
  6922. // Double escape meta chars if necessary
  6923. if (doubleEscapeMetaChars) {
  6924. arg = arg.replace(metaCharsRegExp, '^$1');
  6925. }
  6926. return arg;
  6927. }
  6928. module.exports.command = escapeCommand;
  6929. module.exports.argument = escapeArgument;
  6930. /***/ }),
  6931. /***/ 463:
  6932. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6933. "use strict";
  6934. Object.defineProperty(exports, '__esModule', { value: true });
  6935. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6936. var deprecation = __webpack_require__(692);
  6937. var once = _interopDefault(__webpack_require__(969));
  6938. const logOnce = once(deprecation => console.warn(deprecation));
  6939. /**
  6940. * Error with extra properties to help with debugging
  6941. */
  6942. class RequestError extends Error {
  6943. constructor(message, statusCode, options) {
  6944. super(message); // Maintains proper stack trace (only available on V8)
  6945. /* istanbul ignore next */
  6946. if (Error.captureStackTrace) {
  6947. Error.captureStackTrace(this, this.constructor);
  6948. }
  6949. this.name = "HttpError";
  6950. this.status = statusCode;
  6951. Object.defineProperty(this, "code", {
  6952. get() {
  6953. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  6954. return statusCode;
  6955. }
  6956. });
  6957. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  6958. const requestCopy = Object.assign({}, options.request);
  6959. if (options.request.headers.authorization) {
  6960. requestCopy.headers = Object.assign({}, options.request.headers, {
  6961. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  6962. });
  6963. }
  6964. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  6965. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  6966. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  6967. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  6968. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  6969. this.request = requestCopy;
  6970. }
  6971. }
  6972. exports.RequestError = RequestError;
  6973. //# sourceMappingURL=index.js.map
  6974. /***/ }),
  6975. /***/ 464:
  6976. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6977. "use strict";
  6978. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6979. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6980. return new (P || (P = Promise))(function (resolve, reject) {
  6981. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6982. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6983. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6984. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6985. });
  6986. };
  6987. var __importStar = (this && this.__importStar) || function (mod) {
  6988. if (mod && mod.__esModule) return mod;
  6989. var result = {};
  6990. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6991. result["default"] = mod;
  6992. return result;
  6993. };
  6994. Object.defineProperty(exports, "__esModule", { value: true });
  6995. const assert = __importStar(__webpack_require__(357));
  6996. const core = __importStar(__webpack_require__(470));
  6997. const exec = __importStar(__webpack_require__(986));
  6998. const fs = __importStar(__webpack_require__(747));
  6999. const github = __importStar(__webpack_require__(469));
  7000. const io = __importStar(__webpack_require__(1));
  7001. const path = __importStar(__webpack_require__(622));
  7002. const IS_WINDOWS = process.platform === 'win32';
  7003. function downloadRepository(accessToken, owner, repo, ref, repositoryPath) {
  7004. return __awaiter(this, void 0, void 0, function* () {
  7005. const octokit = new github.GitHub(accessToken);
  7006. const params = {
  7007. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7008. owner: owner,
  7009. repo: repo,
  7010. ref: ref
  7011. };
  7012. // todo: retry
  7013. const response = yield octokit.repos.getArchiveLink(params);
  7014. if (response.status != 200) {
  7015. throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'; Data: '${response.data}'`);
  7016. }
  7017. console.log(`status=${response.status}`);
  7018. console.log(`headers=${JSON.stringify(response.headers)}`);
  7019. // console.log(`data=${response.data}`)
  7020. // console.log(`data=${JSON.stringify(response.data)}`)
  7021. // for (const key of Object.keys(response.data)) {
  7022. // console.log(`data['${key}']=${response.data[key]}`)
  7023. // }
  7024. const runnerTemp = process.env['RUNNER_TEMP'];
  7025. assert.ok(runnerTemp, 'RUNNER_TEMP not defined');
  7026. const archiveFile = path.join(runnerTemp, 'checkout-archive.tar.gz');
  7027. yield io.rmRF(archiveFile);
  7028. yield fs.promises.writeFile(archiveFile, Buffer.from(response.data));
  7029. yield exec.exec(`ls -la "${archiveFile}"`, [], {
  7030. cwd: repositoryPath
  7031. });
  7032. const extractPath = path.join(runnerTemp, 'checkout-archive');
  7033. yield io.rmRF(extractPath);
  7034. yield io.mkdirP(extractPath);
  7035. yield exec.exec(`tar -xzf "${archiveFile}"`, [], {
  7036. cwd: extractPath
  7037. });
  7038. // Determine the real directory to copy (ignore extra dir at root of the archive)
  7039. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7040. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7041. const extraDirectoryName = archiveFileNames[0];
  7042. core.info(`Resolved ${extraDirectoryName}`); // contains the short SHA
  7043. const tempRepositoryPath = path.join(extractPath, extraDirectoryName);
  7044. // Move the files
  7045. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7046. const sourcePath = path.join(tempRepositoryPath, fileName);
  7047. const targetPath = path.join(repositoryPath, fileName);
  7048. yield io.mv(sourcePath, targetPath);
  7049. }
  7050. yield exec.exec(`find .`, [], {
  7051. cwd: repositoryPath
  7052. });
  7053. });
  7054. }
  7055. exports.downloadRepository = downloadRepository;
  7056. /***/ }),
  7057. /***/ 469:
  7058. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7059. "use strict";
  7060. var __importDefault = (this && this.__importDefault) || function (mod) {
  7061. return (mod && mod.__esModule) ? mod : { "default": mod };
  7062. };
  7063. var __importStar = (this && this.__importStar) || function (mod) {
  7064. if (mod && mod.__esModule) return mod;
  7065. var result = {};
  7066. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7067. result["default"] = mod;
  7068. return result;
  7069. };
  7070. Object.defineProperty(exports, "__esModule", { value: true });
  7071. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7072. const graphql_1 = __webpack_require__(898);
  7073. const rest_1 = __importDefault(__webpack_require__(0));
  7074. const Context = __importStar(__webpack_require__(262));
  7075. // We need this in order to extend Octokit
  7076. rest_1.default.prototype = new rest_1.default();
  7077. exports.context = new Context.Context();
  7078. class GitHub extends rest_1.default {
  7079. constructor(token, opts = {}) {
  7080. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7081. this.graphql = graphql_1.graphql.defaults({
  7082. headers: { authorization: `token ${token}` }
  7083. });
  7084. }
  7085. }
  7086. exports.GitHub = GitHub;
  7087. //# sourceMappingURL=github.js.map
  7088. /***/ }),
  7089. /***/ 470:
  7090. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7091. "use strict";
  7092. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7093. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7094. return new (P || (P = Promise))(function (resolve, reject) {
  7095. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7096. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7097. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7098. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7099. });
  7100. };
  7101. Object.defineProperty(exports, "__esModule", { value: true });
  7102. const command_1 = __webpack_require__(431);
  7103. const os = __webpack_require__(87);
  7104. const path = __webpack_require__(622);
  7105. /**
  7106. * The code to exit an action
  7107. */
  7108. var ExitCode;
  7109. (function (ExitCode) {
  7110. /**
  7111. * A code indicating that the action was successful
  7112. */
  7113. ExitCode[ExitCode["Success"] = 0] = "Success";
  7114. /**
  7115. * A code indicating that the action was a failure
  7116. */
  7117. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7118. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7119. //-----------------------------------------------------------------------
  7120. // Variables
  7121. //-----------------------------------------------------------------------
  7122. /**
  7123. * Sets env variable for this action and future actions in the job
  7124. * @param name the name of the variable to set
  7125. * @param val the value of the variable
  7126. */
  7127. function exportVariable(name, val) {
  7128. process.env[name] = val;
  7129. command_1.issueCommand('set-env', { name }, val);
  7130. }
  7131. exports.exportVariable = exportVariable;
  7132. /**
  7133. * Registers a secret which will get masked from logs
  7134. * @param secret value of the secret
  7135. */
  7136. function setSecret(secret) {
  7137. command_1.issueCommand('add-mask', {}, secret);
  7138. }
  7139. exports.setSecret = setSecret;
  7140. /**
  7141. * Prepends inputPath to the PATH (for this action and future actions)
  7142. * @param inputPath
  7143. */
  7144. function addPath(inputPath) {
  7145. command_1.issueCommand('add-path', {}, inputPath);
  7146. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7147. }
  7148. exports.addPath = addPath;
  7149. /**
  7150. * Gets the value of an input. The value is also trimmed.
  7151. *
  7152. * @param name name of the input to get
  7153. * @param options optional. See InputOptions.
  7154. * @returns string
  7155. */
  7156. function getInput(name, options) {
  7157. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7158. if (options && options.required && !val) {
  7159. throw new Error(`Input required and not supplied: ${name}`);
  7160. }
  7161. return val.trim();
  7162. }
  7163. exports.getInput = getInput;
  7164. /**
  7165. * Sets the value of an output.
  7166. *
  7167. * @param name name of the output to set
  7168. * @param value value to store
  7169. */
  7170. function setOutput(name, value) {
  7171. command_1.issueCommand('set-output', { name }, value);
  7172. }
  7173. exports.setOutput = setOutput;
  7174. //-----------------------------------------------------------------------
  7175. // Results
  7176. //-----------------------------------------------------------------------
  7177. /**
  7178. * Sets the action status to failed.
  7179. * When the action exits it will be with an exit code of 1
  7180. * @param message add error issue message
  7181. */
  7182. function setFailed(message) {
  7183. process.exitCode = ExitCode.Failure;
  7184. error(message);
  7185. }
  7186. exports.setFailed = setFailed;
  7187. //-----------------------------------------------------------------------
  7188. // Logging Commands
  7189. //-----------------------------------------------------------------------
  7190. /**
  7191. * Writes debug message to user log
  7192. * @param message debug message
  7193. */
  7194. function debug(message) {
  7195. command_1.issueCommand('debug', {}, message);
  7196. }
  7197. exports.debug = debug;
  7198. /**
  7199. * Adds an error issue
  7200. * @param message error issue message
  7201. */
  7202. function error(message) {
  7203. command_1.issue('error', message);
  7204. }
  7205. exports.error = error;
  7206. /**
  7207. * Adds an warning issue
  7208. * @param message warning issue message
  7209. */
  7210. function warning(message) {
  7211. command_1.issue('warning', message);
  7212. }
  7213. exports.warning = warning;
  7214. /**
  7215. * Writes info to log with console.log.
  7216. * @param message info message
  7217. */
  7218. function info(message) {
  7219. process.stdout.write(message + os.EOL);
  7220. }
  7221. exports.info = info;
  7222. /**
  7223. * Begin an output group.
  7224. *
  7225. * Output until the next `groupEnd` will be foldable in this group
  7226. *
  7227. * @param name The name of the output group
  7228. */
  7229. function startGroup(name) {
  7230. command_1.issue('group', name);
  7231. }
  7232. exports.startGroup = startGroup;
  7233. /**
  7234. * End an output group.
  7235. */
  7236. function endGroup() {
  7237. command_1.issue('endgroup');
  7238. }
  7239. exports.endGroup = endGroup;
  7240. /**
  7241. * Wrap an asynchronous function call in a group.
  7242. *
  7243. * Returns the same type as the function itself.
  7244. *
  7245. * @param name The name of the group
  7246. * @param fn The function to wrap in the group
  7247. */
  7248. function group(name, fn) {
  7249. return __awaiter(this, void 0, void 0, function* () {
  7250. startGroup(name);
  7251. let result;
  7252. try {
  7253. result = yield fn();
  7254. }
  7255. finally {
  7256. endGroup();
  7257. }
  7258. return result;
  7259. });
  7260. }
  7261. exports.group = group;
  7262. //# sourceMappingURL=core.js.map
  7263. /***/ }),
  7264. /***/ 471:
  7265. /***/ (function(module, __unusedexports, __webpack_require__) {
  7266. module.exports = authenticationBeforeRequest;
  7267. const btoa = __webpack_require__(675);
  7268. const uniq = __webpack_require__(126);
  7269. function authenticationBeforeRequest(state, options) {
  7270. if (!state.auth.type) {
  7271. return;
  7272. }
  7273. if (state.auth.type === "basic") {
  7274. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7275. options.headers.authorization = `Basic ${hash}`;
  7276. return;
  7277. }
  7278. if (state.auth.type === "token") {
  7279. options.headers.authorization = `token ${state.auth.token}`;
  7280. return;
  7281. }
  7282. if (state.auth.type === "app") {
  7283. options.headers.authorization = `Bearer ${state.auth.token}`;
  7284. const acceptHeaders = options.headers.accept
  7285. .split(",")
  7286. .concat("application/vnd.github.machine-man-preview+json");
  7287. options.headers.accept = uniq(acceptHeaders)
  7288. .filter(Boolean)
  7289. .join(",");
  7290. return;
  7291. }
  7292. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7293. if (state.auth.token) {
  7294. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7295. return;
  7296. }
  7297. const key = encodeURIComponent(state.auth.key);
  7298. const secret = encodeURIComponent(state.auth.secret);
  7299. options.url += `client_id=${key}&client_secret=${secret}`;
  7300. }
  7301. /***/ }),
  7302. /***/ 489:
  7303. /***/ (function(module, __unusedexports, __webpack_require__) {
  7304. "use strict";
  7305. const path = __webpack_require__(622);
  7306. const which = __webpack_require__(814);
  7307. const pathKey = __webpack_require__(39)();
  7308. function resolveCommandAttempt(parsed, withoutPathExt) {
  7309. const cwd = process.cwd();
  7310. const hasCustomCwd = parsed.options.cwd != null;
  7311. // If a custom `cwd` was specified, we need to change the process cwd
  7312. // because `which` will do stat calls but does not support a custom cwd
  7313. if (hasCustomCwd) {
  7314. try {
  7315. process.chdir(parsed.options.cwd);
  7316. } catch (err) {
  7317. /* Empty */
  7318. }
  7319. }
  7320. let resolved;
  7321. try {
  7322. resolved = which.sync(parsed.command, {
  7323. path: (parsed.options.env || process.env)[pathKey],
  7324. pathExt: withoutPathExt ? path.delimiter : undefined,
  7325. });
  7326. } catch (e) {
  7327. /* Empty */
  7328. } finally {
  7329. process.chdir(cwd);
  7330. }
  7331. // If we successfully resolved, ensure that an absolute path is returned
  7332. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7333. if (resolved) {
  7334. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7335. }
  7336. return resolved;
  7337. }
  7338. function resolveCommand(parsed) {
  7339. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7340. }
  7341. module.exports = resolveCommand;
  7342. /***/ }),
  7343. /***/ 510:
  7344. /***/ (function(module) {
  7345. module.exports = addHook
  7346. function addHook (state, kind, name, hook) {
  7347. var orig = hook
  7348. if (!state.registry[name]) {
  7349. state.registry[name] = []
  7350. }
  7351. if (kind === 'before') {
  7352. hook = function (method, options) {
  7353. return Promise.resolve()
  7354. .then(orig.bind(null, options))
  7355. .then(method.bind(null, options))
  7356. }
  7357. }
  7358. if (kind === 'after') {
  7359. hook = function (method, options) {
  7360. var result
  7361. return Promise.resolve()
  7362. .then(method.bind(null, options))
  7363. .then(function (result_) {
  7364. result = result_
  7365. return orig(result, options)
  7366. })
  7367. .then(function () {
  7368. return result
  7369. })
  7370. }
  7371. }
  7372. if (kind === 'error') {
  7373. hook = function (method, options) {
  7374. return Promise.resolve()
  7375. .then(method.bind(null, options))
  7376. .catch(function (error) {
  7377. return orig(error, options)
  7378. })
  7379. }
  7380. }
  7381. state.registry[name].push({
  7382. hook: hook,
  7383. orig: orig
  7384. })
  7385. }
  7386. /***/ }),
  7387. /***/ 523:
  7388. /***/ (function(module, __unusedexports, __webpack_require__) {
  7389. var register = __webpack_require__(363)
  7390. var addHook = __webpack_require__(510)
  7391. var removeHook = __webpack_require__(763)
  7392. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7393. var bind = Function.bind
  7394. var bindable = bind.bind(bind)
  7395. function bindApi (hook, state, name) {
  7396. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7397. hook.api = { remove: removeHookRef }
  7398. hook.remove = removeHookRef
  7399. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7400. var args = name ? [state, kind, name] : [state, kind]
  7401. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7402. })
  7403. }
  7404. function HookSingular () {
  7405. var singularHookName = 'h'
  7406. var singularHookState = {
  7407. registry: {}
  7408. }
  7409. var singularHook = register.bind(null, singularHookState, singularHookName)
  7410. bindApi(singularHook, singularHookState, singularHookName)
  7411. return singularHook
  7412. }
  7413. function HookCollection () {
  7414. var state = {
  7415. registry: {}
  7416. }
  7417. var hook = register.bind(null, state)
  7418. bindApi(hook, state)
  7419. return hook
  7420. }
  7421. var collectionHookDeprecationMessageDisplayed = false
  7422. function Hook () {
  7423. if (!collectionHookDeprecationMessageDisplayed) {
  7424. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7425. collectionHookDeprecationMessageDisplayed = true
  7426. }
  7427. return HookCollection()
  7428. }
  7429. Hook.Singular = HookSingular.bind()
  7430. Hook.Collection = HookCollection.bind()
  7431. module.exports = Hook
  7432. // expose constructors as a named property for TypeScript
  7433. module.exports.Hook = Hook
  7434. module.exports.Singular = Hook.Singular
  7435. module.exports.Collection = Hook.Collection
  7436. /***/ }),
  7437. /***/ 529:
  7438. /***/ (function(module, __unusedexports, __webpack_require__) {
  7439. const factory = __webpack_require__(47);
  7440. module.exports = factory();
  7441. /***/ }),
  7442. /***/ 536:
  7443. /***/ (function(module, __unusedexports, __webpack_require__) {
  7444. module.exports = hasFirstPage
  7445. const deprecate = __webpack_require__(370)
  7446. const getPageLinks = __webpack_require__(577)
  7447. function hasFirstPage (link) {
  7448. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7449. return getPageLinks(link).first
  7450. }
  7451. /***/ }),
  7452. /***/ 550:
  7453. /***/ (function(module, __unusedexports, __webpack_require__) {
  7454. module.exports = getNextPage
  7455. const getPage = __webpack_require__(265)
  7456. function getNextPage (octokit, link, headers) {
  7457. return getPage(octokit, link, 'next', headers)
  7458. }
  7459. /***/ }),
  7460. /***/ 558:
  7461. /***/ (function(module, __unusedexports, __webpack_require__) {
  7462. module.exports = hasPreviousPage
  7463. const deprecate = __webpack_require__(370)
  7464. const getPageLinks = __webpack_require__(577)
  7465. function hasPreviousPage (link) {
  7466. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7467. return getPageLinks(link).prev
  7468. }
  7469. /***/ }),
  7470. /***/ 559:
  7471. /***/ (function(__unusedmodule, exports) {
  7472. "use strict";
  7473. Object.defineProperty(exports, "__esModule", { value: true });
  7474. class GitVersion {
  7475. /**
  7476. * Used for comparing the version of git and git-lfs against the minimum required version
  7477. * @param version the version string, e.g. 1.2 or 1.2.3
  7478. */
  7479. constructor(version) {
  7480. this.major = NaN;
  7481. this.minor = NaN;
  7482. this.patch = NaN;
  7483. if (version) {
  7484. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  7485. if (match) {
  7486. this.major = Number(match[1]);
  7487. this.minor = Number(match[2]);
  7488. if (match[4]) {
  7489. this.patch = Number(match[4]);
  7490. }
  7491. }
  7492. }
  7493. }
  7494. /**
  7495. * Compares the instance against a minimum required version
  7496. * @param minimum Minimum version
  7497. */
  7498. checkMinimum(minimum) {
  7499. if (!minimum.isValid()) {
  7500. throw new Error('Arg minimum is not a valid version');
  7501. }
  7502. // Major is insufficient
  7503. if (this.major < minimum.major) {
  7504. return false;
  7505. }
  7506. // Major is equal
  7507. if (this.major === minimum.major) {
  7508. // Minor is insufficient
  7509. if (this.minor < minimum.minor) {
  7510. return false;
  7511. }
  7512. // Minor is equal
  7513. if (this.minor === minimum.minor) {
  7514. // Patch is insufficient
  7515. if (this.patch && this.patch < (minimum.patch || 0)) {
  7516. return false;
  7517. }
  7518. }
  7519. }
  7520. return true;
  7521. }
  7522. /**
  7523. * Indicates whether the instance was constructed from a valid version string
  7524. */
  7525. isValid() {
  7526. return !isNaN(this.major);
  7527. }
  7528. /**
  7529. * Returns the version as a string, e.g. 1.2 or 1.2.3
  7530. */
  7531. toString() {
  7532. let result = '';
  7533. if (this.isValid()) {
  7534. result = `${this.major}.${this.minor}`;
  7535. if (!isNaN(this.patch)) {
  7536. result += `.${this.patch}`;
  7537. }
  7538. }
  7539. return result;
  7540. }
  7541. }
  7542. exports.GitVersion = GitVersion;
  7543. /***/ }),
  7544. /***/ 562:
  7545. /***/ (function(module, __unusedexports, __webpack_require__) {
  7546. var once = __webpack_require__(969);
  7547. var noop = function() {};
  7548. var isRequest = function(stream) {
  7549. return stream.setHeader && typeof stream.abort === 'function';
  7550. };
  7551. var isChildProcess = function(stream) {
  7552. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  7553. };
  7554. var eos = function(stream, opts, callback) {
  7555. if (typeof opts === 'function') return eos(stream, null, opts);
  7556. if (!opts) opts = {};
  7557. callback = once(callback || noop);
  7558. var ws = stream._writableState;
  7559. var rs = stream._readableState;
  7560. var readable = opts.readable || (opts.readable !== false && stream.readable);
  7561. var writable = opts.writable || (opts.writable !== false && stream.writable);
  7562. var cancelled = false;
  7563. var onlegacyfinish = function() {
  7564. if (!stream.writable) onfinish();
  7565. };
  7566. var onfinish = function() {
  7567. writable = false;
  7568. if (!readable) callback.call(stream);
  7569. };
  7570. var onend = function() {
  7571. readable = false;
  7572. if (!writable) callback.call(stream);
  7573. };
  7574. var onexit = function(exitCode) {
  7575. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  7576. };
  7577. var onerror = function(err) {
  7578. callback.call(stream, err);
  7579. };
  7580. var onclose = function() {
  7581. process.nextTick(onclosenexttick);
  7582. };
  7583. var onclosenexttick = function() {
  7584. if (cancelled) return;
  7585. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  7586. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  7587. };
  7588. var onrequest = function() {
  7589. stream.req.on('finish', onfinish);
  7590. };
  7591. if (isRequest(stream)) {
  7592. stream.on('complete', onfinish);
  7593. stream.on('abort', onclose);
  7594. if (stream.req) onrequest();
  7595. else stream.on('request', onrequest);
  7596. } else if (writable && !ws) { // legacy streams
  7597. stream.on('end', onlegacyfinish);
  7598. stream.on('close', onlegacyfinish);
  7599. }
  7600. if (isChildProcess(stream)) stream.on('exit', onexit);
  7601. stream.on('end', onend);
  7602. stream.on('finish', onfinish);
  7603. if (opts.error !== false) stream.on('error', onerror);
  7604. stream.on('close', onclose);
  7605. return function() {
  7606. cancelled = true;
  7607. stream.removeListener('complete', onfinish);
  7608. stream.removeListener('abort', onclose);
  7609. stream.removeListener('request', onrequest);
  7610. if (stream.req) stream.req.removeListener('finish', onfinish);
  7611. stream.removeListener('end', onlegacyfinish);
  7612. stream.removeListener('close', onlegacyfinish);
  7613. stream.removeListener('finish', onfinish);
  7614. stream.removeListener('exit', onexit);
  7615. stream.removeListener('end', onend);
  7616. stream.removeListener('error', onerror);
  7617. stream.removeListener('close', onclose);
  7618. };
  7619. };
  7620. module.exports = eos;
  7621. /***/ }),
  7622. /***/ 563:
  7623. /***/ (function(module, __unusedexports, __webpack_require__) {
  7624. module.exports = getPreviousPage
  7625. const getPage = __webpack_require__(265)
  7626. function getPreviousPage (octokit, link, headers) {
  7627. return getPage(octokit, link, 'prev', headers)
  7628. }
  7629. /***/ }),
  7630. /***/ 568:
  7631. /***/ (function(module, __unusedexports, __webpack_require__) {
  7632. "use strict";
  7633. const path = __webpack_require__(622);
  7634. const niceTry = __webpack_require__(948);
  7635. const resolveCommand = __webpack_require__(489);
  7636. const escape = __webpack_require__(462);
  7637. const readShebang = __webpack_require__(389);
  7638. const semver = __webpack_require__(280);
  7639. const isWin = process.platform === 'win32';
  7640. const isExecutableRegExp = /\.(?:com|exe)$/i;
  7641. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  7642. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  7643. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  7644. function detectShebang(parsed) {
  7645. parsed.file = resolveCommand(parsed);
  7646. const shebang = parsed.file && readShebang(parsed.file);
  7647. if (shebang) {
  7648. parsed.args.unshift(parsed.file);
  7649. parsed.command = shebang;
  7650. return resolveCommand(parsed);
  7651. }
  7652. return parsed.file;
  7653. }
  7654. function parseNonShell(parsed) {
  7655. if (!isWin) {
  7656. return parsed;
  7657. }
  7658. // Detect & add support for shebangs
  7659. const commandFile = detectShebang(parsed);
  7660. // We don't need a shell if the command filename is an executable
  7661. const needsShell = !isExecutableRegExp.test(commandFile);
  7662. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  7663. // Note that `forceShell` is an hidden option used only in tests
  7664. if (parsed.options.forceShell || needsShell) {
  7665. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  7666. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  7667. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  7668. // we need to double escape them
  7669. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  7670. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  7671. // This is necessary otherwise it will always fail with ENOENT in those cases
  7672. parsed.command = path.normalize(parsed.command);
  7673. // Escape command & arguments
  7674. parsed.command = escape.command(parsed.command);
  7675. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  7676. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7677. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7678. parsed.command = process.env.comspec || 'cmd.exe';
  7679. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7680. }
  7681. return parsed;
  7682. }
  7683. function parseShell(parsed) {
  7684. // If node supports the shell option, there's no need to mimic its behavior
  7685. if (supportsShellOption) {
  7686. return parsed;
  7687. }
  7688. // Mimic node shell option
  7689. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  7690. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7691. if (isWin) {
  7692. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  7693. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7694. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7695. } else {
  7696. if (typeof parsed.options.shell === 'string') {
  7697. parsed.command = parsed.options.shell;
  7698. } else if (process.platform === 'android') {
  7699. parsed.command = '/system/bin/sh';
  7700. } else {
  7701. parsed.command = '/bin/sh';
  7702. }
  7703. parsed.args = ['-c', shellCommand];
  7704. }
  7705. return parsed;
  7706. }
  7707. function parse(command, args, options) {
  7708. // Normalize arguments, similar to nodejs
  7709. if (args && !Array.isArray(args)) {
  7710. options = args;
  7711. args = null;
  7712. }
  7713. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  7714. options = Object.assign({}, options); // Clone object to avoid changing the original
  7715. // Build our parsed object
  7716. const parsed = {
  7717. command,
  7718. args,
  7719. options,
  7720. file: undefined,
  7721. original: {
  7722. command,
  7723. args,
  7724. },
  7725. };
  7726. // Delegate further parsing to shell or non-shell
  7727. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  7728. }
  7729. module.exports = parse;
  7730. /***/ }),
  7731. /***/ 577:
  7732. /***/ (function(module) {
  7733. module.exports = getPageLinks
  7734. function getPageLinks (link) {
  7735. link = link.link || link.headers.link || ''
  7736. const links = {}
  7737. // link format:
  7738. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  7739. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  7740. links[type] = uri
  7741. })
  7742. return links
  7743. }
  7744. /***/ }),
  7745. /***/ 586:
  7746. /***/ (function(module, __unusedexports, __webpack_require__) {
  7747. module.exports = octokitRestApiEndpoints;
  7748. const ROUTES = __webpack_require__(705);
  7749. function octokitRestApiEndpoints(octokit) {
  7750. // Aliasing scopes for backward compatibility
  7751. // See https://github.com/octokit/rest.js/pull/1134
  7752. ROUTES.gitdata = ROUTES.git;
  7753. ROUTES.authorization = ROUTES.oauthAuthorizations;
  7754. ROUTES.pullRequests = ROUTES.pulls;
  7755. octokit.registerEndpoints(ROUTES);
  7756. }
  7757. /***/ }),
  7758. /***/ 605:
  7759. /***/ (function(module) {
  7760. module.exports = require("http");
  7761. /***/ }),
  7762. /***/ 614:
  7763. /***/ (function(module) {
  7764. module.exports = require("events");
  7765. /***/ }),
  7766. /***/ 618:
  7767. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7768. "use strict";
  7769. var __importStar = (this && this.__importStar) || function (mod) {
  7770. if (mod && mod.__esModule) return mod;
  7771. var result = {};
  7772. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7773. result["default"] = mod;
  7774. return result;
  7775. };
  7776. Object.defineProperty(exports, "__esModule", { value: true });
  7777. const fs = __importStar(__webpack_require__(747));
  7778. function directoryExistsSync(path, required) {
  7779. if (!path) {
  7780. throw new Error("Arg 'path' must not be empty");
  7781. }
  7782. let stats;
  7783. try {
  7784. stats = fs.statSync(path);
  7785. }
  7786. catch (error) {
  7787. if (error.code === 'ENOENT') {
  7788. if (!required) {
  7789. return false;
  7790. }
  7791. throw new Error(`Directory '${path}' does not exist`);
  7792. }
  7793. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7794. }
  7795. if (stats.isDirectory()) {
  7796. return true;
  7797. }
  7798. else if (!required) {
  7799. return false;
  7800. }
  7801. throw new Error(`Directory '${path}' does not exist`);
  7802. }
  7803. exports.directoryExistsSync = directoryExistsSync;
  7804. function existsSync(path) {
  7805. if (!path) {
  7806. throw new Error("Arg 'path' must not be empty");
  7807. }
  7808. try {
  7809. fs.statSync(path);
  7810. }
  7811. catch (error) {
  7812. if (error.code === 'ENOENT') {
  7813. return false;
  7814. }
  7815. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7816. }
  7817. return true;
  7818. }
  7819. exports.existsSync = existsSync;
  7820. function fileExistsSync(path) {
  7821. if (!path) {
  7822. throw new Error("Arg 'path' must not be empty");
  7823. }
  7824. let stats;
  7825. try {
  7826. stats = fs.statSync(path);
  7827. }
  7828. catch (error) {
  7829. if (error.code === 'ENOENT') {
  7830. return false;
  7831. }
  7832. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7833. }
  7834. if (!stats.isDirectory()) {
  7835. return true;
  7836. }
  7837. return false;
  7838. }
  7839. exports.fileExistsSync = fileExistsSync;
  7840. /***/ }),
  7841. /***/ 621:
  7842. /***/ (function(module, __unusedexports, __webpack_require__) {
  7843. "use strict";
  7844. const path = __webpack_require__(622);
  7845. const pathKey = __webpack_require__(39);
  7846. module.exports = opts => {
  7847. opts = Object.assign({
  7848. cwd: process.cwd(),
  7849. path: process.env[pathKey()]
  7850. }, opts);
  7851. let prev;
  7852. let pth = path.resolve(opts.cwd);
  7853. const ret = [];
  7854. while (prev !== pth) {
  7855. ret.push(path.join(pth, 'node_modules/.bin'));
  7856. prev = pth;
  7857. pth = path.resolve(pth, '..');
  7858. }
  7859. // ensure the running `node` binary is used
  7860. ret.push(path.dirname(process.execPath));
  7861. return ret.concat(opts.path).join(path.delimiter);
  7862. };
  7863. module.exports.env = opts => {
  7864. opts = Object.assign({
  7865. env: process.env
  7866. }, opts);
  7867. const env = Object.assign({}, opts.env);
  7868. const path = pathKey({env});
  7869. opts.path = env[path];
  7870. env[path] = module.exports(opts);
  7871. return env;
  7872. };
  7873. /***/ }),
  7874. /***/ 622:
  7875. /***/ (function(module) {
  7876. module.exports = require("path");
  7877. /***/ }),
  7878. /***/ 649:
  7879. /***/ (function(module, __unusedexports, __webpack_require__) {
  7880. module.exports = getLastPage
  7881. const getPage = __webpack_require__(265)
  7882. function getLastPage (octokit, link, headers) {
  7883. return getPage(octokit, link, 'last', headers)
  7884. }
  7885. /***/ }),
  7886. /***/ 654:
  7887. /***/ (function(module) {
  7888. // This is not the set of all possible signals.
  7889. //
  7890. // It IS, however, the set of all signals that trigger
  7891. // an exit on either Linux or BSD systems. Linux is a
  7892. // superset of the signal names supported on BSD, and
  7893. // the unknown signals just fail to register, so we can
  7894. // catch that easily enough.
  7895. //
  7896. // Don't bother with SIGKILL. It's uncatchable, which
  7897. // means that we can't fire any callbacks anyway.
  7898. //
  7899. // If a user does happen to register a handler on a non-
  7900. // fatal signal like SIGWINCH or something, and then
  7901. // exit, it'll end up firing `process.emit('exit')`, so
  7902. // the handler will be fired anyway.
  7903. //
  7904. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  7905. // artificially, inherently leave the process in a
  7906. // state from which it is not safe to try and enter JS
  7907. // listeners.
  7908. module.exports = [
  7909. 'SIGABRT',
  7910. 'SIGALRM',
  7911. 'SIGHUP',
  7912. 'SIGINT',
  7913. 'SIGTERM'
  7914. ]
  7915. if (process.platform !== 'win32') {
  7916. module.exports.push(
  7917. 'SIGVTALRM',
  7918. 'SIGXCPU',
  7919. 'SIGXFSZ',
  7920. 'SIGUSR2',
  7921. 'SIGTRAP',
  7922. 'SIGSYS',
  7923. 'SIGQUIT',
  7924. 'SIGIOT'
  7925. // should detect profiler and enable/disable accordingly.
  7926. // see #21
  7927. // 'SIGPROF'
  7928. )
  7929. }
  7930. if (process.platform === 'linux') {
  7931. module.exports.push(
  7932. 'SIGIO',
  7933. 'SIGPOLL',
  7934. 'SIGPWR',
  7935. 'SIGSTKFLT',
  7936. 'SIGUNUSED'
  7937. )
  7938. }
  7939. /***/ }),
  7940. /***/ 669:
  7941. /***/ (function(module) {
  7942. module.exports = require("util");
  7943. /***/ }),
  7944. /***/ 672:
  7945. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7946. "use strict";
  7947. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7948. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7949. return new (P || (P = Promise))(function (resolve, reject) {
  7950. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7951. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7952. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7953. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7954. });
  7955. };
  7956. var _a;
  7957. Object.defineProperty(exports, "__esModule", { value: true });
  7958. const assert_1 = __webpack_require__(357);
  7959. const fs = __webpack_require__(747);
  7960. const path = __webpack_require__(622);
  7961. _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;
  7962. exports.IS_WINDOWS = process.platform === 'win32';
  7963. function exists(fsPath) {
  7964. return __awaiter(this, void 0, void 0, function* () {
  7965. try {
  7966. yield exports.stat(fsPath);
  7967. }
  7968. catch (err) {
  7969. if (err.code === 'ENOENT') {
  7970. return false;
  7971. }
  7972. throw err;
  7973. }
  7974. return true;
  7975. });
  7976. }
  7977. exports.exists = exists;
  7978. function isDirectory(fsPath, useStat = false) {
  7979. return __awaiter(this, void 0, void 0, function* () {
  7980. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  7981. return stats.isDirectory();
  7982. });
  7983. }
  7984. exports.isDirectory = isDirectory;
  7985. /**
  7986. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  7987. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  7988. */
  7989. function isRooted(p) {
  7990. p = normalizeSeparators(p);
  7991. if (!p) {
  7992. throw new Error('isRooted() parameter "p" cannot be empty');
  7993. }
  7994. if (exports.IS_WINDOWS) {
  7995. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  7996. ); // e.g. C: or C:\hello
  7997. }
  7998. return p.startsWith('/');
  7999. }
  8000. exports.isRooted = isRooted;
  8001. /**
  8002. * Recursively create a directory at `fsPath`.
  8003. *
  8004. * This implementation is optimistic, meaning it attempts to create the full
  8005. * path first, and backs up the path stack from there.
  8006. *
  8007. * @param fsPath The path to create
  8008. * @param maxDepth The maximum recursion depth
  8009. * @param depth The current recursion depth
  8010. */
  8011. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  8012. return __awaiter(this, void 0, void 0, function* () {
  8013. assert_1.ok(fsPath, 'a path argument must be provided');
  8014. fsPath = path.resolve(fsPath);
  8015. if (depth >= maxDepth)
  8016. return exports.mkdir(fsPath);
  8017. try {
  8018. yield exports.mkdir(fsPath);
  8019. return;
  8020. }
  8021. catch (err) {
  8022. switch (err.code) {
  8023. case 'ENOENT': {
  8024. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  8025. yield exports.mkdir(fsPath);
  8026. return;
  8027. }
  8028. default: {
  8029. let stats;
  8030. try {
  8031. stats = yield exports.stat(fsPath);
  8032. }
  8033. catch (err2) {
  8034. throw err;
  8035. }
  8036. if (!stats.isDirectory())
  8037. throw err;
  8038. }
  8039. }
  8040. }
  8041. });
  8042. }
  8043. exports.mkdirP = mkdirP;
  8044. /**
  8045. * Best effort attempt to determine whether a file exists and is executable.
  8046. * @param filePath file path to check
  8047. * @param extensions additional file extensions to try
  8048. * @return if file exists and is executable, returns the file path. otherwise empty string.
  8049. */
  8050. function tryGetExecutablePath(filePath, extensions) {
  8051. return __awaiter(this, void 0, void 0, function* () {
  8052. let stats = undefined;
  8053. try {
  8054. // test file exists
  8055. stats = yield exports.stat(filePath);
  8056. }
  8057. catch (err) {
  8058. if (err.code !== 'ENOENT') {
  8059. // eslint-disable-next-line no-console
  8060. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8061. }
  8062. }
  8063. if (stats && stats.isFile()) {
  8064. if (exports.IS_WINDOWS) {
  8065. // on Windows, test for valid extension
  8066. const upperExt = path.extname(filePath).toUpperCase();
  8067. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  8068. return filePath;
  8069. }
  8070. }
  8071. else {
  8072. if (isUnixExecutable(stats)) {
  8073. return filePath;
  8074. }
  8075. }
  8076. }
  8077. // try each extension
  8078. const originalFilePath = filePath;
  8079. for (const extension of extensions) {
  8080. filePath = originalFilePath + extension;
  8081. stats = undefined;
  8082. try {
  8083. stats = yield exports.stat(filePath);
  8084. }
  8085. catch (err) {
  8086. if (err.code !== 'ENOENT') {
  8087. // eslint-disable-next-line no-console
  8088. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8089. }
  8090. }
  8091. if (stats && stats.isFile()) {
  8092. if (exports.IS_WINDOWS) {
  8093. // preserve the case of the actual file (since an extension was appended)
  8094. try {
  8095. const directory = path.dirname(filePath);
  8096. const upperName = path.basename(filePath).toUpperCase();
  8097. for (const actualName of yield exports.readdir(directory)) {
  8098. if (upperName === actualName.toUpperCase()) {
  8099. filePath = path.join(directory, actualName);
  8100. break;
  8101. }
  8102. }
  8103. }
  8104. catch (err) {
  8105. // eslint-disable-next-line no-console
  8106. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  8107. }
  8108. return filePath;
  8109. }
  8110. else {
  8111. if (isUnixExecutable(stats)) {
  8112. return filePath;
  8113. }
  8114. }
  8115. }
  8116. }
  8117. return '';
  8118. });
  8119. }
  8120. exports.tryGetExecutablePath = tryGetExecutablePath;
  8121. function normalizeSeparators(p) {
  8122. p = p || '';
  8123. if (exports.IS_WINDOWS) {
  8124. // convert slashes on Windows
  8125. p = p.replace(/\//g, '\\');
  8126. // remove redundant slashes
  8127. return p.replace(/\\\\+/g, '\\');
  8128. }
  8129. // remove redundant slashes
  8130. return p.replace(/\/\/+/g, '/');
  8131. }
  8132. // on Mac/Linux, test the execute bit
  8133. // R W X R W X R W X
  8134. // 256 128 64 32 16 8 4 2 1
  8135. function isUnixExecutable(stats) {
  8136. return ((stats.mode & 1) > 0 ||
  8137. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  8138. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  8139. }
  8140. //# sourceMappingURL=io-util.js.map
  8141. /***/ }),
  8142. /***/ 674:
  8143. /***/ (function(module, __unusedexports, __webpack_require__) {
  8144. module.exports = authenticate;
  8145. const { Deprecation } = __webpack_require__(692);
  8146. const once = __webpack_require__(969);
  8147. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  8148. function authenticate(state, options) {
  8149. deprecateAuthenticate(
  8150. state.octokit.log,
  8151. new Deprecation(
  8152. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  8153. )
  8154. );
  8155. if (!options) {
  8156. state.auth = false;
  8157. return;
  8158. }
  8159. switch (options.type) {
  8160. case "basic":
  8161. if (!options.username || !options.password) {
  8162. throw new Error(
  8163. "Basic authentication requires both a username and password to be set"
  8164. );
  8165. }
  8166. break;
  8167. case "oauth":
  8168. if (!options.token && !(options.key && options.secret)) {
  8169. throw new Error(
  8170. "OAuth2 authentication requires a token or key & secret to be set"
  8171. );
  8172. }
  8173. break;
  8174. case "token":
  8175. case "app":
  8176. if (!options.token) {
  8177. throw new Error("Token authentication requires a token to be set");
  8178. }
  8179. break;
  8180. default:
  8181. throw new Error(
  8182. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  8183. );
  8184. }
  8185. state.auth = options;
  8186. }
  8187. /***/ }),
  8188. /***/ 675:
  8189. /***/ (function(module) {
  8190. module.exports = function btoa(str) {
  8191. return new Buffer(str).toString('base64')
  8192. }
  8193. /***/ }),
  8194. /***/ 692:
  8195. /***/ (function(__unusedmodule, exports) {
  8196. "use strict";
  8197. Object.defineProperty(exports, '__esModule', { value: true });
  8198. class Deprecation extends Error {
  8199. constructor(message) {
  8200. super(message); // Maintains proper stack trace (only available on V8)
  8201. /* istanbul ignore next */
  8202. if (Error.captureStackTrace) {
  8203. Error.captureStackTrace(this, this.constructor);
  8204. }
  8205. this.name = 'Deprecation';
  8206. }
  8207. }
  8208. exports.Deprecation = Deprecation;
  8209. /***/ }),
  8210. /***/ 696:
  8211. /***/ (function(module) {
  8212. "use strict";
  8213. /*!
  8214. * isobject <https://github.com/jonschlinkert/isobject>
  8215. *
  8216. * Copyright (c) 2014-2017, Jon Schlinkert.
  8217. * Released under the MIT License.
  8218. */
  8219. function isObject(val) {
  8220. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  8221. }
  8222. /*!
  8223. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  8224. *
  8225. * Copyright (c) 2014-2017, Jon Schlinkert.
  8226. * Released under the MIT License.
  8227. */
  8228. function isObjectObject(o) {
  8229. return isObject(o) === true
  8230. && Object.prototype.toString.call(o) === '[object Object]';
  8231. }
  8232. function isPlainObject(o) {
  8233. var ctor,prot;
  8234. if (isObjectObject(o) === false) return false;
  8235. // If has modified constructor
  8236. ctor = o.constructor;
  8237. if (typeof ctor !== 'function') return false;
  8238. // If has modified prototype
  8239. prot = ctor.prototype;
  8240. if (isObjectObject(prot) === false) return false;
  8241. // If constructor does not have an Object-specific method
  8242. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  8243. return false;
  8244. }
  8245. // Most likely a plain Object
  8246. return true;
  8247. }
  8248. module.exports = isPlainObject;
  8249. /***/ }),
  8250. /***/ 697:
  8251. /***/ (function(module) {
  8252. "use strict";
  8253. module.exports = (promise, onFinally) => {
  8254. onFinally = onFinally || (() => {});
  8255. return promise.then(
  8256. val => new Promise(resolve => {
  8257. resolve(onFinally());
  8258. }).then(() => val),
  8259. err => new Promise(resolve => {
  8260. resolve(onFinally());
  8261. }).then(() => {
  8262. throw err;
  8263. })
  8264. );
  8265. };
  8266. /***/ }),
  8267. /***/ 705:
  8268. /***/ (function(module) {
  8269. module.exports = {"activity":{"checkStarringRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"deleteRepoSubscription":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"deleteThreadSubscription":{"method":"DELETE","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"getRepoSubscription":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"getThread":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"getThreadSubscription":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"listEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/orgs/:org"},"listEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events"},"listFeeds":{"method":"GET","params":{},"url":"/feeds"},"listNotifications":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/notifications"},"listNotificationsForRepo":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"listPublicEvents":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/events"},"listPublicEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/events"},"listPublicEventsForRepoNetwork":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/networks/:owner/:repo/events"},"listPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/public"},"listReceivedEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events"},"listReceivedPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events/public"},"listRepoEvents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/events"},"listReposStarredByAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/user/starred"},"listReposStarredByUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/starred"},"listReposWatchedByUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/subscriptions"},"listStargazersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stargazers"},"listWatchedReposForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/subscriptions"},"listWatchersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscribers"},"markAsRead":{"method":"PUT","params":{"last_read_at":{"type":"string"}},"url":"/notifications"},"markNotificationsAsReadForRepo":{"method":"PUT","params":{"last_read_at":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"markThreadAsRead":{"method":"PATCH","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"setRepoSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"subscribed":{"type":"boolean"}},"url":"/repos/:owner/:repo/subscription"},"setThreadSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"starRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"unstarRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"}},"apps":{"addRepoToInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"PUT","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"checkAccountIsAssociatedWithAny":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/accounts/:account_id"},"checkAccountIsAssociatedWithAnyStubbed":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/accounts/:account_id"},"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"checkToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"POST","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"createContentAttachment":{"headers":{"accept":"application/vnd.github.corsair-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"content_reference_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/content_references/:content_reference_id/attachments"},"createFromManifest":{"headers":{"accept":"application/vnd.github.fury-preview+json"},"method":"POST","params":{"code":{"required":true,"type":"string"}},"url":"/app-manifests/:code/conversions"},"createInstallationToken":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"POST","params":{"installation_id":{"required":true,"type":"integer"},"permissions":{"type":"object"},"repository_ids":{"type":"integer[]"}},"url":"/app/installations/:installation_id/access_tokens"},"deleteAuthorization":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grant"},"deleteInstallation":{"headers":{"accept":"application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"deleteToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"findOrgInstallation":{"deprecated":"octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"findRepoInstallation":{"deprecated":"octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"findUserInstallation":{"deprecated":"octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"getAuthenticated":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{},"url":"/app"},"getBySlug":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"app_slug":{"required":true,"type":"string"}},"url":"/apps/:app_slug"},"getInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"getOrgInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"getRepoInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"getUserInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"listAccountsUserOrOrgOnPlan":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/plans/:plan_id/accounts"},"listAccountsUserOrOrgOnPlanStubbed":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/stubbed/plans/:plan_id/accounts"},"listInstallationReposForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations/:installation_id/repositories"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/app/installations"},"listInstallationsForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations"},"listMarketplacePurchasesForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases"},"listMarketplacePurchasesForAuthenticatedUserStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases/stubbed"},"listPlans":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/plans"},"listPlansStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/plans"},"listRepos":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/installation/repositories"},"removeRepoFromInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"resetToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"PATCH","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"}},"checks":{"create":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"head_sha":{"required":true,"type":"string"},"name":{"required":true,"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs"},"createSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"head_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites"},"get":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"},"getSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id"},"listAnnotations":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id/annotations"},"listForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-runs"},"listForSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"check_suite_id":{"required":true,"type":"integer"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"},"listSuitesForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"app_id":{"type":"integer"},"check_name":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-suites"},"rerequestSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"},"setSuitesPreferences":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"auto_trigger_checks":{"type":"object[]"},"auto_trigger_checks[].app_id":{"required":true,"type":"integer"},"auto_trigger_checks[].setting":{"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/preferences"},"update":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"check_run_id":{"required":true,"type":"integer"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"}},"codesOfConduct":{"getConductCode":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"key":{"required":true,"type":"string"}},"url":"/codes_of_conduct/:key"},"getForRepo":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/code_of_conduct"},"listConductCodes":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{},"url":"/codes_of_conduct"}},"emojis":{"get":{"method":"GET","params":{},"url":"/emojis"}},"gists":{"checkIsStarred":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"create":{"method":"POST","params":{"description":{"type":"string"},"files":{"required":true,"type":"object"},"files.content":{"type":"string"},"public":{"type":"boolean"}},"url":"/gists"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments"},"delete":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"fork":{"method":"POST","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/forks"},"get":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"getRevision":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/gists/:gist_id/:sha"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists"},"listComments":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/comments"},"listCommits":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/commits"},"listForks":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/forks"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/public"},"listPublicForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gists"},"listStarred":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/starred"},"star":{"method":"PUT","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"unstar":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"files":{"type":"object"},"files.content":{"type":"string"},"files.filename":{"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"}},"git":{"createBlob":{"method":"POST","params":{"content":{"required":true,"type":"string"},"encoding":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs"},"createCommit":{"method":"POST","params":{"author":{"type":"object"},"author.date":{"type":"string"},"author.email":{"type":"string"},"author.name":{"type":"string"},"committer":{"type":"object"},"committer.date":{"type":"string"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"parents":{"required":true,"type":"string[]"},"repo":{"required":true,"type":"string"},"signature":{"type":"string"},"tree":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits"},"createRef":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs"},"createTag":{"method":"POST","params":{"message":{"required":true,"type":"string"},"object":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"},"tagger":{"type":"object"},"tagger.date":{"type":"string"},"tagger.email":{"type":"string"},"tagger.name":{"type":"string"},"type":{"enum":["commit","tree","blob"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags"},"createTree":{"method":"POST","params":{"base_tree":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tree":{"required":true,"type":"object[]"},"tree[].content":{"type":"string"},"tree[].mode":{"enum":["100644","100755","040000","160000","120000"],"type":"string"},"tree[].path":{"type":"string"},"tree[].sha":{"allowNull":true,"type":"string"},"tree[].type":{"enum":["blob","tree","commit"],"type":"string"}},"url":"/repos/:owner/:repo/git/trees"},"deleteRef":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"},"getBlob":{"method":"GET","params":{"file_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs/:file_sha"},"getCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits/:commit_sha"},"getRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/ref/:ref"},"getTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags/:tag_sha"},"getTree":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"recursive":{"enum":["1"],"type":"integer"},"repo":{"required":true,"type":"string"},"tree_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/trees/:tree_sha"},"listMatchingRefs":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/matching-refs/:ref"},"listRefs":{"method":"GET","params":{"namespace":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:namespace"},"updateRef":{"method":"PATCH","params":{"force":{"type":"boolean"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"}},"gitignore":{"getTemplate":{"method":"GET","params":{"name":{"required":true,"type":"string"}},"url":"/gitignore/templates/:name"},"listTemplates":{"method":"GET","params":{},"url":"/gitignore/templates"}},"interactions":{"addOrUpdateRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"addOrUpdateRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"getRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"getRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"removeRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"removeRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"}},"issues":{"addAssignees":{"method":"POST","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"addLabels":{"method":"POST","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"required":true,"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"checkAssignee":{"method":"GET","params":{"assignee":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees/:assignee"},"create":{"method":"POST","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"labels":{"type":"string[]"},"milestone":{"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"createLabel":{"method":"POST","params":{"color":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"createMilestone":{"method":"POST","params":{"description":{"type":"string"},"due_on":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"deleteLabel":{"method":"DELETE","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"deleteMilestone":{"method":"DELETE","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"get":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"getEvent":{"method":"GET","params":{"event_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events/:event_id"},"getLabel":{"method":"GET","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"getMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"list":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/issues"},"listAssignees":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees"},"listComments":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/issues/comments"},"listEvents":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/events"},"listEventsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events"},"listEventsForTimeline":{"headers":{"accept":"application/vnd.github.mockingbird-preview+json"},"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/timeline"},"listForAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/user/issues"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/issues"},"listForRepo":{"method":"GET","params":{"assignee":{"type":"string"},"creator":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"labels":{"type":"string"},"mentioned":{"type":"string"},"milestone":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/issues"},"listLabelsForMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number/labels"},"listLabelsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"listLabelsOnIssue":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"listMilestonesForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["due_on","completeness"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"lock":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"lock_reason":{"enum":["off-topic","too heated","resolved","spam"],"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"removeAssignees":{"method":"DELETE","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"removeLabel":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels/:name"},"removeLabels":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"replaceLabels":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"unlock":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"update":{"method":"PATCH","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"milestone":{"allowNull":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"updateLabel":{"method":"PATCH","params":{"color":{"type":"string"},"current_name":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:current_name"},"updateMilestone":{"method":"PATCH","params":{"description":{"type":"string"},"due_on":{"type":"string"},"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"}},"licenses":{"get":{"method":"GET","params":{"license":{"required":true,"type":"string"}},"url":"/licenses/:license"},"getForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/license"},"list":{"deprecated":"octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)","method":"GET","params":{},"url":"/licenses"},"listCommonlyUsed":{"method":"GET","params":{},"url":"/licenses"}},"markdown":{"render":{"method":"POST","params":{"context":{"type":"string"},"mode":{"enum":["markdown","gfm"],"type":"string"},"text":{"required":true,"type":"string"}},"url":"/markdown"},"renderRaw":{"headers":{"content-type":"text/plain; charset=utf-8"},"method":"POST","params":{"data":{"mapTo":"data","required":true,"type":"string"}},"url":"/markdown/raw"}},"meta":{"get":{"method":"GET","params":{},"url":"/meta"}},"migrations":{"cancelImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"deleteArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"deleteArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"getArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getCommitAuthors":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/large_files"},"getStatusForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id"},"getStatusForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id"},"listForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/migrations"},"listForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations"},"mapCommitAuthor":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"author_id":{"required":true,"type":"integer"},"email":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/authors/:author_id"},"setLfsPreference":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"use_lfs":{"enum":["opt_in","opt_out"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/lfs"},"startForAuthenticatedUser":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"repositories":{"required":true,"type":"string[]"}},"url":"/user/migrations"},"startForOrg":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"org":{"required":true,"type":"string"},"repositories":{"required":true,"type":"string[]"}},"url":"/orgs/:org/migrations"},"startImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tfvc_project":{"type":"string"},"vcs":{"enum":["subversion","git","mercurial","tfvc"],"type":"string"},"vcs_password":{"type":"string"},"vcs_url":{"required":true,"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"},"unlockRepoForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"repo_name":{"required":true,"type":"string"}},"url":"/user/migrations/:migration_id/repos/:repo_name/lock"},"unlockRepoForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"repo_name":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"},"updateImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"vcs_password":{"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"}},"oauthAuthorizations":{"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"createAuthorization":{"deprecated":"octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization","method":"POST","params":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"fingerprint":{"type":"string"},"note":{"required":true,"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations"},"deleteAuthorization":{"deprecated":"octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization","method":"DELETE","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"deleteGrant":{"deprecated":"octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant","method":"DELETE","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getAuthorization":{"deprecated":"octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization","method":"GET","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"getGrant":{"deprecated":"octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant","method":"GET","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getOrCreateAuthorizationForApp":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id"},"getOrCreateAuthorizationForAppAndFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"getOrCreateAuthorizationForAppFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"listAuthorizations":{"deprecated":"octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/authorizations"},"listGrants":{"deprecated":"octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/applications/grants"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"updateAuthorization":{"deprecated":"octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization","method":"PATCH","params":{"add_scopes":{"type":"string[]"},"authorization_id":{"required":true,"type":"integer"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"remove_scopes":{"type":"string[]"},"scopes":{"type":"string[]"}},"url":"/authorizations/:authorization_id"}},"orgs":{"addOrUpdateMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["admin","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"blockUser":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkBlockedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"checkPublicMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"concealMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"convertMemberToOutsideCollaborator":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks"},"createInvitation":{"method":"POST","params":{"email":{"type":"string"},"invitee_id":{"type":"integer"},"org":{"required":true,"type":"string"},"role":{"enum":["admin","direct_member","billing_manager"],"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/orgs/:org/invitations"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"get":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"getMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"getMembershipForAuthenticatedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/organizations"},"listBlockedUsers":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/orgs"},"listForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/orgs"},"listHooks":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/hooks"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/installations"},"listInvitationTeams":{"method":"GET","params":{"invitation_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations/:invitation_id/teams"},"listMembers":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["all","admin","member"],"type":"string"}},"url":"/orgs/:org/members"},"listMemberships":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["active","pending"],"type":"string"}},"url":"/user/memberships/orgs"},"listOutsideCollaborators":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/outside_collaborators"},"listPendingInvitations":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations"},"listPublicMembers":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/public_members"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id/pings"},"publicizeMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"removeMember":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"removeMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"removeOutsideCollaborator":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"unblockUser":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"update":{"method":"PATCH","params":{"billing_email":{"type":"string"},"company":{"type":"string"},"default_repository_permission":{"enum":["read","write","admin","none"],"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"has_organization_projects":{"type":"boolean"},"has_repository_projects":{"type":"boolean"},"location":{"type":"string"},"members_allowed_repository_creation_type":{"enum":["all","private","none"],"type":"string"},"members_can_create_repositories":{"type":"boolean"},"name":{"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"updateMembership":{"method":"PATCH","params":{"org":{"required":true,"type":"string"},"state":{"enum":["active"],"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"}},"projects":{"addCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"createCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"content_id":{"type":"integer"},"content_type":{"type":"string"},"note":{"type":"string"}},"url":"/projects/columns/:column_id/cards"},"createColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"name":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"createForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"}},"url":"/user/projects"},"createForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/projects"},"createForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/projects"},"delete":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"deleteCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"deleteColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"get":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"getCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"getColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"listCards":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"archived_state":{"enum":["all","archived","not_archived"],"type":"string"},"column_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/projects/columns/:column_id/cards"},"listCollaborators":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/collaborators"},"listColumns":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"listForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/projects"},"listForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/projects"},"listForUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/projects"},"moveCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"card_id":{"required":true,"type":"integer"},"column_id":{"type":"integer"},"position":{"required":true,"type":"string","validation":"^(top|bottom|after:\\d+)$"}},"url":"/projects/columns/cards/:card_id/moves"},"moveColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"position":{"required":true,"type":"string","validation":"^(first|last|after:\\d+)$"}},"url":"/projects/columns/:column_id/moves"},"removeCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"reviewUserPermissionLevel":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username/permission"},"update":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"name":{"type":"string"},"organization_permission":{"type":"string"},"private":{"type":"boolean"},"project_id":{"required":true,"type":"integer"},"state":{"enum":["open","closed"],"type":"string"}},"url":"/projects/:project_id"},"updateCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"archived":{"type":"boolean"},"card_id":{"required":true,"type":"integer"},"note":{"type":"string"}},"url":"/projects/columns/cards/:card_id"},"updateColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"column_id":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"}},"url":"/projects/columns/:column_id"}},"pulls":{"checkIfMerged":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"create":{"method":"POST","params":{"base":{"required":true,"type":"string"},"body":{"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createCommentReply":{"deprecated":"octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)","method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createFromIssue":{"deprecated":"octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request","method":"POST","params":{"base":{"required":true,"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"issue":{"required":true,"type":"integer"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createReview":{"method":"POST","params":{"body":{"type":"string"},"comments":{"type":"object[]"},"comments[].body":{"required":true,"type":"string"},"comments[].path":{"required":true,"type":"string"},"comments[].position":{"required":true,"type":"integer"},"commit_id":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"createReviewCommentReply":{"method":"POST","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"},"createReviewRequest":{"method":"POST","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"deletePendingReview":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"deleteReviewRequest":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"dismissReview":{"method":"PUT","params":{"message":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"},"get":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"getCommentsForReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"},"getReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"list":{"method":"GET","params":{"base":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"head":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["created","updated","popularity","long-running"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"listComments":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments"},"listCommits":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/commits"},"listFiles":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/files"},"listReviewRequests":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"listReviews":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"merge":{"method":"PUT","params":{"commit_message":{"type":"string"},"commit_title":{"type":"string"},"merge_method":{"enum":["merge","squash","rebase"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"submitReview":{"method":"POST","params":{"body":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"},"update":{"method":"PATCH","params":{"base":{"type":"string"},"body":{"type":"string"},"maintainer_can_modify":{"type":"boolean"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"updateBranch":{"headers":{"accept":"application/vnd.github.lydian-preview+json"},"method":"PUT","params":{"expected_head_sha":{"type":"string"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/update-branch"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"updateReview":{"method":"PUT","params":{"body":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"}},"rateLimit":{"get":{"method":"GET","params":{},"url":"/rate_limit"}},"reactions":{"createForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"createForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"createForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"createForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"createForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"createForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"delete":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"DELETE","params":{"reaction_id":{"required":true,"type":"integer"}},"url":"/reactions/:reaction_id"},"listForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"listForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"listForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"listForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"listForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"listForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"}},"repos":{"acceptInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"addCollaborator":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"addDeployKey":{"method":"POST","params":{"key":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"read_only":{"type":"boolean"},"repo":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/keys"},"addProtectedBranchAdminEnforcement":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"addProtectedBranchAppRestrictions":{"method":"POST","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"addProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"addProtectedBranchRequiredStatusChecksContexts":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"addProtectedBranchTeamRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"addProtectedBranchUserRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"checkCollaborator":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"checkVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"compareCommits":{"method":"GET","params":{"base":{"required":true,"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/compare/:base...:head"},"createCommitComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_sha":{"required":true,"type":"string"},"line":{"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"type":"string"},"position":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"alias":"commit_sha","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"createDeployment":{"method":"POST","params":{"auto_merge":{"type":"boolean"},"description":{"type":"string"},"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"payload":{"type":"string"},"production_environment":{"type":"boolean"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_contexts":{"type":"string[]"},"task":{"type":"string"},"transient_environment":{"type":"boolean"}},"url":"/repos/:owner/:repo/deployments"},"createDeploymentStatus":{"method":"POST","params":{"auto_inactive":{"type":"boolean"},"deployment_id":{"required":true,"type":"integer"},"description":{"type":"string"},"environment":{"enum":["production","staging","qa"],"type":"string"},"environment_url":{"type":"string"},"log_url":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["error","failure","inactive","in_progress","queued","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"createDispatchEvent":{"headers":{"accept":"application/vnd.github.everest-preview+json"},"method":"POST","params":{"client_payload":{"type":"object"},"event_type":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/dispatches"},"createFile":{"deprecated":"octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createForAuthenticatedUser":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/user/repos"},"createFork":{"method":"POST","params":{"organization":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/forks"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"createInOrg":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/orgs/:org/repos"},"createOrUpdateFile":{"method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createRelease":{"method":"POST","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"repo":{"required":true,"type":"string"},"tag_name":{"required":true,"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases"},"createStatus":{"method":"POST","params":{"context":{"type":"string"},"description":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"},"state":{"enum":["error","failure","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/statuses/:sha"},"createUsingTemplate":{"headers":{"accept":"application/vnd.github.baptiste-preview+json"},"method":"POST","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"type":"string"},"private":{"type":"boolean"},"template_owner":{"required":true,"type":"string"},"template_repo":{"required":true,"type":"string"}},"url":"/repos/:template_owner/:template_repo/generate"},"declineInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"delete":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"deleteCommitComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"deleteDownload":{"method":"DELETE","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"deleteFile":{"method":"DELETE","params":{"author":{"type":"object"},"author.email":{"type":"string"},"author.name":{"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"deleteInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"deleteRelease":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"deleteReleaseAsset":{"method":"DELETE","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"disableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"disablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"disableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"enableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"enablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"type":"object"},"source.branch":{"enum":["master","gh-pages"],"type":"string"},"source.path":{"type":"string"}},"url":"/repos/:owner/:repo/pages"},"enableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"get":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"getAppsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"getArchiveLink":{"method":"GET","params":{"archive_format":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/:archive_format/:ref"},"getBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch"},"getBranchProtection":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"getClones":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/clones"},"getCodeFrequencyStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/code_frequency"},"getCollaboratorPermissionLevel":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username/permission"},"getCombinedStatusForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/status"},"getCommit":{"method":"GET","params":{"commit_sha":{"alias":"ref","deprecated":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"alias":"ref","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getCommitActivityStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/commit_activity"},"getCommitComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"getCommitRefSha":{"deprecated":"octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit","headers":{"accept":"application/vnd.github.v3.sha"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getContents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"getContributorsStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/contributors"},"getDeployKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"getDeployment":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id"},"getDeploymentStatus":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"},"getDownload":{"method":"GET","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"getLatestPagesBuild":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/latest"},"getLatestRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/latest"},"getPages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"getPagesBuild":{"method":"GET","params":{"build_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/:build_id"},"getParticipationStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/participation"},"getProtectedBranchAdminEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"getProtectedBranchPullRequestReviewEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"getProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"getProtectedBranchRequiredStatusChecks":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"getProtectedBranchRestrictions":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"getPunchCardStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/punch_card"},"getReadme":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/readme"},"getRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"getReleaseAsset":{"method":"GET","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"getReleaseByTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/tags/:tag"},"getTeamsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"getTopPaths":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/paths"},"getTopReferrers":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/referrers"},"getUsersWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"getViews":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/views"},"list":{"method":"GET","params":{"affiliation":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","public","private","member"],"type":"string"},"visibility":{"enum":["all","public","private"],"type":"string"}},"url":"/user/repos"},"listAppsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"listAssetsForRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id/assets"},"listBranches":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"protected":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches"},"listBranchesForHeadCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/branches-where-head"},"listCollaborators":{"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators"},"listCommentsForCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"alias":"commit_sha","deprecated":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"listCommitComments":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments"},"listCommits":{"method":"GET","params":{"author":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"}},"url":"/repos/:owner/:repo/commits"},"listContributors":{"method":"GET","params":{"anon":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contributors"},"listDeployKeys":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys"},"listDeploymentStatuses":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"listDeployments":{"method":"GET","params":{"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"task":{"type":"string"}},"url":"/repos/:owner/:repo/deployments"},"listDownloads":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","public","private","forks","sources","member"],"type":"string"}},"url":"/orgs/:org/repos"},"listForUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/repos"},"listForks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["newest","oldest","stargazers"],"type":"string"}},"url":"/repos/:owner/:repo/forks"},"listHooks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"listInvitations":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations"},"listInvitationsForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/repository_invitations"},"listLanguages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/languages"},"listPagesBuilds":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"listProtectedBranchRequiredStatusChecksContexts":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"listProtectedBranchTeamRestrictions":{"deprecated":"octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listProtectedBranchUserRestrictions":{"deprecated":"octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/repositories"},"listPullRequestsAssociatedWithCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/pulls"},"listReleases":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases"},"listStatusesForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/statuses"},"listTags":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/tags"},"listTeams":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/teams"},"listTeamsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"listUsersWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"merge":{"method":"POST","params":{"base":{"required":true,"type":"string"},"commit_message":{"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/merges"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/pings"},"removeBranchProtection":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"removeCollaborator":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"removeDeployKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"removeProtectedBranchAdminEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"removeProtectedBranchAppRestrictions":{"method":"DELETE","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"removeProtectedBranchPullRequestReviewEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"removeProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"removeProtectedBranchRequiredStatusChecks":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"removeProtectedBranchRequiredStatusChecksContexts":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"removeProtectedBranchRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"removeProtectedBranchTeamRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"removeProtectedBranchUserRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceProtectedBranchAppRestrictions":{"method":"PUT","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"replaceProtectedBranchRequiredStatusChecksContexts":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"replaceProtectedBranchTeamRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"replaceProtectedBranchUserRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"PUT","params":{"names":{"required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"requestPageBuild":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"retrieveCommunityProfileMetrics":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/profile"},"testPushHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/tests"},"transfer":{"headers":{"accept":"application/vnd.github.nightshade-preview+json"},"method":"POST","params":{"new_owner":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/repos/:owner/:repo/transfer"},"update":{"method":"PATCH","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"archived":{"type":"boolean"},"default_branch":{"type":"string"},"description":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"private":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_pull_request_reviews":{"allowNull":true,"required":true,"type":"object"},"required_pull_request_reviews.dismiss_stale_reviews":{"type":"boolean"},"required_pull_request_reviews.dismissal_restrictions":{"type":"object"},"required_pull_request_reviews.dismissal_restrictions.teams":{"type":"string[]"},"required_pull_request_reviews.dismissal_restrictions.users":{"type":"string[]"},"required_pull_request_reviews.require_code_owner_reviews":{"type":"boolean"},"required_pull_request_reviews.required_approving_review_count":{"type":"integer"},"required_status_checks":{"allowNull":true,"required":true,"type":"object"},"required_status_checks.contexts":{"required":true,"type":"string[]"},"required_status_checks.strict":{"required":true,"type":"boolean"},"restrictions":{"allowNull":true,"required":true,"type":"object"},"restrictions.apps":{"type":"string[]"},"restrictions.teams":{"required":true,"type":"string[]"},"restrictions.users":{"required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"updateCommitComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"updateFile":{"deprecated":"octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"add_events":{"type":"string[]"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"remove_events":{"type":"string[]"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"updateInformationAboutPagesSite":{"method":"PUT","params":{"cname":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"enum":["\"gh-pages\"","\"master\"","\"master /docs\""],"type":"string"}},"url":"/repos/:owner/:repo/pages"},"updateInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"permissions":{"enum":["read","write","admin"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"updateProtectedBranchPullRequestReviewEnforcement":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"dismiss_stale_reviews":{"type":"boolean"},"dismissal_restrictions":{"type":"object"},"dismissal_restrictions.teams":{"type":"string[]"},"dismissal_restrictions.users":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"require_code_owner_reviews":{"type":"boolean"},"required_approving_review_count":{"type":"integer"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"updateProtectedBranchRequiredStatusChecks":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"contexts":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"strict":{"type":"boolean"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"updateRelease":{"method":"PATCH","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"tag_name":{"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"updateReleaseAsset":{"method":"PATCH","params":{"asset_id":{"required":true,"type":"integer"},"label":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"uploadReleaseAsset":{"method":"POST","params":{"file":{"mapTo":"data","required":true,"type":"string | object"},"headers":{"required":true,"type":"object"},"headers.content-length":{"required":true,"type":"integer"},"headers.content-type":{"required":true,"type":"string"},"label":{"type":"string"},"name":{"required":true,"type":"string"},"url":{"required":true,"type":"string"}},"url":":url"}},"search":{"code":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["indexed"],"type":"string"}},"url":"/search/code"},"commits":{"headers":{"accept":"application/vnd.github.cloak-preview+json"},"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["author-date","committer-date"],"type":"string"}},"url":"/search/commits"},"issues":{"deprecated":"octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)","method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"issuesAndPullRequests":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"labels":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"q":{"required":true,"type":"string"},"repository_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/search/labels"},"repos":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["stars","forks","help-wanted-issues","updated"],"type":"string"}},"url":"/search/repositories"},"topics":{"method":"GET","params":{"q":{"required":true,"type":"string"}},"url":"/search/topics"},"users":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["followers","repositories","joined"],"type":"string"}},"url":"/search/users"}},"teams":{"addMember":{"deprecated":"octokit.teams.addMember() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"method":"PUT","params":{"role":{"enum":["member","maintainer"],"type":"string"},"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"addOrUpdateProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"addOrUpdateRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"checkManagesRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"create":{"method":"POST","params":{"description":{"type":"string"},"maintainers":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"repo_names":{"type":"string[]"}},"url":"/orgs/:org/teams"},"createDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/teams/:team_id/discussions"},"createDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"delete":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"get":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getByName":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"getDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"getMember":{"deprecated":"octokit.teams.getMember() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"list":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/teams"},"listChild":{"headers":{"accept":"application/vnd.github.hellcat-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"listDiscussions":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/teams"},"listMembers":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/members"},"listPendingInvitations":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects"},"listRepos":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMember":{"deprecated":"octokit.teams.removeMember() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembership":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"reviewProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"updateDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"},"title":{"type":"string"}},"url":"/teams/:team_id/discussions/:discussion_number"},"updateDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"}},"users":{"addEmails":{"method":"POST","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"block":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkBlocked":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkFollowing":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"checkFollowingForUser":{"method":"GET","params":{"target_user":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following/:target_user"},"createGpgKey":{"method":"POST","params":{"armored_public_key":{"type":"string"}},"url":"/user/gpg_keys"},"createPublicKey":{"method":"POST","params":{"key":{"type":"string"},"title":{"type":"string"}},"url":"/user/keys"},"deleteEmails":{"method":"DELETE","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"deleteGpgKey":{"method":"DELETE","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"deletePublicKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"follow":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"getAuthenticated":{"method":"GET","params":{},"url":"/user"},"getByUsername":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username"},"getContextForUser":{"headers":{"accept":"application/vnd.github.hagar-preview+json"},"method":"GET","params":{"subject_id":{"type":"string"},"subject_type":{"enum":["organization","repository","issue","pull_request"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/hovercard"},"getGpgKey":{"method":"GET","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"getPublicKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/users"},"listBlocked":{"method":"GET","params":{},"url":"/user/blocks"},"listEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/emails"},"listFollowersForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/followers"},"listFollowersForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/followers"},"listFollowingForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/following"},"listFollowingForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following"},"listGpgKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/gpg_keys"},"listGpgKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gpg_keys"},"listPublicEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/public_emails"},"listPublicKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/keys"},"listPublicKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/keys"},"togglePrimaryEmailVisibility":{"method":"PATCH","params":{"email":{"required":true,"type":"string"},"visibility":{"required":true,"type":"string"}},"url":"/user/email/visibility"},"unblock":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"unfollow":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"updateAuthenticated":{"method":"PATCH","params":{"bio":{"type":"string"},"blog":{"type":"string"},"company":{"type":"string"},"email":{"type":"string"},"hireable":{"type":"boolean"},"location":{"type":"string"},"name":{"type":"string"}},"url":"/user"}}};
  8270. /***/ }),
  8271. /***/ 742:
  8272. /***/ (function(module, __unusedexports, __webpack_require__) {
  8273. var fs = __webpack_require__(747)
  8274. var core
  8275. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  8276. core = __webpack_require__(818)
  8277. } else {
  8278. core = __webpack_require__(197)
  8279. }
  8280. module.exports = isexe
  8281. isexe.sync = sync
  8282. function isexe (path, options, cb) {
  8283. if (typeof options === 'function') {
  8284. cb = options
  8285. options = {}
  8286. }
  8287. if (!cb) {
  8288. if (typeof Promise !== 'function') {
  8289. throw new TypeError('callback not provided')
  8290. }
  8291. return new Promise(function (resolve, reject) {
  8292. isexe(path, options || {}, function (er, is) {
  8293. if (er) {
  8294. reject(er)
  8295. } else {
  8296. resolve(is)
  8297. }
  8298. })
  8299. })
  8300. }
  8301. core(path, options || {}, function (er, is) {
  8302. // ignore EACCES because that just means we aren't allowed to run it
  8303. if (er) {
  8304. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  8305. er = null
  8306. is = false
  8307. }
  8308. }
  8309. cb(er, is)
  8310. })
  8311. }
  8312. function sync (path, options) {
  8313. // my kingdom for a filtered catch
  8314. try {
  8315. return core.sync(path, options || {})
  8316. } catch (er) {
  8317. if (options && options.ignoreErrors || er.code === 'EACCES') {
  8318. return false
  8319. } else {
  8320. throw er
  8321. }
  8322. }
  8323. }
  8324. /***/ }),
  8325. /***/ 747:
  8326. /***/ (function(module) {
  8327. module.exports = require("fs");
  8328. /***/ }),
  8329. /***/ 753:
  8330. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8331. "use strict";
  8332. Object.defineProperty(exports, '__esModule', { value: true });
  8333. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8334. var endpoint = __webpack_require__(385);
  8335. var universalUserAgent = __webpack_require__(796);
  8336. var isPlainObject = _interopDefault(__webpack_require__(696));
  8337. var nodeFetch = _interopDefault(__webpack_require__(454));
  8338. var requestError = __webpack_require__(463);
  8339. const VERSION = "5.3.1";
  8340. function getBufferResponse(response) {
  8341. return response.arrayBuffer();
  8342. }
  8343. function fetchWrapper(requestOptions) {
  8344. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  8345. requestOptions.body = JSON.stringify(requestOptions.body);
  8346. }
  8347. let headers = {};
  8348. let status;
  8349. let url;
  8350. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  8351. return fetch(requestOptions.url, Object.assign({
  8352. method: requestOptions.method,
  8353. body: requestOptions.body,
  8354. headers: requestOptions.headers,
  8355. redirect: requestOptions.redirect
  8356. }, requestOptions.request)).then(response => {
  8357. url = response.url;
  8358. status = response.status;
  8359. for (const keyAndValue of response.headers) {
  8360. headers[keyAndValue[0]] = keyAndValue[1];
  8361. }
  8362. if (status === 204 || status === 205) {
  8363. return;
  8364. } // GitHub API returns 200 for HEAD requsets
  8365. if (requestOptions.method === "HEAD") {
  8366. if (status < 400) {
  8367. return;
  8368. }
  8369. throw new requestError.RequestError(response.statusText, status, {
  8370. headers,
  8371. request: requestOptions
  8372. });
  8373. }
  8374. if (status === 304) {
  8375. throw new requestError.RequestError("Not modified", status, {
  8376. headers,
  8377. request: requestOptions
  8378. });
  8379. }
  8380. if (status >= 400) {
  8381. return response.text().then(message => {
  8382. const error = new requestError.RequestError(message, status, {
  8383. headers,
  8384. request: requestOptions
  8385. });
  8386. try {
  8387. let responseBody = JSON.parse(error.message);
  8388. Object.assign(error, responseBody);
  8389. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  8390. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  8391. } catch (e) {// ignore, see octokit/rest.js#684
  8392. }
  8393. throw error;
  8394. });
  8395. }
  8396. const contentType = response.headers.get("content-type");
  8397. if (/application\/json/.test(contentType)) {
  8398. return response.json();
  8399. }
  8400. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  8401. return response.text();
  8402. }
  8403. return getBufferResponse(response);
  8404. }).then(data => {
  8405. return {
  8406. status,
  8407. url,
  8408. headers,
  8409. data
  8410. };
  8411. }).catch(error => {
  8412. if (error instanceof requestError.RequestError) {
  8413. throw error;
  8414. }
  8415. throw new requestError.RequestError(error.message, 500, {
  8416. headers,
  8417. request: requestOptions
  8418. });
  8419. });
  8420. }
  8421. function withDefaults(oldEndpoint, newDefaults) {
  8422. const endpoint = oldEndpoint.defaults(newDefaults);
  8423. const newApi = function (route, parameters) {
  8424. const endpointOptions = endpoint.merge(route, parameters);
  8425. if (!endpointOptions.request || !endpointOptions.request.hook) {
  8426. return fetchWrapper(endpoint.parse(endpointOptions));
  8427. }
  8428. const request = (route, parameters) => {
  8429. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  8430. };
  8431. Object.assign(request, {
  8432. endpoint,
  8433. defaults: withDefaults.bind(null, endpoint)
  8434. });
  8435. return endpointOptions.request.hook(request, endpointOptions);
  8436. };
  8437. return Object.assign(newApi, {
  8438. endpoint,
  8439. defaults: withDefaults.bind(null, endpoint)
  8440. });
  8441. }
  8442. const request = withDefaults(endpoint.endpoint, {
  8443. headers: {
  8444. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  8445. }
  8446. });
  8447. exports.request = request;
  8448. //# sourceMappingURL=index.js.map
  8449. /***/ }),
  8450. /***/ 761:
  8451. /***/ (function(module) {
  8452. module.exports = require("zlib");
  8453. /***/ }),
  8454. /***/ 763:
  8455. /***/ (function(module) {
  8456. module.exports = removeHook
  8457. function removeHook (state, name, method) {
  8458. if (!state.registry[name]) {
  8459. return
  8460. }
  8461. var index = state.registry[name]
  8462. .map(function (registered) { return registered.orig })
  8463. .indexOf(method)
  8464. if (index === -1) {
  8465. return
  8466. }
  8467. state.registry[name].splice(index, 1)
  8468. }
  8469. /***/ }),
  8470. /***/ 768:
  8471. /***/ (function(module) {
  8472. "use strict";
  8473. module.exports = function (x) {
  8474. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  8475. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  8476. if (x[x.length - 1] === lf) {
  8477. x = x.slice(0, x.length - 1);
  8478. }
  8479. if (x[x.length - 1] === cr) {
  8480. x = x.slice(0, x.length - 1);
  8481. }
  8482. return x;
  8483. };
  8484. /***/ }),
  8485. /***/ 777:
  8486. /***/ (function(module, __unusedexports, __webpack_require__) {
  8487. module.exports = getFirstPage
  8488. const getPage = __webpack_require__(265)
  8489. function getFirstPage (octokit, link, headers) {
  8490. return getPage(octokit, link, 'first', headers)
  8491. }
  8492. /***/ }),
  8493. /***/ 796:
  8494. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8495. "use strict";
  8496. Object.defineProperty(exports, '__esModule', { value: true });
  8497. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8498. var osName = _interopDefault(__webpack_require__(2));
  8499. function getUserAgent() {
  8500. try {
  8501. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  8502. } catch (error) {
  8503. if (/wmic os get Caption/.test(error.message)) {
  8504. return "Windows <version undetectable>";
  8505. }
  8506. throw error;
  8507. }
  8508. }
  8509. exports.getUserAgent = getUserAgent;
  8510. //# sourceMappingURL=index.js.map
  8511. /***/ }),
  8512. /***/ 807:
  8513. /***/ (function(module, __unusedexports, __webpack_require__) {
  8514. module.exports = paginate;
  8515. const iterator = __webpack_require__(8);
  8516. function paginate(octokit, route, options, mapFn) {
  8517. if (typeof options === "function") {
  8518. mapFn = options;
  8519. options = undefined;
  8520. }
  8521. options = octokit.request.endpoint.merge(route, options);
  8522. return gather(
  8523. octokit,
  8524. [],
  8525. iterator(octokit, options)[Symbol.asyncIterator](),
  8526. mapFn
  8527. );
  8528. }
  8529. function gather(octokit, results, iterator, mapFn) {
  8530. return iterator.next().then(result => {
  8531. if (result.done) {
  8532. return results;
  8533. }
  8534. let earlyExit = false;
  8535. function done() {
  8536. earlyExit = true;
  8537. }
  8538. results = results.concat(
  8539. mapFn ? mapFn(result.value, done) : result.value.data
  8540. );
  8541. if (earlyExit) {
  8542. return results;
  8543. }
  8544. return gather(octokit, results, iterator, mapFn);
  8545. });
  8546. }
  8547. /***/ }),
  8548. /***/ 814:
  8549. /***/ (function(module, __unusedexports, __webpack_require__) {
  8550. module.exports = which
  8551. which.sync = whichSync
  8552. var isWindows = process.platform === 'win32' ||
  8553. process.env.OSTYPE === 'cygwin' ||
  8554. process.env.OSTYPE === 'msys'
  8555. var path = __webpack_require__(622)
  8556. var COLON = isWindows ? ';' : ':'
  8557. var isexe = __webpack_require__(742)
  8558. function getNotFoundError (cmd) {
  8559. var er = new Error('not found: ' + cmd)
  8560. er.code = 'ENOENT'
  8561. return er
  8562. }
  8563. function getPathInfo (cmd, opt) {
  8564. var colon = opt.colon || COLON
  8565. var pathEnv = opt.path || process.env.PATH || ''
  8566. var pathExt = ['']
  8567. pathEnv = pathEnv.split(colon)
  8568. var pathExtExe = ''
  8569. if (isWindows) {
  8570. pathEnv.unshift(process.cwd())
  8571. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  8572. pathExt = pathExtExe.split(colon)
  8573. // Always test the cmd itself first. isexe will check to make sure
  8574. // it's found in the pathExt set.
  8575. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  8576. pathExt.unshift('')
  8577. }
  8578. // If it has a slash, then we don't bother searching the pathenv.
  8579. // just check the file itself, and that's it.
  8580. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  8581. pathEnv = ['']
  8582. return {
  8583. env: pathEnv,
  8584. ext: pathExt,
  8585. extExe: pathExtExe
  8586. }
  8587. }
  8588. function which (cmd, opt, cb) {
  8589. if (typeof opt === 'function') {
  8590. cb = opt
  8591. opt = {}
  8592. }
  8593. var info = getPathInfo(cmd, opt)
  8594. var pathEnv = info.env
  8595. var pathExt = info.ext
  8596. var pathExtExe = info.extExe
  8597. var found = []
  8598. ;(function F (i, l) {
  8599. if (i === l) {
  8600. if (opt.all && found.length)
  8601. return cb(null, found)
  8602. else
  8603. return cb(getNotFoundError(cmd))
  8604. }
  8605. var pathPart = pathEnv[i]
  8606. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8607. pathPart = pathPart.slice(1, -1)
  8608. var p = path.join(pathPart, cmd)
  8609. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  8610. p = cmd.slice(0, 2) + p
  8611. }
  8612. ;(function E (ii, ll) {
  8613. if (ii === ll) return F(i + 1, l)
  8614. var ext = pathExt[ii]
  8615. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  8616. if (!er && is) {
  8617. if (opt.all)
  8618. found.push(p + ext)
  8619. else
  8620. return cb(null, p + ext)
  8621. }
  8622. return E(ii + 1, ll)
  8623. })
  8624. })(0, pathExt.length)
  8625. })(0, pathEnv.length)
  8626. }
  8627. function whichSync (cmd, opt) {
  8628. opt = opt || {}
  8629. var info = getPathInfo(cmd, opt)
  8630. var pathEnv = info.env
  8631. var pathExt = info.ext
  8632. var pathExtExe = info.extExe
  8633. var found = []
  8634. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  8635. var pathPart = pathEnv[i]
  8636. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8637. pathPart = pathPart.slice(1, -1)
  8638. var p = path.join(pathPart, cmd)
  8639. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  8640. p = cmd.slice(0, 2) + p
  8641. }
  8642. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  8643. var cur = p + pathExt[j]
  8644. var is
  8645. try {
  8646. is = isexe.sync(cur, { pathExt: pathExtExe })
  8647. if (is) {
  8648. if (opt.all)
  8649. found.push(cur)
  8650. else
  8651. return cur
  8652. }
  8653. } catch (ex) {}
  8654. }
  8655. }
  8656. if (opt.all && found.length)
  8657. return found
  8658. if (opt.nothrow)
  8659. return null
  8660. throw getNotFoundError(cmd)
  8661. }
  8662. /***/ }),
  8663. /***/ 816:
  8664. /***/ (function(module) {
  8665. "use strict";
  8666. module.exports = /^#!.*/;
  8667. /***/ }),
  8668. /***/ 818:
  8669. /***/ (function(module, __unusedexports, __webpack_require__) {
  8670. module.exports = isexe
  8671. isexe.sync = sync
  8672. var fs = __webpack_require__(747)
  8673. function checkPathExt (path, options) {
  8674. var pathext = options.pathExt !== undefined ?
  8675. options.pathExt : process.env.PATHEXT
  8676. if (!pathext) {
  8677. return true
  8678. }
  8679. pathext = pathext.split(';')
  8680. if (pathext.indexOf('') !== -1) {
  8681. return true
  8682. }
  8683. for (var i = 0; i < pathext.length; i++) {
  8684. var p = pathext[i].toLowerCase()
  8685. if (p && path.substr(-p.length).toLowerCase() === p) {
  8686. return true
  8687. }
  8688. }
  8689. return false
  8690. }
  8691. function checkStat (stat, path, options) {
  8692. if (!stat.isSymbolicLink() && !stat.isFile()) {
  8693. return false
  8694. }
  8695. return checkPathExt(path, options)
  8696. }
  8697. function isexe (path, options, cb) {
  8698. fs.stat(path, function (er, stat) {
  8699. cb(er, er ? false : checkStat(stat, path, options))
  8700. })
  8701. }
  8702. function sync (path, options) {
  8703. return checkStat(fs.statSync(path), path, options)
  8704. }
  8705. /***/ }),
  8706. /***/ 821:
  8707. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8708. "use strict";
  8709. var __importStar = (this && this.__importStar) || function (mod) {
  8710. if (mod && mod.__esModule) return mod;
  8711. var result = {};
  8712. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8713. result["default"] = mod;
  8714. return result;
  8715. };
  8716. Object.defineProperty(exports, "__esModule", { value: true });
  8717. const core = __importStar(__webpack_require__(470));
  8718. const fsHelper = __importStar(__webpack_require__(618));
  8719. const github = __importStar(__webpack_require__(469));
  8720. const path = __importStar(__webpack_require__(622));
  8721. function getInputs() {
  8722. const result = {};
  8723. // GitHub workspace
  8724. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  8725. if (!githubWorkspacePath) {
  8726. throw new Error('GITHUB_WORKSPACE not defined');
  8727. }
  8728. githubWorkspacePath = path.resolve(githubWorkspacePath);
  8729. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  8730. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  8731. // Qualified repository
  8732. const qualifiedRepository = core.getInput('repository') ||
  8733. `${github.context.repo.owner}/${github.context.repo.repo}`;
  8734. core.debug(`qualified repository = '${qualifiedRepository}'`);
  8735. const splitRepository = qualifiedRepository.split('/');
  8736. if (splitRepository.length !== 2 ||
  8737. !splitRepository[0] ||
  8738. !splitRepository[1]) {
  8739. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  8740. }
  8741. result.repositoryOwner = splitRepository[0];
  8742. result.repositoryName = splitRepository[1];
  8743. // Repository path
  8744. result.repositoryPath = core.getInput('path') || '.';
  8745. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  8746. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  8747. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  8748. }
  8749. // Workflow repository?
  8750. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  8751. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  8752. // Source branch, source version
  8753. result.ref = core.getInput('ref');
  8754. if (!result.ref) {
  8755. if (isWorkflowRepository) {
  8756. result.ref = github.context.ref;
  8757. result.commit = github.context.sha;
  8758. }
  8759. if (!result.ref && !result.commit) {
  8760. result.ref = 'refs/heads/master';
  8761. }
  8762. }
  8763. // SHA?
  8764. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  8765. result.commit = result.ref;
  8766. result.ref = '';
  8767. }
  8768. core.debug(`ref = '${result.ref}'`);
  8769. core.debug(`commit = '${result.commit}'`);
  8770. // Clean
  8771. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  8772. core.debug(`clean = ${result.clean}`);
  8773. // Submodules
  8774. if (core.getInput('submodules')) {
  8775. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  8776. }
  8777. // Fetch depth
  8778. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  8779. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  8780. result.fetchDepth = 0;
  8781. }
  8782. core.debug(`fetch depth = ${result.fetchDepth}`);
  8783. // LFS
  8784. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  8785. core.debug(`lfs = ${result.lfs}`);
  8786. // Access token
  8787. result.accessToken = core.getInput('token');
  8788. return result;
  8789. }
  8790. exports.getInputs = getInputs;
  8791. /***/ }),
  8792. /***/ 835:
  8793. /***/ (function(module) {
  8794. module.exports = require("url");
  8795. /***/ }),
  8796. /***/ 850:
  8797. /***/ (function(module, __unusedexports, __webpack_require__) {
  8798. module.exports = paginationMethodsPlugin
  8799. function paginationMethodsPlugin (octokit) {
  8800. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  8801. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  8802. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  8803. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  8804. octokit.hasFirstPage = __webpack_require__(536)
  8805. octokit.hasLastPage = __webpack_require__(336)
  8806. octokit.hasNextPage = __webpack_require__(929)
  8807. octokit.hasPreviousPage = __webpack_require__(558)
  8808. }
  8809. /***/ }),
  8810. /***/ 854:
  8811. /***/ (function(module) {
  8812. /**
  8813. * lodash (Custom Build) <https://lodash.com/>
  8814. * Build: `lodash modularize exports="npm" -o ./`
  8815. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8816. * Released under MIT license <https://lodash.com/license>
  8817. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8818. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8819. */
  8820. /** Used as the `TypeError` message for "Functions" methods. */
  8821. var FUNC_ERROR_TEXT = 'Expected a function';
  8822. /** Used to stand-in for `undefined` hash values. */
  8823. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8824. /** Used as references for various `Number` constants. */
  8825. var INFINITY = 1 / 0;
  8826. /** `Object#toString` result references. */
  8827. var funcTag = '[object Function]',
  8828. genTag = '[object GeneratorFunction]',
  8829. symbolTag = '[object Symbol]';
  8830. /** Used to match property names within property paths. */
  8831. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8832. reIsPlainProp = /^\w*$/,
  8833. reLeadingDot = /^\./,
  8834. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8835. /**
  8836. * Used to match `RegExp`
  8837. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8838. */
  8839. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8840. /** Used to match backslashes in property paths. */
  8841. var reEscapeChar = /\\(\\)?/g;
  8842. /** Used to detect host constructors (Safari). */
  8843. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8844. /** Detect free variable `global` from Node.js. */
  8845. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  8846. /** Detect free variable `self`. */
  8847. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8848. /** Used as a reference to the global object. */
  8849. var root = freeGlobal || freeSelf || Function('return this')();
  8850. /**
  8851. * Gets the value at `key` of `object`.
  8852. *
  8853. * @private
  8854. * @param {Object} [object] The object to query.
  8855. * @param {string} key The key of the property to get.
  8856. * @returns {*} Returns the property value.
  8857. */
  8858. function getValue(object, key) {
  8859. return object == null ? undefined : object[key];
  8860. }
  8861. /**
  8862. * Checks if `value` is a host object in IE < 9.
  8863. *
  8864. * @private
  8865. * @param {*} value The value to check.
  8866. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  8867. */
  8868. function isHostObject(value) {
  8869. // Many host objects are `Object` objects that can coerce to strings
  8870. // despite having improperly defined `toString` methods.
  8871. var result = false;
  8872. if (value != null && typeof value.toString != 'function') {
  8873. try {
  8874. result = !!(value + '');
  8875. } catch (e) {}
  8876. }
  8877. return result;
  8878. }
  8879. /** Used for built-in method references. */
  8880. var arrayProto = Array.prototype,
  8881. funcProto = Function.prototype,
  8882. objectProto = Object.prototype;
  8883. /** Used to detect overreaching core-js shims. */
  8884. var coreJsData = root['__core-js_shared__'];
  8885. /** Used to detect methods masquerading as native. */
  8886. var maskSrcKey = (function() {
  8887. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8888. return uid ? ('Symbol(src)_1.' + uid) : '';
  8889. }());
  8890. /** Used to resolve the decompiled source of functions. */
  8891. var funcToString = funcProto.toString;
  8892. /** Used to check objects for own properties. */
  8893. var hasOwnProperty = objectProto.hasOwnProperty;
  8894. /**
  8895. * Used to resolve the
  8896. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8897. * of values.
  8898. */
  8899. var objectToString = objectProto.toString;
  8900. /** Used to detect if a method is native. */
  8901. var reIsNative = RegExp('^' +
  8902. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8903. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8904. );
  8905. /** Built-in value references. */
  8906. var Symbol = root.Symbol,
  8907. splice = arrayProto.splice;
  8908. /* Built-in method references that are verified to be native. */
  8909. var Map = getNative(root, 'Map'),
  8910. nativeCreate = getNative(Object, 'create');
  8911. /** Used to convert symbols to primitives and strings. */
  8912. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8913. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8914. /**
  8915. * Creates a hash object.
  8916. *
  8917. * @private
  8918. * @constructor
  8919. * @param {Array} [entries] The key-value pairs to cache.
  8920. */
  8921. function Hash(entries) {
  8922. var index = -1,
  8923. length = entries ? entries.length : 0;
  8924. this.clear();
  8925. while (++index < length) {
  8926. var entry = entries[index];
  8927. this.set(entry[0], entry[1]);
  8928. }
  8929. }
  8930. /**
  8931. * Removes all key-value entries from the hash.
  8932. *
  8933. * @private
  8934. * @name clear
  8935. * @memberOf Hash
  8936. */
  8937. function hashClear() {
  8938. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8939. }
  8940. /**
  8941. * Removes `key` and its value from the hash.
  8942. *
  8943. * @private
  8944. * @name delete
  8945. * @memberOf Hash
  8946. * @param {Object} hash The hash to modify.
  8947. * @param {string} key The key of the value to remove.
  8948. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8949. */
  8950. function hashDelete(key) {
  8951. return this.has(key) && delete this.__data__[key];
  8952. }
  8953. /**
  8954. * Gets the hash value for `key`.
  8955. *
  8956. * @private
  8957. * @name get
  8958. * @memberOf Hash
  8959. * @param {string} key The key of the value to get.
  8960. * @returns {*} Returns the entry value.
  8961. */
  8962. function hashGet(key) {
  8963. var data = this.__data__;
  8964. if (nativeCreate) {
  8965. var result = data[key];
  8966. return result === HASH_UNDEFINED ? undefined : result;
  8967. }
  8968. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8969. }
  8970. /**
  8971. * Checks if a hash value for `key` exists.
  8972. *
  8973. * @private
  8974. * @name has
  8975. * @memberOf Hash
  8976. * @param {string} key The key of the entry to check.
  8977. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8978. */
  8979. function hashHas(key) {
  8980. var data = this.__data__;
  8981. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  8982. }
  8983. /**
  8984. * Sets the hash `key` to `value`.
  8985. *
  8986. * @private
  8987. * @name set
  8988. * @memberOf Hash
  8989. * @param {string} key The key of the value to set.
  8990. * @param {*} value The value to set.
  8991. * @returns {Object} Returns the hash instance.
  8992. */
  8993. function hashSet(key, value) {
  8994. var data = this.__data__;
  8995. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  8996. return this;
  8997. }
  8998. // Add methods to `Hash`.
  8999. Hash.prototype.clear = hashClear;
  9000. Hash.prototype['delete'] = hashDelete;
  9001. Hash.prototype.get = hashGet;
  9002. Hash.prototype.has = hashHas;
  9003. Hash.prototype.set = hashSet;
  9004. /**
  9005. * Creates an list cache object.
  9006. *
  9007. * @private
  9008. * @constructor
  9009. * @param {Array} [entries] The key-value pairs to cache.
  9010. */
  9011. function ListCache(entries) {
  9012. var index = -1,
  9013. length = entries ? entries.length : 0;
  9014. this.clear();
  9015. while (++index < length) {
  9016. var entry = entries[index];
  9017. this.set(entry[0], entry[1]);
  9018. }
  9019. }
  9020. /**
  9021. * Removes all key-value entries from the list cache.
  9022. *
  9023. * @private
  9024. * @name clear
  9025. * @memberOf ListCache
  9026. */
  9027. function listCacheClear() {
  9028. this.__data__ = [];
  9029. }
  9030. /**
  9031. * Removes `key` and its value from the list cache.
  9032. *
  9033. * @private
  9034. * @name delete
  9035. * @memberOf ListCache
  9036. * @param {string} key The key of the value to remove.
  9037. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9038. */
  9039. function listCacheDelete(key) {
  9040. var data = this.__data__,
  9041. index = assocIndexOf(data, key);
  9042. if (index < 0) {
  9043. return false;
  9044. }
  9045. var lastIndex = data.length - 1;
  9046. if (index == lastIndex) {
  9047. data.pop();
  9048. } else {
  9049. splice.call(data, index, 1);
  9050. }
  9051. return true;
  9052. }
  9053. /**
  9054. * Gets the list cache value for `key`.
  9055. *
  9056. * @private
  9057. * @name get
  9058. * @memberOf ListCache
  9059. * @param {string} key The key of the value to get.
  9060. * @returns {*} Returns the entry value.
  9061. */
  9062. function listCacheGet(key) {
  9063. var data = this.__data__,
  9064. index = assocIndexOf(data, key);
  9065. return index < 0 ? undefined : data[index][1];
  9066. }
  9067. /**
  9068. * Checks if a list cache value for `key` exists.
  9069. *
  9070. * @private
  9071. * @name has
  9072. * @memberOf ListCache
  9073. * @param {string} key The key of the entry to check.
  9074. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9075. */
  9076. function listCacheHas(key) {
  9077. return assocIndexOf(this.__data__, key) > -1;
  9078. }
  9079. /**
  9080. * Sets the list cache `key` to `value`.
  9081. *
  9082. * @private
  9083. * @name set
  9084. * @memberOf ListCache
  9085. * @param {string} key The key of the value to set.
  9086. * @param {*} value The value to set.
  9087. * @returns {Object} Returns the list cache instance.
  9088. */
  9089. function listCacheSet(key, value) {
  9090. var data = this.__data__,
  9091. index = assocIndexOf(data, key);
  9092. if (index < 0) {
  9093. data.push([key, value]);
  9094. } else {
  9095. data[index][1] = value;
  9096. }
  9097. return this;
  9098. }
  9099. // Add methods to `ListCache`.
  9100. ListCache.prototype.clear = listCacheClear;
  9101. ListCache.prototype['delete'] = listCacheDelete;
  9102. ListCache.prototype.get = listCacheGet;
  9103. ListCache.prototype.has = listCacheHas;
  9104. ListCache.prototype.set = listCacheSet;
  9105. /**
  9106. * Creates a map cache object to store key-value pairs.
  9107. *
  9108. * @private
  9109. * @constructor
  9110. * @param {Array} [entries] The key-value pairs to cache.
  9111. */
  9112. function MapCache(entries) {
  9113. var index = -1,
  9114. length = entries ? entries.length : 0;
  9115. this.clear();
  9116. while (++index < length) {
  9117. var entry = entries[index];
  9118. this.set(entry[0], entry[1]);
  9119. }
  9120. }
  9121. /**
  9122. * Removes all key-value entries from the map.
  9123. *
  9124. * @private
  9125. * @name clear
  9126. * @memberOf MapCache
  9127. */
  9128. function mapCacheClear() {
  9129. this.__data__ = {
  9130. 'hash': new Hash,
  9131. 'map': new (Map || ListCache),
  9132. 'string': new Hash
  9133. };
  9134. }
  9135. /**
  9136. * Removes `key` and its value from the map.
  9137. *
  9138. * @private
  9139. * @name delete
  9140. * @memberOf MapCache
  9141. * @param {string} key The key of the value to remove.
  9142. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9143. */
  9144. function mapCacheDelete(key) {
  9145. return getMapData(this, key)['delete'](key);
  9146. }
  9147. /**
  9148. * Gets the map value for `key`.
  9149. *
  9150. * @private
  9151. * @name get
  9152. * @memberOf MapCache
  9153. * @param {string} key The key of the value to get.
  9154. * @returns {*} Returns the entry value.
  9155. */
  9156. function mapCacheGet(key) {
  9157. return getMapData(this, key).get(key);
  9158. }
  9159. /**
  9160. * Checks if a map value for `key` exists.
  9161. *
  9162. * @private
  9163. * @name has
  9164. * @memberOf MapCache
  9165. * @param {string} key The key of the entry to check.
  9166. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9167. */
  9168. function mapCacheHas(key) {
  9169. return getMapData(this, key).has(key);
  9170. }
  9171. /**
  9172. * Sets the map `key` to `value`.
  9173. *
  9174. * @private
  9175. * @name set
  9176. * @memberOf MapCache
  9177. * @param {string} key The key of the value to set.
  9178. * @param {*} value The value to set.
  9179. * @returns {Object} Returns the map cache instance.
  9180. */
  9181. function mapCacheSet(key, value) {
  9182. getMapData(this, key).set(key, value);
  9183. return this;
  9184. }
  9185. // Add methods to `MapCache`.
  9186. MapCache.prototype.clear = mapCacheClear;
  9187. MapCache.prototype['delete'] = mapCacheDelete;
  9188. MapCache.prototype.get = mapCacheGet;
  9189. MapCache.prototype.has = mapCacheHas;
  9190. MapCache.prototype.set = mapCacheSet;
  9191. /**
  9192. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9193. *
  9194. * @private
  9195. * @param {Array} array The array to inspect.
  9196. * @param {*} key The key to search for.
  9197. * @returns {number} Returns the index of the matched value, else `-1`.
  9198. */
  9199. function assocIndexOf(array, key) {
  9200. var length = array.length;
  9201. while (length--) {
  9202. if (eq(array[length][0], key)) {
  9203. return length;
  9204. }
  9205. }
  9206. return -1;
  9207. }
  9208. /**
  9209. * The base implementation of `_.get` without support for default values.
  9210. *
  9211. * @private
  9212. * @param {Object} object The object to query.
  9213. * @param {Array|string} path The path of the property to get.
  9214. * @returns {*} Returns the resolved value.
  9215. */
  9216. function baseGet(object, path) {
  9217. path = isKey(path, object) ? [path] : castPath(path);
  9218. var index = 0,
  9219. length = path.length;
  9220. while (object != null && index < length) {
  9221. object = object[toKey(path[index++])];
  9222. }
  9223. return (index && index == length) ? object : undefined;
  9224. }
  9225. /**
  9226. * The base implementation of `_.isNative` without bad shim checks.
  9227. *
  9228. * @private
  9229. * @param {*} value The value to check.
  9230. * @returns {boolean} Returns `true` if `value` is a native function,
  9231. * else `false`.
  9232. */
  9233. function baseIsNative(value) {
  9234. if (!isObject(value) || isMasked(value)) {
  9235. return false;
  9236. }
  9237. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  9238. return pattern.test(toSource(value));
  9239. }
  9240. /**
  9241. * The base implementation of `_.toString` which doesn't convert nullish
  9242. * values to empty strings.
  9243. *
  9244. * @private
  9245. * @param {*} value The value to process.
  9246. * @returns {string} Returns the string.
  9247. */
  9248. function baseToString(value) {
  9249. // Exit early for strings to avoid a performance hit in some environments.
  9250. if (typeof value == 'string') {
  9251. return value;
  9252. }
  9253. if (isSymbol(value)) {
  9254. return symbolToString ? symbolToString.call(value) : '';
  9255. }
  9256. var result = (value + '');
  9257. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9258. }
  9259. /**
  9260. * Casts `value` to a path array if it's not one.
  9261. *
  9262. * @private
  9263. * @param {*} value The value to inspect.
  9264. * @returns {Array} Returns the cast property path array.
  9265. */
  9266. function castPath(value) {
  9267. return isArray(value) ? value : stringToPath(value);
  9268. }
  9269. /**
  9270. * Gets the data for `map`.
  9271. *
  9272. * @private
  9273. * @param {Object} map The map to query.
  9274. * @param {string} key The reference key.
  9275. * @returns {*} Returns the map data.
  9276. */
  9277. function getMapData(map, key) {
  9278. var data = map.__data__;
  9279. return isKeyable(key)
  9280. ? data[typeof key == 'string' ? 'string' : 'hash']
  9281. : data.map;
  9282. }
  9283. /**
  9284. * Gets the native function at `key` of `object`.
  9285. *
  9286. * @private
  9287. * @param {Object} object The object to query.
  9288. * @param {string} key The key of the method to get.
  9289. * @returns {*} Returns the function if it's native, else `undefined`.
  9290. */
  9291. function getNative(object, key) {
  9292. var value = getValue(object, key);
  9293. return baseIsNative(value) ? value : undefined;
  9294. }
  9295. /**
  9296. * Checks if `value` is a property name and not a property path.
  9297. *
  9298. * @private
  9299. * @param {*} value The value to check.
  9300. * @param {Object} [object] The object to query keys on.
  9301. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9302. */
  9303. function isKey(value, object) {
  9304. if (isArray(value)) {
  9305. return false;
  9306. }
  9307. var type = typeof value;
  9308. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  9309. value == null || isSymbol(value)) {
  9310. return true;
  9311. }
  9312. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  9313. (object != null && value in Object(object));
  9314. }
  9315. /**
  9316. * Checks if `value` is suitable for use as unique object key.
  9317. *
  9318. * @private
  9319. * @param {*} value The value to check.
  9320. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  9321. */
  9322. function isKeyable(value) {
  9323. var type = typeof value;
  9324. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  9325. ? (value !== '__proto__')
  9326. : (value === null);
  9327. }
  9328. /**
  9329. * Checks if `func` has its source masked.
  9330. *
  9331. * @private
  9332. * @param {Function} func The function to check.
  9333. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  9334. */
  9335. function isMasked(func) {
  9336. return !!maskSrcKey && (maskSrcKey in func);
  9337. }
  9338. /**
  9339. * Converts `string` to a property path array.
  9340. *
  9341. * @private
  9342. * @param {string} string The string to convert.
  9343. * @returns {Array} Returns the property path array.
  9344. */
  9345. var stringToPath = memoize(function(string) {
  9346. string = toString(string);
  9347. var result = [];
  9348. if (reLeadingDot.test(string)) {
  9349. result.push('');
  9350. }
  9351. string.replace(rePropName, function(match, number, quote, string) {
  9352. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  9353. });
  9354. return result;
  9355. });
  9356. /**
  9357. * Converts `value` to a string key if it's not a string or symbol.
  9358. *
  9359. * @private
  9360. * @param {*} value The value to inspect.
  9361. * @returns {string|symbol} Returns the key.
  9362. */
  9363. function toKey(value) {
  9364. if (typeof value == 'string' || isSymbol(value)) {
  9365. return value;
  9366. }
  9367. var result = (value + '');
  9368. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9369. }
  9370. /**
  9371. * Converts `func` to its source code.
  9372. *
  9373. * @private
  9374. * @param {Function} func The function to process.
  9375. * @returns {string} Returns the source code.
  9376. */
  9377. function toSource(func) {
  9378. if (func != null) {
  9379. try {
  9380. return funcToString.call(func);
  9381. } catch (e) {}
  9382. try {
  9383. return (func + '');
  9384. } catch (e) {}
  9385. }
  9386. return '';
  9387. }
  9388. /**
  9389. * Creates a function that memoizes the result of `func`. If `resolver` is
  9390. * provided, it determines the cache key for storing the result based on the
  9391. * arguments provided to the memoized function. By default, the first argument
  9392. * provided to the memoized function is used as the map cache key. The `func`
  9393. * is invoked with the `this` binding of the memoized function.
  9394. *
  9395. * **Note:** The cache is exposed as the `cache` property on the memoized
  9396. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  9397. * constructor with one whose instances implement the
  9398. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  9399. * method interface of `delete`, `get`, `has`, and `set`.
  9400. *
  9401. * @static
  9402. * @memberOf _
  9403. * @since 0.1.0
  9404. * @category Function
  9405. * @param {Function} func The function to have its output memoized.
  9406. * @param {Function} [resolver] The function to resolve the cache key.
  9407. * @returns {Function} Returns the new memoized function.
  9408. * @example
  9409. *
  9410. * var object = { 'a': 1, 'b': 2 };
  9411. * var other = { 'c': 3, 'd': 4 };
  9412. *
  9413. * var values = _.memoize(_.values);
  9414. * values(object);
  9415. * // => [1, 2]
  9416. *
  9417. * values(other);
  9418. * // => [3, 4]
  9419. *
  9420. * object.a = 2;
  9421. * values(object);
  9422. * // => [1, 2]
  9423. *
  9424. * // Modify the result cache.
  9425. * values.cache.set(object, ['a', 'b']);
  9426. * values(object);
  9427. * // => ['a', 'b']
  9428. *
  9429. * // Replace `_.memoize.Cache`.
  9430. * _.memoize.Cache = WeakMap;
  9431. */
  9432. function memoize(func, resolver) {
  9433. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  9434. throw new TypeError(FUNC_ERROR_TEXT);
  9435. }
  9436. var memoized = function() {
  9437. var args = arguments,
  9438. key = resolver ? resolver.apply(this, args) : args[0],
  9439. cache = memoized.cache;
  9440. if (cache.has(key)) {
  9441. return cache.get(key);
  9442. }
  9443. var result = func.apply(this, args);
  9444. memoized.cache = cache.set(key, result);
  9445. return result;
  9446. };
  9447. memoized.cache = new (memoize.Cache || MapCache);
  9448. return memoized;
  9449. }
  9450. // Assign cache to `_.memoize`.
  9451. memoize.Cache = MapCache;
  9452. /**
  9453. * Performs a
  9454. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9455. * comparison between two values to determine if they are equivalent.
  9456. *
  9457. * @static
  9458. * @memberOf _
  9459. * @since 4.0.0
  9460. * @category Lang
  9461. * @param {*} value The value to compare.
  9462. * @param {*} other The other value to compare.
  9463. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9464. * @example
  9465. *
  9466. * var object = { 'a': 1 };
  9467. * var other = { 'a': 1 };
  9468. *
  9469. * _.eq(object, object);
  9470. * // => true
  9471. *
  9472. * _.eq(object, other);
  9473. * // => false
  9474. *
  9475. * _.eq('a', 'a');
  9476. * // => true
  9477. *
  9478. * _.eq('a', Object('a'));
  9479. * // => false
  9480. *
  9481. * _.eq(NaN, NaN);
  9482. * // => true
  9483. */
  9484. function eq(value, other) {
  9485. return value === other || (value !== value && other !== other);
  9486. }
  9487. /**
  9488. * Checks if `value` is classified as an `Array` object.
  9489. *
  9490. * @static
  9491. * @memberOf _
  9492. * @since 0.1.0
  9493. * @category Lang
  9494. * @param {*} value The value to check.
  9495. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  9496. * @example
  9497. *
  9498. * _.isArray([1, 2, 3]);
  9499. * // => true
  9500. *
  9501. * _.isArray(document.body.children);
  9502. * // => false
  9503. *
  9504. * _.isArray('abc');
  9505. * // => false
  9506. *
  9507. * _.isArray(_.noop);
  9508. * // => false
  9509. */
  9510. var isArray = Array.isArray;
  9511. /**
  9512. * Checks if `value` is classified as a `Function` object.
  9513. *
  9514. * @static
  9515. * @memberOf _
  9516. * @since 0.1.0
  9517. * @category Lang
  9518. * @param {*} value The value to check.
  9519. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  9520. * @example
  9521. *
  9522. * _.isFunction(_);
  9523. * // => true
  9524. *
  9525. * _.isFunction(/abc/);
  9526. * // => false
  9527. */
  9528. function isFunction(value) {
  9529. // The use of `Object#toString` avoids issues with the `typeof` operator
  9530. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  9531. var tag = isObject(value) ? objectToString.call(value) : '';
  9532. return tag == funcTag || tag == genTag;
  9533. }
  9534. /**
  9535. * Checks if `value` is the
  9536. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  9537. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  9538. *
  9539. * @static
  9540. * @memberOf _
  9541. * @since 0.1.0
  9542. * @category Lang
  9543. * @param {*} value The value to check.
  9544. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  9545. * @example
  9546. *
  9547. * _.isObject({});
  9548. * // => true
  9549. *
  9550. * _.isObject([1, 2, 3]);
  9551. * // => true
  9552. *
  9553. * _.isObject(_.noop);
  9554. * // => true
  9555. *
  9556. * _.isObject(null);
  9557. * // => false
  9558. */
  9559. function isObject(value) {
  9560. var type = typeof value;
  9561. return !!value && (type == 'object' || type == 'function');
  9562. }
  9563. /**
  9564. * Checks if `value` is object-like. A value is object-like if it's not `null`
  9565. * and has a `typeof` result of "object".
  9566. *
  9567. * @static
  9568. * @memberOf _
  9569. * @since 4.0.0
  9570. * @category Lang
  9571. * @param {*} value The value to check.
  9572. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  9573. * @example
  9574. *
  9575. * _.isObjectLike({});
  9576. * // => true
  9577. *
  9578. * _.isObjectLike([1, 2, 3]);
  9579. * // => true
  9580. *
  9581. * _.isObjectLike(_.noop);
  9582. * // => false
  9583. *
  9584. * _.isObjectLike(null);
  9585. * // => false
  9586. */
  9587. function isObjectLike(value) {
  9588. return !!value && typeof value == 'object';
  9589. }
  9590. /**
  9591. * Checks if `value` is classified as a `Symbol` primitive or object.
  9592. *
  9593. * @static
  9594. * @memberOf _
  9595. * @since 4.0.0
  9596. * @category Lang
  9597. * @param {*} value The value to check.
  9598. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  9599. * @example
  9600. *
  9601. * _.isSymbol(Symbol.iterator);
  9602. * // => true
  9603. *
  9604. * _.isSymbol('abc');
  9605. * // => false
  9606. */
  9607. function isSymbol(value) {
  9608. return typeof value == 'symbol' ||
  9609. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  9610. }
  9611. /**
  9612. * Converts `value` to a string. An empty string is returned for `null`
  9613. * and `undefined` values. The sign of `-0` is preserved.
  9614. *
  9615. * @static
  9616. * @memberOf _
  9617. * @since 4.0.0
  9618. * @category Lang
  9619. * @param {*} value The value to process.
  9620. * @returns {string} Returns the string.
  9621. * @example
  9622. *
  9623. * _.toString(null);
  9624. * // => ''
  9625. *
  9626. * _.toString(-0);
  9627. * // => '-0'
  9628. *
  9629. * _.toString([1, 2, 3]);
  9630. * // => '1,2,3'
  9631. */
  9632. function toString(value) {
  9633. return value == null ? '' : baseToString(value);
  9634. }
  9635. /**
  9636. * Gets the value at `path` of `object`. If the resolved value is
  9637. * `undefined`, the `defaultValue` is returned in its place.
  9638. *
  9639. * @static
  9640. * @memberOf _
  9641. * @since 3.7.0
  9642. * @category Object
  9643. * @param {Object} object The object to query.
  9644. * @param {Array|string} path The path of the property to get.
  9645. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  9646. * @returns {*} Returns the resolved value.
  9647. * @example
  9648. *
  9649. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  9650. *
  9651. * _.get(object, 'a[0].b.c');
  9652. * // => 3
  9653. *
  9654. * _.get(object, ['a', '0', 'b', 'c']);
  9655. * // => 3
  9656. *
  9657. * _.get(object, 'a.b.c', 'default');
  9658. * // => 'default'
  9659. */
  9660. function get(object, path, defaultValue) {
  9661. var result = object == null ? undefined : baseGet(object, path);
  9662. return result === undefined ? defaultValue : result;
  9663. }
  9664. module.exports = get;
  9665. /***/ }),
  9666. /***/ 855:
  9667. /***/ (function(module, __unusedexports, __webpack_require__) {
  9668. module.exports = registerPlugin;
  9669. const factory = __webpack_require__(47);
  9670. function registerPlugin(plugins, pluginFunction) {
  9671. return factory(
  9672. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  9673. );
  9674. }
  9675. /***/ }),
  9676. /***/ 863:
  9677. /***/ (function(module, __unusedexports, __webpack_require__) {
  9678. module.exports = authenticationBeforeRequest;
  9679. const btoa = __webpack_require__(675);
  9680. const withAuthorizationPrefix = __webpack_require__(143);
  9681. function authenticationBeforeRequest(state, options) {
  9682. if (typeof state.auth === "string") {
  9683. options.headers.authorization = withAuthorizationPrefix(state.auth);
  9684. // https://developer.github.com/v3/previews/#integrations
  9685. if (
  9686. /^bearer /i.test(state.auth) &&
  9687. !/machine-man/.test(options.headers.accept)
  9688. ) {
  9689. const acceptHeaders = options.headers.accept
  9690. .split(",")
  9691. .concat("application/vnd.github.machine-man-preview+json");
  9692. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  9693. }
  9694. return;
  9695. }
  9696. if (state.auth.username) {
  9697. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  9698. options.headers.authorization = `Basic ${hash}`;
  9699. if (state.otp) {
  9700. options.headers["x-github-otp"] = state.otp;
  9701. }
  9702. return;
  9703. }
  9704. if (state.auth.clientId) {
  9705. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  9706. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  9707. // URL though: `/applications/:client_id/tokens/:access_token`.
  9708. //
  9709. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  9710. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  9711. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  9712. //
  9713. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  9714. // as well as "/applications/123/tokens/token456"
  9715. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  9716. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  9717. options.headers.authorization = `Basic ${hash}`;
  9718. return;
  9719. }
  9720. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  9721. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  9722. return;
  9723. }
  9724. return Promise.resolve()
  9725. .then(() => {
  9726. return state.auth();
  9727. })
  9728. .then(authorization => {
  9729. options.headers.authorization = withAuthorizationPrefix(authorization);
  9730. });
  9731. }
  9732. /***/ }),
  9733. /***/ 866:
  9734. /***/ (function(module, __unusedexports, __webpack_require__) {
  9735. "use strict";
  9736. var shebangRegex = __webpack_require__(816);
  9737. module.exports = function (str) {
  9738. var match = str.match(shebangRegex);
  9739. if (!match) {
  9740. return null;
  9741. }
  9742. var arr = match[0].replace(/#! ?/, '').split(' ');
  9743. var bin = arr[0].split('/').pop();
  9744. var arg = arr[1];
  9745. return (bin === 'env' ?
  9746. arg :
  9747. bin + (arg ? ' ' + arg : '')
  9748. );
  9749. };
  9750. /***/ }),
  9751. /***/ 881:
  9752. /***/ (function(module) {
  9753. "use strict";
  9754. const isWin = process.platform === 'win32';
  9755. function notFoundError(original, syscall) {
  9756. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  9757. code: 'ENOENT',
  9758. errno: 'ENOENT',
  9759. syscall: `${syscall} ${original.command}`,
  9760. path: original.command,
  9761. spawnargs: original.args,
  9762. });
  9763. }
  9764. function hookChildProcess(cp, parsed) {
  9765. if (!isWin) {
  9766. return;
  9767. }
  9768. const originalEmit = cp.emit;
  9769. cp.emit = function (name, arg1) {
  9770. // If emitting "exit" event and exit code is 1, we need to check if
  9771. // the command exists and emit an "error" instead
  9772. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  9773. if (name === 'exit') {
  9774. const err = verifyENOENT(arg1, parsed, 'spawn');
  9775. if (err) {
  9776. return originalEmit.call(cp, 'error', err);
  9777. }
  9778. }
  9779. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  9780. };
  9781. }
  9782. function verifyENOENT(status, parsed) {
  9783. if (isWin && status === 1 && !parsed.file) {
  9784. return notFoundError(parsed.original, 'spawn');
  9785. }
  9786. return null;
  9787. }
  9788. function verifyENOENTSync(status, parsed) {
  9789. if (isWin && status === 1 && !parsed.file) {
  9790. return notFoundError(parsed.original, 'spawnSync');
  9791. }
  9792. return null;
  9793. }
  9794. module.exports = {
  9795. hookChildProcess,
  9796. verifyENOENT,
  9797. verifyENOENTSync,
  9798. notFoundError,
  9799. };
  9800. /***/ }),
  9801. /***/ 883:
  9802. /***/ (function(module) {
  9803. /**
  9804. * lodash (Custom Build) <https://lodash.com/>
  9805. * Build: `lodash modularize exports="npm" -o ./`
  9806. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  9807. * Released under MIT license <https://lodash.com/license>
  9808. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  9809. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  9810. */
  9811. /** Used as the `TypeError` message for "Functions" methods. */
  9812. var FUNC_ERROR_TEXT = 'Expected a function';
  9813. /** Used to stand-in for `undefined` hash values. */
  9814. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  9815. /** Used as references for various `Number` constants. */
  9816. var INFINITY = 1 / 0,
  9817. MAX_SAFE_INTEGER = 9007199254740991;
  9818. /** `Object#toString` result references. */
  9819. var funcTag = '[object Function]',
  9820. genTag = '[object GeneratorFunction]',
  9821. symbolTag = '[object Symbol]';
  9822. /** Used to match property names within property paths. */
  9823. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  9824. reIsPlainProp = /^\w*$/,
  9825. reLeadingDot = /^\./,
  9826. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  9827. /**
  9828. * Used to match `RegExp`
  9829. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  9830. */
  9831. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  9832. /** Used to match backslashes in property paths. */
  9833. var reEscapeChar = /\\(\\)?/g;
  9834. /** Used to detect host constructors (Safari). */
  9835. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  9836. /** Used to detect unsigned integer values. */
  9837. var reIsUint = /^(?:0|[1-9]\d*)$/;
  9838. /** Detect free variable `global` from Node.js. */
  9839. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  9840. /** Detect free variable `self`. */
  9841. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  9842. /** Used as a reference to the global object. */
  9843. var root = freeGlobal || freeSelf || Function('return this')();
  9844. /**
  9845. * Gets the value at `key` of `object`.
  9846. *
  9847. * @private
  9848. * @param {Object} [object] The object to query.
  9849. * @param {string} key The key of the property to get.
  9850. * @returns {*} Returns the property value.
  9851. */
  9852. function getValue(object, key) {
  9853. return object == null ? undefined : object[key];
  9854. }
  9855. /**
  9856. * Checks if `value` is a host object in IE < 9.
  9857. *
  9858. * @private
  9859. * @param {*} value The value to check.
  9860. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  9861. */
  9862. function isHostObject(value) {
  9863. // Many host objects are `Object` objects that can coerce to strings
  9864. // despite having improperly defined `toString` methods.
  9865. var result = false;
  9866. if (value != null && typeof value.toString != 'function') {
  9867. try {
  9868. result = !!(value + '');
  9869. } catch (e) {}
  9870. }
  9871. return result;
  9872. }
  9873. /** Used for built-in method references. */
  9874. var arrayProto = Array.prototype,
  9875. funcProto = Function.prototype,
  9876. objectProto = Object.prototype;
  9877. /** Used to detect overreaching core-js shims. */
  9878. var coreJsData = root['__core-js_shared__'];
  9879. /** Used to detect methods masquerading as native. */
  9880. var maskSrcKey = (function() {
  9881. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  9882. return uid ? ('Symbol(src)_1.' + uid) : '';
  9883. }());
  9884. /** Used to resolve the decompiled source of functions. */
  9885. var funcToString = funcProto.toString;
  9886. /** Used to check objects for own properties. */
  9887. var hasOwnProperty = objectProto.hasOwnProperty;
  9888. /**
  9889. * Used to resolve the
  9890. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  9891. * of values.
  9892. */
  9893. var objectToString = objectProto.toString;
  9894. /** Used to detect if a method is native. */
  9895. var reIsNative = RegExp('^' +
  9896. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  9897. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  9898. );
  9899. /** Built-in value references. */
  9900. var Symbol = root.Symbol,
  9901. splice = arrayProto.splice;
  9902. /* Built-in method references that are verified to be native. */
  9903. var Map = getNative(root, 'Map'),
  9904. nativeCreate = getNative(Object, 'create');
  9905. /** Used to convert symbols to primitives and strings. */
  9906. var symbolProto = Symbol ? Symbol.prototype : undefined,
  9907. symbolToString = symbolProto ? symbolProto.toString : undefined;
  9908. /**
  9909. * Creates a hash object.
  9910. *
  9911. * @private
  9912. * @constructor
  9913. * @param {Array} [entries] The key-value pairs to cache.
  9914. */
  9915. function Hash(entries) {
  9916. var index = -1,
  9917. length = entries ? entries.length : 0;
  9918. this.clear();
  9919. while (++index < length) {
  9920. var entry = entries[index];
  9921. this.set(entry[0], entry[1]);
  9922. }
  9923. }
  9924. /**
  9925. * Removes all key-value entries from the hash.
  9926. *
  9927. * @private
  9928. * @name clear
  9929. * @memberOf Hash
  9930. */
  9931. function hashClear() {
  9932. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  9933. }
  9934. /**
  9935. * Removes `key` and its value from the hash.
  9936. *
  9937. * @private
  9938. * @name delete
  9939. * @memberOf Hash
  9940. * @param {Object} hash The hash to modify.
  9941. * @param {string} key The key of the value to remove.
  9942. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9943. */
  9944. function hashDelete(key) {
  9945. return this.has(key) && delete this.__data__[key];
  9946. }
  9947. /**
  9948. * Gets the hash value for `key`.
  9949. *
  9950. * @private
  9951. * @name get
  9952. * @memberOf Hash
  9953. * @param {string} key The key of the value to get.
  9954. * @returns {*} Returns the entry value.
  9955. */
  9956. function hashGet(key) {
  9957. var data = this.__data__;
  9958. if (nativeCreate) {
  9959. var result = data[key];
  9960. return result === HASH_UNDEFINED ? undefined : result;
  9961. }
  9962. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  9963. }
  9964. /**
  9965. * Checks if a hash value for `key` exists.
  9966. *
  9967. * @private
  9968. * @name has
  9969. * @memberOf Hash
  9970. * @param {string} key The key of the entry to check.
  9971. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9972. */
  9973. function hashHas(key) {
  9974. var data = this.__data__;
  9975. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  9976. }
  9977. /**
  9978. * Sets the hash `key` to `value`.
  9979. *
  9980. * @private
  9981. * @name set
  9982. * @memberOf Hash
  9983. * @param {string} key The key of the value to set.
  9984. * @param {*} value The value to set.
  9985. * @returns {Object} Returns the hash instance.
  9986. */
  9987. function hashSet(key, value) {
  9988. var data = this.__data__;
  9989. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  9990. return this;
  9991. }
  9992. // Add methods to `Hash`.
  9993. Hash.prototype.clear = hashClear;
  9994. Hash.prototype['delete'] = hashDelete;
  9995. Hash.prototype.get = hashGet;
  9996. Hash.prototype.has = hashHas;
  9997. Hash.prototype.set = hashSet;
  9998. /**
  9999. * Creates an list cache object.
  10000. *
  10001. * @private
  10002. * @constructor
  10003. * @param {Array} [entries] The key-value pairs to cache.
  10004. */
  10005. function ListCache(entries) {
  10006. var index = -1,
  10007. length = entries ? entries.length : 0;
  10008. this.clear();
  10009. while (++index < length) {
  10010. var entry = entries[index];
  10011. this.set(entry[0], entry[1]);
  10012. }
  10013. }
  10014. /**
  10015. * Removes all key-value entries from the list cache.
  10016. *
  10017. * @private
  10018. * @name clear
  10019. * @memberOf ListCache
  10020. */
  10021. function listCacheClear() {
  10022. this.__data__ = [];
  10023. }
  10024. /**
  10025. * Removes `key` and its value from the list cache.
  10026. *
  10027. * @private
  10028. * @name delete
  10029. * @memberOf ListCache
  10030. * @param {string} key The key of the value to remove.
  10031. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10032. */
  10033. function listCacheDelete(key) {
  10034. var data = this.__data__,
  10035. index = assocIndexOf(data, key);
  10036. if (index < 0) {
  10037. return false;
  10038. }
  10039. var lastIndex = data.length - 1;
  10040. if (index == lastIndex) {
  10041. data.pop();
  10042. } else {
  10043. splice.call(data, index, 1);
  10044. }
  10045. return true;
  10046. }
  10047. /**
  10048. * Gets the list cache value for `key`.
  10049. *
  10050. * @private
  10051. * @name get
  10052. * @memberOf ListCache
  10053. * @param {string} key The key of the value to get.
  10054. * @returns {*} Returns the entry value.
  10055. */
  10056. function listCacheGet(key) {
  10057. var data = this.__data__,
  10058. index = assocIndexOf(data, key);
  10059. return index < 0 ? undefined : data[index][1];
  10060. }
  10061. /**
  10062. * Checks if a list cache value for `key` exists.
  10063. *
  10064. * @private
  10065. * @name has
  10066. * @memberOf ListCache
  10067. * @param {string} key The key of the entry to check.
  10068. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10069. */
  10070. function listCacheHas(key) {
  10071. return assocIndexOf(this.__data__, key) > -1;
  10072. }
  10073. /**
  10074. * Sets the list cache `key` to `value`.
  10075. *
  10076. * @private
  10077. * @name set
  10078. * @memberOf ListCache
  10079. * @param {string} key The key of the value to set.
  10080. * @param {*} value The value to set.
  10081. * @returns {Object} Returns the list cache instance.
  10082. */
  10083. function listCacheSet(key, value) {
  10084. var data = this.__data__,
  10085. index = assocIndexOf(data, key);
  10086. if (index < 0) {
  10087. data.push([key, value]);
  10088. } else {
  10089. data[index][1] = value;
  10090. }
  10091. return this;
  10092. }
  10093. // Add methods to `ListCache`.
  10094. ListCache.prototype.clear = listCacheClear;
  10095. ListCache.prototype['delete'] = listCacheDelete;
  10096. ListCache.prototype.get = listCacheGet;
  10097. ListCache.prototype.has = listCacheHas;
  10098. ListCache.prototype.set = listCacheSet;
  10099. /**
  10100. * Creates a map cache object to store key-value pairs.
  10101. *
  10102. * @private
  10103. * @constructor
  10104. * @param {Array} [entries] The key-value pairs to cache.
  10105. */
  10106. function MapCache(entries) {
  10107. var index = -1,
  10108. length = entries ? entries.length : 0;
  10109. this.clear();
  10110. while (++index < length) {
  10111. var entry = entries[index];
  10112. this.set(entry[0], entry[1]);
  10113. }
  10114. }
  10115. /**
  10116. * Removes all key-value entries from the map.
  10117. *
  10118. * @private
  10119. * @name clear
  10120. * @memberOf MapCache
  10121. */
  10122. function mapCacheClear() {
  10123. this.__data__ = {
  10124. 'hash': new Hash,
  10125. 'map': new (Map || ListCache),
  10126. 'string': new Hash
  10127. };
  10128. }
  10129. /**
  10130. * Removes `key` and its value from the map.
  10131. *
  10132. * @private
  10133. * @name delete
  10134. * @memberOf MapCache
  10135. * @param {string} key The key of the value to remove.
  10136. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10137. */
  10138. function mapCacheDelete(key) {
  10139. return getMapData(this, key)['delete'](key);
  10140. }
  10141. /**
  10142. * Gets the map value for `key`.
  10143. *
  10144. * @private
  10145. * @name get
  10146. * @memberOf MapCache
  10147. * @param {string} key The key of the value to get.
  10148. * @returns {*} Returns the entry value.
  10149. */
  10150. function mapCacheGet(key) {
  10151. return getMapData(this, key).get(key);
  10152. }
  10153. /**
  10154. * Checks if a map value for `key` exists.
  10155. *
  10156. * @private
  10157. * @name has
  10158. * @memberOf MapCache
  10159. * @param {string} key The key of the entry to check.
  10160. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10161. */
  10162. function mapCacheHas(key) {
  10163. return getMapData(this, key).has(key);
  10164. }
  10165. /**
  10166. * Sets the map `key` to `value`.
  10167. *
  10168. * @private
  10169. * @name set
  10170. * @memberOf MapCache
  10171. * @param {string} key The key of the value to set.
  10172. * @param {*} value The value to set.
  10173. * @returns {Object} Returns the map cache instance.
  10174. */
  10175. function mapCacheSet(key, value) {
  10176. getMapData(this, key).set(key, value);
  10177. return this;
  10178. }
  10179. // Add methods to `MapCache`.
  10180. MapCache.prototype.clear = mapCacheClear;
  10181. MapCache.prototype['delete'] = mapCacheDelete;
  10182. MapCache.prototype.get = mapCacheGet;
  10183. MapCache.prototype.has = mapCacheHas;
  10184. MapCache.prototype.set = mapCacheSet;
  10185. /**
  10186. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  10187. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10188. * for equality comparisons.
  10189. *
  10190. * @private
  10191. * @param {Object} object The object to modify.
  10192. * @param {string} key The key of the property to assign.
  10193. * @param {*} value The value to assign.
  10194. */
  10195. function assignValue(object, key, value) {
  10196. var objValue = object[key];
  10197. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  10198. (value === undefined && !(key in object))) {
  10199. object[key] = value;
  10200. }
  10201. }
  10202. /**
  10203. * Gets the index at which the `key` is found in `array` of key-value pairs.
  10204. *
  10205. * @private
  10206. * @param {Array} array The array to inspect.
  10207. * @param {*} key The key to search for.
  10208. * @returns {number} Returns the index of the matched value, else `-1`.
  10209. */
  10210. function assocIndexOf(array, key) {
  10211. var length = array.length;
  10212. while (length--) {
  10213. if (eq(array[length][0], key)) {
  10214. return length;
  10215. }
  10216. }
  10217. return -1;
  10218. }
  10219. /**
  10220. * The base implementation of `_.isNative` without bad shim checks.
  10221. *
  10222. * @private
  10223. * @param {*} value The value to check.
  10224. * @returns {boolean} Returns `true` if `value` is a native function,
  10225. * else `false`.
  10226. */
  10227. function baseIsNative(value) {
  10228. if (!isObject(value) || isMasked(value)) {
  10229. return false;
  10230. }
  10231. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  10232. return pattern.test(toSource(value));
  10233. }
  10234. /**
  10235. * The base implementation of `_.set`.
  10236. *
  10237. * @private
  10238. * @param {Object} object The object to modify.
  10239. * @param {Array|string} path The path of the property to set.
  10240. * @param {*} value The value to set.
  10241. * @param {Function} [customizer] The function to customize path creation.
  10242. * @returns {Object} Returns `object`.
  10243. */
  10244. function baseSet(object, path, value, customizer) {
  10245. if (!isObject(object)) {
  10246. return object;
  10247. }
  10248. path = isKey(path, object) ? [path] : castPath(path);
  10249. var index = -1,
  10250. length = path.length,
  10251. lastIndex = length - 1,
  10252. nested = object;
  10253. while (nested != null && ++index < length) {
  10254. var key = toKey(path[index]),
  10255. newValue = value;
  10256. if (index != lastIndex) {
  10257. var objValue = nested[key];
  10258. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10259. if (newValue === undefined) {
  10260. newValue = isObject(objValue)
  10261. ? objValue
  10262. : (isIndex(path[index + 1]) ? [] : {});
  10263. }
  10264. }
  10265. assignValue(nested, key, newValue);
  10266. nested = nested[key];
  10267. }
  10268. return object;
  10269. }
  10270. /**
  10271. * The base implementation of `_.toString` which doesn't convert nullish
  10272. * values to empty strings.
  10273. *
  10274. * @private
  10275. * @param {*} value The value to process.
  10276. * @returns {string} Returns the string.
  10277. */
  10278. function baseToString(value) {
  10279. // Exit early for strings to avoid a performance hit in some environments.
  10280. if (typeof value == 'string') {
  10281. return value;
  10282. }
  10283. if (isSymbol(value)) {
  10284. return symbolToString ? symbolToString.call(value) : '';
  10285. }
  10286. var result = (value + '');
  10287. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10288. }
  10289. /**
  10290. * Casts `value` to a path array if it's not one.
  10291. *
  10292. * @private
  10293. * @param {*} value The value to inspect.
  10294. * @returns {Array} Returns the cast property path array.
  10295. */
  10296. function castPath(value) {
  10297. return isArray(value) ? value : stringToPath(value);
  10298. }
  10299. /**
  10300. * Gets the data for `map`.
  10301. *
  10302. * @private
  10303. * @param {Object} map The map to query.
  10304. * @param {string} key The reference key.
  10305. * @returns {*} Returns the map data.
  10306. */
  10307. function getMapData(map, key) {
  10308. var data = map.__data__;
  10309. return isKeyable(key)
  10310. ? data[typeof key == 'string' ? 'string' : 'hash']
  10311. : data.map;
  10312. }
  10313. /**
  10314. * Gets the native function at `key` of `object`.
  10315. *
  10316. * @private
  10317. * @param {Object} object The object to query.
  10318. * @param {string} key The key of the method to get.
  10319. * @returns {*} Returns the function if it's native, else `undefined`.
  10320. */
  10321. function getNative(object, key) {
  10322. var value = getValue(object, key);
  10323. return baseIsNative(value) ? value : undefined;
  10324. }
  10325. /**
  10326. * Checks if `value` is a valid array-like index.
  10327. *
  10328. * @private
  10329. * @param {*} value The value to check.
  10330. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  10331. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  10332. */
  10333. function isIndex(value, length) {
  10334. length = length == null ? MAX_SAFE_INTEGER : length;
  10335. return !!length &&
  10336. (typeof value == 'number' || reIsUint.test(value)) &&
  10337. (value > -1 && value % 1 == 0 && value < length);
  10338. }
  10339. /**
  10340. * Checks if `value` is a property name and not a property path.
  10341. *
  10342. * @private
  10343. * @param {*} value The value to check.
  10344. * @param {Object} [object] The object to query keys on.
  10345. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  10346. */
  10347. function isKey(value, object) {
  10348. if (isArray(value)) {
  10349. return false;
  10350. }
  10351. var type = typeof value;
  10352. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  10353. value == null || isSymbol(value)) {
  10354. return true;
  10355. }
  10356. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  10357. (object != null && value in Object(object));
  10358. }
  10359. /**
  10360. * Checks if `value` is suitable for use as unique object key.
  10361. *
  10362. * @private
  10363. * @param {*} value The value to check.
  10364. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  10365. */
  10366. function isKeyable(value) {
  10367. var type = typeof value;
  10368. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  10369. ? (value !== '__proto__')
  10370. : (value === null);
  10371. }
  10372. /**
  10373. * Checks if `func` has its source masked.
  10374. *
  10375. * @private
  10376. * @param {Function} func The function to check.
  10377. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  10378. */
  10379. function isMasked(func) {
  10380. return !!maskSrcKey && (maskSrcKey in func);
  10381. }
  10382. /**
  10383. * Converts `string` to a property path array.
  10384. *
  10385. * @private
  10386. * @param {string} string The string to convert.
  10387. * @returns {Array} Returns the property path array.
  10388. */
  10389. var stringToPath = memoize(function(string) {
  10390. string = toString(string);
  10391. var result = [];
  10392. if (reLeadingDot.test(string)) {
  10393. result.push('');
  10394. }
  10395. string.replace(rePropName, function(match, number, quote, string) {
  10396. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  10397. });
  10398. return result;
  10399. });
  10400. /**
  10401. * Converts `value` to a string key if it's not a string or symbol.
  10402. *
  10403. * @private
  10404. * @param {*} value The value to inspect.
  10405. * @returns {string|symbol} Returns the key.
  10406. */
  10407. function toKey(value) {
  10408. if (typeof value == 'string' || isSymbol(value)) {
  10409. return value;
  10410. }
  10411. var result = (value + '');
  10412. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10413. }
  10414. /**
  10415. * Converts `func` to its source code.
  10416. *
  10417. * @private
  10418. * @param {Function} func The function to process.
  10419. * @returns {string} Returns the source code.
  10420. */
  10421. function toSource(func) {
  10422. if (func != null) {
  10423. try {
  10424. return funcToString.call(func);
  10425. } catch (e) {}
  10426. try {
  10427. return (func + '');
  10428. } catch (e) {}
  10429. }
  10430. return '';
  10431. }
  10432. /**
  10433. * Creates a function that memoizes the result of `func`. If `resolver` is
  10434. * provided, it determines the cache key for storing the result based on the
  10435. * arguments provided to the memoized function. By default, the first argument
  10436. * provided to the memoized function is used as the map cache key. The `func`
  10437. * is invoked with the `this` binding of the memoized function.
  10438. *
  10439. * **Note:** The cache is exposed as the `cache` property on the memoized
  10440. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10441. * constructor with one whose instances implement the
  10442. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10443. * method interface of `delete`, `get`, `has`, and `set`.
  10444. *
  10445. * @static
  10446. * @memberOf _
  10447. * @since 0.1.0
  10448. * @category Function
  10449. * @param {Function} func The function to have its output memoized.
  10450. * @param {Function} [resolver] The function to resolve the cache key.
  10451. * @returns {Function} Returns the new memoized function.
  10452. * @example
  10453. *
  10454. * var object = { 'a': 1, 'b': 2 };
  10455. * var other = { 'c': 3, 'd': 4 };
  10456. *
  10457. * var values = _.memoize(_.values);
  10458. * values(object);
  10459. * // => [1, 2]
  10460. *
  10461. * values(other);
  10462. * // => [3, 4]
  10463. *
  10464. * object.a = 2;
  10465. * values(object);
  10466. * // => [1, 2]
  10467. *
  10468. * // Modify the result cache.
  10469. * values.cache.set(object, ['a', 'b']);
  10470. * values(object);
  10471. * // => ['a', 'b']
  10472. *
  10473. * // Replace `_.memoize.Cache`.
  10474. * _.memoize.Cache = WeakMap;
  10475. */
  10476. function memoize(func, resolver) {
  10477. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  10478. throw new TypeError(FUNC_ERROR_TEXT);
  10479. }
  10480. var memoized = function() {
  10481. var args = arguments,
  10482. key = resolver ? resolver.apply(this, args) : args[0],
  10483. cache = memoized.cache;
  10484. if (cache.has(key)) {
  10485. return cache.get(key);
  10486. }
  10487. var result = func.apply(this, args);
  10488. memoized.cache = cache.set(key, result);
  10489. return result;
  10490. };
  10491. memoized.cache = new (memoize.Cache || MapCache);
  10492. return memoized;
  10493. }
  10494. // Assign cache to `_.memoize`.
  10495. memoize.Cache = MapCache;
  10496. /**
  10497. * Performs a
  10498. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10499. * comparison between two values to determine if they are equivalent.
  10500. *
  10501. * @static
  10502. * @memberOf _
  10503. * @since 4.0.0
  10504. * @category Lang
  10505. * @param {*} value The value to compare.
  10506. * @param {*} other The other value to compare.
  10507. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  10508. * @example
  10509. *
  10510. * var object = { 'a': 1 };
  10511. * var other = { 'a': 1 };
  10512. *
  10513. * _.eq(object, object);
  10514. * // => true
  10515. *
  10516. * _.eq(object, other);
  10517. * // => false
  10518. *
  10519. * _.eq('a', 'a');
  10520. * // => true
  10521. *
  10522. * _.eq('a', Object('a'));
  10523. * // => false
  10524. *
  10525. * _.eq(NaN, NaN);
  10526. * // => true
  10527. */
  10528. function eq(value, other) {
  10529. return value === other || (value !== value && other !== other);
  10530. }
  10531. /**
  10532. * Checks if `value` is classified as an `Array` object.
  10533. *
  10534. * @static
  10535. * @memberOf _
  10536. * @since 0.1.0
  10537. * @category Lang
  10538. * @param {*} value The value to check.
  10539. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  10540. * @example
  10541. *
  10542. * _.isArray([1, 2, 3]);
  10543. * // => true
  10544. *
  10545. * _.isArray(document.body.children);
  10546. * // => false
  10547. *
  10548. * _.isArray('abc');
  10549. * // => false
  10550. *
  10551. * _.isArray(_.noop);
  10552. * // => false
  10553. */
  10554. var isArray = Array.isArray;
  10555. /**
  10556. * Checks if `value` is classified as a `Function` object.
  10557. *
  10558. * @static
  10559. * @memberOf _
  10560. * @since 0.1.0
  10561. * @category Lang
  10562. * @param {*} value The value to check.
  10563. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10564. * @example
  10565. *
  10566. * _.isFunction(_);
  10567. * // => true
  10568. *
  10569. * _.isFunction(/abc/);
  10570. * // => false
  10571. */
  10572. function isFunction(value) {
  10573. // The use of `Object#toString` avoids issues with the `typeof` operator
  10574. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  10575. var tag = isObject(value) ? objectToString.call(value) : '';
  10576. return tag == funcTag || tag == genTag;
  10577. }
  10578. /**
  10579. * Checks if `value` is the
  10580. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10581. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10582. *
  10583. * @static
  10584. * @memberOf _
  10585. * @since 0.1.0
  10586. * @category Lang
  10587. * @param {*} value The value to check.
  10588. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10589. * @example
  10590. *
  10591. * _.isObject({});
  10592. * // => true
  10593. *
  10594. * _.isObject([1, 2, 3]);
  10595. * // => true
  10596. *
  10597. * _.isObject(_.noop);
  10598. * // => true
  10599. *
  10600. * _.isObject(null);
  10601. * // => false
  10602. */
  10603. function isObject(value) {
  10604. var type = typeof value;
  10605. return !!value && (type == 'object' || type == 'function');
  10606. }
  10607. /**
  10608. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10609. * and has a `typeof` result of "object".
  10610. *
  10611. * @static
  10612. * @memberOf _
  10613. * @since 4.0.0
  10614. * @category Lang
  10615. * @param {*} value The value to check.
  10616. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10617. * @example
  10618. *
  10619. * _.isObjectLike({});
  10620. * // => true
  10621. *
  10622. * _.isObjectLike([1, 2, 3]);
  10623. * // => true
  10624. *
  10625. * _.isObjectLike(_.noop);
  10626. * // => false
  10627. *
  10628. * _.isObjectLike(null);
  10629. * // => false
  10630. */
  10631. function isObjectLike(value) {
  10632. return !!value && typeof value == 'object';
  10633. }
  10634. /**
  10635. * Checks if `value` is classified as a `Symbol` primitive or object.
  10636. *
  10637. * @static
  10638. * @memberOf _
  10639. * @since 4.0.0
  10640. * @category Lang
  10641. * @param {*} value The value to check.
  10642. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10643. * @example
  10644. *
  10645. * _.isSymbol(Symbol.iterator);
  10646. * // => true
  10647. *
  10648. * _.isSymbol('abc');
  10649. * // => false
  10650. */
  10651. function isSymbol(value) {
  10652. return typeof value == 'symbol' ||
  10653. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  10654. }
  10655. /**
  10656. * Converts `value` to a string. An empty string is returned for `null`
  10657. * and `undefined` values. The sign of `-0` is preserved.
  10658. *
  10659. * @static
  10660. * @memberOf _
  10661. * @since 4.0.0
  10662. * @category Lang
  10663. * @param {*} value The value to process.
  10664. * @returns {string} Returns the string.
  10665. * @example
  10666. *
  10667. * _.toString(null);
  10668. * // => ''
  10669. *
  10670. * _.toString(-0);
  10671. * // => '-0'
  10672. *
  10673. * _.toString([1, 2, 3]);
  10674. * // => '1,2,3'
  10675. */
  10676. function toString(value) {
  10677. return value == null ? '' : baseToString(value);
  10678. }
  10679. /**
  10680. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  10681. * it's created. Arrays are created for missing index properties while objects
  10682. * are created for all other missing properties. Use `_.setWith` to customize
  10683. * `path` creation.
  10684. *
  10685. * **Note:** This method mutates `object`.
  10686. *
  10687. * @static
  10688. * @memberOf _
  10689. * @since 3.7.0
  10690. * @category Object
  10691. * @param {Object} object The object to modify.
  10692. * @param {Array|string} path The path of the property to set.
  10693. * @param {*} value The value to set.
  10694. * @returns {Object} Returns `object`.
  10695. * @example
  10696. *
  10697. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  10698. *
  10699. * _.set(object, 'a[0].b.c', 4);
  10700. * console.log(object.a[0].b.c);
  10701. * // => 4
  10702. *
  10703. * _.set(object, ['x', '0', 'y', 'z'], 5);
  10704. * console.log(object.x[0].y.z);
  10705. * // => 5
  10706. */
  10707. function set(object, path, value) {
  10708. return object == null ? object : baseSet(object, path, value);
  10709. }
  10710. module.exports = set;
  10711. /***/ }),
  10712. /***/ 898:
  10713. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10714. "use strict";
  10715. Object.defineProperty(exports, '__esModule', { value: true });
  10716. var request = __webpack_require__(753);
  10717. var universalUserAgent = __webpack_require__(796);
  10718. const VERSION = "4.3.1";
  10719. class GraphqlError extends Error {
  10720. constructor(request, response) {
  10721. const message = response.data.errors[0].message;
  10722. super(message);
  10723. Object.assign(this, response.data);
  10724. this.name = "GraphqlError";
  10725. this.request = request; // Maintains proper stack trace (only available on V8)
  10726. /* istanbul ignore next */
  10727. if (Error.captureStackTrace) {
  10728. Error.captureStackTrace(this, this.constructor);
  10729. }
  10730. }
  10731. }
  10732. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  10733. function graphql(request, query, options) {
  10734. options = typeof query === "string" ? options = Object.assign({
  10735. query
  10736. }, options) : options = query;
  10737. const requestOptions = Object.keys(options).reduce((result, key) => {
  10738. if (NON_VARIABLE_OPTIONS.includes(key)) {
  10739. result[key] = options[key];
  10740. return result;
  10741. }
  10742. if (!result.variables) {
  10743. result.variables = {};
  10744. }
  10745. result.variables[key] = options[key];
  10746. return result;
  10747. }, {});
  10748. return request(requestOptions).then(response => {
  10749. if (response.data.errors) {
  10750. throw new GraphqlError(requestOptions, {
  10751. data: response.data
  10752. });
  10753. }
  10754. return response.data.data;
  10755. });
  10756. }
  10757. function withDefaults(request$1, newDefaults) {
  10758. const newRequest = request$1.defaults(newDefaults);
  10759. const newApi = (query, options) => {
  10760. return graphql(newRequest, query, options);
  10761. };
  10762. return Object.assign(newApi, {
  10763. defaults: withDefaults.bind(null, newRequest),
  10764. endpoint: request.request.endpoint
  10765. });
  10766. }
  10767. const graphql$1 = withDefaults(request.request, {
  10768. headers: {
  10769. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10770. },
  10771. method: "POST",
  10772. url: "/graphql"
  10773. });
  10774. function withCustomRequest(customRequest) {
  10775. return withDefaults(customRequest, {
  10776. method: "POST",
  10777. url: "/graphql"
  10778. });
  10779. }
  10780. exports.graphql = graphql$1;
  10781. exports.withCustomRequest = withCustomRequest;
  10782. //# sourceMappingURL=index.js.map
  10783. /***/ }),
  10784. /***/ 899:
  10785. /***/ (function(module, __unusedexports, __webpack_require__) {
  10786. module.exports = registerEndpoints;
  10787. const { Deprecation } = __webpack_require__(692);
  10788. function registerEndpoints(octokit, routes) {
  10789. Object.keys(routes).forEach(namespaceName => {
  10790. if (!octokit[namespaceName]) {
  10791. octokit[namespaceName] = {};
  10792. }
  10793. Object.keys(routes[namespaceName]).forEach(apiName => {
  10794. const apiOptions = routes[namespaceName][apiName];
  10795. const endpointDefaults = ["method", "url", "headers"].reduce(
  10796. (map, key) => {
  10797. if (typeof apiOptions[key] !== "undefined") {
  10798. map[key] = apiOptions[key];
  10799. }
  10800. return map;
  10801. },
  10802. {}
  10803. );
  10804. endpointDefaults.request = {
  10805. validate: apiOptions.params
  10806. };
  10807. let request = octokit.request.defaults(endpointDefaults);
  10808. // patch request & endpoint methods to support deprecated parameters.
  10809. // Not the most elegant solution, but we don’t want to move deprecation
  10810. // logic into octokit/endpoint.js as it’s out of scope
  10811. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  10812. key => apiOptions.params[key].deprecated
  10813. );
  10814. if (hasDeprecatedParam) {
  10815. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  10816. request = patch(
  10817. octokit.request.defaults(endpointDefaults),
  10818. `.${namespaceName}.${apiName}()`
  10819. );
  10820. request.endpoint = patch(
  10821. request.endpoint,
  10822. `.${namespaceName}.${apiName}.endpoint()`
  10823. );
  10824. request.endpoint.merge = patch(
  10825. request.endpoint.merge,
  10826. `.${namespaceName}.${apiName}.endpoint.merge()`
  10827. );
  10828. }
  10829. if (apiOptions.deprecated) {
  10830. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  10831. octokit.log.warn(
  10832. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  10833. );
  10834. octokit[namespaceName][apiName] = request;
  10835. return request.apply(null, arguments);
  10836. };
  10837. return;
  10838. }
  10839. octokit[namespaceName][apiName] = request;
  10840. });
  10841. });
  10842. }
  10843. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  10844. const patchedMethod = options => {
  10845. options = Object.assign({}, options);
  10846. Object.keys(options).forEach(key => {
  10847. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  10848. const aliasKey = apiOptions.params[key].alias;
  10849. octokit.log.warn(
  10850. new Deprecation(
  10851. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  10852. )
  10853. );
  10854. if (!(aliasKey in options)) {
  10855. options[aliasKey] = options[key];
  10856. }
  10857. delete options[key];
  10858. }
  10859. });
  10860. return method(options);
  10861. };
  10862. Object.keys(method).forEach(key => {
  10863. patchedMethod[key] = method[key];
  10864. });
  10865. return patchedMethod;
  10866. }
  10867. /***/ }),
  10868. /***/ 929:
  10869. /***/ (function(module, __unusedexports, __webpack_require__) {
  10870. module.exports = hasNextPage
  10871. const deprecate = __webpack_require__(370)
  10872. const getPageLinks = __webpack_require__(577)
  10873. function hasNextPage (link) {
  10874. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10875. return getPageLinks(link).next
  10876. }
  10877. /***/ }),
  10878. /***/ 948:
  10879. /***/ (function(module) {
  10880. "use strict";
  10881. /**
  10882. * Tries to execute a function and discards any error that occurs.
  10883. * @param {Function} fn - Function that might or might not throw an error.
  10884. * @returns {?*} Return-value of the function when no error occurred.
  10885. */
  10886. module.exports = function(fn) {
  10887. try { return fn() } catch (e) {}
  10888. }
  10889. /***/ }),
  10890. /***/ 954:
  10891. /***/ (function(module) {
  10892. module.exports = validateAuth;
  10893. function validateAuth(auth) {
  10894. if (typeof auth === "string") {
  10895. return;
  10896. }
  10897. if (typeof auth === "function") {
  10898. return;
  10899. }
  10900. if (auth.username && auth.password) {
  10901. return;
  10902. }
  10903. if (auth.clientId && auth.clientSecret) {
  10904. return;
  10905. }
  10906. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  10907. }
  10908. /***/ }),
  10909. /***/ 955:
  10910. /***/ (function(module, __unusedexports, __webpack_require__) {
  10911. "use strict";
  10912. const path = __webpack_require__(622);
  10913. const childProcess = __webpack_require__(129);
  10914. const crossSpawn = __webpack_require__(20);
  10915. const stripEof = __webpack_require__(768);
  10916. const npmRunPath = __webpack_require__(621);
  10917. const isStream = __webpack_require__(323);
  10918. const _getStream = __webpack_require__(145);
  10919. const pFinally = __webpack_require__(697);
  10920. const onExit = __webpack_require__(260);
  10921. const errname = __webpack_require__(427);
  10922. const stdio = __webpack_require__(168);
  10923. const TEN_MEGABYTES = 1000 * 1000 * 10;
  10924. function handleArgs(cmd, args, opts) {
  10925. let parsed;
  10926. opts = Object.assign({
  10927. extendEnv: true,
  10928. env: {}
  10929. }, opts);
  10930. if (opts.extendEnv) {
  10931. opts.env = Object.assign({}, process.env, opts.env);
  10932. }
  10933. if (opts.__winShell === true) {
  10934. delete opts.__winShell;
  10935. parsed = {
  10936. command: cmd,
  10937. args,
  10938. options: opts,
  10939. file: cmd,
  10940. original: {
  10941. cmd,
  10942. args
  10943. }
  10944. };
  10945. } else {
  10946. parsed = crossSpawn._parse(cmd, args, opts);
  10947. }
  10948. opts = Object.assign({
  10949. maxBuffer: TEN_MEGABYTES,
  10950. buffer: true,
  10951. stripEof: true,
  10952. preferLocal: true,
  10953. localDir: parsed.options.cwd || process.cwd(),
  10954. encoding: 'utf8',
  10955. reject: true,
  10956. cleanup: true
  10957. }, parsed.options);
  10958. opts.stdio = stdio(opts);
  10959. if (opts.preferLocal) {
  10960. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  10961. }
  10962. if (opts.detached) {
  10963. // #115
  10964. opts.cleanup = false;
  10965. }
  10966. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  10967. // #116
  10968. parsed.args.unshift('/q');
  10969. }
  10970. return {
  10971. cmd: parsed.command,
  10972. args: parsed.args,
  10973. opts,
  10974. parsed
  10975. };
  10976. }
  10977. function handleInput(spawned, input) {
  10978. if (input === null || input === undefined) {
  10979. return;
  10980. }
  10981. if (isStream(input)) {
  10982. input.pipe(spawned.stdin);
  10983. } else {
  10984. spawned.stdin.end(input);
  10985. }
  10986. }
  10987. function handleOutput(opts, val) {
  10988. if (val && opts.stripEof) {
  10989. val = stripEof(val);
  10990. }
  10991. return val;
  10992. }
  10993. function handleShell(fn, cmd, opts) {
  10994. let file = '/bin/sh';
  10995. let args = ['-c', cmd];
  10996. opts = Object.assign({}, opts);
  10997. if (process.platform === 'win32') {
  10998. opts.__winShell = true;
  10999. file = process.env.comspec || 'cmd.exe';
  11000. args = ['/s', '/c', `"${cmd}"`];
  11001. opts.windowsVerbatimArguments = true;
  11002. }
  11003. if (opts.shell) {
  11004. file = opts.shell;
  11005. delete opts.shell;
  11006. }
  11007. return fn(file, args, opts);
  11008. }
  11009. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  11010. if (!process[stream]) {
  11011. return null;
  11012. }
  11013. let ret;
  11014. if (!buffer) {
  11015. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  11016. ret = new Promise((resolve, reject) => {
  11017. process[stream]
  11018. .once('end', resolve)
  11019. .once('error', reject);
  11020. });
  11021. } else if (encoding) {
  11022. ret = _getStream(process[stream], {
  11023. encoding,
  11024. maxBuffer
  11025. });
  11026. } else {
  11027. ret = _getStream.buffer(process[stream], {maxBuffer});
  11028. }
  11029. return ret.catch(err => {
  11030. err.stream = stream;
  11031. err.message = `${stream} ${err.message}`;
  11032. throw err;
  11033. });
  11034. }
  11035. function makeError(result, options) {
  11036. const {stdout, stderr} = result;
  11037. let err = result.error;
  11038. const {code, signal} = result;
  11039. const {parsed, joinedCmd} = options;
  11040. const timedOut = options.timedOut || false;
  11041. if (!err) {
  11042. let output = '';
  11043. if (Array.isArray(parsed.opts.stdio)) {
  11044. if (parsed.opts.stdio[2] !== 'inherit') {
  11045. output += output.length > 0 ? stderr : `\n${stderr}`;
  11046. }
  11047. if (parsed.opts.stdio[1] !== 'inherit') {
  11048. output += `\n${stdout}`;
  11049. }
  11050. } else if (parsed.opts.stdio !== 'inherit') {
  11051. output = `\n${stderr}${stdout}`;
  11052. }
  11053. err = new Error(`Command failed: ${joinedCmd}${output}`);
  11054. err.code = code < 0 ? errname(code) : code;
  11055. }
  11056. err.stdout = stdout;
  11057. err.stderr = stderr;
  11058. err.failed = true;
  11059. err.signal = signal || null;
  11060. err.cmd = joinedCmd;
  11061. err.timedOut = timedOut;
  11062. return err;
  11063. }
  11064. function joinCmd(cmd, args) {
  11065. let joinedCmd = cmd;
  11066. if (Array.isArray(args) && args.length > 0) {
  11067. joinedCmd += ' ' + args.join(' ');
  11068. }
  11069. return joinedCmd;
  11070. }
  11071. module.exports = (cmd, args, opts) => {
  11072. const parsed = handleArgs(cmd, args, opts);
  11073. const {encoding, buffer, maxBuffer} = parsed.opts;
  11074. const joinedCmd = joinCmd(cmd, args);
  11075. let spawned;
  11076. try {
  11077. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  11078. } catch (err) {
  11079. return Promise.reject(err);
  11080. }
  11081. let removeExitHandler;
  11082. if (parsed.opts.cleanup) {
  11083. removeExitHandler = onExit(() => {
  11084. spawned.kill();
  11085. });
  11086. }
  11087. let timeoutId = null;
  11088. let timedOut = false;
  11089. const cleanup = () => {
  11090. if (timeoutId) {
  11091. clearTimeout(timeoutId);
  11092. timeoutId = null;
  11093. }
  11094. if (removeExitHandler) {
  11095. removeExitHandler();
  11096. }
  11097. };
  11098. if (parsed.opts.timeout > 0) {
  11099. timeoutId = setTimeout(() => {
  11100. timeoutId = null;
  11101. timedOut = true;
  11102. spawned.kill(parsed.opts.killSignal);
  11103. }, parsed.opts.timeout);
  11104. }
  11105. const processDone = new Promise(resolve => {
  11106. spawned.on('exit', (code, signal) => {
  11107. cleanup();
  11108. resolve({code, signal});
  11109. });
  11110. spawned.on('error', err => {
  11111. cleanup();
  11112. resolve({error: err});
  11113. });
  11114. if (spawned.stdin) {
  11115. spawned.stdin.on('error', err => {
  11116. cleanup();
  11117. resolve({error: err});
  11118. });
  11119. }
  11120. });
  11121. function destroy() {
  11122. if (spawned.stdout) {
  11123. spawned.stdout.destroy();
  11124. }
  11125. if (spawned.stderr) {
  11126. spawned.stderr.destroy();
  11127. }
  11128. }
  11129. const handlePromise = () => pFinally(Promise.all([
  11130. processDone,
  11131. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  11132. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  11133. ]).then(arr => {
  11134. const result = arr[0];
  11135. result.stdout = arr[1];
  11136. result.stderr = arr[2];
  11137. if (result.error || result.code !== 0 || result.signal !== null) {
  11138. const err = makeError(result, {
  11139. joinedCmd,
  11140. parsed,
  11141. timedOut
  11142. });
  11143. // TODO: missing some timeout logic for killed
  11144. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  11145. // err.killed = spawned.killed || killed;
  11146. err.killed = err.killed || spawned.killed;
  11147. if (!parsed.opts.reject) {
  11148. return err;
  11149. }
  11150. throw err;
  11151. }
  11152. return {
  11153. stdout: handleOutput(parsed.opts, result.stdout),
  11154. stderr: handleOutput(parsed.opts, result.stderr),
  11155. code: 0,
  11156. failed: false,
  11157. killed: false,
  11158. signal: null,
  11159. cmd: joinedCmd,
  11160. timedOut: false
  11161. };
  11162. }), destroy);
  11163. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  11164. handleInput(spawned, parsed.opts.input);
  11165. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  11166. spawned.catch = onrejected => handlePromise().catch(onrejected);
  11167. return spawned;
  11168. };
  11169. // TODO: set `stderr: 'ignore'` when that option is implemented
  11170. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  11171. // TODO: set `stdout: 'ignore'` when that option is implemented
  11172. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  11173. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  11174. module.exports.sync = (cmd, args, opts) => {
  11175. const parsed = handleArgs(cmd, args, opts);
  11176. const joinedCmd = joinCmd(cmd, args);
  11177. if (isStream(parsed.opts.input)) {
  11178. throw new TypeError('The `input` option cannot be a stream in sync mode');
  11179. }
  11180. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  11181. result.code = result.status;
  11182. if (result.error || result.status !== 0 || result.signal !== null) {
  11183. const err = makeError(result, {
  11184. joinedCmd,
  11185. parsed
  11186. });
  11187. if (!parsed.opts.reject) {
  11188. return err;
  11189. }
  11190. throw err;
  11191. }
  11192. return {
  11193. stdout: handleOutput(parsed.opts, result.stdout),
  11194. stderr: handleOutput(parsed.opts, result.stderr),
  11195. code: 0,
  11196. failed: false,
  11197. signal: null,
  11198. cmd: joinedCmd,
  11199. timedOut: false
  11200. };
  11201. };
  11202. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  11203. /***/ }),
  11204. /***/ 966:
  11205. /***/ (function(module, __unusedexports, __webpack_require__) {
  11206. "use strict";
  11207. const {PassThrough} = __webpack_require__(413);
  11208. module.exports = options => {
  11209. options = Object.assign({}, options);
  11210. const {array} = options;
  11211. let {encoding} = options;
  11212. const buffer = encoding === 'buffer';
  11213. let objectMode = false;
  11214. if (array) {
  11215. objectMode = !(encoding || buffer);
  11216. } else {
  11217. encoding = encoding || 'utf8';
  11218. }
  11219. if (buffer) {
  11220. encoding = null;
  11221. }
  11222. let len = 0;
  11223. const ret = [];
  11224. const stream = new PassThrough({objectMode});
  11225. if (encoding) {
  11226. stream.setEncoding(encoding);
  11227. }
  11228. stream.on('data', chunk => {
  11229. ret.push(chunk);
  11230. if (objectMode) {
  11231. len = ret.length;
  11232. } else {
  11233. len += chunk.length;
  11234. }
  11235. });
  11236. stream.getBufferedValue = () => {
  11237. if (array) {
  11238. return ret;
  11239. }
  11240. return buffer ? Buffer.concat(ret, len) : ret.join('');
  11241. };
  11242. stream.getBufferedLength = () => len;
  11243. return stream;
  11244. };
  11245. /***/ }),
  11246. /***/ 969:
  11247. /***/ (function(module, __unusedexports, __webpack_require__) {
  11248. var wrappy = __webpack_require__(11)
  11249. module.exports = wrappy(once)
  11250. module.exports.strict = wrappy(onceStrict)
  11251. once.proto = once(function () {
  11252. Object.defineProperty(Function.prototype, 'once', {
  11253. value: function () {
  11254. return once(this)
  11255. },
  11256. configurable: true
  11257. })
  11258. Object.defineProperty(Function.prototype, 'onceStrict', {
  11259. value: function () {
  11260. return onceStrict(this)
  11261. },
  11262. configurable: true
  11263. })
  11264. })
  11265. function once (fn) {
  11266. var f = function () {
  11267. if (f.called) return f.value
  11268. f.called = true
  11269. return f.value = fn.apply(this, arguments)
  11270. }
  11271. f.called = false
  11272. return f
  11273. }
  11274. function onceStrict (fn) {
  11275. var f = function () {
  11276. if (f.called)
  11277. throw new Error(f.onceError)
  11278. f.called = true
  11279. return f.value = fn.apply(this, arguments)
  11280. }
  11281. var name = fn.name || 'Function wrapped with `once`'
  11282. f.onceError = name + " shouldn't be called more than once"
  11283. f.called = false
  11284. return f
  11285. }
  11286. /***/ }),
  11287. /***/ 986:
  11288. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11289. "use strict";
  11290. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11291. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11292. return new (P || (P = Promise))(function (resolve, reject) {
  11293. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11294. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11295. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11296. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11297. });
  11298. };
  11299. Object.defineProperty(exports, "__esModule", { value: true });
  11300. const tr = __webpack_require__(9);
  11301. /**
  11302. * Exec a command.
  11303. * Output will be streamed to the live console.
  11304. * Returns promise with return code
  11305. *
  11306. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  11307. * @param args optional arguments for tool. Escaping is handled by the lib.
  11308. * @param options optional exec options. See ExecOptions
  11309. * @returns Promise<number> exit code
  11310. */
  11311. function exec(commandLine, args, options) {
  11312. return __awaiter(this, void 0, void 0, function* () {
  11313. const commandArgs = tr.argStringToArray(commandLine);
  11314. if (commandArgs.length === 0) {
  11315. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  11316. }
  11317. // Path to tool to execute should be first arg
  11318. const toolPath = commandArgs[0];
  11319. args = commandArgs.slice(1).concat(args || []);
  11320. const runner = new tr.ToolRunner(toolPath, args, options);
  11321. return runner.exec();
  11322. });
  11323. }
  11324. exports.exec = exec;
  11325. //# sourceMappingURL=exec.js.map
  11326. /***/ }),
  11327. /***/ 991:
  11328. /***/ (function(module, __unusedexports, __webpack_require__) {
  11329. module.exports = authenticationRequestError;
  11330. const { RequestError } = __webpack_require__(463);
  11331. function authenticationRequestError(state, error, options) {
  11332. if (!error.headers) throw error;
  11333. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  11334. // handle "2FA required" error only
  11335. if (error.status !== 401 || !otpRequired) {
  11336. throw error;
  11337. }
  11338. if (
  11339. error.status === 401 &&
  11340. otpRequired &&
  11341. error.request &&
  11342. error.request.headers["x-github-otp"]
  11343. ) {
  11344. if (state.otp) {
  11345. delete state.otp; // no longer valid, request again
  11346. } else {
  11347. throw new RequestError(
  11348. "Invalid one-time password for two-factor authentication",
  11349. 401,
  11350. {
  11351. headers: error.headers,
  11352. request: options
  11353. }
  11354. );
  11355. }
  11356. }
  11357. if (typeof state.auth.on2fa !== "function") {
  11358. throw new RequestError(
  11359. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  11360. 401,
  11361. {
  11362. headers: error.headers,
  11363. request: options
  11364. }
  11365. );
  11366. }
  11367. return Promise.resolve()
  11368. .then(() => {
  11369. return state.auth.on2fa();
  11370. })
  11371. .then(oneTimePassword => {
  11372. const newOptions = Object.assign(options, {
  11373. headers: Object.assign(options.headers, {
  11374. "x-github-otp": oneTimePassword
  11375. })
  11376. });
  11377. return state.octokit.request(newOptions).then(response => {
  11378. // If OTP still valid, then persist it for following requests
  11379. state.otp = oneTimePassword;
  11380. return response;
  11381. });
  11382. });
  11383. }
  11384. /***/ })
  11385. /******/ });