index.js 500 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. module.exports = withDefaults
  48. const graphql = __webpack_require__(500)
  49. function withDefaults (request, newDefaults) {
  50. const newRequest = request.defaults(newDefaults)
  51. const newApi = function (query, options) {
  52. return graphql(newRequest, query, options)
  53. }
  54. newApi.defaults = withDefaults.bind(null, newRequest)
  55. return newApi
  56. }
  57. /***/ }),
  58. /***/ 1:
  59. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  60. "use strict";
  61. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  62. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  63. return new (P || (P = Promise))(function (resolve, reject) {
  64. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  65. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  66. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  67. step((generator = generator.apply(thisArg, _arguments || [])).next());
  68. });
  69. };
  70. Object.defineProperty(exports, "__esModule", { value: true });
  71. const childProcess = __webpack_require__(129);
  72. const path = __webpack_require__(622);
  73. const util_1 = __webpack_require__(669);
  74. const ioUtil = __webpack_require__(672);
  75. const exec = util_1.promisify(childProcess.exec);
  76. /**
  77. * Copies a file or folder.
  78. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  79. *
  80. * @param source source path
  81. * @param dest destination path
  82. * @param options optional. See CopyOptions.
  83. */
  84. function cp(source, dest, options = {}) {
  85. return __awaiter(this, void 0, void 0, function* () {
  86. const { force, recursive } = readCopyOptions(options);
  87. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  88. // Dest is an existing file, but not forcing
  89. if (destStat && destStat.isFile() && !force) {
  90. return;
  91. }
  92. // If dest is an existing directory, should copy inside.
  93. const newDest = destStat && destStat.isDirectory()
  94. ? path.join(dest, path.basename(source))
  95. : dest;
  96. if (!(yield ioUtil.exists(source))) {
  97. throw new Error(`no such file or directory: ${source}`);
  98. }
  99. const sourceStat = yield ioUtil.stat(source);
  100. if (sourceStat.isDirectory()) {
  101. if (!recursive) {
  102. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  103. }
  104. else {
  105. yield cpDirRecursive(source, newDest, 0, force);
  106. }
  107. }
  108. else {
  109. if (path.relative(source, newDest) === '') {
  110. // a file cannot be copied to itself
  111. throw new Error(`'${newDest}' and '${source}' are the same file`);
  112. }
  113. yield copyFile(source, newDest, force);
  114. }
  115. });
  116. }
  117. exports.cp = cp;
  118. /**
  119. * Moves a path.
  120. *
  121. * @param source source path
  122. * @param dest destination path
  123. * @param options optional. See MoveOptions.
  124. */
  125. function mv(source, dest, options = {}) {
  126. return __awaiter(this, void 0, void 0, function* () {
  127. if (yield ioUtil.exists(dest)) {
  128. let destExists = true;
  129. if (yield ioUtil.isDirectory(dest)) {
  130. // If dest is directory copy src into dest
  131. dest = path.join(dest, path.basename(source));
  132. destExists = yield ioUtil.exists(dest);
  133. }
  134. if (destExists) {
  135. if (options.force == null || options.force) {
  136. yield rmRF(dest);
  137. }
  138. else {
  139. throw new Error('Destination already exists');
  140. }
  141. }
  142. }
  143. yield mkdirP(path.dirname(dest));
  144. yield ioUtil.rename(source, dest);
  145. });
  146. }
  147. exports.mv = mv;
  148. /**
  149. * Remove a path recursively with force
  150. *
  151. * @param inputPath path to remove
  152. */
  153. function rmRF(inputPath) {
  154. return __awaiter(this, void 0, void 0, function* () {
  155. if (ioUtil.IS_WINDOWS) {
  156. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  157. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  158. try {
  159. if (yield ioUtil.isDirectory(inputPath, true)) {
  160. yield exec(`rd /s /q "${inputPath}"`);
  161. }
  162. else {
  163. yield exec(`del /f /a "${inputPath}"`);
  164. }
  165. }
  166. catch (err) {
  167. // if you try to delete a file that doesn't exist, desired result is achieved
  168. // other errors are valid
  169. if (err.code !== 'ENOENT')
  170. throw err;
  171. }
  172. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  173. try {
  174. yield ioUtil.unlink(inputPath);
  175. }
  176. catch (err) {
  177. // if you try to delete a file that doesn't exist, desired result is achieved
  178. // other errors are valid
  179. if (err.code !== 'ENOENT')
  180. throw err;
  181. }
  182. }
  183. else {
  184. let isDir = false;
  185. try {
  186. isDir = yield ioUtil.isDirectory(inputPath);
  187. }
  188. catch (err) {
  189. // if you try to delete a file that doesn't exist, desired result is achieved
  190. // other errors are valid
  191. if (err.code !== 'ENOENT')
  192. throw err;
  193. return;
  194. }
  195. if (isDir) {
  196. yield exec(`rm -rf "${inputPath}"`);
  197. }
  198. else {
  199. yield ioUtil.unlink(inputPath);
  200. }
  201. }
  202. });
  203. }
  204. exports.rmRF = rmRF;
  205. /**
  206. * Make a directory. Creates the full path with folders in between
  207. * Will throw if it fails
  208. *
  209. * @param fsPath path to create
  210. * @returns Promise<void>
  211. */
  212. function mkdirP(fsPath) {
  213. return __awaiter(this, void 0, void 0, function* () {
  214. yield ioUtil.mkdirP(fsPath);
  215. });
  216. }
  217. exports.mkdirP = mkdirP;
  218. /**
  219. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  220. * If you check and the tool does not exist, it will throw.
  221. *
  222. * @param tool name of the tool
  223. * @param check whether to check if tool exists
  224. * @returns Promise<string> path to tool
  225. */
  226. function which(tool, check) {
  227. return __awaiter(this, void 0, void 0, function* () {
  228. if (!tool) {
  229. throw new Error("parameter 'tool' is required");
  230. }
  231. // recursive when check=true
  232. if (check) {
  233. const result = yield which(tool, false);
  234. if (!result) {
  235. if (ioUtil.IS_WINDOWS) {
  236. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  237. }
  238. else {
  239. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  240. }
  241. }
  242. }
  243. try {
  244. // build the list of extensions to try
  245. const extensions = [];
  246. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  247. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  248. if (extension) {
  249. extensions.push(extension);
  250. }
  251. }
  252. }
  253. // if it's rooted, return it if exists. otherwise return empty.
  254. if (ioUtil.isRooted(tool)) {
  255. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  256. if (filePath) {
  257. return filePath;
  258. }
  259. return '';
  260. }
  261. // if any path separators, return empty
  262. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  263. return '';
  264. }
  265. // build the list of directories
  266. //
  267. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  268. // it feels like we should not do this. Checking the current directory seems like more of a use
  269. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  270. // across platforms.
  271. const directories = [];
  272. if (process.env.PATH) {
  273. for (const p of process.env.PATH.split(path.delimiter)) {
  274. if (p) {
  275. directories.push(p);
  276. }
  277. }
  278. }
  279. // return the first match
  280. for (const directory of directories) {
  281. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  282. if (filePath) {
  283. return filePath;
  284. }
  285. }
  286. return '';
  287. }
  288. catch (err) {
  289. throw new Error(`which failed with message ${err.message}`);
  290. }
  291. });
  292. }
  293. exports.which = which;
  294. function readCopyOptions(options) {
  295. const force = options.force == null ? true : options.force;
  296. const recursive = Boolean(options.recursive);
  297. return { force, recursive };
  298. }
  299. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  300. return __awaiter(this, void 0, void 0, function* () {
  301. // Ensure there is not a run away recursive copy
  302. if (currentDepth >= 255)
  303. return;
  304. currentDepth++;
  305. yield mkdirP(destDir);
  306. const files = yield ioUtil.readdir(sourceDir);
  307. for (const fileName of files) {
  308. const srcFile = `${sourceDir}/${fileName}`;
  309. const destFile = `${destDir}/${fileName}`;
  310. const srcFileStat = yield ioUtil.lstat(srcFile);
  311. if (srcFileStat.isDirectory()) {
  312. // Recurse
  313. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  314. }
  315. else {
  316. yield copyFile(srcFile, destFile, force);
  317. }
  318. }
  319. // Change the mode for the newly created directory
  320. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  321. });
  322. }
  323. // Buffered file copy
  324. function copyFile(srcFile, destFile, force) {
  325. return __awaiter(this, void 0, void 0, function* () {
  326. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  327. // unlink/re-link it
  328. try {
  329. yield ioUtil.lstat(destFile);
  330. yield ioUtil.unlink(destFile);
  331. }
  332. catch (e) {
  333. // Try to override file permission
  334. if (e.code === 'EPERM') {
  335. yield ioUtil.chmod(destFile, '0666');
  336. yield ioUtil.unlink(destFile);
  337. }
  338. // other errors = it doesn't exist, no work to do
  339. }
  340. // Copy over symlink
  341. const symlinkFull = yield ioUtil.readlink(srcFile);
  342. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  343. }
  344. else if (!(yield ioUtil.exists(destFile)) || force) {
  345. yield ioUtil.copyFile(srcFile, destFile);
  346. }
  347. });
  348. }
  349. //# sourceMappingURL=io.js.map
  350. /***/ }),
  351. /***/ 2:
  352. /***/ (function(module, __unusedexports, __webpack_require__) {
  353. "use strict";
  354. const os = __webpack_require__(87);
  355. const macosRelease = __webpack_require__(118);
  356. const winRelease = __webpack_require__(49);
  357. const osName = (platform, release) => {
  358. if (!platform && release) {
  359. throw new Error('You can\'t specify a `release` without specifying `platform`');
  360. }
  361. platform = platform || os.platform();
  362. let id;
  363. if (platform === 'darwin') {
  364. if (!release && os.platform() === 'darwin') {
  365. release = os.release();
  366. }
  367. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  368. id = release ? macosRelease(release).name : '';
  369. return prefix + (id ? ' ' + id : '');
  370. }
  371. if (platform === 'linux') {
  372. if (!release && os.platform() === 'linux') {
  373. release = os.release();
  374. }
  375. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  376. return 'Linux' + (id ? ' ' + id : '');
  377. }
  378. if (platform === 'win32') {
  379. if (!release && os.platform() === 'win32') {
  380. release = os.release();
  381. }
  382. id = release ? winRelease(release) : '';
  383. return 'Windows' + (id ? ' ' + id : '');
  384. }
  385. return platform;
  386. };
  387. module.exports = osName;
  388. /***/ }),
  389. /***/ 3:
  390. /***/ (function(module, __unusedexports, __webpack_require__) {
  391. var once = __webpack_require__(969);
  392. var noop = function() {};
  393. var isRequest = function(stream) {
  394. return stream.setHeader && typeof stream.abort === 'function';
  395. };
  396. var isChildProcess = function(stream) {
  397. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  398. };
  399. var eos = function(stream, opts, callback) {
  400. if (typeof opts === 'function') return eos(stream, null, opts);
  401. if (!opts) opts = {};
  402. callback = once(callback || noop);
  403. var ws = stream._writableState;
  404. var rs = stream._readableState;
  405. var readable = opts.readable || (opts.readable !== false && stream.readable);
  406. var writable = opts.writable || (opts.writable !== false && stream.writable);
  407. var cancelled = false;
  408. var onlegacyfinish = function() {
  409. if (!stream.writable) onfinish();
  410. };
  411. var onfinish = function() {
  412. writable = false;
  413. if (!readable) callback.call(stream);
  414. };
  415. var onend = function() {
  416. readable = false;
  417. if (!writable) callback.call(stream);
  418. };
  419. var onexit = function(exitCode) {
  420. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  421. };
  422. var onerror = function(err) {
  423. callback.call(stream, err);
  424. };
  425. var onclose = function() {
  426. process.nextTick(onclosenexttick);
  427. };
  428. var onclosenexttick = function() {
  429. if (cancelled) return;
  430. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  431. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  432. };
  433. var onrequest = function() {
  434. stream.req.on('finish', onfinish);
  435. };
  436. if (isRequest(stream)) {
  437. stream.on('complete', onfinish);
  438. stream.on('abort', onclose);
  439. if (stream.req) onrequest();
  440. else stream.on('request', onrequest);
  441. } else if (writable && !ws) { // legacy streams
  442. stream.on('end', onlegacyfinish);
  443. stream.on('close', onlegacyfinish);
  444. }
  445. if (isChildProcess(stream)) stream.on('exit', onexit);
  446. stream.on('end', onend);
  447. stream.on('finish', onfinish);
  448. if (opts.error !== false) stream.on('error', onerror);
  449. stream.on('close', onclose);
  450. return function() {
  451. cancelled = true;
  452. stream.removeListener('complete', onfinish);
  453. stream.removeListener('abort', onclose);
  454. stream.removeListener('request', onrequest);
  455. if (stream.req) stream.req.removeListener('finish', onfinish);
  456. stream.removeListener('end', onlegacyfinish);
  457. stream.removeListener('close', onlegacyfinish);
  458. stream.removeListener('finish', onfinish);
  459. stream.removeListener('exit', onexit);
  460. stream.removeListener('end', onend);
  461. stream.removeListener('error', onerror);
  462. stream.removeListener('close', onclose);
  463. };
  464. };
  465. module.exports = eos;
  466. /***/ }),
  467. /***/ 8:
  468. /***/ (function(module, __unusedexports, __webpack_require__) {
  469. module.exports = iterator;
  470. const normalizePaginatedListResponse = __webpack_require__(301);
  471. function iterator(octokit, options) {
  472. const headers = options.headers;
  473. let url = octokit.request.endpoint(options).url;
  474. return {
  475. [Symbol.asyncIterator]: () => ({
  476. next() {
  477. if (!url) {
  478. return Promise.resolve({ done: true });
  479. }
  480. return octokit
  481. .request({ url, headers })
  482. .then(response => {
  483. normalizePaginatedListResponse(octokit, url, response);
  484. // `response.headers.link` format:
  485. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  486. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  487. url = ((response.headers.link || "").match(
  488. /<([^>]+)>;\s*rel="next"/
  489. ) || [])[1];
  490. return { value: response };
  491. });
  492. }
  493. })
  494. };
  495. }
  496. /***/ }),
  497. /***/ 9:
  498. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  499. "use strict";
  500. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  501. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  502. return new (P || (P = Promise))(function (resolve, reject) {
  503. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  504. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  505. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  506. step((generator = generator.apply(thisArg, _arguments || [])).next());
  507. });
  508. };
  509. Object.defineProperty(exports, "__esModule", { value: true });
  510. const os = __webpack_require__(87);
  511. const events = __webpack_require__(614);
  512. const child = __webpack_require__(129);
  513. /* eslint-disable @typescript-eslint/unbound-method */
  514. const IS_WINDOWS = process.platform === 'win32';
  515. /*
  516. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  517. */
  518. class ToolRunner extends events.EventEmitter {
  519. constructor(toolPath, args, options) {
  520. super();
  521. if (!toolPath) {
  522. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  523. }
  524. this.toolPath = toolPath;
  525. this.args = args || [];
  526. this.options = options || {};
  527. }
  528. _debug(message) {
  529. if (this.options.listeners && this.options.listeners.debug) {
  530. this.options.listeners.debug(message);
  531. }
  532. }
  533. _getCommandString(options, noPrefix) {
  534. const toolPath = this._getSpawnFileName();
  535. const args = this._getSpawnArgs(options);
  536. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  537. if (IS_WINDOWS) {
  538. // Windows + cmd file
  539. if (this._isCmdFile()) {
  540. cmd += toolPath;
  541. for (const a of args) {
  542. cmd += ` ${a}`;
  543. }
  544. }
  545. // Windows + verbatim
  546. else if (options.windowsVerbatimArguments) {
  547. cmd += `"${toolPath}"`;
  548. for (const a of args) {
  549. cmd += ` ${a}`;
  550. }
  551. }
  552. // Windows (regular)
  553. else {
  554. cmd += this._windowsQuoteCmdArg(toolPath);
  555. for (const a of args) {
  556. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  557. }
  558. }
  559. }
  560. else {
  561. // OSX/Linux - this can likely be improved with some form of quoting.
  562. // creating processes on Unix is fundamentally different than Windows.
  563. // on Unix, execvp() takes an arg array.
  564. cmd += toolPath;
  565. for (const a of args) {
  566. cmd += ` ${a}`;
  567. }
  568. }
  569. return cmd;
  570. }
  571. _processLineBuffer(data, strBuffer, onLine) {
  572. try {
  573. let s = strBuffer + data.toString();
  574. let n = s.indexOf(os.EOL);
  575. while (n > -1) {
  576. const line = s.substring(0, n);
  577. onLine(line);
  578. // the rest of the string ...
  579. s = s.substring(n + os.EOL.length);
  580. n = s.indexOf(os.EOL);
  581. }
  582. strBuffer = s;
  583. }
  584. catch (err) {
  585. // streaming lines to console is best effort. Don't fail a build.
  586. this._debug(`error processing line. Failed with error ${err}`);
  587. }
  588. }
  589. _getSpawnFileName() {
  590. if (IS_WINDOWS) {
  591. if (this._isCmdFile()) {
  592. return process.env['COMSPEC'] || 'cmd.exe';
  593. }
  594. }
  595. return this.toolPath;
  596. }
  597. _getSpawnArgs(options) {
  598. if (IS_WINDOWS) {
  599. if (this._isCmdFile()) {
  600. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  601. for (const a of this.args) {
  602. argline += ' ';
  603. argline += options.windowsVerbatimArguments
  604. ? a
  605. : this._windowsQuoteCmdArg(a);
  606. }
  607. argline += '"';
  608. return [argline];
  609. }
  610. }
  611. return this.args;
  612. }
  613. _endsWith(str, end) {
  614. return str.endsWith(end);
  615. }
  616. _isCmdFile() {
  617. const upperToolPath = this.toolPath.toUpperCase();
  618. return (this._endsWith(upperToolPath, '.CMD') ||
  619. this._endsWith(upperToolPath, '.BAT'));
  620. }
  621. _windowsQuoteCmdArg(arg) {
  622. // for .exe, apply the normal quoting rules that libuv applies
  623. if (!this._isCmdFile()) {
  624. return this._uvQuoteCmdArg(arg);
  625. }
  626. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  627. // the libuv rules are generic and are not designed specifically for cmd.exe
  628. // command line parser.
  629. //
  630. // for a detailed description of the cmd.exe command line parser, refer to
  631. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  632. // need quotes for empty arg
  633. if (!arg) {
  634. return '""';
  635. }
  636. // determine whether the arg needs to be quoted
  637. const cmdSpecialChars = [
  638. ' ',
  639. '\t',
  640. '&',
  641. '(',
  642. ')',
  643. '[',
  644. ']',
  645. '{',
  646. '}',
  647. '^',
  648. '=',
  649. ';',
  650. '!',
  651. "'",
  652. '+',
  653. ',',
  654. '`',
  655. '~',
  656. '|',
  657. '<',
  658. '>',
  659. '"'
  660. ];
  661. let needsQuotes = false;
  662. for (const char of arg) {
  663. if (cmdSpecialChars.some(x => x === char)) {
  664. needsQuotes = true;
  665. break;
  666. }
  667. }
  668. // short-circuit if quotes not needed
  669. if (!needsQuotes) {
  670. return arg;
  671. }
  672. // the following quoting rules are very similar to the rules that by libuv applies.
  673. //
  674. // 1) wrap the string in quotes
  675. //
  676. // 2) double-up quotes - i.e. " => ""
  677. //
  678. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  679. // doesn't work well with a cmd.exe command line.
  680. //
  681. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  682. // for example, the command line:
  683. // foo.exe "myarg:""my val"""
  684. // is parsed by a .NET console app into an arg array:
  685. // [ "myarg:\"my val\"" ]
  686. // which is the same end result when applying libuv quoting rules. although the actual
  687. // command line from libuv quoting rules would look like:
  688. // foo.exe "myarg:\"my val\""
  689. //
  690. // 3) double-up slashes that precede a quote,
  691. // e.g. hello \world => "hello \world"
  692. // hello\"world => "hello\\""world"
  693. // hello\\"world => "hello\\\\""world"
  694. // hello world\ => "hello world\\"
  695. //
  696. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  697. // the reasons for including this as a .cmd quoting rule are:
  698. //
  699. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  700. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  701. //
  702. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  703. // haven't heard any complaints about that aspect.
  704. //
  705. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  706. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  707. // by using %%.
  708. //
  709. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  710. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  711. //
  712. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  713. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  714. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  715. // to an external program.
  716. //
  717. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  718. // % can be escaped within a .cmd file.
  719. let reverse = '"';
  720. let quoteHit = true;
  721. for (let i = arg.length; i > 0; i--) {
  722. // walk the string in reverse
  723. reverse += arg[i - 1];
  724. if (quoteHit && arg[i - 1] === '\\') {
  725. reverse += '\\'; // double the slash
  726. }
  727. else if (arg[i - 1] === '"') {
  728. quoteHit = true;
  729. reverse += '"'; // double the quote
  730. }
  731. else {
  732. quoteHit = false;
  733. }
  734. }
  735. reverse += '"';
  736. return reverse
  737. .split('')
  738. .reverse()
  739. .join('');
  740. }
  741. _uvQuoteCmdArg(arg) {
  742. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  743. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  744. // is used.
  745. //
  746. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  747. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  748. // pasting copyright notice from Node within this function:
  749. //
  750. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  751. //
  752. // Permission is hereby granted, free of charge, to any person obtaining a copy
  753. // of this software and associated documentation files (the "Software"), to
  754. // deal in the Software without restriction, including without limitation the
  755. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  756. // sell copies of the Software, and to permit persons to whom the Software is
  757. // furnished to do so, subject to the following conditions:
  758. //
  759. // The above copyright notice and this permission notice shall be included in
  760. // all copies or substantial portions of the Software.
  761. //
  762. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  763. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  764. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  765. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  766. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  767. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  768. // IN THE SOFTWARE.
  769. if (!arg) {
  770. // Need double quotation for empty argument
  771. return '""';
  772. }
  773. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  774. // No quotation needed
  775. return arg;
  776. }
  777. if (!arg.includes('"') && !arg.includes('\\')) {
  778. // No embedded double quotes or backslashes, so I can just wrap
  779. // quote marks around the whole thing.
  780. return `"${arg}"`;
  781. }
  782. // Expected input/output:
  783. // input : hello"world
  784. // output: "hello\"world"
  785. // input : hello""world
  786. // output: "hello\"\"world"
  787. // input : hello\world
  788. // output: hello\world
  789. // input : hello\\world
  790. // output: hello\\world
  791. // input : hello\"world
  792. // output: "hello\\\"world"
  793. // input : hello\\"world
  794. // output: "hello\\\\\"world"
  795. // input : hello world\
  796. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  797. // but it appears the comment is wrong, it should be "hello world\\"
  798. let reverse = '"';
  799. let quoteHit = true;
  800. for (let i = arg.length; i > 0; i--) {
  801. // walk the string in reverse
  802. reverse += arg[i - 1];
  803. if (quoteHit && arg[i - 1] === '\\') {
  804. reverse += '\\';
  805. }
  806. else if (arg[i - 1] === '"') {
  807. quoteHit = true;
  808. reverse += '\\';
  809. }
  810. else {
  811. quoteHit = false;
  812. }
  813. }
  814. reverse += '"';
  815. return reverse
  816. .split('')
  817. .reverse()
  818. .join('');
  819. }
  820. _cloneExecOptions(options) {
  821. options = options || {};
  822. const result = {
  823. cwd: options.cwd || process.cwd(),
  824. env: options.env || process.env,
  825. silent: options.silent || false,
  826. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  827. failOnStdErr: options.failOnStdErr || false,
  828. ignoreReturnCode: options.ignoreReturnCode || false,
  829. delay: options.delay || 10000
  830. };
  831. result.outStream = options.outStream || process.stdout;
  832. result.errStream = options.errStream || process.stderr;
  833. return result;
  834. }
  835. _getSpawnOptions(options, toolPath) {
  836. options = options || {};
  837. const result = {};
  838. result.cwd = options.cwd;
  839. result.env = options.env;
  840. result['windowsVerbatimArguments'] =
  841. options.windowsVerbatimArguments || this._isCmdFile();
  842. if (options.windowsVerbatimArguments) {
  843. result.argv0 = `"${toolPath}"`;
  844. }
  845. return result;
  846. }
  847. /**
  848. * Exec a tool.
  849. * Output will be streamed to the live console.
  850. * Returns promise with return code
  851. *
  852. * @param tool path to tool to exec
  853. * @param options optional exec options. See ExecOptions
  854. * @returns number
  855. */
  856. exec() {
  857. return __awaiter(this, void 0, void 0, function* () {
  858. return new Promise((resolve, reject) => {
  859. this._debug(`exec tool: ${this.toolPath}`);
  860. this._debug('arguments:');
  861. for (const arg of this.args) {
  862. this._debug(` ${arg}`);
  863. }
  864. const optionsNonNull = this._cloneExecOptions(this.options);
  865. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  866. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  867. }
  868. const state = new ExecState(optionsNonNull, this.toolPath);
  869. state.on('debug', (message) => {
  870. this._debug(message);
  871. });
  872. const fileName = this._getSpawnFileName();
  873. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  874. const stdbuffer = '';
  875. if (cp.stdout) {
  876. cp.stdout.on('data', (data) => {
  877. if (this.options.listeners && this.options.listeners.stdout) {
  878. this.options.listeners.stdout(data);
  879. }
  880. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  881. optionsNonNull.outStream.write(data);
  882. }
  883. this._processLineBuffer(data, stdbuffer, (line) => {
  884. if (this.options.listeners && this.options.listeners.stdline) {
  885. this.options.listeners.stdline(line);
  886. }
  887. });
  888. });
  889. }
  890. const errbuffer = '';
  891. if (cp.stderr) {
  892. cp.stderr.on('data', (data) => {
  893. state.processStderr = true;
  894. if (this.options.listeners && this.options.listeners.stderr) {
  895. this.options.listeners.stderr(data);
  896. }
  897. if (!optionsNonNull.silent &&
  898. optionsNonNull.errStream &&
  899. optionsNonNull.outStream) {
  900. const s = optionsNonNull.failOnStdErr
  901. ? optionsNonNull.errStream
  902. : optionsNonNull.outStream;
  903. s.write(data);
  904. }
  905. this._processLineBuffer(data, errbuffer, (line) => {
  906. if (this.options.listeners && this.options.listeners.errline) {
  907. this.options.listeners.errline(line);
  908. }
  909. });
  910. });
  911. }
  912. cp.on('error', (err) => {
  913. state.processError = err.message;
  914. state.processExited = true;
  915. state.processClosed = true;
  916. state.CheckComplete();
  917. });
  918. cp.on('exit', (code) => {
  919. state.processExitCode = code;
  920. state.processExited = true;
  921. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  922. state.CheckComplete();
  923. });
  924. cp.on('close', (code) => {
  925. state.processExitCode = code;
  926. state.processExited = true;
  927. state.processClosed = true;
  928. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  929. state.CheckComplete();
  930. });
  931. state.on('done', (error, exitCode) => {
  932. if (stdbuffer.length > 0) {
  933. this.emit('stdline', stdbuffer);
  934. }
  935. if (errbuffer.length > 0) {
  936. this.emit('errline', errbuffer);
  937. }
  938. cp.removeAllListeners();
  939. if (error) {
  940. reject(error);
  941. }
  942. else {
  943. resolve(exitCode);
  944. }
  945. });
  946. });
  947. });
  948. }
  949. }
  950. exports.ToolRunner = ToolRunner;
  951. /**
  952. * Convert an arg string to an array of args. Handles escaping
  953. *
  954. * @param argString string of arguments
  955. * @returns string[] array of arguments
  956. */
  957. function argStringToArray(argString) {
  958. const args = [];
  959. let inQuotes = false;
  960. let escaped = false;
  961. let arg = '';
  962. function append(c) {
  963. // we only escape double quotes.
  964. if (escaped && c !== '"') {
  965. arg += '\\';
  966. }
  967. arg += c;
  968. escaped = false;
  969. }
  970. for (let i = 0; i < argString.length; i++) {
  971. const c = argString.charAt(i);
  972. if (c === '"') {
  973. if (!escaped) {
  974. inQuotes = !inQuotes;
  975. }
  976. else {
  977. append(c);
  978. }
  979. continue;
  980. }
  981. if (c === '\\' && escaped) {
  982. append(c);
  983. continue;
  984. }
  985. if (c === '\\' && inQuotes) {
  986. escaped = true;
  987. continue;
  988. }
  989. if (c === ' ' && !inQuotes) {
  990. if (arg.length > 0) {
  991. args.push(arg);
  992. arg = '';
  993. }
  994. continue;
  995. }
  996. append(c);
  997. }
  998. if (arg.length > 0) {
  999. args.push(arg.trim());
  1000. }
  1001. return args;
  1002. }
  1003. exports.argStringToArray = argStringToArray;
  1004. class ExecState extends events.EventEmitter {
  1005. constructor(options, toolPath) {
  1006. super();
  1007. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  1008. this.processError = '';
  1009. this.processExitCode = 0;
  1010. this.processExited = false; // tracks whether the process has exited
  1011. this.processStderr = false; // tracks whether stderr was written to
  1012. this.delay = 10000; // 10 seconds
  1013. this.done = false;
  1014. this.timeout = null;
  1015. if (!toolPath) {
  1016. throw new Error('toolPath must not be empty');
  1017. }
  1018. this.options = options;
  1019. this.toolPath = toolPath;
  1020. if (options.delay) {
  1021. this.delay = options.delay;
  1022. }
  1023. }
  1024. CheckComplete() {
  1025. if (this.done) {
  1026. return;
  1027. }
  1028. if (this.processClosed) {
  1029. this._setResult();
  1030. }
  1031. else if (this.processExited) {
  1032. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  1033. }
  1034. }
  1035. _debug(message) {
  1036. this.emit('debug', message);
  1037. }
  1038. _setResult() {
  1039. // determine whether there is an error
  1040. let error;
  1041. if (this.processExited) {
  1042. if (this.processError) {
  1043. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  1044. }
  1045. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  1046. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  1047. }
  1048. else if (this.processStderr && this.options.failOnStdErr) {
  1049. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  1050. }
  1051. }
  1052. // clear the timeout
  1053. if (this.timeout) {
  1054. clearTimeout(this.timeout);
  1055. this.timeout = null;
  1056. }
  1057. this.done = true;
  1058. this.emit('done', error, this.processExitCode);
  1059. }
  1060. static HandleTimeout(state) {
  1061. if (state.done) {
  1062. return;
  1063. }
  1064. if (!state.processClosed && state.processExited) {
  1065. const message = `The STDIO streams did not close within ${state.delay /
  1066. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  1067. state._debug(message);
  1068. }
  1069. state._setResult();
  1070. }
  1071. }
  1072. //# sourceMappingURL=toolrunner.js.map
  1073. /***/ }),
  1074. /***/ 11:
  1075. /***/ (function(module) {
  1076. // Returns a wrapper function that returns a wrapped callback
  1077. // The wrapper function should do some stuff, and return a
  1078. // presumably different callback function.
  1079. // This makes sure that own properties are retained, so that
  1080. // decorations and such are not lost along the way.
  1081. module.exports = wrappy
  1082. function wrappy (fn, cb) {
  1083. if (fn && cb) return wrappy(fn)(cb)
  1084. if (typeof fn !== 'function')
  1085. throw new TypeError('need wrapper function')
  1086. Object.keys(fn).forEach(function (k) {
  1087. wrapper[k] = fn[k]
  1088. })
  1089. return wrapper
  1090. function wrapper() {
  1091. var args = new Array(arguments.length)
  1092. for (var i = 0; i < args.length; i++) {
  1093. args[i] = arguments[i]
  1094. }
  1095. var ret = fn.apply(this, args)
  1096. var cb = args[args.length-1]
  1097. if (typeof ret === 'function' && ret !== cb) {
  1098. Object.keys(cb).forEach(function (k) {
  1099. ret[k] = cb[k]
  1100. })
  1101. }
  1102. return ret
  1103. }
  1104. }
  1105. /***/ }),
  1106. /***/ 18:
  1107. /***/ (function() {
  1108. eval("require")("encoding");
  1109. /***/ }),
  1110. /***/ 19:
  1111. /***/ (function(module, __unusedexports, __webpack_require__) {
  1112. module.exports = authenticationPlugin;
  1113. const { Deprecation } = __webpack_require__(692);
  1114. const once = __webpack_require__(969);
  1115. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1116. const authenticate = __webpack_require__(674);
  1117. const beforeRequest = __webpack_require__(471);
  1118. const requestError = __webpack_require__(349);
  1119. function authenticationPlugin(octokit, options) {
  1120. if (options.auth) {
  1121. octokit.authenticate = () => {
  1122. deprecateAuthenticate(
  1123. octokit.log,
  1124. new Deprecation(
  1125. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1126. )
  1127. );
  1128. };
  1129. return;
  1130. }
  1131. const state = {
  1132. octokit,
  1133. auth: false
  1134. };
  1135. octokit.authenticate = authenticate.bind(null, state);
  1136. octokit.hook.before("request", beforeRequest.bind(null, state));
  1137. octokit.hook.error("request", requestError.bind(null, state));
  1138. }
  1139. /***/ }),
  1140. /***/ 20:
  1141. /***/ (function(module, __unusedexports, __webpack_require__) {
  1142. "use strict";
  1143. const cp = __webpack_require__(129);
  1144. const parse = __webpack_require__(568);
  1145. const enoent = __webpack_require__(881);
  1146. function spawn(command, args, options) {
  1147. // Parse the arguments
  1148. const parsed = parse(command, args, options);
  1149. // Spawn the child process
  1150. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1151. // Hook into child process "exit" event to emit an error if the command
  1152. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1153. enoent.hookChildProcess(spawned, parsed);
  1154. return spawned;
  1155. }
  1156. function spawnSync(command, args, options) {
  1157. // Parse the arguments
  1158. const parsed = parse(command, args, options);
  1159. // Spawn the child process
  1160. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1161. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1162. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1163. return result;
  1164. }
  1165. module.exports = spawn;
  1166. module.exports.spawn = spawn;
  1167. module.exports.sync = spawnSync;
  1168. module.exports._parse = parse;
  1169. module.exports._enoent = enoent;
  1170. /***/ }),
  1171. /***/ 34:
  1172. /***/ (function(module) {
  1173. module.exports = require("https");
  1174. /***/ }),
  1175. /***/ 39:
  1176. /***/ (function(module) {
  1177. "use strict";
  1178. module.exports = opts => {
  1179. opts = opts || {};
  1180. const env = opts.env || process.env;
  1181. const platform = opts.platform || process.platform;
  1182. if (platform !== 'win32') {
  1183. return 'PATH';
  1184. }
  1185. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1186. };
  1187. /***/ }),
  1188. /***/ 46:
  1189. /***/ (function(module, __unusedexports, __webpack_require__) {
  1190. module.exports = getUserAgentNode
  1191. const osName = __webpack_require__(2)
  1192. function getUserAgentNode () {
  1193. try {
  1194. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`
  1195. } catch (error) {
  1196. if (/wmic os get Caption/.test(error.message)) {
  1197. return 'Windows <version undetectable>'
  1198. }
  1199. throw error
  1200. }
  1201. }
  1202. /***/ }),
  1203. /***/ 47:
  1204. /***/ (function(module, __unusedexports, __webpack_require__) {
  1205. module.exports = factory;
  1206. const Octokit = __webpack_require__(402);
  1207. const registerPlugin = __webpack_require__(855);
  1208. function factory(plugins) {
  1209. const Api = Octokit.bind(null, plugins || []);
  1210. Api.plugin = registerPlugin.bind(null, plugins || []);
  1211. return Api;
  1212. }
  1213. /***/ }),
  1214. /***/ 49:
  1215. /***/ (function(module, __unusedexports, __webpack_require__) {
  1216. "use strict";
  1217. const os = __webpack_require__(87);
  1218. const execa = __webpack_require__(955);
  1219. // Reference: https://www.gaijin.at/en/lstwinver.php
  1220. const names = new Map([
  1221. ['10.0', '10'],
  1222. ['6.3', '8.1'],
  1223. ['6.2', '8'],
  1224. ['6.1', '7'],
  1225. ['6.0', 'Vista'],
  1226. ['5.2', 'Server 2003'],
  1227. ['5.1', 'XP'],
  1228. ['5.0', '2000'],
  1229. ['4.9', 'ME'],
  1230. ['4.1', '98'],
  1231. ['4.0', '95']
  1232. ]);
  1233. const windowsRelease = release => {
  1234. const version = /\d+\.\d/.exec(release || os.release());
  1235. if (release && !version) {
  1236. throw new Error('`release` argument doesn\'t match `n.n`');
  1237. }
  1238. const ver = (version || [])[0];
  1239. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1240. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1241. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1242. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1243. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1244. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1245. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1246. if (year) {
  1247. return `Server ${year}`;
  1248. }
  1249. }
  1250. return names.get(ver);
  1251. };
  1252. module.exports = windowsRelease;
  1253. /***/ }),
  1254. /***/ 87:
  1255. /***/ (function(module) {
  1256. module.exports = require("os");
  1257. /***/ }),
  1258. /***/ 118:
  1259. /***/ (function(module, __unusedexports, __webpack_require__) {
  1260. "use strict";
  1261. const os = __webpack_require__(87);
  1262. const nameMap = new Map([
  1263. [19, 'Catalina'],
  1264. [18, 'Mojave'],
  1265. [17, 'High Sierra'],
  1266. [16, 'Sierra'],
  1267. [15, 'El Capitan'],
  1268. [14, 'Yosemite'],
  1269. [13, 'Mavericks'],
  1270. [12, 'Mountain Lion'],
  1271. [11, 'Lion'],
  1272. [10, 'Snow Leopard'],
  1273. [9, 'Leopard'],
  1274. [8, 'Tiger'],
  1275. [7, 'Panther'],
  1276. [6, 'Jaguar'],
  1277. [5, 'Puma']
  1278. ]);
  1279. const macosRelease = release => {
  1280. release = Number((release || os.release()).split('.')[0]);
  1281. return {
  1282. name: nameMap.get(release),
  1283. version: '10.' + (release - 4)
  1284. };
  1285. };
  1286. module.exports = macosRelease;
  1287. // TODO: remove this in the next major version
  1288. module.exports.default = macosRelease;
  1289. /***/ }),
  1290. /***/ 126:
  1291. /***/ (function(module) {
  1292. /**
  1293. * lodash (Custom Build) <https://lodash.com/>
  1294. * Build: `lodash modularize exports="npm" -o ./`
  1295. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1296. * Released under MIT license <https://lodash.com/license>
  1297. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1298. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1299. */
  1300. /** Used as the size to enable large array optimizations. */
  1301. var LARGE_ARRAY_SIZE = 200;
  1302. /** Used to stand-in for `undefined` hash values. */
  1303. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1304. /** Used as references for various `Number` constants. */
  1305. var INFINITY = 1 / 0;
  1306. /** `Object#toString` result references. */
  1307. var funcTag = '[object Function]',
  1308. genTag = '[object GeneratorFunction]';
  1309. /**
  1310. * Used to match `RegExp`
  1311. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1312. */
  1313. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1314. /** Used to detect host constructors (Safari). */
  1315. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1316. /** Detect free variable `global` from Node.js. */
  1317. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1318. /** Detect free variable `self`. */
  1319. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1320. /** Used as a reference to the global object. */
  1321. var root = freeGlobal || freeSelf || Function('return this')();
  1322. /**
  1323. * A specialized version of `_.includes` for arrays without support for
  1324. * specifying an index to search from.
  1325. *
  1326. * @private
  1327. * @param {Array} [array] The array to inspect.
  1328. * @param {*} target The value to search for.
  1329. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1330. */
  1331. function arrayIncludes(array, value) {
  1332. var length = array ? array.length : 0;
  1333. return !!length && baseIndexOf(array, value, 0) > -1;
  1334. }
  1335. /**
  1336. * This function is like `arrayIncludes` except that it accepts a comparator.
  1337. *
  1338. * @private
  1339. * @param {Array} [array] The array to inspect.
  1340. * @param {*} target The value to search for.
  1341. * @param {Function} comparator The comparator invoked per element.
  1342. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1343. */
  1344. function arrayIncludesWith(array, value, comparator) {
  1345. var index = -1,
  1346. length = array ? array.length : 0;
  1347. while (++index < length) {
  1348. if (comparator(value, array[index])) {
  1349. return true;
  1350. }
  1351. }
  1352. return false;
  1353. }
  1354. /**
  1355. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1356. * support for iteratee shorthands.
  1357. *
  1358. * @private
  1359. * @param {Array} array The array to inspect.
  1360. * @param {Function} predicate The function invoked per iteration.
  1361. * @param {number} fromIndex The index to search from.
  1362. * @param {boolean} [fromRight] Specify iterating from right to left.
  1363. * @returns {number} Returns the index of the matched value, else `-1`.
  1364. */
  1365. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1366. var length = array.length,
  1367. index = fromIndex + (fromRight ? 1 : -1);
  1368. while ((fromRight ? index-- : ++index < length)) {
  1369. if (predicate(array[index], index, array)) {
  1370. return index;
  1371. }
  1372. }
  1373. return -1;
  1374. }
  1375. /**
  1376. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1377. *
  1378. * @private
  1379. * @param {Array} array The array to inspect.
  1380. * @param {*} value The value to search for.
  1381. * @param {number} fromIndex The index to search from.
  1382. * @returns {number} Returns the index of the matched value, else `-1`.
  1383. */
  1384. function baseIndexOf(array, value, fromIndex) {
  1385. if (value !== value) {
  1386. return baseFindIndex(array, baseIsNaN, fromIndex);
  1387. }
  1388. var index = fromIndex - 1,
  1389. length = array.length;
  1390. while (++index < length) {
  1391. if (array[index] === value) {
  1392. return index;
  1393. }
  1394. }
  1395. return -1;
  1396. }
  1397. /**
  1398. * The base implementation of `_.isNaN` without support for number objects.
  1399. *
  1400. * @private
  1401. * @param {*} value The value to check.
  1402. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1403. */
  1404. function baseIsNaN(value) {
  1405. return value !== value;
  1406. }
  1407. /**
  1408. * Checks if a cache value for `key` exists.
  1409. *
  1410. * @private
  1411. * @param {Object} cache The cache to query.
  1412. * @param {string} key The key of the entry to check.
  1413. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1414. */
  1415. function cacheHas(cache, key) {
  1416. return cache.has(key);
  1417. }
  1418. /**
  1419. * Gets the value at `key` of `object`.
  1420. *
  1421. * @private
  1422. * @param {Object} [object] The object to query.
  1423. * @param {string} key The key of the property to get.
  1424. * @returns {*} Returns the property value.
  1425. */
  1426. function getValue(object, key) {
  1427. return object == null ? undefined : object[key];
  1428. }
  1429. /**
  1430. * Checks if `value` is a host object in IE < 9.
  1431. *
  1432. * @private
  1433. * @param {*} value The value to check.
  1434. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1435. */
  1436. function isHostObject(value) {
  1437. // Many host objects are `Object` objects that can coerce to strings
  1438. // despite having improperly defined `toString` methods.
  1439. var result = false;
  1440. if (value != null && typeof value.toString != 'function') {
  1441. try {
  1442. result = !!(value + '');
  1443. } catch (e) {}
  1444. }
  1445. return result;
  1446. }
  1447. /**
  1448. * Converts `set` to an array of its values.
  1449. *
  1450. * @private
  1451. * @param {Object} set The set to convert.
  1452. * @returns {Array} Returns the values.
  1453. */
  1454. function setToArray(set) {
  1455. var index = -1,
  1456. result = Array(set.size);
  1457. set.forEach(function(value) {
  1458. result[++index] = value;
  1459. });
  1460. return result;
  1461. }
  1462. /** Used for built-in method references. */
  1463. var arrayProto = Array.prototype,
  1464. funcProto = Function.prototype,
  1465. objectProto = Object.prototype;
  1466. /** Used to detect overreaching core-js shims. */
  1467. var coreJsData = root['__core-js_shared__'];
  1468. /** Used to detect methods masquerading as native. */
  1469. var maskSrcKey = (function() {
  1470. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1471. return uid ? ('Symbol(src)_1.' + uid) : '';
  1472. }());
  1473. /** Used to resolve the decompiled source of functions. */
  1474. var funcToString = funcProto.toString;
  1475. /** Used to check objects for own properties. */
  1476. var hasOwnProperty = objectProto.hasOwnProperty;
  1477. /**
  1478. * Used to resolve the
  1479. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1480. * of values.
  1481. */
  1482. var objectToString = objectProto.toString;
  1483. /** Used to detect if a method is native. */
  1484. var reIsNative = RegExp('^' +
  1485. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1486. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1487. );
  1488. /** Built-in value references. */
  1489. var splice = arrayProto.splice;
  1490. /* Built-in method references that are verified to be native. */
  1491. var Map = getNative(root, 'Map'),
  1492. Set = getNative(root, 'Set'),
  1493. nativeCreate = getNative(Object, 'create');
  1494. /**
  1495. * Creates a hash object.
  1496. *
  1497. * @private
  1498. * @constructor
  1499. * @param {Array} [entries] The key-value pairs to cache.
  1500. */
  1501. function Hash(entries) {
  1502. var index = -1,
  1503. length = entries ? entries.length : 0;
  1504. this.clear();
  1505. while (++index < length) {
  1506. var entry = entries[index];
  1507. this.set(entry[0], entry[1]);
  1508. }
  1509. }
  1510. /**
  1511. * Removes all key-value entries from the hash.
  1512. *
  1513. * @private
  1514. * @name clear
  1515. * @memberOf Hash
  1516. */
  1517. function hashClear() {
  1518. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1519. }
  1520. /**
  1521. * Removes `key` and its value from the hash.
  1522. *
  1523. * @private
  1524. * @name delete
  1525. * @memberOf Hash
  1526. * @param {Object} hash The hash to modify.
  1527. * @param {string} key The key of the value to remove.
  1528. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1529. */
  1530. function hashDelete(key) {
  1531. return this.has(key) && delete this.__data__[key];
  1532. }
  1533. /**
  1534. * Gets the hash value for `key`.
  1535. *
  1536. * @private
  1537. * @name get
  1538. * @memberOf Hash
  1539. * @param {string} key The key of the value to get.
  1540. * @returns {*} Returns the entry value.
  1541. */
  1542. function hashGet(key) {
  1543. var data = this.__data__;
  1544. if (nativeCreate) {
  1545. var result = data[key];
  1546. return result === HASH_UNDEFINED ? undefined : result;
  1547. }
  1548. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1549. }
  1550. /**
  1551. * Checks if a hash value for `key` exists.
  1552. *
  1553. * @private
  1554. * @name has
  1555. * @memberOf Hash
  1556. * @param {string} key The key of the entry to check.
  1557. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1558. */
  1559. function hashHas(key) {
  1560. var data = this.__data__;
  1561. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1562. }
  1563. /**
  1564. * Sets the hash `key` to `value`.
  1565. *
  1566. * @private
  1567. * @name set
  1568. * @memberOf Hash
  1569. * @param {string} key The key of the value to set.
  1570. * @param {*} value The value to set.
  1571. * @returns {Object} Returns the hash instance.
  1572. */
  1573. function hashSet(key, value) {
  1574. var data = this.__data__;
  1575. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1576. return this;
  1577. }
  1578. // Add methods to `Hash`.
  1579. Hash.prototype.clear = hashClear;
  1580. Hash.prototype['delete'] = hashDelete;
  1581. Hash.prototype.get = hashGet;
  1582. Hash.prototype.has = hashHas;
  1583. Hash.prototype.set = hashSet;
  1584. /**
  1585. * Creates an list cache object.
  1586. *
  1587. * @private
  1588. * @constructor
  1589. * @param {Array} [entries] The key-value pairs to cache.
  1590. */
  1591. function ListCache(entries) {
  1592. var index = -1,
  1593. length = entries ? entries.length : 0;
  1594. this.clear();
  1595. while (++index < length) {
  1596. var entry = entries[index];
  1597. this.set(entry[0], entry[1]);
  1598. }
  1599. }
  1600. /**
  1601. * Removes all key-value entries from the list cache.
  1602. *
  1603. * @private
  1604. * @name clear
  1605. * @memberOf ListCache
  1606. */
  1607. function listCacheClear() {
  1608. this.__data__ = [];
  1609. }
  1610. /**
  1611. * Removes `key` and its value from the list cache.
  1612. *
  1613. * @private
  1614. * @name delete
  1615. * @memberOf ListCache
  1616. * @param {string} key The key of the value to remove.
  1617. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1618. */
  1619. function listCacheDelete(key) {
  1620. var data = this.__data__,
  1621. index = assocIndexOf(data, key);
  1622. if (index < 0) {
  1623. return false;
  1624. }
  1625. var lastIndex = data.length - 1;
  1626. if (index == lastIndex) {
  1627. data.pop();
  1628. } else {
  1629. splice.call(data, index, 1);
  1630. }
  1631. return true;
  1632. }
  1633. /**
  1634. * Gets the list cache value for `key`.
  1635. *
  1636. * @private
  1637. * @name get
  1638. * @memberOf ListCache
  1639. * @param {string} key The key of the value to get.
  1640. * @returns {*} Returns the entry value.
  1641. */
  1642. function listCacheGet(key) {
  1643. var data = this.__data__,
  1644. index = assocIndexOf(data, key);
  1645. return index < 0 ? undefined : data[index][1];
  1646. }
  1647. /**
  1648. * Checks if a list cache value for `key` exists.
  1649. *
  1650. * @private
  1651. * @name has
  1652. * @memberOf ListCache
  1653. * @param {string} key The key of the entry to check.
  1654. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1655. */
  1656. function listCacheHas(key) {
  1657. return assocIndexOf(this.__data__, key) > -1;
  1658. }
  1659. /**
  1660. * Sets the list cache `key` to `value`.
  1661. *
  1662. * @private
  1663. * @name set
  1664. * @memberOf ListCache
  1665. * @param {string} key The key of the value to set.
  1666. * @param {*} value The value to set.
  1667. * @returns {Object} Returns the list cache instance.
  1668. */
  1669. function listCacheSet(key, value) {
  1670. var data = this.__data__,
  1671. index = assocIndexOf(data, key);
  1672. if (index < 0) {
  1673. data.push([key, value]);
  1674. } else {
  1675. data[index][1] = value;
  1676. }
  1677. return this;
  1678. }
  1679. // Add methods to `ListCache`.
  1680. ListCache.prototype.clear = listCacheClear;
  1681. ListCache.prototype['delete'] = listCacheDelete;
  1682. ListCache.prototype.get = listCacheGet;
  1683. ListCache.prototype.has = listCacheHas;
  1684. ListCache.prototype.set = listCacheSet;
  1685. /**
  1686. * Creates a map cache object to store key-value pairs.
  1687. *
  1688. * @private
  1689. * @constructor
  1690. * @param {Array} [entries] The key-value pairs to cache.
  1691. */
  1692. function MapCache(entries) {
  1693. var index = -1,
  1694. length = entries ? entries.length : 0;
  1695. this.clear();
  1696. while (++index < length) {
  1697. var entry = entries[index];
  1698. this.set(entry[0], entry[1]);
  1699. }
  1700. }
  1701. /**
  1702. * Removes all key-value entries from the map.
  1703. *
  1704. * @private
  1705. * @name clear
  1706. * @memberOf MapCache
  1707. */
  1708. function mapCacheClear() {
  1709. this.__data__ = {
  1710. 'hash': new Hash,
  1711. 'map': new (Map || ListCache),
  1712. 'string': new Hash
  1713. };
  1714. }
  1715. /**
  1716. * Removes `key` and its value from the map.
  1717. *
  1718. * @private
  1719. * @name delete
  1720. * @memberOf MapCache
  1721. * @param {string} key The key of the value to remove.
  1722. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1723. */
  1724. function mapCacheDelete(key) {
  1725. return getMapData(this, key)['delete'](key);
  1726. }
  1727. /**
  1728. * Gets the map value for `key`.
  1729. *
  1730. * @private
  1731. * @name get
  1732. * @memberOf MapCache
  1733. * @param {string} key The key of the value to get.
  1734. * @returns {*} Returns the entry value.
  1735. */
  1736. function mapCacheGet(key) {
  1737. return getMapData(this, key).get(key);
  1738. }
  1739. /**
  1740. * Checks if a map value for `key` exists.
  1741. *
  1742. * @private
  1743. * @name has
  1744. * @memberOf MapCache
  1745. * @param {string} key The key of the entry to check.
  1746. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1747. */
  1748. function mapCacheHas(key) {
  1749. return getMapData(this, key).has(key);
  1750. }
  1751. /**
  1752. * Sets the map `key` to `value`.
  1753. *
  1754. * @private
  1755. * @name set
  1756. * @memberOf MapCache
  1757. * @param {string} key The key of the value to set.
  1758. * @param {*} value The value to set.
  1759. * @returns {Object} Returns the map cache instance.
  1760. */
  1761. function mapCacheSet(key, value) {
  1762. getMapData(this, key).set(key, value);
  1763. return this;
  1764. }
  1765. // Add methods to `MapCache`.
  1766. MapCache.prototype.clear = mapCacheClear;
  1767. MapCache.prototype['delete'] = mapCacheDelete;
  1768. MapCache.prototype.get = mapCacheGet;
  1769. MapCache.prototype.has = mapCacheHas;
  1770. MapCache.prototype.set = mapCacheSet;
  1771. /**
  1772. *
  1773. * Creates an array cache object to store unique values.
  1774. *
  1775. * @private
  1776. * @constructor
  1777. * @param {Array} [values] The values to cache.
  1778. */
  1779. function SetCache(values) {
  1780. var index = -1,
  1781. length = values ? values.length : 0;
  1782. this.__data__ = new MapCache;
  1783. while (++index < length) {
  1784. this.add(values[index]);
  1785. }
  1786. }
  1787. /**
  1788. * Adds `value` to the array cache.
  1789. *
  1790. * @private
  1791. * @name add
  1792. * @memberOf SetCache
  1793. * @alias push
  1794. * @param {*} value The value to cache.
  1795. * @returns {Object} Returns the cache instance.
  1796. */
  1797. function setCacheAdd(value) {
  1798. this.__data__.set(value, HASH_UNDEFINED);
  1799. return this;
  1800. }
  1801. /**
  1802. * Checks if `value` is in the array cache.
  1803. *
  1804. * @private
  1805. * @name has
  1806. * @memberOf SetCache
  1807. * @param {*} value The value to search for.
  1808. * @returns {number} Returns `true` if `value` is found, else `false`.
  1809. */
  1810. function setCacheHas(value) {
  1811. return this.__data__.has(value);
  1812. }
  1813. // Add methods to `SetCache`.
  1814. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1815. SetCache.prototype.has = setCacheHas;
  1816. /**
  1817. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1818. *
  1819. * @private
  1820. * @param {Array} array The array to inspect.
  1821. * @param {*} key The key to search for.
  1822. * @returns {number} Returns the index of the matched value, else `-1`.
  1823. */
  1824. function assocIndexOf(array, key) {
  1825. var length = array.length;
  1826. while (length--) {
  1827. if (eq(array[length][0], key)) {
  1828. return length;
  1829. }
  1830. }
  1831. return -1;
  1832. }
  1833. /**
  1834. * The base implementation of `_.isNative` without bad shim checks.
  1835. *
  1836. * @private
  1837. * @param {*} value The value to check.
  1838. * @returns {boolean} Returns `true` if `value` is a native function,
  1839. * else `false`.
  1840. */
  1841. function baseIsNative(value) {
  1842. if (!isObject(value) || isMasked(value)) {
  1843. return false;
  1844. }
  1845. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1846. return pattern.test(toSource(value));
  1847. }
  1848. /**
  1849. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1850. *
  1851. * @private
  1852. * @param {Array} array The array to inspect.
  1853. * @param {Function} [iteratee] The iteratee invoked per element.
  1854. * @param {Function} [comparator] The comparator invoked per element.
  1855. * @returns {Array} Returns the new duplicate free array.
  1856. */
  1857. function baseUniq(array, iteratee, comparator) {
  1858. var index = -1,
  1859. includes = arrayIncludes,
  1860. length = array.length,
  1861. isCommon = true,
  1862. result = [],
  1863. seen = result;
  1864. if (comparator) {
  1865. isCommon = false;
  1866. includes = arrayIncludesWith;
  1867. }
  1868. else if (length >= LARGE_ARRAY_SIZE) {
  1869. var set = iteratee ? null : createSet(array);
  1870. if (set) {
  1871. return setToArray(set);
  1872. }
  1873. isCommon = false;
  1874. includes = cacheHas;
  1875. seen = new SetCache;
  1876. }
  1877. else {
  1878. seen = iteratee ? [] : result;
  1879. }
  1880. outer:
  1881. while (++index < length) {
  1882. var value = array[index],
  1883. computed = iteratee ? iteratee(value) : value;
  1884. value = (comparator || value !== 0) ? value : 0;
  1885. if (isCommon && computed === computed) {
  1886. var seenIndex = seen.length;
  1887. while (seenIndex--) {
  1888. if (seen[seenIndex] === computed) {
  1889. continue outer;
  1890. }
  1891. }
  1892. if (iteratee) {
  1893. seen.push(computed);
  1894. }
  1895. result.push(value);
  1896. }
  1897. else if (!includes(seen, computed, comparator)) {
  1898. if (seen !== result) {
  1899. seen.push(computed);
  1900. }
  1901. result.push(value);
  1902. }
  1903. }
  1904. return result;
  1905. }
  1906. /**
  1907. * Creates a set object of `values`.
  1908. *
  1909. * @private
  1910. * @param {Array} values The values to add to the set.
  1911. * @returns {Object} Returns the new set.
  1912. */
  1913. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1914. return new Set(values);
  1915. };
  1916. /**
  1917. * Gets the data for `map`.
  1918. *
  1919. * @private
  1920. * @param {Object} map The map to query.
  1921. * @param {string} key The reference key.
  1922. * @returns {*} Returns the map data.
  1923. */
  1924. function getMapData(map, key) {
  1925. var data = map.__data__;
  1926. return isKeyable(key)
  1927. ? data[typeof key == 'string' ? 'string' : 'hash']
  1928. : data.map;
  1929. }
  1930. /**
  1931. * Gets the native function at `key` of `object`.
  1932. *
  1933. * @private
  1934. * @param {Object} object The object to query.
  1935. * @param {string} key The key of the method to get.
  1936. * @returns {*} Returns the function if it's native, else `undefined`.
  1937. */
  1938. function getNative(object, key) {
  1939. var value = getValue(object, key);
  1940. return baseIsNative(value) ? value : undefined;
  1941. }
  1942. /**
  1943. * Checks if `value` is suitable for use as unique object key.
  1944. *
  1945. * @private
  1946. * @param {*} value The value to check.
  1947. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1948. */
  1949. function isKeyable(value) {
  1950. var type = typeof value;
  1951. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1952. ? (value !== '__proto__')
  1953. : (value === null);
  1954. }
  1955. /**
  1956. * Checks if `func` has its source masked.
  1957. *
  1958. * @private
  1959. * @param {Function} func The function to check.
  1960. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1961. */
  1962. function isMasked(func) {
  1963. return !!maskSrcKey && (maskSrcKey in func);
  1964. }
  1965. /**
  1966. * Converts `func` to its source code.
  1967. *
  1968. * @private
  1969. * @param {Function} func The function to process.
  1970. * @returns {string} Returns the source code.
  1971. */
  1972. function toSource(func) {
  1973. if (func != null) {
  1974. try {
  1975. return funcToString.call(func);
  1976. } catch (e) {}
  1977. try {
  1978. return (func + '');
  1979. } catch (e) {}
  1980. }
  1981. return '';
  1982. }
  1983. /**
  1984. * Creates a duplicate-free version of an array, using
  1985. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1986. * for equality comparisons, in which only the first occurrence of each
  1987. * element is kept.
  1988. *
  1989. * @static
  1990. * @memberOf _
  1991. * @since 0.1.0
  1992. * @category Array
  1993. * @param {Array} array The array to inspect.
  1994. * @returns {Array} Returns the new duplicate free array.
  1995. * @example
  1996. *
  1997. * _.uniq([2, 1, 2]);
  1998. * // => [2, 1]
  1999. */
  2000. function uniq(array) {
  2001. return (array && array.length)
  2002. ? baseUniq(array)
  2003. : [];
  2004. }
  2005. /**
  2006. * Performs a
  2007. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2008. * comparison between two values to determine if they are equivalent.
  2009. *
  2010. * @static
  2011. * @memberOf _
  2012. * @since 4.0.0
  2013. * @category Lang
  2014. * @param {*} value The value to compare.
  2015. * @param {*} other The other value to compare.
  2016. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2017. * @example
  2018. *
  2019. * var object = { 'a': 1 };
  2020. * var other = { 'a': 1 };
  2021. *
  2022. * _.eq(object, object);
  2023. * // => true
  2024. *
  2025. * _.eq(object, other);
  2026. * // => false
  2027. *
  2028. * _.eq('a', 'a');
  2029. * // => true
  2030. *
  2031. * _.eq('a', Object('a'));
  2032. * // => false
  2033. *
  2034. * _.eq(NaN, NaN);
  2035. * // => true
  2036. */
  2037. function eq(value, other) {
  2038. return value === other || (value !== value && other !== other);
  2039. }
  2040. /**
  2041. * Checks if `value` is classified as a `Function` object.
  2042. *
  2043. * @static
  2044. * @memberOf _
  2045. * @since 0.1.0
  2046. * @category Lang
  2047. * @param {*} value The value to check.
  2048. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2049. * @example
  2050. *
  2051. * _.isFunction(_);
  2052. * // => true
  2053. *
  2054. * _.isFunction(/abc/);
  2055. * // => false
  2056. */
  2057. function isFunction(value) {
  2058. // The use of `Object#toString` avoids issues with the `typeof` operator
  2059. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2060. var tag = isObject(value) ? objectToString.call(value) : '';
  2061. return tag == funcTag || tag == genTag;
  2062. }
  2063. /**
  2064. * Checks if `value` is the
  2065. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2066. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2067. *
  2068. * @static
  2069. * @memberOf _
  2070. * @since 0.1.0
  2071. * @category Lang
  2072. * @param {*} value The value to check.
  2073. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2074. * @example
  2075. *
  2076. * _.isObject({});
  2077. * // => true
  2078. *
  2079. * _.isObject([1, 2, 3]);
  2080. * // => true
  2081. *
  2082. * _.isObject(_.noop);
  2083. * // => true
  2084. *
  2085. * _.isObject(null);
  2086. * // => false
  2087. */
  2088. function isObject(value) {
  2089. var type = typeof value;
  2090. return !!value && (type == 'object' || type == 'function');
  2091. }
  2092. /**
  2093. * This method returns `undefined`.
  2094. *
  2095. * @static
  2096. * @memberOf _
  2097. * @since 2.3.0
  2098. * @category Util
  2099. * @example
  2100. *
  2101. * _.times(2, _.noop);
  2102. * // => [undefined, undefined]
  2103. */
  2104. function noop() {
  2105. // No operation performed.
  2106. }
  2107. module.exports = uniq;
  2108. /***/ }),
  2109. /***/ 129:
  2110. /***/ (function(module) {
  2111. module.exports = require("child_process");
  2112. /***/ }),
  2113. /***/ 143:
  2114. /***/ (function(module, __unusedexports, __webpack_require__) {
  2115. module.exports = withAuthorizationPrefix;
  2116. const atob = __webpack_require__(368);
  2117. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2118. function withAuthorizationPrefix(authorization) {
  2119. if (/^(basic|bearer|token) /i.test(authorization)) {
  2120. return authorization;
  2121. }
  2122. try {
  2123. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2124. return `basic ${authorization}`;
  2125. }
  2126. } catch (error) {}
  2127. if (authorization.split(/\./).length === 3) {
  2128. return `bearer ${authorization}`;
  2129. }
  2130. return `token ${authorization}`;
  2131. }
  2132. /***/ }),
  2133. /***/ 145:
  2134. /***/ (function(module, __unusedexports, __webpack_require__) {
  2135. "use strict";
  2136. const pump = __webpack_require__(453);
  2137. const bufferStream = __webpack_require__(966);
  2138. class MaxBufferError extends Error {
  2139. constructor() {
  2140. super('maxBuffer exceeded');
  2141. this.name = 'MaxBufferError';
  2142. }
  2143. }
  2144. function getStream(inputStream, options) {
  2145. if (!inputStream) {
  2146. return Promise.reject(new Error('Expected a stream'));
  2147. }
  2148. options = Object.assign({maxBuffer: Infinity}, options);
  2149. const {maxBuffer} = options;
  2150. let stream;
  2151. return new Promise((resolve, reject) => {
  2152. const rejectPromise = error => {
  2153. if (error) { // A null check
  2154. error.bufferedData = stream.getBufferedValue();
  2155. }
  2156. reject(error);
  2157. };
  2158. stream = pump(inputStream, bufferStream(options), error => {
  2159. if (error) {
  2160. rejectPromise(error);
  2161. return;
  2162. }
  2163. resolve();
  2164. });
  2165. stream.on('data', () => {
  2166. if (stream.getBufferedLength() > maxBuffer) {
  2167. rejectPromise(new MaxBufferError());
  2168. }
  2169. });
  2170. }).then(() => stream.getBufferedValue());
  2171. }
  2172. module.exports = getStream;
  2173. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2174. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2175. module.exports.MaxBufferError = MaxBufferError;
  2176. /***/ }),
  2177. /***/ 148:
  2178. /***/ (function(module, __unusedexports, __webpack_require__) {
  2179. module.exports = paginatePlugin;
  2180. const iterator = __webpack_require__(8);
  2181. const paginate = __webpack_require__(807);
  2182. function paginatePlugin(octokit) {
  2183. octokit.paginate = paginate.bind(null, octokit);
  2184. octokit.paginate.iterator = iterator.bind(null, octokit);
  2185. }
  2186. /***/ }),
  2187. /***/ 168:
  2188. /***/ (function(module) {
  2189. "use strict";
  2190. const alias = ['stdin', 'stdout', 'stderr'];
  2191. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2192. module.exports = opts => {
  2193. if (!opts) {
  2194. return null;
  2195. }
  2196. if (opts.stdio && hasAlias(opts)) {
  2197. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2198. }
  2199. if (typeof opts.stdio === 'string') {
  2200. return opts.stdio;
  2201. }
  2202. const stdio = opts.stdio || [];
  2203. if (!Array.isArray(stdio)) {
  2204. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2205. }
  2206. const result = [];
  2207. const len = Math.max(stdio.length, alias.length);
  2208. for (let i = 0; i < len; i++) {
  2209. let value = null;
  2210. if (stdio[i] !== undefined) {
  2211. value = stdio[i];
  2212. } else if (opts[alias[i]] !== undefined) {
  2213. value = opts[alias[i]];
  2214. }
  2215. result[i] = value;
  2216. }
  2217. return result;
  2218. };
  2219. /***/ }),
  2220. /***/ 190:
  2221. /***/ (function(module, __unusedexports, __webpack_require__) {
  2222. module.exports = authenticationPlugin;
  2223. const beforeRequest = __webpack_require__(863);
  2224. const requestError = __webpack_require__(991);
  2225. const validate = __webpack_require__(954);
  2226. function authenticationPlugin(octokit, options) {
  2227. if (!options.auth) {
  2228. return;
  2229. }
  2230. validate(options.auth);
  2231. const state = {
  2232. octokit,
  2233. auth: options.auth
  2234. };
  2235. octokit.hook.before("request", beforeRequest.bind(null, state));
  2236. octokit.hook.error("request", requestError.bind(null, state));
  2237. }
  2238. /***/ }),
  2239. /***/ 197:
  2240. /***/ (function(module, __unusedexports, __webpack_require__) {
  2241. module.exports = isexe
  2242. isexe.sync = sync
  2243. var fs = __webpack_require__(747)
  2244. function isexe (path, options, cb) {
  2245. fs.stat(path, function (er, stat) {
  2246. cb(er, er ? false : checkStat(stat, options))
  2247. })
  2248. }
  2249. function sync (path, options) {
  2250. return checkStat(fs.statSync(path), options)
  2251. }
  2252. function checkStat (stat, options) {
  2253. return stat.isFile() && checkMode(stat, options)
  2254. }
  2255. function checkMode (stat, options) {
  2256. var mod = stat.mode
  2257. var uid = stat.uid
  2258. var gid = stat.gid
  2259. var myUid = options.uid !== undefined ?
  2260. options.uid : process.getuid && process.getuid()
  2261. var myGid = options.gid !== undefined ?
  2262. options.gid : process.getgid && process.getgid()
  2263. var u = parseInt('100', 8)
  2264. var g = parseInt('010', 8)
  2265. var o = parseInt('001', 8)
  2266. var ug = u | g
  2267. var ret = (mod & o) ||
  2268. (mod & g) && gid === myGid ||
  2269. (mod & u) && uid === myUid ||
  2270. (mod & ug) && myUid === 0
  2271. return ret
  2272. }
  2273. /***/ }),
  2274. /***/ 198:
  2275. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2276. "use strict";
  2277. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2278. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2279. return new (P || (P = Promise))(function (resolve, reject) {
  2280. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2281. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2282. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2283. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2284. });
  2285. };
  2286. var __importStar = (this && this.__importStar) || function (mod) {
  2287. if (mod && mod.__esModule) return mod;
  2288. var result = {};
  2289. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2290. result["default"] = mod;
  2291. return result;
  2292. };
  2293. Object.defineProperty(exports, "__esModule", { value: true });
  2294. const core = __importStar(__webpack_require__(470));
  2295. const coreCommand = __importStar(__webpack_require__(431));
  2296. const gitSourceProvider = __importStar(__webpack_require__(293));
  2297. const inputHelper = __importStar(__webpack_require__(821));
  2298. const path = __importStar(__webpack_require__(622));
  2299. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2300. function run() {
  2301. return __awaiter(this, void 0, void 0, function* () {
  2302. try {
  2303. const sourceSettings = inputHelper.getInputs();
  2304. try {
  2305. // Register problem matcher
  2306. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2307. // Get sources
  2308. yield gitSourceProvider.getSource(sourceSettings);
  2309. }
  2310. finally {
  2311. // Unregister problem matcher
  2312. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2313. }
  2314. }
  2315. catch (error) {
  2316. core.setFailed(error.message);
  2317. }
  2318. });
  2319. }
  2320. function cleanup() {
  2321. return __awaiter(this, void 0, void 0, function* () {
  2322. try {
  2323. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2324. }
  2325. catch (error) {
  2326. core.warning(error.message);
  2327. }
  2328. });
  2329. }
  2330. // Main
  2331. if (!cleanupRepositoryPath) {
  2332. run();
  2333. }
  2334. // Post
  2335. else {
  2336. cleanup();
  2337. }
  2338. /***/ }),
  2339. /***/ 211:
  2340. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2341. "use strict";
  2342. Object.defineProperty(exports, '__esModule', { value: true });
  2343. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2344. var osName = _interopDefault(__webpack_require__(2));
  2345. function getUserAgent() {
  2346. try {
  2347. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2348. } catch (error) {
  2349. if (/wmic os get Caption/.test(error.message)) {
  2350. return "Windows <version undetectable>";
  2351. }
  2352. throw error;
  2353. }
  2354. }
  2355. exports.getUserAgent = getUserAgent;
  2356. //# sourceMappingURL=index.js.map
  2357. /***/ }),
  2358. /***/ 215:
  2359. /***/ (function(module) {
  2360. module.exports = {"name":"@octokit/rest","version":"16.33.0","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/request":"^5.0.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^12.0.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.0.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^2.1.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^3.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^14.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^15.0.0","sinon":"^7.2.4","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.33.0.tgz","_integrity":"sha512-t4jMR+odsfooQwmHiREoTQixVTX2DfdbSaO+lKrW9R5XBuk0DW+5T/JdfwtxAGUAHgvDDpWY/NVVDfEPTzxD6g==","_from":"@octokit/rest@16.33.0"};
  2361. /***/ }),
  2362. /***/ 227:
  2363. /***/ (function(__unusedmodule, exports) {
  2364. "use strict";
  2365. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2366. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2367. return new (P || (P = Promise))(function (resolve, reject) {
  2368. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2369. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2370. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2371. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2372. });
  2373. };
  2374. Object.defineProperty(exports, "__esModule", { value: true });
  2375. function getCheckoutInfo(git, ref, commit) {
  2376. return __awaiter(this, void 0, void 0, function* () {
  2377. if (!git) {
  2378. throw new Error('Arg git cannot be empty');
  2379. }
  2380. if (!ref && !commit) {
  2381. throw new Error('Args ref and commit cannot both be empty');
  2382. }
  2383. const result = {};
  2384. const upperRef = (ref || '').toUpperCase();
  2385. // SHA only
  2386. if (!ref) {
  2387. result.ref = commit;
  2388. }
  2389. // refs/heads/
  2390. else if (upperRef.startsWith('REFS/HEADS/')) {
  2391. const branch = ref.substring('refs/heads/'.length);
  2392. result.ref = branch;
  2393. result.startPoint = `refs/remotes/origin/${branch}`;
  2394. }
  2395. // refs/pull/
  2396. else if (upperRef.startsWith('REFS/PULL/')) {
  2397. const branch = ref.substring('refs/pull/'.length);
  2398. result.ref = `refs/remotes/pull/${branch}`;
  2399. }
  2400. // refs/tags/
  2401. else if (upperRef.startsWith('REFS/')) {
  2402. result.ref = ref;
  2403. }
  2404. // Unqualified ref, check for a matching branch or tag
  2405. else {
  2406. if (yield git.branchExists(true, `origin/${ref}`)) {
  2407. result.ref = ref;
  2408. result.startPoint = `refs/remotes/origin/${ref}`;
  2409. }
  2410. else if (yield git.tagExists(`${ref}`)) {
  2411. result.ref = `refs/tags/${ref}`;
  2412. }
  2413. else {
  2414. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2415. }
  2416. }
  2417. return result;
  2418. });
  2419. }
  2420. exports.getCheckoutInfo = getCheckoutInfo;
  2421. function getRefSpec(ref, commit) {
  2422. if (!ref && !commit) {
  2423. throw new Error('Args ref and commit cannot both be empty');
  2424. }
  2425. const upperRef = (ref || '').toUpperCase();
  2426. // SHA
  2427. if (commit) {
  2428. // refs/heads
  2429. if (upperRef.startsWith('REFS/HEADS/')) {
  2430. const branch = ref.substring('refs/heads/'.length);
  2431. return [`+${commit}:refs/remotes/origin/${branch}`];
  2432. }
  2433. // refs/pull/
  2434. else if (upperRef.startsWith('REFS/PULL/')) {
  2435. const branch = ref.substring('refs/pull/'.length);
  2436. return [`+${commit}:refs/remotes/pull/${branch}`];
  2437. }
  2438. // refs/tags/
  2439. else if (upperRef.startsWith('REFS/TAGS/')) {
  2440. return [`+${commit}:${ref}`];
  2441. }
  2442. // Otherwise no destination ref
  2443. else {
  2444. return [commit];
  2445. }
  2446. }
  2447. // Unqualified ref, check for a matching branch or tag
  2448. else if (!upperRef.startsWith('REFS/')) {
  2449. return [
  2450. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2451. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2452. ];
  2453. }
  2454. // refs/heads/
  2455. else if (upperRef.startsWith('REFS/HEADS/')) {
  2456. const branch = ref.substring('refs/heads/'.length);
  2457. return [`+${ref}:refs/remotes/origin/${branch}`];
  2458. }
  2459. // refs/pull/
  2460. else if (upperRef.startsWith('REFS/PULL/')) {
  2461. const branch = ref.substring('refs/pull/'.length);
  2462. return [`+${ref}:refs/remotes/pull/${branch}`];
  2463. }
  2464. // refs/tags/
  2465. else {
  2466. return [`+${ref}:${ref}`];
  2467. }
  2468. }
  2469. exports.getRefSpec = getRefSpec;
  2470. /***/ }),
  2471. /***/ 248:
  2472. /***/ (function(module, __unusedexports, __webpack_require__) {
  2473. module.exports = octokitRegisterEndpoints;
  2474. const registerEndpoints = __webpack_require__(899);
  2475. function octokitRegisterEndpoints(octokit) {
  2476. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2477. }
  2478. /***/ }),
  2479. /***/ 260:
  2480. /***/ (function(module, __unusedexports, __webpack_require__) {
  2481. // Note: since nyc uses this module to output coverage, any lines
  2482. // that are in the direct sync flow of nyc's outputCoverage are
  2483. // ignored, since we can never get coverage for them.
  2484. var assert = __webpack_require__(357)
  2485. var signals = __webpack_require__(654)
  2486. var EE = __webpack_require__(614)
  2487. /* istanbul ignore if */
  2488. if (typeof EE !== 'function') {
  2489. EE = EE.EventEmitter
  2490. }
  2491. var emitter
  2492. if (process.__signal_exit_emitter__) {
  2493. emitter = process.__signal_exit_emitter__
  2494. } else {
  2495. emitter = process.__signal_exit_emitter__ = new EE()
  2496. emitter.count = 0
  2497. emitter.emitted = {}
  2498. }
  2499. // Because this emitter is a global, we have to check to see if a
  2500. // previous version of this library failed to enable infinite listeners.
  2501. // I know what you're about to say. But literally everything about
  2502. // signal-exit is a compromise with evil. Get used to it.
  2503. if (!emitter.infinite) {
  2504. emitter.setMaxListeners(Infinity)
  2505. emitter.infinite = true
  2506. }
  2507. module.exports = function (cb, opts) {
  2508. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2509. if (loaded === false) {
  2510. load()
  2511. }
  2512. var ev = 'exit'
  2513. if (opts && opts.alwaysLast) {
  2514. ev = 'afterexit'
  2515. }
  2516. var remove = function () {
  2517. emitter.removeListener(ev, cb)
  2518. if (emitter.listeners('exit').length === 0 &&
  2519. emitter.listeners('afterexit').length === 0) {
  2520. unload()
  2521. }
  2522. }
  2523. emitter.on(ev, cb)
  2524. return remove
  2525. }
  2526. module.exports.unload = unload
  2527. function unload () {
  2528. if (!loaded) {
  2529. return
  2530. }
  2531. loaded = false
  2532. signals.forEach(function (sig) {
  2533. try {
  2534. process.removeListener(sig, sigListeners[sig])
  2535. } catch (er) {}
  2536. })
  2537. process.emit = originalProcessEmit
  2538. process.reallyExit = originalProcessReallyExit
  2539. emitter.count -= 1
  2540. }
  2541. function emit (event, code, signal) {
  2542. if (emitter.emitted[event]) {
  2543. return
  2544. }
  2545. emitter.emitted[event] = true
  2546. emitter.emit(event, code, signal)
  2547. }
  2548. // { <signal>: <listener fn>, ... }
  2549. var sigListeners = {}
  2550. signals.forEach(function (sig) {
  2551. sigListeners[sig] = function listener () {
  2552. // If there are no other listeners, an exit is coming!
  2553. // Simplest way: remove us and then re-send the signal.
  2554. // We know that this will kill the process, so we can
  2555. // safely emit now.
  2556. var listeners = process.listeners(sig)
  2557. if (listeners.length === emitter.count) {
  2558. unload()
  2559. emit('exit', null, sig)
  2560. /* istanbul ignore next */
  2561. emit('afterexit', null, sig)
  2562. /* istanbul ignore next */
  2563. process.kill(process.pid, sig)
  2564. }
  2565. }
  2566. })
  2567. module.exports.signals = function () {
  2568. return signals
  2569. }
  2570. module.exports.load = load
  2571. var loaded = false
  2572. function load () {
  2573. if (loaded) {
  2574. return
  2575. }
  2576. loaded = true
  2577. // This is the number of onSignalExit's that are in play.
  2578. // It's important so that we can count the correct number of
  2579. // listeners on signals, and don't wait for the other one to
  2580. // handle it instead of us.
  2581. emitter.count += 1
  2582. signals = signals.filter(function (sig) {
  2583. try {
  2584. process.on(sig, sigListeners[sig])
  2585. return true
  2586. } catch (er) {
  2587. return false
  2588. }
  2589. })
  2590. process.emit = processEmit
  2591. process.reallyExit = processReallyExit
  2592. }
  2593. var originalProcessReallyExit = process.reallyExit
  2594. function processReallyExit (code) {
  2595. process.exitCode = code || 0
  2596. emit('exit', process.exitCode, null)
  2597. /* istanbul ignore next */
  2598. emit('afterexit', process.exitCode, null)
  2599. /* istanbul ignore next */
  2600. originalProcessReallyExit.call(process, process.exitCode)
  2601. }
  2602. var originalProcessEmit = process.emit
  2603. function processEmit (ev, arg) {
  2604. if (ev === 'exit') {
  2605. if (arg !== undefined) {
  2606. process.exitCode = arg
  2607. }
  2608. var ret = originalProcessEmit.apply(this, arguments)
  2609. emit('exit', process.exitCode, null)
  2610. /* istanbul ignore next */
  2611. emit('afterexit', process.exitCode, null)
  2612. return ret
  2613. } else {
  2614. return originalProcessEmit.apply(this, arguments)
  2615. }
  2616. }
  2617. /***/ }),
  2618. /***/ 262:
  2619. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2620. "use strict";
  2621. Object.defineProperty(exports, "__esModule", { value: true });
  2622. const fs_1 = __webpack_require__(747);
  2623. const os_1 = __webpack_require__(87);
  2624. class Context {
  2625. /**
  2626. * Hydrate the context from the environment
  2627. */
  2628. constructor() {
  2629. this.payload = {};
  2630. if (process.env.GITHUB_EVENT_PATH) {
  2631. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2632. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2633. }
  2634. else {
  2635. process.stdout.write(`GITHUB_EVENT_PATH ${process.env.GITHUB_EVENT_PATH} does not exist${os_1.EOL}`);
  2636. }
  2637. }
  2638. this.eventName = process.env.GITHUB_EVENT_NAME;
  2639. this.sha = process.env.GITHUB_SHA;
  2640. this.ref = process.env.GITHUB_REF;
  2641. this.workflow = process.env.GITHUB_WORKFLOW;
  2642. this.action = process.env.GITHUB_ACTION;
  2643. this.actor = process.env.GITHUB_ACTOR;
  2644. }
  2645. get issue() {
  2646. const payload = this.payload;
  2647. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2648. }
  2649. get repo() {
  2650. if (process.env.GITHUB_REPOSITORY) {
  2651. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2652. return { owner, repo };
  2653. }
  2654. if (this.payload.repository) {
  2655. return {
  2656. owner: this.payload.repository.owner.login,
  2657. repo: this.payload.repository.name
  2658. };
  2659. }
  2660. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2661. }
  2662. }
  2663. exports.Context = Context;
  2664. //# sourceMappingURL=context.js.map
  2665. /***/ }),
  2666. /***/ 265:
  2667. /***/ (function(module, __unusedexports, __webpack_require__) {
  2668. module.exports = getPage
  2669. const deprecate = __webpack_require__(370)
  2670. const getPageLinks = __webpack_require__(577)
  2671. const HttpError = __webpack_require__(297)
  2672. function getPage (octokit, link, which, headers) {
  2673. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  2674. const url = getPageLinks(link)[which]
  2675. if (!url) {
  2676. const urlError = new HttpError(`No ${which} page found`, 404)
  2677. return Promise.reject(urlError)
  2678. }
  2679. const requestOptions = {
  2680. url,
  2681. headers: applyAcceptHeader(link, headers)
  2682. }
  2683. const promise = octokit.request(requestOptions)
  2684. return promise
  2685. }
  2686. function applyAcceptHeader (res, headers) {
  2687. const previous = res.headers && res.headers['x-github-media-type']
  2688. if (!previous || (headers && headers.accept)) {
  2689. return headers
  2690. }
  2691. headers = headers || {}
  2692. headers.accept = 'application/vnd.' + previous
  2693. .replace('; param=', '.')
  2694. .replace('; format=', '+')
  2695. return headers
  2696. }
  2697. /***/ }),
  2698. /***/ 280:
  2699. /***/ (function(module, exports) {
  2700. exports = module.exports = SemVer
  2701. var debug
  2702. /* istanbul ignore next */
  2703. if (typeof process === 'object' &&
  2704. process.env &&
  2705. process.env.NODE_DEBUG &&
  2706. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2707. debug = function () {
  2708. var args = Array.prototype.slice.call(arguments, 0)
  2709. args.unshift('SEMVER')
  2710. console.log.apply(console, args)
  2711. }
  2712. } else {
  2713. debug = function () {}
  2714. }
  2715. // Note: this is the semver.org version of the spec that it implements
  2716. // Not necessarily the package version of this code.
  2717. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2718. var MAX_LENGTH = 256
  2719. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2720. /* istanbul ignore next */ 9007199254740991
  2721. // Max safe segment length for coercion.
  2722. var MAX_SAFE_COMPONENT_LENGTH = 16
  2723. // The actual regexps go on exports.re
  2724. var re = exports.re = []
  2725. var src = exports.src = []
  2726. var R = 0
  2727. // The following Regular Expressions can be used for tokenizing,
  2728. // validating, and parsing SemVer version strings.
  2729. // ## Numeric Identifier
  2730. // A single `0`, or a non-zero digit followed by zero or more digits.
  2731. var NUMERICIDENTIFIER = R++
  2732. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2733. var NUMERICIDENTIFIERLOOSE = R++
  2734. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2735. // ## Non-numeric Identifier
  2736. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2737. // more letters, digits, or hyphens.
  2738. var NONNUMERICIDENTIFIER = R++
  2739. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2740. // ## Main Version
  2741. // Three dot-separated numeric identifiers.
  2742. var MAINVERSION = R++
  2743. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2744. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2745. '(' + src[NUMERICIDENTIFIER] + ')'
  2746. var MAINVERSIONLOOSE = R++
  2747. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2748. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2749. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2750. // ## Pre-release Version Identifier
  2751. // A numeric identifier, or a non-numeric identifier.
  2752. var PRERELEASEIDENTIFIER = R++
  2753. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2754. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2755. var PRERELEASEIDENTIFIERLOOSE = R++
  2756. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2757. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2758. // ## Pre-release Version
  2759. // Hyphen, followed by one or more dot-separated pre-release version
  2760. // identifiers.
  2761. var PRERELEASE = R++
  2762. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2763. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2764. var PRERELEASELOOSE = R++
  2765. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2766. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2767. // ## Build Metadata Identifier
  2768. // Any combination of digits, letters, or hyphens.
  2769. var BUILDIDENTIFIER = R++
  2770. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2771. // ## Build Metadata
  2772. // Plus sign, followed by one or more period-separated build metadata
  2773. // identifiers.
  2774. var BUILD = R++
  2775. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2776. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2777. // ## Full Version String
  2778. // A main version, followed optionally by a pre-release version and
  2779. // build metadata.
  2780. // Note that the only major, minor, patch, and pre-release sections of
  2781. // the version string are capturing groups. The build metadata is not a
  2782. // capturing group, because it should not ever be used in version
  2783. // comparison.
  2784. var FULL = R++
  2785. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2786. src[PRERELEASE] + '?' +
  2787. src[BUILD] + '?'
  2788. src[FULL] = '^' + FULLPLAIN + '$'
  2789. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2790. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2791. // common in the npm registry.
  2792. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2793. src[PRERELEASELOOSE] + '?' +
  2794. src[BUILD] + '?'
  2795. var LOOSE = R++
  2796. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2797. var GTLT = R++
  2798. src[GTLT] = '((?:<|>)?=?)'
  2799. // Something like "2.*" or "1.2.x".
  2800. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2801. // Only the first item is strictly required.
  2802. var XRANGEIDENTIFIERLOOSE = R++
  2803. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2804. var XRANGEIDENTIFIER = R++
  2805. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2806. var XRANGEPLAIN = R++
  2807. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2808. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2809. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2810. '(?:' + src[PRERELEASE] + ')?' +
  2811. src[BUILD] + '?' +
  2812. ')?)?'
  2813. var XRANGEPLAINLOOSE = R++
  2814. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2815. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2816. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2817. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2818. src[BUILD] + '?' +
  2819. ')?)?'
  2820. var XRANGE = R++
  2821. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2822. var XRANGELOOSE = R++
  2823. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2824. // Coercion.
  2825. // Extract anything that could conceivably be a part of a valid semver
  2826. var COERCE = R++
  2827. src[COERCE] = '(?:^|[^\\d])' +
  2828. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2829. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2830. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2831. '(?:$|[^\\d])'
  2832. // Tilde ranges.
  2833. // Meaning is "reasonably at or greater than"
  2834. var LONETILDE = R++
  2835. src[LONETILDE] = '(?:~>?)'
  2836. var TILDETRIM = R++
  2837. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2838. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2839. var tildeTrimReplace = '$1~'
  2840. var TILDE = R++
  2841. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2842. var TILDELOOSE = R++
  2843. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2844. // Caret ranges.
  2845. // Meaning is "at least and backwards compatible with"
  2846. var LONECARET = R++
  2847. src[LONECARET] = '(?:\\^)'
  2848. var CARETTRIM = R++
  2849. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2850. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2851. var caretTrimReplace = '$1^'
  2852. var CARET = R++
  2853. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2854. var CARETLOOSE = R++
  2855. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2856. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2857. var COMPARATORLOOSE = R++
  2858. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2859. var COMPARATOR = R++
  2860. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2861. // An expression to strip any whitespace between the gtlt and the thing
  2862. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2863. var COMPARATORTRIM = R++
  2864. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2865. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2866. // this one has to use the /g flag
  2867. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2868. var comparatorTrimReplace = '$1$2$3'
  2869. // Something like `1.2.3 - 1.2.4`
  2870. // Note that these all use the loose form, because they'll be
  2871. // checked against either the strict or loose comparator form
  2872. // later.
  2873. var HYPHENRANGE = R++
  2874. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  2875. '\\s+-\\s+' +
  2876. '(' + src[XRANGEPLAIN] + ')' +
  2877. '\\s*$'
  2878. var HYPHENRANGELOOSE = R++
  2879. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  2880. '\\s+-\\s+' +
  2881. '(' + src[XRANGEPLAINLOOSE] + ')' +
  2882. '\\s*$'
  2883. // Star ranges basically just allow anything at all.
  2884. var STAR = R++
  2885. src[STAR] = '(<|>)?=?\\s*\\*'
  2886. // Compile to actual regexp objects.
  2887. // All are flag-free, unless they were created above with a flag.
  2888. for (var i = 0; i < R; i++) {
  2889. debug(i, src[i])
  2890. if (!re[i]) {
  2891. re[i] = new RegExp(src[i])
  2892. }
  2893. }
  2894. exports.parse = parse
  2895. function parse (version, options) {
  2896. if (!options || typeof options !== 'object') {
  2897. options = {
  2898. loose: !!options,
  2899. includePrerelease: false
  2900. }
  2901. }
  2902. if (version instanceof SemVer) {
  2903. return version
  2904. }
  2905. if (typeof version !== 'string') {
  2906. return null
  2907. }
  2908. if (version.length > MAX_LENGTH) {
  2909. return null
  2910. }
  2911. var r = options.loose ? re[LOOSE] : re[FULL]
  2912. if (!r.test(version)) {
  2913. return null
  2914. }
  2915. try {
  2916. return new SemVer(version, options)
  2917. } catch (er) {
  2918. return null
  2919. }
  2920. }
  2921. exports.valid = valid
  2922. function valid (version, options) {
  2923. var v = parse(version, options)
  2924. return v ? v.version : null
  2925. }
  2926. exports.clean = clean
  2927. function clean (version, options) {
  2928. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  2929. return s ? s.version : null
  2930. }
  2931. exports.SemVer = SemVer
  2932. function SemVer (version, options) {
  2933. if (!options || typeof options !== 'object') {
  2934. options = {
  2935. loose: !!options,
  2936. includePrerelease: false
  2937. }
  2938. }
  2939. if (version instanceof SemVer) {
  2940. if (version.loose === options.loose) {
  2941. return version
  2942. } else {
  2943. version = version.version
  2944. }
  2945. } else if (typeof version !== 'string') {
  2946. throw new TypeError('Invalid Version: ' + version)
  2947. }
  2948. if (version.length > MAX_LENGTH) {
  2949. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  2950. }
  2951. if (!(this instanceof SemVer)) {
  2952. return new SemVer(version, options)
  2953. }
  2954. debug('SemVer', version, options)
  2955. this.options = options
  2956. this.loose = !!options.loose
  2957. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  2958. if (!m) {
  2959. throw new TypeError('Invalid Version: ' + version)
  2960. }
  2961. this.raw = version
  2962. // these are actually numbers
  2963. this.major = +m[1]
  2964. this.minor = +m[2]
  2965. this.patch = +m[3]
  2966. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  2967. throw new TypeError('Invalid major version')
  2968. }
  2969. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  2970. throw new TypeError('Invalid minor version')
  2971. }
  2972. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  2973. throw new TypeError('Invalid patch version')
  2974. }
  2975. // numberify any prerelease numeric ids
  2976. if (!m[4]) {
  2977. this.prerelease = []
  2978. } else {
  2979. this.prerelease = m[4].split('.').map(function (id) {
  2980. if (/^[0-9]+$/.test(id)) {
  2981. var num = +id
  2982. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  2983. return num
  2984. }
  2985. }
  2986. return id
  2987. })
  2988. }
  2989. this.build = m[5] ? m[5].split('.') : []
  2990. this.format()
  2991. }
  2992. SemVer.prototype.format = function () {
  2993. this.version = this.major + '.' + this.minor + '.' + this.patch
  2994. if (this.prerelease.length) {
  2995. this.version += '-' + this.prerelease.join('.')
  2996. }
  2997. return this.version
  2998. }
  2999. SemVer.prototype.toString = function () {
  3000. return this.version
  3001. }
  3002. SemVer.prototype.compare = function (other) {
  3003. debug('SemVer.compare', this.version, this.options, other)
  3004. if (!(other instanceof SemVer)) {
  3005. other = new SemVer(other, this.options)
  3006. }
  3007. return this.compareMain(other) || this.comparePre(other)
  3008. }
  3009. SemVer.prototype.compareMain = function (other) {
  3010. if (!(other instanceof SemVer)) {
  3011. other = new SemVer(other, this.options)
  3012. }
  3013. return compareIdentifiers(this.major, other.major) ||
  3014. compareIdentifiers(this.minor, other.minor) ||
  3015. compareIdentifiers(this.patch, other.patch)
  3016. }
  3017. SemVer.prototype.comparePre = function (other) {
  3018. if (!(other instanceof SemVer)) {
  3019. other = new SemVer(other, this.options)
  3020. }
  3021. // NOT having a prerelease is > having one
  3022. if (this.prerelease.length && !other.prerelease.length) {
  3023. return -1
  3024. } else if (!this.prerelease.length && other.prerelease.length) {
  3025. return 1
  3026. } else if (!this.prerelease.length && !other.prerelease.length) {
  3027. return 0
  3028. }
  3029. var i = 0
  3030. do {
  3031. var a = this.prerelease[i]
  3032. var b = other.prerelease[i]
  3033. debug('prerelease compare', i, a, b)
  3034. if (a === undefined && b === undefined) {
  3035. return 0
  3036. } else if (b === undefined) {
  3037. return 1
  3038. } else if (a === undefined) {
  3039. return -1
  3040. } else if (a === b) {
  3041. continue
  3042. } else {
  3043. return compareIdentifiers(a, b)
  3044. }
  3045. } while (++i)
  3046. }
  3047. // preminor will bump the version up to the next minor release, and immediately
  3048. // down to pre-release. premajor and prepatch work the same way.
  3049. SemVer.prototype.inc = function (release, identifier) {
  3050. switch (release) {
  3051. case 'premajor':
  3052. this.prerelease.length = 0
  3053. this.patch = 0
  3054. this.minor = 0
  3055. this.major++
  3056. this.inc('pre', identifier)
  3057. break
  3058. case 'preminor':
  3059. this.prerelease.length = 0
  3060. this.patch = 0
  3061. this.minor++
  3062. this.inc('pre', identifier)
  3063. break
  3064. case 'prepatch':
  3065. // If this is already a prerelease, it will bump to the next version
  3066. // drop any prereleases that might already exist, since they are not
  3067. // relevant at this point.
  3068. this.prerelease.length = 0
  3069. this.inc('patch', identifier)
  3070. this.inc('pre', identifier)
  3071. break
  3072. // If the input is a non-prerelease version, this acts the same as
  3073. // prepatch.
  3074. case 'prerelease':
  3075. if (this.prerelease.length === 0) {
  3076. this.inc('patch', identifier)
  3077. }
  3078. this.inc('pre', identifier)
  3079. break
  3080. case 'major':
  3081. // If this is a pre-major version, bump up to the same major version.
  3082. // Otherwise increment major.
  3083. // 1.0.0-5 bumps to 1.0.0
  3084. // 1.1.0 bumps to 2.0.0
  3085. if (this.minor !== 0 ||
  3086. this.patch !== 0 ||
  3087. this.prerelease.length === 0) {
  3088. this.major++
  3089. }
  3090. this.minor = 0
  3091. this.patch = 0
  3092. this.prerelease = []
  3093. break
  3094. case 'minor':
  3095. // If this is a pre-minor version, bump up to the same minor version.
  3096. // Otherwise increment minor.
  3097. // 1.2.0-5 bumps to 1.2.0
  3098. // 1.2.1 bumps to 1.3.0
  3099. if (this.patch !== 0 || this.prerelease.length === 0) {
  3100. this.minor++
  3101. }
  3102. this.patch = 0
  3103. this.prerelease = []
  3104. break
  3105. case 'patch':
  3106. // If this is not a pre-release version, it will increment the patch.
  3107. // If it is a pre-release it will bump up to the same patch version.
  3108. // 1.2.0-5 patches to 1.2.0
  3109. // 1.2.0 patches to 1.2.1
  3110. if (this.prerelease.length === 0) {
  3111. this.patch++
  3112. }
  3113. this.prerelease = []
  3114. break
  3115. // This probably shouldn't be used publicly.
  3116. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3117. case 'pre':
  3118. if (this.prerelease.length === 0) {
  3119. this.prerelease = [0]
  3120. } else {
  3121. var i = this.prerelease.length
  3122. while (--i >= 0) {
  3123. if (typeof this.prerelease[i] === 'number') {
  3124. this.prerelease[i]++
  3125. i = -2
  3126. }
  3127. }
  3128. if (i === -1) {
  3129. // didn't increment anything
  3130. this.prerelease.push(0)
  3131. }
  3132. }
  3133. if (identifier) {
  3134. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3135. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3136. if (this.prerelease[0] === identifier) {
  3137. if (isNaN(this.prerelease[1])) {
  3138. this.prerelease = [identifier, 0]
  3139. }
  3140. } else {
  3141. this.prerelease = [identifier, 0]
  3142. }
  3143. }
  3144. break
  3145. default:
  3146. throw new Error('invalid increment argument: ' + release)
  3147. }
  3148. this.format()
  3149. this.raw = this.version
  3150. return this
  3151. }
  3152. exports.inc = inc
  3153. function inc (version, release, loose, identifier) {
  3154. if (typeof (loose) === 'string') {
  3155. identifier = loose
  3156. loose = undefined
  3157. }
  3158. try {
  3159. return new SemVer(version, loose).inc(release, identifier).version
  3160. } catch (er) {
  3161. return null
  3162. }
  3163. }
  3164. exports.diff = diff
  3165. function diff (version1, version2) {
  3166. if (eq(version1, version2)) {
  3167. return null
  3168. } else {
  3169. var v1 = parse(version1)
  3170. var v2 = parse(version2)
  3171. var prefix = ''
  3172. if (v1.prerelease.length || v2.prerelease.length) {
  3173. prefix = 'pre'
  3174. var defaultResult = 'prerelease'
  3175. }
  3176. for (var key in v1) {
  3177. if (key === 'major' || key === 'minor' || key === 'patch') {
  3178. if (v1[key] !== v2[key]) {
  3179. return prefix + key
  3180. }
  3181. }
  3182. }
  3183. return defaultResult // may be undefined
  3184. }
  3185. }
  3186. exports.compareIdentifiers = compareIdentifiers
  3187. var numeric = /^[0-9]+$/
  3188. function compareIdentifiers (a, b) {
  3189. var anum = numeric.test(a)
  3190. var bnum = numeric.test(b)
  3191. if (anum && bnum) {
  3192. a = +a
  3193. b = +b
  3194. }
  3195. return a === b ? 0
  3196. : (anum && !bnum) ? -1
  3197. : (bnum && !anum) ? 1
  3198. : a < b ? -1
  3199. : 1
  3200. }
  3201. exports.rcompareIdentifiers = rcompareIdentifiers
  3202. function rcompareIdentifiers (a, b) {
  3203. return compareIdentifiers(b, a)
  3204. }
  3205. exports.major = major
  3206. function major (a, loose) {
  3207. return new SemVer(a, loose).major
  3208. }
  3209. exports.minor = minor
  3210. function minor (a, loose) {
  3211. return new SemVer(a, loose).minor
  3212. }
  3213. exports.patch = patch
  3214. function patch (a, loose) {
  3215. return new SemVer(a, loose).patch
  3216. }
  3217. exports.compare = compare
  3218. function compare (a, b, loose) {
  3219. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3220. }
  3221. exports.compareLoose = compareLoose
  3222. function compareLoose (a, b) {
  3223. return compare(a, b, true)
  3224. }
  3225. exports.rcompare = rcompare
  3226. function rcompare (a, b, loose) {
  3227. return compare(b, a, loose)
  3228. }
  3229. exports.sort = sort
  3230. function sort (list, loose) {
  3231. return list.sort(function (a, b) {
  3232. return exports.compare(a, b, loose)
  3233. })
  3234. }
  3235. exports.rsort = rsort
  3236. function rsort (list, loose) {
  3237. return list.sort(function (a, b) {
  3238. return exports.rcompare(a, b, loose)
  3239. })
  3240. }
  3241. exports.gt = gt
  3242. function gt (a, b, loose) {
  3243. return compare(a, b, loose) > 0
  3244. }
  3245. exports.lt = lt
  3246. function lt (a, b, loose) {
  3247. return compare(a, b, loose) < 0
  3248. }
  3249. exports.eq = eq
  3250. function eq (a, b, loose) {
  3251. return compare(a, b, loose) === 0
  3252. }
  3253. exports.neq = neq
  3254. function neq (a, b, loose) {
  3255. return compare(a, b, loose) !== 0
  3256. }
  3257. exports.gte = gte
  3258. function gte (a, b, loose) {
  3259. return compare(a, b, loose) >= 0
  3260. }
  3261. exports.lte = lte
  3262. function lte (a, b, loose) {
  3263. return compare(a, b, loose) <= 0
  3264. }
  3265. exports.cmp = cmp
  3266. function cmp (a, op, b, loose) {
  3267. switch (op) {
  3268. case '===':
  3269. if (typeof a === 'object')
  3270. a = a.version
  3271. if (typeof b === 'object')
  3272. b = b.version
  3273. return a === b
  3274. case '!==':
  3275. if (typeof a === 'object')
  3276. a = a.version
  3277. if (typeof b === 'object')
  3278. b = b.version
  3279. return a !== b
  3280. case '':
  3281. case '=':
  3282. case '==':
  3283. return eq(a, b, loose)
  3284. case '!=':
  3285. return neq(a, b, loose)
  3286. case '>':
  3287. return gt(a, b, loose)
  3288. case '>=':
  3289. return gte(a, b, loose)
  3290. case '<':
  3291. return lt(a, b, loose)
  3292. case '<=':
  3293. return lte(a, b, loose)
  3294. default:
  3295. throw new TypeError('Invalid operator: ' + op)
  3296. }
  3297. }
  3298. exports.Comparator = Comparator
  3299. function Comparator (comp, options) {
  3300. if (!options || typeof options !== 'object') {
  3301. options = {
  3302. loose: !!options,
  3303. includePrerelease: false
  3304. }
  3305. }
  3306. if (comp instanceof Comparator) {
  3307. if (comp.loose === !!options.loose) {
  3308. return comp
  3309. } else {
  3310. comp = comp.value
  3311. }
  3312. }
  3313. if (!(this instanceof Comparator)) {
  3314. return new Comparator(comp, options)
  3315. }
  3316. debug('comparator', comp, options)
  3317. this.options = options
  3318. this.loose = !!options.loose
  3319. this.parse(comp)
  3320. if (this.semver === ANY) {
  3321. this.value = ''
  3322. } else {
  3323. this.value = this.operator + this.semver.version
  3324. }
  3325. debug('comp', this)
  3326. }
  3327. var ANY = {}
  3328. Comparator.prototype.parse = function (comp) {
  3329. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3330. var m = comp.match(r)
  3331. if (!m) {
  3332. throw new TypeError('Invalid comparator: ' + comp)
  3333. }
  3334. this.operator = m[1]
  3335. if (this.operator === '=') {
  3336. this.operator = ''
  3337. }
  3338. // if it literally is just '>' or '' then allow anything.
  3339. if (!m[2]) {
  3340. this.semver = ANY
  3341. } else {
  3342. this.semver = new SemVer(m[2], this.options.loose)
  3343. }
  3344. }
  3345. Comparator.prototype.toString = function () {
  3346. return this.value
  3347. }
  3348. Comparator.prototype.test = function (version) {
  3349. debug('Comparator.test', version, this.options.loose)
  3350. if (this.semver === ANY) {
  3351. return true
  3352. }
  3353. if (typeof version === 'string') {
  3354. version = new SemVer(version, this.options)
  3355. }
  3356. return cmp(version, this.operator, this.semver, this.options)
  3357. }
  3358. Comparator.prototype.intersects = function (comp, options) {
  3359. if (!(comp instanceof Comparator)) {
  3360. throw new TypeError('a Comparator is required')
  3361. }
  3362. if (!options || typeof options !== 'object') {
  3363. options = {
  3364. loose: !!options,
  3365. includePrerelease: false
  3366. }
  3367. }
  3368. var rangeTmp
  3369. if (this.operator === '') {
  3370. rangeTmp = new Range(comp.value, options)
  3371. return satisfies(this.value, rangeTmp, options)
  3372. } else if (comp.operator === '') {
  3373. rangeTmp = new Range(this.value, options)
  3374. return satisfies(comp.semver, rangeTmp, options)
  3375. }
  3376. var sameDirectionIncreasing =
  3377. (this.operator === '>=' || this.operator === '>') &&
  3378. (comp.operator === '>=' || comp.operator === '>')
  3379. var sameDirectionDecreasing =
  3380. (this.operator === '<=' || this.operator === '<') &&
  3381. (comp.operator === '<=' || comp.operator === '<')
  3382. var sameSemVer = this.semver.version === comp.semver.version
  3383. var differentDirectionsInclusive =
  3384. (this.operator === '>=' || this.operator === '<=') &&
  3385. (comp.operator === '>=' || comp.operator === '<=')
  3386. var oppositeDirectionsLessThan =
  3387. cmp(this.semver, '<', comp.semver, options) &&
  3388. ((this.operator === '>=' || this.operator === '>') &&
  3389. (comp.operator === '<=' || comp.operator === '<'))
  3390. var oppositeDirectionsGreaterThan =
  3391. cmp(this.semver, '>', comp.semver, options) &&
  3392. ((this.operator === '<=' || this.operator === '<') &&
  3393. (comp.operator === '>=' || comp.operator === '>'))
  3394. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3395. (sameSemVer && differentDirectionsInclusive) ||
  3396. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3397. }
  3398. exports.Range = Range
  3399. function Range (range, options) {
  3400. if (!options || typeof options !== 'object') {
  3401. options = {
  3402. loose: !!options,
  3403. includePrerelease: false
  3404. }
  3405. }
  3406. if (range instanceof Range) {
  3407. if (range.loose === !!options.loose &&
  3408. range.includePrerelease === !!options.includePrerelease) {
  3409. return range
  3410. } else {
  3411. return new Range(range.raw, options)
  3412. }
  3413. }
  3414. if (range instanceof Comparator) {
  3415. return new Range(range.value, options)
  3416. }
  3417. if (!(this instanceof Range)) {
  3418. return new Range(range, options)
  3419. }
  3420. this.options = options
  3421. this.loose = !!options.loose
  3422. this.includePrerelease = !!options.includePrerelease
  3423. // First, split based on boolean or ||
  3424. this.raw = range
  3425. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3426. return this.parseRange(range.trim())
  3427. }, this).filter(function (c) {
  3428. // throw out any that are not relevant for whatever reason
  3429. return c.length
  3430. })
  3431. if (!this.set.length) {
  3432. throw new TypeError('Invalid SemVer Range: ' + range)
  3433. }
  3434. this.format()
  3435. }
  3436. Range.prototype.format = function () {
  3437. this.range = this.set.map(function (comps) {
  3438. return comps.join(' ').trim()
  3439. }).join('||').trim()
  3440. return this.range
  3441. }
  3442. Range.prototype.toString = function () {
  3443. return this.range
  3444. }
  3445. Range.prototype.parseRange = function (range) {
  3446. var loose = this.options.loose
  3447. range = range.trim()
  3448. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3449. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3450. range = range.replace(hr, hyphenReplace)
  3451. debug('hyphen replace', range)
  3452. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3453. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3454. debug('comparator trim', range, re[COMPARATORTRIM])
  3455. // `~ 1.2.3` => `~1.2.3`
  3456. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3457. // `^ 1.2.3` => `^1.2.3`
  3458. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3459. // normalize spaces
  3460. range = range.split(/\s+/).join(' ')
  3461. // At this point, the range is completely trimmed and
  3462. // ready to be split into comparators.
  3463. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3464. var set = range.split(' ').map(function (comp) {
  3465. return parseComparator(comp, this.options)
  3466. }, this).join(' ').split(/\s+/)
  3467. if (this.options.loose) {
  3468. // in loose mode, throw out any that are not valid comparators
  3469. set = set.filter(function (comp) {
  3470. return !!comp.match(compRe)
  3471. })
  3472. }
  3473. set = set.map(function (comp) {
  3474. return new Comparator(comp, this.options)
  3475. }, this)
  3476. return set
  3477. }
  3478. Range.prototype.intersects = function (range, options) {
  3479. if (!(range instanceof Range)) {
  3480. throw new TypeError('a Range is required')
  3481. }
  3482. return this.set.some(function (thisComparators) {
  3483. return thisComparators.every(function (thisComparator) {
  3484. return range.set.some(function (rangeComparators) {
  3485. return rangeComparators.every(function (rangeComparator) {
  3486. return thisComparator.intersects(rangeComparator, options)
  3487. })
  3488. })
  3489. })
  3490. })
  3491. }
  3492. // Mostly just for testing and legacy API reasons
  3493. exports.toComparators = toComparators
  3494. function toComparators (range, options) {
  3495. return new Range(range, options).set.map(function (comp) {
  3496. return comp.map(function (c) {
  3497. return c.value
  3498. }).join(' ').trim().split(' ')
  3499. })
  3500. }
  3501. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3502. // already replaced the hyphen ranges
  3503. // turn into a set of JUST comparators.
  3504. function parseComparator (comp, options) {
  3505. debug('comp', comp, options)
  3506. comp = replaceCarets(comp, options)
  3507. debug('caret', comp)
  3508. comp = replaceTildes(comp, options)
  3509. debug('tildes', comp)
  3510. comp = replaceXRanges(comp, options)
  3511. debug('xrange', comp)
  3512. comp = replaceStars(comp, options)
  3513. debug('stars', comp)
  3514. return comp
  3515. }
  3516. function isX (id) {
  3517. return !id || id.toLowerCase() === 'x' || id === '*'
  3518. }
  3519. // ~, ~> --> * (any, kinda silly)
  3520. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3521. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3522. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3523. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3524. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3525. function replaceTildes (comp, options) {
  3526. return comp.trim().split(/\s+/).map(function (comp) {
  3527. return replaceTilde(comp, options)
  3528. }).join(' ')
  3529. }
  3530. function replaceTilde (comp, options) {
  3531. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3532. return comp.replace(r, function (_, M, m, p, pr) {
  3533. debug('tilde', comp, _, M, m, p, pr)
  3534. var ret
  3535. if (isX(M)) {
  3536. ret = ''
  3537. } else if (isX(m)) {
  3538. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3539. } else if (isX(p)) {
  3540. // ~1.2 == >=1.2.0 <1.3.0
  3541. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3542. } else if (pr) {
  3543. debug('replaceTilde pr', pr)
  3544. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3545. ' <' + M + '.' + (+m + 1) + '.0'
  3546. } else {
  3547. // ~1.2.3 == >=1.2.3 <1.3.0
  3548. ret = '>=' + M + '.' + m + '.' + p +
  3549. ' <' + M + '.' + (+m + 1) + '.0'
  3550. }
  3551. debug('tilde return', ret)
  3552. return ret
  3553. })
  3554. }
  3555. // ^ --> * (any, kinda silly)
  3556. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3557. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3558. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3559. // ^1.2.3 --> >=1.2.3 <2.0.0
  3560. // ^1.2.0 --> >=1.2.0 <2.0.0
  3561. function replaceCarets (comp, options) {
  3562. return comp.trim().split(/\s+/).map(function (comp) {
  3563. return replaceCaret(comp, options)
  3564. }).join(' ')
  3565. }
  3566. function replaceCaret (comp, options) {
  3567. debug('caret', comp, options)
  3568. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3569. return comp.replace(r, function (_, M, m, p, pr) {
  3570. debug('caret', comp, _, M, m, p, pr)
  3571. var ret
  3572. if (isX(M)) {
  3573. ret = ''
  3574. } else if (isX(m)) {
  3575. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3576. } else if (isX(p)) {
  3577. if (M === '0') {
  3578. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3579. } else {
  3580. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3581. }
  3582. } else if (pr) {
  3583. debug('replaceCaret pr', pr)
  3584. if (M === '0') {
  3585. if (m === '0') {
  3586. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3587. ' <' + M + '.' + m + '.' + (+p + 1)
  3588. } else {
  3589. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3590. ' <' + M + '.' + (+m + 1) + '.0'
  3591. }
  3592. } else {
  3593. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3594. ' <' + (+M + 1) + '.0.0'
  3595. }
  3596. } else {
  3597. debug('no pr')
  3598. if (M === '0') {
  3599. if (m === '0') {
  3600. ret = '>=' + M + '.' + m + '.' + p +
  3601. ' <' + M + '.' + m + '.' + (+p + 1)
  3602. } else {
  3603. ret = '>=' + M + '.' + m + '.' + p +
  3604. ' <' + M + '.' + (+m + 1) + '.0'
  3605. }
  3606. } else {
  3607. ret = '>=' + M + '.' + m + '.' + p +
  3608. ' <' + (+M + 1) + '.0.0'
  3609. }
  3610. }
  3611. debug('caret return', ret)
  3612. return ret
  3613. })
  3614. }
  3615. function replaceXRanges (comp, options) {
  3616. debug('replaceXRanges', comp, options)
  3617. return comp.split(/\s+/).map(function (comp) {
  3618. return replaceXRange(comp, options)
  3619. }).join(' ')
  3620. }
  3621. function replaceXRange (comp, options) {
  3622. comp = comp.trim()
  3623. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3624. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3625. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3626. var xM = isX(M)
  3627. var xm = xM || isX(m)
  3628. var xp = xm || isX(p)
  3629. var anyX = xp
  3630. if (gtlt === '=' && anyX) {
  3631. gtlt = ''
  3632. }
  3633. if (xM) {
  3634. if (gtlt === '>' || gtlt === '<') {
  3635. // nothing is allowed
  3636. ret = '<0.0.0'
  3637. } else {
  3638. // nothing is forbidden
  3639. ret = '*'
  3640. }
  3641. } else if (gtlt && anyX) {
  3642. // we know patch is an x, because we have any x at all.
  3643. // replace X with 0
  3644. if (xm) {
  3645. m = 0
  3646. }
  3647. p = 0
  3648. if (gtlt === '>') {
  3649. // >1 => >=2.0.0
  3650. // >1.2 => >=1.3.0
  3651. // >1.2.3 => >= 1.2.4
  3652. gtlt = '>='
  3653. if (xm) {
  3654. M = +M + 1
  3655. m = 0
  3656. p = 0
  3657. } else {
  3658. m = +m + 1
  3659. p = 0
  3660. }
  3661. } else if (gtlt === '<=') {
  3662. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3663. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3664. gtlt = '<'
  3665. if (xm) {
  3666. M = +M + 1
  3667. } else {
  3668. m = +m + 1
  3669. }
  3670. }
  3671. ret = gtlt + M + '.' + m + '.' + p
  3672. } else if (xm) {
  3673. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3674. } else if (xp) {
  3675. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3676. }
  3677. debug('xRange return', ret)
  3678. return ret
  3679. })
  3680. }
  3681. // Because * is AND-ed with everything else in the comparator,
  3682. // and '' means "any version", just remove the *s entirely.
  3683. function replaceStars (comp, options) {
  3684. debug('replaceStars', comp, options)
  3685. // Looseness is ignored here. star is always as loose as it gets!
  3686. return comp.trim().replace(re[STAR], '')
  3687. }
  3688. // This function is passed to string.replace(re[HYPHENRANGE])
  3689. // M, m, patch, prerelease, build
  3690. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3691. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3692. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3693. function hyphenReplace ($0,
  3694. from, fM, fm, fp, fpr, fb,
  3695. to, tM, tm, tp, tpr, tb) {
  3696. if (isX(fM)) {
  3697. from = ''
  3698. } else if (isX(fm)) {
  3699. from = '>=' + fM + '.0.0'
  3700. } else if (isX(fp)) {
  3701. from = '>=' + fM + '.' + fm + '.0'
  3702. } else {
  3703. from = '>=' + from
  3704. }
  3705. if (isX(tM)) {
  3706. to = ''
  3707. } else if (isX(tm)) {
  3708. to = '<' + (+tM + 1) + '.0.0'
  3709. } else if (isX(tp)) {
  3710. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3711. } else if (tpr) {
  3712. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3713. } else {
  3714. to = '<=' + to
  3715. }
  3716. return (from + ' ' + to).trim()
  3717. }
  3718. // if ANY of the sets match ALL of its comparators, then pass
  3719. Range.prototype.test = function (version) {
  3720. if (!version) {
  3721. return false
  3722. }
  3723. if (typeof version === 'string') {
  3724. version = new SemVer(version, this.options)
  3725. }
  3726. for (var i = 0; i < this.set.length; i++) {
  3727. if (testSet(this.set[i], version, this.options)) {
  3728. return true
  3729. }
  3730. }
  3731. return false
  3732. }
  3733. function testSet (set, version, options) {
  3734. for (var i = 0; i < set.length; i++) {
  3735. if (!set[i].test(version)) {
  3736. return false
  3737. }
  3738. }
  3739. if (version.prerelease.length && !options.includePrerelease) {
  3740. // Find the set of versions that are allowed to have prereleases
  3741. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3742. // That should allow `1.2.3-pr.2` to pass.
  3743. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3744. // even though it's within the range set by the comparators.
  3745. for (i = 0; i < set.length; i++) {
  3746. debug(set[i].semver)
  3747. if (set[i].semver === ANY) {
  3748. continue
  3749. }
  3750. if (set[i].semver.prerelease.length > 0) {
  3751. var allowed = set[i].semver
  3752. if (allowed.major === version.major &&
  3753. allowed.minor === version.minor &&
  3754. allowed.patch === version.patch) {
  3755. return true
  3756. }
  3757. }
  3758. }
  3759. // Version has a -pre, but it's not one of the ones we like.
  3760. return false
  3761. }
  3762. return true
  3763. }
  3764. exports.satisfies = satisfies
  3765. function satisfies (version, range, options) {
  3766. try {
  3767. range = new Range(range, options)
  3768. } catch (er) {
  3769. return false
  3770. }
  3771. return range.test(version)
  3772. }
  3773. exports.maxSatisfying = maxSatisfying
  3774. function maxSatisfying (versions, range, options) {
  3775. var max = null
  3776. var maxSV = null
  3777. try {
  3778. var rangeObj = new Range(range, options)
  3779. } catch (er) {
  3780. return null
  3781. }
  3782. versions.forEach(function (v) {
  3783. if (rangeObj.test(v)) {
  3784. // satisfies(v, range, options)
  3785. if (!max || maxSV.compare(v) === -1) {
  3786. // compare(max, v, true)
  3787. max = v
  3788. maxSV = new SemVer(max, options)
  3789. }
  3790. }
  3791. })
  3792. return max
  3793. }
  3794. exports.minSatisfying = minSatisfying
  3795. function minSatisfying (versions, range, options) {
  3796. var min = null
  3797. var minSV = null
  3798. try {
  3799. var rangeObj = new Range(range, options)
  3800. } catch (er) {
  3801. return null
  3802. }
  3803. versions.forEach(function (v) {
  3804. if (rangeObj.test(v)) {
  3805. // satisfies(v, range, options)
  3806. if (!min || minSV.compare(v) === 1) {
  3807. // compare(min, v, true)
  3808. min = v
  3809. minSV = new SemVer(min, options)
  3810. }
  3811. }
  3812. })
  3813. return min
  3814. }
  3815. exports.minVersion = minVersion
  3816. function minVersion (range, loose) {
  3817. range = new Range(range, loose)
  3818. var minver = new SemVer('0.0.0')
  3819. if (range.test(minver)) {
  3820. return minver
  3821. }
  3822. minver = new SemVer('0.0.0-0')
  3823. if (range.test(minver)) {
  3824. return minver
  3825. }
  3826. minver = null
  3827. for (var i = 0; i < range.set.length; ++i) {
  3828. var comparators = range.set[i]
  3829. comparators.forEach(function (comparator) {
  3830. // Clone to avoid manipulating the comparator's semver object.
  3831. var compver = new SemVer(comparator.semver.version)
  3832. switch (comparator.operator) {
  3833. case '>':
  3834. if (compver.prerelease.length === 0) {
  3835. compver.patch++
  3836. } else {
  3837. compver.prerelease.push(0)
  3838. }
  3839. compver.raw = compver.format()
  3840. /* fallthrough */
  3841. case '':
  3842. case '>=':
  3843. if (!minver || gt(minver, compver)) {
  3844. minver = compver
  3845. }
  3846. break
  3847. case '<':
  3848. case '<=':
  3849. /* Ignore maximum versions */
  3850. break
  3851. /* istanbul ignore next */
  3852. default:
  3853. throw new Error('Unexpected operation: ' + comparator.operator)
  3854. }
  3855. })
  3856. }
  3857. if (minver && range.test(minver)) {
  3858. return minver
  3859. }
  3860. return null
  3861. }
  3862. exports.validRange = validRange
  3863. function validRange (range, options) {
  3864. try {
  3865. // Return '*' instead of '' so that truthiness works.
  3866. // This will throw if it's invalid anyway
  3867. return new Range(range, options).range || '*'
  3868. } catch (er) {
  3869. return null
  3870. }
  3871. }
  3872. // Determine if version is less than all the versions possible in the range
  3873. exports.ltr = ltr
  3874. function ltr (version, range, options) {
  3875. return outside(version, range, '<', options)
  3876. }
  3877. // Determine if version is greater than all the versions possible in the range.
  3878. exports.gtr = gtr
  3879. function gtr (version, range, options) {
  3880. return outside(version, range, '>', options)
  3881. }
  3882. exports.outside = outside
  3883. function outside (version, range, hilo, options) {
  3884. version = new SemVer(version, options)
  3885. range = new Range(range, options)
  3886. var gtfn, ltefn, ltfn, comp, ecomp
  3887. switch (hilo) {
  3888. case '>':
  3889. gtfn = gt
  3890. ltefn = lte
  3891. ltfn = lt
  3892. comp = '>'
  3893. ecomp = '>='
  3894. break
  3895. case '<':
  3896. gtfn = lt
  3897. ltefn = gte
  3898. ltfn = gt
  3899. comp = '<'
  3900. ecomp = '<='
  3901. break
  3902. default:
  3903. throw new TypeError('Must provide a hilo val of "<" or ">"')
  3904. }
  3905. // If it satisifes the range it is not outside
  3906. if (satisfies(version, range, options)) {
  3907. return false
  3908. }
  3909. // From now on, variable terms are as if we're in "gtr" mode.
  3910. // but note that everything is flipped for the "ltr" function.
  3911. for (var i = 0; i < range.set.length; ++i) {
  3912. var comparators = range.set[i]
  3913. var high = null
  3914. var low = null
  3915. comparators.forEach(function (comparator) {
  3916. if (comparator.semver === ANY) {
  3917. comparator = new Comparator('>=0.0.0')
  3918. }
  3919. high = high || comparator
  3920. low = low || comparator
  3921. if (gtfn(comparator.semver, high.semver, options)) {
  3922. high = comparator
  3923. } else if (ltfn(comparator.semver, low.semver, options)) {
  3924. low = comparator
  3925. }
  3926. })
  3927. // If the edge version comparator has a operator then our version
  3928. // isn't outside it
  3929. if (high.operator === comp || high.operator === ecomp) {
  3930. return false
  3931. }
  3932. // If the lowest version comparator has an operator and our version
  3933. // is less than it then it isn't higher than the range
  3934. if ((!low.operator || low.operator === comp) &&
  3935. ltefn(version, low.semver)) {
  3936. return false
  3937. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  3938. return false
  3939. }
  3940. }
  3941. return true
  3942. }
  3943. exports.prerelease = prerelease
  3944. function prerelease (version, options) {
  3945. var parsed = parse(version, options)
  3946. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  3947. }
  3948. exports.intersects = intersects
  3949. function intersects (r1, r2, options) {
  3950. r1 = new Range(r1, options)
  3951. r2 = new Range(r2, options)
  3952. return r1.intersects(r2)
  3953. }
  3954. exports.coerce = coerce
  3955. function coerce (version) {
  3956. if (version instanceof SemVer) {
  3957. return version
  3958. }
  3959. if (typeof version !== 'string') {
  3960. return null
  3961. }
  3962. var match = version.match(re[COERCE])
  3963. if (match == null) {
  3964. return null
  3965. }
  3966. return parse(match[1] +
  3967. '.' + (match[2] || '0') +
  3968. '.' + (match[3] || '0'))
  3969. }
  3970. /***/ }),
  3971. /***/ 289:
  3972. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3973. "use strict";
  3974. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3975. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3976. return new (P || (P = Promise))(function (resolve, reject) {
  3977. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3978. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3979. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3980. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3981. });
  3982. };
  3983. var __importStar = (this && this.__importStar) || function (mod) {
  3984. if (mod && mod.__esModule) return mod;
  3985. var result = {};
  3986. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  3987. result["default"] = mod;
  3988. return result;
  3989. };
  3990. Object.defineProperty(exports, "__esModule", { value: true });
  3991. const core = __importStar(__webpack_require__(470));
  3992. const exec = __importStar(__webpack_require__(986));
  3993. const fshelper = __importStar(__webpack_require__(618));
  3994. const io = __importStar(__webpack_require__(1));
  3995. const path = __importStar(__webpack_require__(622));
  3996. const git_version_1 = __webpack_require__(559);
  3997. function CreateCommandManager(workingDirectory, lfs) {
  3998. return __awaiter(this, void 0, void 0, function* () {
  3999. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4000. });
  4001. }
  4002. exports.CreateCommandManager = CreateCommandManager;
  4003. class GitCommandManager {
  4004. // Private constructor; use createCommandManager()
  4005. constructor() {
  4006. this.gitEnv = {
  4007. GIT_TERMINAL_PROMPT: '0',
  4008. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4009. };
  4010. this.gitPath = '';
  4011. this.lfs = false;
  4012. this.workingDirectory = '';
  4013. }
  4014. branchDelete(remote, branch) {
  4015. return __awaiter(this, void 0, void 0, function* () {
  4016. const args = ['branch', '--delete', '--force'];
  4017. if (remote) {
  4018. args.push('--remote');
  4019. }
  4020. args.push(branch);
  4021. yield this.execGit(args);
  4022. });
  4023. }
  4024. branchExists(remote, pattern) {
  4025. return __awaiter(this, void 0, void 0, function* () {
  4026. const args = ['branch', '--list'];
  4027. if (remote) {
  4028. args.push('--remote');
  4029. }
  4030. args.push(pattern);
  4031. const output = yield this.execGit(args);
  4032. return !!output.stdout.trim();
  4033. });
  4034. }
  4035. branchList(remote) {
  4036. return __awaiter(this, void 0, void 0, function* () {
  4037. const result = [];
  4038. // Note, this implementation uses "rev-parse --symbolic" because the output from
  4039. // "branch --list" is more difficult when in a detached HEAD state.
  4040. const args = ['rev-parse', '--symbolic'];
  4041. if (remote) {
  4042. args.push('--remotes=origin');
  4043. }
  4044. else {
  4045. args.push('--branches');
  4046. }
  4047. const output = yield this.execGit(args);
  4048. for (let branch of output.stdout.trim().split('\n')) {
  4049. branch = branch.trim();
  4050. if (branch) {
  4051. result.push(branch);
  4052. }
  4053. }
  4054. return result;
  4055. });
  4056. }
  4057. checkout(ref, startPoint) {
  4058. return __awaiter(this, void 0, void 0, function* () {
  4059. const args = ['checkout', '--progress', '--force'];
  4060. if (startPoint) {
  4061. args.push('-B', ref, startPoint);
  4062. }
  4063. else {
  4064. args.push(ref);
  4065. }
  4066. yield this.execGit(args);
  4067. });
  4068. }
  4069. checkoutDetach() {
  4070. return __awaiter(this, void 0, void 0, function* () {
  4071. const args = ['checkout', '--detach'];
  4072. yield this.execGit(args);
  4073. });
  4074. }
  4075. config(configKey, configValue) {
  4076. return __awaiter(this, void 0, void 0, function* () {
  4077. yield this.execGit(['config', configKey, configValue]);
  4078. });
  4079. }
  4080. configExists(configKey) {
  4081. return __awaiter(this, void 0, void 0, function* () {
  4082. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4083. return `\\${x}`;
  4084. });
  4085. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  4086. return output.exitCode === 0;
  4087. });
  4088. }
  4089. fetch(fetchDepth, refSpec) {
  4090. return __awaiter(this, void 0, void 0, function* () {
  4091. const args = [
  4092. '-c',
  4093. 'protocol.version=2',
  4094. 'fetch',
  4095. '--no-tags',
  4096. '--prune',
  4097. '--progress',
  4098. '--no-recurse-submodules'
  4099. ];
  4100. if (fetchDepth > 0) {
  4101. args.push(`--depth=${fetchDepth}`);
  4102. }
  4103. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4104. args.push('--unshallow');
  4105. }
  4106. args.push('origin');
  4107. for (const arg of refSpec) {
  4108. args.push(arg);
  4109. }
  4110. let attempt = 1;
  4111. const maxAttempts = 3;
  4112. while (attempt <= maxAttempts) {
  4113. const allowAllExitCodes = attempt < maxAttempts;
  4114. const output = yield this.execGit(args, allowAllExitCodes);
  4115. if (output.exitCode === 0) {
  4116. break;
  4117. }
  4118. const seconds = this.getRandomIntInclusive(1, 10);
  4119. core.warning(`Git fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4120. yield this.sleep(seconds * 1000);
  4121. attempt++;
  4122. }
  4123. });
  4124. }
  4125. getWorkingDirectory() {
  4126. return this.workingDirectory;
  4127. }
  4128. init() {
  4129. return __awaiter(this, void 0, void 0, function* () {
  4130. yield this.execGit(['init', this.workingDirectory]);
  4131. });
  4132. }
  4133. isDetached() {
  4134. return __awaiter(this, void 0, void 0, function* () {
  4135. // Note, this implementation uses "branch --show-current" because
  4136. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4137. // with nothing checked out.
  4138. const output = yield this.execGit(['branch', '--show-current']);
  4139. return output.stdout.trim() === '';
  4140. });
  4141. }
  4142. lfsFetch(ref) {
  4143. return __awaiter(this, void 0, void 0, function* () {
  4144. const args = ['lfs', 'fetch', 'origin', ref];
  4145. let attempt = 1;
  4146. const maxAttempts = 3;
  4147. while (attempt <= maxAttempts) {
  4148. const allowAllExitCodes = attempt < maxAttempts;
  4149. const output = yield this.execGit(args, allowAllExitCodes);
  4150. if (output.exitCode === 0) {
  4151. break;
  4152. }
  4153. const seconds = this.getRandomIntInclusive(1, 10);
  4154. core.warning(`Git lfs fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4155. yield this.sleep(seconds * 1000);
  4156. attempt++;
  4157. }
  4158. });
  4159. }
  4160. lfsInstall() {
  4161. return __awaiter(this, void 0, void 0, function* () {
  4162. yield this.execGit(['lfs', 'install', '--local']);
  4163. });
  4164. }
  4165. log1() {
  4166. return __awaiter(this, void 0, void 0, function* () {
  4167. yield this.execGit(['log', '-1']);
  4168. });
  4169. }
  4170. remoteAdd(remoteName, remoteUrl) {
  4171. return __awaiter(this, void 0, void 0, function* () {
  4172. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4173. });
  4174. }
  4175. tagExists(pattern) {
  4176. return __awaiter(this, void 0, void 0, function* () {
  4177. const output = yield this.execGit(['tag', '--list', pattern]);
  4178. return !!output.stdout.trim();
  4179. });
  4180. }
  4181. tryClean() {
  4182. return __awaiter(this, void 0, void 0, function* () {
  4183. const output = yield this.execGit(['clean', '-ffdx'], true);
  4184. return output.exitCode === 0;
  4185. });
  4186. }
  4187. tryConfigUnset(configKey) {
  4188. return __awaiter(this, void 0, void 0, function* () {
  4189. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4190. return output.exitCode === 0;
  4191. });
  4192. }
  4193. tryDisableAutomaticGarbageCollection() {
  4194. return __awaiter(this, void 0, void 0, function* () {
  4195. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4196. return output.exitCode === 0;
  4197. });
  4198. }
  4199. tryGetFetchUrl() {
  4200. return __awaiter(this, void 0, void 0, function* () {
  4201. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4202. if (output.exitCode !== 0) {
  4203. return '';
  4204. }
  4205. const stdout = output.stdout.trim();
  4206. if (stdout.includes('\n')) {
  4207. return '';
  4208. }
  4209. return stdout;
  4210. });
  4211. }
  4212. tryReset() {
  4213. return __awaiter(this, void 0, void 0, function* () {
  4214. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4215. return output.exitCode === 0;
  4216. });
  4217. }
  4218. static createCommandManager(workingDirectory, lfs) {
  4219. return __awaiter(this, void 0, void 0, function* () {
  4220. const result = new GitCommandManager();
  4221. yield result.initializeCommandManager(workingDirectory, lfs);
  4222. return result;
  4223. });
  4224. }
  4225. execGit(args, allowAllExitCodes = false) {
  4226. return __awaiter(this, void 0, void 0, function* () {
  4227. fshelper.directoryExistsSync(this.workingDirectory, true);
  4228. const result = new GitOutput();
  4229. const env = {};
  4230. for (const key of Object.keys(process.env)) {
  4231. env[key] = process.env[key];
  4232. }
  4233. for (const key of Object.keys(this.gitEnv)) {
  4234. env[key] = this.gitEnv[key];
  4235. }
  4236. const stdout = [];
  4237. const options = {
  4238. cwd: this.workingDirectory,
  4239. env,
  4240. ignoreReturnCode: allowAllExitCodes,
  4241. listeners: {
  4242. stdout: (data) => {
  4243. stdout.push(data.toString());
  4244. }
  4245. }
  4246. };
  4247. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4248. result.stdout = stdout.join('');
  4249. return result;
  4250. });
  4251. }
  4252. initializeCommandManager(workingDirectory, lfs) {
  4253. return __awaiter(this, void 0, void 0, function* () {
  4254. this.workingDirectory = workingDirectory;
  4255. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4256. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4257. this.lfs = lfs;
  4258. if (!this.lfs) {
  4259. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4260. }
  4261. this.gitPath = yield io.which('git', true);
  4262. // Git version
  4263. core.debug('Getting git version');
  4264. let gitVersion = new git_version_1.GitVersion();
  4265. let gitOutput = yield this.execGit(['version']);
  4266. let stdout = gitOutput.stdout.trim();
  4267. if (!stdout.includes('\n')) {
  4268. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4269. if (match) {
  4270. gitVersion = new git_version_1.GitVersion(match[0]);
  4271. }
  4272. }
  4273. if (!gitVersion.isValid()) {
  4274. throw new Error('Unable to determine git version');
  4275. }
  4276. // Minimum git version
  4277. // Note:
  4278. // - Auth header not supported before 2.9
  4279. // - Wire protocol v2 not supported before 2.18
  4280. const minimumGitVersion = new git_version_1.GitVersion('2.18');
  4281. if (!gitVersion.checkMinimum(minimumGitVersion)) {
  4282. throw new Error(`Minimum required git version is ${minimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4283. }
  4284. if (this.lfs) {
  4285. // Git-lfs version
  4286. core.debug('Getting git-lfs version');
  4287. let gitLfsVersion = new git_version_1.GitVersion();
  4288. const gitLfsPath = yield io.which('git-lfs', true);
  4289. gitOutput = yield this.execGit(['lfs', 'version']);
  4290. stdout = gitOutput.stdout.trim();
  4291. if (!stdout.includes('\n')) {
  4292. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4293. if (match) {
  4294. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4295. }
  4296. }
  4297. if (!gitLfsVersion.isValid()) {
  4298. throw new Error('Unable to determine git-lfs version');
  4299. }
  4300. // Minimum git-lfs version
  4301. // Note:
  4302. // - Auth header not supported before 2.1
  4303. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4304. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4305. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4306. }
  4307. }
  4308. // Set the user agent
  4309. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4310. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4311. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4312. });
  4313. }
  4314. getRandomIntInclusive(minimum, maximum) {
  4315. minimum = Math.floor(minimum);
  4316. maximum = Math.floor(maximum);
  4317. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  4318. }
  4319. sleep(milliseconds) {
  4320. return __awaiter(this, void 0, void 0, function* () {
  4321. return new Promise(resolve => setTimeout(resolve, milliseconds));
  4322. });
  4323. }
  4324. }
  4325. class GitOutput {
  4326. constructor() {
  4327. this.stdout = '';
  4328. this.exitCode = 0;
  4329. }
  4330. }
  4331. /***/ }),
  4332. /***/ 293:
  4333. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4334. "use strict";
  4335. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4336. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4337. return new (P || (P = Promise))(function (resolve, reject) {
  4338. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4339. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4340. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4341. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4342. });
  4343. };
  4344. var __importStar = (this && this.__importStar) || function (mod) {
  4345. if (mod && mod.__esModule) return mod;
  4346. var result = {};
  4347. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4348. result["default"] = mod;
  4349. return result;
  4350. };
  4351. Object.defineProperty(exports, "__esModule", { value: true });
  4352. const core = __importStar(__webpack_require__(470));
  4353. const coreCommand = __importStar(__webpack_require__(431));
  4354. const fs = __importStar(__webpack_require__(747));
  4355. const fsHelper = __importStar(__webpack_require__(618));
  4356. const gitCommandManager = __importStar(__webpack_require__(289));
  4357. const io = __importStar(__webpack_require__(1));
  4358. const path = __importStar(__webpack_require__(622));
  4359. const refHelper = __importStar(__webpack_require__(227));
  4360. const authConfigKey = `http.https://github.com/.extraheader`;
  4361. function getSource(settings) {
  4362. return __awaiter(this, void 0, void 0, function* () {
  4363. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4364. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4365. // Remove conflicting file path
  4366. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4367. yield io.rmRF(settings.repositoryPath);
  4368. }
  4369. // Create directory
  4370. let isExisting = true;
  4371. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4372. isExisting = false;
  4373. yield io.mkdirP(settings.repositoryPath);
  4374. }
  4375. // Git command manager
  4376. core.info(`Working directory is '${settings.repositoryPath}'`);
  4377. const git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4378. // Try prepare existing directory, otherwise recreate
  4379. if (isExisting &&
  4380. !(yield tryPrepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean))) {
  4381. yield io.rmRF(settings.repositoryPath);
  4382. yield io.mkdirP(settings.repositoryPath);
  4383. }
  4384. // Initialize the repository
  4385. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4386. yield git.init();
  4387. yield git.remoteAdd('origin', repositoryUrl);
  4388. }
  4389. // Disable automatic garbage collection
  4390. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4391. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4392. }
  4393. // Remove possible previous extraheader
  4394. yield removeGitConfig(git, authConfigKey);
  4395. // Add extraheader (auth)
  4396. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4397. core.setSecret(base64Credentials);
  4398. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4399. yield git.config(authConfigKey, authConfigValue);
  4400. // LFS install
  4401. if (settings.lfs) {
  4402. yield git.lfsInstall();
  4403. }
  4404. // Fetch
  4405. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4406. yield git.fetch(settings.fetchDepth, refSpec);
  4407. // Checkout info
  4408. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4409. // LFS fetch
  4410. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4411. // Explicit lfs fetch will fetch lfs objects in parallel.
  4412. if (settings.lfs) {
  4413. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4414. }
  4415. // Checkout
  4416. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4417. // Dump some info about the checked out commit
  4418. yield git.log1();
  4419. // Set intra-task state for cleanup
  4420. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4421. });
  4422. }
  4423. exports.getSource = getSource;
  4424. function cleanup(repositoryPath) {
  4425. return __awaiter(this, void 0, void 0, function* () {
  4426. // Repo exists?
  4427. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4428. return;
  4429. }
  4430. fsHelper.directoryExistsSync(repositoryPath, true);
  4431. // Remove the config key
  4432. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4433. yield removeGitConfig(git, authConfigKey);
  4434. });
  4435. }
  4436. exports.cleanup = cleanup;
  4437. function tryPrepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4438. return __awaiter(this, void 0, void 0, function* () {
  4439. // Fetch URL does not match
  4440. if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4441. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4442. return false;
  4443. }
  4444. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4445. const lockPaths = [
  4446. path.join(repositoryPath, '.git', 'index.lock'),
  4447. path.join(repositoryPath, '.git', 'shallow.lock')
  4448. ];
  4449. for (const lockPath of lockPaths) {
  4450. try {
  4451. yield io.rmRF(lockPath);
  4452. }
  4453. catch (error) {
  4454. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4455. }
  4456. }
  4457. try {
  4458. // Checkout detached HEAD
  4459. if (!(yield git.isDetached())) {
  4460. yield git.checkoutDetach();
  4461. }
  4462. // Remove all refs/heads/*
  4463. let branches = yield git.branchList(false);
  4464. for (const branch of branches) {
  4465. yield git.branchDelete(false, branch);
  4466. }
  4467. // Remove all refs/remotes/origin/* to avoid conflicts
  4468. branches = yield git.branchList(true);
  4469. for (const branch of branches) {
  4470. yield git.branchDelete(true, branch);
  4471. }
  4472. }
  4473. catch (error) {
  4474. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4475. return false;
  4476. }
  4477. // Clean
  4478. if (clean) {
  4479. let succeeded = true;
  4480. if (!(yield git.tryClean())) {
  4481. 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}'.`);
  4482. succeeded = false;
  4483. }
  4484. else if (!(yield git.tryReset())) {
  4485. succeeded = false;
  4486. }
  4487. if (!succeeded) {
  4488. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4489. }
  4490. return succeeded;
  4491. }
  4492. return true;
  4493. });
  4494. }
  4495. function removeGitConfig(git, configKey) {
  4496. return __awaiter(this, void 0, void 0, function* () {
  4497. if ((yield git.configExists(configKey)) &&
  4498. !(yield git.tryConfigUnset(configKey))) {
  4499. // Load the config contents
  4500. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4501. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4502. fsHelper.fileExistsSync(configPath);
  4503. let contents = fs.readFileSync(configPath).toString() || '';
  4504. // Filter - only includes lines that do not contain the config key
  4505. const upperConfigKey = configKey.toUpperCase();
  4506. const split = contents
  4507. .split('\n')
  4508. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4509. contents = split.join('\n');
  4510. // Rewrite the config file
  4511. fs.writeFileSync(configPath, contents);
  4512. }
  4513. });
  4514. }
  4515. /***/ }),
  4516. /***/ 294:
  4517. /***/ (function(module, __unusedexports, __webpack_require__) {
  4518. module.exports = parseOptions;
  4519. const { Deprecation } = __webpack_require__(692);
  4520. const { getUserAgent } = __webpack_require__(619);
  4521. const once = __webpack_require__(969);
  4522. const pkg = __webpack_require__(215);
  4523. const deprecateOptionsTimeout = once((log, deprecation) =>
  4524. log.warn(deprecation)
  4525. );
  4526. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4527. const deprecateOptionsHeaders = once((log, deprecation) =>
  4528. log.warn(deprecation)
  4529. );
  4530. function parseOptions(options, log, hook) {
  4531. if (options.headers) {
  4532. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4533. newObj[key.toLowerCase()] = options.headers[key];
  4534. return newObj;
  4535. }, {});
  4536. }
  4537. const clientDefaults = {
  4538. headers: options.headers || {},
  4539. request: options.request || {},
  4540. mediaType: {
  4541. previews: [],
  4542. format: ""
  4543. }
  4544. };
  4545. if (options.baseUrl) {
  4546. clientDefaults.baseUrl = options.baseUrl;
  4547. }
  4548. if (options.userAgent) {
  4549. clientDefaults.headers["user-agent"] = options.userAgent;
  4550. }
  4551. if (options.previews) {
  4552. clientDefaults.mediaType.previews = options.previews;
  4553. }
  4554. if (options.timeZone) {
  4555. clientDefaults.headers["time-zone"] = options.timeZone;
  4556. }
  4557. if (options.timeout) {
  4558. deprecateOptionsTimeout(
  4559. log,
  4560. new Deprecation(
  4561. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4562. )
  4563. );
  4564. clientDefaults.request.timeout = options.timeout;
  4565. }
  4566. if (options.agent) {
  4567. deprecateOptionsAgent(
  4568. log,
  4569. new Deprecation(
  4570. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4571. )
  4572. );
  4573. clientDefaults.request.agent = options.agent;
  4574. }
  4575. if (options.headers) {
  4576. deprecateOptionsHeaders(
  4577. log,
  4578. new Deprecation(
  4579. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4580. )
  4581. );
  4582. }
  4583. const userAgentOption = clientDefaults.headers["user-agent"];
  4584. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4585. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4586. .filter(Boolean)
  4587. .join(" ");
  4588. clientDefaults.request.hook = hook.bind(null, "request");
  4589. return clientDefaults;
  4590. }
  4591. /***/ }),
  4592. /***/ 297:
  4593. /***/ (function(module) {
  4594. module.exports = class HttpError extends Error {
  4595. constructor (message, code, headers) {
  4596. super(message)
  4597. // Maintains proper stack trace (only available on V8)
  4598. /* istanbul ignore next */
  4599. if (Error.captureStackTrace) {
  4600. Error.captureStackTrace(this, this.constructor)
  4601. }
  4602. this.name = 'HttpError'
  4603. this.code = code
  4604. this.headers = headers
  4605. }
  4606. }
  4607. /***/ }),
  4608. /***/ 301:
  4609. /***/ (function(module, __unusedexports, __webpack_require__) {
  4610. /**
  4611. * Some “list” response that can be paginated have a different response structure
  4612. *
  4613. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4614. * /installation/repositories also has `repository_selection`), as well as a key with
  4615. * the list of the items which name varies from endpoint to endpoint:
  4616. *
  4617. * - https://developer.github.com/v3/search/#example (key `items`)
  4618. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4619. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4620. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4621. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4622. *
  4623. * Octokit normalizes these responses so that paginated results are always returned following
  4624. * the same structure. One challenge is that if the list response has only one page, no Link
  4625. * header is provided, so this header alone is not sufficient to check wether a response is
  4626. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4627. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4628. * property because it also exists in the response of Get the combined status for a specific ref.
  4629. */
  4630. module.exports = normalizePaginatedListResponse;
  4631. const { Deprecation } = __webpack_require__(692);
  4632. const once = __webpack_require__(969);
  4633. const deprecateIncompleteResults = once((log, deprecation) =>
  4634. log.warn(deprecation)
  4635. );
  4636. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4637. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4638. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4639. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4640. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4641. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4642. function normalizePaginatedListResponse(octokit, url, response) {
  4643. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4644. if (
  4645. !REGEX_IS_SEARCH_PATH.test(path) &&
  4646. !REGEX_IS_CHECKS_PATH.test(path) &&
  4647. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4648. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path)
  4649. ) {
  4650. return;
  4651. }
  4652. // keep the additional properties intact to avoid a breaking change,
  4653. // but log a deprecation warning when accessed
  4654. const incompleteResults = response.data.incomplete_results;
  4655. const repositorySelection = response.data.repository_selection;
  4656. const totalCount = response.data.total_count;
  4657. delete response.data.incomplete_results;
  4658. delete response.data.repository_selection;
  4659. delete response.data.total_count;
  4660. const namespaceKey = Object.keys(response.data)[0];
  4661. response.data = response.data[namespaceKey];
  4662. Object.defineProperty(response.data, namespaceKey, {
  4663. get() {
  4664. deprecateNamespace(
  4665. octokit.log,
  4666. new Deprecation(
  4667. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4668. )
  4669. );
  4670. return response.data;
  4671. }
  4672. });
  4673. if (typeof incompleteResults !== "undefined") {
  4674. Object.defineProperty(response.data, "incomplete_results", {
  4675. get() {
  4676. deprecateIncompleteResults(
  4677. octokit.log,
  4678. new Deprecation(
  4679. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4680. )
  4681. );
  4682. return incompleteResults;
  4683. }
  4684. });
  4685. }
  4686. if (typeof repositorySelection !== "undefined") {
  4687. Object.defineProperty(response.data, "repository_selection", {
  4688. get() {
  4689. deprecateTotalCount(
  4690. octokit.log,
  4691. new Deprecation(
  4692. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4693. )
  4694. );
  4695. return repositorySelection;
  4696. }
  4697. });
  4698. }
  4699. Object.defineProperty(response.data, "total_count", {
  4700. get() {
  4701. deprecateTotalCount(
  4702. octokit.log,
  4703. new Deprecation(
  4704. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4705. )
  4706. );
  4707. return totalCount;
  4708. }
  4709. });
  4710. }
  4711. /***/ }),
  4712. /***/ 309:
  4713. /***/ (function(module, __unusedexports, __webpack_require__) {
  4714. module.exports = octokitRestNormalizeGitReferenceResponses;
  4715. const { RequestError } = __webpack_require__(463);
  4716. function octokitRestNormalizeGitReferenceResponses(octokit) {
  4717. octokit.hook.wrap("request", (request, options) => {
  4718. const isGetOrListRefRequest = /\/repos\/:?\w+\/:?\w+\/git\/refs\/:?\w+/.test(
  4719. options.url
  4720. );
  4721. if (!isGetOrListRefRequest) {
  4722. return request(options);
  4723. }
  4724. const isGetRefRequest = "ref" in options;
  4725. return request(options)
  4726. .then(response => {
  4727. // request single reference
  4728. if (isGetRefRequest) {
  4729. if (Array.isArray(response.data)) {
  4730. throw new RequestError(
  4731. `More than one reference found for "${options.ref}"`,
  4732. 404,
  4733. {
  4734. request: options
  4735. }
  4736. );
  4737. }
  4738. // ✅ received single reference
  4739. return response;
  4740. }
  4741. // request list of references
  4742. if (!Array.isArray(response.data)) {
  4743. response.data = [response.data];
  4744. }
  4745. return response;
  4746. })
  4747. .catch(error => {
  4748. if (isGetRefRequest) {
  4749. throw error;
  4750. }
  4751. if (error.status === 404) {
  4752. return {
  4753. status: 200,
  4754. headers: error.headers,
  4755. data: []
  4756. };
  4757. }
  4758. throw error;
  4759. });
  4760. });
  4761. }
  4762. /***/ }),
  4763. /***/ 314:
  4764. /***/ (function(module) {
  4765. module.exports = {"name":"@octokit/graphql","version":"2.1.3","publishConfig":{"access":"public"},"description":"GitHub GraphQL API client for browsers and Node","main":"index.js","scripts":{"prebuild":"mkdirp dist/","build":"npm-run-all build:*","build:development":"webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json","build:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map","bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","pretest":"standard","test":"nyc mocha test/*-test.js","test:browser":"cypress run --browser chrome"},"repository":{"type":"git","url":"https://github.com/octokit/graphql.js.git"},"keywords":["octokit","github","api","graphql"],"author":"Gregor Martynus (https://github.com/gr2m)","license":"MIT","bugs":{"url":"https://github.com/octokit/graphql.js/issues"},"homepage":"https://github.com/octokit/graphql.js#readme","dependencies":{"@octokit/request":"^5.0.0","universal-user-agent":"^2.0.3"},"devDependencies":{"chai":"^4.2.0","compression-webpack-plugin":"^2.0.0","coveralls":"^3.0.3","cypress":"^3.1.5","fetch-mock":"^7.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","npm-run-all":"^4.1.3","nyc":"^14.0.0","semantic-release":"^15.13.3","simple-mock":"^0.8.0","standard":"^12.0.1","webpack":"^4.29.6","webpack-bundle-analyzer":"^3.1.0","webpack-cli":"^3.2.3"},"bundlesize":[{"path":"./dist/octokit-graphql.min.js.gz","maxSize":"5KB"}],"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"files":["lib"],"_resolved":"https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz","_integrity":"sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==","_from":"@octokit/graphql@2.1.3"};
  4766. /***/ }),
  4767. /***/ 323:
  4768. /***/ (function(module) {
  4769. "use strict";
  4770. var isStream = module.exports = function (stream) {
  4771. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4772. };
  4773. isStream.writable = function (stream) {
  4774. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4775. };
  4776. isStream.readable = function (stream) {
  4777. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4778. };
  4779. isStream.duplex = function (stream) {
  4780. return isStream.writable(stream) && isStream.readable(stream);
  4781. };
  4782. isStream.transform = function (stream) {
  4783. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4784. };
  4785. /***/ }),
  4786. /***/ 336:
  4787. /***/ (function(module, __unusedexports, __webpack_require__) {
  4788. module.exports = hasLastPage
  4789. const deprecate = __webpack_require__(370)
  4790. const getPageLinks = __webpack_require__(577)
  4791. function hasLastPage (link) {
  4792. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4793. return getPageLinks(link).last
  4794. }
  4795. /***/ }),
  4796. /***/ 348:
  4797. /***/ (function(module, __unusedexports, __webpack_require__) {
  4798. "use strict";
  4799. module.exports = validate;
  4800. const { RequestError } = __webpack_require__(463);
  4801. const get = __webpack_require__(854);
  4802. const set = __webpack_require__(883);
  4803. function validate(octokit, options) {
  4804. if (!options.request.validate) {
  4805. return;
  4806. }
  4807. const { validate: params } = options.request;
  4808. Object.keys(params).forEach(parameterName => {
  4809. const parameter = get(params, parameterName);
  4810. const expectedType = parameter.type;
  4811. let parentParameterName;
  4812. let parentValue;
  4813. let parentParamIsPresent = true;
  4814. let parentParameterIsArray = false;
  4815. if (/\./.test(parameterName)) {
  4816. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4817. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4818. if (parentParameterIsArray) {
  4819. parentParameterName = parentParameterName.slice(0, -2);
  4820. }
  4821. parentValue = get(options, parentParameterName);
  4822. parentParamIsPresent =
  4823. parentParameterName === "headers" ||
  4824. (typeof parentValue === "object" && parentValue !== null);
  4825. }
  4826. const values = parentParameterIsArray
  4827. ? (get(options, parentParameterName) || []).map(
  4828. value => value[parameterName.split(/\./).pop()]
  4829. )
  4830. : [get(options, parameterName)];
  4831. values.forEach((value, i) => {
  4832. const valueIsPresent = typeof value !== "undefined";
  4833. const valueIsNull = value === null;
  4834. const currentParameterName = parentParameterIsArray
  4835. ? parameterName.replace(/\[\]/, `[${i}]`)
  4836. : parameterName;
  4837. if (!parameter.required && !valueIsPresent) {
  4838. return;
  4839. }
  4840. // if the parent parameter is of type object but allows null
  4841. // then the child parameters can be ignored
  4842. if (!parentParamIsPresent) {
  4843. return;
  4844. }
  4845. if (parameter.allowNull && valueIsNull) {
  4846. return;
  4847. }
  4848. if (!parameter.allowNull && valueIsNull) {
  4849. throw new RequestError(
  4850. `'${currentParameterName}' cannot be null`,
  4851. 400,
  4852. {
  4853. request: options
  4854. }
  4855. );
  4856. }
  4857. if (parameter.required && !valueIsPresent) {
  4858. throw new RequestError(
  4859. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4860. value
  4861. )}`,
  4862. 400,
  4863. {
  4864. request: options
  4865. }
  4866. );
  4867. }
  4868. // parse to integer before checking for enum
  4869. // so that string "1" will match enum with number 1
  4870. if (expectedType === "integer") {
  4871. const unparsedValue = value;
  4872. value = parseInt(value, 10);
  4873. if (isNaN(value)) {
  4874. throw new RequestError(
  4875. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4876. unparsedValue
  4877. )} is NaN`,
  4878. 400,
  4879. {
  4880. request: options
  4881. }
  4882. );
  4883. }
  4884. }
  4885. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4886. throw new RequestError(
  4887. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4888. value
  4889. )}`,
  4890. 400,
  4891. {
  4892. request: options
  4893. }
  4894. );
  4895. }
  4896. if (parameter.validation) {
  4897. const regex = new RegExp(parameter.validation);
  4898. if (!regex.test(value)) {
  4899. throw new RequestError(
  4900. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4901. value
  4902. )}`,
  4903. 400,
  4904. {
  4905. request: options
  4906. }
  4907. );
  4908. }
  4909. }
  4910. if (expectedType === "object" && typeof value === "string") {
  4911. try {
  4912. value = JSON.parse(value);
  4913. } catch (exception) {
  4914. throw new RequestError(
  4915. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4916. value
  4917. )}`,
  4918. 400,
  4919. {
  4920. request: options
  4921. }
  4922. );
  4923. }
  4924. }
  4925. set(options, parameter.mapTo || currentParameterName, value);
  4926. });
  4927. });
  4928. return options;
  4929. }
  4930. /***/ }),
  4931. /***/ 349:
  4932. /***/ (function(module, __unusedexports, __webpack_require__) {
  4933. module.exports = authenticationRequestError;
  4934. const { RequestError } = __webpack_require__(463);
  4935. function authenticationRequestError(state, error, options) {
  4936. /* istanbul ignore next */
  4937. if (!error.headers) throw error;
  4938. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  4939. // handle "2FA required" error only
  4940. if (error.status !== 401 || !otpRequired) {
  4941. throw error;
  4942. }
  4943. if (
  4944. error.status === 401 &&
  4945. otpRequired &&
  4946. error.request &&
  4947. error.request.headers["x-github-otp"]
  4948. ) {
  4949. throw new RequestError(
  4950. "Invalid one-time password for two-factor authentication",
  4951. 401,
  4952. {
  4953. headers: error.headers,
  4954. request: options
  4955. }
  4956. );
  4957. }
  4958. if (typeof state.auth.on2fa !== "function") {
  4959. throw new RequestError(
  4960. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  4961. 401,
  4962. {
  4963. headers: error.headers,
  4964. request: options
  4965. }
  4966. );
  4967. }
  4968. return Promise.resolve()
  4969. .then(() => {
  4970. return state.auth.on2fa();
  4971. })
  4972. .then(oneTimePassword => {
  4973. const newOptions = Object.assign(options, {
  4974. headers: Object.assign(
  4975. { "x-github-otp": oneTimePassword },
  4976. options.headers
  4977. )
  4978. });
  4979. return state.octokit.request(newOptions);
  4980. });
  4981. }
  4982. /***/ }),
  4983. /***/ 357:
  4984. /***/ (function(module) {
  4985. module.exports = require("assert");
  4986. /***/ }),
  4987. /***/ 363:
  4988. /***/ (function(module) {
  4989. module.exports = register
  4990. function register (state, name, method, options) {
  4991. if (typeof method !== 'function') {
  4992. throw new Error('method for before hook must be a function')
  4993. }
  4994. if (!options) {
  4995. options = {}
  4996. }
  4997. if (Array.isArray(name)) {
  4998. return name.reverse().reduce(function (callback, name) {
  4999. return register.bind(null, state, name, callback, options)
  5000. }, method)()
  5001. }
  5002. return Promise.resolve()
  5003. .then(function () {
  5004. if (!state.registry[name]) {
  5005. return method(options)
  5006. }
  5007. return (state.registry[name]).reduce(function (method, registered) {
  5008. return registered.hook.bind(null, method, options)
  5009. }, method)()
  5010. })
  5011. }
  5012. /***/ }),
  5013. /***/ 368:
  5014. /***/ (function(module) {
  5015. module.exports = function atob(str) {
  5016. return Buffer.from(str, 'base64').toString('binary')
  5017. }
  5018. /***/ }),
  5019. /***/ 370:
  5020. /***/ (function(module) {
  5021. module.exports = deprecate
  5022. const loggedMessages = {}
  5023. function deprecate (message) {
  5024. if (loggedMessages[message]) {
  5025. return
  5026. }
  5027. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5028. loggedMessages[message] = 1
  5029. }
  5030. /***/ }),
  5031. /***/ 372:
  5032. /***/ (function(module) {
  5033. module.exports = octokitDebug;
  5034. function octokitDebug(octokit) {
  5035. octokit.hook.wrap("request", (request, options) => {
  5036. octokit.log.debug("request", options);
  5037. const start = Date.now();
  5038. const requestOptions = octokit.request.endpoint.parse(options);
  5039. const path = requestOptions.url.replace(options.baseUrl, "");
  5040. return request(options)
  5041. .then(response => {
  5042. octokit.log.info(
  5043. `${requestOptions.method} ${path} - ${
  5044. response.status
  5045. } in ${Date.now() - start}ms`
  5046. );
  5047. return response;
  5048. })
  5049. .catch(error => {
  5050. octokit.log.info(
  5051. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5052. start}ms`
  5053. );
  5054. throw error;
  5055. });
  5056. });
  5057. }
  5058. /***/ }),
  5059. /***/ 385:
  5060. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5061. "use strict";
  5062. Object.defineProperty(exports, '__esModule', { value: true });
  5063. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5064. var isPlainObject = _interopDefault(__webpack_require__(696));
  5065. var universalUserAgent = __webpack_require__(562);
  5066. function lowercaseKeys(object) {
  5067. if (!object) {
  5068. return {};
  5069. }
  5070. return Object.keys(object).reduce((newObj, key) => {
  5071. newObj[key.toLowerCase()] = object[key];
  5072. return newObj;
  5073. }, {});
  5074. }
  5075. function mergeDeep(defaults, options) {
  5076. const result = Object.assign({}, defaults);
  5077. Object.keys(options).forEach(key => {
  5078. if (isPlainObject(options[key])) {
  5079. if (!(key in defaults)) Object.assign(result, {
  5080. [key]: options[key]
  5081. });else result[key] = mergeDeep(defaults[key], options[key]);
  5082. } else {
  5083. Object.assign(result, {
  5084. [key]: options[key]
  5085. });
  5086. }
  5087. });
  5088. return result;
  5089. }
  5090. function merge(defaults, route, options) {
  5091. if (typeof route === "string") {
  5092. let [method, url] = route.split(" ");
  5093. options = Object.assign(url ? {
  5094. method,
  5095. url
  5096. } : {
  5097. url: method
  5098. }, options);
  5099. } else {
  5100. options = Object.assign({}, route);
  5101. } // lowercase header names before merging with defaults to avoid duplicates
  5102. options.headers = lowercaseKeys(options.headers);
  5103. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5104. if (defaults && defaults.mediaType.previews.length) {
  5105. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5106. }
  5107. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5108. return mergedOptions;
  5109. }
  5110. function addQueryParameters(url, parameters) {
  5111. const separator = /\?/.test(url) ? "&" : "?";
  5112. const names = Object.keys(parameters);
  5113. if (names.length === 0) {
  5114. return url;
  5115. }
  5116. return url + separator + names.map(name => {
  5117. if (name === "q") {
  5118. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5119. }
  5120. return `${name}=${encodeURIComponent(parameters[name])}`;
  5121. }).join("&");
  5122. }
  5123. const urlVariableRegex = /\{[^}]+\}/g;
  5124. function removeNonChars(variableName) {
  5125. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5126. }
  5127. function extractUrlVariableNames(url) {
  5128. const matches = url.match(urlVariableRegex);
  5129. if (!matches) {
  5130. return [];
  5131. }
  5132. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5133. }
  5134. function omit(object, keysToOmit) {
  5135. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5136. obj[key] = object[key];
  5137. return obj;
  5138. }, {});
  5139. }
  5140. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5141. // TODO: create separate package.
  5142. //
  5143. // Copyright (c) 2012-2014, Bram Stein
  5144. // All rights reserved.
  5145. // Redistribution and use in source and binary forms, with or without
  5146. // modification, are permitted provided that the following conditions
  5147. // are met:
  5148. // 1. Redistributions of source code must retain the above copyright
  5149. // notice, this list of conditions and the following disclaimer.
  5150. // 2. Redistributions in binary form must reproduce the above copyright
  5151. // notice, this list of conditions and the following disclaimer in the
  5152. // documentation and/or other materials provided with the distribution.
  5153. // 3. The name of the author may not be used to endorse or promote products
  5154. // derived from this software without specific prior written permission.
  5155. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5156. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5157. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5158. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5159. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5160. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5161. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5162. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5163. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5164. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5165. /* istanbul ignore file */
  5166. function encodeReserved(str) {
  5167. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5168. if (!/%[0-9A-Fa-f]/.test(part)) {
  5169. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5170. }
  5171. return part;
  5172. }).join("");
  5173. }
  5174. function encodeUnreserved(str) {
  5175. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5176. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5177. });
  5178. }
  5179. function encodeValue(operator, value, key) {
  5180. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5181. if (key) {
  5182. return encodeUnreserved(key) + "=" + value;
  5183. } else {
  5184. return value;
  5185. }
  5186. }
  5187. function isDefined(value) {
  5188. return value !== undefined && value !== null;
  5189. }
  5190. function isKeyOperator(operator) {
  5191. return operator === ";" || operator === "&" || operator === "?";
  5192. }
  5193. function getValues(context, operator, key, modifier) {
  5194. var value = context[key],
  5195. result = [];
  5196. if (isDefined(value) && value !== "") {
  5197. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5198. value = value.toString();
  5199. if (modifier && modifier !== "*") {
  5200. value = value.substring(0, parseInt(modifier, 10));
  5201. }
  5202. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5203. } else {
  5204. if (modifier === "*") {
  5205. if (Array.isArray(value)) {
  5206. value.filter(isDefined).forEach(function (value) {
  5207. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5208. });
  5209. } else {
  5210. Object.keys(value).forEach(function (k) {
  5211. if (isDefined(value[k])) {
  5212. result.push(encodeValue(operator, value[k], k));
  5213. }
  5214. });
  5215. }
  5216. } else {
  5217. const tmp = [];
  5218. if (Array.isArray(value)) {
  5219. value.filter(isDefined).forEach(function (value) {
  5220. tmp.push(encodeValue(operator, value));
  5221. });
  5222. } else {
  5223. Object.keys(value).forEach(function (k) {
  5224. if (isDefined(value[k])) {
  5225. tmp.push(encodeUnreserved(k));
  5226. tmp.push(encodeValue(operator, value[k].toString()));
  5227. }
  5228. });
  5229. }
  5230. if (isKeyOperator(operator)) {
  5231. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5232. } else if (tmp.length !== 0) {
  5233. result.push(tmp.join(","));
  5234. }
  5235. }
  5236. }
  5237. } else {
  5238. if (operator === ";") {
  5239. if (isDefined(value)) {
  5240. result.push(encodeUnreserved(key));
  5241. }
  5242. } else if (value === "" && (operator === "&" || operator === "?")) {
  5243. result.push(encodeUnreserved(key) + "=");
  5244. } else if (value === "") {
  5245. result.push("");
  5246. }
  5247. }
  5248. return result;
  5249. }
  5250. function parseUrl(template) {
  5251. return {
  5252. expand: expand.bind(null, template)
  5253. };
  5254. }
  5255. function expand(template, context) {
  5256. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5257. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5258. if (expression) {
  5259. let operator = "";
  5260. const values = [];
  5261. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5262. operator = expression.charAt(0);
  5263. expression = expression.substr(1);
  5264. }
  5265. expression.split(/,/g).forEach(function (variable) {
  5266. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5267. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5268. });
  5269. if (operator && operator !== "+") {
  5270. var separator = ",";
  5271. if (operator === "?") {
  5272. separator = "&";
  5273. } else if (operator !== "#") {
  5274. separator = operator;
  5275. }
  5276. return (values.length !== 0 ? operator : "") + values.join(separator);
  5277. } else {
  5278. return values.join(",");
  5279. }
  5280. } else {
  5281. return encodeReserved(literal);
  5282. }
  5283. });
  5284. }
  5285. function parse(options) {
  5286. // https://fetch.spec.whatwg.org/#methods
  5287. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5288. let url = options.url.replace(/:([a-z]\w+)/g, "{+$1}");
  5289. let headers = Object.assign({}, options.headers);
  5290. let body;
  5291. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5292. const urlVariableNames = extractUrlVariableNames(url);
  5293. url = parseUrl(url).expand(parameters);
  5294. if (!/^http/.test(url)) {
  5295. url = options.baseUrl + url;
  5296. }
  5297. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5298. const remainingParameters = omit(parameters, omittedParameters);
  5299. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5300. if (!isBinaryRequset) {
  5301. if (options.mediaType.format) {
  5302. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5303. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5304. }
  5305. if (options.mediaType.previews.length) {
  5306. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5307. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5308. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5309. return `application/vnd.github.${preview}-preview${format}`;
  5310. }).join(",");
  5311. }
  5312. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5313. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5314. if (["GET", "HEAD"].includes(method)) {
  5315. url = addQueryParameters(url, remainingParameters);
  5316. } else {
  5317. if ("data" in remainingParameters) {
  5318. body = remainingParameters.data;
  5319. } else {
  5320. if (Object.keys(remainingParameters).length) {
  5321. body = remainingParameters;
  5322. } else {
  5323. headers["content-length"] = 0;
  5324. }
  5325. }
  5326. } // default content-type for JSON if body is set
  5327. if (!headers["content-type"] && typeof body !== "undefined") {
  5328. headers["content-type"] = "application/json; charset=utf-8";
  5329. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5330. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5331. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5332. body = "";
  5333. } // Only return body/request keys if present
  5334. return Object.assign({
  5335. method,
  5336. url,
  5337. headers
  5338. }, typeof body !== "undefined" ? {
  5339. body
  5340. } : null, options.request ? {
  5341. request: options.request
  5342. } : null);
  5343. }
  5344. function endpointWithDefaults(defaults, route, options) {
  5345. return parse(merge(defaults, route, options));
  5346. }
  5347. function withDefaults(oldDefaults, newDefaults) {
  5348. const DEFAULTS = merge(oldDefaults, newDefaults);
  5349. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5350. return Object.assign(endpoint, {
  5351. DEFAULTS,
  5352. defaults: withDefaults.bind(null, DEFAULTS),
  5353. merge: merge.bind(null, DEFAULTS),
  5354. parse
  5355. });
  5356. }
  5357. const VERSION = "0.0.0-development";
  5358. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`;
  5359. const DEFAULTS = {
  5360. method: "GET",
  5361. baseUrl: "https://api.github.com",
  5362. headers: {
  5363. accept: "application/vnd.github.v3+json",
  5364. "user-agent": userAgent
  5365. },
  5366. mediaType: {
  5367. format: "",
  5368. previews: []
  5369. }
  5370. };
  5371. const endpoint = withDefaults(null, DEFAULTS);
  5372. exports.endpoint = endpoint;
  5373. //# sourceMappingURL=index.js.map
  5374. /***/ }),
  5375. /***/ 389:
  5376. /***/ (function(module, __unusedexports, __webpack_require__) {
  5377. "use strict";
  5378. const fs = __webpack_require__(747);
  5379. const shebangCommand = __webpack_require__(866);
  5380. function readShebang(command) {
  5381. // Read the first 150 bytes from the file
  5382. const size = 150;
  5383. let buffer;
  5384. if (Buffer.alloc) {
  5385. // Node.js v4.5+ / v5.10+
  5386. buffer = Buffer.alloc(size);
  5387. } else {
  5388. // Old Node.js API
  5389. buffer = new Buffer(size);
  5390. buffer.fill(0); // zero-fill
  5391. }
  5392. let fd;
  5393. try {
  5394. fd = fs.openSync(command, 'r');
  5395. fs.readSync(fd, buffer, 0, size, 0);
  5396. fs.closeSync(fd);
  5397. } catch (e) { /* Empty */ }
  5398. // Attempt to extract shebang (null is returned if not a shebang)
  5399. return shebangCommand(buffer.toString());
  5400. }
  5401. module.exports = readShebang;
  5402. /***/ }),
  5403. /***/ 402:
  5404. /***/ (function(module, __unusedexports, __webpack_require__) {
  5405. module.exports = Octokit;
  5406. const { request } = __webpack_require__(753);
  5407. const Hook = __webpack_require__(523);
  5408. const parseClientOptions = __webpack_require__(294);
  5409. function Octokit(plugins, options) {
  5410. options = options || {};
  5411. const hook = new Hook.Collection();
  5412. const log = Object.assign(
  5413. {
  5414. debug: () => {},
  5415. info: () => {},
  5416. warn: console.warn,
  5417. error: console.error
  5418. },
  5419. options && options.log
  5420. );
  5421. const api = {
  5422. hook,
  5423. log,
  5424. request: request.defaults(parseClientOptions(options, log, hook))
  5425. };
  5426. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5427. return api;
  5428. }
  5429. /***/ }),
  5430. /***/ 413:
  5431. /***/ (function(module) {
  5432. module.exports = require("stream");
  5433. /***/ }),
  5434. /***/ 427:
  5435. /***/ (function(module, __unusedexports, __webpack_require__) {
  5436. "use strict";
  5437. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5438. // In that case, fall back to a deprecated internal.
  5439. const util = __webpack_require__(669);
  5440. let uv;
  5441. if (typeof util.getSystemErrorName === 'function') {
  5442. module.exports = util.getSystemErrorName;
  5443. } else {
  5444. try {
  5445. uv = process.binding('uv');
  5446. if (typeof uv.errname !== 'function') {
  5447. throw new TypeError('uv.errname is not a function');
  5448. }
  5449. } catch (err) {
  5450. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5451. uv = null;
  5452. }
  5453. module.exports = code => errname(uv, code);
  5454. }
  5455. // Used for testing the fallback behavior
  5456. module.exports.__test__ = errname;
  5457. function errname(uv, code) {
  5458. if (uv) {
  5459. return uv.errname(code);
  5460. }
  5461. if (!(code < 0)) {
  5462. throw new Error('err >= 0');
  5463. }
  5464. return `Unknown system error ${code}`;
  5465. }
  5466. /***/ }),
  5467. /***/ 430:
  5468. /***/ (function(module, __unusedexports, __webpack_require__) {
  5469. module.exports = octokitValidate;
  5470. const validate = __webpack_require__(348);
  5471. function octokitValidate(octokit) {
  5472. octokit.hook.before("request", validate.bind(null, octokit));
  5473. }
  5474. /***/ }),
  5475. /***/ 431:
  5476. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5477. "use strict";
  5478. Object.defineProperty(exports, "__esModule", { value: true });
  5479. const os = __webpack_require__(87);
  5480. /**
  5481. * Commands
  5482. *
  5483. * Command Format:
  5484. * ##[name key=value;key=value]message
  5485. *
  5486. * Examples:
  5487. * ##[warning]This is the user warning message
  5488. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5489. */
  5490. function issueCommand(command, properties, message) {
  5491. const cmd = new Command(command, properties, message);
  5492. process.stdout.write(cmd.toString() + os.EOL);
  5493. }
  5494. exports.issueCommand = issueCommand;
  5495. function issue(name, message = '') {
  5496. issueCommand(name, {}, message);
  5497. }
  5498. exports.issue = issue;
  5499. const CMD_STRING = '::';
  5500. class Command {
  5501. constructor(command, properties, message) {
  5502. if (!command) {
  5503. command = 'missing.command';
  5504. }
  5505. this.command = command;
  5506. this.properties = properties;
  5507. this.message = message;
  5508. }
  5509. toString() {
  5510. let cmdStr = CMD_STRING + this.command;
  5511. if (this.properties && Object.keys(this.properties).length > 0) {
  5512. cmdStr += ' ';
  5513. for (const key in this.properties) {
  5514. if (this.properties.hasOwnProperty(key)) {
  5515. const val = this.properties[key];
  5516. if (val) {
  5517. // safely append the val - avoid blowing up when attempting to
  5518. // call .replace() if message is not a string for some reason
  5519. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5520. }
  5521. }
  5522. }
  5523. }
  5524. cmdStr += CMD_STRING;
  5525. // safely append the message - avoid blowing up when attempting to
  5526. // call .replace() if message is not a string for some reason
  5527. const message = `${this.message || ''}`;
  5528. cmdStr += escapeData(message);
  5529. return cmdStr;
  5530. }
  5531. }
  5532. function escapeData(s) {
  5533. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5534. }
  5535. function escape(s) {
  5536. return s
  5537. .replace(/\r/g, '%0D')
  5538. .replace(/\n/g, '%0A')
  5539. .replace(/]/g, '%5D')
  5540. .replace(/;/g, '%3B');
  5541. }
  5542. //# sourceMappingURL=command.js.map
  5543. /***/ }),
  5544. /***/ 453:
  5545. /***/ (function(module, __unusedexports, __webpack_require__) {
  5546. var once = __webpack_require__(969)
  5547. var eos = __webpack_require__(3)
  5548. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5549. var noop = function () {}
  5550. var ancient = /^v?\.0/.test(process.version)
  5551. var isFn = function (fn) {
  5552. return typeof fn === 'function'
  5553. }
  5554. var isFS = function (stream) {
  5555. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5556. if (!fs) return false // browser
  5557. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5558. }
  5559. var isRequest = function (stream) {
  5560. return stream.setHeader && isFn(stream.abort)
  5561. }
  5562. var destroyer = function (stream, reading, writing, callback) {
  5563. callback = once(callback)
  5564. var closed = false
  5565. stream.on('close', function () {
  5566. closed = true
  5567. })
  5568. eos(stream, {readable: reading, writable: writing}, function (err) {
  5569. if (err) return callback(err)
  5570. closed = true
  5571. callback()
  5572. })
  5573. var destroyed = false
  5574. return function (err) {
  5575. if (closed) return
  5576. if (destroyed) return
  5577. destroyed = true
  5578. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5579. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5580. if (isFn(stream.destroy)) return stream.destroy()
  5581. callback(err || new Error('stream was destroyed'))
  5582. }
  5583. }
  5584. var call = function (fn) {
  5585. fn()
  5586. }
  5587. var pipe = function (from, to) {
  5588. return from.pipe(to)
  5589. }
  5590. var pump = function () {
  5591. var streams = Array.prototype.slice.call(arguments)
  5592. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5593. if (Array.isArray(streams[0])) streams = streams[0]
  5594. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5595. var error
  5596. var destroys = streams.map(function (stream, i) {
  5597. var reading = i < streams.length - 1
  5598. var writing = i > 0
  5599. return destroyer(stream, reading, writing, function (err) {
  5600. if (!error) error = err
  5601. if (err) destroys.forEach(call)
  5602. if (reading) return
  5603. destroys.forEach(call)
  5604. callback(error)
  5605. })
  5606. })
  5607. return streams.reduce(pipe)
  5608. }
  5609. module.exports = pump
  5610. /***/ }),
  5611. /***/ 454:
  5612. /***/ (function(module, exports, __webpack_require__) {
  5613. "use strict";
  5614. Object.defineProperty(exports, '__esModule', { value: true });
  5615. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5616. var Stream = _interopDefault(__webpack_require__(413));
  5617. var http = _interopDefault(__webpack_require__(605));
  5618. var Url = _interopDefault(__webpack_require__(835));
  5619. var https = _interopDefault(__webpack_require__(34));
  5620. var zlib = _interopDefault(__webpack_require__(761));
  5621. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5622. // fix for "Readable" isn't a named export issue
  5623. const Readable = Stream.Readable;
  5624. const BUFFER = Symbol('buffer');
  5625. const TYPE = Symbol('type');
  5626. class Blob {
  5627. constructor() {
  5628. this[TYPE] = '';
  5629. const blobParts = arguments[0];
  5630. const options = arguments[1];
  5631. const buffers = [];
  5632. let size = 0;
  5633. if (blobParts) {
  5634. const a = blobParts;
  5635. const length = Number(a.length);
  5636. for (let i = 0; i < length; i++) {
  5637. const element = a[i];
  5638. let buffer;
  5639. if (element instanceof Buffer) {
  5640. buffer = element;
  5641. } else if (ArrayBuffer.isView(element)) {
  5642. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5643. } else if (element instanceof ArrayBuffer) {
  5644. buffer = Buffer.from(element);
  5645. } else if (element instanceof Blob) {
  5646. buffer = element[BUFFER];
  5647. } else {
  5648. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5649. }
  5650. size += buffer.length;
  5651. buffers.push(buffer);
  5652. }
  5653. }
  5654. this[BUFFER] = Buffer.concat(buffers);
  5655. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5656. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5657. this[TYPE] = type;
  5658. }
  5659. }
  5660. get size() {
  5661. return this[BUFFER].length;
  5662. }
  5663. get type() {
  5664. return this[TYPE];
  5665. }
  5666. text() {
  5667. return Promise.resolve(this[BUFFER].toString());
  5668. }
  5669. arrayBuffer() {
  5670. const buf = this[BUFFER];
  5671. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5672. return Promise.resolve(ab);
  5673. }
  5674. stream() {
  5675. const readable = new Readable();
  5676. readable._read = function () {};
  5677. readable.push(this[BUFFER]);
  5678. readable.push(null);
  5679. return readable;
  5680. }
  5681. toString() {
  5682. return '[object Blob]';
  5683. }
  5684. slice() {
  5685. const size = this.size;
  5686. const start = arguments[0];
  5687. const end = arguments[1];
  5688. let relativeStart, relativeEnd;
  5689. if (start === undefined) {
  5690. relativeStart = 0;
  5691. } else if (start < 0) {
  5692. relativeStart = Math.max(size + start, 0);
  5693. } else {
  5694. relativeStart = Math.min(start, size);
  5695. }
  5696. if (end === undefined) {
  5697. relativeEnd = size;
  5698. } else if (end < 0) {
  5699. relativeEnd = Math.max(size + end, 0);
  5700. } else {
  5701. relativeEnd = Math.min(end, size);
  5702. }
  5703. const span = Math.max(relativeEnd - relativeStart, 0);
  5704. const buffer = this[BUFFER];
  5705. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5706. const blob = new Blob([], { type: arguments[2] });
  5707. blob[BUFFER] = slicedBuffer;
  5708. return blob;
  5709. }
  5710. }
  5711. Object.defineProperties(Blob.prototype, {
  5712. size: { enumerable: true },
  5713. type: { enumerable: true },
  5714. slice: { enumerable: true }
  5715. });
  5716. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5717. value: 'Blob',
  5718. writable: false,
  5719. enumerable: false,
  5720. configurable: true
  5721. });
  5722. /**
  5723. * fetch-error.js
  5724. *
  5725. * FetchError interface for operational errors
  5726. */
  5727. /**
  5728. * Create FetchError instance
  5729. *
  5730. * @param String message Error message for human
  5731. * @param String type Error type for machine
  5732. * @param String systemError For Node.js system error
  5733. * @return FetchError
  5734. */
  5735. function FetchError(message, type, systemError) {
  5736. Error.call(this, message);
  5737. this.message = message;
  5738. this.type = type;
  5739. // when err.type is `system`, err.code contains system error code
  5740. if (systemError) {
  5741. this.code = this.errno = systemError.code;
  5742. }
  5743. // hide custom error implementation details from end-users
  5744. Error.captureStackTrace(this, this.constructor);
  5745. }
  5746. FetchError.prototype = Object.create(Error.prototype);
  5747. FetchError.prototype.constructor = FetchError;
  5748. FetchError.prototype.name = 'FetchError';
  5749. let convert;
  5750. try {
  5751. convert = __webpack_require__(18).convert;
  5752. } catch (e) {}
  5753. const INTERNALS = Symbol('Body internals');
  5754. // fix an issue where "PassThrough" isn't a named export for node <10
  5755. const PassThrough = Stream.PassThrough;
  5756. /**
  5757. * Body mixin
  5758. *
  5759. * Ref: https://fetch.spec.whatwg.org/#body
  5760. *
  5761. * @param Stream body Readable stream
  5762. * @param Object opts Response options
  5763. * @return Void
  5764. */
  5765. function Body(body) {
  5766. var _this = this;
  5767. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5768. _ref$size = _ref.size;
  5769. let size = _ref$size === undefined ? 0 : _ref$size;
  5770. var _ref$timeout = _ref.timeout;
  5771. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5772. if (body == null) {
  5773. // body is undefined or null
  5774. body = null;
  5775. } else if (isURLSearchParams(body)) {
  5776. // body is a URLSearchParams
  5777. body = Buffer.from(body.toString());
  5778. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5779. // body is ArrayBuffer
  5780. body = Buffer.from(body);
  5781. } else if (ArrayBuffer.isView(body)) {
  5782. // body is ArrayBufferView
  5783. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5784. } else if (body instanceof Stream) ; else {
  5785. // none of the above
  5786. // coerce to string then buffer
  5787. body = Buffer.from(String(body));
  5788. }
  5789. this[INTERNALS] = {
  5790. body,
  5791. disturbed: false,
  5792. error: null
  5793. };
  5794. this.size = size;
  5795. this.timeout = timeout;
  5796. if (body instanceof Stream) {
  5797. body.on('error', function (err) {
  5798. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5799. _this[INTERNALS].error = error;
  5800. });
  5801. }
  5802. }
  5803. Body.prototype = {
  5804. get body() {
  5805. return this[INTERNALS].body;
  5806. },
  5807. get bodyUsed() {
  5808. return this[INTERNALS].disturbed;
  5809. },
  5810. /**
  5811. * Decode response as ArrayBuffer
  5812. *
  5813. * @return Promise
  5814. */
  5815. arrayBuffer() {
  5816. return consumeBody.call(this).then(function (buf) {
  5817. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5818. });
  5819. },
  5820. /**
  5821. * Return raw response as Blob
  5822. *
  5823. * @return Promise
  5824. */
  5825. blob() {
  5826. let ct = this.headers && this.headers.get('content-type') || '';
  5827. return consumeBody.call(this).then(function (buf) {
  5828. return Object.assign(
  5829. // Prevent copying
  5830. new Blob([], {
  5831. type: ct.toLowerCase()
  5832. }), {
  5833. [BUFFER]: buf
  5834. });
  5835. });
  5836. },
  5837. /**
  5838. * Decode response as json
  5839. *
  5840. * @return Promise
  5841. */
  5842. json() {
  5843. var _this2 = this;
  5844. return consumeBody.call(this).then(function (buffer) {
  5845. try {
  5846. return JSON.parse(buffer.toString());
  5847. } catch (err) {
  5848. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5849. }
  5850. });
  5851. },
  5852. /**
  5853. * Decode response as text
  5854. *
  5855. * @return Promise
  5856. */
  5857. text() {
  5858. return consumeBody.call(this).then(function (buffer) {
  5859. return buffer.toString();
  5860. });
  5861. },
  5862. /**
  5863. * Decode response as buffer (non-spec api)
  5864. *
  5865. * @return Promise
  5866. */
  5867. buffer() {
  5868. return consumeBody.call(this);
  5869. },
  5870. /**
  5871. * Decode response as text, while automatically detecting the encoding and
  5872. * trying to decode to UTF-8 (non-spec api)
  5873. *
  5874. * @return Promise
  5875. */
  5876. textConverted() {
  5877. var _this3 = this;
  5878. return consumeBody.call(this).then(function (buffer) {
  5879. return convertBody(buffer, _this3.headers);
  5880. });
  5881. }
  5882. };
  5883. // In browsers, all properties are enumerable.
  5884. Object.defineProperties(Body.prototype, {
  5885. body: { enumerable: true },
  5886. bodyUsed: { enumerable: true },
  5887. arrayBuffer: { enumerable: true },
  5888. blob: { enumerable: true },
  5889. json: { enumerable: true },
  5890. text: { enumerable: true }
  5891. });
  5892. Body.mixIn = function (proto) {
  5893. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5894. // istanbul ignore else: future proof
  5895. if (!(name in proto)) {
  5896. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5897. Object.defineProperty(proto, name, desc);
  5898. }
  5899. }
  5900. };
  5901. /**
  5902. * Consume and convert an entire Body to a Buffer.
  5903. *
  5904. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5905. *
  5906. * @return Promise
  5907. */
  5908. function consumeBody() {
  5909. var _this4 = this;
  5910. if (this[INTERNALS].disturbed) {
  5911. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5912. }
  5913. this[INTERNALS].disturbed = true;
  5914. if (this[INTERNALS].error) {
  5915. return Body.Promise.reject(this[INTERNALS].error);
  5916. }
  5917. let body = this.body;
  5918. // body is null
  5919. if (body === null) {
  5920. return Body.Promise.resolve(Buffer.alloc(0));
  5921. }
  5922. // body is blob
  5923. if (isBlob(body)) {
  5924. body = body.stream();
  5925. }
  5926. // body is buffer
  5927. if (Buffer.isBuffer(body)) {
  5928. return Body.Promise.resolve(body);
  5929. }
  5930. // istanbul ignore if: should never happen
  5931. if (!(body instanceof Stream)) {
  5932. return Body.Promise.resolve(Buffer.alloc(0));
  5933. }
  5934. // body is stream
  5935. // get ready to actually consume the body
  5936. let accum = [];
  5937. let accumBytes = 0;
  5938. let abort = false;
  5939. return new Body.Promise(function (resolve, reject) {
  5940. let resTimeout;
  5941. // allow timeout on slow response body
  5942. if (_this4.timeout) {
  5943. resTimeout = setTimeout(function () {
  5944. abort = true;
  5945. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  5946. }, _this4.timeout);
  5947. }
  5948. // handle stream errors
  5949. body.on('error', function (err) {
  5950. if (err.name === 'AbortError') {
  5951. // if the request was aborted, reject with this Error
  5952. abort = true;
  5953. reject(err);
  5954. } else {
  5955. // other errors, such as incorrect content-encoding
  5956. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  5957. }
  5958. });
  5959. body.on('data', function (chunk) {
  5960. if (abort || chunk === null) {
  5961. return;
  5962. }
  5963. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  5964. abort = true;
  5965. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  5966. return;
  5967. }
  5968. accumBytes += chunk.length;
  5969. accum.push(chunk);
  5970. });
  5971. body.on('end', function () {
  5972. if (abort) {
  5973. return;
  5974. }
  5975. clearTimeout(resTimeout);
  5976. try {
  5977. resolve(Buffer.concat(accum, accumBytes));
  5978. } catch (err) {
  5979. // handle streams that have accumulated too much data (issue #414)
  5980. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  5981. }
  5982. });
  5983. });
  5984. }
  5985. /**
  5986. * Detect buffer encoding and convert to target encoding
  5987. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  5988. *
  5989. * @param Buffer buffer Incoming buffer
  5990. * @param String encoding Target encoding
  5991. * @return String
  5992. */
  5993. function convertBody(buffer, headers) {
  5994. if (typeof convert !== 'function') {
  5995. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  5996. }
  5997. const ct = headers.get('content-type');
  5998. let charset = 'utf-8';
  5999. let res, str;
  6000. // header
  6001. if (ct) {
  6002. res = /charset=([^;]*)/i.exec(ct);
  6003. }
  6004. // no charset in content type, peek at response body for at most 1024 bytes
  6005. str = buffer.slice(0, 1024).toString();
  6006. // html5
  6007. if (!res && str) {
  6008. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6009. }
  6010. // html4
  6011. if (!res && str) {
  6012. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6013. if (res) {
  6014. res = /charset=(.*)/i.exec(res.pop());
  6015. }
  6016. }
  6017. // xml
  6018. if (!res && str) {
  6019. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6020. }
  6021. // found charset
  6022. if (res) {
  6023. charset = res.pop();
  6024. // prevent decode issues when sites use incorrect encoding
  6025. // ref: https://hsivonen.fi/encoding-menu/
  6026. if (charset === 'gb2312' || charset === 'gbk') {
  6027. charset = 'gb18030';
  6028. }
  6029. }
  6030. // turn raw buffers into a single utf-8 buffer
  6031. return convert(buffer, 'UTF-8', charset).toString();
  6032. }
  6033. /**
  6034. * Detect a URLSearchParams object
  6035. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6036. *
  6037. * @param Object obj Object to detect by type or brand
  6038. * @return String
  6039. */
  6040. function isURLSearchParams(obj) {
  6041. // Duck-typing as a necessary condition.
  6042. 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') {
  6043. return false;
  6044. }
  6045. // Brand-checking and more duck-typing as optional condition.
  6046. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6047. }
  6048. /**
  6049. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6050. * @param {*} obj
  6051. * @return {boolean}
  6052. */
  6053. function isBlob(obj) {
  6054. 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]);
  6055. }
  6056. /**
  6057. * Clone body given Res/Req instance
  6058. *
  6059. * @param Mixed instance Response or Request instance
  6060. * @return Mixed
  6061. */
  6062. function clone(instance) {
  6063. let p1, p2;
  6064. let body = instance.body;
  6065. // don't allow cloning a used body
  6066. if (instance.bodyUsed) {
  6067. throw new Error('cannot clone body after it is used');
  6068. }
  6069. // check that body is a stream and not form-data object
  6070. // note: we can't clone the form-data object without having it as a dependency
  6071. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6072. // tee instance body
  6073. p1 = new PassThrough();
  6074. p2 = new PassThrough();
  6075. body.pipe(p1);
  6076. body.pipe(p2);
  6077. // set instance body to teed body and return the other teed body
  6078. instance[INTERNALS].body = p1;
  6079. body = p2;
  6080. }
  6081. return body;
  6082. }
  6083. /**
  6084. * Performs the operation "extract a `Content-Type` value from |object|" as
  6085. * specified in the specification:
  6086. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6087. *
  6088. * This function assumes that instance.body is present.
  6089. *
  6090. * @param Mixed instance Any options.body input
  6091. */
  6092. function extractContentType(body) {
  6093. if (body === null) {
  6094. // body is null
  6095. return null;
  6096. } else if (typeof body === 'string') {
  6097. // body is string
  6098. return 'text/plain;charset=UTF-8';
  6099. } else if (isURLSearchParams(body)) {
  6100. // body is a URLSearchParams
  6101. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6102. } else if (isBlob(body)) {
  6103. // body is blob
  6104. return body.type || null;
  6105. } else if (Buffer.isBuffer(body)) {
  6106. // body is buffer
  6107. return null;
  6108. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6109. // body is ArrayBuffer
  6110. return null;
  6111. } else if (ArrayBuffer.isView(body)) {
  6112. // body is ArrayBufferView
  6113. return null;
  6114. } else if (typeof body.getBoundary === 'function') {
  6115. // detect form data input from form-data module
  6116. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6117. } else if (body instanceof Stream) {
  6118. // body is stream
  6119. // can't really do much about this
  6120. return null;
  6121. } else {
  6122. // Body constructor defaults other things to string
  6123. return 'text/plain;charset=UTF-8';
  6124. }
  6125. }
  6126. /**
  6127. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6128. * For us, we have to explicitly get it with a function.
  6129. *
  6130. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6131. *
  6132. * @param Body instance Instance of Body
  6133. * @return Number? Number of bytes, or null if not possible
  6134. */
  6135. function getTotalBytes(instance) {
  6136. const body = instance.body;
  6137. if (body === null) {
  6138. // body is null
  6139. return 0;
  6140. } else if (isBlob(body)) {
  6141. return body.size;
  6142. } else if (Buffer.isBuffer(body)) {
  6143. // body is buffer
  6144. return body.length;
  6145. } else if (body && typeof body.getLengthSync === 'function') {
  6146. // detect form data input from form-data module
  6147. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6148. body.hasKnownLength && body.hasKnownLength()) {
  6149. // 2.x
  6150. return body.getLengthSync();
  6151. }
  6152. return null;
  6153. } else {
  6154. // body is stream
  6155. return null;
  6156. }
  6157. }
  6158. /**
  6159. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6160. *
  6161. * @param Body instance Instance of Body
  6162. * @return Void
  6163. */
  6164. function writeToStream(dest, instance) {
  6165. const body = instance.body;
  6166. if (body === null) {
  6167. // body is null
  6168. dest.end();
  6169. } else if (isBlob(body)) {
  6170. body.stream().pipe(dest);
  6171. } else if (Buffer.isBuffer(body)) {
  6172. // body is buffer
  6173. dest.write(body);
  6174. dest.end();
  6175. } else {
  6176. // body is stream
  6177. body.pipe(dest);
  6178. }
  6179. }
  6180. // expose Promise
  6181. Body.Promise = global.Promise;
  6182. /**
  6183. * headers.js
  6184. *
  6185. * Headers class offers convenient helpers
  6186. */
  6187. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6188. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6189. function validateName(name) {
  6190. name = `${name}`;
  6191. if (invalidTokenRegex.test(name) || name === '') {
  6192. throw new TypeError(`${name} is not a legal HTTP header name`);
  6193. }
  6194. }
  6195. function validateValue(value) {
  6196. value = `${value}`;
  6197. if (invalidHeaderCharRegex.test(value)) {
  6198. throw new TypeError(`${value} is not a legal HTTP header value`);
  6199. }
  6200. }
  6201. /**
  6202. * Find the key in the map object given a header name.
  6203. *
  6204. * Returns undefined if not found.
  6205. *
  6206. * @param String name Header name
  6207. * @return String|Undefined
  6208. */
  6209. function find(map, name) {
  6210. name = name.toLowerCase();
  6211. for (const key in map) {
  6212. if (key.toLowerCase() === name) {
  6213. return key;
  6214. }
  6215. }
  6216. return undefined;
  6217. }
  6218. const MAP = Symbol('map');
  6219. class Headers {
  6220. /**
  6221. * Headers class
  6222. *
  6223. * @param Object headers Response headers
  6224. * @return Void
  6225. */
  6226. constructor() {
  6227. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6228. this[MAP] = Object.create(null);
  6229. if (init instanceof Headers) {
  6230. const rawHeaders = init.raw();
  6231. const headerNames = Object.keys(rawHeaders);
  6232. for (const headerName of headerNames) {
  6233. for (const value of rawHeaders[headerName]) {
  6234. this.append(headerName, value);
  6235. }
  6236. }
  6237. return;
  6238. }
  6239. // We don't worry about converting prop to ByteString here as append()
  6240. // will handle it.
  6241. if (init == null) ; else if (typeof init === 'object') {
  6242. const method = init[Symbol.iterator];
  6243. if (method != null) {
  6244. if (typeof method !== 'function') {
  6245. throw new TypeError('Header pairs must be iterable');
  6246. }
  6247. // sequence<sequence<ByteString>>
  6248. // Note: per spec we have to first exhaust the lists then process them
  6249. const pairs = [];
  6250. for (const pair of init) {
  6251. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6252. throw new TypeError('Each header pair must be iterable');
  6253. }
  6254. pairs.push(Array.from(pair));
  6255. }
  6256. for (const pair of pairs) {
  6257. if (pair.length !== 2) {
  6258. throw new TypeError('Each header pair must be a name/value tuple');
  6259. }
  6260. this.append(pair[0], pair[1]);
  6261. }
  6262. } else {
  6263. // record<ByteString, ByteString>
  6264. for (const key of Object.keys(init)) {
  6265. const value = init[key];
  6266. this.append(key, value);
  6267. }
  6268. }
  6269. } else {
  6270. throw new TypeError('Provided initializer must be an object');
  6271. }
  6272. }
  6273. /**
  6274. * Return combined header value given name
  6275. *
  6276. * @param String name Header name
  6277. * @return Mixed
  6278. */
  6279. get(name) {
  6280. name = `${name}`;
  6281. validateName(name);
  6282. const key = find(this[MAP], name);
  6283. if (key === undefined) {
  6284. return null;
  6285. }
  6286. return this[MAP][key].join(', ');
  6287. }
  6288. /**
  6289. * Iterate over all headers
  6290. *
  6291. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6292. * @param Boolean thisArg `this` context for callback function
  6293. * @return Void
  6294. */
  6295. forEach(callback) {
  6296. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6297. let pairs = getHeaders(this);
  6298. let i = 0;
  6299. while (i < pairs.length) {
  6300. var _pairs$i = pairs[i];
  6301. const name = _pairs$i[0],
  6302. value = _pairs$i[1];
  6303. callback.call(thisArg, value, name, this);
  6304. pairs = getHeaders(this);
  6305. i++;
  6306. }
  6307. }
  6308. /**
  6309. * Overwrite header values given name
  6310. *
  6311. * @param String name Header name
  6312. * @param String value Header value
  6313. * @return Void
  6314. */
  6315. set(name, value) {
  6316. name = `${name}`;
  6317. value = `${value}`;
  6318. validateName(name);
  6319. validateValue(value);
  6320. const key = find(this[MAP], name);
  6321. this[MAP][key !== undefined ? key : name] = [value];
  6322. }
  6323. /**
  6324. * Append a value onto existing header
  6325. *
  6326. * @param String name Header name
  6327. * @param String value Header value
  6328. * @return Void
  6329. */
  6330. append(name, value) {
  6331. name = `${name}`;
  6332. value = `${value}`;
  6333. validateName(name);
  6334. validateValue(value);
  6335. const key = find(this[MAP], name);
  6336. if (key !== undefined) {
  6337. this[MAP][key].push(value);
  6338. } else {
  6339. this[MAP][name] = [value];
  6340. }
  6341. }
  6342. /**
  6343. * Check for header name existence
  6344. *
  6345. * @param String name Header name
  6346. * @return Boolean
  6347. */
  6348. has(name) {
  6349. name = `${name}`;
  6350. validateName(name);
  6351. return find(this[MAP], name) !== undefined;
  6352. }
  6353. /**
  6354. * Delete all header values given name
  6355. *
  6356. * @param String name Header name
  6357. * @return Void
  6358. */
  6359. delete(name) {
  6360. name = `${name}`;
  6361. validateName(name);
  6362. const key = find(this[MAP], name);
  6363. if (key !== undefined) {
  6364. delete this[MAP][key];
  6365. }
  6366. }
  6367. /**
  6368. * Return raw headers (non-spec api)
  6369. *
  6370. * @return Object
  6371. */
  6372. raw() {
  6373. return this[MAP];
  6374. }
  6375. /**
  6376. * Get an iterator on keys.
  6377. *
  6378. * @return Iterator
  6379. */
  6380. keys() {
  6381. return createHeadersIterator(this, 'key');
  6382. }
  6383. /**
  6384. * Get an iterator on values.
  6385. *
  6386. * @return Iterator
  6387. */
  6388. values() {
  6389. return createHeadersIterator(this, 'value');
  6390. }
  6391. /**
  6392. * Get an iterator on entries.
  6393. *
  6394. * This is the default iterator of the Headers object.
  6395. *
  6396. * @return Iterator
  6397. */
  6398. [Symbol.iterator]() {
  6399. return createHeadersIterator(this, 'key+value');
  6400. }
  6401. }
  6402. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6403. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6404. value: 'Headers',
  6405. writable: false,
  6406. enumerable: false,
  6407. configurable: true
  6408. });
  6409. Object.defineProperties(Headers.prototype, {
  6410. get: { enumerable: true },
  6411. forEach: { enumerable: true },
  6412. set: { enumerable: true },
  6413. append: { enumerable: true },
  6414. has: { enumerable: true },
  6415. delete: { enumerable: true },
  6416. keys: { enumerable: true },
  6417. values: { enumerable: true },
  6418. entries: { enumerable: true }
  6419. });
  6420. function getHeaders(headers) {
  6421. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6422. const keys = Object.keys(headers[MAP]).sort();
  6423. return keys.map(kind === 'key' ? function (k) {
  6424. return k.toLowerCase();
  6425. } : kind === 'value' ? function (k) {
  6426. return headers[MAP][k].join(', ');
  6427. } : function (k) {
  6428. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6429. });
  6430. }
  6431. const INTERNAL = Symbol('internal');
  6432. function createHeadersIterator(target, kind) {
  6433. const iterator = Object.create(HeadersIteratorPrototype);
  6434. iterator[INTERNAL] = {
  6435. target,
  6436. kind,
  6437. index: 0
  6438. };
  6439. return iterator;
  6440. }
  6441. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6442. next() {
  6443. // istanbul ignore if
  6444. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6445. throw new TypeError('Value of `this` is not a HeadersIterator');
  6446. }
  6447. var _INTERNAL = this[INTERNAL];
  6448. const target = _INTERNAL.target,
  6449. kind = _INTERNAL.kind,
  6450. index = _INTERNAL.index;
  6451. const values = getHeaders(target, kind);
  6452. const len = values.length;
  6453. if (index >= len) {
  6454. return {
  6455. value: undefined,
  6456. done: true
  6457. };
  6458. }
  6459. this[INTERNAL].index = index + 1;
  6460. return {
  6461. value: values[index],
  6462. done: false
  6463. };
  6464. }
  6465. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6466. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6467. value: 'HeadersIterator',
  6468. writable: false,
  6469. enumerable: false,
  6470. configurable: true
  6471. });
  6472. /**
  6473. * Export the Headers object in a form that Node.js can consume.
  6474. *
  6475. * @param Headers headers
  6476. * @return Object
  6477. */
  6478. function exportNodeCompatibleHeaders(headers) {
  6479. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6480. // http.request() only supports string as Host header. This hack makes
  6481. // specifying custom Host header possible.
  6482. const hostHeaderKey = find(headers[MAP], 'Host');
  6483. if (hostHeaderKey !== undefined) {
  6484. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6485. }
  6486. return obj;
  6487. }
  6488. /**
  6489. * Create a Headers object from an object of headers, ignoring those that do
  6490. * not conform to HTTP grammar productions.
  6491. *
  6492. * @param Object obj Object of headers
  6493. * @return Headers
  6494. */
  6495. function createHeadersLenient(obj) {
  6496. const headers = new Headers();
  6497. for (const name of Object.keys(obj)) {
  6498. if (invalidTokenRegex.test(name)) {
  6499. continue;
  6500. }
  6501. if (Array.isArray(obj[name])) {
  6502. for (const val of obj[name]) {
  6503. if (invalidHeaderCharRegex.test(val)) {
  6504. continue;
  6505. }
  6506. if (headers[MAP][name] === undefined) {
  6507. headers[MAP][name] = [val];
  6508. } else {
  6509. headers[MAP][name].push(val);
  6510. }
  6511. }
  6512. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6513. headers[MAP][name] = [obj[name]];
  6514. }
  6515. }
  6516. return headers;
  6517. }
  6518. const INTERNALS$1 = Symbol('Response internals');
  6519. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6520. const STATUS_CODES = http.STATUS_CODES;
  6521. /**
  6522. * Response class
  6523. *
  6524. * @param Stream body Readable stream
  6525. * @param Object opts Response options
  6526. * @return Void
  6527. */
  6528. class Response {
  6529. constructor() {
  6530. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6531. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6532. Body.call(this, body, opts);
  6533. const status = opts.status || 200;
  6534. const headers = new Headers(opts.headers);
  6535. if (body != null && !headers.has('Content-Type')) {
  6536. const contentType = extractContentType(body);
  6537. if (contentType) {
  6538. headers.append('Content-Type', contentType);
  6539. }
  6540. }
  6541. this[INTERNALS$1] = {
  6542. url: opts.url,
  6543. status,
  6544. statusText: opts.statusText || STATUS_CODES[status],
  6545. headers,
  6546. counter: opts.counter
  6547. };
  6548. }
  6549. get url() {
  6550. return this[INTERNALS$1].url || '';
  6551. }
  6552. get status() {
  6553. return this[INTERNALS$1].status;
  6554. }
  6555. /**
  6556. * Convenience property representing if the request ended normally
  6557. */
  6558. get ok() {
  6559. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6560. }
  6561. get redirected() {
  6562. return this[INTERNALS$1].counter > 0;
  6563. }
  6564. get statusText() {
  6565. return this[INTERNALS$1].statusText;
  6566. }
  6567. get headers() {
  6568. return this[INTERNALS$1].headers;
  6569. }
  6570. /**
  6571. * Clone this response
  6572. *
  6573. * @return Response
  6574. */
  6575. clone() {
  6576. return new Response(clone(this), {
  6577. url: this.url,
  6578. status: this.status,
  6579. statusText: this.statusText,
  6580. headers: this.headers,
  6581. ok: this.ok,
  6582. redirected: this.redirected
  6583. });
  6584. }
  6585. }
  6586. Body.mixIn(Response.prototype);
  6587. Object.defineProperties(Response.prototype, {
  6588. url: { enumerable: true },
  6589. status: { enumerable: true },
  6590. ok: { enumerable: true },
  6591. redirected: { enumerable: true },
  6592. statusText: { enumerable: true },
  6593. headers: { enumerable: true },
  6594. clone: { enumerable: true }
  6595. });
  6596. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6597. value: 'Response',
  6598. writable: false,
  6599. enumerable: false,
  6600. configurable: true
  6601. });
  6602. const INTERNALS$2 = Symbol('Request internals');
  6603. // fix an issue where "format", "parse" aren't a named export for node <10
  6604. const parse_url = Url.parse;
  6605. const format_url = Url.format;
  6606. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6607. /**
  6608. * Check if a value is an instance of Request.
  6609. *
  6610. * @param Mixed input
  6611. * @return Boolean
  6612. */
  6613. function isRequest(input) {
  6614. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6615. }
  6616. function isAbortSignal(signal) {
  6617. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6618. return !!(proto && proto.constructor.name === 'AbortSignal');
  6619. }
  6620. /**
  6621. * Request class
  6622. *
  6623. * @param Mixed input Url or Request instance
  6624. * @param Object init Custom options
  6625. * @return Void
  6626. */
  6627. class Request {
  6628. constructor(input) {
  6629. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6630. let parsedURL;
  6631. // normalize input
  6632. if (!isRequest(input)) {
  6633. if (input && input.href) {
  6634. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6635. // will fall into this branch also (since their `toString()` will return
  6636. // `href` property anyway)
  6637. parsedURL = parse_url(input.href);
  6638. } else {
  6639. // coerce input to a string before attempting to parse
  6640. parsedURL = parse_url(`${input}`);
  6641. }
  6642. input = {};
  6643. } else {
  6644. parsedURL = parse_url(input.url);
  6645. }
  6646. let method = init.method || input.method || 'GET';
  6647. method = method.toUpperCase();
  6648. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6649. throw new TypeError('Request with GET/HEAD method cannot have body');
  6650. }
  6651. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6652. Body.call(this, inputBody, {
  6653. timeout: init.timeout || input.timeout || 0,
  6654. size: init.size || input.size || 0
  6655. });
  6656. const headers = new Headers(init.headers || input.headers || {});
  6657. if (inputBody != null && !headers.has('Content-Type')) {
  6658. const contentType = extractContentType(inputBody);
  6659. if (contentType) {
  6660. headers.append('Content-Type', contentType);
  6661. }
  6662. }
  6663. let signal = isRequest(input) ? input.signal : null;
  6664. if ('signal' in init) signal = init.signal;
  6665. if (signal != null && !isAbortSignal(signal)) {
  6666. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6667. }
  6668. this[INTERNALS$2] = {
  6669. method,
  6670. redirect: init.redirect || input.redirect || 'follow',
  6671. headers,
  6672. parsedURL,
  6673. signal
  6674. };
  6675. // node-fetch-only options
  6676. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6677. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6678. this.counter = init.counter || input.counter || 0;
  6679. this.agent = init.agent || input.agent;
  6680. }
  6681. get method() {
  6682. return this[INTERNALS$2].method;
  6683. }
  6684. get url() {
  6685. return format_url(this[INTERNALS$2].parsedURL);
  6686. }
  6687. get headers() {
  6688. return this[INTERNALS$2].headers;
  6689. }
  6690. get redirect() {
  6691. return this[INTERNALS$2].redirect;
  6692. }
  6693. get signal() {
  6694. return this[INTERNALS$2].signal;
  6695. }
  6696. /**
  6697. * Clone this request
  6698. *
  6699. * @return Request
  6700. */
  6701. clone() {
  6702. return new Request(this);
  6703. }
  6704. }
  6705. Body.mixIn(Request.prototype);
  6706. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6707. value: 'Request',
  6708. writable: false,
  6709. enumerable: false,
  6710. configurable: true
  6711. });
  6712. Object.defineProperties(Request.prototype, {
  6713. method: { enumerable: true },
  6714. url: { enumerable: true },
  6715. headers: { enumerable: true },
  6716. redirect: { enumerable: true },
  6717. clone: { enumerable: true },
  6718. signal: { enumerable: true }
  6719. });
  6720. /**
  6721. * Convert a Request to Node.js http request options.
  6722. *
  6723. * @param Request A Request instance
  6724. * @return Object The options object to be passed to http.request
  6725. */
  6726. function getNodeRequestOptions(request) {
  6727. const parsedURL = request[INTERNALS$2].parsedURL;
  6728. const headers = new Headers(request[INTERNALS$2].headers);
  6729. // fetch step 1.3
  6730. if (!headers.has('Accept')) {
  6731. headers.set('Accept', '*/*');
  6732. }
  6733. // Basic fetch
  6734. if (!parsedURL.protocol || !parsedURL.hostname) {
  6735. throw new TypeError('Only absolute URLs are supported');
  6736. }
  6737. if (!/^https?:$/.test(parsedURL.protocol)) {
  6738. throw new TypeError('Only HTTP(S) protocols are supported');
  6739. }
  6740. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6741. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6742. }
  6743. // HTTP-network-or-cache fetch steps 2.4-2.7
  6744. let contentLengthValue = null;
  6745. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6746. contentLengthValue = '0';
  6747. }
  6748. if (request.body != null) {
  6749. const totalBytes = getTotalBytes(request);
  6750. if (typeof totalBytes === 'number') {
  6751. contentLengthValue = String(totalBytes);
  6752. }
  6753. }
  6754. if (contentLengthValue) {
  6755. headers.set('Content-Length', contentLengthValue);
  6756. }
  6757. // HTTP-network-or-cache fetch step 2.11
  6758. if (!headers.has('User-Agent')) {
  6759. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6760. }
  6761. // HTTP-network-or-cache fetch step 2.15
  6762. if (request.compress && !headers.has('Accept-Encoding')) {
  6763. headers.set('Accept-Encoding', 'gzip,deflate');
  6764. }
  6765. let agent = request.agent;
  6766. if (typeof agent === 'function') {
  6767. agent = agent(parsedURL);
  6768. }
  6769. if (!headers.has('Connection') && !agent) {
  6770. headers.set('Connection', 'close');
  6771. }
  6772. // HTTP-network fetch step 4.2
  6773. // chunked encoding is handled by Node.js
  6774. return Object.assign({}, parsedURL, {
  6775. method: request.method,
  6776. headers: exportNodeCompatibleHeaders(headers),
  6777. agent
  6778. });
  6779. }
  6780. /**
  6781. * abort-error.js
  6782. *
  6783. * AbortError interface for cancelled requests
  6784. */
  6785. /**
  6786. * Create AbortError instance
  6787. *
  6788. * @param String message Error message for human
  6789. * @return AbortError
  6790. */
  6791. function AbortError(message) {
  6792. Error.call(this, message);
  6793. this.type = 'aborted';
  6794. this.message = message;
  6795. // hide custom error implementation details from end-users
  6796. Error.captureStackTrace(this, this.constructor);
  6797. }
  6798. AbortError.prototype = Object.create(Error.prototype);
  6799. AbortError.prototype.constructor = AbortError;
  6800. AbortError.prototype.name = 'AbortError';
  6801. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6802. const PassThrough$1 = Stream.PassThrough;
  6803. const resolve_url = Url.resolve;
  6804. /**
  6805. * Fetch function
  6806. *
  6807. * @param Mixed url Absolute url or Request instance
  6808. * @param Object opts Fetch options
  6809. * @return Promise
  6810. */
  6811. function fetch(url, opts) {
  6812. // allow custom promise
  6813. if (!fetch.Promise) {
  6814. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6815. }
  6816. Body.Promise = fetch.Promise;
  6817. // wrap http.request into fetch
  6818. return new fetch.Promise(function (resolve, reject) {
  6819. // build request object
  6820. const request = new Request(url, opts);
  6821. const options = getNodeRequestOptions(request);
  6822. const send = (options.protocol === 'https:' ? https : http).request;
  6823. const signal = request.signal;
  6824. let response = null;
  6825. const abort = function abort() {
  6826. let error = new AbortError('The user aborted a request.');
  6827. reject(error);
  6828. if (request.body && request.body instanceof Stream.Readable) {
  6829. request.body.destroy(error);
  6830. }
  6831. if (!response || !response.body) return;
  6832. response.body.emit('error', error);
  6833. };
  6834. if (signal && signal.aborted) {
  6835. abort();
  6836. return;
  6837. }
  6838. const abortAndFinalize = function abortAndFinalize() {
  6839. abort();
  6840. finalize();
  6841. };
  6842. // send request
  6843. const req = send(options);
  6844. let reqTimeout;
  6845. if (signal) {
  6846. signal.addEventListener('abort', abortAndFinalize);
  6847. }
  6848. function finalize() {
  6849. req.abort();
  6850. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6851. clearTimeout(reqTimeout);
  6852. }
  6853. if (request.timeout) {
  6854. req.once('socket', function (socket) {
  6855. reqTimeout = setTimeout(function () {
  6856. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6857. finalize();
  6858. }, request.timeout);
  6859. });
  6860. }
  6861. req.on('error', function (err) {
  6862. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6863. finalize();
  6864. });
  6865. req.on('response', function (res) {
  6866. clearTimeout(reqTimeout);
  6867. const headers = createHeadersLenient(res.headers);
  6868. // HTTP fetch step 5
  6869. if (fetch.isRedirect(res.statusCode)) {
  6870. // HTTP fetch step 5.2
  6871. const location = headers.get('Location');
  6872. // HTTP fetch step 5.3
  6873. const locationURL = location === null ? null : resolve_url(request.url, location);
  6874. // HTTP fetch step 5.5
  6875. switch (request.redirect) {
  6876. case 'error':
  6877. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6878. finalize();
  6879. return;
  6880. case 'manual':
  6881. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6882. if (locationURL !== null) {
  6883. // handle corrupted header
  6884. try {
  6885. headers.set('Location', locationURL);
  6886. } catch (err) {
  6887. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6888. reject(err);
  6889. }
  6890. }
  6891. break;
  6892. case 'follow':
  6893. // HTTP-redirect fetch step 2
  6894. if (locationURL === null) {
  6895. break;
  6896. }
  6897. // HTTP-redirect fetch step 5
  6898. if (request.counter >= request.follow) {
  6899. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6900. finalize();
  6901. return;
  6902. }
  6903. // HTTP-redirect fetch step 6 (counter increment)
  6904. // Create a new Request object.
  6905. const requestOpts = {
  6906. headers: new Headers(request.headers),
  6907. follow: request.follow,
  6908. counter: request.counter + 1,
  6909. agent: request.agent,
  6910. compress: request.compress,
  6911. method: request.method,
  6912. body: request.body,
  6913. signal: request.signal,
  6914. timeout: request.timeout
  6915. };
  6916. // HTTP-redirect fetch step 9
  6917. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  6918. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  6919. finalize();
  6920. return;
  6921. }
  6922. // HTTP-redirect fetch step 11
  6923. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  6924. requestOpts.method = 'GET';
  6925. requestOpts.body = undefined;
  6926. requestOpts.headers.delete('content-length');
  6927. }
  6928. // HTTP-redirect fetch step 15
  6929. resolve(fetch(new Request(locationURL, requestOpts)));
  6930. finalize();
  6931. return;
  6932. }
  6933. }
  6934. // prepare response
  6935. res.once('end', function () {
  6936. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6937. });
  6938. let body = res.pipe(new PassThrough$1());
  6939. const response_options = {
  6940. url: request.url,
  6941. status: res.statusCode,
  6942. statusText: res.statusMessage,
  6943. headers: headers,
  6944. size: request.size,
  6945. timeout: request.timeout,
  6946. counter: request.counter
  6947. };
  6948. // HTTP-network fetch step 12.1.1.3
  6949. const codings = headers.get('Content-Encoding');
  6950. // HTTP-network fetch step 12.1.1.4: handle content codings
  6951. // in following scenarios we ignore compression support
  6952. // 1. compression support is disabled
  6953. // 2. HEAD request
  6954. // 3. no Content-Encoding header
  6955. // 4. no content response (204)
  6956. // 5. content not modified response (304)
  6957. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  6958. response = new Response(body, response_options);
  6959. resolve(response);
  6960. return;
  6961. }
  6962. // For Node v6+
  6963. // Be less strict when decoding compressed responses, since sometimes
  6964. // servers send slightly invalid responses that are still accepted
  6965. // by common browsers.
  6966. // Always using Z_SYNC_FLUSH is what cURL does.
  6967. const zlibOptions = {
  6968. flush: zlib.Z_SYNC_FLUSH,
  6969. finishFlush: zlib.Z_SYNC_FLUSH
  6970. };
  6971. // for gzip
  6972. if (codings == 'gzip' || codings == 'x-gzip') {
  6973. body = body.pipe(zlib.createGunzip(zlibOptions));
  6974. response = new Response(body, response_options);
  6975. resolve(response);
  6976. return;
  6977. }
  6978. // for deflate
  6979. if (codings == 'deflate' || codings == 'x-deflate') {
  6980. // handle the infamous raw deflate response from old servers
  6981. // a hack for old IIS and Apache servers
  6982. const raw = res.pipe(new PassThrough$1());
  6983. raw.once('data', function (chunk) {
  6984. // see http://stackoverflow.com/questions/37519828
  6985. if ((chunk[0] & 0x0F) === 0x08) {
  6986. body = body.pipe(zlib.createInflate());
  6987. } else {
  6988. body = body.pipe(zlib.createInflateRaw());
  6989. }
  6990. response = new Response(body, response_options);
  6991. resolve(response);
  6992. });
  6993. return;
  6994. }
  6995. // for br
  6996. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  6997. body = body.pipe(zlib.createBrotliDecompress());
  6998. response = new Response(body, response_options);
  6999. resolve(response);
  7000. return;
  7001. }
  7002. // otherwise, use response as-is
  7003. response = new Response(body, response_options);
  7004. resolve(response);
  7005. });
  7006. writeToStream(req, request);
  7007. });
  7008. }
  7009. /**
  7010. * Redirect code matching
  7011. *
  7012. * @param Number code Status code
  7013. * @return Boolean
  7014. */
  7015. fetch.isRedirect = function (code) {
  7016. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7017. };
  7018. // expose Promise
  7019. fetch.Promise = global.Promise;
  7020. module.exports = exports = fetch;
  7021. Object.defineProperty(exports, "__esModule", { value: true });
  7022. exports.default = exports;
  7023. exports.Headers = Headers;
  7024. exports.Request = Request;
  7025. exports.Response = Response;
  7026. exports.FetchError = FetchError;
  7027. /***/ }),
  7028. /***/ 462:
  7029. /***/ (function(module) {
  7030. "use strict";
  7031. // See http://www.robvanderwoude.com/escapechars.php
  7032. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7033. function escapeCommand(arg) {
  7034. // Escape meta chars
  7035. arg = arg.replace(metaCharsRegExp, '^$1');
  7036. return arg;
  7037. }
  7038. function escapeArgument(arg, doubleEscapeMetaChars) {
  7039. // Convert to string
  7040. arg = `${arg}`;
  7041. // Algorithm below is based on https://qntm.org/cmd
  7042. // Sequence of backslashes followed by a double quote:
  7043. // double up all the backslashes and escape the double quote
  7044. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7045. // Sequence of backslashes followed by the end of the string
  7046. // (which will become a double quote later):
  7047. // double up all the backslashes
  7048. arg = arg.replace(/(\\*)$/, '$1$1');
  7049. // All other backslashes occur literally
  7050. // Quote the whole thing:
  7051. arg = `"${arg}"`;
  7052. // Escape meta chars
  7053. arg = arg.replace(metaCharsRegExp, '^$1');
  7054. // Double escape meta chars if necessary
  7055. if (doubleEscapeMetaChars) {
  7056. arg = arg.replace(metaCharsRegExp, '^$1');
  7057. }
  7058. return arg;
  7059. }
  7060. module.exports.command = escapeCommand;
  7061. module.exports.argument = escapeArgument;
  7062. /***/ }),
  7063. /***/ 463:
  7064. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7065. "use strict";
  7066. Object.defineProperty(exports, '__esModule', { value: true });
  7067. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7068. var deprecation = __webpack_require__(692);
  7069. var once = _interopDefault(__webpack_require__(969));
  7070. const logOnce = once(deprecation => console.warn(deprecation));
  7071. /**
  7072. * Error with extra properties to help with debugging
  7073. */
  7074. class RequestError extends Error {
  7075. constructor(message, statusCode, options) {
  7076. super(message); // Maintains proper stack trace (only available on V8)
  7077. /* istanbul ignore next */
  7078. if (Error.captureStackTrace) {
  7079. Error.captureStackTrace(this, this.constructor);
  7080. }
  7081. this.name = "HttpError";
  7082. this.status = statusCode;
  7083. Object.defineProperty(this, "code", {
  7084. get() {
  7085. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7086. return statusCode;
  7087. }
  7088. });
  7089. this.headers = options.headers; // redact request credentials without mutating original request options
  7090. const requestCopy = Object.assign({}, options.request);
  7091. if (options.request.headers.authorization) {
  7092. requestCopy.headers = Object.assign({}, options.request.headers, {
  7093. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7094. });
  7095. }
  7096. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7097. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7098. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7099. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7100. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7101. this.request = requestCopy;
  7102. }
  7103. }
  7104. exports.RequestError = RequestError;
  7105. /***/ }),
  7106. /***/ 469:
  7107. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7108. "use strict";
  7109. var __importDefault = (this && this.__importDefault) || function (mod) {
  7110. return (mod && mod.__esModule) ? mod : { "default": mod };
  7111. };
  7112. var __importStar = (this && this.__importStar) || function (mod) {
  7113. if (mod && mod.__esModule) return mod;
  7114. var result = {};
  7115. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7116. result["default"] = mod;
  7117. return result;
  7118. };
  7119. Object.defineProperty(exports, "__esModule", { value: true });
  7120. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7121. const graphql_1 = __webpack_require__(503);
  7122. const rest_1 = __importDefault(__webpack_require__(613));
  7123. const Context = __importStar(__webpack_require__(262));
  7124. // We need this in order to extend Octokit
  7125. rest_1.default.prototype = new rest_1.default();
  7126. exports.context = new Context.Context();
  7127. class GitHub extends rest_1.default {
  7128. constructor(token, opts = {}) {
  7129. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7130. this.graphql = graphql_1.defaults({
  7131. headers: { authorization: `token ${token}` }
  7132. });
  7133. }
  7134. }
  7135. exports.GitHub = GitHub;
  7136. //# sourceMappingURL=github.js.map
  7137. /***/ }),
  7138. /***/ 470:
  7139. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7140. "use strict";
  7141. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7142. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7143. return new (P || (P = Promise))(function (resolve, reject) {
  7144. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7145. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7146. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7147. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7148. });
  7149. };
  7150. Object.defineProperty(exports, "__esModule", { value: true });
  7151. const command_1 = __webpack_require__(431);
  7152. const os = __webpack_require__(87);
  7153. const path = __webpack_require__(622);
  7154. /**
  7155. * The code to exit an action
  7156. */
  7157. var ExitCode;
  7158. (function (ExitCode) {
  7159. /**
  7160. * A code indicating that the action was successful
  7161. */
  7162. ExitCode[ExitCode["Success"] = 0] = "Success";
  7163. /**
  7164. * A code indicating that the action was a failure
  7165. */
  7166. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7167. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7168. //-----------------------------------------------------------------------
  7169. // Variables
  7170. //-----------------------------------------------------------------------
  7171. /**
  7172. * Sets env variable for this action and future actions in the job
  7173. * @param name the name of the variable to set
  7174. * @param val the value of the variable
  7175. */
  7176. function exportVariable(name, val) {
  7177. process.env[name] = val;
  7178. command_1.issueCommand('set-env', { name }, val);
  7179. }
  7180. exports.exportVariable = exportVariable;
  7181. /**
  7182. * Registers a secret which will get masked from logs
  7183. * @param secret value of the secret
  7184. */
  7185. function setSecret(secret) {
  7186. command_1.issueCommand('add-mask', {}, secret);
  7187. }
  7188. exports.setSecret = setSecret;
  7189. /**
  7190. * Prepends inputPath to the PATH (for this action and future actions)
  7191. * @param inputPath
  7192. */
  7193. function addPath(inputPath) {
  7194. command_1.issueCommand('add-path', {}, inputPath);
  7195. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7196. }
  7197. exports.addPath = addPath;
  7198. /**
  7199. * Gets the value of an input. The value is also trimmed.
  7200. *
  7201. * @param name name of the input to get
  7202. * @param options optional. See InputOptions.
  7203. * @returns string
  7204. */
  7205. function getInput(name, options) {
  7206. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7207. if (options && options.required && !val) {
  7208. throw new Error(`Input required and not supplied: ${name}`);
  7209. }
  7210. return val.trim();
  7211. }
  7212. exports.getInput = getInput;
  7213. /**
  7214. * Sets the value of an output.
  7215. *
  7216. * @param name name of the output to set
  7217. * @param value value to store
  7218. */
  7219. function setOutput(name, value) {
  7220. command_1.issueCommand('set-output', { name }, value);
  7221. }
  7222. exports.setOutput = setOutput;
  7223. //-----------------------------------------------------------------------
  7224. // Results
  7225. //-----------------------------------------------------------------------
  7226. /**
  7227. * Sets the action status to failed.
  7228. * When the action exits it will be with an exit code of 1
  7229. * @param message add error issue message
  7230. */
  7231. function setFailed(message) {
  7232. process.exitCode = ExitCode.Failure;
  7233. error(message);
  7234. }
  7235. exports.setFailed = setFailed;
  7236. //-----------------------------------------------------------------------
  7237. // Logging Commands
  7238. //-----------------------------------------------------------------------
  7239. /**
  7240. * Writes debug message to user log
  7241. * @param message debug message
  7242. */
  7243. function debug(message) {
  7244. command_1.issueCommand('debug', {}, message);
  7245. }
  7246. exports.debug = debug;
  7247. /**
  7248. * Adds an error issue
  7249. * @param message error issue message
  7250. */
  7251. function error(message) {
  7252. command_1.issue('error', message);
  7253. }
  7254. exports.error = error;
  7255. /**
  7256. * Adds an warning issue
  7257. * @param message warning issue message
  7258. */
  7259. function warning(message) {
  7260. command_1.issue('warning', message);
  7261. }
  7262. exports.warning = warning;
  7263. /**
  7264. * Writes info to log with console.log.
  7265. * @param message info message
  7266. */
  7267. function info(message) {
  7268. process.stdout.write(message + os.EOL);
  7269. }
  7270. exports.info = info;
  7271. /**
  7272. * Begin an output group.
  7273. *
  7274. * Output until the next `groupEnd` will be foldable in this group
  7275. *
  7276. * @param name The name of the output group
  7277. */
  7278. function startGroup(name) {
  7279. command_1.issue('group', name);
  7280. }
  7281. exports.startGroup = startGroup;
  7282. /**
  7283. * End an output group.
  7284. */
  7285. function endGroup() {
  7286. command_1.issue('endgroup');
  7287. }
  7288. exports.endGroup = endGroup;
  7289. /**
  7290. * Wrap an asynchronous function call in a group.
  7291. *
  7292. * Returns the same type as the function itself.
  7293. *
  7294. * @param name The name of the group
  7295. * @param fn The function to wrap in the group
  7296. */
  7297. function group(name, fn) {
  7298. return __awaiter(this, void 0, void 0, function* () {
  7299. startGroup(name);
  7300. let result;
  7301. try {
  7302. result = yield fn();
  7303. }
  7304. finally {
  7305. endGroup();
  7306. }
  7307. return result;
  7308. });
  7309. }
  7310. exports.group = group;
  7311. //# sourceMappingURL=core.js.map
  7312. /***/ }),
  7313. /***/ 471:
  7314. /***/ (function(module, __unusedexports, __webpack_require__) {
  7315. module.exports = authenticationBeforeRequest;
  7316. const btoa = __webpack_require__(675);
  7317. const uniq = __webpack_require__(126);
  7318. function authenticationBeforeRequest(state, options) {
  7319. if (!state.auth.type) {
  7320. return;
  7321. }
  7322. if (state.auth.type === "basic") {
  7323. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7324. options.headers.authorization = `Basic ${hash}`;
  7325. return;
  7326. }
  7327. if (state.auth.type === "token") {
  7328. options.headers.authorization = `token ${state.auth.token}`;
  7329. return;
  7330. }
  7331. if (state.auth.type === "app") {
  7332. options.headers.authorization = `Bearer ${state.auth.token}`;
  7333. const acceptHeaders = options.headers.accept
  7334. .split(",")
  7335. .concat("application/vnd.github.machine-man-preview+json");
  7336. options.headers.accept = uniq(acceptHeaders)
  7337. .filter(Boolean)
  7338. .join(",");
  7339. return;
  7340. }
  7341. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7342. if (state.auth.token) {
  7343. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7344. return;
  7345. }
  7346. const key = encodeURIComponent(state.auth.key);
  7347. const secret = encodeURIComponent(state.auth.secret);
  7348. options.url += `client_id=${key}&client_secret=${secret}`;
  7349. }
  7350. /***/ }),
  7351. /***/ 489:
  7352. /***/ (function(module, __unusedexports, __webpack_require__) {
  7353. "use strict";
  7354. const path = __webpack_require__(622);
  7355. const which = __webpack_require__(814);
  7356. const pathKey = __webpack_require__(39)();
  7357. function resolveCommandAttempt(parsed, withoutPathExt) {
  7358. const cwd = process.cwd();
  7359. const hasCustomCwd = parsed.options.cwd != null;
  7360. // If a custom `cwd` was specified, we need to change the process cwd
  7361. // because `which` will do stat calls but does not support a custom cwd
  7362. if (hasCustomCwd) {
  7363. try {
  7364. process.chdir(parsed.options.cwd);
  7365. } catch (err) {
  7366. /* Empty */
  7367. }
  7368. }
  7369. let resolved;
  7370. try {
  7371. resolved = which.sync(parsed.command, {
  7372. path: (parsed.options.env || process.env)[pathKey],
  7373. pathExt: withoutPathExt ? path.delimiter : undefined,
  7374. });
  7375. } catch (e) {
  7376. /* Empty */
  7377. } finally {
  7378. process.chdir(cwd);
  7379. }
  7380. // If we successfully resolved, ensure that an absolute path is returned
  7381. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7382. if (resolved) {
  7383. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7384. }
  7385. return resolved;
  7386. }
  7387. function resolveCommand(parsed) {
  7388. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7389. }
  7390. module.exports = resolveCommand;
  7391. /***/ }),
  7392. /***/ 500:
  7393. /***/ (function(module, __unusedexports, __webpack_require__) {
  7394. module.exports = graphql
  7395. const GraphqlError = __webpack_require__(862)
  7396. const NON_VARIABLE_OPTIONS = ['method', 'baseUrl', 'url', 'headers', 'request', 'query']
  7397. function graphql (request, query, options) {
  7398. if (typeof query === 'string') {
  7399. options = Object.assign({ query }, options)
  7400. } else {
  7401. options = query
  7402. }
  7403. const requestOptions = Object.keys(options).reduce((result, key) => {
  7404. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7405. result[key] = options[key]
  7406. return result
  7407. }
  7408. if (!result.variables) {
  7409. result.variables = {}
  7410. }
  7411. result.variables[key] = options[key]
  7412. return result
  7413. }, {})
  7414. return request(requestOptions)
  7415. .then(response => {
  7416. if (response.data.errors) {
  7417. throw new GraphqlError(requestOptions, response)
  7418. }
  7419. return response.data.data
  7420. })
  7421. }
  7422. /***/ }),
  7423. /***/ 503:
  7424. /***/ (function(module, __unusedexports, __webpack_require__) {
  7425. const { request } = __webpack_require__(753)
  7426. const getUserAgent = __webpack_require__(46)
  7427. const version = __webpack_require__(314).version
  7428. const userAgent = `octokit-graphql.js/${version} ${getUserAgent()}`
  7429. const withDefaults = __webpack_require__(0)
  7430. module.exports = withDefaults(request, {
  7431. method: 'POST',
  7432. url: '/graphql',
  7433. headers: {
  7434. 'user-agent': userAgent
  7435. }
  7436. })
  7437. /***/ }),
  7438. /***/ 510:
  7439. /***/ (function(module) {
  7440. module.exports = addHook
  7441. function addHook (state, kind, name, hook) {
  7442. var orig = hook
  7443. if (!state.registry[name]) {
  7444. state.registry[name] = []
  7445. }
  7446. if (kind === 'before') {
  7447. hook = function (method, options) {
  7448. return Promise.resolve()
  7449. .then(orig.bind(null, options))
  7450. .then(method.bind(null, options))
  7451. }
  7452. }
  7453. if (kind === 'after') {
  7454. hook = function (method, options) {
  7455. var result
  7456. return Promise.resolve()
  7457. .then(method.bind(null, options))
  7458. .then(function (result_) {
  7459. result = result_
  7460. return orig(result, options)
  7461. })
  7462. .then(function () {
  7463. return result
  7464. })
  7465. }
  7466. }
  7467. if (kind === 'error') {
  7468. hook = function (method, options) {
  7469. return Promise.resolve()
  7470. .then(method.bind(null, options))
  7471. .catch(function (error) {
  7472. return orig(error, options)
  7473. })
  7474. }
  7475. }
  7476. state.registry[name].push({
  7477. hook: hook,
  7478. orig: orig
  7479. })
  7480. }
  7481. /***/ }),
  7482. /***/ 523:
  7483. /***/ (function(module, __unusedexports, __webpack_require__) {
  7484. var register = __webpack_require__(363)
  7485. var addHook = __webpack_require__(510)
  7486. var removeHook = __webpack_require__(763)
  7487. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7488. var bind = Function.bind
  7489. var bindable = bind.bind(bind)
  7490. function bindApi (hook, state, name) {
  7491. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7492. hook.api = { remove: removeHookRef }
  7493. hook.remove = removeHookRef
  7494. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7495. var args = name ? [state, kind, name] : [state, kind]
  7496. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7497. })
  7498. }
  7499. function HookSingular () {
  7500. var singularHookName = 'h'
  7501. var singularHookState = {
  7502. registry: {}
  7503. }
  7504. var singularHook = register.bind(null, singularHookState, singularHookName)
  7505. bindApi(singularHook, singularHookState, singularHookName)
  7506. return singularHook
  7507. }
  7508. function HookCollection () {
  7509. var state = {
  7510. registry: {}
  7511. }
  7512. var hook = register.bind(null, state)
  7513. bindApi(hook, state)
  7514. return hook
  7515. }
  7516. var collectionHookDeprecationMessageDisplayed = false
  7517. function Hook () {
  7518. if (!collectionHookDeprecationMessageDisplayed) {
  7519. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7520. collectionHookDeprecationMessageDisplayed = true
  7521. }
  7522. return HookCollection()
  7523. }
  7524. Hook.Singular = HookSingular.bind()
  7525. Hook.Collection = HookCollection.bind()
  7526. module.exports = Hook
  7527. // expose constructors as a named property for TypeScript
  7528. module.exports.Hook = Hook
  7529. module.exports.Singular = Hook.Singular
  7530. module.exports.Collection = Hook.Collection
  7531. /***/ }),
  7532. /***/ 529:
  7533. /***/ (function(module, __unusedexports, __webpack_require__) {
  7534. const factory = __webpack_require__(47);
  7535. module.exports = factory();
  7536. /***/ }),
  7537. /***/ 536:
  7538. /***/ (function(module, __unusedexports, __webpack_require__) {
  7539. module.exports = hasFirstPage
  7540. const deprecate = __webpack_require__(370)
  7541. const getPageLinks = __webpack_require__(577)
  7542. function hasFirstPage (link) {
  7543. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7544. return getPageLinks(link).first
  7545. }
  7546. /***/ }),
  7547. /***/ 550:
  7548. /***/ (function(module, __unusedexports, __webpack_require__) {
  7549. module.exports = getNextPage
  7550. const getPage = __webpack_require__(265)
  7551. function getNextPage (octokit, link, headers) {
  7552. return getPage(octokit, link, 'next', headers)
  7553. }
  7554. /***/ }),
  7555. /***/ 558:
  7556. /***/ (function(module, __unusedexports, __webpack_require__) {
  7557. module.exports = hasPreviousPage
  7558. const deprecate = __webpack_require__(370)
  7559. const getPageLinks = __webpack_require__(577)
  7560. function hasPreviousPage (link) {
  7561. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7562. return getPageLinks(link).prev
  7563. }
  7564. /***/ }),
  7565. /***/ 559:
  7566. /***/ (function(__unusedmodule, exports) {
  7567. "use strict";
  7568. Object.defineProperty(exports, "__esModule", { value: true });
  7569. class GitVersion {
  7570. /**
  7571. * Used for comparing the version of git and git-lfs against the minimum required version
  7572. * @param version the version string, e.g. 1.2 or 1.2.3
  7573. */
  7574. constructor(version) {
  7575. this.major = NaN;
  7576. this.minor = NaN;
  7577. this.patch = NaN;
  7578. if (version) {
  7579. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  7580. if (match) {
  7581. this.major = Number(match[1]);
  7582. this.minor = Number(match[2]);
  7583. if (match[4]) {
  7584. this.patch = Number(match[4]);
  7585. }
  7586. }
  7587. }
  7588. }
  7589. /**
  7590. * Compares the instance against a minimum required version
  7591. * @param minimum Minimum version
  7592. */
  7593. checkMinimum(minimum) {
  7594. if (!minimum.isValid()) {
  7595. throw new Error('Arg minimum is not a valid version');
  7596. }
  7597. // Major is insufficient
  7598. if (this.major < minimum.major) {
  7599. return false;
  7600. }
  7601. // Major is equal
  7602. if (this.major === minimum.major) {
  7603. // Minor is insufficient
  7604. if (this.minor < minimum.minor) {
  7605. return false;
  7606. }
  7607. // Minor is equal
  7608. if (this.minor === minimum.minor) {
  7609. // Patch is insufficient
  7610. if (this.patch && this.patch < (minimum.patch || 0)) {
  7611. return false;
  7612. }
  7613. }
  7614. }
  7615. return true;
  7616. }
  7617. /**
  7618. * Indicates whether the instance was constructed from a valid version string
  7619. */
  7620. isValid() {
  7621. return !isNaN(this.major);
  7622. }
  7623. /**
  7624. * Returns the version as a string, e.g. 1.2 or 1.2.3
  7625. */
  7626. toString() {
  7627. let result = '';
  7628. if (this.isValid()) {
  7629. result = `${this.major}.${this.minor}`;
  7630. if (!isNaN(this.patch)) {
  7631. result += `.${this.patch}`;
  7632. }
  7633. }
  7634. return result;
  7635. }
  7636. }
  7637. exports.GitVersion = GitVersion;
  7638. /***/ }),
  7639. /***/ 562:
  7640. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7641. "use strict";
  7642. Object.defineProperty(exports, '__esModule', { value: true });
  7643. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7644. var osName = _interopDefault(__webpack_require__(2));
  7645. function getUserAgent() {
  7646. try {
  7647. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  7648. } catch (error) {
  7649. if (/wmic os get Caption/.test(error.message)) {
  7650. return "Windows <version undetectable>";
  7651. }
  7652. throw error;
  7653. }
  7654. }
  7655. exports.getUserAgent = getUserAgent;
  7656. //# sourceMappingURL=index.js.map
  7657. /***/ }),
  7658. /***/ 563:
  7659. /***/ (function(module, __unusedexports, __webpack_require__) {
  7660. module.exports = getPreviousPage
  7661. const getPage = __webpack_require__(265)
  7662. function getPreviousPage (octokit, link, headers) {
  7663. return getPage(octokit, link, 'prev', headers)
  7664. }
  7665. /***/ }),
  7666. /***/ 568:
  7667. /***/ (function(module, __unusedexports, __webpack_require__) {
  7668. "use strict";
  7669. const path = __webpack_require__(622);
  7670. const niceTry = __webpack_require__(948);
  7671. const resolveCommand = __webpack_require__(489);
  7672. const escape = __webpack_require__(462);
  7673. const readShebang = __webpack_require__(389);
  7674. const semver = __webpack_require__(280);
  7675. const isWin = process.platform === 'win32';
  7676. const isExecutableRegExp = /\.(?:com|exe)$/i;
  7677. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  7678. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  7679. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  7680. function detectShebang(parsed) {
  7681. parsed.file = resolveCommand(parsed);
  7682. const shebang = parsed.file && readShebang(parsed.file);
  7683. if (shebang) {
  7684. parsed.args.unshift(parsed.file);
  7685. parsed.command = shebang;
  7686. return resolveCommand(parsed);
  7687. }
  7688. return parsed.file;
  7689. }
  7690. function parseNonShell(parsed) {
  7691. if (!isWin) {
  7692. return parsed;
  7693. }
  7694. // Detect & add support for shebangs
  7695. const commandFile = detectShebang(parsed);
  7696. // We don't need a shell if the command filename is an executable
  7697. const needsShell = !isExecutableRegExp.test(commandFile);
  7698. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  7699. // Note that `forceShell` is an hidden option used only in tests
  7700. if (parsed.options.forceShell || needsShell) {
  7701. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  7702. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  7703. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  7704. // we need to double escape them
  7705. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  7706. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  7707. // This is necessary otherwise it will always fail with ENOENT in those cases
  7708. parsed.command = path.normalize(parsed.command);
  7709. // Escape command & arguments
  7710. parsed.command = escape.command(parsed.command);
  7711. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  7712. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7713. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7714. parsed.command = process.env.comspec || 'cmd.exe';
  7715. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7716. }
  7717. return parsed;
  7718. }
  7719. function parseShell(parsed) {
  7720. // If node supports the shell option, there's no need to mimic its behavior
  7721. if (supportsShellOption) {
  7722. return parsed;
  7723. }
  7724. // Mimic node shell option
  7725. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  7726. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7727. if (isWin) {
  7728. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  7729. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7730. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7731. } else {
  7732. if (typeof parsed.options.shell === 'string') {
  7733. parsed.command = parsed.options.shell;
  7734. } else if (process.platform === 'android') {
  7735. parsed.command = '/system/bin/sh';
  7736. } else {
  7737. parsed.command = '/bin/sh';
  7738. }
  7739. parsed.args = ['-c', shellCommand];
  7740. }
  7741. return parsed;
  7742. }
  7743. function parse(command, args, options) {
  7744. // Normalize arguments, similar to nodejs
  7745. if (args && !Array.isArray(args)) {
  7746. options = args;
  7747. args = null;
  7748. }
  7749. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  7750. options = Object.assign({}, options); // Clone object to avoid changing the original
  7751. // Build our parsed object
  7752. const parsed = {
  7753. command,
  7754. args,
  7755. options,
  7756. file: undefined,
  7757. original: {
  7758. command,
  7759. args,
  7760. },
  7761. };
  7762. // Delegate further parsing to shell or non-shell
  7763. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  7764. }
  7765. module.exports = parse;
  7766. /***/ }),
  7767. /***/ 577:
  7768. /***/ (function(module) {
  7769. module.exports = getPageLinks
  7770. function getPageLinks (link) {
  7771. link = link.link || link.headers.link || ''
  7772. const links = {}
  7773. // link format:
  7774. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  7775. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  7776. links[type] = uri
  7777. })
  7778. return links
  7779. }
  7780. /***/ }),
  7781. /***/ 586:
  7782. /***/ (function(module, __unusedexports, __webpack_require__) {
  7783. module.exports = octokitRestApiEndpoints;
  7784. const ROUTES = __webpack_require__(705);
  7785. function octokitRestApiEndpoints(octokit) {
  7786. // Aliasing scopes for backward compatibility
  7787. // See https://github.com/octokit/rest.js/pull/1134
  7788. ROUTES.gitdata = ROUTES.git;
  7789. ROUTES.authorization = ROUTES.oauthAuthorizations;
  7790. ROUTES.pullRequests = ROUTES.pulls;
  7791. octokit.registerEndpoints(ROUTES);
  7792. }
  7793. /***/ }),
  7794. /***/ 605:
  7795. /***/ (function(module) {
  7796. module.exports = require("http");
  7797. /***/ }),
  7798. /***/ 613:
  7799. /***/ (function(module, __unusedexports, __webpack_require__) {
  7800. const Octokit = __webpack_require__(529);
  7801. const CORE_PLUGINS = [
  7802. __webpack_require__(372),
  7803. __webpack_require__(19), // deprecated: remove in v17
  7804. __webpack_require__(190),
  7805. __webpack_require__(148),
  7806. __webpack_require__(309),
  7807. __webpack_require__(248),
  7808. __webpack_require__(586),
  7809. __webpack_require__(430),
  7810. __webpack_require__(850) // deprecated: remove in v17
  7811. ];
  7812. module.exports = Octokit.plugin(CORE_PLUGINS);
  7813. /***/ }),
  7814. /***/ 614:
  7815. /***/ (function(module) {
  7816. module.exports = require("events");
  7817. /***/ }),
  7818. /***/ 618:
  7819. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7820. "use strict";
  7821. var __importStar = (this && this.__importStar) || function (mod) {
  7822. if (mod && mod.__esModule) return mod;
  7823. var result = {};
  7824. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7825. result["default"] = mod;
  7826. return result;
  7827. };
  7828. Object.defineProperty(exports, "__esModule", { value: true });
  7829. const fs = __importStar(__webpack_require__(747));
  7830. function directoryExistsSync(path, required) {
  7831. if (!path) {
  7832. throw new Error("Arg 'path' must not be empty");
  7833. }
  7834. let stats;
  7835. try {
  7836. stats = fs.statSync(path);
  7837. }
  7838. catch (error) {
  7839. if (error.code === 'ENOENT') {
  7840. if (!required) {
  7841. return false;
  7842. }
  7843. throw new Error(`Directory '${path}' does not exist`);
  7844. }
  7845. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7846. }
  7847. if (stats.isDirectory()) {
  7848. return true;
  7849. }
  7850. else if (!required) {
  7851. return false;
  7852. }
  7853. throw new Error(`Directory '${path}' does not exist`);
  7854. }
  7855. exports.directoryExistsSync = directoryExistsSync;
  7856. function existsSync(path) {
  7857. if (!path) {
  7858. throw new Error("Arg 'path' must not be empty");
  7859. }
  7860. try {
  7861. fs.statSync(path);
  7862. }
  7863. catch (error) {
  7864. if (error.code === 'ENOENT') {
  7865. return false;
  7866. }
  7867. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7868. }
  7869. return true;
  7870. }
  7871. exports.existsSync = existsSync;
  7872. function fileExistsSync(path) {
  7873. if (!path) {
  7874. throw new Error("Arg 'path' must not be empty");
  7875. }
  7876. let stats;
  7877. try {
  7878. stats = fs.statSync(path);
  7879. }
  7880. catch (error) {
  7881. if (error.code === 'ENOENT') {
  7882. return false;
  7883. }
  7884. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7885. }
  7886. if (!stats.isDirectory()) {
  7887. return true;
  7888. }
  7889. return false;
  7890. }
  7891. exports.fileExistsSync = fileExistsSync;
  7892. /***/ }),
  7893. /***/ 619:
  7894. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7895. "use strict";
  7896. Object.defineProperty(exports, '__esModule', { value: true });
  7897. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7898. var osName = _interopDefault(__webpack_require__(2));
  7899. function getUserAgent() {
  7900. try {
  7901. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  7902. } catch (error) {
  7903. if (/wmic os get Caption/.test(error.message)) {
  7904. return "Windows <version undetectable>";
  7905. }
  7906. throw error;
  7907. }
  7908. }
  7909. exports.getUserAgent = getUserAgent;
  7910. //# sourceMappingURL=index.js.map
  7911. /***/ }),
  7912. /***/ 621:
  7913. /***/ (function(module, __unusedexports, __webpack_require__) {
  7914. "use strict";
  7915. const path = __webpack_require__(622);
  7916. const pathKey = __webpack_require__(39);
  7917. module.exports = opts => {
  7918. opts = Object.assign({
  7919. cwd: process.cwd(),
  7920. path: process.env[pathKey()]
  7921. }, opts);
  7922. let prev;
  7923. let pth = path.resolve(opts.cwd);
  7924. const ret = [];
  7925. while (prev !== pth) {
  7926. ret.push(path.join(pth, 'node_modules/.bin'));
  7927. prev = pth;
  7928. pth = path.resolve(pth, '..');
  7929. }
  7930. // ensure the running `node` binary is used
  7931. ret.push(path.dirname(process.execPath));
  7932. return ret.concat(opts.path).join(path.delimiter);
  7933. };
  7934. module.exports.env = opts => {
  7935. opts = Object.assign({
  7936. env: process.env
  7937. }, opts);
  7938. const env = Object.assign({}, opts.env);
  7939. const path = pathKey({env});
  7940. opts.path = env[path];
  7941. env[path] = module.exports(opts);
  7942. return env;
  7943. };
  7944. /***/ }),
  7945. /***/ 622:
  7946. /***/ (function(module) {
  7947. module.exports = require("path");
  7948. /***/ }),
  7949. /***/ 649:
  7950. /***/ (function(module, __unusedexports, __webpack_require__) {
  7951. module.exports = getLastPage
  7952. const getPage = __webpack_require__(265)
  7953. function getLastPage (octokit, link, headers) {
  7954. return getPage(octokit, link, 'last', headers)
  7955. }
  7956. /***/ }),
  7957. /***/ 654:
  7958. /***/ (function(module) {
  7959. // This is not the set of all possible signals.
  7960. //
  7961. // It IS, however, the set of all signals that trigger
  7962. // an exit on either Linux or BSD systems. Linux is a
  7963. // superset of the signal names supported on BSD, and
  7964. // the unknown signals just fail to register, so we can
  7965. // catch that easily enough.
  7966. //
  7967. // Don't bother with SIGKILL. It's uncatchable, which
  7968. // means that we can't fire any callbacks anyway.
  7969. //
  7970. // If a user does happen to register a handler on a non-
  7971. // fatal signal like SIGWINCH or something, and then
  7972. // exit, it'll end up firing `process.emit('exit')`, so
  7973. // the handler will be fired anyway.
  7974. //
  7975. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  7976. // artificially, inherently leave the process in a
  7977. // state from which it is not safe to try and enter JS
  7978. // listeners.
  7979. module.exports = [
  7980. 'SIGABRT',
  7981. 'SIGALRM',
  7982. 'SIGHUP',
  7983. 'SIGINT',
  7984. 'SIGTERM'
  7985. ]
  7986. if (process.platform !== 'win32') {
  7987. module.exports.push(
  7988. 'SIGVTALRM',
  7989. 'SIGXCPU',
  7990. 'SIGXFSZ',
  7991. 'SIGUSR2',
  7992. 'SIGTRAP',
  7993. 'SIGSYS',
  7994. 'SIGQUIT',
  7995. 'SIGIOT'
  7996. // should detect profiler and enable/disable accordingly.
  7997. // see #21
  7998. // 'SIGPROF'
  7999. )
  8000. }
  8001. if (process.platform === 'linux') {
  8002. module.exports.push(
  8003. 'SIGIO',
  8004. 'SIGPOLL',
  8005. 'SIGPWR',
  8006. 'SIGSTKFLT',
  8007. 'SIGUNUSED'
  8008. )
  8009. }
  8010. /***/ }),
  8011. /***/ 669:
  8012. /***/ (function(module) {
  8013. module.exports = require("util");
  8014. /***/ }),
  8015. /***/ 672:
  8016. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8017. "use strict";
  8018. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8019. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8020. return new (P || (P = Promise))(function (resolve, reject) {
  8021. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8022. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8023. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8024. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8025. });
  8026. };
  8027. var _a;
  8028. Object.defineProperty(exports, "__esModule", { value: true });
  8029. const assert_1 = __webpack_require__(357);
  8030. const fs = __webpack_require__(747);
  8031. const path = __webpack_require__(622);
  8032. _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;
  8033. exports.IS_WINDOWS = process.platform === 'win32';
  8034. function exists(fsPath) {
  8035. return __awaiter(this, void 0, void 0, function* () {
  8036. try {
  8037. yield exports.stat(fsPath);
  8038. }
  8039. catch (err) {
  8040. if (err.code === 'ENOENT') {
  8041. return false;
  8042. }
  8043. throw err;
  8044. }
  8045. return true;
  8046. });
  8047. }
  8048. exports.exists = exists;
  8049. function isDirectory(fsPath, useStat = false) {
  8050. return __awaiter(this, void 0, void 0, function* () {
  8051. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  8052. return stats.isDirectory();
  8053. });
  8054. }
  8055. exports.isDirectory = isDirectory;
  8056. /**
  8057. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  8058. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  8059. */
  8060. function isRooted(p) {
  8061. p = normalizeSeparators(p);
  8062. if (!p) {
  8063. throw new Error('isRooted() parameter "p" cannot be empty');
  8064. }
  8065. if (exports.IS_WINDOWS) {
  8066. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  8067. ); // e.g. C: or C:\hello
  8068. }
  8069. return p.startsWith('/');
  8070. }
  8071. exports.isRooted = isRooted;
  8072. /**
  8073. * Recursively create a directory at `fsPath`.
  8074. *
  8075. * This implementation is optimistic, meaning it attempts to create the full
  8076. * path first, and backs up the path stack from there.
  8077. *
  8078. * @param fsPath The path to create
  8079. * @param maxDepth The maximum recursion depth
  8080. * @param depth The current recursion depth
  8081. */
  8082. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  8083. return __awaiter(this, void 0, void 0, function* () {
  8084. assert_1.ok(fsPath, 'a path argument must be provided');
  8085. fsPath = path.resolve(fsPath);
  8086. if (depth >= maxDepth)
  8087. return exports.mkdir(fsPath);
  8088. try {
  8089. yield exports.mkdir(fsPath);
  8090. return;
  8091. }
  8092. catch (err) {
  8093. switch (err.code) {
  8094. case 'ENOENT': {
  8095. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  8096. yield exports.mkdir(fsPath);
  8097. return;
  8098. }
  8099. default: {
  8100. let stats;
  8101. try {
  8102. stats = yield exports.stat(fsPath);
  8103. }
  8104. catch (err2) {
  8105. throw err;
  8106. }
  8107. if (!stats.isDirectory())
  8108. throw err;
  8109. }
  8110. }
  8111. }
  8112. });
  8113. }
  8114. exports.mkdirP = mkdirP;
  8115. /**
  8116. * Best effort attempt to determine whether a file exists and is executable.
  8117. * @param filePath file path to check
  8118. * @param extensions additional file extensions to try
  8119. * @return if file exists and is executable, returns the file path. otherwise empty string.
  8120. */
  8121. function tryGetExecutablePath(filePath, extensions) {
  8122. return __awaiter(this, void 0, void 0, function* () {
  8123. let stats = undefined;
  8124. try {
  8125. // test file exists
  8126. stats = yield exports.stat(filePath);
  8127. }
  8128. catch (err) {
  8129. if (err.code !== 'ENOENT') {
  8130. // eslint-disable-next-line no-console
  8131. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8132. }
  8133. }
  8134. if (stats && stats.isFile()) {
  8135. if (exports.IS_WINDOWS) {
  8136. // on Windows, test for valid extension
  8137. const upperExt = path.extname(filePath).toUpperCase();
  8138. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  8139. return filePath;
  8140. }
  8141. }
  8142. else {
  8143. if (isUnixExecutable(stats)) {
  8144. return filePath;
  8145. }
  8146. }
  8147. }
  8148. // try each extension
  8149. const originalFilePath = filePath;
  8150. for (const extension of extensions) {
  8151. filePath = originalFilePath + extension;
  8152. stats = undefined;
  8153. try {
  8154. stats = yield exports.stat(filePath);
  8155. }
  8156. catch (err) {
  8157. if (err.code !== 'ENOENT') {
  8158. // eslint-disable-next-line no-console
  8159. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8160. }
  8161. }
  8162. if (stats && stats.isFile()) {
  8163. if (exports.IS_WINDOWS) {
  8164. // preserve the case of the actual file (since an extension was appended)
  8165. try {
  8166. const directory = path.dirname(filePath);
  8167. const upperName = path.basename(filePath).toUpperCase();
  8168. for (const actualName of yield exports.readdir(directory)) {
  8169. if (upperName === actualName.toUpperCase()) {
  8170. filePath = path.join(directory, actualName);
  8171. break;
  8172. }
  8173. }
  8174. }
  8175. catch (err) {
  8176. // eslint-disable-next-line no-console
  8177. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  8178. }
  8179. return filePath;
  8180. }
  8181. else {
  8182. if (isUnixExecutable(stats)) {
  8183. return filePath;
  8184. }
  8185. }
  8186. }
  8187. }
  8188. return '';
  8189. });
  8190. }
  8191. exports.tryGetExecutablePath = tryGetExecutablePath;
  8192. function normalizeSeparators(p) {
  8193. p = p || '';
  8194. if (exports.IS_WINDOWS) {
  8195. // convert slashes on Windows
  8196. p = p.replace(/\//g, '\\');
  8197. // remove redundant slashes
  8198. return p.replace(/\\\\+/g, '\\');
  8199. }
  8200. // remove redundant slashes
  8201. return p.replace(/\/\/+/g, '/');
  8202. }
  8203. // on Mac/Linux, test the execute bit
  8204. // R W X R W X R W X
  8205. // 256 128 64 32 16 8 4 2 1
  8206. function isUnixExecutable(stats) {
  8207. return ((stats.mode & 1) > 0 ||
  8208. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  8209. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  8210. }
  8211. //# sourceMappingURL=io-util.js.map
  8212. /***/ }),
  8213. /***/ 674:
  8214. /***/ (function(module, __unusedexports, __webpack_require__) {
  8215. module.exports = authenticate;
  8216. const { Deprecation } = __webpack_require__(692);
  8217. const once = __webpack_require__(969);
  8218. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  8219. function authenticate(state, options) {
  8220. deprecateAuthenticate(
  8221. state.octokit.log,
  8222. new Deprecation(
  8223. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  8224. )
  8225. );
  8226. if (!options) {
  8227. state.auth = false;
  8228. return;
  8229. }
  8230. switch (options.type) {
  8231. case "basic":
  8232. if (!options.username || !options.password) {
  8233. throw new Error(
  8234. "Basic authentication requires both a username and password to be set"
  8235. );
  8236. }
  8237. break;
  8238. case "oauth":
  8239. if (!options.token && !(options.key && options.secret)) {
  8240. throw new Error(
  8241. "OAuth2 authentication requires a token or key & secret to be set"
  8242. );
  8243. }
  8244. break;
  8245. case "token":
  8246. case "app":
  8247. if (!options.token) {
  8248. throw new Error("Token authentication requires a token to be set");
  8249. }
  8250. break;
  8251. default:
  8252. throw new Error(
  8253. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  8254. );
  8255. }
  8256. state.auth = options;
  8257. }
  8258. /***/ }),
  8259. /***/ 675:
  8260. /***/ (function(module) {
  8261. module.exports = function btoa(str) {
  8262. return new Buffer(str).toString('base64')
  8263. }
  8264. /***/ }),
  8265. /***/ 692:
  8266. /***/ (function(__unusedmodule, exports) {
  8267. "use strict";
  8268. Object.defineProperty(exports, '__esModule', { value: true });
  8269. class Deprecation extends Error {
  8270. constructor(message) {
  8271. super(message); // Maintains proper stack trace (only available on V8)
  8272. /* istanbul ignore next */
  8273. if (Error.captureStackTrace) {
  8274. Error.captureStackTrace(this, this.constructor);
  8275. }
  8276. this.name = 'Deprecation';
  8277. }
  8278. }
  8279. exports.Deprecation = Deprecation;
  8280. /***/ }),
  8281. /***/ 696:
  8282. /***/ (function(module) {
  8283. "use strict";
  8284. /*!
  8285. * isobject <https://github.com/jonschlinkert/isobject>
  8286. *
  8287. * Copyright (c) 2014-2017, Jon Schlinkert.
  8288. * Released under the MIT License.
  8289. */
  8290. function isObject(val) {
  8291. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  8292. }
  8293. /*!
  8294. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  8295. *
  8296. * Copyright (c) 2014-2017, Jon Schlinkert.
  8297. * Released under the MIT License.
  8298. */
  8299. function isObjectObject(o) {
  8300. return isObject(o) === true
  8301. && Object.prototype.toString.call(o) === '[object Object]';
  8302. }
  8303. function isPlainObject(o) {
  8304. var ctor,prot;
  8305. if (isObjectObject(o) === false) return false;
  8306. // If has modified constructor
  8307. ctor = o.constructor;
  8308. if (typeof ctor !== 'function') return false;
  8309. // If has modified prototype
  8310. prot = ctor.prototype;
  8311. if (isObjectObject(prot) === false) return false;
  8312. // If constructor does not have an Object-specific method
  8313. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  8314. return false;
  8315. }
  8316. // Most likely a plain Object
  8317. return true;
  8318. }
  8319. module.exports = isPlainObject;
  8320. /***/ }),
  8321. /***/ 697:
  8322. /***/ (function(module) {
  8323. "use strict";
  8324. module.exports = (promise, onFinally) => {
  8325. onFinally = onFinally || (() => {});
  8326. return promise.then(
  8327. val => new Promise(resolve => {
  8328. resolve(onFinally());
  8329. }).then(() => val),
  8330. err => new Promise(resolve => {
  8331. resolve(onFinally());
  8332. }).then(() => {
  8333. throw err;
  8334. })
  8335. );
  8336. };
  8337. /***/ }),
  8338. /***/ 705:
  8339. /***/ (function(module) {
  8340. module.exports = {"activity":{"checkStarringRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"deleteRepoSubscription":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"deleteThreadSubscription":{"method":"DELETE","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"getRepoSubscription":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"getThread":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"getThreadSubscription":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"listEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/orgs/:org"},"listEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events"},"listFeeds":{"method":"GET","params":{},"url":"/feeds"},"listNotifications":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/notifications"},"listNotificationsForRepo":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"listPublicEvents":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/events"},"listPublicEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/events"},"listPublicEventsForRepoNetwork":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/networks/:owner/:repo/events"},"listPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/public"},"listReceivedEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events"},"listReceivedPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events/public"},"listRepoEvents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/events"},"listReposStarredByAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/user/starred"},"listReposStarredByUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/starred"},"listReposWatchedByUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/subscriptions"},"listStargazersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stargazers"},"listWatchedReposForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/subscriptions"},"listWatchersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscribers"},"markAsRead":{"method":"PUT","params":{"last_read_at":{"type":"string"}},"url":"/notifications"},"markNotificationsAsReadForRepo":{"method":"PUT","params":{"last_read_at":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"markThreadAsRead":{"method":"PATCH","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"setRepoSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"subscribed":{"type":"boolean"}},"url":"/repos/:owner/:repo/subscription"},"setThreadSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"starRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"unstarRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"}},"apps":{"addRepoToInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"PUT","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"checkAccountIsAssociatedWithAny":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/accounts/:account_id"},"checkAccountIsAssociatedWithAnyStubbed":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/accounts/:account_id"},"createContentAttachment":{"headers":{"accept":"application/vnd.github.corsair-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"content_reference_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/content_references/:content_reference_id/attachments"},"createFromManifest":{"headers":{"accept":"application/vnd.github.fury-preview+json"},"method":"POST","params":{"code":{"required":true,"type":"string"}},"url":"/app-manifests/:code/conversions"},"createInstallationToken":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"POST","params":{"installation_id":{"required":true,"type":"integer"},"permissions":{"type":"object"},"repository_ids":{"type":"integer[]"}},"url":"/app/installations/:installation_id/access_tokens"},"deleteInstallation":{"headers":{"accept":"application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"findOrgInstallation":{"deprecated":"octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"findRepoInstallation":{"deprecated":"octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"findUserInstallation":{"deprecated":"octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"getAuthenticated":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{},"url":"/app"},"getBySlug":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"app_slug":{"required":true,"type":"string"}},"url":"/apps/:app_slug"},"getInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"getOrgInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"getRepoInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"getUserInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"listAccountsUserOrOrgOnPlan":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/plans/:plan_id/accounts"},"listAccountsUserOrOrgOnPlanStubbed":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/stubbed/plans/:plan_id/accounts"},"listInstallationReposForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations/:installation_id/repositories"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/app/installations"},"listInstallationsForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations"},"listMarketplacePurchasesForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases"},"listMarketplacePurchasesForAuthenticatedUserStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases/stubbed"},"listPlans":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/plans"},"listPlansStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/plans"},"listRepos":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/installation/repositories"},"removeRepoFromInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"}},"checks":{"create":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"head_sha":{"required":true,"type":"string"},"name":{"required":true,"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs"},"createSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"head_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites"},"get":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"},"getSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id"},"listAnnotations":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id/annotations"},"listForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-runs"},"listForSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"check_suite_id":{"required":true,"type":"integer"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"},"listSuitesForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"app_id":{"type":"integer"},"check_name":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-suites"},"rerequestSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"},"setSuitesPreferences":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"auto_trigger_checks":{"type":"object[]"},"auto_trigger_checks[].app_id":{"required":true,"type":"integer"},"auto_trigger_checks[].setting":{"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/preferences"},"update":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"check_run_id":{"required":true,"type":"integer"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"}},"codesOfConduct":{"getConductCode":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"key":{"required":true,"type":"string"}},"url":"/codes_of_conduct/:key"},"getForRepo":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/code_of_conduct"},"listConductCodes":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{},"url":"/codes_of_conduct"}},"emojis":{"get":{"method":"GET","params":{},"url":"/emojis"}},"gists":{"checkIsStarred":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"create":{"method":"POST","params":{"description":{"type":"string"},"files":{"required":true,"type":"object"},"files.content":{"type":"string"},"public":{"type":"boolean"}},"url":"/gists"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments"},"delete":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"fork":{"method":"POST","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/forks"},"get":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"getRevision":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/gists/:gist_id/:sha"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists"},"listComments":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/comments"},"listCommits":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/commits"},"listForks":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/forks"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/public"},"listPublicForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gists"},"listStarred":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/starred"},"star":{"method":"PUT","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"unstar":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"files":{"type":"object"},"files.content":{"type":"string"},"files.filename":{"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"}},"git":{"createBlob":{"method":"POST","params":{"content":{"required":true,"type":"string"},"encoding":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs"},"createCommit":{"method":"POST","params":{"author":{"type":"object"},"author.date":{"type":"string"},"author.email":{"type":"string"},"author.name":{"type":"string"},"committer":{"type":"object"},"committer.date":{"type":"string"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"parents":{"required":true,"type":"string[]"},"repo":{"required":true,"type":"string"},"signature":{"type":"string"},"tree":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits"},"createRef":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs"},"createTag":{"method":"POST","params":{"message":{"required":true,"type":"string"},"object":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"},"tagger":{"type":"object"},"tagger.date":{"type":"string"},"tagger.email":{"type":"string"},"tagger.name":{"type":"string"},"type":{"enum":["commit","tree","blob"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags"},"createTree":{"method":"POST","params":{"base_tree":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tree":{"required":true,"type":"object[]"},"tree[].content":{"type":"string"},"tree[].mode":{"enum":["100644","100755","040000","160000","120000"],"type":"string"},"tree[].path":{"type":"string"},"tree[].sha":{"type":"string"},"tree[].type":{"enum":["blob","tree","commit"],"type":"string"}},"url":"/repos/:owner/:repo/git/trees"},"deleteRef":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"},"getBlob":{"method":"GET","params":{"file_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs/:file_sha"},"getCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits/:commit_sha"},"getRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"},"getTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags/:tag_sha"},"getTree":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"recursive":{"enum":["1"],"type":"integer"},"repo":{"required":true,"type":"string"},"tree_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/trees/:tree_sha"},"listRefs":{"method":"GET","params":{"namespace":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:namespace"},"updateRef":{"method":"PATCH","params":{"force":{"type":"boolean"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"}},"gitignore":{"getTemplate":{"method":"GET","params":{"name":{"required":true,"type":"string"}},"url":"/gitignore/templates/:name"},"listTemplates":{"method":"GET","params":{},"url":"/gitignore/templates"}},"interactions":{"addOrUpdateRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"addOrUpdateRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"getRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"getRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"removeRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"removeRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"}},"issues":{"addAssignees":{"method":"POST","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"addLabels":{"method":"POST","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"required":true,"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"checkAssignee":{"method":"GET","params":{"assignee":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees/:assignee"},"create":{"method":"POST","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"labels":{"type":"string[]"},"milestone":{"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"createLabel":{"method":"POST","params":{"color":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"createMilestone":{"method":"POST","params":{"description":{"type":"string"},"due_on":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"deleteLabel":{"method":"DELETE","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"deleteMilestone":{"method":"DELETE","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"get":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"getEvent":{"method":"GET","params":{"event_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events/:event_id"},"getLabel":{"method":"GET","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"getMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"list":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/issues"},"listAssignees":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees"},"listComments":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/issues/comments"},"listEvents":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/events"},"listEventsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events"},"listEventsForTimeline":{"headers":{"accept":"application/vnd.github.mockingbird-preview+json"},"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/timeline"},"listForAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/user/issues"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/issues"},"listForRepo":{"method":"GET","params":{"assignee":{"type":"string"},"creator":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"labels":{"type":"string"},"mentioned":{"type":"string"},"milestone":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/issues"},"listLabelsForMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number/labels"},"listLabelsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"listLabelsOnIssue":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"listMilestonesForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["due_on","completeness"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"lock":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"lock_reason":{"enum":["off-topic","too heated","resolved","spam"],"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"removeAssignees":{"method":"DELETE","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"removeLabel":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels/:name"},"removeLabels":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"replaceLabels":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"unlock":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"update":{"method":"PATCH","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"milestone":{"allowNull":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"updateLabel":{"method":"PATCH","params":{"color":{"type":"string"},"current_name":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:current_name"},"updateMilestone":{"method":"PATCH","params":{"description":{"type":"string"},"due_on":{"type":"string"},"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"}},"licenses":{"get":{"method":"GET","params":{"license":{"required":true,"type":"string"}},"url":"/licenses/:license"},"getForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/license"},"list":{"deprecated":"octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)","method":"GET","params":{},"url":"/licenses"},"listCommonlyUsed":{"method":"GET","params":{},"url":"/licenses"}},"markdown":{"render":{"method":"POST","params":{"context":{"type":"string"},"mode":{"enum":["markdown","gfm"],"type":"string"},"text":{"required":true,"type":"string"}},"url":"/markdown"},"renderRaw":{"headers":{"content-type":"text/plain; charset=utf-8"},"method":"POST","params":{"data":{"mapTo":"data","required":true,"type":"string"}},"url":"/markdown/raw"}},"meta":{"get":{"method":"GET","params":{},"url":"/meta"}},"migrations":{"cancelImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"deleteArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"deleteArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"getArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getCommitAuthors":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/large_files"},"getStatusForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id"},"getStatusForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id"},"listForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/migrations"},"listForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations"},"mapCommitAuthor":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"author_id":{"required":true,"type":"integer"},"email":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/authors/:author_id"},"setLfsPreference":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"use_lfs":{"enum":["opt_in","opt_out"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/lfs"},"startForAuthenticatedUser":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"repositories":{"required":true,"type":"string[]"}},"url":"/user/migrations"},"startForOrg":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"org":{"required":true,"type":"string"},"repositories":{"required":true,"type":"string[]"}},"url":"/orgs/:org/migrations"},"startImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tfvc_project":{"type":"string"},"vcs":{"enum":["subversion","git","mercurial","tfvc"],"type":"string"},"vcs_password":{"type":"string"},"vcs_url":{"required":true,"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"},"unlockRepoForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"repo_name":{"required":true,"type":"string"}},"url":"/user/migrations/:migration_id/repos/:repo_name/lock"},"unlockRepoForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"repo_name":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"},"updateImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"vcs_password":{"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"}},"oauthAuthorizations":{"checkAuthorization":{"method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"createAuthorization":{"method":"POST","params":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"fingerprint":{"type":"string"},"note":{"required":true,"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations"},"deleteAuthorization":{"method":"DELETE","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"deleteGrant":{"method":"DELETE","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getAuthorization":{"method":"GET","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"getGrant":{"method":"GET","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getOrCreateAuthorizationForApp":{"method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id"},"getOrCreateAuthorizationForAppAndFingerprint":{"method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"getOrCreateAuthorizationForAppFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"listAuthorizations":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/authorizations"},"listGrants":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/applications/grants"},"resetAuthorization":{"method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeAuthorizationForApplication":{"method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"updateAuthorization":{"method":"PATCH","params":{"add_scopes":{"type":"string[]"},"authorization_id":{"required":true,"type":"integer"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"remove_scopes":{"type":"string[]"},"scopes":{"type":"string[]"}},"url":"/authorizations/:authorization_id"}},"orgs":{"addOrUpdateMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["admin","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"blockUser":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkBlockedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"checkPublicMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"concealMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"convertMemberToOutsideCollaborator":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks"},"createInvitation":{"method":"POST","params":{"email":{"type":"string"},"invitee_id":{"type":"integer"},"org":{"required":true,"type":"string"},"role":{"enum":["admin","direct_member","billing_manager"],"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/orgs/:org/invitations"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"get":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"getMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"getMembershipForAuthenticatedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/organizations"},"listBlockedUsers":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/orgs"},"listForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/orgs"},"listHooks":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/hooks"},"listInvitationTeams":{"method":"GET","params":{"invitation_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations/:invitation_id/teams"},"listMembers":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["all","admin","member"],"type":"string"}},"url":"/orgs/:org/members"},"listMemberships":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["active","pending"],"type":"string"}},"url":"/user/memberships/orgs"},"listOutsideCollaborators":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/outside_collaborators"},"listPendingInvitations":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations"},"listPublicMembers":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/public_members"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id/pings"},"publicizeMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"removeMember":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"removeMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"removeOutsideCollaborator":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"unblockUser":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"update":{"method":"PATCH","params":{"billing_email":{"type":"string"},"company":{"type":"string"},"default_repository_permission":{"enum":["read","write","admin","none"],"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"has_organization_projects":{"type":"boolean"},"has_repository_projects":{"type":"boolean"},"location":{"type":"string"},"members_allowed_repository_creation_type":{"enum":["all","private","none"],"type":"string"},"members_can_create_repositories":{"type":"boolean"},"name":{"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"updateMembership":{"method":"PATCH","params":{"org":{"required":true,"type":"string"},"state":{"enum":["active"],"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"}},"projects":{"addCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"createCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"content_id":{"type":"integer"},"content_type":{"type":"string"},"note":{"type":"string"}},"url":"/projects/columns/:column_id/cards"},"createColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"name":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"createForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"}},"url":"/user/projects"},"createForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/projects"},"createForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/projects"},"delete":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"deleteCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"deleteColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"get":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"getCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"getColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"listCards":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"archived_state":{"enum":["all","archived","not_archived"],"type":"string"},"column_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/projects/columns/:column_id/cards"},"listCollaborators":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/collaborators"},"listColumns":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"listForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/projects"},"listForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/projects"},"listForUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/projects"},"moveCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"card_id":{"required":true,"type":"integer"},"column_id":{"type":"integer"},"position":{"required":true,"type":"string","validation":"^(top|bottom|after:\\d+)$"}},"url":"/projects/columns/cards/:card_id/moves"},"moveColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"position":{"required":true,"type":"string","validation":"^(first|last|after:\\d+)$"}},"url":"/projects/columns/:column_id/moves"},"removeCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"reviewUserPermissionLevel":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username/permission"},"update":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"name":{"type":"string"},"organization_permission":{"type":"string"},"private":{"type":"boolean"},"project_id":{"required":true,"type":"integer"},"state":{"enum":["open","closed"],"type":"string"}},"url":"/projects/:project_id"},"updateCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"archived":{"type":"boolean"},"card_id":{"required":true,"type":"integer"},"note":{"type":"string"}},"url":"/projects/columns/cards/:card_id"},"updateColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"column_id":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"}},"url":"/projects/columns/:column_id"}},"pulls":{"checkIfMerged":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"create":{"method":"POST","params":{"base":{"required":true,"type":"string"},"body":{"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"required":true,"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createCommentReply":{"deprecated":"octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)","method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"required":true,"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createFromIssue":{"deprecated":"octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request","method":"POST","params":{"base":{"required":true,"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"issue":{"required":true,"type":"integer"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createReview":{"method":"POST","params":{"body":{"type":"string"},"comments":{"type":"object[]"},"comments[].body":{"required":true,"type":"string"},"comments[].path":{"required":true,"type":"string"},"comments[].position":{"required":true,"type":"integer"},"commit_id":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"createReviewCommentReply":{"method":"POST","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"},"createReviewRequest":{"method":"POST","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"deletePendingReview":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"deleteReviewRequest":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"dismissReview":{"method":"PUT","params":{"message":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"},"get":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"getCommentsForReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"},"getReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"list":{"method":"GET","params":{"base":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"head":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["created","updated","popularity","long-running"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"listComments":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments"},"listCommits":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/commits"},"listFiles":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/files"},"listReviewRequests":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"listReviews":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"merge":{"method":"PUT","params":{"commit_message":{"type":"string"},"commit_title":{"type":"string"},"merge_method":{"enum":["merge","squash","rebase"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"submitReview":{"method":"POST","params":{"body":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"},"update":{"method":"PATCH","params":{"base":{"type":"string"},"body":{"type":"string"},"maintainer_can_modify":{"type":"boolean"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"updateBranch":{"headers":{"accept":"application/vnd.github.lydian-preview+json"},"method":"PUT","params":{"expected_head_sha":{"type":"string"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/update-branch"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"updateReview":{"method":"PUT","params":{"body":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"}},"rateLimit":{"get":{"method":"GET","params":{},"url":"/rate_limit"}},"reactions":{"createForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"createForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"createForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"createForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"createForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"createForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"delete":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"DELETE","params":{"reaction_id":{"required":true,"type":"integer"}},"url":"/reactions/:reaction_id"},"listForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"listForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"listForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"listForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"listForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"listForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"}},"repos":{"acceptInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"addCollaborator":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"addDeployKey":{"method":"POST","params":{"key":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"read_only":{"type":"boolean"},"repo":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/keys"},"addProtectedBranchAdminEnforcement":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"addProtectedBranchAppRestrictions":{"method":"POST","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"addProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"addProtectedBranchRequiredStatusChecksContexts":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"addProtectedBranchTeamRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"addProtectedBranchUserRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"checkCollaborator":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"checkVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"compareCommits":{"method":"GET","params":{"base":{"required":true,"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/compare/:base...:head"},"createCommitComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_sha":{"required":true,"type":"string"},"line":{"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"type":"string"},"position":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"alias":"commit_sha","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"createDeployment":{"method":"POST","params":{"auto_merge":{"type":"boolean"},"description":{"type":"string"},"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"payload":{"type":"string"},"production_environment":{"type":"boolean"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_contexts":{"type":"string[]"},"task":{"type":"string"},"transient_environment":{"type":"boolean"}},"url":"/repos/:owner/:repo/deployments"},"createDeploymentStatus":{"method":"POST","params":{"auto_inactive":{"type":"boolean"},"deployment_id":{"required":true,"type":"integer"},"description":{"type":"string"},"environment":{"enum":["production","staging","qa"],"type":"string"},"environment_url":{"type":"string"},"log_url":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["error","failure","inactive","in_progress","queued","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"createDispatchEvent":{"headers":{"accept":"application/vnd.github.everest-preview+json"},"method":"POST","params":{"event_type":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/dispatches"},"createFile":{"deprecated":"octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createForAuthenticatedUser":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/user/repos"},"createFork":{"method":"POST","params":{"organization":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/forks"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"createInOrg":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/orgs/:org/repos"},"createOrUpdateFile":{"method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createRelease":{"method":"POST","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"repo":{"required":true,"type":"string"},"tag_name":{"required":true,"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases"},"createStatus":{"method":"POST","params":{"context":{"type":"string"},"description":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"},"state":{"enum":["error","failure","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/statuses/:sha"},"createUsingTemplate":{"headers":{"accept":"application/vnd.github.baptiste-preview+json"},"method":"POST","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"type":"string"},"private":{"type":"boolean"},"template_owner":{"required":true,"type":"string"},"template_repo":{"required":true,"type":"string"}},"url":"/repos/:template_owner/:template_repo/generate"},"declineInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"delete":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"deleteCommitComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"deleteDownload":{"method":"DELETE","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"deleteFile":{"method":"DELETE","params":{"author":{"type":"object"},"author.email":{"type":"string"},"author.name":{"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"deleteInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"deleteRelease":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"deleteReleaseAsset":{"method":"DELETE","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"disableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"disablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"disableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"enableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"enablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"type":"object"},"source.branch":{"enum":["master","gh-pages"],"type":"string"},"source.path":{"type":"string"}},"url":"/repos/:owner/:repo/pages"},"enableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"get":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"getAppsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"getArchiveLink":{"method":"GET","params":{"archive_format":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/:archive_format/:ref"},"getBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch"},"getBranchProtection":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"getClones":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/clones"},"getCodeFrequencyStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/code_frequency"},"getCollaboratorPermissionLevel":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username/permission"},"getCombinedStatusForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/status"},"getCommit":{"method":"GET","params":{"commit_sha":{"alias":"ref","deprecated":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"alias":"ref","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getCommitActivityStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/commit_activity"},"getCommitComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"getCommitRefSha":{"deprecated":"octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit","headers":{"accept":"application/vnd.github.v3.sha"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getContents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"getContributorsStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/contributors"},"getDeployKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"getDeployment":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id"},"getDeploymentStatus":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"},"getDownload":{"method":"GET","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"getLatestPagesBuild":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/latest"},"getLatestRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/latest"},"getPages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"getPagesBuild":{"method":"GET","params":{"build_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/:build_id"},"getParticipationStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/participation"},"getProtectedBranchAdminEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"getProtectedBranchPullRequestReviewEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"getProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"getProtectedBranchRequiredStatusChecks":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"getProtectedBranchRestrictions":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"getPunchCardStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/punch_card"},"getReadme":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/readme"},"getRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"getReleaseAsset":{"method":"GET","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"getReleaseByTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/tags/:tag"},"getTeamsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"getTopPaths":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/paths"},"getTopReferrers":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/referrers"},"getUsersWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"getViews":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/views"},"list":{"method":"GET","params":{"affiliation":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","public","private","member"],"type":"string"},"visibility":{"enum":["all","public","private"],"type":"string"}},"url":"/user/repos"},"listAppsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"listAssetsForRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id/assets"},"listBranches":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"protected":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches"},"listBranchesForHeadCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/branches-where-head"},"listCollaborators":{"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators"},"listCommentsForCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"alias":"commit_sha","deprecated":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"listCommitComments":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments"},"listCommits":{"method":"GET","params":{"author":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"}},"url":"/repos/:owner/:repo/commits"},"listContributors":{"method":"GET","params":{"anon":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contributors"},"listDeployKeys":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys"},"listDeploymentStatuses":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"listDeployments":{"method":"GET","params":{"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"task":{"type":"string"}},"url":"/repos/:owner/:repo/deployments"},"listDownloads":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","public","private","forks","sources","member"],"type":"string"}},"url":"/orgs/:org/repos"},"listForUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/repos"},"listForks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["newest","oldest","stargazers"],"type":"string"}},"url":"/repos/:owner/:repo/forks"},"listHooks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"listInvitations":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations"},"listInvitationsForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/repository_invitations"},"listLanguages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/languages"},"listPagesBuilds":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"listProtectedBranchRequiredStatusChecksContexts":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"listProtectedBranchTeamRestrictions":{"deprecated":"octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listProtectedBranchUserRestrictions":{"deprecated":"octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/repositories"},"listPullRequestsAssociatedWithCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/pulls"},"listReleases":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases"},"listStatusesForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/statuses"},"listTags":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/tags"},"listTeams":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/teams"},"listTeamsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listTopics":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"listUsersWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"merge":{"method":"POST","params":{"base":{"required":true,"type":"string"},"commit_message":{"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/merges"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/pings"},"removeBranchProtection":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"removeCollaborator":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"removeDeployKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"removeProtectedBranchAdminEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"removeProtectedBranchAppRestrictions":{"method":"DELETE","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"removeProtectedBranchPullRequestReviewEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"removeProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"removeProtectedBranchRequiredStatusChecks":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"removeProtectedBranchRequiredStatusChecksContexts":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"removeProtectedBranchRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"removeProtectedBranchTeamRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"removeProtectedBranchUserRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceProtectedBranchAppRestrictions":{"method":"PUT","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"replaceProtectedBranchRequiredStatusChecksContexts":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"replaceProtectedBranchTeamRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"replaceProtectedBranchUserRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceTopics":{"method":"PUT","params":{"names":{"required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"requestPageBuild":{"headers":{"accept":"application/vnd.github.mister-fantastic-preview+json"},"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"retrieveCommunityProfileMetrics":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/profile"},"testPushHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/tests"},"transfer":{"headers":{"accept":"application/vnd.github.nightshade-preview+json"},"method":"POST","params":{"new_owner":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/repos/:owner/:repo/transfer"},"update":{"method":"PATCH","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"archived":{"type":"boolean"},"default_branch":{"type":"string"},"description":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"private":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_pull_request_reviews":{"allowNull":true,"required":true,"type":"object"},"required_pull_request_reviews.dismiss_stale_reviews":{"type":"boolean"},"required_pull_request_reviews.dismissal_restrictions":{"type":"object"},"required_pull_request_reviews.dismissal_restrictions.teams":{"type":"string[]"},"required_pull_request_reviews.dismissal_restrictions.users":{"type":"string[]"},"required_pull_request_reviews.require_code_owner_reviews":{"type":"boolean"},"required_pull_request_reviews.required_approving_review_count":{"type":"integer"},"required_status_checks":{"allowNull":true,"required":true,"type":"object"},"required_status_checks.contexts":{"required":true,"type":"string[]"},"required_status_checks.strict":{"required":true,"type":"boolean"},"restrictions":{"allowNull":true,"required":true,"type":"object"},"restrictions.apps":{"type":"string[]"},"restrictions.teams":{"required":true,"type":"string[]"},"restrictions.users":{"required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"updateCommitComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"updateFile":{"deprecated":"octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"add_events":{"type":"string[]"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"remove_events":{"type":"string[]"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"updateInformationAboutPagesSite":{"method":"PUT","params":{"cname":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"enum":["\"gh-pages\"","\"master\"","\"master /docs\""],"type":"string"}},"url":"/repos/:owner/:repo/pages"},"updateInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"permissions":{"enum":["read","write","admin"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"updateProtectedBranchPullRequestReviewEnforcement":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"dismiss_stale_reviews":{"type":"boolean"},"dismissal_restrictions":{"type":"object"},"dismissal_restrictions.teams":{"type":"string[]"},"dismissal_restrictions.users":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"require_code_owner_reviews":{"type":"boolean"},"required_approving_review_count":{"type":"integer"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"updateProtectedBranchRequiredStatusChecks":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"contexts":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"strict":{"type":"boolean"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"updateRelease":{"method":"PATCH","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"tag_name":{"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"updateReleaseAsset":{"method":"PATCH","params":{"asset_id":{"required":true,"type":"integer"},"label":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"uploadReleaseAsset":{"method":"POST","params":{"file":{"mapTo":"data","required":true,"type":"string | object"},"headers":{"required":true,"type":"object"},"headers.content-length":{"required":true,"type":"integer"},"headers.content-type":{"required":true,"type":"string"},"label":{"type":"string"},"name":{"required":true,"type":"string"},"url":{"required":true,"type":"string"}},"url":":url"}},"search":{"code":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["indexed"],"type":"string"}},"url":"/search/code"},"commits":{"headers":{"accept":"application/vnd.github.cloak-preview+json"},"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["author-date","committer-date"],"type":"string"}},"url":"/search/commits"},"issues":{"deprecated":"octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)","method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"issuesAndPullRequests":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"labels":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"q":{"required":true,"type":"string"},"repository_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/search/labels"},"repos":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["stars","forks","help-wanted-issues","updated"],"type":"string"}},"url":"/search/repositories"},"topics":{"method":"GET","params":{"q":{"required":true,"type":"string"}},"url":"/search/topics"},"users":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["followers","repositories","joined"],"type":"string"}},"url":"/search/users"}},"teams":{"addMember":{"deprecated":"octokit.teams.addMember() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"method":"PUT","params":{"role":{"enum":["member","maintainer"],"type":"string"},"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"addOrUpdateProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"addOrUpdateRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"checkManagesRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"create":{"method":"POST","params":{"description":{"type":"string"},"maintainers":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"repo_names":{"type":"string[]"}},"url":"/orgs/:org/teams"},"createDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/teams/:team_id/discussions"},"createDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"delete":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"get":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getByName":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"getDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"getMember":{"deprecated":"octokit.teams.getMember() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"list":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/teams"},"listChild":{"headers":{"accept":"application/vnd.github.hellcat-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"listDiscussions":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/teams"},"listMembers":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/members"},"listPendingInvitations":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects"},"listRepos":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMember":{"deprecated":"octokit.teams.removeMember() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembership":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"reviewProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"updateDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"},"title":{"type":"string"}},"url":"/teams/:team_id/discussions/:discussion_number"},"updateDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"}},"users":{"addEmails":{"method":"POST","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"block":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkBlocked":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkFollowing":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"checkFollowingForUser":{"method":"GET","params":{"target_user":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following/:target_user"},"createGpgKey":{"method":"POST","params":{"armored_public_key":{"type":"string"}},"url":"/user/gpg_keys"},"createPublicKey":{"method":"POST","params":{"key":{"type":"string"},"title":{"type":"string"}},"url":"/user/keys"},"deleteEmails":{"method":"DELETE","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"deleteGpgKey":{"method":"DELETE","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"deletePublicKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"follow":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"getAuthenticated":{"method":"GET","params":{},"url":"/user"},"getByUsername":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username"},"getContextForUser":{"headers":{"accept":"application/vnd.github.hagar-preview+json"},"method":"GET","params":{"subject_id":{"type":"string"},"subject_type":{"enum":["organization","repository","issue","pull_request"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/hovercard"},"getGpgKey":{"method":"GET","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"getPublicKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/users"},"listBlocked":{"method":"GET","params":{},"url":"/user/blocks"},"listEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/emails"},"listFollowersForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/followers"},"listFollowersForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/followers"},"listFollowingForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/following"},"listFollowingForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following"},"listGpgKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/gpg_keys"},"listGpgKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gpg_keys"},"listPublicEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/public_emails"},"listPublicKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/keys"},"listPublicKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/keys"},"togglePrimaryEmailVisibility":{"method":"PATCH","params":{"email":{"required":true,"type":"string"},"visibility":{"required":true,"type":"string"}},"url":"/user/email/visibility"},"unblock":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"unfollow":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"updateAuthenticated":{"method":"PATCH","params":{"bio":{"type":"string"},"blog":{"type":"string"},"company":{"type":"string"},"email":{"type":"string"},"hireable":{"type":"boolean"},"location":{"type":"string"},"name":{"type":"string"}},"url":"/user"}}};
  8341. /***/ }),
  8342. /***/ 742:
  8343. /***/ (function(module, __unusedexports, __webpack_require__) {
  8344. var fs = __webpack_require__(747)
  8345. var core
  8346. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  8347. core = __webpack_require__(818)
  8348. } else {
  8349. core = __webpack_require__(197)
  8350. }
  8351. module.exports = isexe
  8352. isexe.sync = sync
  8353. function isexe (path, options, cb) {
  8354. if (typeof options === 'function') {
  8355. cb = options
  8356. options = {}
  8357. }
  8358. if (!cb) {
  8359. if (typeof Promise !== 'function') {
  8360. throw new TypeError('callback not provided')
  8361. }
  8362. return new Promise(function (resolve, reject) {
  8363. isexe(path, options || {}, function (er, is) {
  8364. if (er) {
  8365. reject(er)
  8366. } else {
  8367. resolve(is)
  8368. }
  8369. })
  8370. })
  8371. }
  8372. core(path, options || {}, function (er, is) {
  8373. // ignore EACCES because that just means we aren't allowed to run it
  8374. if (er) {
  8375. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  8376. er = null
  8377. is = false
  8378. }
  8379. }
  8380. cb(er, is)
  8381. })
  8382. }
  8383. function sync (path, options) {
  8384. // my kingdom for a filtered catch
  8385. try {
  8386. return core.sync(path, options || {})
  8387. } catch (er) {
  8388. if (options && options.ignoreErrors || er.code === 'EACCES') {
  8389. return false
  8390. } else {
  8391. throw er
  8392. }
  8393. }
  8394. }
  8395. /***/ }),
  8396. /***/ 747:
  8397. /***/ (function(module) {
  8398. module.exports = require("fs");
  8399. /***/ }),
  8400. /***/ 753:
  8401. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8402. "use strict";
  8403. Object.defineProperty(exports, '__esModule', { value: true });
  8404. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8405. var endpoint = __webpack_require__(385);
  8406. var universalUserAgent = __webpack_require__(211);
  8407. var isPlainObject = _interopDefault(__webpack_require__(696));
  8408. var nodeFetch = _interopDefault(__webpack_require__(454));
  8409. var requestError = __webpack_require__(463);
  8410. const VERSION = "0.0.0-development";
  8411. function getBufferResponse(response) {
  8412. return response.arrayBuffer();
  8413. }
  8414. function fetchWrapper(requestOptions) {
  8415. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  8416. requestOptions.body = JSON.stringify(requestOptions.body);
  8417. }
  8418. let headers = {};
  8419. let status;
  8420. let url;
  8421. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  8422. return fetch(requestOptions.url, Object.assign({
  8423. method: requestOptions.method,
  8424. body: requestOptions.body,
  8425. headers: requestOptions.headers,
  8426. redirect: requestOptions.redirect
  8427. }, requestOptions.request)).then(response => {
  8428. url = response.url;
  8429. status = response.status;
  8430. for (const keyAndValue of response.headers) {
  8431. headers[keyAndValue[0]] = keyAndValue[1];
  8432. }
  8433. if (status === 204 || status === 205) {
  8434. return;
  8435. } // GitHub API returns 200 for HEAD requsets
  8436. if (requestOptions.method === "HEAD") {
  8437. if (status < 400) {
  8438. return;
  8439. }
  8440. throw new requestError.RequestError(response.statusText, status, {
  8441. headers,
  8442. request: requestOptions
  8443. });
  8444. }
  8445. if (status === 304) {
  8446. throw new requestError.RequestError("Not modified", status, {
  8447. headers,
  8448. request: requestOptions
  8449. });
  8450. }
  8451. if (status >= 400) {
  8452. return response.text().then(message => {
  8453. const error = new requestError.RequestError(message, status, {
  8454. headers,
  8455. request: requestOptions
  8456. });
  8457. try {
  8458. Object.assign(error, JSON.parse(error.message));
  8459. } catch (e) {// ignore, see octokit/rest.js#684
  8460. }
  8461. throw error;
  8462. });
  8463. }
  8464. const contentType = response.headers.get("content-type");
  8465. if (/application\/json/.test(contentType)) {
  8466. return response.json();
  8467. }
  8468. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  8469. return response.text();
  8470. }
  8471. return getBufferResponse(response);
  8472. }).then(data => {
  8473. return {
  8474. status,
  8475. url,
  8476. headers,
  8477. data
  8478. };
  8479. }).catch(error => {
  8480. if (error instanceof requestError.RequestError) {
  8481. throw error;
  8482. }
  8483. throw new requestError.RequestError(error.message, 500, {
  8484. headers,
  8485. request: requestOptions
  8486. });
  8487. });
  8488. }
  8489. function withDefaults(oldEndpoint, newDefaults) {
  8490. const endpoint = oldEndpoint.defaults(newDefaults);
  8491. const newApi = function (route, parameters) {
  8492. const endpointOptions = endpoint.merge(route, parameters);
  8493. if (!endpointOptions.request || !endpointOptions.request.hook) {
  8494. return fetchWrapper(endpoint.parse(endpointOptions));
  8495. }
  8496. const request = (route, parameters) => {
  8497. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  8498. };
  8499. Object.assign(request, {
  8500. endpoint,
  8501. defaults: withDefaults.bind(null, endpoint)
  8502. });
  8503. return endpointOptions.request.hook(request, endpointOptions);
  8504. };
  8505. return Object.assign(newApi, {
  8506. endpoint,
  8507. defaults: withDefaults.bind(null, endpoint)
  8508. });
  8509. }
  8510. const request = withDefaults(endpoint.endpoint, {
  8511. headers: {
  8512. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  8513. }
  8514. });
  8515. exports.request = request;
  8516. //# sourceMappingURL=index.js.map
  8517. /***/ }),
  8518. /***/ 761:
  8519. /***/ (function(module) {
  8520. module.exports = require("zlib");
  8521. /***/ }),
  8522. /***/ 763:
  8523. /***/ (function(module) {
  8524. module.exports = removeHook
  8525. function removeHook (state, name, method) {
  8526. if (!state.registry[name]) {
  8527. return
  8528. }
  8529. var index = state.registry[name]
  8530. .map(function (registered) { return registered.orig })
  8531. .indexOf(method)
  8532. if (index === -1) {
  8533. return
  8534. }
  8535. state.registry[name].splice(index, 1)
  8536. }
  8537. /***/ }),
  8538. /***/ 768:
  8539. /***/ (function(module) {
  8540. "use strict";
  8541. module.exports = function (x) {
  8542. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  8543. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  8544. if (x[x.length - 1] === lf) {
  8545. x = x.slice(0, x.length - 1);
  8546. }
  8547. if (x[x.length - 1] === cr) {
  8548. x = x.slice(0, x.length - 1);
  8549. }
  8550. return x;
  8551. };
  8552. /***/ }),
  8553. /***/ 777:
  8554. /***/ (function(module, __unusedexports, __webpack_require__) {
  8555. module.exports = getFirstPage
  8556. const getPage = __webpack_require__(265)
  8557. function getFirstPage (octokit, link, headers) {
  8558. return getPage(octokit, link, 'first', headers)
  8559. }
  8560. /***/ }),
  8561. /***/ 807:
  8562. /***/ (function(module, __unusedexports, __webpack_require__) {
  8563. module.exports = paginate;
  8564. const iterator = __webpack_require__(8);
  8565. function paginate(octokit, route, options, mapFn) {
  8566. if (typeof options === "function") {
  8567. mapFn = options;
  8568. options = undefined;
  8569. }
  8570. options = octokit.request.endpoint.merge(route, options);
  8571. return gather(
  8572. octokit,
  8573. [],
  8574. iterator(octokit, options)[Symbol.asyncIterator](),
  8575. mapFn
  8576. );
  8577. }
  8578. function gather(octokit, results, iterator, mapFn) {
  8579. return iterator.next().then(result => {
  8580. if (result.done) {
  8581. return results;
  8582. }
  8583. let earlyExit = false;
  8584. function done() {
  8585. earlyExit = true;
  8586. }
  8587. results = results.concat(
  8588. mapFn ? mapFn(result.value, done) : result.value.data
  8589. );
  8590. if (earlyExit) {
  8591. return results;
  8592. }
  8593. return gather(octokit, results, iterator, mapFn);
  8594. });
  8595. }
  8596. /***/ }),
  8597. /***/ 814:
  8598. /***/ (function(module, __unusedexports, __webpack_require__) {
  8599. module.exports = which
  8600. which.sync = whichSync
  8601. var isWindows = process.platform === 'win32' ||
  8602. process.env.OSTYPE === 'cygwin' ||
  8603. process.env.OSTYPE === 'msys'
  8604. var path = __webpack_require__(622)
  8605. var COLON = isWindows ? ';' : ':'
  8606. var isexe = __webpack_require__(742)
  8607. function getNotFoundError (cmd) {
  8608. var er = new Error('not found: ' + cmd)
  8609. er.code = 'ENOENT'
  8610. return er
  8611. }
  8612. function getPathInfo (cmd, opt) {
  8613. var colon = opt.colon || COLON
  8614. var pathEnv = opt.path || process.env.PATH || ''
  8615. var pathExt = ['']
  8616. pathEnv = pathEnv.split(colon)
  8617. var pathExtExe = ''
  8618. if (isWindows) {
  8619. pathEnv.unshift(process.cwd())
  8620. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  8621. pathExt = pathExtExe.split(colon)
  8622. // Always test the cmd itself first. isexe will check to make sure
  8623. // it's found in the pathExt set.
  8624. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  8625. pathExt.unshift('')
  8626. }
  8627. // If it has a slash, then we don't bother searching the pathenv.
  8628. // just check the file itself, and that's it.
  8629. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  8630. pathEnv = ['']
  8631. return {
  8632. env: pathEnv,
  8633. ext: pathExt,
  8634. extExe: pathExtExe
  8635. }
  8636. }
  8637. function which (cmd, opt, cb) {
  8638. if (typeof opt === 'function') {
  8639. cb = opt
  8640. opt = {}
  8641. }
  8642. var info = getPathInfo(cmd, opt)
  8643. var pathEnv = info.env
  8644. var pathExt = info.ext
  8645. var pathExtExe = info.extExe
  8646. var found = []
  8647. ;(function F (i, l) {
  8648. if (i === l) {
  8649. if (opt.all && found.length)
  8650. return cb(null, found)
  8651. else
  8652. return cb(getNotFoundError(cmd))
  8653. }
  8654. var pathPart = pathEnv[i]
  8655. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8656. pathPart = pathPart.slice(1, -1)
  8657. var p = path.join(pathPart, cmd)
  8658. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  8659. p = cmd.slice(0, 2) + p
  8660. }
  8661. ;(function E (ii, ll) {
  8662. if (ii === ll) return F(i + 1, l)
  8663. var ext = pathExt[ii]
  8664. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  8665. if (!er && is) {
  8666. if (opt.all)
  8667. found.push(p + ext)
  8668. else
  8669. return cb(null, p + ext)
  8670. }
  8671. return E(ii + 1, ll)
  8672. })
  8673. })(0, pathExt.length)
  8674. })(0, pathEnv.length)
  8675. }
  8676. function whichSync (cmd, opt) {
  8677. opt = opt || {}
  8678. var info = getPathInfo(cmd, opt)
  8679. var pathEnv = info.env
  8680. var pathExt = info.ext
  8681. var pathExtExe = info.extExe
  8682. var found = []
  8683. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  8684. var pathPart = pathEnv[i]
  8685. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8686. pathPart = pathPart.slice(1, -1)
  8687. var p = path.join(pathPart, cmd)
  8688. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  8689. p = cmd.slice(0, 2) + p
  8690. }
  8691. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  8692. var cur = p + pathExt[j]
  8693. var is
  8694. try {
  8695. is = isexe.sync(cur, { pathExt: pathExtExe })
  8696. if (is) {
  8697. if (opt.all)
  8698. found.push(cur)
  8699. else
  8700. return cur
  8701. }
  8702. } catch (ex) {}
  8703. }
  8704. }
  8705. if (opt.all && found.length)
  8706. return found
  8707. if (opt.nothrow)
  8708. return null
  8709. throw getNotFoundError(cmd)
  8710. }
  8711. /***/ }),
  8712. /***/ 816:
  8713. /***/ (function(module) {
  8714. "use strict";
  8715. module.exports = /^#!.*/;
  8716. /***/ }),
  8717. /***/ 818:
  8718. /***/ (function(module, __unusedexports, __webpack_require__) {
  8719. module.exports = isexe
  8720. isexe.sync = sync
  8721. var fs = __webpack_require__(747)
  8722. function checkPathExt (path, options) {
  8723. var pathext = options.pathExt !== undefined ?
  8724. options.pathExt : process.env.PATHEXT
  8725. if (!pathext) {
  8726. return true
  8727. }
  8728. pathext = pathext.split(';')
  8729. if (pathext.indexOf('') !== -1) {
  8730. return true
  8731. }
  8732. for (var i = 0; i < pathext.length; i++) {
  8733. var p = pathext[i].toLowerCase()
  8734. if (p && path.substr(-p.length).toLowerCase() === p) {
  8735. return true
  8736. }
  8737. }
  8738. return false
  8739. }
  8740. function checkStat (stat, path, options) {
  8741. if (!stat.isSymbolicLink() && !stat.isFile()) {
  8742. return false
  8743. }
  8744. return checkPathExt(path, options)
  8745. }
  8746. function isexe (path, options, cb) {
  8747. fs.stat(path, function (er, stat) {
  8748. cb(er, er ? false : checkStat(stat, path, options))
  8749. })
  8750. }
  8751. function sync (path, options) {
  8752. return checkStat(fs.statSync(path), path, options)
  8753. }
  8754. /***/ }),
  8755. /***/ 821:
  8756. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8757. "use strict";
  8758. var __importStar = (this && this.__importStar) || function (mod) {
  8759. if (mod && mod.__esModule) return mod;
  8760. var result = {};
  8761. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8762. result["default"] = mod;
  8763. return result;
  8764. };
  8765. Object.defineProperty(exports, "__esModule", { value: true });
  8766. const core = __importStar(__webpack_require__(470));
  8767. const fsHelper = __importStar(__webpack_require__(618));
  8768. const github = __importStar(__webpack_require__(469));
  8769. const path = __importStar(__webpack_require__(622));
  8770. function getInputs() {
  8771. const result = {};
  8772. // GitHub workspace
  8773. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  8774. if (!githubWorkspacePath) {
  8775. throw new Error('GITHUB_WORKSPACE not defined');
  8776. }
  8777. githubWorkspacePath = path.resolve(githubWorkspacePath);
  8778. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  8779. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  8780. // Qualified repository
  8781. const qualifiedRepository = core.getInput('repository') ||
  8782. `${github.context.repo.owner}/${github.context.repo.repo}`;
  8783. core.debug(`qualified repository = '${qualifiedRepository}'`);
  8784. const splitRepository = qualifiedRepository.split('/');
  8785. if (splitRepository.length !== 2 ||
  8786. !splitRepository[0] ||
  8787. !splitRepository[1]) {
  8788. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  8789. }
  8790. result.repositoryOwner = splitRepository[0];
  8791. result.repositoryName = splitRepository[1];
  8792. // Repository path
  8793. result.repositoryPath = core.getInput('path') || '.';
  8794. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  8795. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  8796. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  8797. }
  8798. // Workflow repository?
  8799. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  8800. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  8801. // Source branch, source version
  8802. result.ref = core.getInput('ref');
  8803. if (!result.ref) {
  8804. if (isWorkflowRepository) {
  8805. result.ref = github.context.ref;
  8806. result.commit = github.context.sha;
  8807. }
  8808. if (!result.ref && !result.commit) {
  8809. result.ref = 'refs/heads/master';
  8810. }
  8811. }
  8812. // SHA?
  8813. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  8814. result.commit = result.ref;
  8815. result.ref = '';
  8816. }
  8817. core.debug(`ref = '${result.ref}'`);
  8818. core.debug(`commit = '${result.commit}'`);
  8819. // Clean
  8820. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  8821. core.debug(`clean = ${result.clean}`);
  8822. // Submodules
  8823. if (core.getInput('submodules')) {
  8824. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  8825. }
  8826. // Fetch depth
  8827. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  8828. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  8829. result.fetchDepth = 0;
  8830. }
  8831. core.debug(`fetch depth = ${result.fetchDepth}`);
  8832. // LFS
  8833. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  8834. core.debug(`lfs = ${result.lfs}`);
  8835. // Access token
  8836. result.accessToken = core.getInput('token');
  8837. return result;
  8838. }
  8839. exports.getInputs = getInputs;
  8840. /***/ }),
  8841. /***/ 835:
  8842. /***/ (function(module) {
  8843. module.exports = require("url");
  8844. /***/ }),
  8845. /***/ 850:
  8846. /***/ (function(module, __unusedexports, __webpack_require__) {
  8847. module.exports = paginationMethodsPlugin
  8848. function paginationMethodsPlugin (octokit) {
  8849. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  8850. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  8851. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  8852. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  8853. octokit.hasFirstPage = __webpack_require__(536)
  8854. octokit.hasLastPage = __webpack_require__(336)
  8855. octokit.hasNextPage = __webpack_require__(929)
  8856. octokit.hasPreviousPage = __webpack_require__(558)
  8857. }
  8858. /***/ }),
  8859. /***/ 854:
  8860. /***/ (function(module) {
  8861. /**
  8862. * lodash (Custom Build) <https://lodash.com/>
  8863. * Build: `lodash modularize exports="npm" -o ./`
  8864. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8865. * Released under MIT license <https://lodash.com/license>
  8866. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8867. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8868. */
  8869. /** Used as the `TypeError` message for "Functions" methods. */
  8870. var FUNC_ERROR_TEXT = 'Expected a function';
  8871. /** Used to stand-in for `undefined` hash values. */
  8872. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8873. /** Used as references for various `Number` constants. */
  8874. var INFINITY = 1 / 0;
  8875. /** `Object#toString` result references. */
  8876. var funcTag = '[object Function]',
  8877. genTag = '[object GeneratorFunction]',
  8878. symbolTag = '[object Symbol]';
  8879. /** Used to match property names within property paths. */
  8880. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8881. reIsPlainProp = /^\w*$/,
  8882. reLeadingDot = /^\./,
  8883. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8884. /**
  8885. * Used to match `RegExp`
  8886. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8887. */
  8888. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8889. /** Used to match backslashes in property paths. */
  8890. var reEscapeChar = /\\(\\)?/g;
  8891. /** Used to detect host constructors (Safari). */
  8892. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8893. /** Detect free variable `global` from Node.js. */
  8894. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  8895. /** Detect free variable `self`. */
  8896. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8897. /** Used as a reference to the global object. */
  8898. var root = freeGlobal || freeSelf || Function('return this')();
  8899. /**
  8900. * Gets the value at `key` of `object`.
  8901. *
  8902. * @private
  8903. * @param {Object} [object] The object to query.
  8904. * @param {string} key The key of the property to get.
  8905. * @returns {*} Returns the property value.
  8906. */
  8907. function getValue(object, key) {
  8908. return object == null ? undefined : object[key];
  8909. }
  8910. /**
  8911. * Checks if `value` is a host object in IE < 9.
  8912. *
  8913. * @private
  8914. * @param {*} value The value to check.
  8915. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  8916. */
  8917. function isHostObject(value) {
  8918. // Many host objects are `Object` objects that can coerce to strings
  8919. // despite having improperly defined `toString` methods.
  8920. var result = false;
  8921. if (value != null && typeof value.toString != 'function') {
  8922. try {
  8923. result = !!(value + '');
  8924. } catch (e) {}
  8925. }
  8926. return result;
  8927. }
  8928. /** Used for built-in method references. */
  8929. var arrayProto = Array.prototype,
  8930. funcProto = Function.prototype,
  8931. objectProto = Object.prototype;
  8932. /** Used to detect overreaching core-js shims. */
  8933. var coreJsData = root['__core-js_shared__'];
  8934. /** Used to detect methods masquerading as native. */
  8935. var maskSrcKey = (function() {
  8936. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8937. return uid ? ('Symbol(src)_1.' + uid) : '';
  8938. }());
  8939. /** Used to resolve the decompiled source of functions. */
  8940. var funcToString = funcProto.toString;
  8941. /** Used to check objects for own properties. */
  8942. var hasOwnProperty = objectProto.hasOwnProperty;
  8943. /**
  8944. * Used to resolve the
  8945. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8946. * of values.
  8947. */
  8948. var objectToString = objectProto.toString;
  8949. /** Used to detect if a method is native. */
  8950. var reIsNative = RegExp('^' +
  8951. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8952. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8953. );
  8954. /** Built-in value references. */
  8955. var Symbol = root.Symbol,
  8956. splice = arrayProto.splice;
  8957. /* Built-in method references that are verified to be native. */
  8958. var Map = getNative(root, 'Map'),
  8959. nativeCreate = getNative(Object, 'create');
  8960. /** Used to convert symbols to primitives and strings. */
  8961. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8962. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8963. /**
  8964. * Creates a hash object.
  8965. *
  8966. * @private
  8967. * @constructor
  8968. * @param {Array} [entries] The key-value pairs to cache.
  8969. */
  8970. function Hash(entries) {
  8971. var index = -1,
  8972. length = entries ? entries.length : 0;
  8973. this.clear();
  8974. while (++index < length) {
  8975. var entry = entries[index];
  8976. this.set(entry[0], entry[1]);
  8977. }
  8978. }
  8979. /**
  8980. * Removes all key-value entries from the hash.
  8981. *
  8982. * @private
  8983. * @name clear
  8984. * @memberOf Hash
  8985. */
  8986. function hashClear() {
  8987. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8988. }
  8989. /**
  8990. * Removes `key` and its value from the hash.
  8991. *
  8992. * @private
  8993. * @name delete
  8994. * @memberOf Hash
  8995. * @param {Object} hash The hash to modify.
  8996. * @param {string} key The key of the value to remove.
  8997. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8998. */
  8999. function hashDelete(key) {
  9000. return this.has(key) && delete this.__data__[key];
  9001. }
  9002. /**
  9003. * Gets the hash value for `key`.
  9004. *
  9005. * @private
  9006. * @name get
  9007. * @memberOf Hash
  9008. * @param {string} key The key of the value to get.
  9009. * @returns {*} Returns the entry value.
  9010. */
  9011. function hashGet(key) {
  9012. var data = this.__data__;
  9013. if (nativeCreate) {
  9014. var result = data[key];
  9015. return result === HASH_UNDEFINED ? undefined : result;
  9016. }
  9017. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  9018. }
  9019. /**
  9020. * Checks if a hash value for `key` exists.
  9021. *
  9022. * @private
  9023. * @name has
  9024. * @memberOf Hash
  9025. * @param {string} key The key of the entry to check.
  9026. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9027. */
  9028. function hashHas(key) {
  9029. var data = this.__data__;
  9030. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  9031. }
  9032. /**
  9033. * Sets the hash `key` to `value`.
  9034. *
  9035. * @private
  9036. * @name set
  9037. * @memberOf Hash
  9038. * @param {string} key The key of the value to set.
  9039. * @param {*} value The value to set.
  9040. * @returns {Object} Returns the hash instance.
  9041. */
  9042. function hashSet(key, value) {
  9043. var data = this.__data__;
  9044. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  9045. return this;
  9046. }
  9047. // Add methods to `Hash`.
  9048. Hash.prototype.clear = hashClear;
  9049. Hash.prototype['delete'] = hashDelete;
  9050. Hash.prototype.get = hashGet;
  9051. Hash.prototype.has = hashHas;
  9052. Hash.prototype.set = hashSet;
  9053. /**
  9054. * Creates an list cache object.
  9055. *
  9056. * @private
  9057. * @constructor
  9058. * @param {Array} [entries] The key-value pairs to cache.
  9059. */
  9060. function ListCache(entries) {
  9061. var index = -1,
  9062. length = entries ? entries.length : 0;
  9063. this.clear();
  9064. while (++index < length) {
  9065. var entry = entries[index];
  9066. this.set(entry[0], entry[1]);
  9067. }
  9068. }
  9069. /**
  9070. * Removes all key-value entries from the list cache.
  9071. *
  9072. * @private
  9073. * @name clear
  9074. * @memberOf ListCache
  9075. */
  9076. function listCacheClear() {
  9077. this.__data__ = [];
  9078. }
  9079. /**
  9080. * Removes `key` and its value from the list cache.
  9081. *
  9082. * @private
  9083. * @name delete
  9084. * @memberOf ListCache
  9085. * @param {string} key The key of the value to remove.
  9086. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9087. */
  9088. function listCacheDelete(key) {
  9089. var data = this.__data__,
  9090. index = assocIndexOf(data, key);
  9091. if (index < 0) {
  9092. return false;
  9093. }
  9094. var lastIndex = data.length - 1;
  9095. if (index == lastIndex) {
  9096. data.pop();
  9097. } else {
  9098. splice.call(data, index, 1);
  9099. }
  9100. return true;
  9101. }
  9102. /**
  9103. * Gets the list cache value for `key`.
  9104. *
  9105. * @private
  9106. * @name get
  9107. * @memberOf ListCache
  9108. * @param {string} key The key of the value to get.
  9109. * @returns {*} Returns the entry value.
  9110. */
  9111. function listCacheGet(key) {
  9112. var data = this.__data__,
  9113. index = assocIndexOf(data, key);
  9114. return index < 0 ? undefined : data[index][1];
  9115. }
  9116. /**
  9117. * Checks if a list cache value for `key` exists.
  9118. *
  9119. * @private
  9120. * @name has
  9121. * @memberOf ListCache
  9122. * @param {string} key The key of the entry to check.
  9123. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9124. */
  9125. function listCacheHas(key) {
  9126. return assocIndexOf(this.__data__, key) > -1;
  9127. }
  9128. /**
  9129. * Sets the list cache `key` to `value`.
  9130. *
  9131. * @private
  9132. * @name set
  9133. * @memberOf ListCache
  9134. * @param {string} key The key of the value to set.
  9135. * @param {*} value The value to set.
  9136. * @returns {Object} Returns the list cache instance.
  9137. */
  9138. function listCacheSet(key, value) {
  9139. var data = this.__data__,
  9140. index = assocIndexOf(data, key);
  9141. if (index < 0) {
  9142. data.push([key, value]);
  9143. } else {
  9144. data[index][1] = value;
  9145. }
  9146. return this;
  9147. }
  9148. // Add methods to `ListCache`.
  9149. ListCache.prototype.clear = listCacheClear;
  9150. ListCache.prototype['delete'] = listCacheDelete;
  9151. ListCache.prototype.get = listCacheGet;
  9152. ListCache.prototype.has = listCacheHas;
  9153. ListCache.prototype.set = listCacheSet;
  9154. /**
  9155. * Creates a map cache object to store key-value pairs.
  9156. *
  9157. * @private
  9158. * @constructor
  9159. * @param {Array} [entries] The key-value pairs to cache.
  9160. */
  9161. function MapCache(entries) {
  9162. var index = -1,
  9163. length = entries ? entries.length : 0;
  9164. this.clear();
  9165. while (++index < length) {
  9166. var entry = entries[index];
  9167. this.set(entry[0], entry[1]);
  9168. }
  9169. }
  9170. /**
  9171. * Removes all key-value entries from the map.
  9172. *
  9173. * @private
  9174. * @name clear
  9175. * @memberOf MapCache
  9176. */
  9177. function mapCacheClear() {
  9178. this.__data__ = {
  9179. 'hash': new Hash,
  9180. 'map': new (Map || ListCache),
  9181. 'string': new Hash
  9182. };
  9183. }
  9184. /**
  9185. * Removes `key` and its value from the map.
  9186. *
  9187. * @private
  9188. * @name delete
  9189. * @memberOf MapCache
  9190. * @param {string} key The key of the value to remove.
  9191. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9192. */
  9193. function mapCacheDelete(key) {
  9194. return getMapData(this, key)['delete'](key);
  9195. }
  9196. /**
  9197. * Gets the map value for `key`.
  9198. *
  9199. * @private
  9200. * @name get
  9201. * @memberOf MapCache
  9202. * @param {string} key The key of the value to get.
  9203. * @returns {*} Returns the entry value.
  9204. */
  9205. function mapCacheGet(key) {
  9206. return getMapData(this, key).get(key);
  9207. }
  9208. /**
  9209. * Checks if a map value for `key` exists.
  9210. *
  9211. * @private
  9212. * @name has
  9213. * @memberOf MapCache
  9214. * @param {string} key The key of the entry to check.
  9215. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9216. */
  9217. function mapCacheHas(key) {
  9218. return getMapData(this, key).has(key);
  9219. }
  9220. /**
  9221. * Sets the map `key` to `value`.
  9222. *
  9223. * @private
  9224. * @name set
  9225. * @memberOf MapCache
  9226. * @param {string} key The key of the value to set.
  9227. * @param {*} value The value to set.
  9228. * @returns {Object} Returns the map cache instance.
  9229. */
  9230. function mapCacheSet(key, value) {
  9231. getMapData(this, key).set(key, value);
  9232. return this;
  9233. }
  9234. // Add methods to `MapCache`.
  9235. MapCache.prototype.clear = mapCacheClear;
  9236. MapCache.prototype['delete'] = mapCacheDelete;
  9237. MapCache.prototype.get = mapCacheGet;
  9238. MapCache.prototype.has = mapCacheHas;
  9239. MapCache.prototype.set = mapCacheSet;
  9240. /**
  9241. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9242. *
  9243. * @private
  9244. * @param {Array} array The array to inspect.
  9245. * @param {*} key The key to search for.
  9246. * @returns {number} Returns the index of the matched value, else `-1`.
  9247. */
  9248. function assocIndexOf(array, key) {
  9249. var length = array.length;
  9250. while (length--) {
  9251. if (eq(array[length][0], key)) {
  9252. return length;
  9253. }
  9254. }
  9255. return -1;
  9256. }
  9257. /**
  9258. * The base implementation of `_.get` without support for default values.
  9259. *
  9260. * @private
  9261. * @param {Object} object The object to query.
  9262. * @param {Array|string} path The path of the property to get.
  9263. * @returns {*} Returns the resolved value.
  9264. */
  9265. function baseGet(object, path) {
  9266. path = isKey(path, object) ? [path] : castPath(path);
  9267. var index = 0,
  9268. length = path.length;
  9269. while (object != null && index < length) {
  9270. object = object[toKey(path[index++])];
  9271. }
  9272. return (index && index == length) ? object : undefined;
  9273. }
  9274. /**
  9275. * The base implementation of `_.isNative` without bad shim checks.
  9276. *
  9277. * @private
  9278. * @param {*} value The value to check.
  9279. * @returns {boolean} Returns `true` if `value` is a native function,
  9280. * else `false`.
  9281. */
  9282. function baseIsNative(value) {
  9283. if (!isObject(value) || isMasked(value)) {
  9284. return false;
  9285. }
  9286. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  9287. return pattern.test(toSource(value));
  9288. }
  9289. /**
  9290. * The base implementation of `_.toString` which doesn't convert nullish
  9291. * values to empty strings.
  9292. *
  9293. * @private
  9294. * @param {*} value The value to process.
  9295. * @returns {string} Returns the string.
  9296. */
  9297. function baseToString(value) {
  9298. // Exit early for strings to avoid a performance hit in some environments.
  9299. if (typeof value == 'string') {
  9300. return value;
  9301. }
  9302. if (isSymbol(value)) {
  9303. return symbolToString ? symbolToString.call(value) : '';
  9304. }
  9305. var result = (value + '');
  9306. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9307. }
  9308. /**
  9309. * Casts `value` to a path array if it's not one.
  9310. *
  9311. * @private
  9312. * @param {*} value The value to inspect.
  9313. * @returns {Array} Returns the cast property path array.
  9314. */
  9315. function castPath(value) {
  9316. return isArray(value) ? value : stringToPath(value);
  9317. }
  9318. /**
  9319. * Gets the data for `map`.
  9320. *
  9321. * @private
  9322. * @param {Object} map The map to query.
  9323. * @param {string} key The reference key.
  9324. * @returns {*} Returns the map data.
  9325. */
  9326. function getMapData(map, key) {
  9327. var data = map.__data__;
  9328. return isKeyable(key)
  9329. ? data[typeof key == 'string' ? 'string' : 'hash']
  9330. : data.map;
  9331. }
  9332. /**
  9333. * Gets the native function at `key` of `object`.
  9334. *
  9335. * @private
  9336. * @param {Object} object The object to query.
  9337. * @param {string} key The key of the method to get.
  9338. * @returns {*} Returns the function if it's native, else `undefined`.
  9339. */
  9340. function getNative(object, key) {
  9341. var value = getValue(object, key);
  9342. return baseIsNative(value) ? value : undefined;
  9343. }
  9344. /**
  9345. * Checks if `value` is a property name and not a property path.
  9346. *
  9347. * @private
  9348. * @param {*} value The value to check.
  9349. * @param {Object} [object] The object to query keys on.
  9350. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9351. */
  9352. function isKey(value, object) {
  9353. if (isArray(value)) {
  9354. return false;
  9355. }
  9356. var type = typeof value;
  9357. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  9358. value == null || isSymbol(value)) {
  9359. return true;
  9360. }
  9361. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  9362. (object != null && value in Object(object));
  9363. }
  9364. /**
  9365. * Checks if `value` is suitable for use as unique object key.
  9366. *
  9367. * @private
  9368. * @param {*} value The value to check.
  9369. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  9370. */
  9371. function isKeyable(value) {
  9372. var type = typeof value;
  9373. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  9374. ? (value !== '__proto__')
  9375. : (value === null);
  9376. }
  9377. /**
  9378. * Checks if `func` has its source masked.
  9379. *
  9380. * @private
  9381. * @param {Function} func The function to check.
  9382. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  9383. */
  9384. function isMasked(func) {
  9385. return !!maskSrcKey && (maskSrcKey in func);
  9386. }
  9387. /**
  9388. * Converts `string` to a property path array.
  9389. *
  9390. * @private
  9391. * @param {string} string The string to convert.
  9392. * @returns {Array} Returns the property path array.
  9393. */
  9394. var stringToPath = memoize(function(string) {
  9395. string = toString(string);
  9396. var result = [];
  9397. if (reLeadingDot.test(string)) {
  9398. result.push('');
  9399. }
  9400. string.replace(rePropName, function(match, number, quote, string) {
  9401. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  9402. });
  9403. return result;
  9404. });
  9405. /**
  9406. * Converts `value` to a string key if it's not a string or symbol.
  9407. *
  9408. * @private
  9409. * @param {*} value The value to inspect.
  9410. * @returns {string|symbol} Returns the key.
  9411. */
  9412. function toKey(value) {
  9413. if (typeof value == 'string' || isSymbol(value)) {
  9414. return value;
  9415. }
  9416. var result = (value + '');
  9417. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9418. }
  9419. /**
  9420. * Converts `func` to its source code.
  9421. *
  9422. * @private
  9423. * @param {Function} func The function to process.
  9424. * @returns {string} Returns the source code.
  9425. */
  9426. function toSource(func) {
  9427. if (func != null) {
  9428. try {
  9429. return funcToString.call(func);
  9430. } catch (e) {}
  9431. try {
  9432. return (func + '');
  9433. } catch (e) {}
  9434. }
  9435. return '';
  9436. }
  9437. /**
  9438. * Creates a function that memoizes the result of `func`. If `resolver` is
  9439. * provided, it determines the cache key for storing the result based on the
  9440. * arguments provided to the memoized function. By default, the first argument
  9441. * provided to the memoized function is used as the map cache key. The `func`
  9442. * is invoked with the `this` binding of the memoized function.
  9443. *
  9444. * **Note:** The cache is exposed as the `cache` property on the memoized
  9445. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  9446. * constructor with one whose instances implement the
  9447. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  9448. * method interface of `delete`, `get`, `has`, and `set`.
  9449. *
  9450. * @static
  9451. * @memberOf _
  9452. * @since 0.1.0
  9453. * @category Function
  9454. * @param {Function} func The function to have its output memoized.
  9455. * @param {Function} [resolver] The function to resolve the cache key.
  9456. * @returns {Function} Returns the new memoized function.
  9457. * @example
  9458. *
  9459. * var object = { 'a': 1, 'b': 2 };
  9460. * var other = { 'c': 3, 'd': 4 };
  9461. *
  9462. * var values = _.memoize(_.values);
  9463. * values(object);
  9464. * // => [1, 2]
  9465. *
  9466. * values(other);
  9467. * // => [3, 4]
  9468. *
  9469. * object.a = 2;
  9470. * values(object);
  9471. * // => [1, 2]
  9472. *
  9473. * // Modify the result cache.
  9474. * values.cache.set(object, ['a', 'b']);
  9475. * values(object);
  9476. * // => ['a', 'b']
  9477. *
  9478. * // Replace `_.memoize.Cache`.
  9479. * _.memoize.Cache = WeakMap;
  9480. */
  9481. function memoize(func, resolver) {
  9482. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  9483. throw new TypeError(FUNC_ERROR_TEXT);
  9484. }
  9485. var memoized = function() {
  9486. var args = arguments,
  9487. key = resolver ? resolver.apply(this, args) : args[0],
  9488. cache = memoized.cache;
  9489. if (cache.has(key)) {
  9490. return cache.get(key);
  9491. }
  9492. var result = func.apply(this, args);
  9493. memoized.cache = cache.set(key, result);
  9494. return result;
  9495. };
  9496. memoized.cache = new (memoize.Cache || MapCache);
  9497. return memoized;
  9498. }
  9499. // Assign cache to `_.memoize`.
  9500. memoize.Cache = MapCache;
  9501. /**
  9502. * Performs a
  9503. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9504. * comparison between two values to determine if they are equivalent.
  9505. *
  9506. * @static
  9507. * @memberOf _
  9508. * @since 4.0.0
  9509. * @category Lang
  9510. * @param {*} value The value to compare.
  9511. * @param {*} other The other value to compare.
  9512. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9513. * @example
  9514. *
  9515. * var object = { 'a': 1 };
  9516. * var other = { 'a': 1 };
  9517. *
  9518. * _.eq(object, object);
  9519. * // => true
  9520. *
  9521. * _.eq(object, other);
  9522. * // => false
  9523. *
  9524. * _.eq('a', 'a');
  9525. * // => true
  9526. *
  9527. * _.eq('a', Object('a'));
  9528. * // => false
  9529. *
  9530. * _.eq(NaN, NaN);
  9531. * // => true
  9532. */
  9533. function eq(value, other) {
  9534. return value === other || (value !== value && other !== other);
  9535. }
  9536. /**
  9537. * Checks if `value` is classified as an `Array` object.
  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 array, else `false`.
  9545. * @example
  9546. *
  9547. * _.isArray([1, 2, 3]);
  9548. * // => true
  9549. *
  9550. * _.isArray(document.body.children);
  9551. * // => false
  9552. *
  9553. * _.isArray('abc');
  9554. * // => false
  9555. *
  9556. * _.isArray(_.noop);
  9557. * // => false
  9558. */
  9559. var isArray = Array.isArray;
  9560. /**
  9561. * Checks if `value` is classified as a `Function` object.
  9562. *
  9563. * @static
  9564. * @memberOf _
  9565. * @since 0.1.0
  9566. * @category Lang
  9567. * @param {*} value The value to check.
  9568. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  9569. * @example
  9570. *
  9571. * _.isFunction(_);
  9572. * // => true
  9573. *
  9574. * _.isFunction(/abc/);
  9575. * // => false
  9576. */
  9577. function isFunction(value) {
  9578. // The use of `Object#toString` avoids issues with the `typeof` operator
  9579. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  9580. var tag = isObject(value) ? objectToString.call(value) : '';
  9581. return tag == funcTag || tag == genTag;
  9582. }
  9583. /**
  9584. * Checks if `value` is the
  9585. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  9586. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  9587. *
  9588. * @static
  9589. * @memberOf _
  9590. * @since 0.1.0
  9591. * @category Lang
  9592. * @param {*} value The value to check.
  9593. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  9594. * @example
  9595. *
  9596. * _.isObject({});
  9597. * // => true
  9598. *
  9599. * _.isObject([1, 2, 3]);
  9600. * // => true
  9601. *
  9602. * _.isObject(_.noop);
  9603. * // => true
  9604. *
  9605. * _.isObject(null);
  9606. * // => false
  9607. */
  9608. function isObject(value) {
  9609. var type = typeof value;
  9610. return !!value && (type == 'object' || type == 'function');
  9611. }
  9612. /**
  9613. * Checks if `value` is object-like. A value is object-like if it's not `null`
  9614. * and has a `typeof` result of "object".
  9615. *
  9616. * @static
  9617. * @memberOf _
  9618. * @since 4.0.0
  9619. * @category Lang
  9620. * @param {*} value The value to check.
  9621. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  9622. * @example
  9623. *
  9624. * _.isObjectLike({});
  9625. * // => true
  9626. *
  9627. * _.isObjectLike([1, 2, 3]);
  9628. * // => true
  9629. *
  9630. * _.isObjectLike(_.noop);
  9631. * // => false
  9632. *
  9633. * _.isObjectLike(null);
  9634. * // => false
  9635. */
  9636. function isObjectLike(value) {
  9637. return !!value && typeof value == 'object';
  9638. }
  9639. /**
  9640. * Checks if `value` is classified as a `Symbol` primitive or object.
  9641. *
  9642. * @static
  9643. * @memberOf _
  9644. * @since 4.0.0
  9645. * @category Lang
  9646. * @param {*} value The value to check.
  9647. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  9648. * @example
  9649. *
  9650. * _.isSymbol(Symbol.iterator);
  9651. * // => true
  9652. *
  9653. * _.isSymbol('abc');
  9654. * // => false
  9655. */
  9656. function isSymbol(value) {
  9657. return typeof value == 'symbol' ||
  9658. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  9659. }
  9660. /**
  9661. * Converts `value` to a string. An empty string is returned for `null`
  9662. * and `undefined` values. The sign of `-0` is preserved.
  9663. *
  9664. * @static
  9665. * @memberOf _
  9666. * @since 4.0.0
  9667. * @category Lang
  9668. * @param {*} value The value to process.
  9669. * @returns {string} Returns the string.
  9670. * @example
  9671. *
  9672. * _.toString(null);
  9673. * // => ''
  9674. *
  9675. * _.toString(-0);
  9676. * // => '-0'
  9677. *
  9678. * _.toString([1, 2, 3]);
  9679. * // => '1,2,3'
  9680. */
  9681. function toString(value) {
  9682. return value == null ? '' : baseToString(value);
  9683. }
  9684. /**
  9685. * Gets the value at `path` of `object`. If the resolved value is
  9686. * `undefined`, the `defaultValue` is returned in its place.
  9687. *
  9688. * @static
  9689. * @memberOf _
  9690. * @since 3.7.0
  9691. * @category Object
  9692. * @param {Object} object The object to query.
  9693. * @param {Array|string} path The path of the property to get.
  9694. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  9695. * @returns {*} Returns the resolved value.
  9696. * @example
  9697. *
  9698. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  9699. *
  9700. * _.get(object, 'a[0].b.c');
  9701. * // => 3
  9702. *
  9703. * _.get(object, ['a', '0', 'b', 'c']);
  9704. * // => 3
  9705. *
  9706. * _.get(object, 'a.b.c', 'default');
  9707. * // => 'default'
  9708. */
  9709. function get(object, path, defaultValue) {
  9710. var result = object == null ? undefined : baseGet(object, path);
  9711. return result === undefined ? defaultValue : result;
  9712. }
  9713. module.exports = get;
  9714. /***/ }),
  9715. /***/ 855:
  9716. /***/ (function(module, __unusedexports, __webpack_require__) {
  9717. module.exports = registerPlugin;
  9718. const factory = __webpack_require__(47);
  9719. function registerPlugin(plugins, pluginFunction) {
  9720. return factory(
  9721. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  9722. );
  9723. }
  9724. /***/ }),
  9725. /***/ 862:
  9726. /***/ (function(module) {
  9727. module.exports = class GraphqlError extends Error {
  9728. constructor (request, response) {
  9729. const message = response.data.errors[0].message
  9730. super(message)
  9731. Object.assign(this, response.data)
  9732. this.name = 'GraphqlError'
  9733. this.request = request
  9734. // Maintains proper stack trace (only available on V8)
  9735. /* istanbul ignore next */
  9736. if (Error.captureStackTrace) {
  9737. Error.captureStackTrace(this, this.constructor)
  9738. }
  9739. }
  9740. }
  9741. /***/ }),
  9742. /***/ 863:
  9743. /***/ (function(module, __unusedexports, __webpack_require__) {
  9744. module.exports = authenticationBeforeRequest;
  9745. const btoa = __webpack_require__(675);
  9746. const withAuthorizationPrefix = __webpack_require__(143);
  9747. function authenticationBeforeRequest(state, options) {
  9748. if (typeof state.auth === "string") {
  9749. options.headers.authorization = withAuthorizationPrefix(state.auth);
  9750. // https://developer.github.com/v3/previews/#integrations
  9751. if (
  9752. /^bearer /i.test(state.auth) &&
  9753. !/machine-man/.test(options.headers.accept)
  9754. ) {
  9755. const acceptHeaders = options.headers.accept
  9756. .split(",")
  9757. .concat("application/vnd.github.machine-man-preview+json");
  9758. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  9759. }
  9760. return;
  9761. }
  9762. if (state.auth.username) {
  9763. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  9764. options.headers.authorization = `Basic ${hash}`;
  9765. if (state.otp) {
  9766. options.headers["x-github-otp"] = state.otp;
  9767. }
  9768. return;
  9769. }
  9770. if (state.auth.clientId) {
  9771. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  9772. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  9773. // URL though: `/applications/:client_id/tokens/:access_token`.
  9774. //
  9775. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  9776. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  9777. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  9778. //
  9779. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  9780. // as well as "/applications/123/tokens/token456"
  9781. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  9782. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  9783. options.headers.authorization = `Basic ${hash}`;
  9784. return;
  9785. }
  9786. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  9787. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  9788. return;
  9789. }
  9790. return Promise.resolve()
  9791. .then(() => {
  9792. return state.auth();
  9793. })
  9794. .then(authorization => {
  9795. options.headers.authorization = withAuthorizationPrefix(authorization);
  9796. });
  9797. }
  9798. /***/ }),
  9799. /***/ 866:
  9800. /***/ (function(module, __unusedexports, __webpack_require__) {
  9801. "use strict";
  9802. var shebangRegex = __webpack_require__(816);
  9803. module.exports = function (str) {
  9804. var match = str.match(shebangRegex);
  9805. if (!match) {
  9806. return null;
  9807. }
  9808. var arr = match[0].replace(/#! ?/, '').split(' ');
  9809. var bin = arr[0].split('/').pop();
  9810. var arg = arr[1];
  9811. return (bin === 'env' ?
  9812. arg :
  9813. bin + (arg ? ' ' + arg : '')
  9814. );
  9815. };
  9816. /***/ }),
  9817. /***/ 881:
  9818. /***/ (function(module) {
  9819. "use strict";
  9820. const isWin = process.platform === 'win32';
  9821. function notFoundError(original, syscall) {
  9822. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  9823. code: 'ENOENT',
  9824. errno: 'ENOENT',
  9825. syscall: `${syscall} ${original.command}`,
  9826. path: original.command,
  9827. spawnargs: original.args,
  9828. });
  9829. }
  9830. function hookChildProcess(cp, parsed) {
  9831. if (!isWin) {
  9832. return;
  9833. }
  9834. const originalEmit = cp.emit;
  9835. cp.emit = function (name, arg1) {
  9836. // If emitting "exit" event and exit code is 1, we need to check if
  9837. // the command exists and emit an "error" instead
  9838. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  9839. if (name === 'exit') {
  9840. const err = verifyENOENT(arg1, parsed, 'spawn');
  9841. if (err) {
  9842. return originalEmit.call(cp, 'error', err);
  9843. }
  9844. }
  9845. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  9846. };
  9847. }
  9848. function verifyENOENT(status, parsed) {
  9849. if (isWin && status === 1 && !parsed.file) {
  9850. return notFoundError(parsed.original, 'spawn');
  9851. }
  9852. return null;
  9853. }
  9854. function verifyENOENTSync(status, parsed) {
  9855. if (isWin && status === 1 && !parsed.file) {
  9856. return notFoundError(parsed.original, 'spawnSync');
  9857. }
  9858. return null;
  9859. }
  9860. module.exports = {
  9861. hookChildProcess,
  9862. verifyENOENT,
  9863. verifyENOENTSync,
  9864. notFoundError,
  9865. };
  9866. /***/ }),
  9867. /***/ 883:
  9868. /***/ (function(module) {
  9869. /**
  9870. * lodash (Custom Build) <https://lodash.com/>
  9871. * Build: `lodash modularize exports="npm" -o ./`
  9872. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  9873. * Released under MIT license <https://lodash.com/license>
  9874. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  9875. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  9876. */
  9877. /** Used as the `TypeError` message for "Functions" methods. */
  9878. var FUNC_ERROR_TEXT = 'Expected a function';
  9879. /** Used to stand-in for `undefined` hash values. */
  9880. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  9881. /** Used as references for various `Number` constants. */
  9882. var INFINITY = 1 / 0,
  9883. MAX_SAFE_INTEGER = 9007199254740991;
  9884. /** `Object#toString` result references. */
  9885. var funcTag = '[object Function]',
  9886. genTag = '[object GeneratorFunction]',
  9887. symbolTag = '[object Symbol]';
  9888. /** Used to match property names within property paths. */
  9889. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  9890. reIsPlainProp = /^\w*$/,
  9891. reLeadingDot = /^\./,
  9892. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  9893. /**
  9894. * Used to match `RegExp`
  9895. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  9896. */
  9897. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  9898. /** Used to match backslashes in property paths. */
  9899. var reEscapeChar = /\\(\\)?/g;
  9900. /** Used to detect host constructors (Safari). */
  9901. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  9902. /** Used to detect unsigned integer values. */
  9903. var reIsUint = /^(?:0|[1-9]\d*)$/;
  9904. /** Detect free variable `global` from Node.js. */
  9905. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  9906. /** Detect free variable `self`. */
  9907. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  9908. /** Used as a reference to the global object. */
  9909. var root = freeGlobal || freeSelf || Function('return this')();
  9910. /**
  9911. * Gets the value at `key` of `object`.
  9912. *
  9913. * @private
  9914. * @param {Object} [object] The object to query.
  9915. * @param {string} key The key of the property to get.
  9916. * @returns {*} Returns the property value.
  9917. */
  9918. function getValue(object, key) {
  9919. return object == null ? undefined : object[key];
  9920. }
  9921. /**
  9922. * Checks if `value` is a host object in IE < 9.
  9923. *
  9924. * @private
  9925. * @param {*} value The value to check.
  9926. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  9927. */
  9928. function isHostObject(value) {
  9929. // Many host objects are `Object` objects that can coerce to strings
  9930. // despite having improperly defined `toString` methods.
  9931. var result = false;
  9932. if (value != null && typeof value.toString != 'function') {
  9933. try {
  9934. result = !!(value + '');
  9935. } catch (e) {}
  9936. }
  9937. return result;
  9938. }
  9939. /** Used for built-in method references. */
  9940. var arrayProto = Array.prototype,
  9941. funcProto = Function.prototype,
  9942. objectProto = Object.prototype;
  9943. /** Used to detect overreaching core-js shims. */
  9944. var coreJsData = root['__core-js_shared__'];
  9945. /** Used to detect methods masquerading as native. */
  9946. var maskSrcKey = (function() {
  9947. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  9948. return uid ? ('Symbol(src)_1.' + uid) : '';
  9949. }());
  9950. /** Used to resolve the decompiled source of functions. */
  9951. var funcToString = funcProto.toString;
  9952. /** Used to check objects for own properties. */
  9953. var hasOwnProperty = objectProto.hasOwnProperty;
  9954. /**
  9955. * Used to resolve the
  9956. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  9957. * of values.
  9958. */
  9959. var objectToString = objectProto.toString;
  9960. /** Used to detect if a method is native. */
  9961. var reIsNative = RegExp('^' +
  9962. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  9963. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  9964. );
  9965. /** Built-in value references. */
  9966. var Symbol = root.Symbol,
  9967. splice = arrayProto.splice;
  9968. /* Built-in method references that are verified to be native. */
  9969. var Map = getNative(root, 'Map'),
  9970. nativeCreate = getNative(Object, 'create');
  9971. /** Used to convert symbols to primitives and strings. */
  9972. var symbolProto = Symbol ? Symbol.prototype : undefined,
  9973. symbolToString = symbolProto ? symbolProto.toString : undefined;
  9974. /**
  9975. * Creates a hash object.
  9976. *
  9977. * @private
  9978. * @constructor
  9979. * @param {Array} [entries] The key-value pairs to cache.
  9980. */
  9981. function Hash(entries) {
  9982. var index = -1,
  9983. length = entries ? entries.length : 0;
  9984. this.clear();
  9985. while (++index < length) {
  9986. var entry = entries[index];
  9987. this.set(entry[0], entry[1]);
  9988. }
  9989. }
  9990. /**
  9991. * Removes all key-value entries from the hash.
  9992. *
  9993. * @private
  9994. * @name clear
  9995. * @memberOf Hash
  9996. */
  9997. function hashClear() {
  9998. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  9999. }
  10000. /**
  10001. * Removes `key` and its value from the hash.
  10002. *
  10003. * @private
  10004. * @name delete
  10005. * @memberOf Hash
  10006. * @param {Object} hash The hash to modify.
  10007. * @param {string} key The key of the value to remove.
  10008. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10009. */
  10010. function hashDelete(key) {
  10011. return this.has(key) && delete this.__data__[key];
  10012. }
  10013. /**
  10014. * Gets the hash value for `key`.
  10015. *
  10016. * @private
  10017. * @name get
  10018. * @memberOf Hash
  10019. * @param {string} key The key of the value to get.
  10020. * @returns {*} Returns the entry value.
  10021. */
  10022. function hashGet(key) {
  10023. var data = this.__data__;
  10024. if (nativeCreate) {
  10025. var result = data[key];
  10026. return result === HASH_UNDEFINED ? undefined : result;
  10027. }
  10028. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  10029. }
  10030. /**
  10031. * Checks if a hash value for `key` exists.
  10032. *
  10033. * @private
  10034. * @name has
  10035. * @memberOf Hash
  10036. * @param {string} key The key of the entry to check.
  10037. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10038. */
  10039. function hashHas(key) {
  10040. var data = this.__data__;
  10041. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  10042. }
  10043. /**
  10044. * Sets the hash `key` to `value`.
  10045. *
  10046. * @private
  10047. * @name set
  10048. * @memberOf Hash
  10049. * @param {string} key The key of the value to set.
  10050. * @param {*} value The value to set.
  10051. * @returns {Object} Returns the hash instance.
  10052. */
  10053. function hashSet(key, value) {
  10054. var data = this.__data__;
  10055. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  10056. return this;
  10057. }
  10058. // Add methods to `Hash`.
  10059. Hash.prototype.clear = hashClear;
  10060. Hash.prototype['delete'] = hashDelete;
  10061. Hash.prototype.get = hashGet;
  10062. Hash.prototype.has = hashHas;
  10063. Hash.prototype.set = hashSet;
  10064. /**
  10065. * Creates an list cache object.
  10066. *
  10067. * @private
  10068. * @constructor
  10069. * @param {Array} [entries] The key-value pairs to cache.
  10070. */
  10071. function ListCache(entries) {
  10072. var index = -1,
  10073. length = entries ? entries.length : 0;
  10074. this.clear();
  10075. while (++index < length) {
  10076. var entry = entries[index];
  10077. this.set(entry[0], entry[1]);
  10078. }
  10079. }
  10080. /**
  10081. * Removes all key-value entries from the list cache.
  10082. *
  10083. * @private
  10084. * @name clear
  10085. * @memberOf ListCache
  10086. */
  10087. function listCacheClear() {
  10088. this.__data__ = [];
  10089. }
  10090. /**
  10091. * Removes `key` and its value from the list cache.
  10092. *
  10093. * @private
  10094. * @name delete
  10095. * @memberOf ListCache
  10096. * @param {string} key The key of the value to remove.
  10097. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10098. */
  10099. function listCacheDelete(key) {
  10100. var data = this.__data__,
  10101. index = assocIndexOf(data, key);
  10102. if (index < 0) {
  10103. return false;
  10104. }
  10105. var lastIndex = data.length - 1;
  10106. if (index == lastIndex) {
  10107. data.pop();
  10108. } else {
  10109. splice.call(data, index, 1);
  10110. }
  10111. return true;
  10112. }
  10113. /**
  10114. * Gets the list cache value for `key`.
  10115. *
  10116. * @private
  10117. * @name get
  10118. * @memberOf ListCache
  10119. * @param {string} key The key of the value to get.
  10120. * @returns {*} Returns the entry value.
  10121. */
  10122. function listCacheGet(key) {
  10123. var data = this.__data__,
  10124. index = assocIndexOf(data, key);
  10125. return index < 0 ? undefined : data[index][1];
  10126. }
  10127. /**
  10128. * Checks if a list cache value for `key` exists.
  10129. *
  10130. * @private
  10131. * @name has
  10132. * @memberOf ListCache
  10133. * @param {string} key The key of the entry to check.
  10134. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10135. */
  10136. function listCacheHas(key) {
  10137. return assocIndexOf(this.__data__, key) > -1;
  10138. }
  10139. /**
  10140. * Sets the list cache `key` to `value`.
  10141. *
  10142. * @private
  10143. * @name set
  10144. * @memberOf ListCache
  10145. * @param {string} key The key of the value to set.
  10146. * @param {*} value The value to set.
  10147. * @returns {Object} Returns the list cache instance.
  10148. */
  10149. function listCacheSet(key, value) {
  10150. var data = this.__data__,
  10151. index = assocIndexOf(data, key);
  10152. if (index < 0) {
  10153. data.push([key, value]);
  10154. } else {
  10155. data[index][1] = value;
  10156. }
  10157. return this;
  10158. }
  10159. // Add methods to `ListCache`.
  10160. ListCache.prototype.clear = listCacheClear;
  10161. ListCache.prototype['delete'] = listCacheDelete;
  10162. ListCache.prototype.get = listCacheGet;
  10163. ListCache.prototype.has = listCacheHas;
  10164. ListCache.prototype.set = listCacheSet;
  10165. /**
  10166. * Creates a map cache object to store key-value pairs.
  10167. *
  10168. * @private
  10169. * @constructor
  10170. * @param {Array} [entries] The key-value pairs to cache.
  10171. */
  10172. function MapCache(entries) {
  10173. var index = -1,
  10174. length = entries ? entries.length : 0;
  10175. this.clear();
  10176. while (++index < length) {
  10177. var entry = entries[index];
  10178. this.set(entry[0], entry[1]);
  10179. }
  10180. }
  10181. /**
  10182. * Removes all key-value entries from the map.
  10183. *
  10184. * @private
  10185. * @name clear
  10186. * @memberOf MapCache
  10187. */
  10188. function mapCacheClear() {
  10189. this.__data__ = {
  10190. 'hash': new Hash,
  10191. 'map': new (Map || ListCache),
  10192. 'string': new Hash
  10193. };
  10194. }
  10195. /**
  10196. * Removes `key` and its value from the map.
  10197. *
  10198. * @private
  10199. * @name delete
  10200. * @memberOf MapCache
  10201. * @param {string} key The key of the value to remove.
  10202. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10203. */
  10204. function mapCacheDelete(key) {
  10205. return getMapData(this, key)['delete'](key);
  10206. }
  10207. /**
  10208. * Gets the map value for `key`.
  10209. *
  10210. * @private
  10211. * @name get
  10212. * @memberOf MapCache
  10213. * @param {string} key The key of the value to get.
  10214. * @returns {*} Returns the entry value.
  10215. */
  10216. function mapCacheGet(key) {
  10217. return getMapData(this, key).get(key);
  10218. }
  10219. /**
  10220. * Checks if a map value for `key` exists.
  10221. *
  10222. * @private
  10223. * @name has
  10224. * @memberOf MapCache
  10225. * @param {string} key The key of the entry to check.
  10226. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10227. */
  10228. function mapCacheHas(key) {
  10229. return getMapData(this, key).has(key);
  10230. }
  10231. /**
  10232. * Sets the map `key` to `value`.
  10233. *
  10234. * @private
  10235. * @name set
  10236. * @memberOf MapCache
  10237. * @param {string} key The key of the value to set.
  10238. * @param {*} value The value to set.
  10239. * @returns {Object} Returns the map cache instance.
  10240. */
  10241. function mapCacheSet(key, value) {
  10242. getMapData(this, key).set(key, value);
  10243. return this;
  10244. }
  10245. // Add methods to `MapCache`.
  10246. MapCache.prototype.clear = mapCacheClear;
  10247. MapCache.prototype['delete'] = mapCacheDelete;
  10248. MapCache.prototype.get = mapCacheGet;
  10249. MapCache.prototype.has = mapCacheHas;
  10250. MapCache.prototype.set = mapCacheSet;
  10251. /**
  10252. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  10253. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10254. * for equality comparisons.
  10255. *
  10256. * @private
  10257. * @param {Object} object The object to modify.
  10258. * @param {string} key The key of the property to assign.
  10259. * @param {*} value The value to assign.
  10260. */
  10261. function assignValue(object, key, value) {
  10262. var objValue = object[key];
  10263. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  10264. (value === undefined && !(key in object))) {
  10265. object[key] = value;
  10266. }
  10267. }
  10268. /**
  10269. * Gets the index at which the `key` is found in `array` of key-value pairs.
  10270. *
  10271. * @private
  10272. * @param {Array} array The array to inspect.
  10273. * @param {*} key The key to search for.
  10274. * @returns {number} Returns the index of the matched value, else `-1`.
  10275. */
  10276. function assocIndexOf(array, key) {
  10277. var length = array.length;
  10278. while (length--) {
  10279. if (eq(array[length][0], key)) {
  10280. return length;
  10281. }
  10282. }
  10283. return -1;
  10284. }
  10285. /**
  10286. * The base implementation of `_.isNative` without bad shim checks.
  10287. *
  10288. * @private
  10289. * @param {*} value The value to check.
  10290. * @returns {boolean} Returns `true` if `value` is a native function,
  10291. * else `false`.
  10292. */
  10293. function baseIsNative(value) {
  10294. if (!isObject(value) || isMasked(value)) {
  10295. return false;
  10296. }
  10297. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  10298. return pattern.test(toSource(value));
  10299. }
  10300. /**
  10301. * The base implementation of `_.set`.
  10302. *
  10303. * @private
  10304. * @param {Object} object The object to modify.
  10305. * @param {Array|string} path The path of the property to set.
  10306. * @param {*} value The value to set.
  10307. * @param {Function} [customizer] The function to customize path creation.
  10308. * @returns {Object} Returns `object`.
  10309. */
  10310. function baseSet(object, path, value, customizer) {
  10311. if (!isObject(object)) {
  10312. return object;
  10313. }
  10314. path = isKey(path, object) ? [path] : castPath(path);
  10315. var index = -1,
  10316. length = path.length,
  10317. lastIndex = length - 1,
  10318. nested = object;
  10319. while (nested != null && ++index < length) {
  10320. var key = toKey(path[index]),
  10321. newValue = value;
  10322. if (index != lastIndex) {
  10323. var objValue = nested[key];
  10324. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10325. if (newValue === undefined) {
  10326. newValue = isObject(objValue)
  10327. ? objValue
  10328. : (isIndex(path[index + 1]) ? [] : {});
  10329. }
  10330. }
  10331. assignValue(nested, key, newValue);
  10332. nested = nested[key];
  10333. }
  10334. return object;
  10335. }
  10336. /**
  10337. * The base implementation of `_.toString` which doesn't convert nullish
  10338. * values to empty strings.
  10339. *
  10340. * @private
  10341. * @param {*} value The value to process.
  10342. * @returns {string} Returns the string.
  10343. */
  10344. function baseToString(value) {
  10345. // Exit early for strings to avoid a performance hit in some environments.
  10346. if (typeof value == 'string') {
  10347. return value;
  10348. }
  10349. if (isSymbol(value)) {
  10350. return symbolToString ? symbolToString.call(value) : '';
  10351. }
  10352. var result = (value + '');
  10353. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10354. }
  10355. /**
  10356. * Casts `value` to a path array if it's not one.
  10357. *
  10358. * @private
  10359. * @param {*} value The value to inspect.
  10360. * @returns {Array} Returns the cast property path array.
  10361. */
  10362. function castPath(value) {
  10363. return isArray(value) ? value : stringToPath(value);
  10364. }
  10365. /**
  10366. * Gets the data for `map`.
  10367. *
  10368. * @private
  10369. * @param {Object} map The map to query.
  10370. * @param {string} key The reference key.
  10371. * @returns {*} Returns the map data.
  10372. */
  10373. function getMapData(map, key) {
  10374. var data = map.__data__;
  10375. return isKeyable(key)
  10376. ? data[typeof key == 'string' ? 'string' : 'hash']
  10377. : data.map;
  10378. }
  10379. /**
  10380. * Gets the native function at `key` of `object`.
  10381. *
  10382. * @private
  10383. * @param {Object} object The object to query.
  10384. * @param {string} key The key of the method to get.
  10385. * @returns {*} Returns the function if it's native, else `undefined`.
  10386. */
  10387. function getNative(object, key) {
  10388. var value = getValue(object, key);
  10389. return baseIsNative(value) ? value : undefined;
  10390. }
  10391. /**
  10392. * Checks if `value` is a valid array-like index.
  10393. *
  10394. * @private
  10395. * @param {*} value The value to check.
  10396. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  10397. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  10398. */
  10399. function isIndex(value, length) {
  10400. length = length == null ? MAX_SAFE_INTEGER : length;
  10401. return !!length &&
  10402. (typeof value == 'number' || reIsUint.test(value)) &&
  10403. (value > -1 && value % 1 == 0 && value < length);
  10404. }
  10405. /**
  10406. * Checks if `value` is a property name and not a property path.
  10407. *
  10408. * @private
  10409. * @param {*} value The value to check.
  10410. * @param {Object} [object] The object to query keys on.
  10411. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  10412. */
  10413. function isKey(value, object) {
  10414. if (isArray(value)) {
  10415. return false;
  10416. }
  10417. var type = typeof value;
  10418. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  10419. value == null || isSymbol(value)) {
  10420. return true;
  10421. }
  10422. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  10423. (object != null && value in Object(object));
  10424. }
  10425. /**
  10426. * Checks if `value` is suitable for use as unique object key.
  10427. *
  10428. * @private
  10429. * @param {*} value The value to check.
  10430. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  10431. */
  10432. function isKeyable(value) {
  10433. var type = typeof value;
  10434. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  10435. ? (value !== '__proto__')
  10436. : (value === null);
  10437. }
  10438. /**
  10439. * Checks if `func` has its source masked.
  10440. *
  10441. * @private
  10442. * @param {Function} func The function to check.
  10443. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  10444. */
  10445. function isMasked(func) {
  10446. return !!maskSrcKey && (maskSrcKey in func);
  10447. }
  10448. /**
  10449. * Converts `string` to a property path array.
  10450. *
  10451. * @private
  10452. * @param {string} string The string to convert.
  10453. * @returns {Array} Returns the property path array.
  10454. */
  10455. var stringToPath = memoize(function(string) {
  10456. string = toString(string);
  10457. var result = [];
  10458. if (reLeadingDot.test(string)) {
  10459. result.push('');
  10460. }
  10461. string.replace(rePropName, function(match, number, quote, string) {
  10462. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  10463. });
  10464. return result;
  10465. });
  10466. /**
  10467. * Converts `value` to a string key if it's not a string or symbol.
  10468. *
  10469. * @private
  10470. * @param {*} value The value to inspect.
  10471. * @returns {string|symbol} Returns the key.
  10472. */
  10473. function toKey(value) {
  10474. if (typeof value == 'string' || isSymbol(value)) {
  10475. return value;
  10476. }
  10477. var result = (value + '');
  10478. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10479. }
  10480. /**
  10481. * Converts `func` to its source code.
  10482. *
  10483. * @private
  10484. * @param {Function} func The function to process.
  10485. * @returns {string} Returns the source code.
  10486. */
  10487. function toSource(func) {
  10488. if (func != null) {
  10489. try {
  10490. return funcToString.call(func);
  10491. } catch (e) {}
  10492. try {
  10493. return (func + '');
  10494. } catch (e) {}
  10495. }
  10496. return '';
  10497. }
  10498. /**
  10499. * Creates a function that memoizes the result of `func`. If `resolver` is
  10500. * provided, it determines the cache key for storing the result based on the
  10501. * arguments provided to the memoized function. By default, the first argument
  10502. * provided to the memoized function is used as the map cache key. The `func`
  10503. * is invoked with the `this` binding of the memoized function.
  10504. *
  10505. * **Note:** The cache is exposed as the `cache` property on the memoized
  10506. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10507. * constructor with one whose instances implement the
  10508. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10509. * method interface of `delete`, `get`, `has`, and `set`.
  10510. *
  10511. * @static
  10512. * @memberOf _
  10513. * @since 0.1.0
  10514. * @category Function
  10515. * @param {Function} func The function to have its output memoized.
  10516. * @param {Function} [resolver] The function to resolve the cache key.
  10517. * @returns {Function} Returns the new memoized function.
  10518. * @example
  10519. *
  10520. * var object = { 'a': 1, 'b': 2 };
  10521. * var other = { 'c': 3, 'd': 4 };
  10522. *
  10523. * var values = _.memoize(_.values);
  10524. * values(object);
  10525. * // => [1, 2]
  10526. *
  10527. * values(other);
  10528. * // => [3, 4]
  10529. *
  10530. * object.a = 2;
  10531. * values(object);
  10532. * // => [1, 2]
  10533. *
  10534. * // Modify the result cache.
  10535. * values.cache.set(object, ['a', 'b']);
  10536. * values(object);
  10537. * // => ['a', 'b']
  10538. *
  10539. * // Replace `_.memoize.Cache`.
  10540. * _.memoize.Cache = WeakMap;
  10541. */
  10542. function memoize(func, resolver) {
  10543. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  10544. throw new TypeError(FUNC_ERROR_TEXT);
  10545. }
  10546. var memoized = function() {
  10547. var args = arguments,
  10548. key = resolver ? resolver.apply(this, args) : args[0],
  10549. cache = memoized.cache;
  10550. if (cache.has(key)) {
  10551. return cache.get(key);
  10552. }
  10553. var result = func.apply(this, args);
  10554. memoized.cache = cache.set(key, result);
  10555. return result;
  10556. };
  10557. memoized.cache = new (memoize.Cache || MapCache);
  10558. return memoized;
  10559. }
  10560. // Assign cache to `_.memoize`.
  10561. memoize.Cache = MapCache;
  10562. /**
  10563. * Performs a
  10564. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10565. * comparison between two values to determine if they are equivalent.
  10566. *
  10567. * @static
  10568. * @memberOf _
  10569. * @since 4.0.0
  10570. * @category Lang
  10571. * @param {*} value The value to compare.
  10572. * @param {*} other The other value to compare.
  10573. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  10574. * @example
  10575. *
  10576. * var object = { 'a': 1 };
  10577. * var other = { 'a': 1 };
  10578. *
  10579. * _.eq(object, object);
  10580. * // => true
  10581. *
  10582. * _.eq(object, other);
  10583. * // => false
  10584. *
  10585. * _.eq('a', 'a');
  10586. * // => true
  10587. *
  10588. * _.eq('a', Object('a'));
  10589. * // => false
  10590. *
  10591. * _.eq(NaN, NaN);
  10592. * // => true
  10593. */
  10594. function eq(value, other) {
  10595. return value === other || (value !== value && other !== other);
  10596. }
  10597. /**
  10598. * Checks if `value` is classified as an `Array` object.
  10599. *
  10600. * @static
  10601. * @memberOf _
  10602. * @since 0.1.0
  10603. * @category Lang
  10604. * @param {*} value The value to check.
  10605. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  10606. * @example
  10607. *
  10608. * _.isArray([1, 2, 3]);
  10609. * // => true
  10610. *
  10611. * _.isArray(document.body.children);
  10612. * // => false
  10613. *
  10614. * _.isArray('abc');
  10615. * // => false
  10616. *
  10617. * _.isArray(_.noop);
  10618. * // => false
  10619. */
  10620. var isArray = Array.isArray;
  10621. /**
  10622. * Checks if `value` is classified as a `Function` object.
  10623. *
  10624. * @static
  10625. * @memberOf _
  10626. * @since 0.1.0
  10627. * @category Lang
  10628. * @param {*} value The value to check.
  10629. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10630. * @example
  10631. *
  10632. * _.isFunction(_);
  10633. * // => true
  10634. *
  10635. * _.isFunction(/abc/);
  10636. * // => false
  10637. */
  10638. function isFunction(value) {
  10639. // The use of `Object#toString` avoids issues with the `typeof` operator
  10640. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  10641. var tag = isObject(value) ? objectToString.call(value) : '';
  10642. return tag == funcTag || tag == genTag;
  10643. }
  10644. /**
  10645. * Checks if `value` is the
  10646. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10647. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10648. *
  10649. * @static
  10650. * @memberOf _
  10651. * @since 0.1.0
  10652. * @category Lang
  10653. * @param {*} value The value to check.
  10654. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10655. * @example
  10656. *
  10657. * _.isObject({});
  10658. * // => true
  10659. *
  10660. * _.isObject([1, 2, 3]);
  10661. * // => true
  10662. *
  10663. * _.isObject(_.noop);
  10664. * // => true
  10665. *
  10666. * _.isObject(null);
  10667. * // => false
  10668. */
  10669. function isObject(value) {
  10670. var type = typeof value;
  10671. return !!value && (type == 'object' || type == 'function');
  10672. }
  10673. /**
  10674. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10675. * and has a `typeof` result of "object".
  10676. *
  10677. * @static
  10678. * @memberOf _
  10679. * @since 4.0.0
  10680. * @category Lang
  10681. * @param {*} value The value to check.
  10682. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10683. * @example
  10684. *
  10685. * _.isObjectLike({});
  10686. * // => true
  10687. *
  10688. * _.isObjectLike([1, 2, 3]);
  10689. * // => true
  10690. *
  10691. * _.isObjectLike(_.noop);
  10692. * // => false
  10693. *
  10694. * _.isObjectLike(null);
  10695. * // => false
  10696. */
  10697. function isObjectLike(value) {
  10698. return !!value && typeof value == 'object';
  10699. }
  10700. /**
  10701. * Checks if `value` is classified as a `Symbol` primitive or object.
  10702. *
  10703. * @static
  10704. * @memberOf _
  10705. * @since 4.0.0
  10706. * @category Lang
  10707. * @param {*} value The value to check.
  10708. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10709. * @example
  10710. *
  10711. * _.isSymbol(Symbol.iterator);
  10712. * // => true
  10713. *
  10714. * _.isSymbol('abc');
  10715. * // => false
  10716. */
  10717. function isSymbol(value) {
  10718. return typeof value == 'symbol' ||
  10719. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  10720. }
  10721. /**
  10722. * Converts `value` to a string. An empty string is returned for `null`
  10723. * and `undefined` values. The sign of `-0` is preserved.
  10724. *
  10725. * @static
  10726. * @memberOf _
  10727. * @since 4.0.0
  10728. * @category Lang
  10729. * @param {*} value The value to process.
  10730. * @returns {string} Returns the string.
  10731. * @example
  10732. *
  10733. * _.toString(null);
  10734. * // => ''
  10735. *
  10736. * _.toString(-0);
  10737. * // => '-0'
  10738. *
  10739. * _.toString([1, 2, 3]);
  10740. * // => '1,2,3'
  10741. */
  10742. function toString(value) {
  10743. return value == null ? '' : baseToString(value);
  10744. }
  10745. /**
  10746. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  10747. * it's created. Arrays are created for missing index properties while objects
  10748. * are created for all other missing properties. Use `_.setWith` to customize
  10749. * `path` creation.
  10750. *
  10751. * **Note:** This method mutates `object`.
  10752. *
  10753. * @static
  10754. * @memberOf _
  10755. * @since 3.7.0
  10756. * @category Object
  10757. * @param {Object} object The object to modify.
  10758. * @param {Array|string} path The path of the property to set.
  10759. * @param {*} value The value to set.
  10760. * @returns {Object} Returns `object`.
  10761. * @example
  10762. *
  10763. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  10764. *
  10765. * _.set(object, 'a[0].b.c', 4);
  10766. * console.log(object.a[0].b.c);
  10767. * // => 4
  10768. *
  10769. * _.set(object, ['x', '0', 'y', 'z'], 5);
  10770. * console.log(object.x[0].y.z);
  10771. * // => 5
  10772. */
  10773. function set(object, path, value) {
  10774. return object == null ? object : baseSet(object, path, value);
  10775. }
  10776. module.exports = set;
  10777. /***/ }),
  10778. /***/ 899:
  10779. /***/ (function(module, __unusedexports, __webpack_require__) {
  10780. module.exports = registerEndpoints;
  10781. const { Deprecation } = __webpack_require__(692);
  10782. function registerEndpoints(octokit, routes) {
  10783. Object.keys(routes).forEach(namespaceName => {
  10784. if (!octokit[namespaceName]) {
  10785. octokit[namespaceName] = {};
  10786. }
  10787. Object.keys(routes[namespaceName]).forEach(apiName => {
  10788. const apiOptions = routes[namespaceName][apiName];
  10789. const endpointDefaults = ["method", "url", "headers"].reduce(
  10790. (map, key) => {
  10791. if (typeof apiOptions[key] !== "undefined") {
  10792. map[key] = apiOptions[key];
  10793. }
  10794. return map;
  10795. },
  10796. {}
  10797. );
  10798. endpointDefaults.request = {
  10799. validate: apiOptions.params
  10800. };
  10801. let request = octokit.request.defaults(endpointDefaults);
  10802. // patch request & endpoint methods to support deprecated parameters.
  10803. // Not the most elegant solution, but we don’t want to move deprecation
  10804. // logic into octokit/endpoint.js as it’s out of scope
  10805. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  10806. key => apiOptions.params[key].deprecated
  10807. );
  10808. if (hasDeprecatedParam) {
  10809. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  10810. request = patch(
  10811. octokit.request.defaults(endpointDefaults),
  10812. `.${namespaceName}.${apiName}()`
  10813. );
  10814. request.endpoint = patch(
  10815. request.endpoint,
  10816. `.${namespaceName}.${apiName}.endpoint()`
  10817. );
  10818. request.endpoint.merge = patch(
  10819. request.endpoint.merge,
  10820. `.${namespaceName}.${apiName}.endpoint.merge()`
  10821. );
  10822. }
  10823. if (apiOptions.deprecated) {
  10824. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  10825. octokit.log.warn(
  10826. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  10827. );
  10828. octokit[namespaceName][apiName] = request;
  10829. return request.apply(null, arguments);
  10830. };
  10831. return;
  10832. }
  10833. octokit[namespaceName][apiName] = request;
  10834. });
  10835. });
  10836. }
  10837. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  10838. const patchedMethod = options => {
  10839. options = Object.assign({}, options);
  10840. Object.keys(options).forEach(key => {
  10841. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  10842. const aliasKey = apiOptions.params[key].alias;
  10843. octokit.log.warn(
  10844. new Deprecation(
  10845. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  10846. )
  10847. );
  10848. if (!(aliasKey in options)) {
  10849. options[aliasKey] = options[key];
  10850. }
  10851. delete options[key];
  10852. }
  10853. });
  10854. return method(options);
  10855. };
  10856. Object.keys(method).forEach(key => {
  10857. patchedMethod[key] = method[key];
  10858. });
  10859. return patchedMethod;
  10860. }
  10861. /***/ }),
  10862. /***/ 929:
  10863. /***/ (function(module, __unusedexports, __webpack_require__) {
  10864. module.exports = hasNextPage
  10865. const deprecate = __webpack_require__(370)
  10866. const getPageLinks = __webpack_require__(577)
  10867. function hasNextPage (link) {
  10868. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10869. return getPageLinks(link).next
  10870. }
  10871. /***/ }),
  10872. /***/ 948:
  10873. /***/ (function(module) {
  10874. "use strict";
  10875. /**
  10876. * Tries to execute a function and discards any error that occurs.
  10877. * @param {Function} fn - Function that might or might not throw an error.
  10878. * @returns {?*} Return-value of the function when no error occurred.
  10879. */
  10880. module.exports = function(fn) {
  10881. try { return fn() } catch (e) {}
  10882. }
  10883. /***/ }),
  10884. /***/ 954:
  10885. /***/ (function(module) {
  10886. module.exports = validateAuth;
  10887. function validateAuth(auth) {
  10888. if (typeof auth === "string") {
  10889. return;
  10890. }
  10891. if (typeof auth === "function") {
  10892. return;
  10893. }
  10894. if (auth.username && auth.password) {
  10895. return;
  10896. }
  10897. if (auth.clientId && auth.clientSecret) {
  10898. return;
  10899. }
  10900. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  10901. }
  10902. /***/ }),
  10903. /***/ 955:
  10904. /***/ (function(module, __unusedexports, __webpack_require__) {
  10905. "use strict";
  10906. const path = __webpack_require__(622);
  10907. const childProcess = __webpack_require__(129);
  10908. const crossSpawn = __webpack_require__(20);
  10909. const stripEof = __webpack_require__(768);
  10910. const npmRunPath = __webpack_require__(621);
  10911. const isStream = __webpack_require__(323);
  10912. const _getStream = __webpack_require__(145);
  10913. const pFinally = __webpack_require__(697);
  10914. const onExit = __webpack_require__(260);
  10915. const errname = __webpack_require__(427);
  10916. const stdio = __webpack_require__(168);
  10917. const TEN_MEGABYTES = 1000 * 1000 * 10;
  10918. function handleArgs(cmd, args, opts) {
  10919. let parsed;
  10920. opts = Object.assign({
  10921. extendEnv: true,
  10922. env: {}
  10923. }, opts);
  10924. if (opts.extendEnv) {
  10925. opts.env = Object.assign({}, process.env, opts.env);
  10926. }
  10927. if (opts.__winShell === true) {
  10928. delete opts.__winShell;
  10929. parsed = {
  10930. command: cmd,
  10931. args,
  10932. options: opts,
  10933. file: cmd,
  10934. original: {
  10935. cmd,
  10936. args
  10937. }
  10938. };
  10939. } else {
  10940. parsed = crossSpawn._parse(cmd, args, opts);
  10941. }
  10942. opts = Object.assign({
  10943. maxBuffer: TEN_MEGABYTES,
  10944. buffer: true,
  10945. stripEof: true,
  10946. preferLocal: true,
  10947. localDir: parsed.options.cwd || process.cwd(),
  10948. encoding: 'utf8',
  10949. reject: true,
  10950. cleanup: true
  10951. }, parsed.options);
  10952. opts.stdio = stdio(opts);
  10953. if (opts.preferLocal) {
  10954. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  10955. }
  10956. if (opts.detached) {
  10957. // #115
  10958. opts.cleanup = false;
  10959. }
  10960. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  10961. // #116
  10962. parsed.args.unshift('/q');
  10963. }
  10964. return {
  10965. cmd: parsed.command,
  10966. args: parsed.args,
  10967. opts,
  10968. parsed
  10969. };
  10970. }
  10971. function handleInput(spawned, input) {
  10972. if (input === null || input === undefined) {
  10973. return;
  10974. }
  10975. if (isStream(input)) {
  10976. input.pipe(spawned.stdin);
  10977. } else {
  10978. spawned.stdin.end(input);
  10979. }
  10980. }
  10981. function handleOutput(opts, val) {
  10982. if (val && opts.stripEof) {
  10983. val = stripEof(val);
  10984. }
  10985. return val;
  10986. }
  10987. function handleShell(fn, cmd, opts) {
  10988. let file = '/bin/sh';
  10989. let args = ['-c', cmd];
  10990. opts = Object.assign({}, opts);
  10991. if (process.platform === 'win32') {
  10992. opts.__winShell = true;
  10993. file = process.env.comspec || 'cmd.exe';
  10994. args = ['/s', '/c', `"${cmd}"`];
  10995. opts.windowsVerbatimArguments = true;
  10996. }
  10997. if (opts.shell) {
  10998. file = opts.shell;
  10999. delete opts.shell;
  11000. }
  11001. return fn(file, args, opts);
  11002. }
  11003. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  11004. if (!process[stream]) {
  11005. return null;
  11006. }
  11007. let ret;
  11008. if (!buffer) {
  11009. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  11010. ret = new Promise((resolve, reject) => {
  11011. process[stream]
  11012. .once('end', resolve)
  11013. .once('error', reject);
  11014. });
  11015. } else if (encoding) {
  11016. ret = _getStream(process[stream], {
  11017. encoding,
  11018. maxBuffer
  11019. });
  11020. } else {
  11021. ret = _getStream.buffer(process[stream], {maxBuffer});
  11022. }
  11023. return ret.catch(err => {
  11024. err.stream = stream;
  11025. err.message = `${stream} ${err.message}`;
  11026. throw err;
  11027. });
  11028. }
  11029. function makeError(result, options) {
  11030. const {stdout, stderr} = result;
  11031. let err = result.error;
  11032. const {code, signal} = result;
  11033. const {parsed, joinedCmd} = options;
  11034. const timedOut = options.timedOut || false;
  11035. if (!err) {
  11036. let output = '';
  11037. if (Array.isArray(parsed.opts.stdio)) {
  11038. if (parsed.opts.stdio[2] !== 'inherit') {
  11039. output += output.length > 0 ? stderr : `\n${stderr}`;
  11040. }
  11041. if (parsed.opts.stdio[1] !== 'inherit') {
  11042. output += `\n${stdout}`;
  11043. }
  11044. } else if (parsed.opts.stdio !== 'inherit') {
  11045. output = `\n${stderr}${stdout}`;
  11046. }
  11047. err = new Error(`Command failed: ${joinedCmd}${output}`);
  11048. err.code = code < 0 ? errname(code) : code;
  11049. }
  11050. err.stdout = stdout;
  11051. err.stderr = stderr;
  11052. err.failed = true;
  11053. err.signal = signal || null;
  11054. err.cmd = joinedCmd;
  11055. err.timedOut = timedOut;
  11056. return err;
  11057. }
  11058. function joinCmd(cmd, args) {
  11059. let joinedCmd = cmd;
  11060. if (Array.isArray(args) && args.length > 0) {
  11061. joinedCmd += ' ' + args.join(' ');
  11062. }
  11063. return joinedCmd;
  11064. }
  11065. module.exports = (cmd, args, opts) => {
  11066. const parsed = handleArgs(cmd, args, opts);
  11067. const {encoding, buffer, maxBuffer} = parsed.opts;
  11068. const joinedCmd = joinCmd(cmd, args);
  11069. let spawned;
  11070. try {
  11071. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  11072. } catch (err) {
  11073. return Promise.reject(err);
  11074. }
  11075. let removeExitHandler;
  11076. if (parsed.opts.cleanup) {
  11077. removeExitHandler = onExit(() => {
  11078. spawned.kill();
  11079. });
  11080. }
  11081. let timeoutId = null;
  11082. let timedOut = false;
  11083. const cleanup = () => {
  11084. if (timeoutId) {
  11085. clearTimeout(timeoutId);
  11086. timeoutId = null;
  11087. }
  11088. if (removeExitHandler) {
  11089. removeExitHandler();
  11090. }
  11091. };
  11092. if (parsed.opts.timeout > 0) {
  11093. timeoutId = setTimeout(() => {
  11094. timeoutId = null;
  11095. timedOut = true;
  11096. spawned.kill(parsed.opts.killSignal);
  11097. }, parsed.opts.timeout);
  11098. }
  11099. const processDone = new Promise(resolve => {
  11100. spawned.on('exit', (code, signal) => {
  11101. cleanup();
  11102. resolve({code, signal});
  11103. });
  11104. spawned.on('error', err => {
  11105. cleanup();
  11106. resolve({error: err});
  11107. });
  11108. if (spawned.stdin) {
  11109. spawned.stdin.on('error', err => {
  11110. cleanup();
  11111. resolve({error: err});
  11112. });
  11113. }
  11114. });
  11115. function destroy() {
  11116. if (spawned.stdout) {
  11117. spawned.stdout.destroy();
  11118. }
  11119. if (spawned.stderr) {
  11120. spawned.stderr.destroy();
  11121. }
  11122. }
  11123. const handlePromise = () => pFinally(Promise.all([
  11124. processDone,
  11125. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  11126. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  11127. ]).then(arr => {
  11128. const result = arr[0];
  11129. result.stdout = arr[1];
  11130. result.stderr = arr[2];
  11131. if (result.error || result.code !== 0 || result.signal !== null) {
  11132. const err = makeError(result, {
  11133. joinedCmd,
  11134. parsed,
  11135. timedOut
  11136. });
  11137. // TODO: missing some timeout logic for killed
  11138. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  11139. // err.killed = spawned.killed || killed;
  11140. err.killed = err.killed || spawned.killed;
  11141. if (!parsed.opts.reject) {
  11142. return err;
  11143. }
  11144. throw err;
  11145. }
  11146. return {
  11147. stdout: handleOutput(parsed.opts, result.stdout),
  11148. stderr: handleOutput(parsed.opts, result.stderr),
  11149. code: 0,
  11150. failed: false,
  11151. killed: false,
  11152. signal: null,
  11153. cmd: joinedCmd,
  11154. timedOut: false
  11155. };
  11156. }), destroy);
  11157. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  11158. handleInput(spawned, parsed.opts.input);
  11159. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  11160. spawned.catch = onrejected => handlePromise().catch(onrejected);
  11161. return spawned;
  11162. };
  11163. // TODO: set `stderr: 'ignore'` when that option is implemented
  11164. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  11165. // TODO: set `stdout: 'ignore'` when that option is implemented
  11166. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  11167. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  11168. module.exports.sync = (cmd, args, opts) => {
  11169. const parsed = handleArgs(cmd, args, opts);
  11170. const joinedCmd = joinCmd(cmd, args);
  11171. if (isStream(parsed.opts.input)) {
  11172. throw new TypeError('The `input` option cannot be a stream in sync mode');
  11173. }
  11174. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  11175. result.code = result.status;
  11176. if (result.error || result.status !== 0 || result.signal !== null) {
  11177. const err = makeError(result, {
  11178. joinedCmd,
  11179. parsed
  11180. });
  11181. if (!parsed.opts.reject) {
  11182. return err;
  11183. }
  11184. throw err;
  11185. }
  11186. return {
  11187. stdout: handleOutput(parsed.opts, result.stdout),
  11188. stderr: handleOutput(parsed.opts, result.stderr),
  11189. code: 0,
  11190. failed: false,
  11191. signal: null,
  11192. cmd: joinedCmd,
  11193. timedOut: false
  11194. };
  11195. };
  11196. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  11197. /***/ }),
  11198. /***/ 966:
  11199. /***/ (function(module, __unusedexports, __webpack_require__) {
  11200. "use strict";
  11201. const {PassThrough} = __webpack_require__(413);
  11202. module.exports = options => {
  11203. options = Object.assign({}, options);
  11204. const {array} = options;
  11205. let {encoding} = options;
  11206. const buffer = encoding === 'buffer';
  11207. let objectMode = false;
  11208. if (array) {
  11209. objectMode = !(encoding || buffer);
  11210. } else {
  11211. encoding = encoding || 'utf8';
  11212. }
  11213. if (buffer) {
  11214. encoding = null;
  11215. }
  11216. let len = 0;
  11217. const ret = [];
  11218. const stream = new PassThrough({objectMode});
  11219. if (encoding) {
  11220. stream.setEncoding(encoding);
  11221. }
  11222. stream.on('data', chunk => {
  11223. ret.push(chunk);
  11224. if (objectMode) {
  11225. len = ret.length;
  11226. } else {
  11227. len += chunk.length;
  11228. }
  11229. });
  11230. stream.getBufferedValue = () => {
  11231. if (array) {
  11232. return ret;
  11233. }
  11234. return buffer ? Buffer.concat(ret, len) : ret.join('');
  11235. };
  11236. stream.getBufferedLength = () => len;
  11237. return stream;
  11238. };
  11239. /***/ }),
  11240. /***/ 969:
  11241. /***/ (function(module, __unusedexports, __webpack_require__) {
  11242. var wrappy = __webpack_require__(11)
  11243. module.exports = wrappy(once)
  11244. module.exports.strict = wrappy(onceStrict)
  11245. once.proto = once(function () {
  11246. Object.defineProperty(Function.prototype, 'once', {
  11247. value: function () {
  11248. return once(this)
  11249. },
  11250. configurable: true
  11251. })
  11252. Object.defineProperty(Function.prototype, 'onceStrict', {
  11253. value: function () {
  11254. return onceStrict(this)
  11255. },
  11256. configurable: true
  11257. })
  11258. })
  11259. function once (fn) {
  11260. var f = function () {
  11261. if (f.called) return f.value
  11262. f.called = true
  11263. return f.value = fn.apply(this, arguments)
  11264. }
  11265. f.called = false
  11266. return f
  11267. }
  11268. function onceStrict (fn) {
  11269. var f = function () {
  11270. if (f.called)
  11271. throw new Error(f.onceError)
  11272. f.called = true
  11273. return f.value = fn.apply(this, arguments)
  11274. }
  11275. var name = fn.name || 'Function wrapped with `once`'
  11276. f.onceError = name + " shouldn't be called more than once"
  11277. f.called = false
  11278. return f
  11279. }
  11280. /***/ }),
  11281. /***/ 986:
  11282. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11283. "use strict";
  11284. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11285. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11286. return new (P || (P = Promise))(function (resolve, reject) {
  11287. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11288. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11289. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11290. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11291. });
  11292. };
  11293. Object.defineProperty(exports, "__esModule", { value: true });
  11294. const tr = __webpack_require__(9);
  11295. /**
  11296. * Exec a command.
  11297. * Output will be streamed to the live console.
  11298. * Returns promise with return code
  11299. *
  11300. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  11301. * @param args optional arguments for tool. Escaping is handled by the lib.
  11302. * @param options optional exec options. See ExecOptions
  11303. * @returns Promise<number> exit code
  11304. */
  11305. function exec(commandLine, args, options) {
  11306. return __awaiter(this, void 0, void 0, function* () {
  11307. const commandArgs = tr.argStringToArray(commandLine);
  11308. if (commandArgs.length === 0) {
  11309. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  11310. }
  11311. // Path to tool to execute should be first arg
  11312. const toolPath = commandArgs[0];
  11313. args = commandArgs.slice(1).concat(args || []);
  11314. const runner = new tr.ToolRunner(toolPath, args, options);
  11315. return runner.exec();
  11316. });
  11317. }
  11318. exports.exec = exec;
  11319. //# sourceMappingURL=exec.js.map
  11320. /***/ }),
  11321. /***/ 991:
  11322. /***/ (function(module, __unusedexports, __webpack_require__) {
  11323. module.exports = authenticationRequestError;
  11324. const { RequestError } = __webpack_require__(463);
  11325. function authenticationRequestError(state, error, options) {
  11326. if (!error.headers) throw error;
  11327. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  11328. // handle "2FA required" error only
  11329. if (error.status !== 401 || !otpRequired) {
  11330. throw error;
  11331. }
  11332. if (
  11333. error.status === 401 &&
  11334. otpRequired &&
  11335. error.request &&
  11336. error.request.headers["x-github-otp"]
  11337. ) {
  11338. if (state.otp) {
  11339. delete state.otp; // no longer valid, request again
  11340. } else {
  11341. throw new RequestError(
  11342. "Invalid one-time password for two-factor authentication",
  11343. 401,
  11344. {
  11345. headers: error.headers,
  11346. request: options
  11347. }
  11348. );
  11349. }
  11350. }
  11351. if (typeof state.auth.on2fa !== "function") {
  11352. throw new RequestError(
  11353. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  11354. 401,
  11355. {
  11356. headers: error.headers,
  11357. request: options
  11358. }
  11359. );
  11360. }
  11361. return Promise.resolve()
  11362. .then(() => {
  11363. return state.auth.on2fa();
  11364. })
  11365. .then(oneTimePassword => {
  11366. const newOptions = Object.assign(options, {
  11367. headers: Object.assign(options.headers, {
  11368. "x-github-otp": oneTimePassword
  11369. })
  11370. });
  11371. return state.octokit.request(newOptions).then(response => {
  11372. // If OTP still valid, then persist it for following requests
  11373. state.otp = oneTimePassword;
  11374. return response;
  11375. });
  11376. });
  11377. }
  11378. /***/ })
  11379. /******/ });