index.js 1008 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803
  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__(104);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 2:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. var AWS = __webpack_require__(395);
  48. var util = __webpack_require__(153);
  49. var Rest = __webpack_require__(618);
  50. function populateBody(req) {
  51. var input = req.service.api.operations[req.operation].input;
  52. var builder = new AWS.XML.Builder();
  53. var params = req.params;
  54. var payload = input.payload;
  55. if (payload) {
  56. var payloadMember = input.members[payload];
  57. params = params[payload];
  58. if (params === undefined) return;
  59. if (payloadMember.type === 'structure') {
  60. var rootElement = payloadMember.name;
  61. req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true);
  62. } else { // non-xml payload
  63. req.httpRequest.body = params;
  64. }
  65. } else {
  66. req.httpRequest.body = builder.toXML(params, input, input.name ||
  67. input.shape || util.string.upperFirst(req.operation) + 'Request');
  68. }
  69. }
  70. function buildRequest(req) {
  71. Rest.buildRequest(req);
  72. // never send body payload on GET/HEAD
  73. if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) {
  74. populateBody(req);
  75. }
  76. }
  77. function extractError(resp) {
  78. Rest.extractError(resp);
  79. var data;
  80. try {
  81. data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString());
  82. } catch (e) {
  83. data = {
  84. Code: resp.httpResponse.statusCode,
  85. Message: resp.httpResponse.statusMessage
  86. };
  87. }
  88. if (data.Errors) data = data.Errors;
  89. if (data.Error) data = data.Error;
  90. if (data.Code) {
  91. resp.error = util.error(new Error(), {
  92. code: data.Code,
  93. message: data.Message
  94. });
  95. } else {
  96. resp.error = util.error(new Error(), {
  97. code: resp.httpResponse.statusCode,
  98. message: null
  99. });
  100. }
  101. }
  102. function extractData(resp) {
  103. Rest.extractData(resp);
  104. var parser;
  105. var req = resp.request;
  106. var body = resp.httpResponse.body;
  107. var operation = req.service.api.operations[req.operation];
  108. var output = operation.output;
  109. var hasEventOutput = operation.hasEventOutput;
  110. var payload = output.payload;
  111. if (payload) {
  112. var payloadMember = output.members[payload];
  113. if (payloadMember.isEventStream) {
  114. parser = new AWS.XML.Parser();
  115. resp.data[payload] = util.createEventStream(
  116. AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body,
  117. parser,
  118. payloadMember
  119. );
  120. } else if (payloadMember.type === 'structure') {
  121. parser = new AWS.XML.Parser();
  122. resp.data[payload] = parser.parse(body.toString(), payloadMember);
  123. } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) {
  124. resp.data[payload] = body;
  125. } else {
  126. resp.data[payload] = payloadMember.toType(body);
  127. }
  128. } else if (body.length > 0) {
  129. parser = new AWS.XML.Parser();
  130. var data = parser.parse(body.toString(), output);
  131. util.update(resp.data, data);
  132. }
  133. }
  134. /**
  135. * @api private
  136. */
  137. module.exports = {
  138. buildRequest: buildRequest,
  139. extractError: extractError,
  140. extractData: extractData
  141. };
  142. /***/ }),
  143. /***/ 16:
  144. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  145. var AWS = __webpack_require__(395);
  146. var v4Credentials = __webpack_require__(819);
  147. var resolveRegionalEndpointsFlag = __webpack_require__(232);
  148. var s3util = __webpack_require__(338);
  149. var regionUtil = __webpack_require__(546);
  150. // Pull in managed upload extension
  151. __webpack_require__(856);
  152. /**
  153. * @api private
  154. */
  155. var operationsWith200StatusCodeError = {
  156. 'completeMultipartUpload': true,
  157. 'copyObject': true,
  158. 'uploadPartCopy': true
  159. };
  160. /**
  161. * @api private
  162. */
  163. var regionRedirectErrorCodes = [
  164. 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints
  165. 'BadRequest', // head operations on virtual-hosted global bucket endpoints
  166. 'PermanentRedirect', // non-head operations on path-style or regional endpoints
  167. 301 // head operations on path-style or regional endpoints
  168. ];
  169. AWS.util.update(AWS.S3.prototype, {
  170. /**
  171. * @api private
  172. */
  173. getSignatureVersion: function getSignatureVersion(request) {
  174. var defaultApiVersion = this.api.signatureVersion;
  175. var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null;
  176. var regionDefinedVersion = this.config.signatureVersion;
  177. var isPresigned = request ? request.isPresigned() : false;
  178. /*
  179. 1) User defined version specified:
  180. a) always return user defined version
  181. 2) No user defined version specified:
  182. a) If not using presigned urls, default to V4
  183. b) If using presigned urls, default to lowest version the region supports
  184. */
  185. if (userDefinedVersion) {
  186. userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion;
  187. return userDefinedVersion;
  188. }
  189. if (isPresigned !== true) {
  190. defaultApiVersion = 'v4';
  191. } else if (regionDefinedVersion) {
  192. defaultApiVersion = regionDefinedVersion;
  193. }
  194. return defaultApiVersion;
  195. },
  196. /**
  197. * @api private
  198. */
  199. getSigningName: function getSigningName() {
  200. var _super = AWS.Service.prototype.getSigningName;
  201. return (this._parsedArn && this._parsedArn.service)
  202. ? this._parsedArn.service
  203. : _super.call(this);
  204. },
  205. /**
  206. * @api private
  207. */
  208. getSignerClass: function getSignerClass(request) {
  209. var signatureVersion = this.getSignatureVersion(request);
  210. return AWS.Signers.RequestSigner.getVersion(signatureVersion);
  211. },
  212. /**
  213. * @api private
  214. */
  215. validateService: function validateService() {
  216. var msg;
  217. var messages = [];
  218. // default to us-east-1 when no region is provided
  219. if (!this.config.region) this.config.region = 'us-east-1';
  220. if (!this.config.endpoint && this.config.s3BucketEndpoint) {
  221. messages.push('An endpoint must be provided when configuring ' +
  222. '`s3BucketEndpoint` to true.');
  223. }
  224. if (messages.length === 1) {
  225. msg = messages[0];
  226. } else if (messages.length > 1) {
  227. msg = 'Multiple configuration errors:\n' + messages.join('\n');
  228. }
  229. if (msg) {
  230. throw AWS.util.error(new Error(),
  231. {name: 'InvalidEndpoint', message: msg});
  232. }
  233. },
  234. /**
  235. * @api private
  236. */
  237. shouldDisableBodySigning: function shouldDisableBodySigning(request) {
  238. var signerClass = this.getSignerClass();
  239. if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4
  240. && request.httpRequest.endpoint.protocol === 'https:') {
  241. return true;
  242. }
  243. return false;
  244. },
  245. /**
  246. * @api private
  247. */
  248. setupRequestListeners: function setupRequestListeners(request) {
  249. var prependListener = true;
  250. request.addListener('validate', this.validateScheme);
  251. request.addListener('validate', this.validateBucketName, prependListener);
  252. request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener);
  253. request.removeListener('validate',
  254. AWS.EventListeners.Core.VALIDATE_REGION);
  255. request.addListener('build', this.addContentType);
  256. request.addListener('build', this.computeContentMd5);
  257. request.addListener('build', this.computeSseCustomerKeyMd5);
  258. request.addListener('build', this.populateURI);
  259. request.addListener('afterBuild', this.addExpect100Continue);
  260. request.addListener('extractError', this.extractError);
  261. request.addListener('extractData', AWS.util.hoistPayloadMember);
  262. request.addListener('extractData', this.extractData);
  263. request.addListener('extractData', this.extractErrorFrom200Response);
  264. request.addListener('beforePresign', this.prepareSignedUrl);
  265. if (this.shouldDisableBodySigning(request)) {
  266. request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256);
  267. request.addListener('afterBuild', this.disableBodySigning);
  268. }
  269. //deal with ARNs supplied to Bucket
  270. if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) {
  271. // avoid duplicate parsing in the future
  272. request.service._parsedArn = AWS.util.ARN.parse(request.params.Bucket);
  273. request.removeListener('validate', this.validateBucketName);
  274. request.removeListener('build', this.populateURI);
  275. if (request.service._parsedArn.service === 's3') {
  276. request.addListener('validate', s3util.validateS3AccessPointArn);
  277. request.addListener('validate', this.validateArnResourceType);
  278. } else if (request.service._parsedArn.service === 's3-outposts') {
  279. request.addListener('validate', s3util.validateOutpostsAccessPointArn);
  280. request.addListener('validate', s3util.validateOutpostsArn);
  281. }
  282. request.addListener('validate', s3util.validateArnRegion);
  283. request.addListener('validate', s3util.validateArnAccount);
  284. request.addListener('validate', s3util.validateArnService);
  285. request.addListener('build', this.populateUriFromAccessPointArn);
  286. request.addListener('build', s3util.validatePopulateUriFromArn);
  287. return;
  288. }
  289. //listeners regarding region inference
  290. request.addListener('validate', this.validateBucketEndpoint);
  291. request.addListener('validate', this.correctBucketRegionFromCache);
  292. request.onAsync('extractError', this.requestBucketRegion);
  293. if (AWS.util.isBrowser()) {
  294. request.onAsync('retry', this.reqRegionForNetworkingError);
  295. }
  296. },
  297. /**
  298. * @api private
  299. */
  300. validateScheme: function(req) {
  301. var params = req.params,
  302. scheme = req.httpRequest.endpoint.protocol,
  303. sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey;
  304. if (sensitive && scheme !== 'https:') {
  305. var msg = 'Cannot send SSE keys over HTTP. Set \'sslEnabled\'' +
  306. 'to \'true\' in your configuration';
  307. throw AWS.util.error(new Error(),
  308. { code: 'ConfigError', message: msg });
  309. }
  310. },
  311. /**
  312. * @api private
  313. */
  314. validateBucketEndpoint: function(req) {
  315. if (!req.params.Bucket && req.service.config.s3BucketEndpoint) {
  316. var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.';
  317. throw AWS.util.error(new Error(),
  318. { code: 'ConfigError', message: msg });
  319. }
  320. },
  321. /**
  322. * Validate resource-type supplied in S3 ARN
  323. */
  324. validateArnResourceType: function validateArnResourceType(req) {
  325. var resource = req.service._parsedArn.resource;
  326. if (
  327. resource.indexOf('accesspoint:') !== 0 &&
  328. resource.indexOf('accesspoint/') !== 0
  329. ) {
  330. throw AWS.util.error(new Error(), {
  331. code: 'InvalidARN',
  332. message: 'ARN resource should begin with \'accesspoint/\''
  333. });
  334. }
  335. },
  336. /**
  337. * @api private
  338. */
  339. validateBucketName: function validateBucketName(req) {
  340. var service = req.service;
  341. var signatureVersion = service.getSignatureVersion(req);
  342. var bucket = req.params && req.params.Bucket;
  343. var key = req.params && req.params.Key;
  344. var slashIndex = bucket && bucket.indexOf('/');
  345. if (bucket && slashIndex >= 0) {
  346. if (typeof key === 'string' && slashIndex > 0) {
  347. req.params = AWS.util.copy(req.params);
  348. // Need to include trailing slash to match sigv2 behavior
  349. var prefix = bucket.substr(slashIndex + 1) || '';
  350. req.params.Key = prefix + '/' + key;
  351. req.params.Bucket = bucket.substr(0, slashIndex);
  352. } else if (signatureVersion === 'v4') {
  353. var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket;
  354. throw AWS.util.error(new Error(),
  355. { code: 'InvalidBucket', message: msg });
  356. }
  357. }
  358. },
  359. /**
  360. * @api private
  361. */
  362. isValidAccelerateOperation: function isValidAccelerateOperation(operation) {
  363. var invalidOperations = [
  364. 'createBucket',
  365. 'deleteBucket',
  366. 'listBuckets'
  367. ];
  368. return invalidOperations.indexOf(operation) === -1;
  369. },
  370. /**
  371. * When us-east-1 region endpoint configuration is set, in stead of sending request to
  372. * global endpoint(e.g. 's3.amazonaws.com'), we will send request to
  373. * 's3.us-east-1.amazonaws.com'.
  374. * @api private
  375. */
  376. optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) {
  377. var service = req.service;
  378. var config = service.config;
  379. config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, {
  380. env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT',
  381. sharedConfig: 's3_us_east_1_regional_endpoint',
  382. clientConfig: 's3UsEast1RegionalEndpoint'
  383. });
  384. if (
  385. !(service._originalConfig || {}).endpoint &&
  386. req.httpRequest.region === 'us-east-1' &&
  387. config.s3UsEast1RegionalEndpoint === 'regional' &&
  388. req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0
  389. ) {
  390. var insertPoint = config.endpoint.indexOf('.amazonaws.com');
  391. regionalEndpoint = config.endpoint.substring(0, insertPoint) +
  392. '.us-east-1' + config.endpoint.substring(insertPoint);
  393. req.httpRequest.updateEndpoint(regionalEndpoint);
  394. }
  395. },
  396. /**
  397. * S3 prefers dns-compatible bucket names to be moved from the uri path
  398. * to the hostname as a sub-domain. This is not possible, even for dns-compat
  399. * buckets when using SSL and the bucket name contains a dot ('.'). The
  400. * ssl wildcard certificate is only 1-level deep.
  401. *
  402. * @api private
  403. */
  404. populateURI: function populateURI(req) {
  405. var httpRequest = req.httpRequest;
  406. var b = req.params.Bucket;
  407. var service = req.service;
  408. var endpoint = httpRequest.endpoint;
  409. if (b) {
  410. if (!service.pathStyleBucketName(b)) {
  411. if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) {
  412. if (service.config.useDualstack) {
  413. endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com';
  414. } else {
  415. endpoint.hostname = b + '.s3-accelerate.amazonaws.com';
  416. }
  417. } else if (!service.config.s3BucketEndpoint) {
  418. endpoint.hostname =
  419. b + '.' + endpoint.hostname;
  420. }
  421. var port = endpoint.port;
  422. if (port !== 80 && port !== 443) {
  423. endpoint.host = endpoint.hostname + ':' +
  424. endpoint.port;
  425. } else {
  426. endpoint.host = endpoint.hostname;
  427. }
  428. httpRequest.virtualHostedBucket = b; // needed for signing the request
  429. service.removeVirtualHostedBucketFromPath(req);
  430. }
  431. }
  432. },
  433. /**
  434. * Takes the bucket name out of the path if bucket is virtual-hosted
  435. *
  436. * @api private
  437. */
  438. removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) {
  439. var httpRequest = req.httpRequest;
  440. var bucket = httpRequest.virtualHostedBucket;
  441. if (bucket && httpRequest.path) {
  442. if (req.params && req.params.Key) {
  443. var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key);
  444. if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) {
  445. //path only contains key or path contains only key and querystring
  446. return;
  447. }
  448. }
  449. httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), '');
  450. if (httpRequest.path[0] !== '/') {
  451. httpRequest.path = '/' + httpRequest.path;
  452. }
  453. }
  454. },
  455. /**
  456. * When user supply an access point ARN in the Bucket parameter, we need to
  457. * populate the URI according to the ARN.
  458. */
  459. populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) {
  460. var accessPointArn = req.service._parsedArn;
  461. var isOutpostArn = accessPointArn.service === 's3-outposts';
  462. var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: '';
  463. var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint';
  464. var dualStackSuffix = !isOutpostArn && req.service.config.useDualstack ? '.dualstack' : '';
  465. var endpoint = req.httpRequest.endpoint;
  466. var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region);
  467. var useArnRegion = req.service.config.s3UseArnRegion;
  468. endpoint.hostname = [
  469. accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix,
  470. serviceName + dualStackSuffix,
  471. useArnRegion ? accessPointArn.region : req.service.config.region,
  472. dnsSuffix
  473. ].join('.');
  474. endpoint.host = endpoint.hostname;
  475. var encodedArn = AWS.util.uriEscape(req.params.Bucket);
  476. var path = req.httpRequest.path;
  477. //remove the Bucket value from path
  478. req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), '');
  479. if (req.httpRequest.path[0] !== '/') {
  480. req.httpRequest.path = '/' + req.httpRequest.path;
  481. }
  482. req.httpRequest.region = accessPointArn.region; //region used to sign
  483. },
  484. /**
  485. * Adds Expect: 100-continue header if payload is greater-or-equal 1MB
  486. * @api private
  487. */
  488. addExpect100Continue: function addExpect100Continue(req) {
  489. var len = req.httpRequest.headers['Content-Length'];
  490. if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) {
  491. req.httpRequest.headers['Expect'] = '100-continue';
  492. }
  493. },
  494. /**
  495. * Adds a default content type if none is supplied.
  496. *
  497. * @api private
  498. */
  499. addContentType: function addContentType(req) {
  500. var httpRequest = req.httpRequest;
  501. if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') {
  502. // Content-Type is not set in GET/HEAD requests
  503. delete httpRequest.headers['Content-Type'];
  504. return;
  505. }
  506. if (!httpRequest.headers['Content-Type']) { // always have a Content-Type
  507. httpRequest.headers['Content-Type'] = 'application/octet-stream';
  508. }
  509. var contentType = httpRequest.headers['Content-Type'];
  510. if (AWS.util.isBrowser()) {
  511. if (typeof httpRequest.body === 'string' && !contentType.match(/;\s*charset=/)) {
  512. var charset = '; charset=UTF-8';
  513. httpRequest.headers['Content-Type'] += charset;
  514. } else {
  515. var replaceFn = function(_, prefix, charsetName) {
  516. return prefix + charsetName.toUpperCase();
  517. };
  518. httpRequest.headers['Content-Type'] =
  519. contentType.replace(/(;\s*charset=)(.+)$/, replaceFn);
  520. }
  521. }
  522. },
  523. /**
  524. * @api private
  525. */
  526. computableChecksumOperations: {
  527. putBucketCors: true,
  528. putBucketLifecycle: true,
  529. putBucketLifecycleConfiguration: true,
  530. putBucketTagging: true,
  531. deleteObjects: true,
  532. putBucketReplication: true,
  533. putObjectLegalHold: true,
  534. putObjectRetention: true,
  535. putObjectLockConfiguration: true
  536. },
  537. /**
  538. * Checks whether checksums should be computed for the request.
  539. * If the request requires checksums to be computed, this will always
  540. * return true, otherwise it depends on whether {AWS.Config.computeChecksums}
  541. * is set.
  542. *
  543. * @param req [AWS.Request] the request to check against
  544. * @return [Boolean] whether to compute checksums for a request.
  545. * @api private
  546. */
  547. willComputeChecksums: function willComputeChecksums(req) {
  548. if (this.computableChecksumOperations[req.operation]) return true;
  549. if (!this.config.computeChecksums) return false;
  550. // TODO: compute checksums for Stream objects
  551. if (!AWS.util.Buffer.isBuffer(req.httpRequest.body) &&
  552. typeof req.httpRequest.body !== 'string') {
  553. return false;
  554. }
  555. var rules = req.service.api.operations[req.operation].input.members;
  556. // Sha256 signing disabled, and not a presigned url
  557. if (req.service.shouldDisableBodySigning(req) && !Object.prototype.hasOwnProperty.call(req.httpRequest.headers, 'presigned-expires')) {
  558. if (rules.ContentMD5 && !req.params.ContentMD5) {
  559. return true;
  560. }
  561. }
  562. // V4 signer uses SHA256 signatures so only compute MD5 if it is required
  563. if (req.service.getSignerClass(req) === AWS.Signers.V4) {
  564. if (rules.ContentMD5 && !rules.ContentMD5.required) return false;
  565. }
  566. if (rules.ContentMD5 && !req.params.ContentMD5) return true;
  567. },
  568. /**
  569. * A listener that computes the Content-MD5 and sets it in the header.
  570. * @see AWS.S3.willComputeChecksums
  571. * @api private
  572. */
  573. computeContentMd5: function computeContentMd5(req) {
  574. if (req.service.willComputeChecksums(req)) {
  575. var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64');
  576. req.httpRequest.headers['Content-MD5'] = md5;
  577. }
  578. },
  579. /**
  580. * @api private
  581. */
  582. computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) {
  583. var keys = {
  584. SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5',
  585. CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5'
  586. };
  587. AWS.util.each(keys, function(key, header) {
  588. if (req.params[key]) {
  589. var value = AWS.util.crypto.md5(req.params[key], 'base64');
  590. req.httpRequest.headers[header] = value;
  591. }
  592. });
  593. },
  594. /**
  595. * Returns true if the bucket name should be left in the URI path for
  596. * a request to S3. This function takes into account the current
  597. * endpoint protocol (e.g. http or https).
  598. *
  599. * @api private
  600. */
  601. pathStyleBucketName: function pathStyleBucketName(bucketName) {
  602. // user can force path style requests via the configuration
  603. if (this.config.s3ForcePathStyle) return true;
  604. if (this.config.s3BucketEndpoint) return false;
  605. if (s3util.dnsCompatibleBucketName(bucketName)) {
  606. return (this.config.sslEnabled && bucketName.match(/\./)) ? true : false;
  607. } else {
  608. return true; // not dns compatible names must always use path style
  609. }
  610. },
  611. /**
  612. * For COPY operations, some can be error even with status code 200.
  613. * SDK treats the response as exception when response body indicates
  614. * an exception or body is empty.
  615. *
  616. * @api private
  617. */
  618. extractErrorFrom200Response: function extractErrorFrom200Response(resp) {
  619. if (!operationsWith200StatusCodeError[resp.request.operation]) return;
  620. var httpResponse = resp.httpResponse;
  621. if (httpResponse.body && httpResponse.body.toString().match('<Error>')) {
  622. // Response body with '<Error>...</Error>' indicates an exception.
  623. // Get S3 client object. In ManagedUpload, this.service refers to
  624. // S3 client object.
  625. resp.data = null;
  626. var service = this.service ? this.service : this;
  627. service.extractError(resp);
  628. throw resp.error;
  629. } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\w_]/)) {
  630. // When body is empty or incomplete, S3 might stop the request on detecting client
  631. // side aborting the request.
  632. resp.data = null;
  633. throw AWS.util.error(new Error(), {
  634. code: 'InternalError',
  635. message: 'S3 aborted request'
  636. });
  637. }
  638. },
  639. /**
  640. * @return [Boolean] whether the error can be retried
  641. * @api private
  642. */
  643. retryableError: function retryableError(error, request) {
  644. if (operationsWith200StatusCodeError[request.operation] &&
  645. error.statusCode === 200) {
  646. return true;
  647. } else if (request._requestRegionForBucket &&
  648. request.service.bucketRegionCache[request._requestRegionForBucket]) {
  649. return false;
  650. } else if (error && error.code === 'RequestTimeout') {
  651. return true;
  652. } else if (error &&
  653. regionRedirectErrorCodes.indexOf(error.code) != -1 &&
  654. error.region && error.region != request.httpRequest.region) {
  655. request.httpRequest.region = error.region;
  656. if (error.statusCode === 301) {
  657. request.service.updateReqBucketRegion(request);
  658. }
  659. return true;
  660. } else {
  661. var _super = AWS.Service.prototype.retryableError;
  662. return _super.call(this, error, request);
  663. }
  664. },
  665. /**
  666. * Updates httpRequest with region. If region is not provided, then
  667. * the httpRequest will be updated based on httpRequest.region
  668. *
  669. * @api private
  670. */
  671. updateReqBucketRegion: function updateReqBucketRegion(request, region) {
  672. var httpRequest = request.httpRequest;
  673. if (typeof region === 'string' && region.length) {
  674. httpRequest.region = region;
  675. }
  676. if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) {
  677. return;
  678. }
  679. var service = request.service;
  680. var s3Config = service.config;
  681. var s3BucketEndpoint = s3Config.s3BucketEndpoint;
  682. if (s3BucketEndpoint) {
  683. delete s3Config.s3BucketEndpoint;
  684. }
  685. var newConfig = AWS.util.copy(s3Config);
  686. delete newConfig.endpoint;
  687. newConfig.region = httpRequest.region;
  688. httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint;
  689. service.populateURI(request);
  690. s3Config.s3BucketEndpoint = s3BucketEndpoint;
  691. httpRequest.headers.Host = httpRequest.endpoint.host;
  692. if (request._asm.currentState === 'validate') {
  693. request.removeListener('build', service.populateURI);
  694. request.addListener('build', service.removeVirtualHostedBucketFromPath);
  695. }
  696. },
  697. /**
  698. * Provides a specialized parser for getBucketLocation -- all other
  699. * operations are parsed by the super class.
  700. *
  701. * @api private
  702. */
  703. extractData: function extractData(resp) {
  704. var req = resp.request;
  705. if (req.operation === 'getBucketLocation') {
  706. var match = resp.httpResponse.body.toString().match(/>(.+)<\/Location/);
  707. delete resp.data['_'];
  708. if (match) {
  709. resp.data.LocationConstraint = match[1];
  710. } else {
  711. resp.data.LocationConstraint = '';
  712. }
  713. }
  714. var bucket = req.params.Bucket || null;
  715. if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) {
  716. req.service.clearBucketRegionCache(bucket);
  717. } else {
  718. var headers = resp.httpResponse.headers || {};
  719. var region = headers['x-amz-bucket-region'] || null;
  720. if (!region && req.operation === 'createBucket' && !resp.error) {
  721. var createBucketConfiguration = req.params.CreateBucketConfiguration;
  722. if (!createBucketConfiguration) {
  723. region = 'us-east-1';
  724. } else if (createBucketConfiguration.LocationConstraint === 'EU') {
  725. region = 'eu-west-1';
  726. } else {
  727. region = createBucketConfiguration.LocationConstraint;
  728. }
  729. }
  730. if (region) {
  731. if (bucket && region !== req.service.bucketRegionCache[bucket]) {
  732. req.service.bucketRegionCache[bucket] = region;
  733. }
  734. }
  735. }
  736. req.service.extractRequestIds(resp);
  737. },
  738. /**
  739. * Extracts an error object from the http response.
  740. *
  741. * @api private
  742. */
  743. extractError: function extractError(resp) {
  744. var codes = {
  745. 304: 'NotModified',
  746. 403: 'Forbidden',
  747. 400: 'BadRequest',
  748. 404: 'NotFound'
  749. };
  750. var req = resp.request;
  751. var code = resp.httpResponse.statusCode;
  752. var body = resp.httpResponse.body || '';
  753. var headers = resp.httpResponse.headers || {};
  754. var region = headers['x-amz-bucket-region'] || null;
  755. var bucket = req.params.Bucket || null;
  756. var bucketRegionCache = req.service.bucketRegionCache;
  757. if (region && bucket && region !== bucketRegionCache[bucket]) {
  758. bucketRegionCache[bucket] = region;
  759. }
  760. var cachedRegion;
  761. if (codes[code] && body.length === 0) {
  762. if (bucket && !region) {
  763. cachedRegion = bucketRegionCache[bucket] || null;
  764. if (cachedRegion !== req.httpRequest.region) {
  765. region = cachedRegion;
  766. }
  767. }
  768. resp.error = AWS.util.error(new Error(), {
  769. code: codes[code],
  770. message: null,
  771. region: region
  772. });
  773. } else {
  774. var data = new AWS.XML.Parser().parse(body.toString());
  775. if (data.Region && !region) {
  776. region = data.Region;
  777. if (bucket && region !== bucketRegionCache[bucket]) {
  778. bucketRegionCache[bucket] = region;
  779. }
  780. } else if (bucket && !region && !data.Region) {
  781. cachedRegion = bucketRegionCache[bucket] || null;
  782. if (cachedRegion !== req.httpRequest.region) {
  783. region = cachedRegion;
  784. }
  785. }
  786. resp.error = AWS.util.error(new Error(), {
  787. code: data.Code || code,
  788. message: data.Message || null,
  789. region: region
  790. });
  791. }
  792. req.service.extractRequestIds(resp);
  793. },
  794. /**
  795. * If region was not obtained synchronously, then send async request
  796. * to get bucket region for errors resulting from wrong region.
  797. *
  798. * @api private
  799. */
  800. requestBucketRegion: function requestBucketRegion(resp, done) {
  801. var error = resp.error;
  802. var req = resp.request;
  803. var bucket = req.params.Bucket || null;
  804. if (!error || !bucket || error.region || req.operation === 'listObjects' ||
  805. (AWS.util.isNode() && req.operation === 'headBucket') ||
  806. (error.statusCode === 400 && req.operation !== 'headObject') ||
  807. regionRedirectErrorCodes.indexOf(error.code) === -1) {
  808. return done();
  809. }
  810. var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects';
  811. var reqParams = {Bucket: bucket};
  812. if (reqOperation === 'listObjects') reqParams.MaxKeys = 0;
  813. var regionReq = req.service[reqOperation](reqParams);
  814. regionReq._requestRegionForBucket = bucket;
  815. regionReq.send(function() {
  816. var region = req.service.bucketRegionCache[bucket] || null;
  817. error.region = region;
  818. done();
  819. });
  820. },
  821. /**
  822. * For browser only. If NetworkingError received, will attempt to obtain
  823. * the bucket region.
  824. *
  825. * @api private
  826. */
  827. reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) {
  828. if (!AWS.util.isBrowser()) {
  829. return done();
  830. }
  831. var error = resp.error;
  832. var request = resp.request;
  833. var bucket = request.params.Bucket;
  834. if (!error || error.code !== 'NetworkingError' || !bucket ||
  835. request.httpRequest.region === 'us-east-1') {
  836. return done();
  837. }
  838. var service = request.service;
  839. var bucketRegionCache = service.bucketRegionCache;
  840. var cachedRegion = bucketRegionCache[bucket] || null;
  841. if (cachedRegion && cachedRegion !== request.httpRequest.region) {
  842. service.updateReqBucketRegion(request, cachedRegion);
  843. done();
  844. } else if (!s3util.dnsCompatibleBucketName(bucket)) {
  845. service.updateReqBucketRegion(request, 'us-east-1');
  846. if (bucketRegionCache[bucket] !== 'us-east-1') {
  847. bucketRegionCache[bucket] = 'us-east-1';
  848. }
  849. done();
  850. } else if (request.httpRequest.virtualHostedBucket) {
  851. var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0});
  852. service.updateReqBucketRegion(getRegionReq, 'us-east-1');
  853. getRegionReq._requestRegionForBucket = bucket;
  854. getRegionReq.send(function() {
  855. var region = service.bucketRegionCache[bucket] || null;
  856. if (region && region !== request.httpRequest.region) {
  857. service.updateReqBucketRegion(request, region);
  858. }
  859. done();
  860. });
  861. } else {
  862. // DNS-compatible path-style
  863. // (s3ForcePathStyle or bucket name with dot over https)
  864. // Cannot obtain region information for this case
  865. done();
  866. }
  867. },
  868. /**
  869. * Cache for bucket region.
  870. *
  871. * @api private
  872. */
  873. bucketRegionCache: {},
  874. /**
  875. * Clears bucket region cache.
  876. *
  877. * @api private
  878. */
  879. clearBucketRegionCache: function(buckets) {
  880. var bucketRegionCache = this.bucketRegionCache;
  881. if (!buckets) {
  882. buckets = Object.keys(bucketRegionCache);
  883. } else if (typeof buckets === 'string') {
  884. buckets = [buckets];
  885. }
  886. for (var i = 0; i < buckets.length; i++) {
  887. delete bucketRegionCache[buckets[i]];
  888. }
  889. return bucketRegionCache;
  890. },
  891. /**
  892. * Corrects request region if bucket's cached region is different
  893. *
  894. * @api private
  895. */
  896. correctBucketRegionFromCache: function correctBucketRegionFromCache(req) {
  897. var bucket = req.params.Bucket || null;
  898. if (bucket) {
  899. var service = req.service;
  900. var requestRegion = req.httpRequest.region;
  901. var cachedRegion = service.bucketRegionCache[bucket];
  902. if (cachedRegion && cachedRegion !== requestRegion) {
  903. service.updateReqBucketRegion(req, cachedRegion);
  904. }
  905. }
  906. },
  907. /**
  908. * Extracts S3 specific request ids from the http response.
  909. *
  910. * @api private
  911. */
  912. extractRequestIds: function extractRequestIds(resp) {
  913. var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null;
  914. var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null;
  915. resp.extendedRequestId = extendedRequestId;
  916. resp.cfId = cfId;
  917. if (resp.error) {
  918. resp.error.requestId = resp.requestId || null;
  919. resp.error.extendedRequestId = extendedRequestId;
  920. resp.error.cfId = cfId;
  921. }
  922. },
  923. /**
  924. * Get a pre-signed URL for a given operation name.
  925. *
  926. * @note You must ensure that you have static or previously resolved
  927. * credentials if you call this method synchronously (with no callback),
  928. * otherwise it may not properly sign the request. If you cannot guarantee
  929. * this (you are using an asynchronous credential provider, i.e., EC2
  930. * IAM roles), you should always call this method with an asynchronous
  931. * callback.
  932. * @note Not all operation parameters are supported when using pre-signed
  933. * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,
  934. * `ContentLength`, or `Tagging` must be provided as headers when sending a
  935. * request. If you are using pre-signed URLs to upload from a browser and
  936. * need to use these fields, see {createPresignedPost}.
  937. * @note The default signer allows altering the request by adding corresponding
  938. * headers to set some parameters (e.g. Range) and these added parameters
  939. * won't be signed. You must use signatureVersion v4 to to include these
  940. * parameters in the signed portion of the URL and enforce exact matching
  941. * between headers and signed params in the URL.
  942. * @note This operation cannot be used with a promise. See note above regarding
  943. * asynchronous credentials and use with a callback.
  944. * @param operation [String] the name of the operation to call
  945. * @param params [map] parameters to pass to the operation. See the given
  946. * operation for the expected operation parameters. In addition, you can
  947. * also pass the "Expires" parameter to inform S3 how long the URL should
  948. * work for.
  949. * @option params Expires [Integer] (900) the number of seconds to expire
  950. * the pre-signed URL operation in. Defaults to 15 minutes.
  951. * @param callback [Function] if a callback is provided, this function will
  952. * pass the URL as the second parameter (after the error parameter) to
  953. * the callback function.
  954. * @return [String] if called synchronously (with no callback), returns the
  955. * signed URL.
  956. * @return [null] nothing is returned if a callback is provided.
  957. * @example Pre-signing a getObject operation (synchronously)
  958. * var params = {Bucket: 'bucket', Key: 'key'};
  959. * var url = s3.getSignedUrl('getObject', params);
  960. * console.log('The URL is', url);
  961. * @example Pre-signing a putObject (asynchronously)
  962. * var params = {Bucket: 'bucket', Key: 'key'};
  963. * s3.getSignedUrl('putObject', params, function (err, url) {
  964. * console.log('The URL is', url);
  965. * });
  966. * @example Pre-signing a putObject operation with a specific payload
  967. * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};
  968. * var url = s3.getSignedUrl('putObject', params);
  969. * console.log('The URL is', url);
  970. * @example Passing in a 1-minute expiry time for a pre-signed URL
  971. * var params = {Bucket: 'bucket', Key: 'key', Expires: 60};
  972. * var url = s3.getSignedUrl('getObject', params);
  973. * console.log('The URL is', url); // expires in 60 seconds
  974. */
  975. getSignedUrl: function getSignedUrl(operation, params, callback) {
  976. params = AWS.util.copy(params || {});
  977. var expires = params.Expires || 900;
  978. if (typeof expires !== 'number') {
  979. throw AWS.util.error(new Error(),
  980. { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires });
  981. }
  982. delete params.Expires; // we can't validate this
  983. var request = this.makeRequest(operation, params);
  984. if (callback) {
  985. AWS.util.defer(function() {
  986. request.presign(expires, callback);
  987. });
  988. } else {
  989. return request.presign(expires, callback);
  990. }
  991. },
  992. /**
  993. * @!method getSignedUrlPromise()
  994. * Returns a 'thenable' promise that will be resolved with a pre-signed URL
  995. * for a given operation name.
  996. *
  997. * Two callbacks can be provided to the `then` method on the returned promise.
  998. * The first callback will be called if the promise is fulfilled, and the second
  999. * callback will be called if the promise is rejected.
  1000. * @note Not all operation parameters are supported when using pre-signed
  1001. * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,
  1002. * `ContentLength`, or `Tagging` must be provided as headers when sending a
  1003. * request. If you are using pre-signed URLs to upload from a browser and
  1004. * need to use these fields, see {createPresignedPost}.
  1005. * @param operation [String] the name of the operation to call
  1006. * @param params [map] parameters to pass to the operation. See the given
  1007. * operation for the expected operation parameters. In addition, you can
  1008. * also pass the "Expires" parameter to inform S3 how long the URL should
  1009. * work for.
  1010. * @option params Expires [Integer] (900) the number of seconds to expire
  1011. * the pre-signed URL operation in. Defaults to 15 minutes.
  1012. * @callback fulfilledCallback function(url)
  1013. * Called if the promise is fulfilled.
  1014. * @param url [String] the signed url
  1015. * @callback rejectedCallback function(err)
  1016. * Called if the promise is rejected.
  1017. * @param err [Error] if an error occurred, this value will be filled
  1018. * @return [Promise] A promise that represents the state of the `refresh` call.
  1019. * @example Pre-signing a getObject operation
  1020. * var params = {Bucket: 'bucket', Key: 'key'};
  1021. * var promise = s3.getSignedUrlPromise('getObject', params);
  1022. * promise.then(function(url) {
  1023. * console.log('The URL is', url);
  1024. * }, function(err) { ... });
  1025. * @example Pre-signing a putObject operation with a specific payload
  1026. * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};
  1027. * var promise = s3.getSignedUrlPromise('putObject', params);
  1028. * promise.then(function(url) {
  1029. * console.log('The URL is', url);
  1030. * }, function(err) { ... });
  1031. * @example Passing in a 1-minute expiry time for a pre-signed URL
  1032. * var params = {Bucket: 'bucket', Key: 'key', Expires: 60};
  1033. * var promise = s3.getSignedUrlPromise('getObject', params);
  1034. * promise.then(function(url) {
  1035. * console.log('The URL is', url);
  1036. * }, function(err) { ... });
  1037. */
  1038. /**
  1039. * Get a pre-signed POST policy to support uploading to S3 directly from an
  1040. * HTML form.
  1041. *
  1042. * @param params [map]
  1043. * @option params Bucket [String] The bucket to which the post should be
  1044. * uploaded
  1045. * @option params Expires [Integer] (3600) The number of seconds for which
  1046. * the presigned policy should be valid.
  1047. * @option params Conditions [Array] An array of conditions that must be met
  1048. * for the presigned policy to allow the
  1049. * upload. This can include required tags,
  1050. * the accepted range for content lengths,
  1051. * etc.
  1052. * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html
  1053. * @option params Fields [map] Fields to include in the form. All
  1054. * values passed in as fields will be
  1055. * signed as exact match conditions.
  1056. * @param callback [Function]
  1057. *
  1058. * @note All fields passed in when creating presigned post data will be signed
  1059. * as exact match conditions. Any fields that will be interpolated by S3
  1060. * must be added to the fields hash after signing, and an appropriate
  1061. * condition for such fields must be explicitly added to the Conditions
  1062. * array passed to this function before signing.
  1063. *
  1064. * @example Presiging post data with a known key
  1065. * var params = {
  1066. * Bucket: 'bucket',
  1067. * Fields: {
  1068. * key: 'key'
  1069. * }
  1070. * };
  1071. * s3.createPresignedPost(params, function(err, data) {
  1072. * if (err) {
  1073. * console.error('Presigning post data encountered an error', err);
  1074. * } else {
  1075. * console.log('The post data is', data);
  1076. * }
  1077. * });
  1078. *
  1079. * @example Presigning post data with an interpolated key
  1080. * var params = {
  1081. * Bucket: 'bucket',
  1082. * Conditions: [
  1083. * ['starts-with', '$key', 'path/to/uploads/']
  1084. * ]
  1085. * };
  1086. * s3.createPresignedPost(params, function(err, data) {
  1087. * if (err) {
  1088. * console.error('Presigning post data encountered an error', err);
  1089. * } else {
  1090. * data.Fields.key = 'path/to/uploads/${filename}';
  1091. * console.log('The post data is', data);
  1092. * }
  1093. * });
  1094. *
  1095. * @note You must ensure that you have static or previously resolved
  1096. * credentials if you call this method synchronously (with no callback),
  1097. * otherwise it may not properly sign the request. If you cannot guarantee
  1098. * this (you are using an asynchronous credential provider, i.e., EC2
  1099. * IAM roles), you should always call this method with an asynchronous
  1100. * callback.
  1101. *
  1102. * @return [map] If called synchronously (with no callback), returns a hash
  1103. * with the url to set as the form action and a hash of fields
  1104. * to include in the form.
  1105. * @return [null] Nothing is returned if a callback is provided.
  1106. *
  1107. * @callback callback function (err, data)
  1108. * @param err [Error] the error object returned from the policy signer
  1109. * @param data [map] The data necessary to construct an HTML form
  1110. * @param data.url [String] The URL to use as the action of the form
  1111. * @param data.fields [map] A hash of fields that must be included in the
  1112. * form for the upload to succeed. This hash will
  1113. * include the signed POST policy, your access key
  1114. * ID and security token (if present), etc. These
  1115. * may be safely included as input elements of type
  1116. * 'hidden.'
  1117. */
  1118. createPresignedPost: function createPresignedPost(params, callback) {
  1119. if (typeof params === 'function' && callback === undefined) {
  1120. callback = params;
  1121. params = null;
  1122. }
  1123. params = AWS.util.copy(params || {});
  1124. var boundParams = this.config.params || {};
  1125. var bucket = params.Bucket || boundParams.Bucket,
  1126. self = this,
  1127. config = this.config,
  1128. endpoint = AWS.util.copy(this.endpoint);
  1129. if (!config.s3BucketEndpoint) {
  1130. endpoint.pathname = '/' + bucket;
  1131. }
  1132. function finalizePost() {
  1133. return {
  1134. url: AWS.util.urlFormat(endpoint),
  1135. fields: self.preparePostFields(
  1136. config.credentials,
  1137. config.region,
  1138. bucket,
  1139. params.Fields,
  1140. params.Conditions,
  1141. params.Expires
  1142. )
  1143. };
  1144. }
  1145. if (callback) {
  1146. config.getCredentials(function (err) {
  1147. if (err) {
  1148. callback(err);
  1149. } else {
  1150. try {
  1151. callback(null, finalizePost());
  1152. } catch (err) {
  1153. callback(err);
  1154. }
  1155. }
  1156. });
  1157. } else {
  1158. return finalizePost();
  1159. }
  1160. },
  1161. /**
  1162. * @api private
  1163. */
  1164. preparePostFields: function preparePostFields(
  1165. credentials,
  1166. region,
  1167. bucket,
  1168. fields,
  1169. conditions,
  1170. expiresInSeconds
  1171. ) {
  1172. var now = this.getSkewCorrectedDate();
  1173. if (!credentials || !region || !bucket) {
  1174. throw new Error('Unable to create a POST object policy without a bucket,'
  1175. + ' region, and credentials');
  1176. }
  1177. fields = AWS.util.copy(fields || {});
  1178. conditions = (conditions || []).slice(0);
  1179. expiresInSeconds = expiresInSeconds || 3600;
  1180. var signingDate = AWS.util.date.iso8601(now).replace(/[:\-]|\.\d{3}/g, '');
  1181. var shortDate = signingDate.substr(0, 8);
  1182. var scope = v4Credentials.createScope(shortDate, region, 's3');
  1183. var credential = credentials.accessKeyId + '/' + scope;
  1184. fields['bucket'] = bucket;
  1185. fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256';
  1186. fields['X-Amz-Credential'] = credential;
  1187. fields['X-Amz-Date'] = signingDate;
  1188. if (credentials.sessionToken) {
  1189. fields['X-Amz-Security-Token'] = credentials.sessionToken;
  1190. }
  1191. for (var field in fields) {
  1192. if (fields.hasOwnProperty(field)) {
  1193. var condition = {};
  1194. condition[field] = fields[field];
  1195. conditions.push(condition);
  1196. }
  1197. }
  1198. fields.Policy = this.preparePostPolicy(
  1199. new Date(now.valueOf() + expiresInSeconds * 1000),
  1200. conditions
  1201. );
  1202. fields['X-Amz-Signature'] = AWS.util.crypto.hmac(
  1203. v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true),
  1204. fields.Policy,
  1205. 'hex'
  1206. );
  1207. return fields;
  1208. },
  1209. /**
  1210. * @api private
  1211. */
  1212. preparePostPolicy: function preparePostPolicy(expiration, conditions) {
  1213. return AWS.util.base64.encode(JSON.stringify({
  1214. expiration: AWS.util.date.iso8601(expiration),
  1215. conditions: conditions
  1216. }));
  1217. },
  1218. /**
  1219. * @api private
  1220. */
  1221. prepareSignedUrl: function prepareSignedUrl(request) {
  1222. request.addListener('validate', request.service.noPresignedContentLength);
  1223. request.removeListener('build', request.service.addContentType);
  1224. if (!request.params.Body) {
  1225. // no Content-MD5/SHA-256 if body is not provided
  1226. request.removeListener('build', request.service.computeContentMd5);
  1227. } else {
  1228. request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256);
  1229. }
  1230. },
  1231. /**
  1232. * @api private
  1233. * @param request
  1234. */
  1235. disableBodySigning: function disableBodySigning(request) {
  1236. var headers = request.httpRequest.headers;
  1237. // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined
  1238. if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) {
  1239. headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD';
  1240. }
  1241. },
  1242. /**
  1243. * @api private
  1244. */
  1245. noPresignedContentLength: function noPresignedContentLength(request) {
  1246. if (request.params.ContentLength !== undefined) {
  1247. throw AWS.util.error(new Error(), {code: 'UnexpectedParameter',
  1248. message: 'ContentLength is not supported in pre-signed URLs.'});
  1249. }
  1250. },
  1251. createBucket: function createBucket(params, callback) {
  1252. // When creating a bucket *outside* the classic region, the location
  1253. // constraint must be set for the bucket and it must match the endpoint.
  1254. // This chunk of code will set the location constraint param based
  1255. // on the region (when possible), but it will not override a passed-in
  1256. // location constraint.
  1257. if (typeof params === 'function' || !params) {
  1258. callback = callback || params;
  1259. params = {};
  1260. }
  1261. var hostname = this.endpoint.hostname;
  1262. // copy params so that appending keys does not unintentioinallly
  1263. // mutate params object argument passed in by user
  1264. var copiedParams = AWS.util.copy(params);
  1265. if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) {
  1266. copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region };
  1267. }
  1268. return this.makeRequest('createBucket', copiedParams, callback);
  1269. },
  1270. /**
  1271. * @see AWS.S3.ManagedUpload
  1272. * @overload upload(params = {}, [options], [callback])
  1273. * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent
  1274. * concurrent handling of parts if the payload is large enough. You can
  1275. * configure the concurrent queue size by setting `options`. Note that this
  1276. * is the only operation for which the SDK can retry requests with stream
  1277. * bodies.
  1278. *
  1279. * @param (see AWS.S3.putObject)
  1280. * @option (see AWS.S3.ManagedUpload.constructor)
  1281. * @return [AWS.S3.ManagedUpload] the managed upload object that can call
  1282. * `send()` or track progress.
  1283. * @example Uploading a stream object
  1284. * var params = {Bucket: 'bucket', Key: 'key', Body: stream};
  1285. * s3.upload(params, function(err, data) {
  1286. * console.log(err, data);
  1287. * });
  1288. * @example Uploading a stream with concurrency of 1 and partSize of 10mb
  1289. * var params = {Bucket: 'bucket', Key: 'key', Body: stream};
  1290. * var options = {partSize: 10 * 1024 * 1024, queueSize: 1};
  1291. * s3.upload(params, options, function(err, data) {
  1292. * console.log(err, data);
  1293. * });
  1294. * @callback callback function(err, data)
  1295. * @param err [Error] an error or null if no error occurred.
  1296. * @param data [map] The response data from the successful upload:
  1297. * @param data.Location [String] the URL of the uploaded object
  1298. * @param data.ETag [String] the ETag of the uploaded object
  1299. * @param data.Bucket [String] the bucket to which the object was uploaded
  1300. * @param data.Key [String] the key to which the object was uploaded
  1301. */
  1302. upload: function upload(params, options, callback) {
  1303. if (typeof options === 'function' && callback === undefined) {
  1304. callback = options;
  1305. options = null;
  1306. }
  1307. options = options || {};
  1308. options = AWS.util.merge(options || {}, {service: this, params: params});
  1309. var uploader = new AWS.S3.ManagedUpload(options);
  1310. if (typeof callback === 'function') uploader.send(callback);
  1311. return uploader;
  1312. }
  1313. });
  1314. /**
  1315. * @api private
  1316. */
  1317. AWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) {
  1318. this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency);
  1319. };
  1320. /**
  1321. * @api private
  1322. */
  1323. AWS.S3.deletePromisesFromClass = function deletePromisesFromClass() {
  1324. delete this.prototype.getSignedUrlPromise;
  1325. };
  1326. AWS.util.addPromises(AWS.S3);
  1327. /***/ }),
  1328. /***/ 19:
  1329. /***/ (function(module, __unusedexports, __webpack_require__) {
  1330. // Generated by CoffeeScript 1.12.7
  1331. (function() {
  1332. var XMLDTDNotation, XMLNode,
  1333. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1334. hasProp = {}.hasOwnProperty;
  1335. XMLNode = __webpack_require__(855);
  1336. module.exports = XMLDTDNotation = (function(superClass) {
  1337. extend(XMLDTDNotation, superClass);
  1338. function XMLDTDNotation(parent, name, value) {
  1339. XMLDTDNotation.__super__.constructor.call(this, parent);
  1340. if (name == null) {
  1341. throw new Error("Missing notation name");
  1342. }
  1343. if (!value.pubID && !value.sysID) {
  1344. throw new Error("Public or system identifiers are required for an external entity");
  1345. }
  1346. this.name = this.stringify.eleName(name);
  1347. if (value.pubID != null) {
  1348. this.pubID = this.stringify.dtdPubID(value.pubID);
  1349. }
  1350. if (value.sysID != null) {
  1351. this.sysID = this.stringify.dtdSysID(value.sysID);
  1352. }
  1353. }
  1354. XMLDTDNotation.prototype.toString = function(options) {
  1355. return this.options.writer.set(options).dtdNotation(this);
  1356. };
  1357. return XMLDTDNotation;
  1358. })(XMLNode);
  1359. }).call(this);
  1360. /***/ }),
  1361. /***/ 22:
  1362. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  1363. var AWS = __webpack_require__(395);
  1364. var STS = __webpack_require__(733);
  1365. var iniLoader = AWS.util.iniLoader;
  1366. var ASSUME_ROLE_DEFAULT_REGION = 'us-east-1';
  1367. /**
  1368. * Represents credentials loaded from shared credentials file
  1369. * (defaulting to ~/.aws/credentials or defined by the
  1370. * `AWS_SHARED_CREDENTIALS_FILE` environment variable).
  1371. *
  1372. * ## Using the shared credentials file
  1373. *
  1374. * This provider is checked by default in the Node.js environment. To use the
  1375. * credentials file provider, simply add your access and secret keys to the
  1376. * ~/.aws/credentials file in the following format:
  1377. *
  1378. * [default]
  1379. * aws_access_key_id = AKID...
  1380. * aws_secret_access_key = YOUR_SECRET_KEY
  1381. *
  1382. * ## Using custom profiles
  1383. *
  1384. * The SDK supports loading credentials for separate profiles. This can be done
  1385. * in two ways:
  1386. *
  1387. * 1. Set the `AWS_PROFILE` environment variable in your process prior to
  1388. * loading the SDK.
  1389. * 2. Directly load the AWS.SharedIniFileCredentials provider:
  1390. *
  1391. * ```javascript
  1392. * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'});
  1393. * AWS.config.credentials = creds;
  1394. * ```
  1395. *
  1396. * @!macro nobrowser
  1397. */
  1398. AWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, {
  1399. /**
  1400. * Creates a new SharedIniFileCredentials object.
  1401. *
  1402. * @param options [map] a set of options
  1403. * @option options profile [String] (AWS_PROFILE env var or 'default')
  1404. * the name of the profile to load.
  1405. * @option options filename [String] ('~/.aws/credentials' or defined by
  1406. * AWS_SHARED_CREDENTIALS_FILE process env var)
  1407. * the filename to use when loading credentials.
  1408. * @option options disableAssumeRole [Boolean] (false) True to disable
  1409. * support for profiles that assume an IAM role. If true, and an assume
  1410. * role profile is selected, an error is raised.
  1411. * @option options preferStaticCredentials [Boolean] (false) True to
  1412. * prefer static credentials to role_arn if both are present.
  1413. * @option options tokenCodeFn [Function] (null) Function to provide
  1414. * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini
  1415. * file. Function is called with value of mfa_serial and callback, and
  1416. * should provide the TokenCode or an error to the callback in the format
  1417. * callback(err, token)
  1418. * @option options callback [Function] (err) Credentials are eagerly loaded
  1419. * by the constructor. When the callback is called with no error, the
  1420. * credentials have been loaded successfully.
  1421. * @option options httpOptions [map] A set of options to pass to the low-level
  1422. * HTTP request. Currently supported options are:
  1423. * * **proxy** [String] &mdash; the URL to proxy requests through
  1424. * * **agent** [http.Agent, https.Agent] &mdash; the Agent object to perform
  1425. * HTTP requests with. Used for connection pooling. Defaults to the global
  1426. * agent (`http.globalAgent`) for non-SSL connections. Note that for
  1427. * SSL connections, a special Agent object is used in order to enable
  1428. * peer certificate verification. This feature is only available in the
  1429. * Node.js environment.
  1430. * * **connectTimeout** [Integer] &mdash; Sets the socket to timeout after
  1431. * failing to establish a connection with the server after
  1432. * `connectTimeout` milliseconds. This timeout has no effect once a socket
  1433. * connection has been established.
  1434. * * **timeout** [Integer] &mdash; The number of milliseconds a request can
  1435. * take before automatically being terminated.
  1436. * Defaults to two minutes (120000).
  1437. */
  1438. constructor: function SharedIniFileCredentials(options) {
  1439. AWS.Credentials.call(this);
  1440. options = options || {};
  1441. this.filename = options.filename;
  1442. this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;
  1443. this.disableAssumeRole = Boolean(options.disableAssumeRole);
  1444. this.preferStaticCredentials = Boolean(options.preferStaticCredentials);
  1445. this.tokenCodeFn = options.tokenCodeFn || null;
  1446. this.httpOptions = options.httpOptions || null;
  1447. this.get(options.callback || AWS.util.fn.noop);
  1448. },
  1449. /**
  1450. * @api private
  1451. */
  1452. load: function load(callback) {
  1453. var self = this;
  1454. try {
  1455. var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);
  1456. var profile = profiles[this.profile] || {};
  1457. if (Object.keys(profile).length === 0) {
  1458. throw AWS.util.error(
  1459. new Error('Profile ' + this.profile + ' not found'),
  1460. { code: 'SharedIniFileCredentialsProviderFailure' }
  1461. );
  1462. }
  1463. /*
  1464. In the CLI, the presence of both a role_arn and static credentials have
  1465. different meanings depending on how many profiles have been visited. For
  1466. the first profile processed, role_arn takes precedence over any static
  1467. credentials, but for all subsequent profiles, static credentials are
  1468. used if present, and only in their absence will the profile's
  1469. source_profile and role_arn keys be used to load another set of
  1470. credentials. This var is intended to yield compatible behaviour in this
  1471. sdk.
  1472. */
  1473. var preferStaticCredentialsToRoleArn = Boolean(
  1474. this.preferStaticCredentials
  1475. && profile['aws_access_key_id']
  1476. && profile['aws_secret_access_key']
  1477. );
  1478. if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) {
  1479. this.loadRoleProfile(profiles, profile, function(err, data) {
  1480. if (err) {
  1481. callback(err);
  1482. } else {
  1483. self.expired = false;
  1484. self.accessKeyId = data.Credentials.AccessKeyId;
  1485. self.secretAccessKey = data.Credentials.SecretAccessKey;
  1486. self.sessionToken = data.Credentials.SessionToken;
  1487. self.expireTime = data.Credentials.Expiration;
  1488. callback(null);
  1489. }
  1490. });
  1491. return;
  1492. }
  1493. this.accessKeyId = profile['aws_access_key_id'];
  1494. this.secretAccessKey = profile['aws_secret_access_key'];
  1495. this.sessionToken = profile['aws_session_token'];
  1496. if (!this.accessKeyId || !this.secretAccessKey) {
  1497. throw AWS.util.error(
  1498. new Error('Credentials not set for profile ' + this.profile),
  1499. { code: 'SharedIniFileCredentialsProviderFailure' }
  1500. );
  1501. }
  1502. this.expired = false;
  1503. callback(null);
  1504. } catch (err) {
  1505. callback(err);
  1506. }
  1507. },
  1508. /**
  1509. * Loads the credentials from the shared credentials file
  1510. *
  1511. * @callback callback function(err)
  1512. * Called after the shared INI file on disk is read and parsed. When this
  1513. * callback is called with no error, it means that the credentials
  1514. * information has been loaded into the object (as the `accessKeyId`,
  1515. * `secretAccessKey`, and `sessionToken` properties).
  1516. * @param err [Error] if an error occurred, this value will be filled
  1517. * @see get
  1518. */
  1519. refresh: function refresh(callback) {
  1520. iniLoader.clearCachedFiles();
  1521. this.coalesceRefresh(
  1522. callback || AWS.util.fn.callback,
  1523. this.disableAssumeRole
  1524. );
  1525. },
  1526. /**
  1527. * @api private
  1528. */
  1529. loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) {
  1530. if (this.disableAssumeRole) {
  1531. throw AWS.util.error(
  1532. new Error('Role assumption profiles are disabled. ' +
  1533. 'Failed to load profile ' + this.profile +
  1534. ' from ' + creds.filename),
  1535. { code: 'SharedIniFileCredentialsProviderFailure' }
  1536. );
  1537. }
  1538. var self = this;
  1539. var roleArn = roleProfile['role_arn'];
  1540. var roleSessionName = roleProfile['role_session_name'];
  1541. var externalId = roleProfile['external_id'];
  1542. var mfaSerial = roleProfile['mfa_serial'];
  1543. var sourceProfileName = roleProfile['source_profile'];
  1544. // From experimentation, the following behavior mimics the AWS CLI:
  1545. //
  1546. // 1. Use region from the profile if present.
  1547. // 2. Otherwise fall back to N. Virginia (global endpoint).
  1548. //
  1549. // It is necessary to do the fallback explicitly, because if
  1550. // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will
  1551. // otherwise throw an error if region is left 'undefined'.
  1552. //
  1553. // Experimentation shows that the AWS CLI (tested at version 1.18.136)
  1554. // ignores the following potential sources of a region for the purposes of
  1555. // this AssumeRole call:
  1556. //
  1557. // - The [default] profile
  1558. // - The AWS_REGION environment variable
  1559. //
  1560. // Ignoring the [default] profile for the purposes of AssumeRole is arguably
  1561. // a bug in the CLI since it does use the [default] region for service
  1562. // calls... but right now we're matching behavior of the other tool.
  1563. var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION;
  1564. if (!sourceProfileName) {
  1565. throw AWS.util.error(
  1566. new Error('source_profile is not set using profile ' + this.profile),
  1567. { code: 'SharedIniFileCredentialsProviderFailure' }
  1568. );
  1569. }
  1570. var sourceProfileExistanceTest = creds[sourceProfileName];
  1571. if (typeof sourceProfileExistanceTest !== 'object') {
  1572. throw AWS.util.error(
  1573. new Error('source_profile ' + sourceProfileName + ' using profile '
  1574. + this.profile + ' does not exist'),
  1575. { code: 'SharedIniFileCredentialsProviderFailure' }
  1576. );
  1577. }
  1578. var sourceCredentials = new AWS.SharedIniFileCredentials(
  1579. AWS.util.merge(this.options || {}, {
  1580. profile: sourceProfileName,
  1581. preferStaticCredentials: true
  1582. })
  1583. );
  1584. this.roleArn = roleArn;
  1585. var sts = new STS({
  1586. credentials: sourceCredentials,
  1587. region: profileRegion,
  1588. httpOptions: this.httpOptions
  1589. });
  1590. var roleParams = {
  1591. RoleArn: roleArn,
  1592. RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now()
  1593. };
  1594. if (externalId) {
  1595. roleParams.ExternalId = externalId;
  1596. }
  1597. if (mfaSerial && self.tokenCodeFn) {
  1598. roleParams.SerialNumber = mfaSerial;
  1599. self.tokenCodeFn(mfaSerial, function(err, token) {
  1600. if (err) {
  1601. var message;
  1602. if (err instanceof Error) {
  1603. message = err.message;
  1604. } else {
  1605. message = err;
  1606. }
  1607. callback(
  1608. AWS.util.error(
  1609. new Error('Error fetching MFA token: ' + message),
  1610. { code: 'SharedIniFileCredentialsProviderFailure' }
  1611. ));
  1612. return;
  1613. }
  1614. roleParams.TokenCode = token;
  1615. sts.assumeRole(roleParams, callback);
  1616. });
  1617. return;
  1618. }
  1619. sts.assumeRole(roleParams, callback);
  1620. }
  1621. });
  1622. /***/ }),
  1623. /***/ 35:
  1624. /***/ (function(module, __unusedexports, __webpack_require__) {
  1625. // Generated by CoffeeScript 1.12.7
  1626. (function() {
  1627. var XMLCData, XMLNode,
  1628. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  1629. hasProp = {}.hasOwnProperty;
  1630. XMLNode = __webpack_require__(855);
  1631. module.exports = XMLCData = (function(superClass) {
  1632. extend(XMLCData, superClass);
  1633. function XMLCData(parent, text) {
  1634. XMLCData.__super__.constructor.call(this, parent);
  1635. if (text == null) {
  1636. throw new Error("Missing CDATA text");
  1637. }
  1638. this.text = this.stringify.cdata(text);
  1639. }
  1640. XMLCData.prototype.clone = function() {
  1641. return Object.create(this);
  1642. };
  1643. XMLCData.prototype.toString = function(options) {
  1644. return this.options.writer.set(options).cdata(this);
  1645. };
  1646. return XMLCData;
  1647. })(XMLNode);
  1648. }).call(this);
  1649. /***/ }),
  1650. /***/ 43:
  1651. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  1652. var AWS = __webpack_require__(395);
  1653. var STS = __webpack_require__(733);
  1654. /**
  1655. * Represents temporary credentials retrieved from {AWS.STS}. Without any
  1656. * extra parameters, credentials will be fetched from the
  1657. * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the
  1658. * {AWS.STS.assumeRole} operation will be used to fetch credentials for the
  1659. * role instead.
  1660. *
  1661. * @note AWS.TemporaryCredentials is deprecated, but remains available for
  1662. * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the
  1663. * preferred class for temporary credentials.
  1664. *
  1665. * To setup temporary credentials, configure a set of master credentials
  1666. * using the standard credentials providers (environment, EC2 instance metadata,
  1667. * or from the filesystem), then set the global credentials to a new
  1668. * temporary credentials object:
  1669. *
  1670. * ```javascript
  1671. * // Note that environment credentials are loaded by default,
  1672. * // the following line is shown for clarity:
  1673. * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS');
  1674. *
  1675. * // Now set temporary credentials seeded from the master credentials
  1676. * AWS.config.credentials = new AWS.TemporaryCredentials();
  1677. *
  1678. * // subsequent requests will now use temporary credentials from AWS STS.
  1679. * new AWS.S3().listBucket(function(err, data) { ... });
  1680. * ```
  1681. *
  1682. * @!attribute masterCredentials
  1683. * @return [AWS.Credentials] the master (non-temporary) credentials used to
  1684. * get and refresh temporary credentials from AWS STS.
  1685. * @note (see constructor)
  1686. */
  1687. AWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, {
  1688. /**
  1689. * Creates a new temporary credentials object.
  1690. *
  1691. * @note In order to create temporary credentials, you first need to have
  1692. * "master" credentials configured in {AWS.Config.credentials}. These
  1693. * master credentials are necessary to retrieve the temporary credentials,
  1694. * as well as refresh the credentials when they expire.
  1695. * @param params [map] a map of options that are passed to the
  1696. * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.
  1697. * If a `RoleArn` parameter is passed in, credentials will be based on the
  1698. * IAM role.
  1699. * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials
  1700. * used to get and refresh temporary credentials from AWS STS.
  1701. * @example Creating a new credentials object for generic temporary credentials
  1702. * AWS.config.credentials = new AWS.TemporaryCredentials();
  1703. * @example Creating a new credentials object for an IAM role
  1704. * AWS.config.credentials = new AWS.TemporaryCredentials({
  1705. * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials',
  1706. * });
  1707. * @see AWS.STS.assumeRole
  1708. * @see AWS.STS.getSessionToken
  1709. */
  1710. constructor: function TemporaryCredentials(params, masterCredentials) {
  1711. AWS.Credentials.call(this);
  1712. this.loadMasterCredentials(masterCredentials);
  1713. this.expired = true;
  1714. this.params = params || {};
  1715. if (this.params.RoleArn) {
  1716. this.params.RoleSessionName =
  1717. this.params.RoleSessionName || 'temporary-credentials';
  1718. }
  1719. },
  1720. /**
  1721. * Refreshes credentials using {AWS.STS.assumeRole} or
  1722. * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed
  1723. * to the credentials {constructor}.
  1724. *
  1725. * @callback callback function(err)
  1726. * Called when the STS service responds (or fails). When
  1727. * this callback is called with no error, it means that the credentials
  1728. * information has been loaded into the object (as the `accessKeyId`,
  1729. * `secretAccessKey`, and `sessionToken` properties).
  1730. * @param err [Error] if an error occurred, this value will be filled
  1731. * @see get
  1732. */
  1733. refresh: function refresh (callback) {
  1734. this.coalesceRefresh(callback || AWS.util.fn.callback);
  1735. },
  1736. /**
  1737. * @api private
  1738. */
  1739. load: function load (callback) {
  1740. var self = this;
  1741. self.createClients();
  1742. self.masterCredentials.get(function () {
  1743. self.service.config.credentials = self.masterCredentials;
  1744. var operation = self.params.RoleArn ?
  1745. self.service.assumeRole : self.service.getSessionToken;
  1746. operation.call(self.service, function (err, data) {
  1747. if (!err) {
  1748. self.service.credentialsFrom(data, self);
  1749. }
  1750. callback(err);
  1751. });
  1752. });
  1753. },
  1754. /**
  1755. * @api private
  1756. */
  1757. loadMasterCredentials: function loadMasterCredentials (masterCredentials) {
  1758. this.masterCredentials = masterCredentials || AWS.config.credentials;
  1759. while (this.masterCredentials.masterCredentials) {
  1760. this.masterCredentials = this.masterCredentials.masterCredentials;
  1761. }
  1762. if (typeof this.masterCredentials.get !== 'function') {
  1763. this.masterCredentials = new AWS.Credentials(this.masterCredentials);
  1764. }
  1765. },
  1766. /**
  1767. * @api private
  1768. */
  1769. createClients: function () {
  1770. this.service = this.service || new STS({params: this.params});
  1771. }
  1772. });
  1773. /***/ }),
  1774. /***/ 56:
  1775. /***/ (function(module) {
  1776. module.exports = {"version":"2.0","metadata":{"apiVersion":"2014-06-30","endpointPrefix":"cognito-identity","jsonVersion":"1.1","protocol":"json","serviceFullName":"Amazon Cognito Identity","serviceId":"Cognito Identity","signatureVersion":"v4","targetPrefix":"AWSCognitoIdentityService","uid":"cognito-identity-2014-06-30"},"operations":{"CreateIdentityPool":{"input":{"type":"structure","required":["IdentityPoolName","AllowUnauthenticatedIdentities"],"members":{"IdentityPoolName":{},"AllowUnauthenticatedIdentities":{"type":"boolean"},"AllowClassicFlow":{"type":"boolean"},"SupportedLoginProviders":{"shape":"S5"},"DeveloperProviderName":{},"OpenIdConnectProviderARNs":{"shape":"S9"},"CognitoIdentityProviders":{"shape":"Sb"},"SamlProviderARNs":{"shape":"Sg"},"IdentityPoolTags":{"shape":"Sh"}}},"output":{"shape":"Sk"}},"DeleteIdentities":{"input":{"type":"structure","required":["IdentityIdsToDelete"],"members":{"IdentityIdsToDelete":{"type":"list","member":{}}}},"output":{"type":"structure","members":{"UnprocessedIdentityIds":{"type":"list","member":{"type":"structure","members":{"IdentityId":{},"ErrorCode":{}}}}}}},"DeleteIdentityPool":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{}}}},"DescribeIdentity":{"input":{"type":"structure","required":["IdentityId"],"members":{"IdentityId":{}}},"output":{"shape":"Sv"}},"DescribeIdentityPool":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{}}},"output":{"shape":"Sk"}},"GetCredentialsForIdentity":{"input":{"type":"structure","required":["IdentityId"],"members":{"IdentityId":{},"Logins":{"shape":"S10"},"CustomRoleArn":{}}},"output":{"type":"structure","members":{"IdentityId":{},"Credentials":{"type":"structure","members":{"AccessKeyId":{},"SecretKey":{},"SessionToken":{},"Expiration":{"type":"timestamp"}}}}},"authtype":"none"},"GetId":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"AccountId":{},"IdentityPoolId":{},"Logins":{"shape":"S10"}}},"output":{"type":"structure","members":{"IdentityId":{}}},"authtype":"none"},"GetIdentityPoolRoles":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{}}},"output":{"type":"structure","members":{"IdentityPoolId":{},"Roles":{"shape":"S1c"},"RoleMappings":{"shape":"S1e"}}}},"GetOpenIdToken":{"input":{"type":"structure","required":["IdentityId"],"members":{"IdentityId":{},"Logins":{"shape":"S10"}}},"output":{"type":"structure","members":{"IdentityId":{},"Token":{}}},"authtype":"none"},"GetOpenIdTokenForDeveloperIdentity":{"input":{"type":"structure","required":["IdentityPoolId","Logins"],"members":{"IdentityPoolId":{},"IdentityId":{},"Logins":{"shape":"S10"},"TokenDuration":{"type":"long"}}},"output":{"type":"structure","members":{"IdentityId":{},"Token":{}}}},"ListIdentities":{"input":{"type":"structure","required":["IdentityPoolId","MaxResults"],"members":{"IdentityPoolId":{},"MaxResults":{"type":"integer"},"NextToken":{},"HideDisabled":{"type":"boolean"}}},"output":{"type":"structure","members":{"IdentityPoolId":{},"Identities":{"type":"list","member":{"shape":"Sv"}},"NextToken":{}}}},"ListIdentityPools":{"input":{"type":"structure","required":["MaxResults"],"members":{"MaxResults":{"type":"integer"},"NextToken":{}}},"output":{"type":"structure","members":{"IdentityPools":{"type":"list","member":{"type":"structure","members":{"IdentityPoolId":{},"IdentityPoolName":{}}}},"NextToken":{}}}},"ListTagsForResource":{"input":{"type":"structure","required":["ResourceArn"],"members":{"ResourceArn":{}}},"output":{"type":"structure","members":{"Tags":{"shape":"Sh"}}}},"LookupDeveloperIdentity":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"IdentityPoolId":{},"IdentityId":{},"DeveloperUserIdentifier":{},"MaxResults":{"type":"integer"},"NextToken":{}}},"output":{"type":"structure","members":{"IdentityId":{},"DeveloperUserIdentifierList":{"type":"list","member":{}},"NextToken":{}}}},"MergeDeveloperIdentities":{"input":{"type":"structure","required":["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],"members":{"SourceUserIdentifier":{},"DestinationUserIdentifier":{},"DeveloperProviderName":{},"IdentityPoolId":{}}},"output":{"type":"structure","members":{"IdentityId":{}}}},"SetIdentityPoolRoles":{"input":{"type":"structure","required":["IdentityPoolId","Roles"],"members":{"IdentityPoolId":{},"Roles":{"shape":"S1c"},"RoleMappings":{"shape":"S1e"}}}},"TagResource":{"input":{"type":"structure","required":["ResourceArn","Tags"],"members":{"ResourceArn":{},"Tags":{"shape":"Sh"}}},"output":{"type":"structure","members":{}}},"UnlinkDeveloperIdentity":{"input":{"type":"structure","required":["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],"members":{"IdentityId":{},"IdentityPoolId":{},"DeveloperProviderName":{},"DeveloperUserIdentifier":{}}}},"UnlinkIdentity":{"input":{"type":"structure","required":["IdentityId","Logins","LoginsToRemove"],"members":{"IdentityId":{},"Logins":{"shape":"S10"},"LoginsToRemove":{"shape":"Sw"}}},"authtype":"none"},"UntagResource":{"input":{"type":"structure","required":["ResourceArn","TagKeys"],"members":{"ResourceArn":{},"TagKeys":{"type":"list","member":{}}}},"output":{"type":"structure","members":{}}},"UpdateIdentityPool":{"input":{"shape":"Sk"},"output":{"shape":"Sk"}}},"shapes":{"S5":{"type":"map","key":{},"value":{}},"S9":{"type":"list","member":{}},"Sb":{"type":"list","member":{"type":"structure","members":{"ProviderName":{},"ClientId":{},"ServerSideTokenCheck":{"type":"boolean"}}}},"Sg":{"type":"list","member":{}},"Sh":{"type":"map","key":{},"value":{}},"Sk":{"type":"structure","required":["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],"members":{"IdentityPoolId":{},"IdentityPoolName":{},"AllowUnauthenticatedIdentities":{"type":"boolean"},"AllowClassicFlow":{"type":"boolean"},"SupportedLoginProviders":{"shape":"S5"},"DeveloperProviderName":{},"OpenIdConnectProviderARNs":{"shape":"S9"},"CognitoIdentityProviders":{"shape":"Sb"},"SamlProviderARNs":{"shape":"Sg"},"IdentityPoolTags":{"shape":"Sh"}}},"Sv":{"type":"structure","members":{"IdentityId":{},"Logins":{"shape":"Sw"},"CreationDate":{"type":"timestamp"},"LastModifiedDate":{"type":"timestamp"}}},"Sw":{"type":"list","member":{}},"S10":{"type":"map","key":{},"value":{}},"S1c":{"type":"map","key":{},"value":{}},"S1e":{"type":"map","key":{},"value":{"type":"structure","required":["Type"],"members":{"Type":{},"AmbiguousRoleResolution":{},"RulesConfiguration":{"type":"structure","required":["Rules"],"members":{"Rules":{"type":"list","member":{"type":"structure","required":["Claim","MatchType","Value","RoleARN"],"members":{"Claim":{},"MatchType":{},"Value":{},"RoleARN":{}}}}}}}}}}};
  1777. /***/ }),
  1778. /***/ 82:
  1779. /***/ (function(__unusedmodule, exports) {
  1780. "use strict";
  1781. // We use any as a valid input type
  1782. /* eslint-disable @typescript-eslint/no-explicit-any */
  1783. Object.defineProperty(exports, "__esModule", { value: true });
  1784. /**
  1785. * Sanitizes an input into a string so it can be passed into issueCommand safely
  1786. * @param input input to sanitize into a string
  1787. */
  1788. function toCommandValue(input) {
  1789. if (input === null || input === undefined) {
  1790. return '';
  1791. }
  1792. else if (typeof input === 'string' || input instanceof String) {
  1793. return input;
  1794. }
  1795. return JSON.stringify(input);
  1796. }
  1797. exports.toCommandValue = toCommandValue;
  1798. //# sourceMappingURL=utils.js.map
  1799. /***/ }),
  1800. /***/ 86:
  1801. /***/ (function(module, __unusedexports, __webpack_require__) {
  1802. var rng = __webpack_require__(139);
  1803. var bytesToUuid = __webpack_require__(722);
  1804. // **`v1()` - Generate time-based UUID**
  1805. //
  1806. // Inspired by https://github.com/LiosK/UUID.js
  1807. // and http://docs.python.org/library/uuid.html
  1808. var _nodeId;
  1809. var _clockseq;
  1810. // Previous uuid creation time
  1811. var _lastMSecs = 0;
  1812. var _lastNSecs = 0;
  1813. // See https://github.com/broofa/node-uuid for API details
  1814. function v1(options, buf, offset) {
  1815. var i = buf && offset || 0;
  1816. var b = buf || [];
  1817. options = options || {};
  1818. var node = options.node || _nodeId;
  1819. var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
  1820. // node and clockseq need to be initialized to random values if they're not
  1821. // specified. We do this lazily to minimize issues related to insufficient
  1822. // system entropy. See #189
  1823. if (node == null || clockseq == null) {
  1824. var seedBytes = rng();
  1825. if (node == null) {
  1826. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  1827. node = _nodeId = [
  1828. seedBytes[0] | 0x01,
  1829. seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
  1830. ];
  1831. }
  1832. if (clockseq == null) {
  1833. // Per 4.2.2, randomize (14 bit) clockseq
  1834. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  1835. }
  1836. }
  1837. // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  1838. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  1839. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  1840. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  1841. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
  1842. // Per 4.2.1.2, use count of uuid's generated during the current clock
  1843. // cycle to simulate higher resolution clock
  1844. var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
  1845. // Time since last uuid creation (in msecs)
  1846. var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
  1847. // Per 4.2.1.2, Bump clockseq on clock regression
  1848. if (dt < 0 && options.clockseq === undefined) {
  1849. clockseq = clockseq + 1 & 0x3fff;
  1850. }
  1851. // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  1852. // time interval
  1853. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  1854. nsecs = 0;
  1855. }
  1856. // Per 4.2.1.2 Throw error if too many uuids are requested
  1857. if (nsecs >= 10000) {
  1858. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  1859. }
  1860. _lastMSecs = msecs;
  1861. _lastNSecs = nsecs;
  1862. _clockseq = clockseq;
  1863. // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  1864. msecs += 12219292800000;
  1865. // `time_low`
  1866. var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  1867. b[i++] = tl >>> 24 & 0xff;
  1868. b[i++] = tl >>> 16 & 0xff;
  1869. b[i++] = tl >>> 8 & 0xff;
  1870. b[i++] = tl & 0xff;
  1871. // `time_mid`
  1872. var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
  1873. b[i++] = tmh >>> 8 & 0xff;
  1874. b[i++] = tmh & 0xff;
  1875. // `time_high_and_version`
  1876. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  1877. b[i++] = tmh >>> 16 & 0xff;
  1878. // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  1879. b[i++] = clockseq >>> 8 | 0x80;
  1880. // `clock_seq_low`
  1881. b[i++] = clockseq & 0xff;
  1882. // `node`
  1883. for (var n = 0; n < 6; ++n) {
  1884. b[i + n] = node[n];
  1885. }
  1886. return buf ? buf : bytesToUuid(b);
  1887. }
  1888. module.exports = v1;
  1889. /***/ }),
  1890. /***/ 87:
  1891. /***/ (function(module) {
  1892. module.exports = require("os");
  1893. /***/ }),
  1894. /***/ 93:
  1895. /***/ (function(module, __unusedexports, __webpack_require__) {
  1896. var Stream = __webpack_require__(413).Stream
  1897. module.exports = legacy
  1898. function legacy (fs) {
  1899. return {
  1900. ReadStream: ReadStream,
  1901. WriteStream: WriteStream
  1902. }
  1903. function ReadStream (path, options) {
  1904. if (!(this instanceof ReadStream)) return new ReadStream(path, options);
  1905. Stream.call(this);
  1906. var self = this;
  1907. this.path = path;
  1908. this.fd = null;
  1909. this.readable = true;
  1910. this.paused = false;
  1911. this.flags = 'r';
  1912. this.mode = 438; /*=0666*/
  1913. this.bufferSize = 64 * 1024;
  1914. options = options || {};
  1915. // Mixin options into this
  1916. var keys = Object.keys(options);
  1917. for (var index = 0, length = keys.length; index < length; index++) {
  1918. var key = keys[index];
  1919. this[key] = options[key];
  1920. }
  1921. if (this.encoding) this.setEncoding(this.encoding);
  1922. if (this.start !== undefined) {
  1923. if ('number' !== typeof this.start) {
  1924. throw TypeError('start must be a Number');
  1925. }
  1926. if (this.end === undefined) {
  1927. this.end = Infinity;
  1928. } else if ('number' !== typeof this.end) {
  1929. throw TypeError('end must be a Number');
  1930. }
  1931. if (this.start > this.end) {
  1932. throw new Error('start must be <= end');
  1933. }
  1934. this.pos = this.start;
  1935. }
  1936. if (this.fd !== null) {
  1937. process.nextTick(function() {
  1938. self._read();
  1939. });
  1940. return;
  1941. }
  1942. fs.open(this.path, this.flags, this.mode, function (err, fd) {
  1943. if (err) {
  1944. self.emit('error', err);
  1945. self.readable = false;
  1946. return;
  1947. }
  1948. self.fd = fd;
  1949. self.emit('open', fd);
  1950. self._read();
  1951. })
  1952. }
  1953. function WriteStream (path, options) {
  1954. if (!(this instanceof WriteStream)) return new WriteStream(path, options);
  1955. Stream.call(this);
  1956. this.path = path;
  1957. this.fd = null;
  1958. this.writable = true;
  1959. this.flags = 'w';
  1960. this.encoding = 'binary';
  1961. this.mode = 438; /*=0666*/
  1962. this.bytesWritten = 0;
  1963. options = options || {};
  1964. // Mixin options into this
  1965. var keys = Object.keys(options);
  1966. for (var index = 0, length = keys.length; index < length; index++) {
  1967. var key = keys[index];
  1968. this[key] = options[key];
  1969. }
  1970. if (this.start !== undefined) {
  1971. if ('number' !== typeof this.start) {
  1972. throw TypeError('start must be a Number');
  1973. }
  1974. if (this.start < 0) {
  1975. throw new Error('start must be >= zero');
  1976. }
  1977. this.pos = this.start;
  1978. }
  1979. this.busy = false;
  1980. this._queue = [];
  1981. if (this.fd === null) {
  1982. this._open = fs.open;
  1983. this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
  1984. this.flush();
  1985. }
  1986. }
  1987. }
  1988. /***/ }),
  1989. /***/ 102:
  1990. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1991. "use strict";
  1992. // For internal use, subject to change.
  1993. var __importStar = (this && this.__importStar) || function (mod) {
  1994. if (mod && mod.__esModule) return mod;
  1995. var result = {};
  1996. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1997. result["default"] = mod;
  1998. return result;
  1999. };
  2000. Object.defineProperty(exports, "__esModule", { value: true });
  2001. // We use any as a valid input type
  2002. /* eslint-disable @typescript-eslint/no-explicit-any */
  2003. const fs = __importStar(__webpack_require__(747));
  2004. const os = __importStar(__webpack_require__(87));
  2005. const utils_1 = __webpack_require__(82);
  2006. function issueCommand(command, message) {
  2007. const filePath = process.env[`GITHUB_${command}`];
  2008. if (!filePath) {
  2009. throw new Error(`Unable to find environment variable for file command ${command}`);
  2010. }
  2011. if (!fs.existsSync(filePath)) {
  2012. throw new Error(`Missing file at path: ${filePath}`);
  2013. }
  2014. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2015. encoding: 'utf8'
  2016. });
  2017. }
  2018. exports.issueCommand = issueCommand;
  2019. //# sourceMappingURL=file-command.js.map
  2020. /***/ }),
  2021. /***/ 103:
  2022. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  2023. var AWS = __webpack_require__(395);
  2024. __webpack_require__(751);
  2025. /**
  2026. * Represents credentials received from the metadata service on an EC2 instance.
  2027. *
  2028. * By default, this class will connect to the metadata service using
  2029. * {AWS.MetadataService} and attempt to load any available credentials. If it
  2030. * can connect, and credentials are available, these will be used with zero
  2031. * configuration.
  2032. *
  2033. * This credentials class will by default timeout after 1 second of inactivity
  2034. * and retry 3 times.
  2035. * If your requests to the EC2 metadata service are timing out, you can increase
  2036. * these values by configuring them directly:
  2037. *
  2038. * ```javascript
  2039. * AWS.config.credentials = new AWS.EC2MetadataCredentials({
  2040. * httpOptions: { timeout: 5000 }, // 5 second timeout
  2041. * maxRetries: 10, // retry 10 times
  2042. * retryDelayOptions: { base: 200 } // see AWS.Config for information
  2043. * });
  2044. *
  2045. * If your requests are timing out in connecting to the metadata service, such
  2046. * as when testing on a development machine, you can use the connectTimeout
  2047. * option, specified in milliseconds, which also defaults to 1 second.
  2048. * ```
  2049. *
  2050. * @see AWS.Config.retryDelayOptions
  2051. *
  2052. * @!macro nobrowser
  2053. */
  2054. AWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, {
  2055. constructor: function EC2MetadataCredentials(options) {
  2056. AWS.Credentials.call(this);
  2057. options = options ? AWS.util.copy(options) : {};
  2058. options = AWS.util.merge(
  2059. {maxRetries: this.defaultMaxRetries}, options);
  2060. if (!options.httpOptions) options.httpOptions = {};
  2061. options.httpOptions = AWS.util.merge(
  2062. {timeout: this.defaultTimeout,
  2063. connectTimeout: this.defaultConnectTimeout},
  2064. options.httpOptions);
  2065. this.metadataService = new AWS.MetadataService(options);
  2066. this.metadata = {};
  2067. },
  2068. /**
  2069. * @api private
  2070. */
  2071. defaultTimeout: 1000,
  2072. /**
  2073. * @api private
  2074. */
  2075. defaultConnectTimeout: 1000,
  2076. /**
  2077. * @api private
  2078. */
  2079. defaultMaxRetries: 3,
  2080. /**
  2081. * Loads the credentials from the instance metadata service
  2082. *
  2083. * @callback callback function(err)
  2084. * Called when the instance metadata service responds (or fails). When
  2085. * this callback is called with no error, it means that the credentials
  2086. * information has been loaded into the object (as the `accessKeyId`,
  2087. * `secretAccessKey`, and `sessionToken` properties).
  2088. * @param err [Error] if an error occurred, this value will be filled
  2089. * @see get
  2090. */
  2091. refresh: function refresh(callback) {
  2092. this.coalesceRefresh(callback || AWS.util.fn.callback);
  2093. },
  2094. /**
  2095. * @api private
  2096. * @param callback
  2097. */
  2098. load: function load(callback) {
  2099. var self = this;
  2100. self.metadataService.loadCredentials(function(err, creds) {
  2101. if (!err) {
  2102. var currentTime = AWS.util.date.getDate();
  2103. var expireTime = new Date(creds.Expiration);
  2104. if (expireTime < currentTime) {
  2105. err = AWS.util.error(
  2106. new Error('EC2 Instance Metadata Serivce provided expired credentials'),
  2107. { code: 'EC2MetadataCredentialsProviderFailure' }
  2108. );
  2109. } else {
  2110. self.expired = false;
  2111. self.metadata = creds;
  2112. self.accessKeyId = creds.AccessKeyId;
  2113. self.secretAccessKey = creds.SecretAccessKey;
  2114. self.sessionToken = creds.Token;
  2115. self.expireTime = expireTime;
  2116. }
  2117. }
  2118. callback(err);
  2119. });
  2120. }
  2121. });
  2122. /***/ }),
  2123. /***/ 104:
  2124. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  2125. const core = __webpack_require__(470);
  2126. const S3 = __webpack_require__(777);
  2127. const fs = __webpack_require__(747);
  2128. const path = __webpack_require__(622);
  2129. const shortid = __webpack_require__(354);
  2130. const klawSync = __webpack_require__(502);
  2131. const slash = __webpack_require__(143);
  2132. const { lookup } = __webpack_require__(779);
  2133. const AWS_KEY_ID = core.getInput('aws_key_id', {
  2134. required: true
  2135. });
  2136. const SECRET_ACCESS_KEY = core.getInput('aws_secret_access_key', {
  2137. required: true
  2138. });
  2139. const BUCKET = core.getInput('aws_bucket', {
  2140. required: true
  2141. });
  2142. const SOURCE_DIR = core.getInput('source_dir', {
  2143. required: true
  2144. });
  2145. const DESTINATION_DIR = core.getInput('destination_dir', {
  2146. required: false
  2147. });
  2148. const s3 = new S3({
  2149. accessKeyId: AWS_KEY_ID,
  2150. secretAccessKey: SECRET_ACCESS_KEY
  2151. });
  2152. const destinationDir = DESTINATION_DIR === '/' ? shortid() : DESTINATION_DIR;
  2153. const paths = klawSync(SOURCE_DIR, {
  2154. nodir: true
  2155. });
  2156. function upload(params) {
  2157. return new Promise(resolve => {
  2158. s3.upload(params, (err, data) => {
  2159. if (err) core.error(err);
  2160. core.info(`uploaded - ${data.Key}`);
  2161. core.info(`located - ${data.Location}`);
  2162. resolve(data.Location);
  2163. });
  2164. });
  2165. }
  2166. function run() {
  2167. const sourceDir = slash(path.join(process.cwd(), SOURCE_DIR));
  2168. return Promise.all(
  2169. paths.map(p => {
  2170. const fileStream = fs.createReadStream(p.path);
  2171. const bucketPath = slash(path.join(destinationDir, slash(path.relative(sourceDir, p.path))));
  2172. const params = {
  2173. Bucket: BUCKET,
  2174. ACL: 'public-read',
  2175. Body: fileStream,
  2176. Key: bucketPath,
  2177. ContentType: lookup(p.path) || 'text/plain'
  2178. };
  2179. return upload(params);
  2180. })
  2181. );
  2182. }
  2183. run()
  2184. .then(locations => {
  2185. core.info(`object key - ${destinationDir}`);
  2186. core.info(`object locations - ${locations}`);
  2187. core.setOutput('object_key', destinationDir);
  2188. core.setOutput('object_locations', locations);
  2189. })
  2190. .catch(err => {
  2191. core.error(err);
  2192. core.setFailed(err.message);
  2193. });
  2194. /***/ }),
  2195. /***/ 120:
  2196. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2197. "use strict";
  2198. Object.defineProperty(exports, "__esModule", { value: true });
  2199. var LRU_1 = __webpack_require__(629);
  2200. var CACHE_SIZE = 1000;
  2201. /**
  2202. * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache]
  2203. */
  2204. var EndpointCache = /** @class */ (function () {
  2205. function EndpointCache(maxSize) {
  2206. if (maxSize === void 0) { maxSize = CACHE_SIZE; }
  2207. this.maxSize = maxSize;
  2208. this.cache = new LRU_1.LRUCache(maxSize);
  2209. }
  2210. ;
  2211. Object.defineProperty(EndpointCache.prototype, "size", {
  2212. get: function () {
  2213. return this.cache.length;
  2214. },
  2215. enumerable: true,
  2216. configurable: true
  2217. });
  2218. EndpointCache.prototype.put = function (key, value) {
  2219. var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;
  2220. var endpointRecord = this.populateValue(value);
  2221. this.cache.put(keyString, endpointRecord);
  2222. };
  2223. EndpointCache.prototype.get = function (key) {
  2224. var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;
  2225. var now = Date.now();
  2226. var records = this.cache.get(keyString);
  2227. if (records) {
  2228. for (var i = 0; i < records.length; i++) {
  2229. var record = records[i];
  2230. if (record.Expire < now) {
  2231. this.cache.remove(keyString);
  2232. return undefined;
  2233. }
  2234. }
  2235. }
  2236. return records;
  2237. };
  2238. EndpointCache.getKeyString = function (key) {
  2239. var identifiers = [];
  2240. var identifierNames = Object.keys(key).sort();
  2241. for (var i = 0; i < identifierNames.length; i++) {
  2242. var identifierName = identifierNames[i];
  2243. if (key[identifierName] === undefined)
  2244. continue;
  2245. identifiers.push(key[identifierName]);
  2246. }
  2247. return identifiers.join(' ');
  2248. };
  2249. EndpointCache.prototype.populateValue = function (endpoints) {
  2250. var now = Date.now();
  2251. return endpoints.map(function (endpoint) { return ({
  2252. Address: endpoint.Address || '',
  2253. Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000
  2254. }); });
  2255. };
  2256. EndpointCache.prototype.empty = function () {
  2257. this.cache.empty();
  2258. };
  2259. EndpointCache.prototype.remove = function (key) {
  2260. var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;
  2261. this.cache.remove(keyString);
  2262. };
  2263. return EndpointCache;
  2264. }());
  2265. exports.EndpointCache = EndpointCache;
  2266. /***/ }),
  2267. /***/ 129:
  2268. /***/ (function(module) {
  2269. module.exports = require("child_process");
  2270. /***/ }),
  2271. /***/ 139:
  2272. /***/ (function(module, __unusedexports, __webpack_require__) {
  2273. // Unique ID creation requires a high quality random # generator. In node.js
  2274. // this is pretty straight-forward - we use the crypto API.
  2275. var crypto = __webpack_require__(417);
  2276. module.exports = function nodeRNG() {
  2277. return crypto.randomBytes(16);
  2278. };
  2279. /***/ }),
  2280. /***/ 143:
  2281. /***/ (function(module) {
  2282. "use strict";
  2283. module.exports = path => {
  2284. const isExtendedLengthPath = /^\\\\\?\\/.test(path);
  2285. const hasNonAscii = /[^\u0000-\u0080]+/.test(path); // eslint-disable-line no-control-regex
  2286. if (isExtendedLengthPath || hasNonAscii) {
  2287. return path;
  2288. }
  2289. return path.replace(/\\/g, '/');
  2290. };
  2291. /***/ }),
  2292. /***/ 152:
  2293. /***/ (function(module) {
  2294. module.exports = {"version":2,"waiters":{"BucketExists":{"delay":5,"operation":"HeadBucket","maxAttempts":20,"acceptors":[{"expected":200,"matcher":"status","state":"success"},{"expected":301,"matcher":"status","state":"success"},{"expected":403,"matcher":"status","state":"success"},{"expected":404,"matcher":"status","state":"retry"}]},"BucketNotExists":{"delay":5,"operation":"HeadBucket","maxAttempts":20,"acceptors":[{"expected":404,"matcher":"status","state":"success"}]},"ObjectExists":{"delay":5,"operation":"HeadObject","maxAttempts":20,"acceptors":[{"expected":200,"matcher":"status","state":"success"},{"expected":404,"matcher":"status","state":"retry"}]},"ObjectNotExists":{"delay":5,"operation":"HeadObject","maxAttempts":20,"acceptors":[{"expected":404,"matcher":"status","state":"success"}]}}};
  2295. /***/ }),
  2296. /***/ 153:
  2297. /***/ (function(module, __unusedexports, __webpack_require__) {
  2298. /* eslint guard-for-in:0 */
  2299. var AWS;
  2300. /**
  2301. * A set of utility methods for use with the AWS SDK.
  2302. *
  2303. * @!attribute abort
  2304. * Return this value from an iterator function {each} or {arrayEach}
  2305. * to break out of the iteration.
  2306. * @example Breaking out of an iterator function
  2307. * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) {
  2308. * if (key == 'b') return AWS.util.abort;
  2309. * });
  2310. * @see each
  2311. * @see arrayEach
  2312. * @api private
  2313. */
  2314. var util = {
  2315. environment: 'nodejs',
  2316. engine: function engine() {
  2317. if (util.isBrowser() && typeof navigator !== 'undefined') {
  2318. return navigator.userAgent;
  2319. } else {
  2320. var engine = process.platform + '/' + process.version;
  2321. if (process.env.AWS_EXECUTION_ENV) {
  2322. engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV;
  2323. }
  2324. return engine;
  2325. }
  2326. },
  2327. userAgent: function userAgent() {
  2328. var name = util.environment;
  2329. var agent = 'aws-sdk-' + name + '/' + __webpack_require__(395).VERSION;
  2330. if (name === 'nodejs') agent += ' ' + util.engine();
  2331. return agent;
  2332. },
  2333. uriEscape: function uriEscape(string) {
  2334. var output = encodeURIComponent(string);
  2335. output = output.replace(/[^A-Za-z0-9_.~\-%]+/g, escape);
  2336. // AWS percent-encodes some extra non-standard characters in a URI
  2337. output = output.replace(/[*]/g, function(ch) {
  2338. return '%' + ch.charCodeAt(0).toString(16).toUpperCase();
  2339. });
  2340. return output;
  2341. },
  2342. uriEscapePath: function uriEscapePath(string) {
  2343. var parts = [];
  2344. util.arrayEach(string.split('/'), function (part) {
  2345. parts.push(util.uriEscape(part));
  2346. });
  2347. return parts.join('/');
  2348. },
  2349. urlParse: function urlParse(url) {
  2350. return util.url.parse(url);
  2351. },
  2352. urlFormat: function urlFormat(url) {
  2353. return util.url.format(url);
  2354. },
  2355. queryStringParse: function queryStringParse(qs) {
  2356. return util.querystring.parse(qs);
  2357. },
  2358. queryParamsToString: function queryParamsToString(params) {
  2359. var items = [];
  2360. var escape = util.uriEscape;
  2361. var sortedKeys = Object.keys(params).sort();
  2362. util.arrayEach(sortedKeys, function(name) {
  2363. var value = params[name];
  2364. var ename = escape(name);
  2365. var result = ename + '=';
  2366. if (Array.isArray(value)) {
  2367. var vals = [];
  2368. util.arrayEach(value, function(item) { vals.push(escape(item)); });
  2369. result = ename + '=' + vals.sort().join('&' + ename + '=');
  2370. } else if (value !== undefined && value !== null) {
  2371. result = ename + '=' + escape(value);
  2372. }
  2373. items.push(result);
  2374. });
  2375. return items.join('&');
  2376. },
  2377. readFileSync: function readFileSync(path) {
  2378. if (util.isBrowser()) return null;
  2379. return __webpack_require__(747).readFileSync(path, 'utf-8');
  2380. },
  2381. base64: {
  2382. encode: function encode64(string) {
  2383. if (typeof string === 'number') {
  2384. throw util.error(new Error('Cannot base64 encode number ' + string));
  2385. }
  2386. if (string === null || typeof string === 'undefined') {
  2387. return string;
  2388. }
  2389. var buf = util.buffer.toBuffer(string);
  2390. return buf.toString('base64');
  2391. },
  2392. decode: function decode64(string) {
  2393. if (typeof string === 'number') {
  2394. throw util.error(new Error('Cannot base64 decode number ' + string));
  2395. }
  2396. if (string === null || typeof string === 'undefined') {
  2397. return string;
  2398. }
  2399. return util.buffer.toBuffer(string, 'base64');
  2400. }
  2401. },
  2402. buffer: {
  2403. /**
  2404. * Buffer constructor for Node buffer and buffer pollyfill
  2405. */
  2406. toBuffer: function(data, encoding) {
  2407. return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ?
  2408. util.Buffer.from(data, encoding) : new util.Buffer(data, encoding);
  2409. },
  2410. alloc: function(size, fill, encoding) {
  2411. if (typeof size !== 'number') {
  2412. throw new Error('size passed to alloc must be a number.');
  2413. }
  2414. if (typeof util.Buffer.alloc === 'function') {
  2415. return util.Buffer.alloc(size, fill, encoding);
  2416. } else {
  2417. var buf = new util.Buffer(size);
  2418. if (fill !== undefined && typeof buf.fill === 'function') {
  2419. buf.fill(fill, undefined, undefined, encoding);
  2420. }
  2421. return buf;
  2422. }
  2423. },
  2424. toStream: function toStream(buffer) {
  2425. if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer);
  2426. var readable = new (util.stream.Readable)();
  2427. var pos = 0;
  2428. readable._read = function(size) {
  2429. if (pos >= buffer.length) return readable.push(null);
  2430. var end = pos + size;
  2431. if (end > buffer.length) end = buffer.length;
  2432. readable.push(buffer.slice(pos, end));
  2433. pos = end;
  2434. };
  2435. return readable;
  2436. },
  2437. /**
  2438. * Concatenates a list of Buffer objects.
  2439. */
  2440. concat: function(buffers) {
  2441. var length = 0,
  2442. offset = 0,
  2443. buffer = null, i;
  2444. for (i = 0; i < buffers.length; i++) {
  2445. length += buffers[i].length;
  2446. }
  2447. buffer = util.buffer.alloc(length);
  2448. for (i = 0; i < buffers.length; i++) {
  2449. buffers[i].copy(buffer, offset);
  2450. offset += buffers[i].length;
  2451. }
  2452. return buffer;
  2453. }
  2454. },
  2455. string: {
  2456. byteLength: function byteLength(string) {
  2457. if (string === null || string === undefined) return 0;
  2458. if (typeof string === 'string') string = util.buffer.toBuffer(string);
  2459. if (typeof string.byteLength === 'number') {
  2460. return string.byteLength;
  2461. } else if (typeof string.length === 'number') {
  2462. return string.length;
  2463. } else if (typeof string.size === 'number') {
  2464. return string.size;
  2465. } else if (typeof string.path === 'string') {
  2466. return __webpack_require__(747).lstatSync(string.path).size;
  2467. } else {
  2468. throw util.error(new Error('Cannot determine length of ' + string),
  2469. { object: string });
  2470. }
  2471. },
  2472. upperFirst: function upperFirst(string) {
  2473. return string[0].toUpperCase() + string.substr(1);
  2474. },
  2475. lowerFirst: function lowerFirst(string) {
  2476. return string[0].toLowerCase() + string.substr(1);
  2477. }
  2478. },
  2479. ini: {
  2480. parse: function string(ini) {
  2481. var currentSection, map = {};
  2482. util.arrayEach(ini.split(/\r?\n/), function(line) {
  2483. line = line.split(/(^|\s)[;#]/)[0]; // remove comments
  2484. var section = line.match(/^\s*\[([^\[\]]+)\]\s*$/);
  2485. if (section) {
  2486. currentSection = section[1];
  2487. if (currentSection === '__proto__' || currentSection.split(/\s/)[1] === '__proto__') {
  2488. throw util.error(
  2489. new Error('Cannot load profile name \'' + currentSection + '\' from shared ini file.')
  2490. );
  2491. }
  2492. } else if (currentSection) {
  2493. var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/);
  2494. if (item) {
  2495. map[currentSection] = map[currentSection] || {};
  2496. map[currentSection][item[1]] = item[2];
  2497. }
  2498. }
  2499. });
  2500. return map;
  2501. }
  2502. },
  2503. fn: {
  2504. noop: function() {},
  2505. callback: function (err) { if (err) throw err; },
  2506. /**
  2507. * Turn a synchronous function into as "async" function by making it call
  2508. * a callback. The underlying function is called with all but the last argument,
  2509. * which is treated as the callback. The callback is passed passed a first argument
  2510. * of null on success to mimick standard node callbacks.
  2511. */
  2512. makeAsync: function makeAsync(fn, expectedArgs) {
  2513. if (expectedArgs && expectedArgs <= fn.length) {
  2514. return fn;
  2515. }
  2516. return function() {
  2517. var args = Array.prototype.slice.call(arguments, 0);
  2518. var callback = args.pop();
  2519. var result = fn.apply(null, args);
  2520. callback(result);
  2521. };
  2522. }
  2523. },
  2524. /**
  2525. * Date and time utility functions.
  2526. */
  2527. date: {
  2528. /**
  2529. * @return [Date] the current JavaScript date object. Since all
  2530. * AWS services rely on this date object, you can override
  2531. * this function to provide a special time value to AWS service
  2532. * requests.
  2533. */
  2534. getDate: function getDate() {
  2535. if (!AWS) AWS = __webpack_require__(395);
  2536. if (AWS.config.systemClockOffset) { // use offset when non-zero
  2537. return new Date(new Date().getTime() + AWS.config.systemClockOffset);
  2538. } else {
  2539. return new Date();
  2540. }
  2541. },
  2542. /**
  2543. * @return [String] the date in ISO-8601 format
  2544. */
  2545. iso8601: function iso8601(date) {
  2546. if (date === undefined) { date = util.date.getDate(); }
  2547. return date.toISOString().replace(/\.\d{3}Z$/, 'Z');
  2548. },
  2549. /**
  2550. * @return [String] the date in RFC 822 format
  2551. */
  2552. rfc822: function rfc822(date) {
  2553. if (date === undefined) { date = util.date.getDate(); }
  2554. return date.toUTCString();
  2555. },
  2556. /**
  2557. * @return [Integer] the UNIX timestamp value for the current time
  2558. */
  2559. unixTimestamp: function unixTimestamp(date) {
  2560. if (date === undefined) { date = util.date.getDate(); }
  2561. return date.getTime() / 1000;
  2562. },
  2563. /**
  2564. * @param [String,number,Date] date
  2565. * @return [Date]
  2566. */
  2567. from: function format(date) {
  2568. if (typeof date === 'number') {
  2569. return new Date(date * 1000); // unix timestamp
  2570. } else {
  2571. return new Date(date);
  2572. }
  2573. },
  2574. /**
  2575. * Given a Date or date-like value, this function formats the
  2576. * date into a string of the requested value.
  2577. * @param [String,number,Date] date
  2578. * @param [String] formatter Valid formats are:
  2579. # * 'iso8601'
  2580. # * 'rfc822'
  2581. # * 'unixTimestamp'
  2582. * @return [String]
  2583. */
  2584. format: function format(date, formatter) {
  2585. if (!formatter) formatter = 'iso8601';
  2586. return util.date[formatter](util.date.from(date));
  2587. },
  2588. parseTimestamp: function parseTimestamp(value) {
  2589. if (typeof value === 'number') { // unix timestamp (number)
  2590. return new Date(value * 1000);
  2591. } else if (value.match(/^\d+$/)) { // unix timestamp
  2592. return new Date(value * 1000);
  2593. } else if (value.match(/^\d{4}/)) { // iso8601
  2594. return new Date(value);
  2595. } else if (value.match(/^\w{3},/)) { // rfc822
  2596. return new Date(value);
  2597. } else {
  2598. throw util.error(
  2599. new Error('unhandled timestamp format: ' + value),
  2600. {code: 'TimestampParserError'});
  2601. }
  2602. }
  2603. },
  2604. crypto: {
  2605. crc32Table: [
  2606. 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419,
  2607. 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4,
  2608. 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07,
  2609. 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
  2610. 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856,
  2611. 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
  2612. 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4,
  2613. 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
  2614. 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3,
  2615. 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A,
  2616. 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599,
  2617. 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
  2618. 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190,
  2619. 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F,
  2620. 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E,
  2621. 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
  2622. 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED,
  2623. 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
  2624. 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3,
  2625. 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
  2626. 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A,
  2627. 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5,
  2628. 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010,
  2629. 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
  2630. 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17,
  2631. 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6,
  2632. 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,
  2633. 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
  2634. 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,
  2635. 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
  2636. 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,
  2637. 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
  2638. 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1,
  2639. 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C,
  2640. 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF,
  2641. 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
  2642. 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE,
  2643. 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31,
  2644. 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C,
  2645. 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
  2646. 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B,
  2647. 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
  2648. 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1,
  2649. 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
  2650. 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278,
  2651. 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7,
  2652. 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66,
  2653. 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
  2654. 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,
  2655. 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8,
  2656. 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,
  2657. 0x2D02EF8D],
  2658. crc32: function crc32(data) {
  2659. var tbl = util.crypto.crc32Table;
  2660. var crc = 0 ^ -1;
  2661. if (typeof data === 'string') {
  2662. data = util.buffer.toBuffer(data);
  2663. }
  2664. for (var i = 0; i < data.length; i++) {
  2665. var code = data.readUInt8(i);
  2666. crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF];
  2667. }
  2668. return (crc ^ -1) >>> 0;
  2669. },
  2670. hmac: function hmac(key, string, digest, fn) {
  2671. if (!digest) digest = 'binary';
  2672. if (digest === 'buffer') { digest = undefined; }
  2673. if (!fn) fn = 'sha256';
  2674. if (typeof string === 'string') string = util.buffer.toBuffer(string);
  2675. return util.crypto.lib.createHmac(fn, key).update(string).digest(digest);
  2676. },
  2677. md5: function md5(data, digest, callback) {
  2678. return util.crypto.hash('md5', data, digest, callback);
  2679. },
  2680. sha256: function sha256(data, digest, callback) {
  2681. return util.crypto.hash('sha256', data, digest, callback);
  2682. },
  2683. hash: function(algorithm, data, digest, callback) {
  2684. var hash = util.crypto.createHash(algorithm);
  2685. if (!digest) { digest = 'binary'; }
  2686. if (digest === 'buffer') { digest = undefined; }
  2687. if (typeof data === 'string') data = util.buffer.toBuffer(data);
  2688. var sliceFn = util.arraySliceFn(data);
  2689. var isBuffer = util.Buffer.isBuffer(data);
  2690. //Identifying objects with an ArrayBuffer as buffers
  2691. if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true;
  2692. if (callback && typeof data === 'object' &&
  2693. typeof data.on === 'function' && !isBuffer) {
  2694. data.on('data', function(chunk) { hash.update(chunk); });
  2695. data.on('error', function(err) { callback(err); });
  2696. data.on('end', function() { callback(null, hash.digest(digest)); });
  2697. } else if (callback && sliceFn && !isBuffer &&
  2698. typeof FileReader !== 'undefined') {
  2699. // this might be a File/Blob
  2700. var index = 0, size = 1024 * 512;
  2701. var reader = new FileReader();
  2702. reader.onerror = function() {
  2703. callback(new Error('Failed to read data.'));
  2704. };
  2705. reader.onload = function() {
  2706. var buf = new util.Buffer(new Uint8Array(reader.result));
  2707. hash.update(buf);
  2708. index += buf.length;
  2709. reader._continueReading();
  2710. };
  2711. reader._continueReading = function() {
  2712. if (index >= data.size) {
  2713. callback(null, hash.digest(digest));
  2714. return;
  2715. }
  2716. var back = index + size;
  2717. if (back > data.size) back = data.size;
  2718. reader.readAsArrayBuffer(sliceFn.call(data, index, back));
  2719. };
  2720. reader._continueReading();
  2721. } else {
  2722. if (util.isBrowser() && typeof data === 'object' && !isBuffer) {
  2723. data = new util.Buffer(new Uint8Array(data));
  2724. }
  2725. var out = hash.update(data).digest(digest);
  2726. if (callback) callback(null, out);
  2727. return out;
  2728. }
  2729. },
  2730. toHex: function toHex(data) {
  2731. var out = [];
  2732. for (var i = 0; i < data.length; i++) {
  2733. out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2));
  2734. }
  2735. return out.join('');
  2736. },
  2737. createHash: function createHash(algorithm) {
  2738. return util.crypto.lib.createHash(algorithm);
  2739. }
  2740. },
  2741. /** @!ignore */
  2742. /* Abort constant */
  2743. abort: {},
  2744. each: function each(object, iterFunction) {
  2745. for (var key in object) {
  2746. if (Object.prototype.hasOwnProperty.call(object, key)) {
  2747. var ret = iterFunction.call(this, key, object[key]);
  2748. if (ret === util.abort) break;
  2749. }
  2750. }
  2751. },
  2752. arrayEach: function arrayEach(array, iterFunction) {
  2753. for (var idx in array) {
  2754. if (Object.prototype.hasOwnProperty.call(array, idx)) {
  2755. var ret = iterFunction.call(this, array[idx], parseInt(idx, 10));
  2756. if (ret === util.abort) break;
  2757. }
  2758. }
  2759. },
  2760. update: function update(obj1, obj2) {
  2761. util.each(obj2, function iterator(key, item) {
  2762. obj1[key] = item;
  2763. });
  2764. return obj1;
  2765. },
  2766. merge: function merge(obj1, obj2) {
  2767. return util.update(util.copy(obj1), obj2);
  2768. },
  2769. copy: function copy(object) {
  2770. if (object === null || object === undefined) return object;
  2771. var dupe = {};
  2772. // jshint forin:false
  2773. for (var key in object) {
  2774. dupe[key] = object[key];
  2775. }
  2776. return dupe;
  2777. },
  2778. isEmpty: function isEmpty(obj) {
  2779. for (var prop in obj) {
  2780. if (Object.prototype.hasOwnProperty.call(obj, prop)) {
  2781. return false;
  2782. }
  2783. }
  2784. return true;
  2785. },
  2786. arraySliceFn: function arraySliceFn(obj) {
  2787. var fn = obj.slice || obj.webkitSlice || obj.mozSlice;
  2788. return typeof fn === 'function' ? fn : null;
  2789. },
  2790. isType: function isType(obj, type) {
  2791. // handle cross-"frame" objects
  2792. if (typeof type === 'function') type = util.typeName(type);
  2793. return Object.prototype.toString.call(obj) === '[object ' + type + ']';
  2794. },
  2795. typeName: function typeName(type) {
  2796. if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name;
  2797. var str = type.toString();
  2798. var match = str.match(/^\s*function (.+)\(/);
  2799. return match ? match[1] : str;
  2800. },
  2801. error: function error(err, options) {
  2802. var originalError = null;
  2803. if (typeof err.message === 'string' && err.message !== '') {
  2804. if (typeof options === 'string' || (options && options.message)) {
  2805. originalError = util.copy(err);
  2806. originalError.message = err.message;
  2807. }
  2808. }
  2809. err.message = err.message || null;
  2810. if (typeof options === 'string') {
  2811. err.message = options;
  2812. } else if (typeof options === 'object' && options !== null) {
  2813. util.update(err, options);
  2814. if (options.message)
  2815. err.message = options.message;
  2816. if (options.code || options.name)
  2817. err.code = options.code || options.name;
  2818. if (options.stack)
  2819. err.stack = options.stack;
  2820. }
  2821. if (typeof Object.defineProperty === 'function') {
  2822. Object.defineProperty(err, 'name', {writable: true, enumerable: false});
  2823. Object.defineProperty(err, 'message', {enumerable: true});
  2824. }
  2825. err.name = String(options && options.name || err.name || err.code || 'Error');
  2826. err.time = new Date();
  2827. if (originalError) err.originalError = originalError;
  2828. return err;
  2829. },
  2830. /**
  2831. * @api private
  2832. */
  2833. inherit: function inherit(klass, features) {
  2834. var newObject = null;
  2835. if (features === undefined) {
  2836. features = klass;
  2837. klass = Object;
  2838. newObject = {};
  2839. } else {
  2840. var ctor = function ConstructorWrapper() {};
  2841. ctor.prototype = klass.prototype;
  2842. newObject = new ctor();
  2843. }
  2844. // constructor not supplied, create pass-through ctor
  2845. if (features.constructor === Object) {
  2846. features.constructor = function() {
  2847. if (klass !== Object) {
  2848. return klass.apply(this, arguments);
  2849. }
  2850. };
  2851. }
  2852. features.constructor.prototype = newObject;
  2853. util.update(features.constructor.prototype, features);
  2854. features.constructor.__super__ = klass;
  2855. return features.constructor;
  2856. },
  2857. /**
  2858. * @api private
  2859. */
  2860. mixin: function mixin() {
  2861. var klass = arguments[0];
  2862. for (var i = 1; i < arguments.length; i++) {
  2863. // jshint forin:false
  2864. for (var prop in arguments[i].prototype) {
  2865. var fn = arguments[i].prototype[prop];
  2866. if (prop !== 'constructor') {
  2867. klass.prototype[prop] = fn;
  2868. }
  2869. }
  2870. }
  2871. return klass;
  2872. },
  2873. /**
  2874. * @api private
  2875. */
  2876. hideProperties: function hideProperties(obj, props) {
  2877. if (typeof Object.defineProperty !== 'function') return;
  2878. util.arrayEach(props, function (key) {
  2879. Object.defineProperty(obj, key, {
  2880. enumerable: false, writable: true, configurable: true });
  2881. });
  2882. },
  2883. /**
  2884. * @api private
  2885. */
  2886. property: function property(obj, name, value, enumerable, isValue) {
  2887. var opts = {
  2888. configurable: true,
  2889. enumerable: enumerable !== undefined ? enumerable : true
  2890. };
  2891. if (typeof value === 'function' && !isValue) {
  2892. opts.get = value;
  2893. }
  2894. else {
  2895. opts.value = value; opts.writable = true;
  2896. }
  2897. Object.defineProperty(obj, name, opts);
  2898. },
  2899. /**
  2900. * @api private
  2901. */
  2902. memoizedProperty: function memoizedProperty(obj, name, get, enumerable) {
  2903. var cachedValue = null;
  2904. // build enumerable attribute for each value with lazy accessor.
  2905. util.property(obj, name, function() {
  2906. if (cachedValue === null) {
  2907. cachedValue = get();
  2908. }
  2909. return cachedValue;
  2910. }, enumerable);
  2911. },
  2912. /**
  2913. * TODO Remove in major version revision
  2914. * This backfill populates response data without the
  2915. * top-level payload name.
  2916. *
  2917. * @api private
  2918. */
  2919. hoistPayloadMember: function hoistPayloadMember(resp) {
  2920. var req = resp.request;
  2921. var operationName = req.operation;
  2922. var operation = req.service.api.operations[operationName];
  2923. var output = operation.output;
  2924. if (output.payload && !operation.hasEventOutput) {
  2925. var payloadMember = output.members[output.payload];
  2926. var responsePayload = resp.data[output.payload];
  2927. if (payloadMember.type === 'structure') {
  2928. util.each(responsePayload, function(key, value) {
  2929. util.property(resp.data, key, value, false);
  2930. });
  2931. }
  2932. }
  2933. },
  2934. /**
  2935. * Compute SHA-256 checksums of streams
  2936. *
  2937. * @api private
  2938. */
  2939. computeSha256: function computeSha256(body, done) {
  2940. if (util.isNode()) {
  2941. var Stream = util.stream.Stream;
  2942. var fs = __webpack_require__(747);
  2943. if (typeof Stream === 'function' && body instanceof Stream) {
  2944. if (typeof body.path === 'string') { // assume file object
  2945. var settings = {};
  2946. if (typeof body.start === 'number') {
  2947. settings.start = body.start;
  2948. }
  2949. if (typeof body.end === 'number') {
  2950. settings.end = body.end;
  2951. }
  2952. body = fs.createReadStream(body.path, settings);
  2953. } else { // TODO support other stream types
  2954. return done(new Error('Non-file stream objects are ' +
  2955. 'not supported with SigV4'));
  2956. }
  2957. }
  2958. }
  2959. util.crypto.sha256(body, 'hex', function(err, sha) {
  2960. if (err) done(err);
  2961. else done(null, sha);
  2962. });
  2963. },
  2964. /**
  2965. * @api private
  2966. */
  2967. isClockSkewed: function isClockSkewed(serverTime) {
  2968. if (serverTime) {
  2969. util.property(AWS.config, 'isClockSkewed',
  2970. Math.abs(new Date().getTime() - serverTime) >= 300000, false);
  2971. return AWS.config.isClockSkewed;
  2972. }
  2973. },
  2974. applyClockOffset: function applyClockOffset(serverTime) {
  2975. if (serverTime)
  2976. AWS.config.systemClockOffset = serverTime - new Date().getTime();
  2977. },
  2978. /**
  2979. * @api private
  2980. */
  2981. extractRequestId: function extractRequestId(resp) {
  2982. var requestId = resp.httpResponse.headers['x-amz-request-id'] ||
  2983. resp.httpResponse.headers['x-amzn-requestid'];
  2984. if (!requestId && resp.data && resp.data.ResponseMetadata) {
  2985. requestId = resp.data.ResponseMetadata.RequestId;
  2986. }
  2987. if (requestId) {
  2988. resp.requestId = requestId;
  2989. }
  2990. if (resp.error) {
  2991. resp.error.requestId = requestId;
  2992. }
  2993. },
  2994. /**
  2995. * @api private
  2996. */
  2997. addPromises: function addPromises(constructors, PromiseDependency) {
  2998. var deletePromises = false;
  2999. if (PromiseDependency === undefined && AWS && AWS.config) {
  3000. PromiseDependency = AWS.config.getPromisesDependency();
  3001. }
  3002. if (PromiseDependency === undefined && typeof Promise !== 'undefined') {
  3003. PromiseDependency = Promise;
  3004. }
  3005. if (typeof PromiseDependency !== 'function') deletePromises = true;
  3006. if (!Array.isArray(constructors)) constructors = [constructors];
  3007. for (var ind = 0; ind < constructors.length; ind++) {
  3008. var constructor = constructors[ind];
  3009. if (deletePromises) {
  3010. if (constructor.deletePromisesFromClass) {
  3011. constructor.deletePromisesFromClass();
  3012. }
  3013. } else if (constructor.addPromisesToClass) {
  3014. constructor.addPromisesToClass(PromiseDependency);
  3015. }
  3016. }
  3017. },
  3018. /**
  3019. * @api private
  3020. * Return a function that will return a promise whose fate is decided by the
  3021. * callback behavior of the given method with `methodName`. The method to be
  3022. * promisified should conform to node.js convention of accepting a callback as
  3023. * last argument and calling that callback with error as the first argument
  3024. * and success value on the second argument.
  3025. */
  3026. promisifyMethod: function promisifyMethod(methodName, PromiseDependency) {
  3027. return function promise() {
  3028. var self = this;
  3029. var args = Array.prototype.slice.call(arguments);
  3030. return new PromiseDependency(function(resolve, reject) {
  3031. args.push(function(err, data) {
  3032. if (err) {
  3033. reject(err);
  3034. } else {
  3035. resolve(data);
  3036. }
  3037. });
  3038. self[methodName].apply(self, args);
  3039. });
  3040. };
  3041. },
  3042. /**
  3043. * @api private
  3044. */
  3045. isDualstackAvailable: function isDualstackAvailable(service) {
  3046. if (!service) return false;
  3047. var metadata = __webpack_require__(694);
  3048. if (typeof service !== 'string') service = service.serviceIdentifier;
  3049. if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false;
  3050. return !!metadata[service].dualstackAvailable;
  3051. },
  3052. /**
  3053. * @api private
  3054. */
  3055. calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) {
  3056. if (!retryDelayOptions) retryDelayOptions = {};
  3057. var customBackoff = retryDelayOptions.customBackoff || null;
  3058. if (typeof customBackoff === 'function') {
  3059. return customBackoff(retryCount, err);
  3060. }
  3061. var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100;
  3062. var delay = Math.random() * (Math.pow(2, retryCount) * base);
  3063. return delay;
  3064. },
  3065. /**
  3066. * @api private
  3067. */
  3068. handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) {
  3069. if (!options) options = {};
  3070. var http = AWS.HttpClient.getInstance();
  3071. var httpOptions = options.httpOptions || {};
  3072. var retryCount = 0;
  3073. var errCallback = function(err) {
  3074. var maxRetries = options.maxRetries || 0;
  3075. if (err && err.code === 'TimeoutError') err.retryable = true;
  3076. // Call `calculateRetryDelay()` only when relevant, see #3401
  3077. if (err && err.retryable && retryCount < maxRetries) {
  3078. var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err);
  3079. if (delay >= 0) {
  3080. retryCount++;
  3081. setTimeout(sendRequest, delay + (err.retryAfter || 0));
  3082. return;
  3083. }
  3084. }
  3085. cb(err);
  3086. };
  3087. var sendRequest = function() {
  3088. var data = '';
  3089. http.handleRequest(httpRequest, httpOptions, function(httpResponse) {
  3090. httpResponse.on('data', function(chunk) { data += chunk.toString(); });
  3091. httpResponse.on('end', function() {
  3092. var statusCode = httpResponse.statusCode;
  3093. if (statusCode < 300) {
  3094. cb(null, data);
  3095. } else {
  3096. var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0;
  3097. var err = util.error(new Error(),
  3098. {
  3099. statusCode: statusCode,
  3100. retryable: statusCode >= 500 || statusCode === 429
  3101. }
  3102. );
  3103. if (retryAfter && err.retryable) err.retryAfter = retryAfter;
  3104. errCallback(err);
  3105. }
  3106. });
  3107. }, errCallback);
  3108. };
  3109. AWS.util.defer(sendRequest);
  3110. },
  3111. /**
  3112. * @api private
  3113. */
  3114. uuid: {
  3115. v4: function uuidV4() {
  3116. return __webpack_require__(898).v4();
  3117. }
  3118. },
  3119. /**
  3120. * @api private
  3121. */
  3122. convertPayloadToString: function convertPayloadToString(resp) {
  3123. var req = resp.request;
  3124. var operation = req.operation;
  3125. var rules = req.service.api.operations[operation].output || {};
  3126. if (rules.payload && resp.data[rules.payload]) {
  3127. resp.data[rules.payload] = resp.data[rules.payload].toString();
  3128. }
  3129. },
  3130. /**
  3131. * @api private
  3132. */
  3133. defer: function defer(callback) {
  3134. if (typeof process === 'object' && typeof process.nextTick === 'function') {
  3135. process.nextTick(callback);
  3136. } else if (typeof setImmediate === 'function') {
  3137. setImmediate(callback);
  3138. } else {
  3139. setTimeout(callback, 0);
  3140. }
  3141. },
  3142. /**
  3143. * @api private
  3144. */
  3145. getRequestPayloadShape: function getRequestPayloadShape(req) {
  3146. var operations = req.service.api.operations;
  3147. if (!operations) return undefined;
  3148. var operation = (operations || {})[req.operation];
  3149. if (!operation || !operation.input || !operation.input.payload) return undefined;
  3150. return operation.input.members[operation.input.payload];
  3151. },
  3152. getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) {
  3153. var profiles = {};
  3154. var profilesFromConfig = {};
  3155. if (process.env[util.configOptInEnv]) {
  3156. var profilesFromConfig = iniLoader.loadFrom({
  3157. isConfig: true,
  3158. filename: process.env[util.sharedConfigFileEnv]
  3159. });
  3160. }
  3161. var profilesFromCreds= {};
  3162. try {
  3163. var profilesFromCreds = iniLoader.loadFrom({
  3164. filename: filename ||
  3165. (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv])
  3166. });
  3167. } catch (error) {
  3168. // if using config, assume it is fully descriptive without a credentials file:
  3169. if (!process.env[util.configOptInEnv]) throw error;
  3170. }
  3171. for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) {
  3172. profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]);
  3173. }
  3174. for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) {
  3175. profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]);
  3176. }
  3177. return profiles;
  3178. /**
  3179. * Roughly the semantics of `Object.assign(target, source)`
  3180. */
  3181. function objectAssign(target, source) {
  3182. for (var i = 0, keys = Object.keys(source); i < keys.length; i++) {
  3183. target[keys[i]] = source[keys[i]];
  3184. }
  3185. return target;
  3186. }
  3187. },
  3188. /**
  3189. * @api private
  3190. */
  3191. ARN: {
  3192. validate: function validateARN(str) {
  3193. return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6;
  3194. },
  3195. parse: function parseARN(arn) {
  3196. var matched = arn.split(':');
  3197. return {
  3198. partition: matched[1],
  3199. service: matched[2],
  3200. region: matched[3],
  3201. accountId: matched[4],
  3202. resource: matched.slice(5).join(':')
  3203. };
  3204. },
  3205. build: function buildARN(arnObject) {
  3206. if (
  3207. arnObject.service === undefined ||
  3208. arnObject.region === undefined ||
  3209. arnObject.accountId === undefined ||
  3210. arnObject.resource === undefined
  3211. ) throw util.error(new Error('Input ARN object is invalid'));
  3212. return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service +
  3213. ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource;
  3214. }
  3215. },
  3216. /**
  3217. * @api private
  3218. */
  3219. defaultProfile: 'default',
  3220. /**
  3221. * @api private
  3222. */
  3223. configOptInEnv: 'AWS_SDK_LOAD_CONFIG',
  3224. /**
  3225. * @api private
  3226. */
  3227. sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE',
  3228. /**
  3229. * @api private
  3230. */
  3231. sharedConfigFileEnv: 'AWS_CONFIG_FILE',
  3232. /**
  3233. * @api private
  3234. */
  3235. imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED'
  3236. };
  3237. /**
  3238. * @api private
  3239. */
  3240. module.exports = util;
  3241. /***/ }),
  3242. /***/ 165:
  3243. /***/ (function(module) {
  3244. function apiLoader(svc, version) {
  3245. if (!apiLoader.services.hasOwnProperty(svc)) {
  3246. throw new Error('InvalidService: Failed to load api for ' + svc);
  3247. }
  3248. return apiLoader.services[svc][version];
  3249. }
  3250. /**
  3251. * @api private
  3252. *
  3253. * This member of AWS.apiLoader is private, but changing it will necessitate a
  3254. * change to ../scripts/services-table-generator.ts
  3255. */
  3256. apiLoader.services = {};
  3257. /**
  3258. * @api private
  3259. */
  3260. module.exports = apiLoader;
  3261. /***/ }),
  3262. /***/ 170:
  3263. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  3264. var AWS = __webpack_require__(395);
  3265. var CognitoIdentity = __webpack_require__(214);
  3266. var STS = __webpack_require__(733);
  3267. /**
  3268. * Represents credentials retrieved from STS Web Identity Federation using
  3269. * the Amazon Cognito Identity service.
  3270. *
  3271. * By default this provider gets credentials using the
  3272. * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which
  3273. * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito
  3274. * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to
  3275. * obtain an `IdentityId`. If the identity or identity pool is not configured in
  3276. * the Amazon Cognito Console to use IAM roles with the appropriate permissions,
  3277. * then additionally a `RoleArn` is required containing the ARN of the IAM trust
  3278. * policy for the Amazon Cognito role that the user will log into. If a `RoleArn`
  3279. * is provided, then this provider gets credentials using the
  3280. * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an
  3281. * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}.
  3282. *
  3283. * In addition, if this credential provider is used to provide authenticated
  3284. * login, the `Logins` map may be set to the tokens provided by the respective
  3285. * identity providers. See {constructor} for an example on creating a credentials
  3286. * object with proper property values.
  3287. *
  3288. * ## Refreshing Credentials from Identity Service
  3289. *
  3290. * In addition to AWS credentials expiring after a given amount of time, the
  3291. * login token from the identity provider will also expire. Once this token
  3292. * expires, it will not be usable to refresh AWS credentials, and another
  3293. * token will be needed. The SDK does not manage refreshing of the token value,
  3294. * but this can be done through a "refresh token" supported by most identity
  3295. * providers. Consult the documentation for the identity provider for refreshing
  3296. * tokens. Once the refreshed token is acquired, you should make sure to update
  3297. * this new token in the credentials object's {params} property. The following
  3298. * code will update the WebIdentityToken, assuming you have retrieved an updated
  3299. * token from the identity provider:
  3300. *
  3301. * ```javascript
  3302. * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken;
  3303. * ```
  3304. *
  3305. * Future calls to `credentials.refresh()` will now use the new token.
  3306. *
  3307. * @!attribute params
  3308. * @return [map] the map of params passed to
  3309. * {AWS.CognitoIdentity.getId},
  3310. * {AWS.CognitoIdentity.getOpenIdToken}, and
  3311. * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the
  3312. * `params.WebIdentityToken` property.
  3313. * @!attribute data
  3314. * @return [map] the raw data response from the call to
  3315. * {AWS.CognitoIdentity.getCredentialsForIdentity}, or
  3316. * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get
  3317. * access to other properties from the response.
  3318. * @!attribute identityId
  3319. * @return [String] the Cognito ID returned by the last call to
  3320. * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual
  3321. * final resolved identity ID from Amazon Cognito.
  3322. */
  3323. AWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, {
  3324. /**
  3325. * @api private
  3326. */
  3327. localStorageKey: {
  3328. id: 'aws.cognito.identity-id.',
  3329. providers: 'aws.cognito.identity-providers.'
  3330. },
  3331. /**
  3332. * Creates a new credentials object.
  3333. * @example Creating a new credentials object
  3334. * AWS.config.credentials = new AWS.CognitoIdentityCredentials({
  3335. *
  3336. * // either IdentityPoolId or IdentityId is required
  3337. * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below)
  3338. * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity
  3339. * // or AWS.CognitoIdentity.getOpenIdToken (linked below)
  3340. * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030',
  3341. * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f'
  3342. *
  3343. * // optional, only necessary when the identity pool is not configured
  3344. * // to use IAM roles in the Amazon Cognito Console
  3345. * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below)
  3346. * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity',
  3347. *
  3348. * // optional tokens, used for authenticated login
  3349. * // See the Logins param for AWS.CognitoIdentity.getID (linked below)
  3350. * Logins: {
  3351. * 'graph.facebook.com': 'FBTOKEN',
  3352. * 'www.amazon.com': 'AMAZONTOKEN',
  3353. * 'accounts.google.com': 'GOOGLETOKEN',
  3354. * 'api.twitter.com': 'TWITTERTOKEN',
  3355. * 'www.digits.com': 'DIGITSTOKEN'
  3356. * },
  3357. *
  3358. * // optional name, defaults to web-identity
  3359. * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below)
  3360. * RoleSessionName: 'web',
  3361. *
  3362. * // optional, only necessary when application runs in a browser
  3363. * // and multiple users are signed in at once, used for caching
  3364. * LoginId: 'example@gmail.com'
  3365. *
  3366. * }, {
  3367. * // optionally provide configuration to apply to the underlying service clients
  3368. * // if configuration is not provided, then configuration will be pulled from AWS.config
  3369. *
  3370. * // region should match the region your identity pool is located in
  3371. * region: 'us-east-1',
  3372. *
  3373. * // specify timeout options
  3374. * httpOptions: {
  3375. * timeout: 100
  3376. * }
  3377. * });
  3378. * @see AWS.CognitoIdentity.getId
  3379. * @see AWS.CognitoIdentity.getCredentialsForIdentity
  3380. * @see AWS.STS.assumeRoleWithWebIdentity
  3381. * @see AWS.CognitoIdentity.getOpenIdToken
  3382. * @see AWS.Config
  3383. * @note If a region is not provided in the global AWS.config, or
  3384. * specified in the `clientConfig` to the CognitoIdentityCredentials
  3385. * constructor, you may encounter a 'Missing credentials in config' error
  3386. * when calling making a service call.
  3387. */
  3388. constructor: function CognitoIdentityCredentials(params, clientConfig) {
  3389. AWS.Credentials.call(this);
  3390. this.expired = true;
  3391. this.params = params;
  3392. this.data = null;
  3393. this._identityId = null;
  3394. this._clientConfig = AWS.util.copy(clientConfig || {});
  3395. this.loadCachedId();
  3396. var self = this;
  3397. Object.defineProperty(this, 'identityId', {
  3398. get: function() {
  3399. self.loadCachedId();
  3400. return self._identityId || self.params.IdentityId;
  3401. },
  3402. set: function(identityId) {
  3403. self._identityId = identityId;
  3404. }
  3405. });
  3406. },
  3407. /**
  3408. * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity},
  3409. * or {AWS.STS.assumeRoleWithWebIdentity}.
  3410. *
  3411. * @callback callback function(err)
  3412. * Called when the STS service responds (or fails). When
  3413. * this callback is called with no error, it means that the credentials
  3414. * information has been loaded into the object (as the `accessKeyId`,
  3415. * `secretAccessKey`, and `sessionToken` properties).
  3416. * @param err [Error] if an error occurred, this value will be filled
  3417. * @see AWS.Credentials.get
  3418. */
  3419. refresh: function refresh(callback) {
  3420. this.coalesceRefresh(callback || AWS.util.fn.callback);
  3421. },
  3422. /**
  3423. * @api private
  3424. * @param callback
  3425. */
  3426. load: function load(callback) {
  3427. var self = this;
  3428. self.createClients();
  3429. self.data = null;
  3430. self._identityId = null;
  3431. self.getId(function(err) {
  3432. if (!err) {
  3433. if (!self.params.RoleArn) {
  3434. self.getCredentialsForIdentity(callback);
  3435. } else {
  3436. self.getCredentialsFromSTS(callback);
  3437. }
  3438. } else {
  3439. self.clearIdOnNotAuthorized(err);
  3440. callback(err);
  3441. }
  3442. });
  3443. },
  3444. /**
  3445. * Clears the cached Cognito ID associated with the currently configured
  3446. * identity pool ID. Use this to manually invalidate your cache if
  3447. * the identity pool ID was deleted.
  3448. */
  3449. clearCachedId: function clearCache() {
  3450. this._identityId = null;
  3451. delete this.params.IdentityId;
  3452. var poolId = this.params.IdentityPoolId;
  3453. var loginId = this.params.LoginId || '';
  3454. delete this.storage[this.localStorageKey.id + poolId + loginId];
  3455. delete this.storage[this.localStorageKey.providers + poolId + loginId];
  3456. },
  3457. /**
  3458. * @api private
  3459. */
  3460. clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) {
  3461. var self = this;
  3462. if (err.code == 'NotAuthorizedException') {
  3463. self.clearCachedId();
  3464. }
  3465. },
  3466. /**
  3467. * Retrieves a Cognito ID, loading from cache if it was already retrieved
  3468. * on this device.
  3469. *
  3470. * @callback callback function(err, identityId)
  3471. * @param err [Error, null] an error object if the call failed or null if
  3472. * it succeeded.
  3473. * @param identityId [String, null] if successful, the callback will return
  3474. * the Cognito ID.
  3475. * @note If not loaded explicitly, the Cognito ID is loaded and stored in
  3476. * localStorage in the browser environment of a device.
  3477. * @api private
  3478. */
  3479. getId: function getId(callback) {
  3480. var self = this;
  3481. if (typeof self.params.IdentityId === 'string') {
  3482. return callback(null, self.params.IdentityId);
  3483. }
  3484. self.cognito.getId(function(err, data) {
  3485. if (!err && data.IdentityId) {
  3486. self.params.IdentityId = data.IdentityId;
  3487. callback(null, data.IdentityId);
  3488. } else {
  3489. callback(err);
  3490. }
  3491. });
  3492. },
  3493. /**
  3494. * @api private
  3495. */
  3496. loadCredentials: function loadCredentials(data, credentials) {
  3497. if (!data || !credentials) return;
  3498. credentials.expired = false;
  3499. credentials.accessKeyId = data.Credentials.AccessKeyId;
  3500. credentials.secretAccessKey = data.Credentials.SecretKey;
  3501. credentials.sessionToken = data.Credentials.SessionToken;
  3502. credentials.expireTime = data.Credentials.Expiration;
  3503. },
  3504. /**
  3505. * @api private
  3506. */
  3507. getCredentialsForIdentity: function getCredentialsForIdentity(callback) {
  3508. var self = this;
  3509. self.cognito.getCredentialsForIdentity(function(err, data) {
  3510. if (!err) {
  3511. self.cacheId(data);
  3512. self.data = data;
  3513. self.loadCredentials(self.data, self);
  3514. } else {
  3515. self.clearIdOnNotAuthorized(err);
  3516. }
  3517. callback(err);
  3518. });
  3519. },
  3520. /**
  3521. * @api private
  3522. */
  3523. getCredentialsFromSTS: function getCredentialsFromSTS(callback) {
  3524. var self = this;
  3525. self.cognito.getOpenIdToken(function(err, data) {
  3526. if (!err) {
  3527. self.cacheId(data);
  3528. self.params.WebIdentityToken = data.Token;
  3529. self.webIdentityCredentials.refresh(function(webErr) {
  3530. if (!webErr) {
  3531. self.data = self.webIdentityCredentials.data;
  3532. self.sts.credentialsFrom(self.data, self);
  3533. }
  3534. callback(webErr);
  3535. });
  3536. } else {
  3537. self.clearIdOnNotAuthorized(err);
  3538. callback(err);
  3539. }
  3540. });
  3541. },
  3542. /**
  3543. * @api private
  3544. */
  3545. loadCachedId: function loadCachedId() {
  3546. var self = this;
  3547. // in the browser we source default IdentityId from localStorage
  3548. if (AWS.util.isBrowser() && !self.params.IdentityId) {
  3549. var id = self.getStorage('id');
  3550. if (id && self.params.Logins) {
  3551. var actualProviders = Object.keys(self.params.Logins);
  3552. var cachedProviders =
  3553. (self.getStorage('providers') || '').split(',');
  3554. // only load ID if at least one provider used this ID before
  3555. var intersect = cachedProviders.filter(function(n) {
  3556. return actualProviders.indexOf(n) !== -1;
  3557. });
  3558. if (intersect.length !== 0) {
  3559. self.params.IdentityId = id;
  3560. }
  3561. } else if (id) {
  3562. self.params.IdentityId = id;
  3563. }
  3564. }
  3565. },
  3566. /**
  3567. * @api private
  3568. */
  3569. createClients: function() {
  3570. var clientConfig = this._clientConfig;
  3571. this.webIdentityCredentials = this.webIdentityCredentials ||
  3572. new AWS.WebIdentityCredentials(this.params, clientConfig);
  3573. if (!this.cognito) {
  3574. var cognitoConfig = AWS.util.merge({}, clientConfig);
  3575. cognitoConfig.params = this.params;
  3576. this.cognito = new CognitoIdentity(cognitoConfig);
  3577. }
  3578. this.sts = this.sts || new STS(clientConfig);
  3579. },
  3580. /**
  3581. * @api private
  3582. */
  3583. cacheId: function cacheId(data) {
  3584. this._identityId = data.IdentityId;
  3585. this.params.IdentityId = this._identityId;
  3586. // cache this IdentityId in browser localStorage if possible
  3587. if (AWS.util.isBrowser()) {
  3588. this.setStorage('id', data.IdentityId);
  3589. if (this.params.Logins) {
  3590. this.setStorage('providers', Object.keys(this.params.Logins).join(','));
  3591. }
  3592. }
  3593. },
  3594. /**
  3595. * @api private
  3596. */
  3597. getStorage: function getStorage(key) {
  3598. return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')];
  3599. },
  3600. /**
  3601. * @api private
  3602. */
  3603. setStorage: function setStorage(key, val) {
  3604. try {
  3605. this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val;
  3606. } catch (_) {}
  3607. },
  3608. /**
  3609. * @api private
  3610. */
  3611. storage: (function() {
  3612. try {
  3613. var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ?
  3614. window.localStorage : {};
  3615. // Test set/remove which would throw an error in Safari's private browsing
  3616. storage['aws.test-storage'] = 'foobar';
  3617. delete storage['aws.test-storage'];
  3618. return storage;
  3619. } catch (_) {
  3620. return {};
  3621. }
  3622. })()
  3623. });
  3624. /***/ }),
  3625. /***/ 175:
  3626. /***/ (function(module, __unusedexports, __webpack_require__) {
  3627. var util = __webpack_require__(395).util;
  3628. var toBuffer = util.buffer.toBuffer;
  3629. // All prelude components are unsigned, 32-bit integers
  3630. var PRELUDE_MEMBER_LENGTH = 4;
  3631. // The prelude consists of two components
  3632. var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;
  3633. // Checksums are always CRC32 hashes.
  3634. var CHECKSUM_LENGTH = 4;
  3635. // Messages must include a full prelude, a prelude checksum, and a message checksum
  3636. var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;
  3637. /**
  3638. * @api private
  3639. *
  3640. * @param {Buffer} message
  3641. */
  3642. function splitMessage(message) {
  3643. if (!util.Buffer.isBuffer(message)) message = toBuffer(message);
  3644. if (message.length < MINIMUM_MESSAGE_LENGTH) {
  3645. throw new Error('Provided message too short to accommodate event stream message overhead');
  3646. }
  3647. if (message.length !== message.readUInt32BE(0)) {
  3648. throw new Error('Reported message length does not match received message length');
  3649. }
  3650. var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH);
  3651. if (
  3652. expectedPreludeChecksum !== util.crypto.crc32(
  3653. message.slice(0, PRELUDE_LENGTH)
  3654. )
  3655. ) {
  3656. throw new Error(
  3657. 'The prelude checksum specified in the message (' +
  3658. expectedPreludeChecksum +
  3659. ') does not match the calculated CRC32 checksum.'
  3660. );
  3661. }
  3662. var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH);
  3663. if (
  3664. expectedMessageChecksum !== util.crypto.crc32(
  3665. message.slice(0, message.length - CHECKSUM_LENGTH)
  3666. )
  3667. ) {
  3668. throw new Error(
  3669. 'The message checksum did not match the expected value of ' +
  3670. expectedMessageChecksum
  3671. );
  3672. }
  3673. var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH;
  3674. var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH);
  3675. return {
  3676. headers: message.slice(headersStart, headersEnd),
  3677. body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH),
  3678. };
  3679. }
  3680. /**
  3681. * @api private
  3682. */
  3683. module.exports = {
  3684. splitMessage: splitMessage
  3685. };
  3686. /***/ }),
  3687. /***/ 182:
  3688. /***/ (function(module, __unusedexports, __webpack_require__) {
  3689. "use strict";
  3690. var alphabet = __webpack_require__(963);
  3691. function isShortId(id) {
  3692. if (!id || typeof id !== 'string' || id.length < 6 ) {
  3693. return false;
  3694. }
  3695. var nonAlphabetic = new RegExp('[^' +
  3696. alphabet.get().replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&') +
  3697. ']');
  3698. return !nonAlphabetic.test(id);
  3699. }
  3700. module.exports = isShortId;
  3701. /***/ }),
  3702. /***/ 187:
  3703. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  3704. var AWS = __webpack_require__(395);
  3705. __webpack_require__(923);
  3706. __webpack_require__(906);
  3707. var PromisesDependency;
  3708. /**
  3709. * The main configuration class used by all service objects to set
  3710. * the region, credentials, and other options for requests.
  3711. *
  3712. * By default, credentials and region settings are left unconfigured.
  3713. * This should be configured by the application before using any
  3714. * AWS service APIs.
  3715. *
  3716. * In order to set global configuration options, properties should
  3717. * be assigned to the global {AWS.config} object.
  3718. *
  3719. * @see AWS.config
  3720. *
  3721. * @!group General Configuration Options
  3722. *
  3723. * @!attribute credentials
  3724. * @return [AWS.Credentials] the AWS credentials to sign requests with.
  3725. *
  3726. * @!attribute region
  3727. * @example Set the global region setting to us-west-2
  3728. * AWS.config.update({region: 'us-west-2'});
  3729. * @return [AWS.Credentials] The region to send service requests to.
  3730. * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html
  3731. * A list of available endpoints for each AWS service
  3732. *
  3733. * @!attribute maxRetries
  3734. * @return [Integer] the maximum amount of retries to perform for a
  3735. * service request. By default this value is calculated by the specific
  3736. * service object that the request is being made to.
  3737. *
  3738. * @!attribute maxRedirects
  3739. * @return [Integer] the maximum amount of redirects to follow for a
  3740. * service request. Defaults to 10.
  3741. *
  3742. * @!attribute paramValidation
  3743. * @return [Boolean|map] whether input parameters should be validated against
  3744. * the operation description before sending the request. Defaults to true.
  3745. * Pass a map to enable any of the following specific validation features:
  3746. *
  3747. * * **min** [Boolean] &mdash; Validates that a value meets the min
  3748. * constraint. This is enabled by default when paramValidation is set
  3749. * to `true`.
  3750. * * **max** [Boolean] &mdash; Validates that a value meets the max
  3751. * constraint.
  3752. * * **pattern** [Boolean] &mdash; Validates that a string value matches a
  3753. * regular expression.
  3754. * * **enum** [Boolean] &mdash; Validates that a string value matches one
  3755. * of the allowable enum values.
  3756. *
  3757. * @!attribute computeChecksums
  3758. * @return [Boolean] whether to compute checksums for payload bodies when
  3759. * the service accepts it (currently supported in S3 only).
  3760. *
  3761. * @!attribute convertResponseTypes
  3762. * @return [Boolean] whether types are converted when parsing response data.
  3763. * Currently only supported for JSON based services. Turning this off may
  3764. * improve performance on large response payloads. Defaults to `true`.
  3765. *
  3766. * @!attribute correctClockSkew
  3767. * @return [Boolean] whether to apply a clock skew correction and retry
  3768. * requests that fail because of an skewed client clock. Defaults to
  3769. * `false`.
  3770. *
  3771. * @!attribute sslEnabled
  3772. * @return [Boolean] whether SSL is enabled for requests
  3773. *
  3774. * @!attribute s3ForcePathStyle
  3775. * @return [Boolean] whether to force path style URLs for S3 objects
  3776. *
  3777. * @!attribute s3BucketEndpoint
  3778. * @note Setting this configuration option requires an `endpoint` to be
  3779. * provided explicitly to the service constructor.
  3780. * @return [Boolean] whether the provided endpoint addresses an individual
  3781. * bucket (false if it addresses the root API endpoint).
  3782. *
  3783. * @!attribute s3DisableBodySigning
  3784. * @return [Boolean] whether to disable S3 body signing when using signature version `v4`.
  3785. * Body signing can only be disabled when using https. Defaults to `true`.
  3786. *
  3787. * @!attribute s3UsEast1RegionalEndpoint
  3788. * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3
  3789. * request to global endpoints or 'us-east-1' regional endpoints. This config is only
  3790. * applicable to S3 client;
  3791. * Defaults to 'legacy'
  3792. * @!attribute s3UseArnRegion
  3793. * @return [Boolean] whether to override the request region with the region inferred
  3794. * from requested resource's ARN. Only available for S3 buckets
  3795. * Defaults to `true`
  3796. *
  3797. * @!attribute useAccelerateEndpoint
  3798. * @note This configuration option is only compatible with S3 while accessing
  3799. * dns-compatible buckets.
  3800. * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service.
  3801. * Defaults to `false`.
  3802. *
  3803. * @!attribute retryDelayOptions
  3804. * @example Set the base retry delay for all services to 300 ms
  3805. * AWS.config.update({retryDelayOptions: {base: 300}});
  3806. * // Delays with maxRetries = 3: 300, 600, 1200
  3807. * @example Set a custom backoff function to provide delay values on retries
  3808. * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) {
  3809. * // returns delay in ms
  3810. * }}});
  3811. * @return [map] A set of options to configure the retry delay on retryable errors.
  3812. * Currently supported options are:
  3813. *
  3814. * * **base** [Integer] &mdash; The base number of milliseconds to use in the
  3815. * exponential backoff for operation retries. Defaults to 100 ms for all services except
  3816. * DynamoDB, where it defaults to 50ms.
  3817. *
  3818. * * **customBackoff ** [function] &mdash; A custom function that accepts a
  3819. * retry count and error and returns the amount of time to delay in
  3820. * milliseconds. If the result is a non-zero negative value, no further
  3821. * retry attempts will be made. The `base` option will be ignored if this
  3822. * option is supplied. The function is only called for retryable errors.
  3823. *
  3824. * @!attribute httpOptions
  3825. * @return [map] A set of options to pass to the low-level HTTP request.
  3826. * Currently supported options are:
  3827. *
  3828. * * **proxy** [String] &mdash; the URL to proxy requests through
  3829. * * **agent** [http.Agent, https.Agent] &mdash; the Agent object to perform
  3830. * HTTP requests with. Used for connection pooling. Note that for
  3831. * SSL connections, a special Agent object is used in order to enable
  3832. * peer certificate verification. This feature is only supported in the
  3833. * Node.js environment.
  3834. * * **connectTimeout** [Integer] &mdash; Sets the socket to timeout after
  3835. * failing to establish a connection with the server after
  3836. * `connectTimeout` milliseconds. This timeout has no effect once a socket
  3837. * connection has been established.
  3838. * * **timeout** [Integer] &mdash; The number of milliseconds a request can
  3839. * take before automatically being terminated.
  3840. * Defaults to two minutes (120000).
  3841. * * **xhrAsync** [Boolean] &mdash; Whether the SDK will send asynchronous
  3842. * HTTP requests. Used in the browser environment only. Set to false to
  3843. * send requests synchronously. Defaults to true (async on).
  3844. * * **xhrWithCredentials** [Boolean] &mdash; Sets the "withCredentials"
  3845. * property of an XMLHttpRequest object. Used in the browser environment
  3846. * only. Defaults to false.
  3847. * @!attribute logger
  3848. * @return [#write,#log] an object that responds to .write() (like a stream)
  3849. * or .log() (like the console object) in order to log information about
  3850. * requests
  3851. *
  3852. * @!attribute systemClockOffset
  3853. * @return [Number] an offset value in milliseconds to apply to all signing
  3854. * times. Use this to compensate for clock skew when your system may be
  3855. * out of sync with the service time. Note that this configuration option
  3856. * can only be applied to the global `AWS.config` object and cannot be
  3857. * overridden in service-specific configuration. Defaults to 0 milliseconds.
  3858. *
  3859. * @!attribute signatureVersion
  3860. * @return [String] the signature version to sign requests with (overriding
  3861. * the API configuration). Possible values are: 'v2', 'v3', 'v4'.
  3862. *
  3863. * @!attribute signatureCache
  3864. * @return [Boolean] whether the signature to sign requests with (overriding
  3865. * the API configuration) is cached. Only applies to the signature version 'v4'.
  3866. * Defaults to `true`.
  3867. *
  3868. * @!attribute endpointDiscoveryEnabled
  3869. * @return [Boolean|undefined] whether to call operations with endpoints
  3870. * given by service dynamically. Setting this config to `true` will enable
  3871. * endpoint discovery for all applicable operations. Setting it to `false`
  3872. * will explicitly disable endpoint discovery even though operations that
  3873. * require endpoint discovery will presumably fail. Leaving it to
  3874. * `undefined` means SDK only do endpoint discovery when it's required.
  3875. * Defaults to `undefined`
  3876. *
  3877. * @!attribute endpointCacheSize
  3878. * @return [Number] the size of the global cache storing endpoints from endpoint
  3879. * discovery operations. Once endpoint cache is created, updating this setting
  3880. * cannot change existing cache size.
  3881. * Defaults to 1000
  3882. *
  3883. * @!attribute hostPrefixEnabled
  3884. * @return [Boolean] whether to marshal request parameters to the prefix of
  3885. * hostname. Defaults to `true`.
  3886. *
  3887. * @!attribute stsRegionalEndpoints
  3888. * @return ['legacy'|'regional'] whether to send sts request to global endpoints or
  3889. * regional endpoints.
  3890. * Defaults to 'legacy'
  3891. */
  3892. AWS.Config = AWS.util.inherit({
  3893. /**
  3894. * @!endgroup
  3895. */
  3896. /**
  3897. * Creates a new configuration object. This is the object that passes
  3898. * option data along to service requests, including credentials, security,
  3899. * region information, and some service specific settings.
  3900. *
  3901. * @example Creating a new configuration object with credentials and region
  3902. * var config = new AWS.Config({
  3903. * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2'
  3904. * });
  3905. * @option options accessKeyId [String] your AWS access key ID.
  3906. * @option options secretAccessKey [String] your AWS secret access key.
  3907. * @option options sessionToken [AWS.Credentials] the optional AWS
  3908. * session token to sign requests with.
  3909. * @option options credentials [AWS.Credentials] the AWS credentials
  3910. * to sign requests with. You can either specify this object, or
  3911. * specify the accessKeyId and secretAccessKey options directly.
  3912. * @option options credentialProvider [AWS.CredentialProviderChain] the
  3913. * provider chain used to resolve credentials if no static `credentials`
  3914. * property is set.
  3915. * @option options region [String] the region to send service requests to.
  3916. * See {region} for more information.
  3917. * @option options maxRetries [Integer] the maximum amount of retries to
  3918. * attempt with a request. See {maxRetries} for more information.
  3919. * @option options maxRedirects [Integer] the maximum amount of redirects to
  3920. * follow with a request. See {maxRedirects} for more information.
  3921. * @option options sslEnabled [Boolean] whether to enable SSL for
  3922. * requests.
  3923. * @option options paramValidation [Boolean|map] whether input parameters
  3924. * should be validated against the operation description before sending
  3925. * the request. Defaults to true. Pass a map to enable any of the
  3926. * following specific validation features:
  3927. *
  3928. * * **min** [Boolean] &mdash; Validates that a value meets the min
  3929. * constraint. This is enabled by default when paramValidation is set
  3930. * to `true`.
  3931. * * **max** [Boolean] &mdash; Validates that a value meets the max
  3932. * constraint.
  3933. * * **pattern** [Boolean] &mdash; Validates that a string value matches a
  3934. * regular expression.
  3935. * * **enum** [Boolean] &mdash; Validates that a string value matches one
  3936. * of the allowable enum values.
  3937. * @option options computeChecksums [Boolean] whether to compute checksums
  3938. * for payload bodies when the service accepts it (currently supported
  3939. * in S3 only)
  3940. * @option options convertResponseTypes [Boolean] whether types are converted
  3941. * when parsing response data. Currently only supported for JSON based
  3942. * services. Turning this off may improve performance on large response
  3943. * payloads. Defaults to `true`.
  3944. * @option options correctClockSkew [Boolean] whether to apply a clock skew
  3945. * correction and retry requests that fail because of an skewed client
  3946. * clock. Defaults to `false`.
  3947. * @option options s3ForcePathStyle [Boolean] whether to force path
  3948. * style URLs for S3 objects.
  3949. * @option options s3BucketEndpoint [Boolean] whether the provided endpoint
  3950. * addresses an individual bucket (false if it addresses the root API
  3951. * endpoint). Note that setting this configuration option requires an
  3952. * `endpoint` to be provided explicitly to the service constructor.
  3953. * @option options s3DisableBodySigning [Boolean] whether S3 body signing
  3954. * should be disabled when using signature version `v4`. Body signing
  3955. * can only be disabled when using https. Defaults to `true`.
  3956. * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region
  3957. * is set to 'us-east-1', whether to send s3 request to global endpoints or
  3958. * 'us-east-1' regional endpoints. This config is only applicable to S3 client.
  3959. * Defaults to `legacy`
  3960. * @option options s3UseArnRegion [Boolean] whether to override the request region
  3961. * with the region inferred from requested resource's ARN. Only available for S3 buckets
  3962. * Defaults to `true`
  3963. *
  3964. * @option options retryDelayOptions [map] A set of options to configure
  3965. * the retry delay on retryable errors. Currently supported options are:
  3966. *
  3967. * * **base** [Integer] &mdash; The base number of milliseconds to use in the
  3968. * exponential backoff for operation retries. Defaults to 100 ms for all
  3969. * services except DynamoDB, where it defaults to 50ms.
  3970. * * **customBackoff ** [function] &mdash; A custom function that accepts a
  3971. * retry count and error and returns the amount of time to delay in
  3972. * milliseconds. If the result is a non-zero negative value, no further
  3973. * retry attempts will be made. The `base` option will be ignored if this
  3974. * option is supplied. The function is only called for retryable errors.
  3975. * @option options httpOptions [map] A set of options to pass to the low-level
  3976. * HTTP request. Currently supported options are:
  3977. *
  3978. * * **proxy** [String] &mdash; the URL to proxy requests through
  3979. * * **agent** [http.Agent, https.Agent] &mdash; the Agent object to perform
  3980. * HTTP requests with. Used for connection pooling. Defaults to the global
  3981. * agent (`http.globalAgent`) for non-SSL connections. Note that for
  3982. * SSL connections, a special Agent object is used in order to enable
  3983. * peer certificate verification. This feature is only available in the
  3984. * Node.js environment.
  3985. * * **connectTimeout** [Integer] &mdash; Sets the socket to timeout after
  3986. * failing to establish a connection with the server after
  3987. * `connectTimeout` milliseconds. This timeout has no effect once a socket
  3988. * connection has been established.
  3989. * * **timeout** [Integer] &mdash; Sets the socket to timeout after timeout
  3990. * milliseconds of inactivity on the socket. Defaults to two minutes
  3991. * (120000).
  3992. * * **xhrAsync** [Boolean] &mdash; Whether the SDK will send asynchronous
  3993. * HTTP requests. Used in the browser environment only. Set to false to
  3994. * send requests synchronously. Defaults to true (async on).
  3995. * * **xhrWithCredentials** [Boolean] &mdash; Sets the "withCredentials"
  3996. * property of an XMLHttpRequest object. Used in the browser environment
  3997. * only. Defaults to false.
  3998. * @option options apiVersion [String, Date] a String in YYYY-MM-DD format
  3999. * (or a date) that represents the latest possible API version that can be
  4000. * used in all services (unless overridden by `apiVersions`). Specify
  4001. * 'latest' to use the latest possible version.
  4002. * @option options apiVersions [map<String, String|Date>] a map of service
  4003. * identifiers (the lowercase service class name) with the API version to
  4004. * use when instantiating a service. Specify 'latest' for each individual
  4005. * that can use the latest available version.
  4006. * @option options logger [#write,#log] an object that responds to .write()
  4007. * (like a stream) or .log() (like the console object) in order to log
  4008. * information about requests
  4009. * @option options systemClockOffset [Number] an offset value in milliseconds
  4010. * to apply to all signing times. Use this to compensate for clock skew
  4011. * when your system may be out of sync with the service time. Note that
  4012. * this configuration option can only be applied to the global `AWS.config`
  4013. * object and cannot be overridden in service-specific configuration.
  4014. * Defaults to 0 milliseconds.
  4015. * @option options signatureVersion [String] the signature version to sign
  4016. * requests with (overriding the API configuration). Possible values are:
  4017. * 'v2', 'v3', 'v4'.
  4018. * @option options signatureCache [Boolean] whether the signature to sign
  4019. * requests with (overriding the API configuration) is cached. Only applies
  4020. * to the signature version 'v4'. Defaults to `true`.
  4021. * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32
  4022. * checksum of HTTP response bodies returned by DynamoDB. Default: `true`.
  4023. * @option options useAccelerateEndpoint [Boolean] Whether to use the
  4024. * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`.
  4025. * @option options clientSideMonitoring [Boolean] whether to collect and
  4026. * publish this client's performance metrics of all its API requests.
  4027. * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to
  4028. * call operations with endpoints given by service dynamically. Setting this
  4029. * config to `true` will enable endpoint discovery for all applicable operations.
  4030. * Setting it to `false` will explicitly disable endpoint discovery even though
  4031. * operations that require endpoint discovery will presumably fail. Leaving it
  4032. * to `undefined` means SDK will only do endpoint discovery when it's required.
  4033. * Defaults to `undefined`
  4034. * @option options endpointCacheSize [Number] the size of the global cache storing
  4035. * endpoints from endpoint discovery operations. Once endpoint cache is created,
  4036. * updating this setting cannot change existing cache size.
  4037. * Defaults to 1000
  4038. * @option options hostPrefixEnabled [Boolean] whether to marshal request
  4039. * parameters to the prefix of hostname.
  4040. * Defaults to `true`.
  4041. * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request
  4042. * to global endpoints or regional endpoints.
  4043. * Defaults to 'legacy'.
  4044. */
  4045. constructor: function Config(options) {
  4046. if (options === undefined) options = {};
  4047. options = this.extractCredentials(options);
  4048. AWS.util.each.call(this, this.keys, function (key, value) {
  4049. this.set(key, options[key], value);
  4050. });
  4051. },
  4052. /**
  4053. * @!group Managing Credentials
  4054. */
  4055. /**
  4056. * Loads credentials from the configuration object. This is used internally
  4057. * by the SDK to ensure that refreshable {Credentials} objects are properly
  4058. * refreshed and loaded when sending a request. If you want to ensure that
  4059. * your credentials are loaded prior to a request, you can use this method
  4060. * directly to provide accurate credential data stored in the object.
  4061. *
  4062. * @note If you configure the SDK with static or environment credentials,
  4063. * the credential data should already be present in {credentials} attribute.
  4064. * This method is primarily necessary to load credentials from asynchronous
  4065. * sources, or sources that can refresh credentials periodically.
  4066. * @example Getting your access key
  4067. * AWS.config.getCredentials(function(err) {
  4068. * if (err) console.log(err.stack); // credentials not loaded
  4069. * else console.log("Access Key:", AWS.config.credentials.accessKeyId);
  4070. * })
  4071. * @callback callback function(err)
  4072. * Called when the {credentials} have been properly set on the configuration
  4073. * object.
  4074. *
  4075. * @param err [Error] if this is set, credentials were not successfully
  4076. * loaded and this error provides information why.
  4077. * @see credentials
  4078. * @see Credentials
  4079. */
  4080. getCredentials: function getCredentials(callback) {
  4081. var self = this;
  4082. function finish(err) {
  4083. callback(err, err ? null : self.credentials);
  4084. }
  4085. function credError(msg, err) {
  4086. return new AWS.util.error(err || new Error(), {
  4087. code: 'CredentialsError',
  4088. message: msg,
  4089. name: 'CredentialsError'
  4090. });
  4091. }
  4092. function getAsyncCredentials() {
  4093. self.credentials.get(function(err) {
  4094. if (err) {
  4095. var msg = 'Could not load credentials from ' +
  4096. self.credentials.constructor.name;
  4097. err = credError(msg, err);
  4098. }
  4099. finish(err);
  4100. });
  4101. }
  4102. function getStaticCredentials() {
  4103. var err = null;
  4104. if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) {
  4105. err = credError('Missing credentials');
  4106. }
  4107. finish(err);
  4108. }
  4109. if (self.credentials) {
  4110. if (typeof self.credentials.get === 'function') {
  4111. getAsyncCredentials();
  4112. } else { // static credentials
  4113. getStaticCredentials();
  4114. }
  4115. } else if (self.credentialProvider) {
  4116. self.credentialProvider.resolve(function(err, creds) {
  4117. if (err) {
  4118. err = credError('Could not load credentials from any providers', err);
  4119. }
  4120. self.credentials = creds;
  4121. finish(err);
  4122. });
  4123. } else {
  4124. finish(credError('No credentials to load'));
  4125. }
  4126. },
  4127. /**
  4128. * @!group Loading and Setting Configuration Options
  4129. */
  4130. /**
  4131. * @overload update(options, allowUnknownKeys = false)
  4132. * Updates the current configuration object with new options.
  4133. *
  4134. * @example Update maxRetries property of a configuration object
  4135. * config.update({maxRetries: 10});
  4136. * @param [Object] options a map of option keys and values.
  4137. * @param [Boolean] allowUnknownKeys whether unknown keys can be set on
  4138. * the configuration object. Defaults to `false`.
  4139. * @see constructor
  4140. */
  4141. update: function update(options, allowUnknownKeys) {
  4142. allowUnknownKeys = allowUnknownKeys || false;
  4143. options = this.extractCredentials(options);
  4144. AWS.util.each.call(this, options, function (key, value) {
  4145. if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) ||
  4146. AWS.Service.hasService(key)) {
  4147. this.set(key, value);
  4148. }
  4149. });
  4150. },
  4151. /**
  4152. * Loads configuration data from a JSON file into this config object.
  4153. * @note Loading configuration will reset all existing configuration
  4154. * on the object.
  4155. * @!macro nobrowser
  4156. * @param path [String] the path relative to your process's current
  4157. * working directory to load configuration from.
  4158. * @return [AWS.Config] the same configuration object
  4159. */
  4160. loadFromPath: function loadFromPath(path) {
  4161. this.clear();
  4162. var options = JSON.parse(AWS.util.readFileSync(path));
  4163. var fileSystemCreds = new AWS.FileSystemCredentials(path);
  4164. var chain = new AWS.CredentialProviderChain();
  4165. chain.providers.unshift(fileSystemCreds);
  4166. chain.resolve(function (err, creds) {
  4167. if (err) throw err;
  4168. else options.credentials = creds;
  4169. });
  4170. this.constructor(options);
  4171. return this;
  4172. },
  4173. /**
  4174. * Clears configuration data on this object
  4175. *
  4176. * @api private
  4177. */
  4178. clear: function clear() {
  4179. /*jshint forin:false */
  4180. AWS.util.each.call(this, this.keys, function (key) {
  4181. delete this[key];
  4182. });
  4183. // reset credential provider
  4184. this.set('credentials', undefined);
  4185. this.set('credentialProvider', undefined);
  4186. },
  4187. /**
  4188. * Sets a property on the configuration object, allowing for a
  4189. * default value
  4190. * @api private
  4191. */
  4192. set: function set(property, value, defaultValue) {
  4193. if (value === undefined) {
  4194. if (defaultValue === undefined) {
  4195. defaultValue = this.keys[property];
  4196. }
  4197. if (typeof defaultValue === 'function') {
  4198. this[property] = defaultValue.call(this);
  4199. } else {
  4200. this[property] = defaultValue;
  4201. }
  4202. } else if (property === 'httpOptions' && this[property]) {
  4203. // deep merge httpOptions
  4204. this[property] = AWS.util.merge(this[property], value);
  4205. } else {
  4206. this[property] = value;
  4207. }
  4208. },
  4209. /**
  4210. * All of the keys with their default values.
  4211. *
  4212. * @constant
  4213. * @api private
  4214. */
  4215. keys: {
  4216. credentials: null,
  4217. credentialProvider: null,
  4218. region: null,
  4219. logger: null,
  4220. apiVersions: {},
  4221. apiVersion: null,
  4222. endpoint: undefined,
  4223. httpOptions: {
  4224. timeout: 120000
  4225. },
  4226. maxRetries: undefined,
  4227. maxRedirects: 10,
  4228. paramValidation: true,
  4229. sslEnabled: true,
  4230. s3ForcePathStyle: false,
  4231. s3BucketEndpoint: false,
  4232. s3DisableBodySigning: true,
  4233. s3UsEast1RegionalEndpoint: 'legacy',
  4234. s3UseArnRegion: undefined,
  4235. computeChecksums: true,
  4236. convertResponseTypes: true,
  4237. correctClockSkew: false,
  4238. customUserAgent: null,
  4239. dynamoDbCrc32: true,
  4240. systemClockOffset: 0,
  4241. signatureVersion: null,
  4242. signatureCache: true,
  4243. retryDelayOptions: {},
  4244. useAccelerateEndpoint: false,
  4245. clientSideMonitoring: false,
  4246. endpointDiscoveryEnabled: undefined,
  4247. endpointCacheSize: 1000,
  4248. hostPrefixEnabled: true,
  4249. stsRegionalEndpoints: 'legacy'
  4250. },
  4251. /**
  4252. * Extracts accessKeyId, secretAccessKey and sessionToken
  4253. * from a configuration hash.
  4254. *
  4255. * @api private
  4256. */
  4257. extractCredentials: function extractCredentials(options) {
  4258. if (options.accessKeyId && options.secretAccessKey) {
  4259. options = AWS.util.copy(options);
  4260. options.credentials = new AWS.Credentials(options);
  4261. }
  4262. return options;
  4263. },
  4264. /**
  4265. * Sets the promise dependency the SDK will use wherever Promises are returned.
  4266. * Passing `null` will force the SDK to use native Promises if they are available.
  4267. * If native Promises are not available, passing `null` will have no effect.
  4268. * @param [Constructor] dep A reference to a Promise constructor
  4269. */
  4270. setPromisesDependency: function setPromisesDependency(dep) {
  4271. PromisesDependency = dep;
  4272. // if null was passed in, we should try to use native promises
  4273. if (dep === null && typeof Promise === 'function') {
  4274. PromisesDependency = Promise;
  4275. }
  4276. var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain];
  4277. if (AWS.S3) {
  4278. constructors.push(AWS.S3);
  4279. if (AWS.S3.ManagedUpload) {
  4280. constructors.push(AWS.S3.ManagedUpload);
  4281. }
  4282. }
  4283. AWS.util.addPromises(constructors, PromisesDependency);
  4284. },
  4285. /**
  4286. * Gets the promise dependency set by `AWS.config.setPromisesDependency`.
  4287. */
  4288. getPromisesDependency: function getPromisesDependency() {
  4289. return PromisesDependency;
  4290. }
  4291. });
  4292. /**
  4293. * @return [AWS.Config] The global configuration object singleton instance
  4294. * @readonly
  4295. * @see AWS.Config
  4296. */
  4297. AWS.config = new AWS.Config();
  4298. /***/ }),
  4299. /***/ 191:
  4300. /***/ (function(module) {
  4301. module.exports = require("querystring");
  4302. /***/ }),
  4303. /***/ 200:
  4304. /***/ (function(module) {
  4305. module.exports = require("dgram");
  4306. /***/ }),
  4307. /***/ 210:
  4308. /***/ (function(__unusedmodule, exports) {
  4309. // Generated by CoffeeScript 1.12.7
  4310. (function() {
  4311. "use strict";
  4312. exports.stripBOM = function(str) {
  4313. if (str[0] === '\uFEFF') {
  4314. return str.substring(1);
  4315. } else {
  4316. return str;
  4317. }
  4318. };
  4319. }).call(this);
  4320. /***/ }),
  4321. /***/ 211:
  4322. /***/ (function(module) {
  4323. module.exports = require("https");
  4324. /***/ }),
  4325. /***/ 213:
  4326. /***/ (function(module) {
  4327. module.exports = require("timers");
  4328. /***/ }),
  4329. /***/ 214:
  4330. /***/ (function(module, __unusedexports, __webpack_require__) {
  4331. __webpack_require__(234);
  4332. var AWS = __webpack_require__(395);
  4333. var Service = AWS.Service;
  4334. var apiLoader = AWS.apiLoader;
  4335. apiLoader.services['cognitoidentity'] = {};
  4336. AWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']);
  4337. Object.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', {
  4338. get: function get() {
  4339. var model = __webpack_require__(56);
  4340. model.paginators = __webpack_require__(280).pagination;
  4341. return model;
  4342. },
  4343. enumerable: true,
  4344. configurable: true
  4345. });
  4346. module.exports = AWS.CognitoIdentity;
  4347. /***/ }),
  4348. /***/ 220:
  4349. /***/ (function(module, __unusedexports, __webpack_require__) {
  4350. var AWS = __webpack_require__(395);
  4351. var inherit = AWS.util.inherit;
  4352. /**
  4353. * @api private
  4354. */
  4355. AWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, {
  4356. addAuthorization: function addAuthorization(credentials, date) {
  4357. if (!date) date = AWS.util.date.getDate();
  4358. var r = this.request;
  4359. r.params.Timestamp = AWS.util.date.iso8601(date);
  4360. r.params.SignatureVersion = '2';
  4361. r.params.SignatureMethod = 'HmacSHA256';
  4362. r.params.AWSAccessKeyId = credentials.accessKeyId;
  4363. if (credentials.sessionToken) {
  4364. r.params.SecurityToken = credentials.sessionToken;
  4365. }
  4366. delete r.params.Signature; // delete old Signature for re-signing
  4367. r.params.Signature = this.signature(credentials);
  4368. r.body = AWS.util.queryParamsToString(r.params);
  4369. r.headers['Content-Length'] = r.body.length;
  4370. },
  4371. signature: function signature(credentials) {
  4372. return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');
  4373. },
  4374. stringToSign: function stringToSign() {
  4375. var parts = [];
  4376. parts.push(this.request.method);
  4377. parts.push(this.request.endpoint.host.toLowerCase());
  4378. parts.push(this.request.pathname());
  4379. parts.push(AWS.util.queryParamsToString(this.request.params));
  4380. return parts.join('\n');
  4381. }
  4382. });
  4383. /**
  4384. * @api private
  4385. */
  4386. module.exports = AWS.Signers.V2;
  4387. /***/ }),
  4388. /***/ 229:
  4389. /***/ (function(module) {
  4390. module.exports = require("domain");
  4391. /***/ }),
  4392. /***/ 232:
  4393. /***/ (function(module, __unusedexports, __webpack_require__) {
  4394. var AWS = __webpack_require__(395);
  4395. /**
  4396. * @api private
  4397. */
  4398. function validateRegionalEndpointsFlagValue(configValue, errorOptions) {
  4399. if (typeof configValue !== 'string') return undefined;
  4400. else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) {
  4401. return configValue.toLowerCase();
  4402. } else {
  4403. throw AWS.util.error(new Error(), errorOptions);
  4404. }
  4405. }
  4406. /**
  4407. * Resolve the configuration value for regional endpoint from difference sources: client
  4408. * config, environmental variable, shared config file. Value can be case-insensitive
  4409. * 'legacy' or 'reginal'.
  4410. * @param originalConfig user-supplied config object to resolve
  4411. * @param options a map of config property names from individual configuration source
  4412. * - env: name of environmental variable that refers to the config
  4413. * - sharedConfig: name of shared configuration file property that refers to the config
  4414. * - clientConfig: name of client configuration property that refers to the config
  4415. *
  4416. * @api private
  4417. */
  4418. function resolveRegionalEndpointsFlag(originalConfig, options) {
  4419. originalConfig = originalConfig || {};
  4420. //validate config value
  4421. var resolved;
  4422. if (originalConfig[options.clientConfig]) {
  4423. resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], {
  4424. code: 'InvalidConfiguration',
  4425. message: 'invalid "' + options.clientConfig + '" configuration. Expect "legacy" ' +
  4426. ' or "regional". Got "' + originalConfig[options.clientConfig] + '".'
  4427. });
  4428. if (resolved) return resolved;
  4429. }
  4430. if (!AWS.util.isNode()) return resolved;
  4431. //validate environmental variable
  4432. if (Object.prototype.hasOwnProperty.call(process.env, options.env)) {
  4433. var envFlag = process.env[options.env];
  4434. resolved = validateRegionalEndpointsFlagValue(envFlag, {
  4435. code: 'InvalidEnvironmentalVariable',
  4436. message: 'invalid ' + options.env + ' environmental variable. Expect "legacy" ' +
  4437. ' or "regional". Got "' + process.env[options.env] + '".'
  4438. });
  4439. if (resolved) return resolved;
  4440. }
  4441. //validate shared config file
  4442. var profile = {};
  4443. try {
  4444. var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);
  4445. profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];
  4446. } catch (e) {};
  4447. if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) {
  4448. var fileFlag = profile[options.sharedConfig];
  4449. resolved = validateRegionalEndpointsFlagValue(fileFlag, {
  4450. code: 'InvalidConfiguration',
  4451. message: 'invalid ' + options.sharedConfig + ' profile config. Expect "legacy" ' +
  4452. ' or "regional". Got "' + profile[options.sharedConfig] + '".'
  4453. });
  4454. if (resolved) return resolved;
  4455. }
  4456. return resolved;
  4457. }
  4458. module.exports = resolveRegionalEndpointsFlag;
  4459. /***/ }),
  4460. /***/ 234:
  4461. /***/ (function(module, __unusedexports, __webpack_require__) {
  4462. var util = __webpack_require__(153);
  4463. util.isBrowser = function() { return false; };
  4464. util.isNode = function() { return true; };
  4465. // node.js specific modules
  4466. util.crypto.lib = __webpack_require__(417);
  4467. util.Buffer = __webpack_require__(293).Buffer;
  4468. util.domain = __webpack_require__(229);
  4469. util.stream = __webpack_require__(413);
  4470. util.url = __webpack_require__(414);
  4471. util.querystring = __webpack_require__(191);
  4472. util.environment = 'nodejs';
  4473. util.createEventStream = util.stream.Readable ?
  4474. __webpack_require__(445).createEventStream : __webpack_require__(661).createEventStream;
  4475. util.realClock = __webpack_require__(693);
  4476. util.clientSideMonitoring = {
  4477. Publisher: __webpack_require__(701).Publisher,
  4478. configProvider: __webpack_require__(762),
  4479. };
  4480. util.iniLoader = __webpack_require__(892).iniLoader;
  4481. util.getSystemErrorName = __webpack_require__(669).getSystemErrorName;
  4482. var AWS;
  4483. /**
  4484. * @api private
  4485. */
  4486. module.exports = AWS = __webpack_require__(395);
  4487. __webpack_require__(923);
  4488. __webpack_require__(906);
  4489. __webpack_require__(43);
  4490. __webpack_require__(543);
  4491. __webpack_require__(306);
  4492. __webpack_require__(170);
  4493. __webpack_require__(966);
  4494. __webpack_require__(982);
  4495. // Load the xml2js XML parser
  4496. AWS.XML.Parser = __webpack_require__(810);
  4497. // Load Node HTTP client
  4498. __webpack_require__(888);
  4499. __webpack_require__(818);
  4500. // Load custom credential providers
  4501. __webpack_require__(868);
  4502. __webpack_require__(103);
  4503. __webpack_require__(426);
  4504. __webpack_require__(316);
  4505. __webpack_require__(872);
  4506. __webpack_require__(634);
  4507. __webpack_require__(22);
  4508. __webpack_require__(982);
  4509. // Setup default chain providers
  4510. // If this changes, please update documentation for
  4511. // AWS.CredentialProviderChain.defaultProviders in
  4512. // credentials/credential_provider_chain.js
  4513. AWS.CredentialProviderChain.defaultProviders = [
  4514. function () { return new AWS.EnvironmentCredentials('AWS'); },
  4515. function () { return new AWS.EnvironmentCredentials('AMAZON'); },
  4516. function () { return new AWS.SharedIniFileCredentials(); },
  4517. function () { return new AWS.ECSCredentials(); },
  4518. function () { return new AWS.ProcessCredentials(); },
  4519. function () { return new AWS.TokenFileWebIdentityCredentials(); },
  4520. function () { return new AWS.EC2MetadataCredentials(); }
  4521. ];
  4522. // Update configuration keys
  4523. AWS.util.update(AWS.Config.prototype.keys, {
  4524. credentials: function () {
  4525. var credentials = null;
  4526. new AWS.CredentialProviderChain([
  4527. function () { return new AWS.EnvironmentCredentials('AWS'); },
  4528. function () { return new AWS.EnvironmentCredentials('AMAZON'); },
  4529. function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); }
  4530. ]).resolve(function(err, creds) {
  4531. if (!err) credentials = creds;
  4532. });
  4533. return credentials;
  4534. },
  4535. credentialProvider: function() {
  4536. return new AWS.CredentialProviderChain();
  4537. },
  4538. logger: function () {
  4539. return process.env.AWSJS_DEBUG ? console : null;
  4540. },
  4541. region: function() {
  4542. var env = process.env;
  4543. var region = env.AWS_REGION || env.AMAZON_REGION;
  4544. if (env[AWS.util.configOptInEnv]) {
  4545. var toCheck = [
  4546. {filename: env[AWS.util.sharedCredentialsFileEnv]},
  4547. {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]}
  4548. ];
  4549. var iniLoader = AWS.util.iniLoader;
  4550. while (!region && toCheck.length) {
  4551. var configFile = iniLoader.loadFrom(toCheck.shift());
  4552. var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile];
  4553. region = profile && profile.region;
  4554. }
  4555. }
  4556. return region;
  4557. }
  4558. });
  4559. // Reset configuration
  4560. AWS.config = new AWS.Config();
  4561. /***/ }),
  4562. /***/ 250:
  4563. /***/ (function(module, __unusedexports, __webpack_require__) {
  4564. var constants = __webpack_require__(619)
  4565. var origCwd = process.cwd
  4566. var cwd = null
  4567. var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
  4568. process.cwd = function() {
  4569. if (!cwd)
  4570. cwd = origCwd.call(process)
  4571. return cwd
  4572. }
  4573. try {
  4574. process.cwd()
  4575. } catch (er) {}
  4576. var chdir = process.chdir
  4577. process.chdir = function(d) {
  4578. cwd = null
  4579. chdir.call(process, d)
  4580. }
  4581. module.exports = patch
  4582. function patch (fs) {
  4583. // (re-)implement some things that are known busted or missing.
  4584. // lchmod, broken prior to 0.6.2
  4585. // back-port the fix here.
  4586. if (constants.hasOwnProperty('O_SYMLINK') &&
  4587. process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
  4588. patchLchmod(fs)
  4589. }
  4590. // lutimes implementation, or no-op
  4591. if (!fs.lutimes) {
  4592. patchLutimes(fs)
  4593. }
  4594. // https://github.com/isaacs/node-graceful-fs/issues/4
  4595. // Chown should not fail on einval or eperm if non-root.
  4596. // It should not fail on enosys ever, as this just indicates
  4597. // that a fs doesn't support the intended operation.
  4598. fs.chown = chownFix(fs.chown)
  4599. fs.fchown = chownFix(fs.fchown)
  4600. fs.lchown = chownFix(fs.lchown)
  4601. fs.chmod = chmodFix(fs.chmod)
  4602. fs.fchmod = chmodFix(fs.fchmod)
  4603. fs.lchmod = chmodFix(fs.lchmod)
  4604. fs.chownSync = chownFixSync(fs.chownSync)
  4605. fs.fchownSync = chownFixSync(fs.fchownSync)
  4606. fs.lchownSync = chownFixSync(fs.lchownSync)
  4607. fs.chmodSync = chmodFixSync(fs.chmodSync)
  4608. fs.fchmodSync = chmodFixSync(fs.fchmodSync)
  4609. fs.lchmodSync = chmodFixSync(fs.lchmodSync)
  4610. fs.stat = statFix(fs.stat)
  4611. fs.fstat = statFix(fs.fstat)
  4612. fs.lstat = statFix(fs.lstat)
  4613. fs.statSync = statFixSync(fs.statSync)
  4614. fs.fstatSync = statFixSync(fs.fstatSync)
  4615. fs.lstatSync = statFixSync(fs.lstatSync)
  4616. // if lchmod/lchown do not exist, then make them no-ops
  4617. if (!fs.lchmod) {
  4618. fs.lchmod = function (path, mode, cb) {
  4619. if (cb) process.nextTick(cb)
  4620. }
  4621. fs.lchmodSync = function () {}
  4622. }
  4623. if (!fs.lchown) {
  4624. fs.lchown = function (path, uid, gid, cb) {
  4625. if (cb) process.nextTick(cb)
  4626. }
  4627. fs.lchownSync = function () {}
  4628. }
  4629. // on Windows, A/V software can lock the directory, causing this
  4630. // to fail with an EACCES or EPERM if the directory contains newly
  4631. // created files. Try again on failure, for up to 60 seconds.
  4632. // Set the timeout this long because some Windows Anti-Virus, such as Parity
  4633. // bit9, may lock files for up to a minute, causing npm package install
  4634. // failures. Also, take care to yield the scheduler. Windows scheduling gives
  4635. // CPU to a busy looping process, which can cause the program causing the lock
  4636. // contention to be starved of CPU by node, so the contention doesn't resolve.
  4637. if (platform === "win32") {
  4638. fs.rename = (function (fs$rename) { return function (from, to, cb) {
  4639. var start = Date.now()
  4640. var backoff = 0;
  4641. fs$rename(from, to, function CB (er) {
  4642. if (er
  4643. && (er.code === "EACCES" || er.code === "EPERM")
  4644. && Date.now() - start < 60000) {
  4645. setTimeout(function() {
  4646. fs.stat(to, function (stater, st) {
  4647. if (stater && stater.code === "ENOENT")
  4648. fs$rename(from, to, CB);
  4649. else
  4650. cb(er)
  4651. })
  4652. }, backoff)
  4653. if (backoff < 100)
  4654. backoff += 10;
  4655. return;
  4656. }
  4657. if (cb) cb(er)
  4658. })
  4659. }})(fs.rename)
  4660. }
  4661. // if read() returns EAGAIN, then just try it again.
  4662. fs.read = (function (fs$read) {
  4663. function read (fd, buffer, offset, length, position, callback_) {
  4664. var callback
  4665. if (callback_ && typeof callback_ === 'function') {
  4666. var eagCounter = 0
  4667. callback = function (er, _, __) {
  4668. if (er && er.code === 'EAGAIN' && eagCounter < 10) {
  4669. eagCounter ++
  4670. return fs$read.call(fs, fd, buffer, offset, length, position, callback)
  4671. }
  4672. callback_.apply(this, arguments)
  4673. }
  4674. }
  4675. return fs$read.call(fs, fd, buffer, offset, length, position, callback)
  4676. }
  4677. // This ensures `util.promisify` works as it does for native `fs.read`.
  4678. read.__proto__ = fs$read
  4679. return read
  4680. })(fs.read)
  4681. fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
  4682. var eagCounter = 0
  4683. while (true) {
  4684. try {
  4685. return fs$readSync.call(fs, fd, buffer, offset, length, position)
  4686. } catch (er) {
  4687. if (er.code === 'EAGAIN' && eagCounter < 10) {
  4688. eagCounter ++
  4689. continue
  4690. }
  4691. throw er
  4692. }
  4693. }
  4694. }})(fs.readSync)
  4695. function patchLchmod (fs) {
  4696. fs.lchmod = function (path, mode, callback) {
  4697. fs.open( path
  4698. , constants.O_WRONLY | constants.O_SYMLINK
  4699. , mode
  4700. , function (err, fd) {
  4701. if (err) {
  4702. if (callback) callback(err)
  4703. return
  4704. }
  4705. // prefer to return the chmod error, if one occurs,
  4706. // but still try to close, and report closing errors if they occur.
  4707. fs.fchmod(fd, mode, function (err) {
  4708. fs.close(fd, function(err2) {
  4709. if (callback) callback(err || err2)
  4710. })
  4711. })
  4712. })
  4713. }
  4714. fs.lchmodSync = function (path, mode) {
  4715. var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
  4716. // prefer to return the chmod error, if one occurs,
  4717. // but still try to close, and report closing errors if they occur.
  4718. var threw = true
  4719. var ret
  4720. try {
  4721. ret = fs.fchmodSync(fd, mode)
  4722. threw = false
  4723. } finally {
  4724. if (threw) {
  4725. try {
  4726. fs.closeSync(fd)
  4727. } catch (er) {}
  4728. } else {
  4729. fs.closeSync(fd)
  4730. }
  4731. }
  4732. return ret
  4733. }
  4734. }
  4735. function patchLutimes (fs) {
  4736. if (constants.hasOwnProperty("O_SYMLINK")) {
  4737. fs.lutimes = function (path, at, mt, cb) {
  4738. fs.open(path, constants.O_SYMLINK, function (er, fd) {
  4739. if (er) {
  4740. if (cb) cb(er)
  4741. return
  4742. }
  4743. fs.futimes(fd, at, mt, function (er) {
  4744. fs.close(fd, function (er2) {
  4745. if (cb) cb(er || er2)
  4746. })
  4747. })
  4748. })
  4749. }
  4750. fs.lutimesSync = function (path, at, mt) {
  4751. var fd = fs.openSync(path, constants.O_SYMLINK)
  4752. var ret
  4753. var threw = true
  4754. try {
  4755. ret = fs.futimesSync(fd, at, mt)
  4756. threw = false
  4757. } finally {
  4758. if (threw) {
  4759. try {
  4760. fs.closeSync(fd)
  4761. } catch (er) {}
  4762. } else {
  4763. fs.closeSync(fd)
  4764. }
  4765. }
  4766. return ret
  4767. }
  4768. } else {
  4769. fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
  4770. fs.lutimesSync = function () {}
  4771. }
  4772. }
  4773. function chmodFix (orig) {
  4774. if (!orig) return orig
  4775. return function (target, mode, cb) {
  4776. return orig.call(fs, target, mode, function (er) {
  4777. if (chownErOk(er)) er = null
  4778. if (cb) cb.apply(this, arguments)
  4779. })
  4780. }
  4781. }
  4782. function chmodFixSync (orig) {
  4783. if (!orig) return orig
  4784. return function (target, mode) {
  4785. try {
  4786. return orig.call(fs, target, mode)
  4787. } catch (er) {
  4788. if (!chownErOk(er)) throw er
  4789. }
  4790. }
  4791. }
  4792. function chownFix (orig) {
  4793. if (!orig) return orig
  4794. return function (target, uid, gid, cb) {
  4795. return orig.call(fs, target, uid, gid, function (er) {
  4796. if (chownErOk(er)) er = null
  4797. if (cb) cb.apply(this, arguments)
  4798. })
  4799. }
  4800. }
  4801. function chownFixSync (orig) {
  4802. if (!orig) return orig
  4803. return function (target, uid, gid) {
  4804. try {
  4805. return orig.call(fs, target, uid, gid)
  4806. } catch (er) {
  4807. if (!chownErOk(er)) throw er
  4808. }
  4809. }
  4810. }
  4811. function statFix (orig) {
  4812. if (!orig) return orig
  4813. // Older versions of Node erroneously returned signed integers for
  4814. // uid + gid.
  4815. return function (target, options, cb) {
  4816. if (typeof options === 'function') {
  4817. cb = options
  4818. options = null
  4819. }
  4820. function callback (er, stats) {
  4821. if (stats) {
  4822. if (stats.uid < 0) stats.uid += 0x100000000
  4823. if (stats.gid < 0) stats.gid += 0x100000000
  4824. }
  4825. if (cb) cb.apply(this, arguments)
  4826. }
  4827. return options ? orig.call(fs, target, options, callback)
  4828. : orig.call(fs, target, callback)
  4829. }
  4830. }
  4831. function statFixSync (orig) {
  4832. if (!orig) return orig
  4833. // Older versions of Node erroneously returned signed integers for
  4834. // uid + gid.
  4835. return function (target, options) {
  4836. var stats = options ? orig.call(fs, target, options)
  4837. : orig.call(fs, target)
  4838. if (stats.uid < 0) stats.uid += 0x100000000
  4839. if (stats.gid < 0) stats.gid += 0x100000000
  4840. return stats;
  4841. }
  4842. }
  4843. // ENOSYS means that the fs doesn't support the op. Just ignore
  4844. // that, because it doesn't matter.
  4845. //
  4846. // if there's no getuid, or if getuid() is something other
  4847. // than 0, and the error is EINVAL or EPERM, then just ignore
  4848. // it.
  4849. //
  4850. // This specific case is a silent failure in cp, install, tar,
  4851. // and most other unix tools that manage permissions.
  4852. //
  4853. // When running as root, or if other types of errors are
  4854. // encountered, then it's strict.
  4855. function chownErOk (er) {
  4856. if (!er)
  4857. return true
  4858. if (er.code === "ENOSYS")
  4859. return true
  4860. var nonroot = !process.getuid || process.getuid() !== 0
  4861. if (nonroot) {
  4862. if (er.code === "EINVAL" || er.code === "EPERM")
  4863. return true
  4864. }
  4865. return false
  4866. }
  4867. }
  4868. /***/ }),
  4869. /***/ 262:
  4870. /***/ (function(module) {
  4871. module.exports = {"pagination":{}};
  4872. /***/ }),
  4873. /***/ 265:
  4874. /***/ (function(module, __unusedexports, __webpack_require__) {
  4875. var property = __webpack_require__(153).property;
  4876. function Paginator(name, paginator) {
  4877. property(this, 'inputToken', paginator.input_token);
  4878. property(this, 'limitKey', paginator.limit_key);
  4879. property(this, 'moreResults', paginator.more_results);
  4880. property(this, 'outputToken', paginator.output_token);
  4881. property(this, 'resultKey', paginator.result_key);
  4882. }
  4883. /**
  4884. * @api private
  4885. */
  4886. module.exports = Paginator;
  4887. /***/ }),
  4888. /***/ 280:
  4889. /***/ (function(module) {
  4890. module.exports = {"pagination":{"ListIdentityPools":{"input_token":"NextToken","limit_key":"MaxResults","output_token":"NextToken","result_key":"IdentityPools"}}};
  4891. /***/ }),
  4892. /***/ 293:
  4893. /***/ (function(module) {
  4894. module.exports = require("buffer");
  4895. /***/ }),
  4896. /***/ 304:
  4897. /***/ (function(module) {
  4898. module.exports = require("string_decoder");
  4899. /***/ }),
  4900. /***/ 306:
  4901. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  4902. var AWS = __webpack_require__(395);
  4903. var STS = __webpack_require__(733);
  4904. /**
  4905. * Represents credentials retrieved from STS Web Identity Federation support.
  4906. *
  4907. * By default this provider gets credentials using the
  4908. * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation
  4909. * requires a `RoleArn` containing the ARN of the IAM trust policy for the
  4910. * application for which credentials will be given. In addition, the
  4911. * `WebIdentityToken` must be set to the token provided by the identity
  4912. * provider. See {constructor} for an example on creating a credentials
  4913. * object with proper `RoleArn` and `WebIdentityToken` values.
  4914. *
  4915. * ## Refreshing Credentials from Identity Service
  4916. *
  4917. * In addition to AWS credentials expiring after a given amount of time, the
  4918. * login token from the identity provider will also expire. Once this token
  4919. * expires, it will not be usable to refresh AWS credentials, and another
  4920. * token will be needed. The SDK does not manage refreshing of the token value,
  4921. * but this can be done through a "refresh token" supported by most identity
  4922. * providers. Consult the documentation for the identity provider for refreshing
  4923. * tokens. Once the refreshed token is acquired, you should make sure to update
  4924. * this new token in the credentials object's {params} property. The following
  4925. * code will update the WebIdentityToken, assuming you have retrieved an updated
  4926. * token from the identity provider:
  4927. *
  4928. * ```javascript
  4929. * AWS.config.credentials.params.WebIdentityToken = updatedToken;
  4930. * ```
  4931. *
  4932. * Future calls to `credentials.refresh()` will now use the new token.
  4933. *
  4934. * @!attribute params
  4935. * @return [map] the map of params passed to
  4936. * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the
  4937. * `params.WebIdentityToken` property.
  4938. * @!attribute data
  4939. * @return [map] the raw data response from the call to
  4940. * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get
  4941. * access to other properties from the response.
  4942. */
  4943. AWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {
  4944. /**
  4945. * Creates a new credentials object.
  4946. * @param (see AWS.STS.assumeRoleWithWebIdentity)
  4947. * @example Creating a new credentials object
  4948. * AWS.config.credentials = new AWS.WebIdentityCredentials({
  4949. * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity',
  4950. * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service
  4951. * RoleSessionName: 'web' // optional name, defaults to web-identity
  4952. * }, {
  4953. * // optionally provide configuration to apply to the underlying AWS.STS service client
  4954. * // if configuration is not provided, then configuration will be pulled from AWS.config
  4955. *
  4956. * // specify timeout options
  4957. * httpOptions: {
  4958. * timeout: 100
  4959. * }
  4960. * });
  4961. * @see AWS.STS.assumeRoleWithWebIdentity
  4962. * @see AWS.Config
  4963. */
  4964. constructor: function WebIdentityCredentials(params, clientConfig) {
  4965. AWS.Credentials.call(this);
  4966. this.expired = true;
  4967. this.params = params;
  4968. this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity';
  4969. this.data = null;
  4970. this._clientConfig = AWS.util.copy(clientConfig || {});
  4971. },
  4972. /**
  4973. * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}
  4974. *
  4975. * @callback callback function(err)
  4976. * Called when the STS service responds (or fails). When
  4977. * this callback is called with no error, it means that the credentials
  4978. * information has been loaded into the object (as the `accessKeyId`,
  4979. * `secretAccessKey`, and `sessionToken` properties).
  4980. * @param err [Error] if an error occurred, this value will be filled
  4981. * @see get
  4982. */
  4983. refresh: function refresh(callback) {
  4984. this.coalesceRefresh(callback || AWS.util.fn.callback);
  4985. },
  4986. /**
  4987. * @api private
  4988. */
  4989. load: function load(callback) {
  4990. var self = this;
  4991. self.createClients();
  4992. self.service.assumeRoleWithWebIdentity(function (err, data) {
  4993. self.data = null;
  4994. if (!err) {
  4995. self.data = data;
  4996. self.service.credentialsFrom(data, self);
  4997. }
  4998. callback(err);
  4999. });
  5000. },
  5001. /**
  5002. * @api private
  5003. */
  5004. createClients: function() {
  5005. if (!this.service) {
  5006. var stsConfig = AWS.util.merge({}, this._clientConfig);
  5007. stsConfig.params = this.params;
  5008. this.service = new STS(stsConfig);
  5009. }
  5010. }
  5011. });
  5012. /***/ }),
  5013. /***/ 312:
  5014. /***/ (function(module, __unusedexports, __webpack_require__) {
  5015. // Generated by CoffeeScript 1.12.7
  5016. (function() {
  5017. var XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
  5018. ref = __webpack_require__(582), assign = ref.assign, isFunction = ref.isFunction;
  5019. XMLDocument = __webpack_require__(559);
  5020. XMLDocumentCB = __webpack_require__(768);
  5021. XMLStringWriter = __webpack_require__(750);
  5022. XMLStreamWriter = __webpack_require__(458);
  5023. module.exports.create = function(name, xmldec, doctype, options) {
  5024. var doc, root;
  5025. if (name == null) {
  5026. throw new Error("Root element needs a name");
  5027. }
  5028. options = assign({}, xmldec, doctype, options);
  5029. doc = new XMLDocument(options);
  5030. root = doc.element(name);
  5031. if (!options.headless) {
  5032. doc.declaration(options);
  5033. if ((options.pubID != null) || (options.sysID != null)) {
  5034. doc.doctype(options);
  5035. }
  5036. }
  5037. return root;
  5038. };
  5039. module.exports.begin = function(options, onData, onEnd) {
  5040. var ref1;
  5041. if (isFunction(options)) {
  5042. ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
  5043. options = {};
  5044. }
  5045. if (onData) {
  5046. return new XMLDocumentCB(options, onData, onEnd);
  5047. } else {
  5048. return new XMLDocument(options);
  5049. }
  5050. };
  5051. module.exports.stringWriter = function(options) {
  5052. return new XMLStringWriter(options);
  5053. };
  5054. module.exports.streamWriter = function(stream, options) {
  5055. return new XMLStreamWriter(stream, options);
  5056. };
  5057. }).call(this);
  5058. /***/ }),
  5059. /***/ 315:
  5060. /***/ (function(module, __unusedexports, __webpack_require__) {
  5061. var util = __webpack_require__(153);
  5062. var Rest = __webpack_require__(618);
  5063. var Json = __webpack_require__(912);
  5064. var JsonBuilder = __webpack_require__(337);
  5065. var JsonParser = __webpack_require__(806);
  5066. function populateBody(req) {
  5067. var builder = new JsonBuilder();
  5068. var input = req.service.api.operations[req.operation].input;
  5069. if (input.payload) {
  5070. var params = {};
  5071. var payloadShape = input.members[input.payload];
  5072. params = req.params[input.payload];
  5073. if (params === undefined) return;
  5074. if (payloadShape.type === 'structure') {
  5075. req.httpRequest.body = builder.build(params, payloadShape);
  5076. applyContentTypeHeader(req);
  5077. } else { // non-JSON payload
  5078. req.httpRequest.body = params;
  5079. if (payloadShape.type === 'binary' || payloadShape.isStreaming) {
  5080. applyContentTypeHeader(req, true);
  5081. }
  5082. }
  5083. } else {
  5084. var body = builder.build(req.params, input);
  5085. if (body !== '{}' || req.httpRequest.method !== 'GET') { //don't send empty body for GET method
  5086. req.httpRequest.body = body;
  5087. }
  5088. applyContentTypeHeader(req);
  5089. }
  5090. }
  5091. function applyContentTypeHeader(req, isBinary) {
  5092. var operation = req.service.api.operations[req.operation];
  5093. var input = operation.input;
  5094. if (!req.httpRequest.headers['Content-Type']) {
  5095. var type = isBinary ? 'binary/octet-stream' : 'application/json';
  5096. req.httpRequest.headers['Content-Type'] = type;
  5097. }
  5098. }
  5099. function buildRequest(req) {
  5100. Rest.buildRequest(req);
  5101. // never send body payload on HEAD/DELETE
  5102. if (['HEAD', 'DELETE'].indexOf(req.httpRequest.method) < 0) {
  5103. populateBody(req);
  5104. }
  5105. }
  5106. function extractError(resp) {
  5107. Json.extractError(resp);
  5108. }
  5109. function extractData(resp) {
  5110. Rest.extractData(resp);
  5111. var req = resp.request;
  5112. var operation = req.service.api.operations[req.operation];
  5113. var rules = req.service.api.operations[req.operation].output || {};
  5114. var parser;
  5115. var hasEventOutput = operation.hasEventOutput;
  5116. if (rules.payload) {
  5117. var payloadMember = rules.members[rules.payload];
  5118. var body = resp.httpResponse.body;
  5119. if (payloadMember.isEventStream) {
  5120. parser = new JsonParser();
  5121. resp.data[payload] = util.createEventStream(
  5122. AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body,
  5123. parser,
  5124. payloadMember
  5125. );
  5126. } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') {
  5127. var parser = new JsonParser();
  5128. resp.data[rules.payload] = parser.parse(body, payloadMember);
  5129. } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) {
  5130. resp.data[rules.payload] = body;
  5131. } else {
  5132. resp.data[rules.payload] = payloadMember.toType(body);
  5133. }
  5134. } else {
  5135. var data = resp.data;
  5136. Json.extractData(resp);
  5137. resp.data = util.merge(data, resp.data);
  5138. }
  5139. }
  5140. /**
  5141. * @api private
  5142. */
  5143. module.exports = {
  5144. buildRequest: buildRequest,
  5145. extractError: extractError,
  5146. extractData: extractData
  5147. };
  5148. /***/ }),
  5149. /***/ 316:
  5150. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  5151. var AWS = __webpack_require__(395);
  5152. /**
  5153. * Represents credentials received from relative URI specified in the ECS container.
  5154. *
  5155. * This class will request refreshable credentials from the relative URI
  5156. * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the
  5157. * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials
  5158. * are returned in the response, these will be used with zero configuration.
  5159. *
  5160. * This credentials class will by default timeout after 1 second of inactivity
  5161. * and retry 3 times.
  5162. * If your requests to the relative URI are timing out, you can increase
  5163. * the value by configuring them directly:
  5164. *
  5165. * ```javascript
  5166. * AWS.config.credentials = new AWS.ECSCredentials({
  5167. * httpOptions: { timeout: 5000 }, // 5 second timeout
  5168. * maxRetries: 10, // retry 10 times
  5169. * retryDelayOptions: { base: 200 } // see AWS.Config for information
  5170. * });
  5171. * ```
  5172. *
  5173. * @see AWS.Config.retryDelayOptions
  5174. *
  5175. * @!macro nobrowser
  5176. */
  5177. AWS.ECSCredentials = AWS.RemoteCredentials;
  5178. /***/ }),
  5179. /***/ 323:
  5180. /***/ (function(module) {
  5181. "use strict";
  5182. // Found this seed-based random generator somewhere
  5183. // Based on The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
  5184. var seed = 1;
  5185. /**
  5186. * return a random number based on a seed
  5187. * @param seed
  5188. * @returns {number}
  5189. */
  5190. function getNextValue() {
  5191. seed = (seed * 9301 + 49297) % 233280;
  5192. return seed/(233280.0);
  5193. }
  5194. function setSeed(_seed_) {
  5195. seed = _seed_;
  5196. }
  5197. module.exports = {
  5198. nextValue: getNextValue,
  5199. seed: setSeed
  5200. };
  5201. /***/ }),
  5202. /***/ 337:
  5203. /***/ (function(module, __unusedexports, __webpack_require__) {
  5204. var util = __webpack_require__(153);
  5205. function JsonBuilder() { }
  5206. JsonBuilder.prototype.build = function(value, shape) {
  5207. return JSON.stringify(translate(value, shape));
  5208. };
  5209. function translate(value, shape) {
  5210. if (!shape || value === undefined || value === null) return undefined;
  5211. switch (shape.type) {
  5212. case 'structure': return translateStructure(value, shape);
  5213. case 'map': return translateMap(value, shape);
  5214. case 'list': return translateList(value, shape);
  5215. default: return translateScalar(value, shape);
  5216. }
  5217. }
  5218. function translateStructure(structure, shape) {
  5219. var struct = {};
  5220. util.each(structure, function(name, value) {
  5221. var memberShape = shape.members[name];
  5222. if (memberShape) {
  5223. if (memberShape.location !== 'body') return;
  5224. var locationName = memberShape.isLocationName ? memberShape.name : name;
  5225. var result = translate(value, memberShape);
  5226. if (result !== undefined) struct[locationName] = result;
  5227. }
  5228. });
  5229. return struct;
  5230. }
  5231. function translateList(list, shape) {
  5232. var out = [];
  5233. util.arrayEach(list, function(value) {
  5234. var result = translate(value, shape.member);
  5235. if (result !== undefined) out.push(result);
  5236. });
  5237. return out;
  5238. }
  5239. function translateMap(map, shape) {
  5240. var out = {};
  5241. util.each(map, function(key, value) {
  5242. var result = translate(value, shape.value);
  5243. if (result !== undefined) out[key] = result;
  5244. });
  5245. return out;
  5246. }
  5247. function translateScalar(value, shape) {
  5248. return shape.toWireFormat(value);
  5249. }
  5250. /**
  5251. * @api private
  5252. */
  5253. module.exports = JsonBuilder;
  5254. /***/ }),
  5255. /***/ 338:
  5256. /***/ (function(module, __unusedexports, __webpack_require__) {
  5257. var AWS = __webpack_require__(395);
  5258. var regionUtil = __webpack_require__(546);
  5259. var s3util = {
  5260. /**
  5261. * @api private
  5262. */
  5263. isArnInParam: function isArnInParam(req, paramName) {
  5264. var inputShape = (req.service.api.operations[req.operation] || {}).input || {};
  5265. var inputMembers = inputShape.members || {};
  5266. if (!req.params[paramName] || !inputMembers[paramName]) return false;
  5267. return AWS.util.ARN.validate(req.params[paramName]);
  5268. },
  5269. /**
  5270. * Validate service component from ARN supplied in Bucket parameter
  5271. */
  5272. validateArnService: function validateArnService(req) {
  5273. var parsedArn = req.service._parsedArn;
  5274. if (parsedArn.service !== 's3' && parsedArn.service !== 's3-outposts') {
  5275. throw AWS.util.error(new Error(), {
  5276. code: 'InvalidARN',
  5277. message: 'expect \'s3\' or \'s3-outposts\' in ARN service component'
  5278. });
  5279. }
  5280. },
  5281. /**
  5282. * Validate account ID from ARN supplied in Bucket parameter is a valid account
  5283. */
  5284. validateArnAccount: function validateArnAccount(req) {
  5285. var parsedArn = req.service._parsedArn;
  5286. if (!/[0-9]{12}/.exec(parsedArn.accountId)) {
  5287. throw AWS.util.error(new Error(), {
  5288. code: 'InvalidARN',
  5289. message: 'ARN accountID does not match regex "[0-9]{12}"'
  5290. });
  5291. }
  5292. },
  5293. /**
  5294. * Validate ARN supplied in Bucket parameter is a valid access point ARN
  5295. */
  5296. validateS3AccessPointArn: function validateS3AccessPointArn(req) {
  5297. var parsedArn = req.service._parsedArn;
  5298. //can be ':' or '/'
  5299. var delimiter = parsedArn.resource['accesspoint'.length];
  5300. if (parsedArn.resource.split(delimiter).length !== 2) {
  5301. throw AWS.util.error(new Error(), {
  5302. code: 'InvalidARN',
  5303. message: 'Access Point ARN should have one resource accesspoint/{accesspointName}'
  5304. });
  5305. }
  5306. var accessPoint = parsedArn.resource.split(delimiter)[1];
  5307. var accessPointPrefix = accessPoint + '-' + parsedArn.accountId;
  5308. if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) {
  5309. throw AWS.util.error(new Error(), {
  5310. code: 'InvalidARN',
  5311. message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint
  5312. });
  5313. }
  5314. //set parsed valid access point
  5315. req.service._parsedArn.accessPoint = accessPoint;
  5316. },
  5317. /**
  5318. * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN
  5319. */
  5320. validateOutpostsArn: function validateOutpostsArn(req) {
  5321. var parsedArn = req.service._parsedArn;
  5322. if (
  5323. parsedArn.resource.indexOf('outpost:') !== 0 &&
  5324. parsedArn.resource.indexOf('outpost/') !== 0
  5325. ) {
  5326. throw AWS.util.error(new Error(), {
  5327. code: 'InvalidARN',
  5328. message: 'ARN resource should begin with \'outpost/\''
  5329. });
  5330. }
  5331. //can be ':' or '/'
  5332. var delimiter = parsedArn.resource['outpost'.length];
  5333. var outpostId = parsedArn.resource.split(delimiter)[1];
  5334. var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);
  5335. if (!dnsHostRegex.test(outpostId)) {
  5336. throw AWS.util.error(new Error(), {
  5337. code: 'InvalidARN',
  5338. message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId
  5339. });
  5340. }
  5341. req.service._parsedArn.outpostId = outpostId;
  5342. },
  5343. /**
  5344. * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN
  5345. */
  5346. validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) {
  5347. var parsedArn = req.service._parsedArn;
  5348. //can be ':' or '/'
  5349. var delimiter = parsedArn.resource['outpost'.length];
  5350. if (parsedArn.resource.split(delimiter).length !== 4) {
  5351. throw AWS.util.error(new Error(), {
  5352. code: 'InvalidARN',
  5353. message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}'
  5354. });
  5355. }
  5356. var accessPoint = parsedArn.resource.split(delimiter)[3];
  5357. var accessPointPrefix = accessPoint + '-' + parsedArn.accountId;
  5358. if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\./)) {
  5359. throw AWS.util.error(new Error(), {
  5360. code: 'InvalidARN',
  5361. message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint
  5362. });
  5363. }
  5364. //set parsed valid access point
  5365. req.service._parsedArn.accessPoint = accessPoint;
  5366. },
  5367. /**
  5368. * Validate region field in ARN supplied in Bucket parameter is a valid region
  5369. */
  5370. validateArnRegion: function validateArnRegion(req) {
  5371. var useArnRegion = s3util.loadUseArnRegionConfig(req);
  5372. var regionFromArn = req.service._parsedArn.region;
  5373. var clientRegion = req.service.config.region;
  5374. if (!regionFromArn) {
  5375. throw AWS.util.error(new Error(), {
  5376. code: 'InvalidARN',
  5377. message: 'ARN region is empty'
  5378. });
  5379. }
  5380. if (
  5381. clientRegion.indexOf('fips') >= 0 ||
  5382. regionFromArn.indexOf('fips') >= 0
  5383. ) {
  5384. throw AWS.util.error(new Error(), {
  5385. code: 'InvalidConfiguration',
  5386. message: 'ARN endpoint is not compatible with FIPS region'
  5387. });
  5388. }
  5389. if (!useArnRegion && regionFromArn !== clientRegion) {
  5390. throw AWS.util.error(new Error(), {
  5391. code: 'InvalidConfiguration',
  5392. message: 'Configured region conflicts with access point region'
  5393. });
  5394. } else if (
  5395. useArnRegion &&
  5396. regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion)
  5397. ) {
  5398. throw AWS.util.error(new Error(), {
  5399. code: 'InvalidConfiguration',
  5400. message: 'Configured region and access point region not in same partition'
  5401. });
  5402. }
  5403. if (req.service.config.useAccelerateEndpoint) {
  5404. throw AWS.util.error(new Error(), {
  5405. code: 'InvalidConfiguration',
  5406. message: 'useAccelerateEndpoint config is not supported with access point ARN'
  5407. });
  5408. }
  5409. if (req.service._parsedArn.service === 's3-outposts' && req.service.config.useDualstack) {
  5410. throw AWS.util.error(new Error(), {
  5411. code: 'InvalidConfiguration',
  5412. message: 'useDualstack config is not supported with outposts access point ARN'
  5413. });
  5414. }
  5415. },
  5416. loadUseArnRegionConfig: function loadUseArnRegionConfig(req) {
  5417. var envName = 'AWS_S3_USE_ARN_REGION';
  5418. var configName = 's3_use_arn_region';
  5419. var useArnRegion = true;
  5420. var originalConfig = req.service._originalConfig || {};
  5421. if (req.service.config.s3UseArnRegion !== undefined) {
  5422. return req.service.config.s3UseArnRegion;
  5423. } else if (originalConfig.s3UseArnRegion !== undefined) {
  5424. useArnRegion = originalConfig.s3UseArnRegion === true;
  5425. } else if (AWS.util.isNode()) {
  5426. //load from environmental variable AWS_USE_ARN_REGION
  5427. if (process.env[envName]) {
  5428. var value = process.env[envName].trim().toLowerCase();
  5429. if (['false', 'true'].indexOf(value) < 0) {
  5430. throw AWS.util.error(new Error(), {
  5431. code: 'InvalidConfiguration',
  5432. message: envName + ' only accepts true or false. Got ' + process.env[envName],
  5433. retryable: false
  5434. });
  5435. }
  5436. useArnRegion = value === 'true';
  5437. } else { //load from shared config property use_arn_region
  5438. var profiles = {};
  5439. var profile = {};
  5440. try {
  5441. profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);
  5442. profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];
  5443. } catch (e) {}
  5444. if (profile[configName]) {
  5445. if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) {
  5446. throw AWS.util.error(new Error(), {
  5447. code: 'InvalidConfiguration',
  5448. message: configName + ' only accepts true or false. Got ' + profile[configName],
  5449. retryable: false
  5450. });
  5451. }
  5452. useArnRegion = profile[configName].trim().toLowerCase() === 'true';
  5453. }
  5454. }
  5455. }
  5456. req.service.config.s3UseArnRegion = useArnRegion;
  5457. return useArnRegion;
  5458. },
  5459. /**
  5460. * Validations before URI can be populated
  5461. */
  5462. validatePopulateUriFromArn: function validatePopulateUriFromArn(req) {
  5463. if (req.service._originalConfig && req.service._originalConfig.endpoint) {
  5464. throw AWS.util.error(new Error(), {
  5465. code: 'InvalidConfiguration',
  5466. message: 'Custom endpoint is not compatible with access point ARN'
  5467. });
  5468. }
  5469. if (req.service.config.s3ForcePathStyle) {
  5470. throw AWS.util.error(new Error(), {
  5471. code: 'InvalidConfiguration',
  5472. message: 'Cannot construct path-style endpoint with access point'
  5473. });
  5474. }
  5475. },
  5476. /**
  5477. * Returns true if the bucket name is DNS compatible. Buckets created
  5478. * outside of the classic region MUST be DNS compatible.
  5479. *
  5480. * @api private
  5481. */
  5482. dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) {
  5483. var b = bucketName;
  5484. var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);
  5485. var ipAddress = new RegExp(/(\d+\.){3}\d+/);
  5486. var dots = new RegExp(/\.\./);
  5487. return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false;
  5488. },
  5489. };
  5490. /**
  5491. * @api private
  5492. */
  5493. module.exports = s3util;
  5494. /***/ }),
  5495. /***/ 350:
  5496. /***/ (function(__unusedmodule, exports) {
  5497. // Generated by CoffeeScript 1.12.7
  5498. (function() {
  5499. "use strict";
  5500. var prefixMatch;
  5501. prefixMatch = new RegExp(/(?!xmlns)^.*:/);
  5502. exports.normalize = function(str) {
  5503. return str.toLowerCase();
  5504. };
  5505. exports.firstCharLowerCase = function(str) {
  5506. return str.charAt(0).toLowerCase() + str.slice(1);
  5507. };
  5508. exports.stripPrefix = function(str) {
  5509. return str.replace(prefixMatch, '');
  5510. };
  5511. exports.parseNumbers = function(str) {
  5512. if (!isNaN(str)) {
  5513. str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
  5514. }
  5515. return str;
  5516. };
  5517. exports.parseBooleans = function(str) {
  5518. if (/^(?:true|false)$/i.test(str)) {
  5519. str = str.toLowerCase() === 'true';
  5520. }
  5521. return str;
  5522. };
  5523. }).call(this);
  5524. /***/ }),
  5525. /***/ 354:
  5526. /***/ (function(module, __unusedexports, __webpack_require__) {
  5527. "use strict";
  5528. module.exports = __webpack_require__(703);
  5529. /***/ }),
  5530. /***/ 357:
  5531. /***/ (function(module) {
  5532. module.exports = require("assert");
  5533. /***/ }),
  5534. /***/ 395:
  5535. /***/ (function(module, __unusedexports, __webpack_require__) {
  5536. /**
  5537. * The main AWS namespace
  5538. */
  5539. var AWS = { util: __webpack_require__(153) };
  5540. /**
  5541. * @api private
  5542. * @!macro [new] nobrowser
  5543. * @note This feature is not supported in the browser environment of the SDK.
  5544. */
  5545. var _hidden = {}; _hidden.toString(); // hack to parse macro
  5546. /**
  5547. * @api private
  5548. */
  5549. module.exports = AWS;
  5550. AWS.util.update(AWS, {
  5551. /**
  5552. * @constant
  5553. */
  5554. VERSION: '2.814.0',
  5555. /**
  5556. * @api private
  5557. */
  5558. Signers: {},
  5559. /**
  5560. * @api private
  5561. */
  5562. Protocol: {
  5563. Json: __webpack_require__(912),
  5564. Query: __webpack_require__(576),
  5565. Rest: __webpack_require__(618),
  5566. RestJson: __webpack_require__(315),
  5567. RestXml: __webpack_require__(2)
  5568. },
  5569. /**
  5570. * @api private
  5571. */
  5572. XML: {
  5573. Builder: __webpack_require__(492),
  5574. Parser: null // conditionally set based on environment
  5575. },
  5576. /**
  5577. * @api private
  5578. */
  5579. JSON: {
  5580. Builder: __webpack_require__(337),
  5581. Parser: __webpack_require__(806)
  5582. },
  5583. /**
  5584. * @api private
  5585. */
  5586. Model: {
  5587. Api: __webpack_require__(788),
  5588. Operation: __webpack_require__(964),
  5589. Shape: __webpack_require__(682),
  5590. Paginator: __webpack_require__(265),
  5591. ResourceWaiter: __webpack_require__(624)
  5592. },
  5593. /**
  5594. * @api private
  5595. */
  5596. apiLoader: __webpack_require__(165),
  5597. /**
  5598. * @api private
  5599. */
  5600. EndpointCache: __webpack_require__(120).EndpointCache
  5601. });
  5602. __webpack_require__(610);
  5603. __webpack_require__(503);
  5604. __webpack_require__(187);
  5605. __webpack_require__(711);
  5606. __webpack_require__(606);
  5607. __webpack_require__(453);
  5608. __webpack_require__(828);
  5609. __webpack_require__(930);
  5610. __webpack_require__(835);
  5611. __webpack_require__(977);
  5612. /**
  5613. * @readonly
  5614. * @return [AWS.SequentialExecutor] a collection of global event listeners that
  5615. * are attached to every sent request.
  5616. * @see AWS.Request AWS.Request for a list of events to listen for
  5617. * @example Logging the time taken to send a request
  5618. * AWS.events.on('send', function startSend(resp) {
  5619. * resp.startTime = new Date().getTime();
  5620. * }).on('complete', function calculateTime(resp) {
  5621. * var time = (new Date().getTime() - resp.startTime) / 1000;
  5622. * console.log('Request took ' + time + ' seconds');
  5623. * });
  5624. *
  5625. * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds'
  5626. */
  5627. AWS.events = new AWS.SequentialExecutor();
  5628. //create endpoint cache lazily
  5629. AWS.util.memoizedProperty(AWS, 'endpointCache', function() {
  5630. return new AWS.EndpointCache(AWS.config.endpointCacheSize);
  5631. }, true);
  5632. /***/ }),
  5633. /***/ 404:
  5634. /***/ (function(module, __unusedexports, __webpack_require__) {
  5635. var escapeAttribute = __webpack_require__(918).escapeAttribute;
  5636. /**
  5637. * Represents an XML node.
  5638. * @api private
  5639. */
  5640. function XmlNode(name, children) {
  5641. if (children === void 0) { children = []; }
  5642. this.name = name;
  5643. this.children = children;
  5644. this.attributes = {};
  5645. }
  5646. XmlNode.prototype.addAttribute = function (name, value) {
  5647. this.attributes[name] = value;
  5648. return this;
  5649. };
  5650. XmlNode.prototype.addChildNode = function (child) {
  5651. this.children.push(child);
  5652. return this;
  5653. };
  5654. XmlNode.prototype.removeAttribute = function (name) {
  5655. delete this.attributes[name];
  5656. return this;
  5657. };
  5658. XmlNode.prototype.toString = function () {
  5659. var hasChildren = Boolean(this.children.length);
  5660. var xmlText = '<' + this.name;
  5661. // add attributes
  5662. var attributes = this.attributes;
  5663. for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) {
  5664. var attributeName = attributeNames[i];
  5665. var attribute = attributes[attributeName];
  5666. if (typeof attribute !== 'undefined' && attribute !== null) {
  5667. xmlText += ' ' + attributeName + '=\"' + escapeAttribute('' + attribute) + '\"';
  5668. }
  5669. }
  5670. return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + '</' + this.name + '>';
  5671. };
  5672. /**
  5673. * @api private
  5674. */
  5675. module.exports = {
  5676. XmlNode: XmlNode
  5677. };
  5678. /***/ }),
  5679. /***/ 413:
  5680. /***/ (function(module) {
  5681. module.exports = require("stream");
  5682. /***/ }),
  5683. /***/ 414:
  5684. /***/ (function(module) {
  5685. module.exports = require("url");
  5686. /***/ }),
  5687. /***/ 417:
  5688. /***/ (function(module) {
  5689. module.exports = require("crypto");
  5690. /***/ }),
  5691. /***/ 423:
  5692. /***/ (function(module) {
  5693. // Generated by CoffeeScript 1.12.7
  5694. (function() {
  5695. var XMLWriterBase,
  5696. hasProp = {}.hasOwnProperty;
  5697. module.exports = XMLWriterBase = (function() {
  5698. function XMLWriterBase(options) {
  5699. var key, ref, ref1, ref2, ref3, ref4, ref5, ref6, value;
  5700. options || (options = {});
  5701. this.pretty = options.pretty || false;
  5702. this.allowEmpty = (ref = options.allowEmpty) != null ? ref : false;
  5703. if (this.pretty) {
  5704. this.indent = (ref1 = options.indent) != null ? ref1 : ' ';
  5705. this.newline = (ref2 = options.newline) != null ? ref2 : '\n';
  5706. this.offset = (ref3 = options.offset) != null ? ref3 : 0;
  5707. this.dontprettytextnodes = (ref4 = options.dontprettytextnodes) != null ? ref4 : 0;
  5708. } else {
  5709. this.indent = '';
  5710. this.newline = '';
  5711. this.offset = 0;
  5712. this.dontprettytextnodes = 0;
  5713. }
  5714. this.spacebeforeslash = (ref5 = options.spacebeforeslash) != null ? ref5 : '';
  5715. if (this.spacebeforeslash === true) {
  5716. this.spacebeforeslash = ' ';
  5717. }
  5718. this.newlinedefault = this.newline;
  5719. this.prettydefault = this.pretty;
  5720. ref6 = options.writer || {};
  5721. for (key in ref6) {
  5722. if (!hasProp.call(ref6, key)) continue;
  5723. value = ref6[key];
  5724. this[key] = value;
  5725. }
  5726. }
  5727. XMLWriterBase.prototype.set = function(options) {
  5728. var key, ref, value;
  5729. options || (options = {});
  5730. if ("pretty" in options) {
  5731. this.pretty = options.pretty;
  5732. }
  5733. if ("allowEmpty" in options) {
  5734. this.allowEmpty = options.allowEmpty;
  5735. }
  5736. if (this.pretty) {
  5737. this.indent = "indent" in options ? options.indent : ' ';
  5738. this.newline = "newline" in options ? options.newline : '\n';
  5739. this.offset = "offset" in options ? options.offset : 0;
  5740. this.dontprettytextnodes = "dontprettytextnodes" in options ? options.dontprettytextnodes : 0;
  5741. } else {
  5742. this.indent = '';
  5743. this.newline = '';
  5744. this.offset = 0;
  5745. this.dontprettytextnodes = 0;
  5746. }
  5747. this.spacebeforeslash = "spacebeforeslash" in options ? options.spacebeforeslash : '';
  5748. if (this.spacebeforeslash === true) {
  5749. this.spacebeforeslash = ' ';
  5750. }
  5751. this.newlinedefault = this.newline;
  5752. this.prettydefault = this.pretty;
  5753. ref = options.writer || {};
  5754. for (key in ref) {
  5755. if (!hasProp.call(ref, key)) continue;
  5756. value = ref[key];
  5757. this[key] = value;
  5758. }
  5759. return this;
  5760. };
  5761. XMLWriterBase.prototype.space = function(level) {
  5762. var indent;
  5763. if (this.pretty) {
  5764. indent = (level || 0) + this.offset + 1;
  5765. if (indent > 0) {
  5766. return new Array(indent).join(this.indent);
  5767. } else {
  5768. return '';
  5769. }
  5770. } else {
  5771. return '';
  5772. }
  5773. };
  5774. return XMLWriterBase;
  5775. })();
  5776. }).call(this);
  5777. /***/ }),
  5778. /***/ 426:
  5779. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  5780. var AWS = __webpack_require__(395),
  5781. ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI',
  5782. ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI',
  5783. ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN',
  5784. FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'],
  5785. FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'],
  5786. FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'],
  5787. RELATIVE_URI_HOST = '169.254.170.2';
  5788. /**
  5789. * Represents credentials received from specified URI.
  5790. *
  5791. * This class will request refreshable credentials from the relative URI
  5792. * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the
  5793. * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials
  5794. * are returned in the response, these will be used with zero configuration.
  5795. *
  5796. * This credentials class will by default timeout after 1 second of inactivity
  5797. * and retry 3 times.
  5798. * If your requests to the relative URI are timing out, you can increase
  5799. * the value by configuring them directly:
  5800. *
  5801. * ```javascript
  5802. * AWS.config.credentials = new AWS.RemoteCredentials({
  5803. * httpOptions: { timeout: 5000 }, // 5 second timeout
  5804. * maxRetries: 10, // retry 10 times
  5805. * retryDelayOptions: { base: 200 } // see AWS.Config for information
  5806. * });
  5807. * ```
  5808. *
  5809. * @see AWS.Config.retryDelayOptions
  5810. *
  5811. * @!macro nobrowser
  5812. */
  5813. AWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, {
  5814. constructor: function RemoteCredentials(options) {
  5815. AWS.Credentials.call(this);
  5816. options = options ? AWS.util.copy(options) : {};
  5817. if (!options.httpOptions) options.httpOptions = {};
  5818. options.httpOptions = AWS.util.merge(
  5819. this.httpOptions, options.httpOptions);
  5820. AWS.util.update(this, options);
  5821. },
  5822. /**
  5823. * @api private
  5824. */
  5825. httpOptions: { timeout: 1000 },
  5826. /**
  5827. * @api private
  5828. */
  5829. maxRetries: 3,
  5830. /**
  5831. * @api private
  5832. */
  5833. isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() {
  5834. return Boolean(
  5835. process &&
  5836. process.env &&
  5837. (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI])
  5838. );
  5839. },
  5840. /**
  5841. * @api private
  5842. */
  5843. getECSFullUri: function getECSFullUri() {
  5844. if (process && process.env) {
  5845. var relative = process.env[ENV_RELATIVE_URI],
  5846. full = process.env[ENV_FULL_URI];
  5847. if (relative) {
  5848. return 'http://' + RELATIVE_URI_HOST + relative;
  5849. } else if (full) {
  5850. var parsed = AWS.util.urlParse(full);
  5851. if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) {
  5852. throw AWS.util.error(
  5853. new Error('Unsupported protocol: AWS.RemoteCredentials supports '
  5854. + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; '
  5855. + parsed.protocol + ' requested.'),
  5856. { code: 'ECSCredentialsProviderFailure' }
  5857. );
  5858. }
  5859. if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 &&
  5860. FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) {
  5861. throw AWS.util.error(
  5862. new Error('Unsupported hostname: AWS.RemoteCredentials only supports '
  5863. + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; '
  5864. + parsed.protocol + '//' + parsed.hostname + ' requested.'),
  5865. { code: 'ECSCredentialsProviderFailure' }
  5866. );
  5867. }
  5868. return full;
  5869. } else {
  5870. throw AWS.util.error(
  5871. new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI +
  5872. ' must be set to use AWS.RemoteCredentials.'),
  5873. { code: 'ECSCredentialsProviderFailure' }
  5874. );
  5875. }
  5876. } else {
  5877. throw AWS.util.error(
  5878. new Error('No process info available'),
  5879. { code: 'ECSCredentialsProviderFailure' }
  5880. );
  5881. }
  5882. },
  5883. /**
  5884. * @api private
  5885. */
  5886. getECSAuthToken: function getECSAuthToken() {
  5887. if (process && process.env && process.env[ENV_FULL_URI]) {
  5888. return process.env[ENV_AUTH_TOKEN];
  5889. }
  5890. },
  5891. /**
  5892. * @api private
  5893. */
  5894. credsFormatIsValid: function credsFormatIsValid(credData) {
  5895. return (!!credData.accessKeyId && !!credData.secretAccessKey &&
  5896. !!credData.sessionToken && !!credData.expireTime);
  5897. },
  5898. /**
  5899. * @api private
  5900. */
  5901. formatCreds: function formatCreds(credData) {
  5902. if (!!credData.credentials) {
  5903. credData = credData.credentials;
  5904. }
  5905. return {
  5906. expired: false,
  5907. accessKeyId: credData.accessKeyId || credData.AccessKeyId,
  5908. secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey,
  5909. sessionToken: credData.sessionToken || credData.Token,
  5910. expireTime: new Date(credData.expiration || credData.Expiration)
  5911. };
  5912. },
  5913. /**
  5914. * @api private
  5915. */
  5916. request: function request(url, callback) {
  5917. var httpRequest = new AWS.HttpRequest(url);
  5918. httpRequest.method = 'GET';
  5919. httpRequest.headers.Accept = 'application/json';
  5920. var token = this.getECSAuthToken();
  5921. if (token) {
  5922. httpRequest.headers.Authorization = token;
  5923. }
  5924. AWS.util.handleRequestWithRetries(httpRequest, this, callback);
  5925. },
  5926. /**
  5927. * Loads the credentials from the relative URI specified by container
  5928. *
  5929. * @callback callback function(err)
  5930. * Called when the request to the relative URI responds (or fails). When
  5931. * this callback is called with no error, it means that the credentials
  5932. * information has been loaded into the object (as the `accessKeyId`,
  5933. * `secretAccessKey`, `sessionToken`, and `expireTime` properties).
  5934. * @param err [Error] if an error occurred, this value will be filled
  5935. * @see get
  5936. */
  5937. refresh: function refresh(callback) {
  5938. this.coalesceRefresh(callback || AWS.util.fn.callback);
  5939. },
  5940. /**
  5941. * @api private
  5942. */
  5943. load: function load(callback) {
  5944. var self = this;
  5945. var fullUri;
  5946. try {
  5947. fullUri = this.getECSFullUri();
  5948. } catch (err) {
  5949. callback(err);
  5950. return;
  5951. }
  5952. this.request(fullUri, function(err, data) {
  5953. if (!err) {
  5954. try {
  5955. data = JSON.parse(data);
  5956. var creds = self.formatCreds(data);
  5957. if (!self.credsFormatIsValid(creds)) {
  5958. throw AWS.util.error(
  5959. new Error('Response data is not in valid format'),
  5960. { code: 'ECSCredentialsProviderFailure' }
  5961. );
  5962. }
  5963. AWS.util.update(self, creds);
  5964. } catch (dataError) {
  5965. err = dataError;
  5966. }
  5967. }
  5968. callback(err, creds);
  5969. });
  5970. }
  5971. });
  5972. /***/ }),
  5973. /***/ 431:
  5974. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5975. "use strict";
  5976. var __importStar = (this && this.__importStar) || function (mod) {
  5977. if (mod && mod.__esModule) return mod;
  5978. var result = {};
  5979. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5980. result["default"] = mod;
  5981. return result;
  5982. };
  5983. Object.defineProperty(exports, "__esModule", { value: true });
  5984. const os = __importStar(__webpack_require__(87));
  5985. const utils_1 = __webpack_require__(82);
  5986. /**
  5987. * Commands
  5988. *
  5989. * Command Format:
  5990. * ::name key=value,key=value::message
  5991. *
  5992. * Examples:
  5993. * ::warning::This is the message
  5994. * ::set-env name=MY_VAR::some value
  5995. */
  5996. function issueCommand(command, properties, message) {
  5997. const cmd = new Command(command, properties, message);
  5998. process.stdout.write(cmd.toString() + os.EOL);
  5999. }
  6000. exports.issueCommand = issueCommand;
  6001. function issue(name, message = '') {
  6002. issueCommand(name, {}, message);
  6003. }
  6004. exports.issue = issue;
  6005. const CMD_STRING = '::';
  6006. class Command {
  6007. constructor(command, properties, message) {
  6008. if (!command) {
  6009. command = 'missing.command';
  6010. }
  6011. this.command = command;
  6012. this.properties = properties;
  6013. this.message = message;
  6014. }
  6015. toString() {
  6016. let cmdStr = CMD_STRING + this.command;
  6017. if (this.properties && Object.keys(this.properties).length > 0) {
  6018. cmdStr += ' ';
  6019. let first = true;
  6020. for (const key in this.properties) {
  6021. if (this.properties.hasOwnProperty(key)) {
  6022. const val = this.properties[key];
  6023. if (val) {
  6024. if (first) {
  6025. first = false;
  6026. }
  6027. else {
  6028. cmdStr += ',';
  6029. }
  6030. cmdStr += `${key}=${escapeProperty(val)}`;
  6031. }
  6032. }
  6033. }
  6034. }
  6035. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  6036. return cmdStr;
  6037. }
  6038. }
  6039. function escapeData(s) {
  6040. return utils_1.toCommandValue(s)
  6041. .replace(/%/g, '%25')
  6042. .replace(/\r/g, '%0D')
  6043. .replace(/\n/g, '%0A');
  6044. }
  6045. function escapeProperty(s) {
  6046. return utils_1.toCommandValue(s)
  6047. .replace(/%/g, '%25')
  6048. .replace(/\r/g, '%0D')
  6049. .replace(/\n/g, '%0A')
  6050. .replace(/:/g, '%3A')
  6051. .replace(/,/g, '%2C');
  6052. }
  6053. //# sourceMappingURL=command.js.map
  6054. /***/ }),
  6055. /***/ 439:
  6056. /***/ (function(module, __unusedexports, __webpack_require__) {
  6057. var util = __webpack_require__(153);
  6058. function QueryParamSerializer() {
  6059. }
  6060. QueryParamSerializer.prototype.serialize = function(params, shape, fn) {
  6061. serializeStructure('', params, shape, fn);
  6062. };
  6063. function ucfirst(shape) {
  6064. if (shape.isQueryName || shape.api.protocol !== 'ec2') {
  6065. return shape.name;
  6066. } else {
  6067. return shape.name[0].toUpperCase() + shape.name.substr(1);
  6068. }
  6069. }
  6070. function serializeStructure(prefix, struct, rules, fn) {
  6071. util.each(rules.members, function(name, member) {
  6072. var value = struct[name];
  6073. if (value === null || value === undefined) return;
  6074. var memberName = ucfirst(member);
  6075. memberName = prefix ? prefix + '.' + memberName : memberName;
  6076. serializeMember(memberName, value, member, fn);
  6077. });
  6078. }
  6079. function serializeMap(name, map, rules, fn) {
  6080. var i = 1;
  6081. util.each(map, function (key, value) {
  6082. var prefix = rules.flattened ? '.' : '.entry.';
  6083. var position = prefix + (i++) + '.';
  6084. var keyName = position + (rules.key.name || 'key');
  6085. var valueName = position + (rules.value.name || 'value');
  6086. serializeMember(name + keyName, key, rules.key, fn);
  6087. serializeMember(name + valueName, value, rules.value, fn);
  6088. });
  6089. }
  6090. function serializeList(name, list, rules, fn) {
  6091. var memberRules = rules.member || {};
  6092. if (list.length === 0) {
  6093. fn.call(this, name, null);
  6094. return;
  6095. }
  6096. util.arrayEach(list, function (v, n) {
  6097. var suffix = '.' + (n + 1);
  6098. if (rules.api.protocol === 'ec2') {
  6099. // Do nothing for EC2
  6100. suffix = suffix + ''; // make linter happy
  6101. } else if (rules.flattened) {
  6102. if (memberRules.name) {
  6103. var parts = name.split('.');
  6104. parts.pop();
  6105. parts.push(ucfirst(memberRules));
  6106. name = parts.join('.');
  6107. }
  6108. } else {
  6109. suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix;
  6110. }
  6111. serializeMember(name + suffix, v, memberRules, fn);
  6112. });
  6113. }
  6114. function serializeMember(name, value, rules, fn) {
  6115. if (value === null || value === undefined) return;
  6116. if (rules.type === 'structure') {
  6117. serializeStructure(name, value, rules, fn);
  6118. } else if (rules.type === 'list') {
  6119. serializeList(name, value, rules, fn);
  6120. } else if (rules.type === 'map') {
  6121. serializeMap(name, value, rules, fn);
  6122. } else {
  6123. fn(name, rules.toWireFormat(value).toString());
  6124. }
  6125. }
  6126. /**
  6127. * @api private
  6128. */
  6129. module.exports = QueryParamSerializer;
  6130. /***/ }),
  6131. /***/ 445:
  6132. /***/ (function(module, __unusedexports, __webpack_require__) {
  6133. /**
  6134. * What is necessary to create an event stream in node?
  6135. * - http response stream
  6136. * - parser
  6137. * - event stream model
  6138. */
  6139. var EventMessageChunkerStream = __webpack_require__(862).EventMessageChunkerStream;
  6140. var EventUnmarshallerStream = __webpack_require__(723).EventUnmarshallerStream;
  6141. function createEventStream(stream, parser, model) {
  6142. var eventStream = new EventUnmarshallerStream({
  6143. parser: parser,
  6144. eventStreamModel: model
  6145. });
  6146. var eventMessageChunker = new EventMessageChunkerStream();
  6147. stream.pipe(
  6148. eventMessageChunker
  6149. ).pipe(eventStream);
  6150. stream.on('error', function(err) {
  6151. eventMessageChunker.emit('error', err);
  6152. });
  6153. eventMessageChunker.on('error', function(err) {
  6154. eventStream.emit('error', err);
  6155. });
  6156. return eventStream;
  6157. }
  6158. /**
  6159. * @api private
  6160. */
  6161. module.exports = {
  6162. createEventStream: createEventStream
  6163. };
  6164. /***/ }),
  6165. /***/ 453:
  6166. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  6167. var AWS = __webpack_require__(395);
  6168. var AcceptorStateMachine = __webpack_require__(696);
  6169. var inherit = AWS.util.inherit;
  6170. var domain = AWS.util.domain;
  6171. var jmespath = __webpack_require__(802);
  6172. /**
  6173. * @api private
  6174. */
  6175. var hardErrorStates = {success: 1, error: 1, complete: 1};
  6176. function isTerminalState(machine) {
  6177. return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState);
  6178. }
  6179. var fsm = new AcceptorStateMachine();
  6180. fsm.setupStates = function() {
  6181. var transition = function(_, done) {
  6182. var self = this;
  6183. self._haltHandlersOnError = false;
  6184. self.emit(self._asm.currentState, function(err) {
  6185. if (err) {
  6186. if (isTerminalState(self)) {
  6187. if (domain && self.domain instanceof domain.Domain) {
  6188. err.domainEmitter = self;
  6189. err.domain = self.domain;
  6190. err.domainThrown = false;
  6191. self.domain.emit('error', err);
  6192. } else {
  6193. throw err;
  6194. }
  6195. } else {
  6196. self.response.error = err;
  6197. done(err);
  6198. }
  6199. } else {
  6200. done(self.response.error);
  6201. }
  6202. });
  6203. };
  6204. this.addState('validate', 'build', 'error', transition);
  6205. this.addState('build', 'afterBuild', 'restart', transition);
  6206. this.addState('afterBuild', 'sign', 'restart', transition);
  6207. this.addState('sign', 'send', 'retry', transition);
  6208. this.addState('retry', 'afterRetry', 'afterRetry', transition);
  6209. this.addState('afterRetry', 'sign', 'error', transition);
  6210. this.addState('send', 'validateResponse', 'retry', transition);
  6211. this.addState('validateResponse', 'extractData', 'extractError', transition);
  6212. this.addState('extractError', 'extractData', 'retry', transition);
  6213. this.addState('extractData', 'success', 'retry', transition);
  6214. this.addState('restart', 'build', 'error', transition);
  6215. this.addState('success', 'complete', 'complete', transition);
  6216. this.addState('error', 'complete', 'complete', transition);
  6217. this.addState('complete', null, null, transition);
  6218. };
  6219. fsm.setupStates();
  6220. /**
  6221. * ## Asynchronous Requests
  6222. *
  6223. * All requests made through the SDK are asynchronous and use a
  6224. * callback interface. Each service method that kicks off a request
  6225. * returns an `AWS.Request` object that you can use to register
  6226. * callbacks.
  6227. *
  6228. * For example, the following service method returns the request
  6229. * object as "request", which can be used to register callbacks:
  6230. *
  6231. * ```javascript
  6232. * // request is an AWS.Request object
  6233. * var request = ec2.describeInstances();
  6234. *
  6235. * // register callbacks on request to retrieve response data
  6236. * request.on('success', function(response) {
  6237. * console.log(response.data);
  6238. * });
  6239. * ```
  6240. *
  6241. * When a request is ready to be sent, the {send} method should
  6242. * be called:
  6243. *
  6244. * ```javascript
  6245. * request.send();
  6246. * ```
  6247. *
  6248. * Since registered callbacks may or may not be idempotent, requests should only
  6249. * be sent once. To perform the same operation multiple times, you will need to
  6250. * create multiple request objects, each with its own registered callbacks.
  6251. *
  6252. * ## Removing Default Listeners for Events
  6253. *
  6254. * Request objects are built with default listeners for the various events,
  6255. * depending on the service type. In some cases, you may want to remove
  6256. * some built-in listeners to customize behaviour. Doing this requires
  6257. * access to the built-in listener functions, which are exposed through
  6258. * the {AWS.EventListeners.Core} namespace. For instance, you may
  6259. * want to customize the HTTP handler used when sending a request. In this
  6260. * case, you can remove the built-in listener associated with the 'send'
  6261. * event, the {AWS.EventListeners.Core.SEND} listener and add your own.
  6262. *
  6263. * ## Multiple Callbacks and Chaining
  6264. *
  6265. * You can register multiple callbacks on any request object. The
  6266. * callbacks can be registered for different events, or all for the
  6267. * same event. In addition, you can chain callback registration, for
  6268. * example:
  6269. *
  6270. * ```javascript
  6271. * request.
  6272. * on('success', function(response) {
  6273. * console.log("Success!");
  6274. * }).
  6275. * on('error', function(error, response) {
  6276. * console.log("Error!");
  6277. * }).
  6278. * on('complete', function(response) {
  6279. * console.log("Always!");
  6280. * }).
  6281. * send();
  6282. * ```
  6283. *
  6284. * The above example will print either "Success! Always!", or "Error! Always!",
  6285. * depending on whether the request succeeded or not.
  6286. *
  6287. * @!attribute httpRequest
  6288. * @readonly
  6289. * @!group HTTP Properties
  6290. * @return [AWS.HttpRequest] the raw HTTP request object
  6291. * containing request headers and body information
  6292. * sent by the service.
  6293. *
  6294. * @!attribute startTime
  6295. * @readonly
  6296. * @!group Operation Properties
  6297. * @return [Date] the time that the request started
  6298. *
  6299. * @!group Request Building Events
  6300. *
  6301. * @!event validate(request)
  6302. * Triggered when a request is being validated. Listeners
  6303. * should throw an error if the request should not be sent.
  6304. * @param request [Request] the request object being sent
  6305. * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS
  6306. * @see AWS.EventListeners.Core.VALIDATE_REGION
  6307. * @example Ensuring that a certain parameter is set before sending a request
  6308. * var req = s3.putObject(params);
  6309. * req.on('validate', function() {
  6310. * if (!req.params.Body.match(/^Hello\s/)) {
  6311. * throw new Error('Body must start with "Hello "');
  6312. * }
  6313. * });
  6314. * req.send(function(err, data) { ... });
  6315. *
  6316. * @!event build(request)
  6317. * Triggered when the request payload is being built. Listeners
  6318. * should fill the necessary information to send the request
  6319. * over HTTP.
  6320. * @param (see AWS.Request~validate)
  6321. * @example Add a custom HTTP header to a request
  6322. * var req = s3.putObject(params);
  6323. * req.on('build', function() {
  6324. * req.httpRequest.headers['Custom-Header'] = 'value';
  6325. * });
  6326. * req.send(function(err, data) { ... });
  6327. *
  6328. * @!event sign(request)
  6329. * Triggered when the request is being signed. Listeners should
  6330. * add the correct authentication headers and/or adjust the body,
  6331. * depending on the authentication mechanism being used.
  6332. * @param (see AWS.Request~validate)
  6333. *
  6334. * @!group Request Sending Events
  6335. *
  6336. * @!event send(response)
  6337. * Triggered when the request is ready to be sent. Listeners
  6338. * should call the underlying transport layer to initiate
  6339. * the sending of the request.
  6340. * @param response [Response] the response object
  6341. * @context [Request] the request object that was sent
  6342. * @see AWS.EventListeners.Core.SEND
  6343. *
  6344. * @!event retry(response)
  6345. * Triggered when a request failed and might need to be retried or redirected.
  6346. * If the response is retryable, the listener should set the
  6347. * `response.error.retryable` property to `true`, and optionally set
  6348. * `response.error.retryDelay` to the millisecond delay for the next attempt.
  6349. * In the case of a redirect, `response.error.redirect` should be set to
  6350. * `true` with `retryDelay` set to an optional delay on the next request.
  6351. *
  6352. * If a listener decides that a request should not be retried,
  6353. * it should set both `retryable` and `redirect` to false.
  6354. *
  6355. * Note that a retryable error will be retried at most
  6356. * {AWS.Config.maxRetries} times (based on the service object's config).
  6357. * Similarly, a request that is redirected will only redirect at most
  6358. * {AWS.Config.maxRedirects} times.
  6359. *
  6360. * @param (see AWS.Request~send)
  6361. * @context (see AWS.Request~send)
  6362. * @example Adding a custom retry for a 404 response
  6363. * request.on('retry', function(response) {
  6364. * // this resource is not yet available, wait 10 seconds to get it again
  6365. * if (response.httpResponse.statusCode === 404 && response.error) {
  6366. * response.error.retryable = true; // retry this error
  6367. * response.error.retryDelay = 10000; // wait 10 seconds
  6368. * }
  6369. * });
  6370. *
  6371. * @!group Data Parsing Events
  6372. *
  6373. * @!event extractError(response)
  6374. * Triggered on all non-2xx requests so that listeners can extract
  6375. * error details from the response body. Listeners to this event
  6376. * should set the `response.error` property.
  6377. * @param (see AWS.Request~send)
  6378. * @context (see AWS.Request~send)
  6379. *
  6380. * @!event extractData(response)
  6381. * Triggered in successful requests to allow listeners to
  6382. * de-serialize the response body into `response.data`.
  6383. * @param (see AWS.Request~send)
  6384. * @context (see AWS.Request~send)
  6385. *
  6386. * @!group Completion Events
  6387. *
  6388. * @!event success(response)
  6389. * Triggered when the request completed successfully.
  6390. * `response.data` will contain the response data and
  6391. * `response.error` will be null.
  6392. * @param (see AWS.Request~send)
  6393. * @context (see AWS.Request~send)
  6394. *
  6395. * @!event error(error, response)
  6396. * Triggered when an error occurs at any point during the
  6397. * request. `response.error` will contain details about the error
  6398. * that occurred. `response.data` will be null.
  6399. * @param error [Error] the error object containing details about
  6400. * the error that occurred.
  6401. * @param (see AWS.Request~send)
  6402. * @context (see AWS.Request~send)
  6403. *
  6404. * @!event complete(response)
  6405. * Triggered whenever a request cycle completes. `response.error`
  6406. * should be checked, since the request may have failed.
  6407. * @param (see AWS.Request~send)
  6408. * @context (see AWS.Request~send)
  6409. *
  6410. * @!group HTTP Events
  6411. *
  6412. * @!event httpHeaders(statusCode, headers, response, statusMessage)
  6413. * Triggered when headers are sent by the remote server
  6414. * @param statusCode [Integer] the HTTP response code
  6415. * @param headers [map<String,String>] the response headers
  6416. * @param (see AWS.Request~send)
  6417. * @param statusMessage [String] A status message corresponding to the HTTP
  6418. * response code
  6419. * @context (see AWS.Request~send)
  6420. *
  6421. * @!event httpData(chunk, response)
  6422. * Triggered when data is sent by the remote server
  6423. * @param chunk [Buffer] the buffer data containing the next data chunk
  6424. * from the server
  6425. * @param (see AWS.Request~send)
  6426. * @context (see AWS.Request~send)
  6427. * @see AWS.EventListeners.Core.HTTP_DATA
  6428. *
  6429. * @!event httpUploadProgress(progress, response)
  6430. * Triggered when the HTTP request has uploaded more data
  6431. * @param progress [map] An object containing the `loaded` and `total` bytes
  6432. * of the request.
  6433. * @param (see AWS.Request~send)
  6434. * @context (see AWS.Request~send)
  6435. * @note This event will not be emitted in Node.js 0.8.x.
  6436. *
  6437. * @!event httpDownloadProgress(progress, response)
  6438. * Triggered when the HTTP request has downloaded more data
  6439. * @param progress [map] An object containing the `loaded` and `total` bytes
  6440. * of the request.
  6441. * @param (see AWS.Request~send)
  6442. * @context (see AWS.Request~send)
  6443. * @note This event will not be emitted in Node.js 0.8.x.
  6444. *
  6445. * @!event httpError(error, response)
  6446. * Triggered when the HTTP request failed
  6447. * @param error [Error] the error object that was thrown
  6448. * @param (see AWS.Request~send)
  6449. * @context (see AWS.Request~send)
  6450. *
  6451. * @!event httpDone(response)
  6452. * Triggered when the server is finished sending data
  6453. * @param (see AWS.Request~send)
  6454. * @context (see AWS.Request~send)
  6455. *
  6456. * @see AWS.Response
  6457. */
  6458. AWS.Request = inherit({
  6459. /**
  6460. * Creates a request for an operation on a given service with
  6461. * a set of input parameters.
  6462. *
  6463. * @param service [AWS.Service] the service to perform the operation on
  6464. * @param operation [String] the operation to perform on the service
  6465. * @param params [Object] parameters to send to the operation.
  6466. * See the operation's documentation for the format of the
  6467. * parameters.
  6468. */
  6469. constructor: function Request(service, operation, params) {
  6470. var endpoint = service.endpoint;
  6471. var region = service.config.region;
  6472. var customUserAgent = service.config.customUserAgent;
  6473. if (service.isGlobalEndpoint) {
  6474. if (service.signingRegion) {
  6475. region = service.signingRegion;
  6476. } else {
  6477. region = 'us-east-1';
  6478. }
  6479. }
  6480. this.domain = domain && domain.active;
  6481. this.service = service;
  6482. this.operation = operation;
  6483. this.params = params || {};
  6484. this.httpRequest = new AWS.HttpRequest(endpoint, region);
  6485. this.httpRequest.appendToUserAgent(customUserAgent);
  6486. this.startTime = service.getSkewCorrectedDate();
  6487. this.response = new AWS.Response(this);
  6488. this._asm = new AcceptorStateMachine(fsm.states, 'validate');
  6489. this._haltHandlersOnError = false;
  6490. AWS.SequentialExecutor.call(this);
  6491. this.emit = this.emitEvent;
  6492. },
  6493. /**
  6494. * @!group Sending a Request
  6495. */
  6496. /**
  6497. * @overload send(callback = null)
  6498. * Sends the request object.
  6499. *
  6500. * @callback callback function(err, data)
  6501. * If a callback is supplied, it is called when a response is returned
  6502. * from the service.
  6503. * @context [AWS.Request] the request object being sent.
  6504. * @param err [Error] the error object returned from the request.
  6505. * Set to `null` if the request is successful.
  6506. * @param data [Object] the de-serialized data returned from
  6507. * the request. Set to `null` if a request error occurs.
  6508. * @example Sending a request with a callback
  6509. * request = s3.putObject({Bucket: 'bucket', Key: 'key'});
  6510. * request.send(function(err, data) { console.log(err, data); });
  6511. * @example Sending a request with no callback (using event handlers)
  6512. * request = s3.putObject({Bucket: 'bucket', Key: 'key'});
  6513. * request.on('complete', function(response) { ... }); // register a callback
  6514. * request.send();
  6515. */
  6516. send: function send(callback) {
  6517. if (callback) {
  6518. // append to user agent
  6519. this.httpRequest.appendToUserAgent('callback');
  6520. this.on('complete', function (resp) {
  6521. callback.call(resp, resp.error, resp.data);
  6522. });
  6523. }
  6524. this.runTo();
  6525. return this.response;
  6526. },
  6527. /**
  6528. * @!method promise()
  6529. * Sends the request and returns a 'thenable' promise.
  6530. *
  6531. * Two callbacks can be provided to the `then` method on the returned promise.
  6532. * The first callback will be called if the promise is fulfilled, and the second
  6533. * callback will be called if the promise is rejected.
  6534. * @callback fulfilledCallback function(data)
  6535. * Called if the promise is fulfilled.
  6536. * @param data [Object] the de-serialized data returned from the request.
  6537. * @callback rejectedCallback function(error)
  6538. * Called if the promise is rejected.
  6539. * @param error [Error] the error object returned from the request.
  6540. * @return [Promise] A promise that represents the state of the request.
  6541. * @example Sending a request using promises.
  6542. * var request = s3.putObject({Bucket: 'bucket', Key: 'key'});
  6543. * var result = request.promise();
  6544. * result.then(function(data) { ... }, function(error) { ... });
  6545. */
  6546. /**
  6547. * @api private
  6548. */
  6549. build: function build(callback) {
  6550. return this.runTo('send', callback);
  6551. },
  6552. /**
  6553. * @api private
  6554. */
  6555. runTo: function runTo(state, done) {
  6556. this._asm.runTo(state, done, this);
  6557. return this;
  6558. },
  6559. /**
  6560. * Aborts a request, emitting the error and complete events.
  6561. *
  6562. * @!macro nobrowser
  6563. * @example Aborting a request after sending
  6564. * var params = {
  6565. * Bucket: 'bucket', Key: 'key',
  6566. * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload
  6567. * };
  6568. * var request = s3.putObject(params);
  6569. * request.send(function (err, data) {
  6570. * if (err) console.log("Error:", err.code, err.message);
  6571. * else console.log(data);
  6572. * });
  6573. *
  6574. * // abort request in 1 second
  6575. * setTimeout(request.abort.bind(request), 1000);
  6576. *
  6577. * // prints "Error: RequestAbortedError Request aborted by user"
  6578. * @return [AWS.Request] the same request object, for chaining.
  6579. * @since v1.4.0
  6580. */
  6581. abort: function abort() {
  6582. this.removeAllListeners('validateResponse');
  6583. this.removeAllListeners('extractError');
  6584. this.on('validateResponse', function addAbortedError(resp) {
  6585. resp.error = AWS.util.error(new Error('Request aborted by user'), {
  6586. code: 'RequestAbortedError', retryable: false
  6587. });
  6588. });
  6589. if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream
  6590. this.httpRequest.stream.abort();
  6591. if (this.httpRequest._abortCallback) {
  6592. this.httpRequest._abortCallback();
  6593. } else {
  6594. this.removeAllListeners('send'); // haven't sent yet, so let's not
  6595. }
  6596. }
  6597. return this;
  6598. },
  6599. /**
  6600. * Iterates over each page of results given a pageable request, calling
  6601. * the provided callback with each page of data. After all pages have been
  6602. * retrieved, the callback is called with `null` data.
  6603. *
  6604. * @note This operation can generate multiple requests to a service.
  6605. * @example Iterating over multiple pages of objects in an S3 bucket
  6606. * var pages = 1;
  6607. * s3.listObjects().eachPage(function(err, data) {
  6608. * if (err) return;
  6609. * console.log("Page", pages++);
  6610. * console.log(data);
  6611. * });
  6612. * @example Iterating over multiple pages with an asynchronous callback
  6613. * s3.listObjects(params).eachPage(function(err, data, done) {
  6614. * doSomethingAsyncAndOrExpensive(function() {
  6615. * // The next page of results isn't fetched until done is called
  6616. * done();
  6617. * });
  6618. * });
  6619. * @callback callback function(err, data, [doneCallback])
  6620. * Called with each page of resulting data from the request. If the
  6621. * optional `doneCallback` is provided in the function, it must be called
  6622. * when the callback is complete.
  6623. *
  6624. * @param err [Error] an error object, if an error occurred.
  6625. * @param data [Object] a single page of response data. If there is no
  6626. * more data, this object will be `null`.
  6627. * @param doneCallback [Function] an optional done callback. If this
  6628. * argument is defined in the function declaration, it should be called
  6629. * when the next page is ready to be retrieved. This is useful for
  6630. * controlling serial pagination across asynchronous operations.
  6631. * @return [Boolean] if the callback returns `false`, pagination will
  6632. * stop.
  6633. *
  6634. * @see AWS.Request.eachItem
  6635. * @see AWS.Response.nextPage
  6636. * @since v1.4.0
  6637. */
  6638. eachPage: function eachPage(callback) {
  6639. // Make all callbacks async-ish
  6640. callback = AWS.util.fn.makeAsync(callback, 3);
  6641. function wrappedCallback(response) {
  6642. callback.call(response, response.error, response.data, function (result) {
  6643. if (result === false) return;
  6644. if (response.hasNextPage()) {
  6645. response.nextPage().on('complete', wrappedCallback).send();
  6646. } else {
  6647. callback.call(response, null, null, AWS.util.fn.noop);
  6648. }
  6649. });
  6650. }
  6651. this.on('complete', wrappedCallback).send();
  6652. },
  6653. /**
  6654. * Enumerates over individual items of a request, paging the responses if
  6655. * necessary.
  6656. *
  6657. * @api experimental
  6658. * @since v1.4.0
  6659. */
  6660. eachItem: function eachItem(callback) {
  6661. var self = this;
  6662. function wrappedCallback(err, data) {
  6663. if (err) return callback(err, null);
  6664. if (data === null) return callback(null, null);
  6665. var config = self.service.paginationConfig(self.operation);
  6666. var resultKey = config.resultKey;
  6667. if (Array.isArray(resultKey)) resultKey = resultKey[0];
  6668. var items = jmespath.search(data, resultKey);
  6669. var continueIteration = true;
  6670. AWS.util.arrayEach(items, function(item) {
  6671. continueIteration = callback(null, item);
  6672. if (continueIteration === false) {
  6673. return AWS.util.abort;
  6674. }
  6675. });
  6676. return continueIteration;
  6677. }
  6678. this.eachPage(wrappedCallback);
  6679. },
  6680. /**
  6681. * @return [Boolean] whether the operation can return multiple pages of
  6682. * response data.
  6683. * @see AWS.Response.eachPage
  6684. * @since v1.4.0
  6685. */
  6686. isPageable: function isPageable() {
  6687. return this.service.paginationConfig(this.operation) ? true : false;
  6688. },
  6689. /**
  6690. * Sends the request and converts the request object into a readable stream
  6691. * that can be read from or piped into a writable stream.
  6692. *
  6693. * @note The data read from a readable stream contains only
  6694. * the raw HTTP body contents.
  6695. * @example Manually reading from a stream
  6696. * request.createReadStream().on('data', function(data) {
  6697. * console.log("Got data:", data.toString());
  6698. * });
  6699. * @example Piping a request body into a file
  6700. * var out = fs.createWriteStream('/path/to/outfile.jpg');
  6701. * s3.service.getObject(params).createReadStream().pipe(out);
  6702. * @return [Stream] the readable stream object that can be piped
  6703. * or read from (by registering 'data' event listeners).
  6704. * @!macro nobrowser
  6705. */
  6706. createReadStream: function createReadStream() {
  6707. var streams = AWS.util.stream;
  6708. var req = this;
  6709. var stream = null;
  6710. if (AWS.HttpClient.streamsApiVersion === 2) {
  6711. stream = new streams.PassThrough();
  6712. process.nextTick(function() { req.send(); });
  6713. } else {
  6714. stream = new streams.Stream();
  6715. stream.readable = true;
  6716. stream.sent = false;
  6717. stream.on('newListener', function(event) {
  6718. if (!stream.sent && event === 'data') {
  6719. stream.sent = true;
  6720. process.nextTick(function() { req.send(); });
  6721. }
  6722. });
  6723. }
  6724. this.on('error', function(err) {
  6725. stream.emit('error', err);
  6726. });
  6727. this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) {
  6728. if (statusCode < 300) {
  6729. req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA);
  6730. req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR);
  6731. req.on('httpError', function streamHttpError(error) {
  6732. resp.error = error;
  6733. resp.error.retryable = false;
  6734. });
  6735. var shouldCheckContentLength = false;
  6736. var expectedLen;
  6737. if (req.httpRequest.method !== 'HEAD') {
  6738. expectedLen = parseInt(headers['content-length'], 10);
  6739. }
  6740. if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) {
  6741. shouldCheckContentLength = true;
  6742. var receivedLen = 0;
  6743. }
  6744. var checkContentLengthAndEmit = function checkContentLengthAndEmit() {
  6745. if (shouldCheckContentLength && receivedLen !== expectedLen) {
  6746. stream.emit('error', AWS.util.error(
  6747. new Error('Stream content length mismatch. Received ' +
  6748. receivedLen + ' of ' + expectedLen + ' bytes.'),
  6749. { code: 'StreamContentLengthMismatch' }
  6750. ));
  6751. } else if (AWS.HttpClient.streamsApiVersion === 2) {
  6752. stream.end();
  6753. } else {
  6754. stream.emit('end');
  6755. }
  6756. };
  6757. var httpStream = resp.httpResponse.createUnbufferedStream();
  6758. if (AWS.HttpClient.streamsApiVersion === 2) {
  6759. if (shouldCheckContentLength) {
  6760. var lengthAccumulator = new streams.PassThrough();
  6761. lengthAccumulator._write = function(chunk) {
  6762. if (chunk && chunk.length) {
  6763. receivedLen += chunk.length;
  6764. }
  6765. return streams.PassThrough.prototype._write.apply(this, arguments);
  6766. };
  6767. lengthAccumulator.on('end', checkContentLengthAndEmit);
  6768. stream.on('error', function(err) {
  6769. shouldCheckContentLength = false;
  6770. httpStream.unpipe(lengthAccumulator);
  6771. lengthAccumulator.emit('end');
  6772. lengthAccumulator.end();
  6773. });
  6774. httpStream.pipe(lengthAccumulator).pipe(stream, { end: false });
  6775. } else {
  6776. httpStream.pipe(stream);
  6777. }
  6778. } else {
  6779. if (shouldCheckContentLength) {
  6780. httpStream.on('data', function(arg) {
  6781. if (arg && arg.length) {
  6782. receivedLen += arg.length;
  6783. }
  6784. });
  6785. }
  6786. httpStream.on('data', function(arg) {
  6787. stream.emit('data', arg);
  6788. });
  6789. httpStream.on('end', checkContentLengthAndEmit);
  6790. }
  6791. httpStream.on('error', function(err) {
  6792. shouldCheckContentLength = false;
  6793. stream.emit('error', err);
  6794. });
  6795. }
  6796. });
  6797. return stream;
  6798. },
  6799. /**
  6800. * @param [Array,Response] args This should be the response object,
  6801. * or an array of args to send to the event.
  6802. * @api private
  6803. */
  6804. emitEvent: function emit(eventName, args, done) {
  6805. if (typeof args === 'function') { done = args; args = null; }
  6806. if (!done) done = function() { };
  6807. if (!args) args = this.eventParameters(eventName, this.response);
  6808. var origEmit = AWS.SequentialExecutor.prototype.emit;
  6809. origEmit.call(this, eventName, args, function (err) {
  6810. if (err) this.response.error = err;
  6811. done.call(this, err);
  6812. });
  6813. },
  6814. /**
  6815. * @api private
  6816. */
  6817. eventParameters: function eventParameters(eventName) {
  6818. switch (eventName) {
  6819. case 'restart':
  6820. case 'validate':
  6821. case 'sign':
  6822. case 'build':
  6823. case 'afterValidate':
  6824. case 'afterBuild':
  6825. return [this];
  6826. case 'error':
  6827. return [this.response.error, this.response];
  6828. default:
  6829. return [this.response];
  6830. }
  6831. },
  6832. /**
  6833. * @api private
  6834. */
  6835. presign: function presign(expires, callback) {
  6836. if (!callback && typeof expires === 'function') {
  6837. callback = expires;
  6838. expires = null;
  6839. }
  6840. return new AWS.Signers.Presign().sign(this.toGet(), expires, callback);
  6841. },
  6842. /**
  6843. * @api private
  6844. */
  6845. isPresigned: function isPresigned() {
  6846. return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires');
  6847. },
  6848. /**
  6849. * @api private
  6850. */
  6851. toUnauthenticated: function toUnauthenticated() {
  6852. this._unAuthenticated = true;
  6853. this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS);
  6854. this.removeListener('sign', AWS.EventListeners.Core.SIGN);
  6855. return this;
  6856. },
  6857. /**
  6858. * @api private
  6859. */
  6860. toGet: function toGet() {
  6861. if (this.service.api.protocol === 'query' ||
  6862. this.service.api.protocol === 'ec2') {
  6863. this.removeListener('build', this.buildAsGet);
  6864. this.addListener('build', this.buildAsGet);
  6865. }
  6866. return this;
  6867. },
  6868. /**
  6869. * @api private
  6870. */
  6871. buildAsGet: function buildAsGet(request) {
  6872. request.httpRequest.method = 'GET';
  6873. request.httpRequest.path = request.service.endpoint.path +
  6874. '?' + request.httpRequest.body;
  6875. request.httpRequest.body = '';
  6876. // don't need these headers on a GET request
  6877. delete request.httpRequest.headers['Content-Length'];
  6878. delete request.httpRequest.headers['Content-Type'];
  6879. },
  6880. /**
  6881. * @api private
  6882. */
  6883. haltHandlersOnError: function haltHandlersOnError() {
  6884. this._haltHandlersOnError = true;
  6885. }
  6886. });
  6887. /**
  6888. * @api private
  6889. */
  6890. AWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) {
  6891. this.prototype.promise = function promise() {
  6892. var self = this;
  6893. // append to user agent
  6894. this.httpRequest.appendToUserAgent('promise');
  6895. return new PromiseDependency(function(resolve, reject) {
  6896. self.on('complete', function(resp) {
  6897. if (resp.error) {
  6898. reject(resp.error);
  6899. } else {
  6900. // define $response property so that it is not enumerable
  6901. // this prevents circular reference errors when stringifying the JSON object
  6902. resolve(Object.defineProperty(
  6903. resp.data || {},
  6904. '$response',
  6905. {value: resp}
  6906. ));
  6907. }
  6908. });
  6909. self.runTo();
  6910. });
  6911. };
  6912. };
  6913. /**
  6914. * @api private
  6915. */
  6916. AWS.Request.deletePromisesFromClass = function deletePromisesFromClass() {
  6917. delete this.prototype.promise;
  6918. };
  6919. AWS.util.addPromises(AWS.Request);
  6920. AWS.util.mixin(AWS.Request, AWS.SequentialExecutor);
  6921. /***/ }),
  6922. /***/ 458:
  6923. /***/ (function(module, __unusedexports, __webpack_require__) {
  6924. // Generated by CoffeeScript 1.12.7
  6925. (function() {
  6926. var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStreamWriter, XMLText, XMLWriterBase,
  6927. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  6928. hasProp = {}.hasOwnProperty;
  6929. XMLDeclaration = __webpack_require__(738);
  6930. XMLDocType = __webpack_require__(735);
  6931. XMLCData = __webpack_require__(35);
  6932. XMLComment = __webpack_require__(919);
  6933. XMLElement = __webpack_require__(796);
  6934. XMLRaw = __webpack_require__(660);
  6935. XMLText = __webpack_require__(708);
  6936. XMLProcessingInstruction = __webpack_require__(491);
  6937. XMLDTDAttList = __webpack_require__(801);
  6938. XMLDTDElement = __webpack_require__(463);
  6939. XMLDTDEntity = __webpack_require__(755);
  6940. XMLDTDNotation = __webpack_require__(19);
  6941. XMLWriterBase = __webpack_require__(423);
  6942. module.exports = XMLStreamWriter = (function(superClass) {
  6943. extend(XMLStreamWriter, superClass);
  6944. function XMLStreamWriter(stream, options) {
  6945. XMLStreamWriter.__super__.constructor.call(this, options);
  6946. this.stream = stream;
  6947. }
  6948. XMLStreamWriter.prototype.document = function(doc) {
  6949. var child, i, j, len, len1, ref, ref1, results;
  6950. ref = doc.children;
  6951. for (i = 0, len = ref.length; i < len; i++) {
  6952. child = ref[i];
  6953. child.isLastRootNode = false;
  6954. }
  6955. doc.children[doc.children.length - 1].isLastRootNode = true;
  6956. ref1 = doc.children;
  6957. results = [];
  6958. for (j = 0, len1 = ref1.length; j < len1; j++) {
  6959. child = ref1[j];
  6960. switch (false) {
  6961. case !(child instanceof XMLDeclaration):
  6962. results.push(this.declaration(child));
  6963. break;
  6964. case !(child instanceof XMLDocType):
  6965. results.push(this.docType(child));
  6966. break;
  6967. case !(child instanceof XMLComment):
  6968. results.push(this.comment(child));
  6969. break;
  6970. case !(child instanceof XMLProcessingInstruction):
  6971. results.push(this.processingInstruction(child));
  6972. break;
  6973. default:
  6974. results.push(this.element(child));
  6975. }
  6976. }
  6977. return results;
  6978. };
  6979. XMLStreamWriter.prototype.attribute = function(att) {
  6980. return this.stream.write(' ' + att.name + '="' + att.value + '"');
  6981. };
  6982. XMLStreamWriter.prototype.cdata = function(node, level) {
  6983. return this.stream.write(this.space(level) + '<![CDATA[' + node.text + ']]>' + this.endline(node));
  6984. };
  6985. XMLStreamWriter.prototype.comment = function(node, level) {
  6986. return this.stream.write(this.space(level) + '<!-- ' + node.text + ' -->' + this.endline(node));
  6987. };
  6988. XMLStreamWriter.prototype.declaration = function(node, level) {
  6989. this.stream.write(this.space(level));
  6990. this.stream.write('<?xml version="' + node.version + '"');
  6991. if (node.encoding != null) {
  6992. this.stream.write(' encoding="' + node.encoding + '"');
  6993. }
  6994. if (node.standalone != null) {
  6995. this.stream.write(' standalone="' + node.standalone + '"');
  6996. }
  6997. this.stream.write(this.spacebeforeslash + '?>');
  6998. return this.stream.write(this.endline(node));
  6999. };
  7000. XMLStreamWriter.prototype.docType = function(node, level) {
  7001. var child, i, len, ref;
  7002. level || (level = 0);
  7003. this.stream.write(this.space(level));
  7004. this.stream.write('<!DOCTYPE ' + node.root().name);
  7005. if (node.pubID && node.sysID) {
  7006. this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
  7007. } else if (node.sysID) {
  7008. this.stream.write(' SYSTEM "' + node.sysID + '"');
  7009. }
  7010. if (node.children.length > 0) {
  7011. this.stream.write(' [');
  7012. this.stream.write(this.endline(node));
  7013. ref = node.children;
  7014. for (i = 0, len = ref.length; i < len; i++) {
  7015. child = ref[i];
  7016. switch (false) {
  7017. case !(child instanceof XMLDTDAttList):
  7018. this.dtdAttList(child, level + 1);
  7019. break;
  7020. case !(child instanceof XMLDTDElement):
  7021. this.dtdElement(child, level + 1);
  7022. break;
  7023. case !(child instanceof XMLDTDEntity):
  7024. this.dtdEntity(child, level + 1);
  7025. break;
  7026. case !(child instanceof XMLDTDNotation):
  7027. this.dtdNotation(child, level + 1);
  7028. break;
  7029. case !(child instanceof XMLCData):
  7030. this.cdata(child, level + 1);
  7031. break;
  7032. case !(child instanceof XMLComment):
  7033. this.comment(child, level + 1);
  7034. break;
  7035. case !(child instanceof XMLProcessingInstruction):
  7036. this.processingInstruction(child, level + 1);
  7037. break;
  7038. default:
  7039. throw new Error("Unknown DTD node type: " + child.constructor.name);
  7040. }
  7041. }
  7042. this.stream.write(']');
  7043. }
  7044. this.stream.write(this.spacebeforeslash + '>');
  7045. return this.stream.write(this.endline(node));
  7046. };
  7047. XMLStreamWriter.prototype.element = function(node, level) {
  7048. var att, child, i, len, name, ref, ref1, space;
  7049. level || (level = 0);
  7050. space = this.space(level);
  7051. this.stream.write(space + '<' + node.name);
  7052. ref = node.attributes;
  7053. for (name in ref) {
  7054. if (!hasProp.call(ref, name)) continue;
  7055. att = ref[name];
  7056. this.attribute(att);
  7057. }
  7058. if (node.children.length === 0 || node.children.every(function(e) {
  7059. return e.value === '';
  7060. })) {
  7061. if (this.allowEmpty) {
  7062. this.stream.write('></' + node.name + '>');
  7063. } else {
  7064. this.stream.write(this.spacebeforeslash + '/>');
  7065. }
  7066. } else if (this.pretty && node.children.length === 1 && (node.children[0].value != null)) {
  7067. this.stream.write('>');
  7068. this.stream.write(node.children[0].value);
  7069. this.stream.write('</' + node.name + '>');
  7070. } else {
  7071. this.stream.write('>' + this.newline);
  7072. ref1 = node.children;
  7073. for (i = 0, len = ref1.length; i < len; i++) {
  7074. child = ref1[i];
  7075. switch (false) {
  7076. case !(child instanceof XMLCData):
  7077. this.cdata(child, level + 1);
  7078. break;
  7079. case !(child instanceof XMLComment):
  7080. this.comment(child, level + 1);
  7081. break;
  7082. case !(child instanceof XMLElement):
  7083. this.element(child, level + 1);
  7084. break;
  7085. case !(child instanceof XMLRaw):
  7086. this.raw(child, level + 1);
  7087. break;
  7088. case !(child instanceof XMLText):
  7089. this.text(child, level + 1);
  7090. break;
  7091. case !(child instanceof XMLProcessingInstruction):
  7092. this.processingInstruction(child, level + 1);
  7093. break;
  7094. default:
  7095. throw new Error("Unknown XML node type: " + child.constructor.name);
  7096. }
  7097. }
  7098. this.stream.write(space + '</' + node.name + '>');
  7099. }
  7100. return this.stream.write(this.endline(node));
  7101. };
  7102. XMLStreamWriter.prototype.processingInstruction = function(node, level) {
  7103. this.stream.write(this.space(level) + '<?' + node.target);
  7104. if (node.value) {
  7105. this.stream.write(' ' + node.value);
  7106. }
  7107. return this.stream.write(this.spacebeforeslash + '?>' + this.endline(node));
  7108. };
  7109. XMLStreamWriter.prototype.raw = function(node, level) {
  7110. return this.stream.write(this.space(level) + node.value + this.endline(node));
  7111. };
  7112. XMLStreamWriter.prototype.text = function(node, level) {
  7113. return this.stream.write(this.space(level) + node.value + this.endline(node));
  7114. };
  7115. XMLStreamWriter.prototype.dtdAttList = function(node, level) {
  7116. this.stream.write(this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType);
  7117. if (node.defaultValueType !== '#DEFAULT') {
  7118. this.stream.write(' ' + node.defaultValueType);
  7119. }
  7120. if (node.defaultValue) {
  7121. this.stream.write(' "' + node.defaultValue + '"');
  7122. }
  7123. return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
  7124. };
  7125. XMLStreamWriter.prototype.dtdElement = function(node, level) {
  7126. this.stream.write(this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value);
  7127. return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
  7128. };
  7129. XMLStreamWriter.prototype.dtdEntity = function(node, level) {
  7130. this.stream.write(this.space(level) + '<!ENTITY');
  7131. if (node.pe) {
  7132. this.stream.write(' %');
  7133. }
  7134. this.stream.write(' ' + node.name);
  7135. if (node.value) {
  7136. this.stream.write(' "' + node.value + '"');
  7137. } else {
  7138. if (node.pubID && node.sysID) {
  7139. this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
  7140. } else if (node.sysID) {
  7141. this.stream.write(' SYSTEM "' + node.sysID + '"');
  7142. }
  7143. if (node.nData) {
  7144. this.stream.write(' NDATA ' + node.nData);
  7145. }
  7146. }
  7147. return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
  7148. };
  7149. XMLStreamWriter.prototype.dtdNotation = function(node, level) {
  7150. this.stream.write(this.space(level) + '<!NOTATION ' + node.name);
  7151. if (node.pubID && node.sysID) {
  7152. this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
  7153. } else if (node.pubID) {
  7154. this.stream.write(' PUBLIC "' + node.pubID + '"');
  7155. } else if (node.sysID) {
  7156. this.stream.write(' SYSTEM "' + node.sysID + '"');
  7157. }
  7158. return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
  7159. };
  7160. XMLStreamWriter.prototype.endline = function(node) {
  7161. if (!node.isLastRootNode) {
  7162. return this.newline;
  7163. } else {
  7164. return '';
  7165. }
  7166. };
  7167. return XMLStreamWriter;
  7168. })(XMLWriterBase);
  7169. }).call(this);
  7170. /***/ }),
  7171. /***/ 463:
  7172. /***/ (function(module, __unusedexports, __webpack_require__) {
  7173. // Generated by CoffeeScript 1.12.7
  7174. (function() {
  7175. var XMLDTDElement, XMLNode,
  7176. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  7177. hasProp = {}.hasOwnProperty;
  7178. XMLNode = __webpack_require__(855);
  7179. module.exports = XMLDTDElement = (function(superClass) {
  7180. extend(XMLDTDElement, superClass);
  7181. function XMLDTDElement(parent, name, value) {
  7182. XMLDTDElement.__super__.constructor.call(this, parent);
  7183. if (name == null) {
  7184. throw new Error("Missing DTD element name");
  7185. }
  7186. if (!value) {
  7187. value = '(#PCDATA)';
  7188. }
  7189. if (Array.isArray(value)) {
  7190. value = '(' + value.join(',') + ')';
  7191. }
  7192. this.name = this.stringify.eleName(name);
  7193. this.value = this.stringify.dtdElementValue(value);
  7194. }
  7195. XMLDTDElement.prototype.toString = function(options) {
  7196. return this.options.writer.set(options).dtdElement(this);
  7197. };
  7198. return XMLDTDElement;
  7199. })(XMLNode);
  7200. }).call(this);
  7201. /***/ }),
  7202. /***/ 470:
  7203. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7204. "use strict";
  7205. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7206. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7207. return new (P || (P = Promise))(function (resolve, reject) {
  7208. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7209. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7210. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7211. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7212. });
  7213. };
  7214. var __importStar = (this && this.__importStar) || function (mod) {
  7215. if (mod && mod.__esModule) return mod;
  7216. var result = {};
  7217. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7218. result["default"] = mod;
  7219. return result;
  7220. };
  7221. Object.defineProperty(exports, "__esModule", { value: true });
  7222. const command_1 = __webpack_require__(431);
  7223. const file_command_1 = __webpack_require__(102);
  7224. const utils_1 = __webpack_require__(82);
  7225. const os = __importStar(__webpack_require__(87));
  7226. const path = __importStar(__webpack_require__(622));
  7227. /**
  7228. * The code to exit an action
  7229. */
  7230. var ExitCode;
  7231. (function (ExitCode) {
  7232. /**
  7233. * A code indicating that the action was successful
  7234. */
  7235. ExitCode[ExitCode["Success"] = 0] = "Success";
  7236. /**
  7237. * A code indicating that the action was a failure
  7238. */
  7239. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7240. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7241. //-----------------------------------------------------------------------
  7242. // Variables
  7243. //-----------------------------------------------------------------------
  7244. /**
  7245. * Sets env variable for this action and future actions in the job
  7246. * @param name the name of the variable to set
  7247. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  7248. */
  7249. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  7250. function exportVariable(name, val) {
  7251. const convertedVal = utils_1.toCommandValue(val);
  7252. process.env[name] = convertedVal;
  7253. const filePath = process.env['GITHUB_ENV'] || '';
  7254. if (filePath) {
  7255. const delimiter = '_GitHubActionsFileCommandDelimeter_';
  7256. const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
  7257. file_command_1.issueCommand('ENV', commandValue);
  7258. }
  7259. else {
  7260. command_1.issueCommand('set-env', { name }, convertedVal);
  7261. }
  7262. }
  7263. exports.exportVariable = exportVariable;
  7264. /**
  7265. * Registers a secret which will get masked from logs
  7266. * @param secret value of the secret
  7267. */
  7268. function setSecret(secret) {
  7269. command_1.issueCommand('add-mask', {}, secret);
  7270. }
  7271. exports.setSecret = setSecret;
  7272. /**
  7273. * Prepends inputPath to the PATH (for this action and future actions)
  7274. * @param inputPath
  7275. */
  7276. function addPath(inputPath) {
  7277. const filePath = process.env['GITHUB_PATH'] || '';
  7278. if (filePath) {
  7279. file_command_1.issueCommand('PATH', inputPath);
  7280. }
  7281. else {
  7282. command_1.issueCommand('add-path', {}, inputPath);
  7283. }
  7284. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7285. }
  7286. exports.addPath = addPath;
  7287. /**
  7288. * Gets the value of an input. The value is also trimmed.
  7289. *
  7290. * @param name name of the input to get
  7291. * @param options optional. See InputOptions.
  7292. * @returns string
  7293. */
  7294. function getInput(name, options) {
  7295. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7296. if (options && options.required && !val) {
  7297. throw new Error(`Input required and not supplied: ${name}`);
  7298. }
  7299. return val.trim();
  7300. }
  7301. exports.getInput = getInput;
  7302. /**
  7303. * Sets the value of an output.
  7304. *
  7305. * @param name name of the output to set
  7306. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  7307. */
  7308. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  7309. function setOutput(name, value) {
  7310. command_1.issueCommand('set-output', { name }, value);
  7311. }
  7312. exports.setOutput = setOutput;
  7313. /**
  7314. * Enables or disables the echoing of commands into stdout for the rest of the step.
  7315. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  7316. *
  7317. */
  7318. function setCommandEcho(enabled) {
  7319. command_1.issue('echo', enabled ? 'on' : 'off');
  7320. }
  7321. exports.setCommandEcho = setCommandEcho;
  7322. //-----------------------------------------------------------------------
  7323. // Results
  7324. //-----------------------------------------------------------------------
  7325. /**
  7326. * Sets the action status to failed.
  7327. * When the action exits it will be with an exit code of 1
  7328. * @param message add error issue message
  7329. */
  7330. function setFailed(message) {
  7331. process.exitCode = ExitCode.Failure;
  7332. error(message);
  7333. }
  7334. exports.setFailed = setFailed;
  7335. //-----------------------------------------------------------------------
  7336. // Logging Commands
  7337. //-----------------------------------------------------------------------
  7338. /**
  7339. * Gets whether Actions Step Debug is on or not
  7340. */
  7341. function isDebug() {
  7342. return process.env['RUNNER_DEBUG'] === '1';
  7343. }
  7344. exports.isDebug = isDebug;
  7345. /**
  7346. * Writes debug message to user log
  7347. * @param message debug message
  7348. */
  7349. function debug(message) {
  7350. command_1.issueCommand('debug', {}, message);
  7351. }
  7352. exports.debug = debug;
  7353. /**
  7354. * Adds an error issue
  7355. * @param message error issue message. Errors will be converted to string via toString()
  7356. */
  7357. function error(message) {
  7358. command_1.issue('error', message instanceof Error ? message.toString() : message);
  7359. }
  7360. exports.error = error;
  7361. /**
  7362. * Adds an warning issue
  7363. * @param message warning issue message. Errors will be converted to string via toString()
  7364. */
  7365. function warning(message) {
  7366. command_1.issue('warning', message instanceof Error ? message.toString() : message);
  7367. }
  7368. exports.warning = warning;
  7369. /**
  7370. * Writes info to log with console.log.
  7371. * @param message info message
  7372. */
  7373. function info(message) {
  7374. process.stdout.write(message + os.EOL);
  7375. }
  7376. exports.info = info;
  7377. /**
  7378. * Begin an output group.
  7379. *
  7380. * Output until the next `groupEnd` will be foldable in this group
  7381. *
  7382. * @param name The name of the output group
  7383. */
  7384. function startGroup(name) {
  7385. command_1.issue('group', name);
  7386. }
  7387. exports.startGroup = startGroup;
  7388. /**
  7389. * End an output group.
  7390. */
  7391. function endGroup() {
  7392. command_1.issue('endgroup');
  7393. }
  7394. exports.endGroup = endGroup;
  7395. /**
  7396. * Wrap an asynchronous function call in a group.
  7397. *
  7398. * Returns the same type as the function itself.
  7399. *
  7400. * @param name The name of the group
  7401. * @param fn The function to wrap in the group
  7402. */
  7403. function group(name, fn) {
  7404. return __awaiter(this, void 0, void 0, function* () {
  7405. startGroup(name);
  7406. let result;
  7407. try {
  7408. result = yield fn();
  7409. }
  7410. finally {
  7411. endGroup();
  7412. }
  7413. return result;
  7414. });
  7415. }
  7416. exports.group = group;
  7417. //-----------------------------------------------------------------------
  7418. // Wrapper action state
  7419. //-----------------------------------------------------------------------
  7420. /**
  7421. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  7422. *
  7423. * @param name name of the state to store
  7424. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  7425. */
  7426. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  7427. function saveState(name, value) {
  7428. command_1.issueCommand('save-state', { name }, value);
  7429. }
  7430. exports.saveState = saveState;
  7431. /**
  7432. * Gets the value of an state set by this action's main execution.
  7433. *
  7434. * @param name name of the state to get
  7435. * @returns string
  7436. */
  7437. function getState(name) {
  7438. return process.env[`STATE_${name}`] || '';
  7439. }
  7440. exports.getState = getState;
  7441. //# sourceMappingURL=core.js.map
  7442. /***/ }),
  7443. /***/ 476:
  7444. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7445. // Generated by CoffeeScript 1.12.7
  7446. (function() {
  7447. "use strict";
  7448. var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,
  7449. hasProp = {}.hasOwnProperty;
  7450. builder = __webpack_require__(312);
  7451. defaults = __webpack_require__(514).defaults;
  7452. requiresCDATA = function(entry) {
  7453. return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);
  7454. };
  7455. wrapCDATA = function(entry) {
  7456. return "<![CDATA[" + (escapeCDATA(entry)) + "]]>";
  7457. };
  7458. escapeCDATA = function(entry) {
  7459. return entry.replace(']]>', ']]]]><![CDATA[>');
  7460. };
  7461. exports.Builder = (function() {
  7462. function Builder(opts) {
  7463. var key, ref, value;
  7464. this.options = {};
  7465. ref = defaults["0.2"];
  7466. for (key in ref) {
  7467. if (!hasProp.call(ref, key)) continue;
  7468. value = ref[key];
  7469. this.options[key] = value;
  7470. }
  7471. for (key in opts) {
  7472. if (!hasProp.call(opts, key)) continue;
  7473. value = opts[key];
  7474. this.options[key] = value;
  7475. }
  7476. }
  7477. Builder.prototype.buildObject = function(rootObj) {
  7478. var attrkey, charkey, render, rootElement, rootName;
  7479. attrkey = this.options.attrkey;
  7480. charkey = this.options.charkey;
  7481. if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {
  7482. rootName = Object.keys(rootObj)[0];
  7483. rootObj = rootObj[rootName];
  7484. } else {
  7485. rootName = this.options.rootName;
  7486. }
  7487. render = (function(_this) {
  7488. return function(element, obj) {
  7489. var attr, child, entry, index, key, value;
  7490. if (typeof obj !== 'object') {
  7491. if (_this.options.cdata && requiresCDATA(obj)) {
  7492. element.raw(wrapCDATA(obj));
  7493. } else {
  7494. element.txt(obj);
  7495. }
  7496. } else if (Array.isArray(obj)) {
  7497. for (index in obj) {
  7498. if (!hasProp.call(obj, index)) continue;
  7499. child = obj[index];
  7500. for (key in child) {
  7501. entry = child[key];
  7502. element = render(element.ele(key), entry).up();
  7503. }
  7504. }
  7505. } else {
  7506. for (key in obj) {
  7507. if (!hasProp.call(obj, key)) continue;
  7508. child = obj[key];
  7509. if (key === attrkey) {
  7510. if (typeof child === "object") {
  7511. for (attr in child) {
  7512. value = child[attr];
  7513. element = element.att(attr, value);
  7514. }
  7515. }
  7516. } else if (key === charkey) {
  7517. if (_this.options.cdata && requiresCDATA(child)) {
  7518. element = element.raw(wrapCDATA(child));
  7519. } else {
  7520. element = element.txt(child);
  7521. }
  7522. } else if (Array.isArray(child)) {
  7523. for (index in child) {
  7524. if (!hasProp.call(child, index)) continue;
  7525. entry = child[index];
  7526. if (typeof entry === 'string') {
  7527. if (_this.options.cdata && requiresCDATA(entry)) {
  7528. element = element.ele(key).raw(wrapCDATA(entry)).up();
  7529. } else {
  7530. element = element.ele(key, entry).up();
  7531. }
  7532. } else {
  7533. element = render(element.ele(key), entry).up();
  7534. }
  7535. }
  7536. } else if (typeof child === "object") {
  7537. element = render(element.ele(key), child).up();
  7538. } else {
  7539. if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {
  7540. element = element.ele(key).raw(wrapCDATA(child)).up();
  7541. } else {
  7542. if (child == null) {
  7543. child = '';
  7544. }
  7545. element = element.ele(key, child.toString()).up();
  7546. }
  7547. }
  7548. }
  7549. }
  7550. return element;
  7551. };
  7552. })(this);
  7553. rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
  7554. headless: this.options.headless,
  7555. allowSurrogateChars: this.options.allowSurrogateChars
  7556. });
  7557. return render(rootElement, rootObj).end(this.options.renderOpts);
  7558. };
  7559. return Builder;
  7560. })();
  7561. }).call(this);
  7562. /***/ }),
  7563. /***/ 482:
  7564. /***/ (function(module, __unusedexports, __webpack_require__) {
  7565. "use strict";
  7566. var alphabet = __webpack_require__(963);
  7567. var random = __webpack_require__(578);
  7568. var format = __webpack_require__(907);
  7569. function generate(number) {
  7570. var loopCounter = 0;
  7571. var done;
  7572. var str = '';
  7573. while (!done) {
  7574. str = str + format(random, alphabet.get(), 1);
  7575. done = number < (Math.pow(16, loopCounter + 1 ) );
  7576. loopCounter++;
  7577. }
  7578. return str;
  7579. }
  7580. module.exports = generate;
  7581. /***/ }),
  7582. /***/ 491:
  7583. /***/ (function(module, __unusedexports, __webpack_require__) {
  7584. // Generated by CoffeeScript 1.12.7
  7585. (function() {
  7586. var XMLNode, XMLProcessingInstruction,
  7587. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  7588. hasProp = {}.hasOwnProperty;
  7589. XMLNode = __webpack_require__(855);
  7590. module.exports = XMLProcessingInstruction = (function(superClass) {
  7591. extend(XMLProcessingInstruction, superClass);
  7592. function XMLProcessingInstruction(parent, target, value) {
  7593. XMLProcessingInstruction.__super__.constructor.call(this, parent);
  7594. if (target == null) {
  7595. throw new Error("Missing instruction target");
  7596. }
  7597. this.target = this.stringify.insTarget(target);
  7598. if (value) {
  7599. this.value = this.stringify.insValue(value);
  7600. }
  7601. }
  7602. XMLProcessingInstruction.prototype.clone = function() {
  7603. return Object.create(this);
  7604. };
  7605. XMLProcessingInstruction.prototype.toString = function(options) {
  7606. return this.options.writer.set(options).processingInstruction(this);
  7607. };
  7608. return XMLProcessingInstruction;
  7609. })(XMLNode);
  7610. }).call(this);
  7611. /***/ }),
  7612. /***/ 492:
  7613. /***/ (function(module, __unusedexports, __webpack_require__) {
  7614. var util = __webpack_require__(153);
  7615. var XmlNode = __webpack_require__(404).XmlNode;
  7616. var XmlText = __webpack_require__(948).XmlText;
  7617. function XmlBuilder() { }
  7618. XmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) {
  7619. var xml = new XmlNode(rootElement);
  7620. applyNamespaces(xml, shape, true);
  7621. serialize(xml, params, shape);
  7622. return xml.children.length > 0 || noEmpty ? xml.toString() : '';
  7623. };
  7624. function serialize(xml, value, shape) {
  7625. switch (shape.type) {
  7626. case 'structure': return serializeStructure(xml, value, shape);
  7627. case 'map': return serializeMap(xml, value, shape);
  7628. case 'list': return serializeList(xml, value, shape);
  7629. default: return serializeScalar(xml, value, shape);
  7630. }
  7631. }
  7632. function serializeStructure(xml, params, shape) {
  7633. util.arrayEach(shape.memberNames, function(memberName) {
  7634. var memberShape = shape.members[memberName];
  7635. if (memberShape.location !== 'body') return;
  7636. var value = params[memberName];
  7637. var name = memberShape.name;
  7638. if (value !== undefined && value !== null) {
  7639. if (memberShape.isXmlAttribute) {
  7640. xml.addAttribute(name, value);
  7641. } else if (memberShape.flattened) {
  7642. serialize(xml, value, memberShape);
  7643. } else {
  7644. var element = new XmlNode(name);
  7645. xml.addChildNode(element);
  7646. applyNamespaces(element, memberShape);
  7647. serialize(element, value, memberShape);
  7648. }
  7649. }
  7650. });
  7651. }
  7652. function serializeMap(xml, map, shape) {
  7653. var xmlKey = shape.key.name || 'key';
  7654. var xmlValue = shape.value.name || 'value';
  7655. util.each(map, function(key, value) {
  7656. var entry = new XmlNode(shape.flattened ? shape.name : 'entry');
  7657. xml.addChildNode(entry);
  7658. var entryKey = new XmlNode(xmlKey);
  7659. var entryValue = new XmlNode(xmlValue);
  7660. entry.addChildNode(entryKey);
  7661. entry.addChildNode(entryValue);
  7662. serialize(entryKey, key, shape.key);
  7663. serialize(entryValue, value, shape.value);
  7664. });
  7665. }
  7666. function serializeList(xml, list, shape) {
  7667. if (shape.flattened) {
  7668. util.arrayEach(list, function(value) {
  7669. var name = shape.member.name || shape.name;
  7670. var element = new XmlNode(name);
  7671. xml.addChildNode(element);
  7672. serialize(element, value, shape.member);
  7673. });
  7674. } else {
  7675. util.arrayEach(list, function(value) {
  7676. var name = shape.member.name || 'member';
  7677. var element = new XmlNode(name);
  7678. xml.addChildNode(element);
  7679. serialize(element, value, shape.member);
  7680. });
  7681. }
  7682. }
  7683. function serializeScalar(xml, value, shape) {
  7684. xml.addChildNode(
  7685. new XmlText(shape.toWireFormat(value))
  7686. );
  7687. }
  7688. function applyNamespaces(xml, shape, isRoot) {
  7689. var uri, prefix = 'xmlns';
  7690. if (shape.xmlNamespaceUri) {
  7691. uri = shape.xmlNamespaceUri;
  7692. if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix;
  7693. } else if (isRoot && shape.api.xmlNamespaceUri) {
  7694. uri = shape.api.xmlNamespaceUri;
  7695. }
  7696. if (uri) xml.addAttribute(prefix, uri);
  7697. }
  7698. /**
  7699. * @api private
  7700. */
  7701. module.exports = XmlBuilder;
  7702. /***/ }),
  7703. /***/ 502:
  7704. /***/ (function(module, __unusedexports, __webpack_require__) {
  7705. "use strict";
  7706. const fs = __webpack_require__(598)
  7707. const path = __webpack_require__(622)
  7708. function klawSync (dir, opts, ls) {
  7709. if (!ls) {
  7710. ls = []
  7711. dir = path.resolve(dir)
  7712. opts = opts || {}
  7713. opts.fs = opts.fs || fs
  7714. if (opts.depthLimit > -1) opts.rootDepth = dir.split(path.sep).length + 1
  7715. }
  7716. const paths = opts.fs.readdirSync(dir).map(p => dir + path.sep + p)
  7717. for (var i = 0; i < paths.length; i += 1) {
  7718. const pi = paths[i]
  7719. const st = opts.fs.statSync(pi)
  7720. const item = {path: pi, stats: st}
  7721. const isUnderDepthLimit = (!opts.rootDepth || pi.split(path.sep).length - opts.rootDepth < opts.depthLimit)
  7722. const filterResult = opts.filter ? opts.filter(item) : true
  7723. const isDir = st.isDirectory()
  7724. const shouldAdd = filterResult && (isDir ? !opts.nodir : !opts.nofile)
  7725. const shouldTraverse = isDir && isUnderDepthLimit && (opts.traverseAll || filterResult)
  7726. if (shouldAdd) ls.push(item)
  7727. if (shouldTraverse) ls = klawSync(pi, opts, ls)
  7728. }
  7729. return ls
  7730. }
  7731. module.exports = klawSync
  7732. /***/ }),
  7733. /***/ 503:
  7734. /***/ (function(module, __unusedexports, __webpack_require__) {
  7735. var AWS = __webpack_require__(395);
  7736. var Api = __webpack_require__(788);
  7737. var regionConfig = __webpack_require__(546);
  7738. var inherit = AWS.util.inherit;
  7739. var clientCount = 0;
  7740. /**
  7741. * The service class representing an AWS service.
  7742. *
  7743. * @class_abstract This class is an abstract class.
  7744. *
  7745. * @!attribute apiVersions
  7746. * @return [Array<String>] the list of API versions supported by this service.
  7747. * @readonly
  7748. */
  7749. AWS.Service = inherit({
  7750. /**
  7751. * Create a new service object with a configuration object
  7752. *
  7753. * @param config [map] a map of configuration options
  7754. */
  7755. constructor: function Service(config) {
  7756. if (!this.loadServiceClass) {
  7757. throw AWS.util.error(new Error(),
  7758. 'Service must be constructed with `new\' operator');
  7759. }
  7760. var ServiceClass = this.loadServiceClass(config || {});
  7761. if (ServiceClass) {
  7762. var originalConfig = AWS.util.copy(config);
  7763. var svc = new ServiceClass(config);
  7764. Object.defineProperty(svc, '_originalConfig', {
  7765. get: function() { return originalConfig; },
  7766. enumerable: false,
  7767. configurable: true
  7768. });
  7769. svc._clientId = ++clientCount;
  7770. return svc;
  7771. }
  7772. this.initialize(config);
  7773. },
  7774. /**
  7775. * @api private
  7776. */
  7777. initialize: function initialize(config) {
  7778. var svcConfig = AWS.config[this.serviceIdentifier];
  7779. this.config = new AWS.Config(AWS.config);
  7780. if (svcConfig) this.config.update(svcConfig, true);
  7781. if (config) this.config.update(config, true);
  7782. this.validateService();
  7783. if (!this.config.endpoint) regionConfig.configureEndpoint(this);
  7784. this.config.endpoint = this.endpointFromTemplate(this.config.endpoint);
  7785. this.setEndpoint(this.config.endpoint);
  7786. //enable attaching listeners to service client
  7787. AWS.SequentialExecutor.call(this);
  7788. AWS.Service.addDefaultMonitoringListeners(this);
  7789. if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) {
  7790. var publisher = this.publisher;
  7791. this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) {
  7792. process.nextTick(function() {publisher.eventHandler(event);});
  7793. });
  7794. this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) {
  7795. process.nextTick(function() {publisher.eventHandler(event);});
  7796. });
  7797. }
  7798. },
  7799. /**
  7800. * @api private
  7801. */
  7802. validateService: function validateService() {
  7803. },
  7804. /**
  7805. * @api private
  7806. */
  7807. loadServiceClass: function loadServiceClass(serviceConfig) {
  7808. var config = serviceConfig;
  7809. if (!AWS.util.isEmpty(this.api)) {
  7810. return null;
  7811. } else if (config.apiConfig) {
  7812. return AWS.Service.defineServiceApi(this.constructor, config.apiConfig);
  7813. } else if (!this.constructor.services) {
  7814. return null;
  7815. } else {
  7816. config = new AWS.Config(AWS.config);
  7817. config.update(serviceConfig, true);
  7818. var version = config.apiVersions[this.constructor.serviceIdentifier];
  7819. version = version || config.apiVersion;
  7820. return this.getLatestServiceClass(version);
  7821. }
  7822. },
  7823. /**
  7824. * @api private
  7825. */
  7826. getLatestServiceClass: function getLatestServiceClass(version) {
  7827. version = this.getLatestServiceVersion(version);
  7828. if (this.constructor.services[version] === null) {
  7829. AWS.Service.defineServiceApi(this.constructor, version);
  7830. }
  7831. return this.constructor.services[version];
  7832. },
  7833. /**
  7834. * @api private
  7835. */
  7836. getLatestServiceVersion: function getLatestServiceVersion(version) {
  7837. if (!this.constructor.services || this.constructor.services.length === 0) {
  7838. throw new Error('No services defined on ' +
  7839. this.constructor.serviceIdentifier);
  7840. }
  7841. if (!version) {
  7842. version = 'latest';
  7843. } else if (AWS.util.isType(version, Date)) {
  7844. version = AWS.util.date.iso8601(version).split('T')[0];
  7845. }
  7846. if (Object.hasOwnProperty(this.constructor.services, version)) {
  7847. return version;
  7848. }
  7849. var keys = Object.keys(this.constructor.services).sort();
  7850. var selectedVersion = null;
  7851. for (var i = keys.length - 1; i >= 0; i--) {
  7852. // versions that end in "*" are not available on disk and can be
  7853. // skipped, so do not choose these as selectedVersions
  7854. if (keys[i][keys[i].length - 1] !== '*') {
  7855. selectedVersion = keys[i];
  7856. }
  7857. if (keys[i].substr(0, 10) <= version) {
  7858. return selectedVersion;
  7859. }
  7860. }
  7861. throw new Error('Could not find ' + this.constructor.serviceIdentifier +
  7862. ' API to satisfy version constraint `' + version + '\'');
  7863. },
  7864. /**
  7865. * @api private
  7866. */
  7867. api: {},
  7868. /**
  7869. * @api private
  7870. */
  7871. defaultRetryCount: 3,
  7872. /**
  7873. * @api private
  7874. */
  7875. customizeRequests: function customizeRequests(callback) {
  7876. if (!callback) {
  7877. this.customRequestHandler = null;
  7878. } else if (typeof callback === 'function') {
  7879. this.customRequestHandler = callback;
  7880. } else {
  7881. throw new Error('Invalid callback type \'' + typeof callback + '\' provided in customizeRequests');
  7882. }
  7883. },
  7884. /**
  7885. * Calls an operation on a service with the given input parameters.
  7886. *
  7887. * @param operation [String] the name of the operation to call on the service.
  7888. * @param params [map] a map of input options for the operation
  7889. * @callback callback function(err, data)
  7890. * If a callback is supplied, it is called when a response is returned
  7891. * from the service.
  7892. * @param err [Error] the error object returned from the request.
  7893. * Set to `null` if the request is successful.
  7894. * @param data [Object] the de-serialized data returned from
  7895. * the request. Set to `null` if a request error occurs.
  7896. */
  7897. makeRequest: function makeRequest(operation, params, callback) {
  7898. if (typeof params === 'function') {
  7899. callback = params;
  7900. params = null;
  7901. }
  7902. params = params || {};
  7903. if (this.config.params) { // copy only toplevel bound params
  7904. var rules = this.api.operations[operation];
  7905. if (rules) {
  7906. params = AWS.util.copy(params);
  7907. AWS.util.each(this.config.params, function(key, value) {
  7908. if (rules.input.members[key]) {
  7909. if (params[key] === undefined || params[key] === null) {
  7910. params[key] = value;
  7911. }
  7912. }
  7913. });
  7914. }
  7915. }
  7916. var request = new AWS.Request(this, operation, params);
  7917. this.addAllRequestListeners(request);
  7918. this.attachMonitoringEmitter(request);
  7919. if (callback) request.send(callback);
  7920. return request;
  7921. },
  7922. /**
  7923. * Calls an operation on a service with the given input parameters, without
  7924. * any authentication data. This method is useful for "public" API operations.
  7925. *
  7926. * @param operation [String] the name of the operation to call on the service.
  7927. * @param params [map] a map of input options for the operation
  7928. * @callback callback function(err, data)
  7929. * If a callback is supplied, it is called when a response is returned
  7930. * from the service.
  7931. * @param err [Error] the error object returned from the request.
  7932. * Set to `null` if the request is successful.
  7933. * @param data [Object] the de-serialized data returned from
  7934. * the request. Set to `null` if a request error occurs.
  7935. */
  7936. makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) {
  7937. if (typeof params === 'function') {
  7938. callback = params;
  7939. params = {};
  7940. }
  7941. var request = this.makeRequest(operation, params).toUnauthenticated();
  7942. return callback ? request.send(callback) : request;
  7943. },
  7944. /**
  7945. * Waits for a given state
  7946. *
  7947. * @param state [String] the state on the service to wait for
  7948. * @param params [map] a map of parameters to pass with each request
  7949. * @option params $waiter [map] a map of configuration options for the waiter
  7950. * @option params $waiter.delay [Number] The number of seconds to wait between
  7951. * requests
  7952. * @option params $waiter.maxAttempts [Number] The maximum number of requests
  7953. * to send while waiting
  7954. * @callback callback function(err, data)
  7955. * If a callback is supplied, it is called when a response is returned
  7956. * from the service.
  7957. * @param err [Error] the error object returned from the request.
  7958. * Set to `null` if the request is successful.
  7959. * @param data [Object] the de-serialized data returned from
  7960. * the request. Set to `null` if a request error occurs.
  7961. */
  7962. waitFor: function waitFor(state, params, callback) {
  7963. var waiter = new AWS.ResourceWaiter(this, state);
  7964. return waiter.wait(params, callback);
  7965. },
  7966. /**
  7967. * @api private
  7968. */
  7969. addAllRequestListeners: function addAllRequestListeners(request) {
  7970. var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(),
  7971. AWS.EventListeners.CorePost];
  7972. for (var i = 0; i < list.length; i++) {
  7973. if (list[i]) request.addListeners(list[i]);
  7974. }
  7975. // disable parameter validation
  7976. if (!this.config.paramValidation) {
  7977. request.removeListener('validate',
  7978. AWS.EventListeners.Core.VALIDATE_PARAMETERS);
  7979. }
  7980. if (this.config.logger) { // add logging events
  7981. request.addListeners(AWS.EventListeners.Logger);
  7982. }
  7983. this.setupRequestListeners(request);
  7984. // call prototype's customRequestHandler
  7985. if (typeof this.constructor.prototype.customRequestHandler === 'function') {
  7986. this.constructor.prototype.customRequestHandler(request);
  7987. }
  7988. // call instance's customRequestHandler
  7989. if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') {
  7990. this.customRequestHandler(request);
  7991. }
  7992. },
  7993. /**
  7994. * Event recording metrics for a whole API call.
  7995. * @returns {object} a subset of api call metrics
  7996. * @api private
  7997. */
  7998. apiCallEvent: function apiCallEvent(request) {
  7999. var api = request.service.api.operations[request.operation];
  8000. var monitoringEvent = {
  8001. Type: 'ApiCall',
  8002. Api: api ? api.name : request.operation,
  8003. Version: 1,
  8004. Service: request.service.api.serviceId || request.service.api.endpointPrefix,
  8005. Region: request.httpRequest.region,
  8006. MaxRetriesExceeded: 0,
  8007. UserAgent: request.httpRequest.getUserAgent(),
  8008. };
  8009. var response = request.response;
  8010. if (response.httpResponse.statusCode) {
  8011. monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode;
  8012. }
  8013. if (response.error) {
  8014. var error = response.error;
  8015. var statusCode = response.httpResponse.statusCode;
  8016. if (statusCode > 299) {
  8017. if (error.code) monitoringEvent.FinalAwsException = error.code;
  8018. if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message;
  8019. } else {
  8020. if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name;
  8021. if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message;
  8022. }
  8023. }
  8024. return monitoringEvent;
  8025. },
  8026. /**
  8027. * Event recording metrics for an API call attempt.
  8028. * @returns {object} a subset of api call attempt metrics
  8029. * @api private
  8030. */
  8031. apiAttemptEvent: function apiAttemptEvent(request) {
  8032. var api = request.service.api.operations[request.operation];
  8033. var monitoringEvent = {
  8034. Type: 'ApiCallAttempt',
  8035. Api: api ? api.name : request.operation,
  8036. Version: 1,
  8037. Service: request.service.api.serviceId || request.service.api.endpointPrefix,
  8038. Fqdn: request.httpRequest.endpoint.hostname,
  8039. UserAgent: request.httpRequest.getUserAgent(),
  8040. };
  8041. var response = request.response;
  8042. if (response.httpResponse.statusCode) {
  8043. monitoringEvent.HttpStatusCode = response.httpResponse.statusCode;
  8044. }
  8045. if (
  8046. !request._unAuthenticated &&
  8047. request.service.config.credentials &&
  8048. request.service.config.credentials.accessKeyId
  8049. ) {
  8050. monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId;
  8051. }
  8052. if (!response.httpResponse.headers) return monitoringEvent;
  8053. if (request.httpRequest.headers['x-amz-security-token']) {
  8054. monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token'];
  8055. }
  8056. if (response.httpResponse.headers['x-amzn-requestid']) {
  8057. monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid'];
  8058. }
  8059. if (response.httpResponse.headers['x-amz-request-id']) {
  8060. monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id'];
  8061. }
  8062. if (response.httpResponse.headers['x-amz-id-2']) {
  8063. monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2'];
  8064. }
  8065. return monitoringEvent;
  8066. },
  8067. /**
  8068. * Add metrics of failed request.
  8069. * @api private
  8070. */
  8071. attemptFailEvent: function attemptFailEvent(request) {
  8072. var monitoringEvent = this.apiAttemptEvent(request);
  8073. var response = request.response;
  8074. var error = response.error;
  8075. if (response.httpResponse.statusCode > 299 ) {
  8076. if (error.code) monitoringEvent.AwsException = error.code;
  8077. if (error.message) monitoringEvent.AwsExceptionMessage = error.message;
  8078. } else {
  8079. if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name;
  8080. if (error.message) monitoringEvent.SdkExceptionMessage = error.message;
  8081. }
  8082. return monitoringEvent;
  8083. },
  8084. /**
  8085. * Attach listeners to request object to fetch metrics of each request
  8086. * and emit data object through \'ApiCall\' and \'ApiCallAttempt\' events.
  8087. * @api private
  8088. */
  8089. attachMonitoringEmitter: function attachMonitoringEmitter(request) {
  8090. var attemptTimestamp; //timestamp marking the beginning of a request attempt
  8091. var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency
  8092. var attemptLatency; //latency from request sent out to http response reaching SDK
  8093. var callStartRealTime; //Start time of API call. Used to calculating API call latency
  8094. var attemptCount = 0; //request.retryCount is not reliable here
  8095. var region; //region cache region for each attempt since it can be updated in plase (e.g. s3)
  8096. var callTimestamp; //timestamp when the request is created
  8097. var self = this;
  8098. var addToHead = true;
  8099. request.on('validate', function () {
  8100. callStartRealTime = AWS.util.realClock.now();
  8101. callTimestamp = Date.now();
  8102. }, addToHead);
  8103. request.on('sign', function () {
  8104. attemptStartRealTime = AWS.util.realClock.now();
  8105. attemptTimestamp = Date.now();
  8106. region = request.httpRequest.region;
  8107. attemptCount++;
  8108. }, addToHead);
  8109. request.on('validateResponse', function() {
  8110. attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime);
  8111. });
  8112. request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() {
  8113. var apiAttemptEvent = self.apiAttemptEvent(request);
  8114. apiAttemptEvent.Timestamp = attemptTimestamp;
  8115. apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0;
  8116. apiAttemptEvent.Region = region;
  8117. self.emit('apiCallAttempt', [apiAttemptEvent]);
  8118. });
  8119. request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() {
  8120. var apiAttemptEvent = self.attemptFailEvent(request);
  8121. apiAttemptEvent.Timestamp = attemptTimestamp;
  8122. //attemptLatency may not be available if fail before response
  8123. attemptLatency = attemptLatency ||
  8124. Math.round(AWS.util.realClock.now() - attemptStartRealTime);
  8125. apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0;
  8126. apiAttemptEvent.Region = region;
  8127. self.emit('apiCallAttempt', [apiAttemptEvent]);
  8128. });
  8129. request.addNamedListener('API_CALL', 'complete', function API_CALL() {
  8130. var apiCallEvent = self.apiCallEvent(request);
  8131. apiCallEvent.AttemptCount = attemptCount;
  8132. if (apiCallEvent.AttemptCount <= 0) return;
  8133. apiCallEvent.Timestamp = callTimestamp;
  8134. var latency = Math.round(AWS.util.realClock.now() - callStartRealTime);
  8135. apiCallEvent.Latency = latency >= 0 ? latency : 0;
  8136. var response = request.response;
  8137. if (
  8138. response.error &&
  8139. response.error.retryable &&
  8140. typeof response.retryCount === 'number' &&
  8141. typeof response.maxRetries === 'number' &&
  8142. (response.retryCount >= response.maxRetries)
  8143. ) {
  8144. apiCallEvent.MaxRetriesExceeded = 1;
  8145. }
  8146. self.emit('apiCall', [apiCallEvent]);
  8147. });
  8148. },
  8149. /**
  8150. * Override this method to setup any custom request listeners for each
  8151. * new request to the service.
  8152. *
  8153. * @method_abstract This is an abstract method.
  8154. */
  8155. setupRequestListeners: function setupRequestListeners(request) {
  8156. },
  8157. /**
  8158. * Gets the signing name for a given request
  8159. * @api private
  8160. */
  8161. getSigningName: function getSigningName() {
  8162. return this.api.signingName || this.api.endpointPrefix;
  8163. },
  8164. /**
  8165. * Gets the signer class for a given request
  8166. * @api private
  8167. */
  8168. getSignerClass: function getSignerClass(request) {
  8169. var version;
  8170. // get operation authtype if present
  8171. var operation = null;
  8172. var authtype = '';
  8173. if (request) {
  8174. var operations = request.service.api.operations || {};
  8175. operation = operations[request.operation] || null;
  8176. authtype = operation ? operation.authtype : '';
  8177. }
  8178. if (this.config.signatureVersion) {
  8179. version = this.config.signatureVersion;
  8180. } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') {
  8181. version = 'v4';
  8182. } else {
  8183. version = this.api.signatureVersion;
  8184. }
  8185. return AWS.Signers.RequestSigner.getVersion(version);
  8186. },
  8187. /**
  8188. * @api private
  8189. */
  8190. serviceInterface: function serviceInterface() {
  8191. switch (this.api.protocol) {
  8192. case 'ec2': return AWS.EventListeners.Query;
  8193. case 'query': return AWS.EventListeners.Query;
  8194. case 'json': return AWS.EventListeners.Json;
  8195. case 'rest-json': return AWS.EventListeners.RestJson;
  8196. case 'rest-xml': return AWS.EventListeners.RestXml;
  8197. }
  8198. if (this.api.protocol) {
  8199. throw new Error('Invalid service `protocol\' ' +
  8200. this.api.protocol + ' in API config');
  8201. }
  8202. },
  8203. /**
  8204. * @api private
  8205. */
  8206. successfulResponse: function successfulResponse(resp) {
  8207. return resp.httpResponse.statusCode < 300;
  8208. },
  8209. /**
  8210. * How many times a failed request should be retried before giving up.
  8211. * the defaultRetryCount can be overriden by service classes.
  8212. *
  8213. * @api private
  8214. */
  8215. numRetries: function numRetries() {
  8216. if (this.config.maxRetries !== undefined) {
  8217. return this.config.maxRetries;
  8218. } else {
  8219. return this.defaultRetryCount;
  8220. }
  8221. },
  8222. /**
  8223. * @api private
  8224. */
  8225. retryDelays: function retryDelays(retryCount, err) {
  8226. return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err);
  8227. },
  8228. /**
  8229. * @api private
  8230. */
  8231. retryableError: function retryableError(error) {
  8232. if (this.timeoutError(error)) return true;
  8233. if (this.networkingError(error)) return true;
  8234. if (this.expiredCredentialsError(error)) return true;
  8235. if (this.throttledError(error)) return true;
  8236. if (error.statusCode >= 500) return true;
  8237. return false;
  8238. },
  8239. /**
  8240. * @api private
  8241. */
  8242. networkingError: function networkingError(error) {
  8243. return error.code === 'NetworkingError';
  8244. },
  8245. /**
  8246. * @api private
  8247. */
  8248. timeoutError: function timeoutError(error) {
  8249. return error.code === 'TimeoutError';
  8250. },
  8251. /**
  8252. * @api private
  8253. */
  8254. expiredCredentialsError: function expiredCredentialsError(error) {
  8255. // TODO : this only handles *one* of the expired credential codes
  8256. return (error.code === 'ExpiredTokenException');
  8257. },
  8258. /**
  8259. * @api private
  8260. */
  8261. clockSkewError: function clockSkewError(error) {
  8262. switch (error.code) {
  8263. case 'RequestTimeTooSkewed':
  8264. case 'RequestExpired':
  8265. case 'InvalidSignatureException':
  8266. case 'SignatureDoesNotMatch':
  8267. case 'AuthFailure':
  8268. case 'RequestInTheFuture':
  8269. return true;
  8270. default: return false;
  8271. }
  8272. },
  8273. /**
  8274. * @api private
  8275. */
  8276. getSkewCorrectedDate: function getSkewCorrectedDate() {
  8277. return new Date(Date.now() + this.config.systemClockOffset);
  8278. },
  8279. /**
  8280. * @api private
  8281. */
  8282. applyClockOffset: function applyClockOffset(newServerTime) {
  8283. if (newServerTime) {
  8284. this.config.systemClockOffset = newServerTime - Date.now();
  8285. }
  8286. },
  8287. /**
  8288. * @api private
  8289. */
  8290. isClockSkewed: function isClockSkewed(newServerTime) {
  8291. if (newServerTime) {
  8292. return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000;
  8293. }
  8294. },
  8295. /**
  8296. * @api private
  8297. */
  8298. throttledError: function throttledError(error) {
  8299. // this logic varies between services
  8300. if (error.statusCode === 429) return true;
  8301. switch (error.code) {
  8302. case 'ProvisionedThroughputExceededException':
  8303. case 'Throttling':
  8304. case 'ThrottlingException':
  8305. case 'RequestLimitExceeded':
  8306. case 'RequestThrottled':
  8307. case 'RequestThrottledException':
  8308. case 'TooManyRequestsException':
  8309. case 'TransactionInProgressException': //dynamodb
  8310. case 'EC2ThrottledException':
  8311. return true;
  8312. default:
  8313. return false;
  8314. }
  8315. },
  8316. /**
  8317. * @api private
  8318. */
  8319. endpointFromTemplate: function endpointFromTemplate(endpoint) {
  8320. if (typeof endpoint !== 'string') return endpoint;
  8321. var e = endpoint;
  8322. e = e.replace(/\{service\}/g, this.api.endpointPrefix);
  8323. e = e.replace(/\{region\}/g, this.config.region);
  8324. e = e.replace(/\{scheme\}/g, this.config.sslEnabled ? 'https' : 'http');
  8325. return e;
  8326. },
  8327. /**
  8328. * @api private
  8329. */
  8330. setEndpoint: function setEndpoint(endpoint) {
  8331. this.endpoint = new AWS.Endpoint(endpoint, this.config);
  8332. },
  8333. /**
  8334. * @api private
  8335. */
  8336. paginationConfig: function paginationConfig(operation, throwException) {
  8337. var paginator = this.api.operations[operation].paginator;
  8338. if (!paginator) {
  8339. if (throwException) {
  8340. var e = new Error();
  8341. throw AWS.util.error(e, 'No pagination configuration for ' + operation);
  8342. }
  8343. return null;
  8344. }
  8345. return paginator;
  8346. }
  8347. });
  8348. AWS.util.update(AWS.Service, {
  8349. /**
  8350. * Adds one method for each operation described in the api configuration
  8351. *
  8352. * @api private
  8353. */
  8354. defineMethods: function defineMethods(svc) {
  8355. AWS.util.each(svc.prototype.api.operations, function iterator(method) {
  8356. if (svc.prototype[method]) return;
  8357. var operation = svc.prototype.api.operations[method];
  8358. if (operation.authtype === 'none') {
  8359. svc.prototype[method] = function (params, callback) {
  8360. return this.makeUnauthenticatedRequest(method, params, callback);
  8361. };
  8362. } else {
  8363. svc.prototype[method] = function (params, callback) {
  8364. return this.makeRequest(method, params, callback);
  8365. };
  8366. }
  8367. });
  8368. },
  8369. /**
  8370. * Defines a new Service class using a service identifier and list of versions
  8371. * including an optional set of features (functions) to apply to the class
  8372. * prototype.
  8373. *
  8374. * @param serviceIdentifier [String] the identifier for the service
  8375. * @param versions [Array<String>] a list of versions that work with this
  8376. * service
  8377. * @param features [Object] an object to attach to the prototype
  8378. * @return [Class<Service>] the service class defined by this function.
  8379. */
  8380. defineService: function defineService(serviceIdentifier, versions, features) {
  8381. AWS.Service._serviceMap[serviceIdentifier] = true;
  8382. if (!Array.isArray(versions)) {
  8383. features = versions;
  8384. versions = [];
  8385. }
  8386. var svc = inherit(AWS.Service, features || {});
  8387. if (typeof serviceIdentifier === 'string') {
  8388. AWS.Service.addVersions(svc, versions);
  8389. var identifier = svc.serviceIdentifier || serviceIdentifier;
  8390. svc.serviceIdentifier = identifier;
  8391. } else { // defineService called with an API
  8392. svc.prototype.api = serviceIdentifier;
  8393. AWS.Service.defineMethods(svc);
  8394. }
  8395. AWS.SequentialExecutor.call(this.prototype);
  8396. //util.clientSideMonitoring is only available in node
  8397. if (!this.prototype.publisher && AWS.util.clientSideMonitoring) {
  8398. var Publisher = AWS.util.clientSideMonitoring.Publisher;
  8399. var configProvider = AWS.util.clientSideMonitoring.configProvider;
  8400. var publisherConfig = configProvider();
  8401. this.prototype.publisher = new Publisher(publisherConfig);
  8402. if (publisherConfig.enabled) {
  8403. //if csm is enabled in environment, SDK should send all metrics
  8404. AWS.Service._clientSideMonitoring = true;
  8405. }
  8406. }
  8407. AWS.SequentialExecutor.call(svc.prototype);
  8408. AWS.Service.addDefaultMonitoringListeners(svc.prototype);
  8409. return svc;
  8410. },
  8411. /**
  8412. * @api private
  8413. */
  8414. addVersions: function addVersions(svc, versions) {
  8415. if (!Array.isArray(versions)) versions = [versions];
  8416. svc.services = svc.services || {};
  8417. for (var i = 0; i < versions.length; i++) {
  8418. if (svc.services[versions[i]] === undefined) {
  8419. svc.services[versions[i]] = null;
  8420. }
  8421. }
  8422. svc.apiVersions = Object.keys(svc.services).sort();
  8423. },
  8424. /**
  8425. * @api private
  8426. */
  8427. defineServiceApi: function defineServiceApi(superclass, version, apiConfig) {
  8428. var svc = inherit(superclass, {
  8429. serviceIdentifier: superclass.serviceIdentifier
  8430. });
  8431. function setApi(api) {
  8432. if (api.isApi) {
  8433. svc.prototype.api = api;
  8434. } else {
  8435. svc.prototype.api = new Api(api, {
  8436. serviceIdentifier: superclass.serviceIdentifier
  8437. });
  8438. }
  8439. }
  8440. if (typeof version === 'string') {
  8441. if (apiConfig) {
  8442. setApi(apiConfig);
  8443. } else {
  8444. try {
  8445. setApi(AWS.apiLoader(superclass.serviceIdentifier, version));
  8446. } catch (err) {
  8447. throw AWS.util.error(err, {
  8448. message: 'Could not find API configuration ' +
  8449. superclass.serviceIdentifier + '-' + version
  8450. });
  8451. }
  8452. }
  8453. if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) {
  8454. superclass.apiVersions = superclass.apiVersions.concat(version).sort();
  8455. }
  8456. superclass.services[version] = svc;
  8457. } else {
  8458. setApi(version);
  8459. }
  8460. AWS.Service.defineMethods(svc);
  8461. return svc;
  8462. },
  8463. /**
  8464. * @api private
  8465. */
  8466. hasService: function(identifier) {
  8467. return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier);
  8468. },
  8469. /**
  8470. * @param attachOn attach default monitoring listeners to object
  8471. *
  8472. * Each monitoring event should be emitted from service client to service constructor prototype and then
  8473. * to global service prototype like bubbling up. These default monitoring events listener will transfer
  8474. * the monitoring events to the upper layer.
  8475. * @api private
  8476. */
  8477. addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) {
  8478. attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) {
  8479. var baseClass = Object.getPrototypeOf(attachOn);
  8480. if (baseClass._events) baseClass.emit('apiCallAttempt', [event]);
  8481. });
  8482. attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) {
  8483. var baseClass = Object.getPrototypeOf(attachOn);
  8484. if (baseClass._events) baseClass.emit('apiCall', [event]);
  8485. });
  8486. },
  8487. /**
  8488. * @api private
  8489. */
  8490. _serviceMap: {}
  8491. });
  8492. AWS.util.mixin(AWS.Service, AWS.SequentialExecutor);
  8493. /**
  8494. * @api private
  8495. */
  8496. module.exports = AWS.Service;
  8497. /***/ }),
  8498. /***/ 512:
  8499. /***/ (function(module) {
  8500. module.exports = {"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["ecma","es"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/mrb-publish+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["keynote"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana"},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana"},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana"},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana"},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}};
  8501. /***/ }),
  8502. /***/ 514:
  8503. /***/ (function(__unusedmodule, exports) {
  8504. // Generated by CoffeeScript 1.12.7
  8505. (function() {
  8506. exports.defaults = {
  8507. "0.1": {
  8508. explicitCharkey: false,
  8509. trim: true,
  8510. normalize: true,
  8511. normalizeTags: false,
  8512. attrkey: "@",
  8513. charkey: "#",
  8514. explicitArray: false,
  8515. ignoreAttrs: false,
  8516. mergeAttrs: false,
  8517. explicitRoot: false,
  8518. validator: null,
  8519. xmlns: false,
  8520. explicitChildren: false,
  8521. childkey: '@@',
  8522. charsAsChildren: false,
  8523. includeWhiteChars: false,
  8524. async: false,
  8525. strict: true,
  8526. attrNameProcessors: null,
  8527. attrValueProcessors: null,
  8528. tagNameProcessors: null,
  8529. valueProcessors: null,
  8530. emptyTag: ''
  8531. },
  8532. "0.2": {
  8533. explicitCharkey: false,
  8534. trim: false,
  8535. normalize: false,
  8536. normalizeTags: false,
  8537. attrkey: "$",
  8538. charkey: "_",
  8539. explicitArray: true,
  8540. ignoreAttrs: false,
  8541. mergeAttrs: false,
  8542. explicitRoot: true,
  8543. validator: null,
  8544. xmlns: false,
  8545. explicitChildren: false,
  8546. preserveChildrenOrder: false,
  8547. childkey: '$$',
  8548. charsAsChildren: false,
  8549. includeWhiteChars: false,
  8550. async: false,
  8551. strict: true,
  8552. attrNameProcessors: null,
  8553. attrValueProcessors: null,
  8554. tagNameProcessors: null,
  8555. valueProcessors: null,
  8556. rootName: 'root',
  8557. xmldec: {
  8558. 'version': '1.0',
  8559. 'encoding': 'UTF-8',
  8560. 'standalone': true
  8561. },
  8562. doctype: null,
  8563. renderOpts: {
  8564. 'pretty': true,
  8565. 'indent': ' ',
  8566. 'newline': '\n'
  8567. },
  8568. headless: false,
  8569. chunkSize: 10000,
  8570. emptyTag: '',
  8571. cdata: false
  8572. }
  8573. };
  8574. }).call(this);
  8575. /***/ }),
  8576. /***/ 531:
  8577. /***/ (function(module) {
  8578. module.exports = require("cluster");
  8579. /***/ }),
  8580. /***/ 543:
  8581. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  8582. var AWS = __webpack_require__(395);
  8583. var STS = __webpack_require__(733);
  8584. /**
  8585. * Represents temporary credentials retrieved from {AWS.STS}. Without any
  8586. * extra parameters, credentials will be fetched from the
  8587. * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the
  8588. * {AWS.STS.assumeRole} operation will be used to fetch credentials for the
  8589. * role instead.
  8590. *
  8591. * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in
  8592. * the way masterCredentials and refreshes are handled.
  8593. * AWS.ChainableTemporaryCredentials refreshes expired credentials using the
  8594. * masterCredentials passed by the user to support chaining of STS credentials.
  8595. * However, AWS.TemporaryCredentials recursively collapses the masterCredentials
  8596. * during instantiation, precluding the ability to refresh credentials which
  8597. * require intermediate, temporary credentials.
  8598. *
  8599. * For example, if the application should use RoleA, which must be assumed from
  8600. * RoleB, and the environment provides credentials which can assume RoleB, then
  8601. * AWS.ChainableTemporaryCredentials must be used to support refreshing the
  8602. * temporary credentials for RoleA:
  8603. *
  8604. * ```javascript
  8605. * var roleACreds = new AWS.ChainableTemporaryCredentials({
  8606. * params: {RoleArn: 'RoleA'},
  8607. * masterCredentials: new AWS.ChainableTemporaryCredentials({
  8608. * params: {RoleArn: 'RoleB'},
  8609. * masterCredentials: new AWS.EnvironmentCredentials('AWS')
  8610. * })
  8611. * });
  8612. * ```
  8613. *
  8614. * If AWS.TemporaryCredentials had been used in the previous example,
  8615. * `roleACreds` would fail to refresh because `roleACreds` would
  8616. * use the environment credentials for the AssumeRole request.
  8617. *
  8618. * Another difference is that AWS.ChainableTemporaryCredentials creates the STS
  8619. * service instance during instantiation while AWS.TemporaryCredentials creates
  8620. * the STS service instance during the first refresh. Creating the service
  8621. * instance during instantiation effectively captures the master credentials
  8622. * from the global config, so that subsequent changes to the global config do
  8623. * not affect the master credentials used to refresh the temporary credentials.
  8624. *
  8625. * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned
  8626. * to AWS.config.credentials:
  8627. *
  8628. * ```javascript
  8629. * var envCreds = new AWS.EnvironmentCredentials('AWS');
  8630. * AWS.config.credentials = envCreds;
  8631. * // masterCredentials will be envCreds
  8632. * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({
  8633. * params: {RoleArn: '...'}
  8634. * });
  8635. * ```
  8636. *
  8637. * Similarly, to use the CredentialProviderChain's default providers as the
  8638. * master credentials, simply create a new instance of
  8639. * AWS.ChainableTemporaryCredentials:
  8640. *
  8641. * ```javascript
  8642. * AWS.config.credentials = new ChainableTemporaryCredentials({
  8643. * params: {RoleArn: '...'}
  8644. * });
  8645. * ```
  8646. *
  8647. * @!attribute service
  8648. * @return [AWS.STS] the STS service instance used to
  8649. * get and refresh temporary credentials from AWS STS.
  8650. * @note (see constructor)
  8651. */
  8652. AWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, {
  8653. /**
  8654. * Creates a new temporary credentials object.
  8655. *
  8656. * @param options [map] a set of options
  8657. * @option options params [map] ({}) a map of options that are passed to the
  8658. * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.
  8659. * If a `RoleArn` parameter is passed in, credentials will be based on the
  8660. * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must
  8661. * also be passed in or an error will be thrown.
  8662. * @option options masterCredentials [AWS.Credentials] the master credentials
  8663. * used to get and refresh temporary credentials from AWS STS. By default,
  8664. * AWS.config.credentials or AWS.config.credentialProvider will be used.
  8665. * @option options tokenCodeFn [Function] (null) Function to provide
  8666. * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function
  8667. * is called with value of `SerialNumber` and `callback`, and should provide
  8668. * the `TokenCode` or an error to the callback in the format
  8669. * `callback(err, token)`.
  8670. * @example Creating a new credentials object for generic temporary credentials
  8671. * AWS.config.credentials = new AWS.ChainableTemporaryCredentials();
  8672. * @example Creating a new credentials object for an IAM role
  8673. * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({
  8674. * params: {
  8675. * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials'
  8676. * }
  8677. * });
  8678. * @see AWS.STS.assumeRole
  8679. * @see AWS.STS.getSessionToken
  8680. */
  8681. constructor: function ChainableTemporaryCredentials(options) {
  8682. AWS.Credentials.call(this);
  8683. options = options || {};
  8684. this.errorCode = 'ChainableTemporaryCredentialsProviderFailure';
  8685. this.expired = true;
  8686. this.tokenCodeFn = null;
  8687. var params = AWS.util.copy(options.params) || {};
  8688. if (params.RoleArn) {
  8689. params.RoleSessionName = params.RoleSessionName || 'temporary-credentials';
  8690. }
  8691. if (params.SerialNumber) {
  8692. if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) {
  8693. throw new AWS.util.error(
  8694. new Error('tokenCodeFn must be a function when params.SerialNumber is given'),
  8695. {code: this.errorCode}
  8696. );
  8697. } else {
  8698. this.tokenCodeFn = options.tokenCodeFn;
  8699. }
  8700. }
  8701. var config = AWS.util.merge(
  8702. {
  8703. params: params,
  8704. credentials: options.masterCredentials || AWS.config.credentials
  8705. },
  8706. options.stsConfig || {}
  8707. );
  8708. this.service = new STS(config);
  8709. },
  8710. /**
  8711. * Refreshes credentials using {AWS.STS.assumeRole} or
  8712. * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed
  8713. * to the credentials {constructor}.
  8714. *
  8715. * @callback callback function(err)
  8716. * Called when the STS service responds (or fails). When
  8717. * this callback is called with no error, it means that the credentials
  8718. * information has been loaded into the object (as the `accessKeyId`,
  8719. * `secretAccessKey`, and `sessionToken` properties).
  8720. * @param err [Error] if an error occurred, this value will be filled
  8721. * @see AWS.Credentials.get
  8722. */
  8723. refresh: function refresh(callback) {
  8724. this.coalesceRefresh(callback || AWS.util.fn.callback);
  8725. },
  8726. /**
  8727. * @api private
  8728. * @param callback
  8729. */
  8730. load: function load(callback) {
  8731. var self = this;
  8732. var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken';
  8733. this.getTokenCode(function (err, tokenCode) {
  8734. var params = {};
  8735. if (err) {
  8736. callback(err);
  8737. return;
  8738. }
  8739. if (tokenCode) {
  8740. params.TokenCode = tokenCode;
  8741. }
  8742. self.service[operation](params, function (err, data) {
  8743. if (!err) {
  8744. self.service.credentialsFrom(data, self);
  8745. }
  8746. callback(err);
  8747. });
  8748. });
  8749. },
  8750. /**
  8751. * @api private
  8752. */
  8753. getTokenCode: function getTokenCode(callback) {
  8754. var self = this;
  8755. if (this.tokenCodeFn) {
  8756. this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) {
  8757. if (err) {
  8758. var message = err;
  8759. if (err instanceof Error) {
  8760. message = err.message;
  8761. }
  8762. callback(
  8763. AWS.util.error(
  8764. new Error('Error fetching MFA token: ' + message),
  8765. { code: self.errorCode}
  8766. )
  8767. );
  8768. return;
  8769. }
  8770. callback(null, token);
  8771. });
  8772. } else {
  8773. callback(null);
  8774. }
  8775. }
  8776. });
  8777. /***/ }),
  8778. /***/ 546:
  8779. /***/ (function(module, __unusedexports, __webpack_require__) {
  8780. var util = __webpack_require__(153);
  8781. var regionConfig = __webpack_require__(572);
  8782. function generateRegionPrefix(region) {
  8783. if (!region) return null;
  8784. var parts = region.split('-');
  8785. if (parts.length < 3) return null;
  8786. return parts.slice(0, parts.length - 2).join('-') + '-*';
  8787. }
  8788. function derivedKeys(service) {
  8789. var region = service.config.region;
  8790. var regionPrefix = generateRegionPrefix(region);
  8791. var endpointPrefix = service.api.endpointPrefix;
  8792. return [
  8793. [region, endpointPrefix],
  8794. [regionPrefix, endpointPrefix],
  8795. [region, '*'],
  8796. [regionPrefix, '*'],
  8797. ['*', endpointPrefix],
  8798. ['*', '*']
  8799. ].map(function(item) {
  8800. return item[0] && item[1] ? item.join('/') : null;
  8801. });
  8802. }
  8803. function applyConfig(service, config) {
  8804. util.each(config, function(key, value) {
  8805. if (key === 'globalEndpoint') return;
  8806. if (service.config[key] === undefined || service.config[key] === null) {
  8807. service.config[key] = value;
  8808. }
  8809. });
  8810. }
  8811. function configureEndpoint(service) {
  8812. var keys = derivedKeys(service);
  8813. for (var i = 0; i < keys.length; i++) {
  8814. var key = keys[i];
  8815. if (!key) continue;
  8816. if (Object.prototype.hasOwnProperty.call(regionConfig.rules, key)) {
  8817. var config = regionConfig.rules[key];
  8818. if (typeof config === 'string') {
  8819. config = regionConfig.patterns[config];
  8820. }
  8821. // set dualstack endpoint
  8822. if (service.config.useDualstack && util.isDualstackAvailable(service)) {
  8823. config = util.copy(config);
  8824. config.endpoint = config.endpoint.replace(
  8825. /{service}\.({region}\.)?/,
  8826. '{service}.dualstack.{region}.'
  8827. );
  8828. }
  8829. // set global endpoint
  8830. service.isGlobalEndpoint = !!config.globalEndpoint;
  8831. if (config.signingRegion) {
  8832. service.signingRegion = config.signingRegion;
  8833. }
  8834. // signature version
  8835. if (!config.signatureVersion) config.signatureVersion = 'v4';
  8836. // merge config
  8837. applyConfig(service, config);
  8838. return;
  8839. }
  8840. }
  8841. }
  8842. function getEndpointSuffix(region) {
  8843. var regionRegexes = {
  8844. '^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$': 'amazonaws.com',
  8845. '^cn\\-\\w+\\-\\d+$': 'amazonaws.com.cn',
  8846. '^us\\-gov\\-\\w+\\-\\d+$': 'amazonaws.com',
  8847. '^us\\-iso\\-\\w+\\-\\d+$': 'c2s.ic.gov',
  8848. '^us\\-isob\\-\\w+\\-\\d+$': 'sc2s.sgov.gov'
  8849. };
  8850. var defaultSuffix = 'amazonaws.com';
  8851. var regexes = Object.keys(regionRegexes);
  8852. for (var i = 0; i < regexes.length; i++) {
  8853. var regionPattern = RegExp(regexes[i]);
  8854. var dnsSuffix = regionRegexes[regexes[i]];
  8855. if (regionPattern.test(region)) return dnsSuffix;
  8856. }
  8857. return defaultSuffix;
  8858. }
  8859. /**
  8860. * @api private
  8861. */
  8862. module.exports = {
  8863. configureEndpoint: configureEndpoint,
  8864. getEndpointSuffix: getEndpointSuffix
  8865. };
  8866. /***/ }),
  8867. /***/ 559:
  8868. /***/ (function(module, __unusedexports, __webpack_require__) {
  8869. // Generated by CoffeeScript 1.12.7
  8870. (function() {
  8871. var XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,
  8872. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  8873. hasProp = {}.hasOwnProperty;
  8874. isPlainObject = __webpack_require__(582).isPlainObject;
  8875. XMLNode = __webpack_require__(855);
  8876. XMLStringifier = __webpack_require__(602);
  8877. XMLStringWriter = __webpack_require__(750);
  8878. module.exports = XMLDocument = (function(superClass) {
  8879. extend(XMLDocument, superClass);
  8880. function XMLDocument(options) {
  8881. XMLDocument.__super__.constructor.call(this, null);
  8882. options || (options = {});
  8883. if (!options.writer) {
  8884. options.writer = new XMLStringWriter();
  8885. }
  8886. this.options = options;
  8887. this.stringify = new XMLStringifier(options);
  8888. this.isDocument = true;
  8889. }
  8890. XMLDocument.prototype.end = function(writer) {
  8891. var writerOptions;
  8892. if (!writer) {
  8893. writer = this.options.writer;
  8894. } else if (isPlainObject(writer)) {
  8895. writerOptions = writer;
  8896. writer = this.options.writer.set(writerOptions);
  8897. }
  8898. return writer.document(this);
  8899. };
  8900. XMLDocument.prototype.toString = function(options) {
  8901. return this.options.writer.set(options).document(this);
  8902. };
  8903. return XMLDocument;
  8904. })(XMLNode);
  8905. }).call(this);
  8906. /***/ }),
  8907. /***/ 566:
  8908. /***/ (function(module, __unusedexports, __webpack_require__) {
  8909. var AWS = __webpack_require__(395);
  8910. var inherit = AWS.util.inherit;
  8911. __webpack_require__(791);
  8912. /**
  8913. * @api private
  8914. */
  8915. AWS.Signers.V3Https = inherit(AWS.Signers.V3, {
  8916. authorization: function authorization(credentials) {
  8917. return 'AWS3-HTTPS ' +
  8918. 'AWSAccessKeyId=' + credentials.accessKeyId + ',' +
  8919. 'Algorithm=HmacSHA256,' +
  8920. 'Signature=' + this.signature(credentials);
  8921. },
  8922. stringToSign: function stringToSign() {
  8923. return this.request.headers['X-Amz-Date'];
  8924. }
  8925. });
  8926. /**
  8927. * @api private
  8928. */
  8929. module.exports = AWS.Signers.V3Https;
  8930. /***/ }),
  8931. /***/ 572:
  8932. /***/ (function(module) {
  8933. module.exports = {"rules":{"*/*":{"endpoint":"{service}.{region}.amazonaws.com"},"cn-*/*":{"endpoint":"{service}.{region}.amazonaws.com.cn"},"us-iso-*/*":{"endpoint":"{service}.{region}.c2s.ic.gov"},"us-isob-*/*":{"endpoint":"{service}.{region}.sc2s.sgov.gov"},"*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/sts":"globalSSL","*/importexport":{"endpoint":"{service}.amazonaws.com","signatureVersion":"v2","globalEndpoint":true},"*/route53":"globalSSL","cn-*/route53":{"endpoint":"{service}.amazonaws.com.cn","globalEndpoint":true,"signingRegion":"cn-northwest-1"},"us-gov-*/route53":"globalGovCloud","*/waf":"globalSSL","*/iam":"globalSSL","cn-*/iam":{"endpoint":"{service}.cn-north-1.amazonaws.com.cn","globalEndpoint":true,"signingRegion":"cn-north-1"},"us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{"endpoint":"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3signature","us-west-1/s3":"s3signature","us-west-2/s3":"s3signature","eu-west-1/s3":"s3signature","ap-southeast-1/s3":"s3signature","ap-southeast-2/s3":"s3signature","ap-northeast-1/s3":"s3signature","sa-east-1/s3":"s3signature","us-east-1/s3":{"endpoint":"{service}.amazonaws.com","signatureVersion":"s3"},"us-east-1/sdb":{"endpoint":"{service}.amazonaws.com","signatureVersion":"v2"},"*/sdb":{"endpoint":"{service}.{region}.amazonaws.com","signatureVersion":"v2"}},"patterns":{"globalSSL":{"endpoint":"https://{service}.amazonaws.com","globalEndpoint":true,"signingRegion":"us-east-1"},"globalGovCloud":{"endpoint":"{service}.us-gov.amazonaws.com","globalEndpoint":true,"signingRegion":"us-gov-west-1"},"s3signature":{"endpoint":"{service}.{region}.amazonaws.com","signatureVersion":"s3"}}};
  8934. /***/ }),
  8935. /***/ 576:
  8936. /***/ (function(module, __unusedexports, __webpack_require__) {
  8937. var AWS = __webpack_require__(395);
  8938. var util = __webpack_require__(153);
  8939. var QueryParamSerializer = __webpack_require__(439);
  8940. var Shape = __webpack_require__(682);
  8941. var populateHostPrefix = __webpack_require__(904).populateHostPrefix;
  8942. function buildRequest(req) {
  8943. var operation = req.service.api.operations[req.operation];
  8944. var httpRequest = req.httpRequest;
  8945. httpRequest.headers['Content-Type'] =
  8946. 'application/x-www-form-urlencoded; charset=utf-8';
  8947. httpRequest.params = {
  8948. Version: req.service.api.apiVersion,
  8949. Action: operation.name
  8950. };
  8951. // convert the request parameters into a list of query params,
  8952. // e.g. Deeply.NestedParam.0.Name=value
  8953. var builder = new QueryParamSerializer();
  8954. builder.serialize(req.params, operation.input, function(name, value) {
  8955. httpRequest.params[name] = value;
  8956. });
  8957. httpRequest.body = util.queryParamsToString(httpRequest.params);
  8958. populateHostPrefix(req);
  8959. }
  8960. function extractError(resp) {
  8961. var data, body = resp.httpResponse.body.toString();
  8962. if (body.match('<UnknownOperationException')) {
  8963. data = {
  8964. Code: 'UnknownOperation',
  8965. Message: 'Unknown operation ' + resp.request.operation
  8966. };
  8967. } else {
  8968. try {
  8969. data = new AWS.XML.Parser().parse(body);
  8970. } catch (e) {
  8971. data = {
  8972. Code: resp.httpResponse.statusCode,
  8973. Message: resp.httpResponse.statusMessage
  8974. };
  8975. }
  8976. }
  8977. if (data.requestId && !resp.requestId) resp.requestId = data.requestId;
  8978. if (data.Errors) data = data.Errors;
  8979. if (data.Error) data = data.Error;
  8980. if (data.Code) {
  8981. resp.error = util.error(new Error(), {
  8982. code: data.Code,
  8983. message: data.Message
  8984. });
  8985. } else {
  8986. resp.error = util.error(new Error(), {
  8987. code: resp.httpResponse.statusCode,
  8988. message: null
  8989. });
  8990. }
  8991. }
  8992. function extractData(resp) {
  8993. var req = resp.request;
  8994. var operation = req.service.api.operations[req.operation];
  8995. var shape = operation.output || {};
  8996. var origRules = shape;
  8997. if (origRules.resultWrapper) {
  8998. var tmp = Shape.create({type: 'structure'});
  8999. tmp.members[origRules.resultWrapper] = shape;
  9000. tmp.memberNames = [origRules.resultWrapper];
  9001. util.property(shape, 'name', shape.resultWrapper);
  9002. shape = tmp;
  9003. }
  9004. var parser = new AWS.XML.Parser();
  9005. // TODO: Refactor XML Parser to parse RequestId from response.
  9006. if (shape && shape.members && !shape.members._XAMZRequestId) {
  9007. var requestIdShape = Shape.create(
  9008. { type: 'string' },
  9009. { api: { protocol: 'query' } },
  9010. 'requestId'
  9011. );
  9012. shape.members._XAMZRequestId = requestIdShape;
  9013. }
  9014. var data = parser.parse(resp.httpResponse.body.toString(), shape);
  9015. resp.requestId = data._XAMZRequestId || data.requestId;
  9016. if (data._XAMZRequestId) delete data._XAMZRequestId;
  9017. if (origRules.resultWrapper) {
  9018. if (data[origRules.resultWrapper]) {
  9019. util.update(data, data[origRules.resultWrapper]);
  9020. delete data[origRules.resultWrapper];
  9021. }
  9022. }
  9023. resp.data = data;
  9024. }
  9025. /**
  9026. * @api private
  9027. */
  9028. module.exports = {
  9029. buildRequest: buildRequest,
  9030. extractError: extractError,
  9031. extractData: extractData
  9032. };
  9033. /***/ }),
  9034. /***/ 578:
  9035. /***/ (function(module, __unusedexports, __webpack_require__) {
  9036. module.exports = __webpack_require__(679);
  9037. /***/ }),
  9038. /***/ 582:
  9039. /***/ (function(module) {
  9040. // Generated by CoffeeScript 1.12.7
  9041. (function() {
  9042. var assign, isArray, isEmpty, isFunction, isObject, isPlainObject,
  9043. slice = [].slice,
  9044. hasProp = {}.hasOwnProperty;
  9045. assign = function() {
  9046. var i, key, len, source, sources, target;
  9047. target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
  9048. if (isFunction(Object.assign)) {
  9049. Object.assign.apply(null, arguments);
  9050. } else {
  9051. for (i = 0, len = sources.length; i < len; i++) {
  9052. source = sources[i];
  9053. if (source != null) {
  9054. for (key in source) {
  9055. if (!hasProp.call(source, key)) continue;
  9056. target[key] = source[key];
  9057. }
  9058. }
  9059. }
  9060. }
  9061. return target;
  9062. };
  9063. isFunction = function(val) {
  9064. return !!val && Object.prototype.toString.call(val) === '[object Function]';
  9065. };
  9066. isObject = function(val) {
  9067. var ref;
  9068. return !!val && ((ref = typeof val) === 'function' || ref === 'object');
  9069. };
  9070. isArray = function(val) {
  9071. if (isFunction(Array.isArray)) {
  9072. return Array.isArray(val);
  9073. } else {
  9074. return Object.prototype.toString.call(val) === '[object Array]';
  9075. }
  9076. };
  9077. isEmpty = function(val) {
  9078. var key;
  9079. if (isArray(val)) {
  9080. return !val.length;
  9081. } else {
  9082. for (key in val) {
  9083. if (!hasProp.call(val, key)) continue;
  9084. return false;
  9085. }
  9086. return true;
  9087. }
  9088. };
  9089. isPlainObject = function(val) {
  9090. var ctor, proto;
  9091. return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object));
  9092. };
  9093. module.exports.assign = assign;
  9094. module.exports.isFunction = isFunction;
  9095. module.exports.isObject = isObject;
  9096. module.exports.isArray = isArray;
  9097. module.exports.isEmpty = isEmpty;
  9098. module.exports.isPlainObject = isPlainObject;
  9099. }).call(this);
  9100. /***/ }),
  9101. /***/ 583:
  9102. /***/ (function(module, __unusedexports, __webpack_require__) {
  9103. var memoizedProperty = __webpack_require__(153).memoizedProperty;
  9104. function memoize(name, value, factory, nameTr) {
  9105. memoizedProperty(this, nameTr(name), function() {
  9106. return factory(name, value);
  9107. });
  9108. }
  9109. function Collection(iterable, options, factory, nameTr, callback) {
  9110. nameTr = nameTr || String;
  9111. var self = this;
  9112. for (var id in iterable) {
  9113. if (Object.prototype.hasOwnProperty.call(iterable, id)) {
  9114. memoize.call(self, id, iterable[id], factory, nameTr);
  9115. if (callback) callback(id, iterable[id]);
  9116. }
  9117. }
  9118. }
  9119. /**
  9120. * @api private
  9121. */
  9122. module.exports = Collection;
  9123. /***/ }),
  9124. /***/ 598:
  9125. /***/ (function(module, __unusedexports, __webpack_require__) {
  9126. var fs = __webpack_require__(747)
  9127. var polyfills = __webpack_require__(250)
  9128. var legacy = __webpack_require__(93)
  9129. var clone = __webpack_require__(608)
  9130. var util = __webpack_require__(669)
  9131. /* istanbul ignore next - node 0.x polyfill */
  9132. var gracefulQueue
  9133. var previousSymbol
  9134. /* istanbul ignore else - node 0.x polyfill */
  9135. if (typeof Symbol === 'function' && typeof Symbol.for === 'function') {
  9136. gracefulQueue = Symbol.for('graceful-fs.queue')
  9137. // This is used in testing by future versions
  9138. previousSymbol = Symbol.for('graceful-fs.previous')
  9139. } else {
  9140. gracefulQueue = '___graceful-fs.queue'
  9141. previousSymbol = '___graceful-fs.previous'
  9142. }
  9143. function noop () {}
  9144. function publishQueue(context, queue) {
  9145. Object.defineProperty(context, gracefulQueue, {
  9146. get: function() {
  9147. return queue
  9148. }
  9149. })
  9150. }
  9151. var debug = noop
  9152. if (util.debuglog)
  9153. debug = util.debuglog('gfs4')
  9154. else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
  9155. debug = function() {
  9156. var m = util.format.apply(util, arguments)
  9157. m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
  9158. console.error(m)
  9159. }
  9160. // Once time initialization
  9161. if (!fs[gracefulQueue]) {
  9162. // This queue can be shared by multiple loaded instances
  9163. var queue = global[gracefulQueue] || []
  9164. publishQueue(fs, queue)
  9165. // Patch fs.close/closeSync to shared queue version, because we need
  9166. // to retry() whenever a close happens *anywhere* in the program.
  9167. // This is essential when multiple graceful-fs instances are
  9168. // in play at the same time.
  9169. fs.close = (function (fs$close) {
  9170. function close (fd, cb) {
  9171. return fs$close.call(fs, fd, function (err) {
  9172. // This function uses the graceful-fs shared queue
  9173. if (!err) {
  9174. retry()
  9175. }
  9176. if (typeof cb === 'function')
  9177. cb.apply(this, arguments)
  9178. })
  9179. }
  9180. Object.defineProperty(close, previousSymbol, {
  9181. value: fs$close
  9182. })
  9183. return close
  9184. })(fs.close)
  9185. fs.closeSync = (function (fs$closeSync) {
  9186. function closeSync (fd) {
  9187. // This function uses the graceful-fs shared queue
  9188. fs$closeSync.apply(fs, arguments)
  9189. retry()
  9190. }
  9191. Object.defineProperty(closeSync, previousSymbol, {
  9192. value: fs$closeSync
  9193. })
  9194. return closeSync
  9195. })(fs.closeSync)
  9196. if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
  9197. process.on('exit', function() {
  9198. debug(fs[gracefulQueue])
  9199. __webpack_require__(357).equal(fs[gracefulQueue].length, 0)
  9200. })
  9201. }
  9202. }
  9203. if (!global[gracefulQueue]) {
  9204. publishQueue(global, fs[gracefulQueue]);
  9205. }
  9206. module.exports = patch(clone(fs))
  9207. if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
  9208. module.exports = patch(fs)
  9209. fs.__patched = true;
  9210. }
  9211. function patch (fs) {
  9212. // Everything that references the open() function needs to be in here
  9213. polyfills(fs)
  9214. fs.gracefulify = patch
  9215. fs.createReadStream = createReadStream
  9216. fs.createWriteStream = createWriteStream
  9217. var fs$readFile = fs.readFile
  9218. fs.readFile = readFile
  9219. function readFile (path, options, cb) {
  9220. if (typeof options === 'function')
  9221. cb = options, options = null
  9222. return go$readFile(path, options, cb)
  9223. function go$readFile (path, options, cb) {
  9224. return fs$readFile(path, options, function (err) {
  9225. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  9226. enqueue([go$readFile, [path, options, cb]])
  9227. else {
  9228. if (typeof cb === 'function')
  9229. cb.apply(this, arguments)
  9230. retry()
  9231. }
  9232. })
  9233. }
  9234. }
  9235. var fs$writeFile = fs.writeFile
  9236. fs.writeFile = writeFile
  9237. function writeFile (path, data, options, cb) {
  9238. if (typeof options === 'function')
  9239. cb = options, options = null
  9240. return go$writeFile(path, data, options, cb)
  9241. function go$writeFile (path, data, options, cb) {
  9242. return fs$writeFile(path, data, options, function (err) {
  9243. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  9244. enqueue([go$writeFile, [path, data, options, cb]])
  9245. else {
  9246. if (typeof cb === 'function')
  9247. cb.apply(this, arguments)
  9248. retry()
  9249. }
  9250. })
  9251. }
  9252. }
  9253. var fs$appendFile = fs.appendFile
  9254. if (fs$appendFile)
  9255. fs.appendFile = appendFile
  9256. function appendFile (path, data, options, cb) {
  9257. if (typeof options === 'function')
  9258. cb = options, options = null
  9259. return go$appendFile(path, data, options, cb)
  9260. function go$appendFile (path, data, options, cb) {
  9261. return fs$appendFile(path, data, options, function (err) {
  9262. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  9263. enqueue([go$appendFile, [path, data, options, cb]])
  9264. else {
  9265. if (typeof cb === 'function')
  9266. cb.apply(this, arguments)
  9267. retry()
  9268. }
  9269. })
  9270. }
  9271. }
  9272. var fs$readdir = fs.readdir
  9273. fs.readdir = readdir
  9274. function readdir (path, options, cb) {
  9275. var args = [path]
  9276. if (typeof options !== 'function') {
  9277. args.push(options)
  9278. } else {
  9279. cb = options
  9280. }
  9281. args.push(go$readdir$cb)
  9282. return go$readdir(args)
  9283. function go$readdir$cb (err, files) {
  9284. if (files && files.sort)
  9285. files.sort()
  9286. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  9287. enqueue([go$readdir, [args]])
  9288. else {
  9289. if (typeof cb === 'function')
  9290. cb.apply(this, arguments)
  9291. retry()
  9292. }
  9293. }
  9294. }
  9295. function go$readdir (args) {
  9296. return fs$readdir.apply(fs, args)
  9297. }
  9298. if (process.version.substr(0, 4) === 'v0.8') {
  9299. var legStreams = legacy(fs)
  9300. ReadStream = legStreams.ReadStream
  9301. WriteStream = legStreams.WriteStream
  9302. }
  9303. var fs$ReadStream = fs.ReadStream
  9304. if (fs$ReadStream) {
  9305. ReadStream.prototype = Object.create(fs$ReadStream.prototype)
  9306. ReadStream.prototype.open = ReadStream$open
  9307. }
  9308. var fs$WriteStream = fs.WriteStream
  9309. if (fs$WriteStream) {
  9310. WriteStream.prototype = Object.create(fs$WriteStream.prototype)
  9311. WriteStream.prototype.open = WriteStream$open
  9312. }
  9313. Object.defineProperty(fs, 'ReadStream', {
  9314. get: function () {
  9315. return ReadStream
  9316. },
  9317. set: function (val) {
  9318. ReadStream = val
  9319. },
  9320. enumerable: true,
  9321. configurable: true
  9322. })
  9323. Object.defineProperty(fs, 'WriteStream', {
  9324. get: function () {
  9325. return WriteStream
  9326. },
  9327. set: function (val) {
  9328. WriteStream = val
  9329. },
  9330. enumerable: true,
  9331. configurable: true
  9332. })
  9333. // legacy names
  9334. var FileReadStream = ReadStream
  9335. Object.defineProperty(fs, 'FileReadStream', {
  9336. get: function () {
  9337. return FileReadStream
  9338. },
  9339. set: function (val) {
  9340. FileReadStream = val
  9341. },
  9342. enumerable: true,
  9343. configurable: true
  9344. })
  9345. var FileWriteStream = WriteStream
  9346. Object.defineProperty(fs, 'FileWriteStream', {
  9347. get: function () {
  9348. return FileWriteStream
  9349. },
  9350. set: function (val) {
  9351. FileWriteStream = val
  9352. },
  9353. enumerable: true,
  9354. configurable: true
  9355. })
  9356. function ReadStream (path, options) {
  9357. if (this instanceof ReadStream)
  9358. return fs$ReadStream.apply(this, arguments), this
  9359. else
  9360. return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
  9361. }
  9362. function ReadStream$open () {
  9363. var that = this
  9364. open(that.path, that.flags, that.mode, function (err, fd) {
  9365. if (err) {
  9366. if (that.autoClose)
  9367. that.destroy()
  9368. that.emit('error', err)
  9369. } else {
  9370. that.fd = fd
  9371. that.emit('open', fd)
  9372. that.read()
  9373. }
  9374. })
  9375. }
  9376. function WriteStream (path, options) {
  9377. if (this instanceof WriteStream)
  9378. return fs$WriteStream.apply(this, arguments), this
  9379. else
  9380. return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
  9381. }
  9382. function WriteStream$open () {
  9383. var that = this
  9384. open(that.path, that.flags, that.mode, function (err, fd) {
  9385. if (err) {
  9386. that.destroy()
  9387. that.emit('error', err)
  9388. } else {
  9389. that.fd = fd
  9390. that.emit('open', fd)
  9391. }
  9392. })
  9393. }
  9394. function createReadStream (path, options) {
  9395. return new fs.ReadStream(path, options)
  9396. }
  9397. function createWriteStream (path, options) {
  9398. return new fs.WriteStream(path, options)
  9399. }
  9400. var fs$open = fs.open
  9401. fs.open = open
  9402. function open (path, flags, mode, cb) {
  9403. if (typeof mode === 'function')
  9404. cb = mode, mode = null
  9405. return go$open(path, flags, mode, cb)
  9406. function go$open (path, flags, mode, cb) {
  9407. return fs$open(path, flags, mode, function (err, fd) {
  9408. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  9409. enqueue([go$open, [path, flags, mode, cb]])
  9410. else {
  9411. if (typeof cb === 'function')
  9412. cb.apply(this, arguments)
  9413. retry()
  9414. }
  9415. })
  9416. }
  9417. }
  9418. return fs
  9419. }
  9420. function enqueue (elem) {
  9421. debug('ENQUEUE', elem[0].name, elem[1])
  9422. fs[gracefulQueue].push(elem)
  9423. }
  9424. function retry () {
  9425. var elem = fs[gracefulQueue].shift()
  9426. if (elem) {
  9427. debug('RETRY', elem[0].name, elem[1])
  9428. elem[0].apply(null, elem[1])
  9429. }
  9430. }
  9431. /***/ }),
  9432. /***/ 600:
  9433. /***/ (function(module, __unusedexports, __webpack_require__) {
  9434. "use strict";
  9435. var cluster = __webpack_require__(531);
  9436. var clusterId = 0;
  9437. if (!cluster.isMaster && cluster.worker) {
  9438. clusterId = cluster.worker.id;
  9439. }
  9440. module.exports = parseInt(process.env.NODE_UNIQUE_ID || clusterId, 10);
  9441. /***/ }),
  9442. /***/ 602:
  9443. /***/ (function(module) {
  9444. // Generated by CoffeeScript 1.12.7
  9445. (function() {
  9446. var XMLStringifier,
  9447. bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
  9448. hasProp = {}.hasOwnProperty;
  9449. module.exports = XMLStringifier = (function() {
  9450. function XMLStringifier(options) {
  9451. this.assertLegalChar = bind(this.assertLegalChar, this);
  9452. var key, ref, value;
  9453. options || (options = {});
  9454. this.noDoubleEncoding = options.noDoubleEncoding;
  9455. ref = options.stringify || {};
  9456. for (key in ref) {
  9457. if (!hasProp.call(ref, key)) continue;
  9458. value = ref[key];
  9459. this[key] = value;
  9460. }
  9461. }
  9462. XMLStringifier.prototype.eleName = function(val) {
  9463. val = '' + val || '';
  9464. return this.assertLegalChar(val);
  9465. };
  9466. XMLStringifier.prototype.eleText = function(val) {
  9467. val = '' + val || '';
  9468. return this.assertLegalChar(this.elEscape(val));
  9469. };
  9470. XMLStringifier.prototype.cdata = function(val) {
  9471. val = '' + val || '';
  9472. val = val.replace(']]>', ']]]]><![CDATA[>');
  9473. return this.assertLegalChar(val);
  9474. };
  9475. XMLStringifier.prototype.comment = function(val) {
  9476. val = '' + val || '';
  9477. if (val.match(/--/)) {
  9478. throw new Error("Comment text cannot contain double-hypen: " + val);
  9479. }
  9480. return this.assertLegalChar(val);
  9481. };
  9482. XMLStringifier.prototype.raw = function(val) {
  9483. return '' + val || '';
  9484. };
  9485. XMLStringifier.prototype.attName = function(val) {
  9486. return val = '' + val || '';
  9487. };
  9488. XMLStringifier.prototype.attValue = function(val) {
  9489. val = '' + val || '';
  9490. return this.attEscape(val);
  9491. };
  9492. XMLStringifier.prototype.insTarget = function(val) {
  9493. return '' + val || '';
  9494. };
  9495. XMLStringifier.prototype.insValue = function(val) {
  9496. val = '' + val || '';
  9497. if (val.match(/\?>/)) {
  9498. throw new Error("Invalid processing instruction value: " + val);
  9499. }
  9500. return val;
  9501. };
  9502. XMLStringifier.prototype.xmlVersion = function(val) {
  9503. val = '' + val || '';
  9504. if (!val.match(/1\.[0-9]+/)) {
  9505. throw new Error("Invalid version number: " + val);
  9506. }
  9507. return val;
  9508. };
  9509. XMLStringifier.prototype.xmlEncoding = function(val) {
  9510. val = '' + val || '';
  9511. if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
  9512. throw new Error("Invalid encoding: " + val);
  9513. }
  9514. return val;
  9515. };
  9516. XMLStringifier.prototype.xmlStandalone = function(val) {
  9517. if (val) {
  9518. return "yes";
  9519. } else {
  9520. return "no";
  9521. }
  9522. };
  9523. XMLStringifier.prototype.dtdPubID = function(val) {
  9524. return '' + val || '';
  9525. };
  9526. XMLStringifier.prototype.dtdSysID = function(val) {
  9527. return '' + val || '';
  9528. };
  9529. XMLStringifier.prototype.dtdElementValue = function(val) {
  9530. return '' + val || '';
  9531. };
  9532. XMLStringifier.prototype.dtdAttType = function(val) {
  9533. return '' + val || '';
  9534. };
  9535. XMLStringifier.prototype.dtdAttDefault = function(val) {
  9536. if (val != null) {
  9537. return '' + val || '';
  9538. } else {
  9539. return val;
  9540. }
  9541. };
  9542. XMLStringifier.prototype.dtdEntityValue = function(val) {
  9543. return '' + val || '';
  9544. };
  9545. XMLStringifier.prototype.dtdNData = function(val) {
  9546. return '' + val || '';
  9547. };
  9548. XMLStringifier.prototype.convertAttKey = '@';
  9549. XMLStringifier.prototype.convertPIKey = '?';
  9550. XMLStringifier.prototype.convertTextKey = '#text';
  9551. XMLStringifier.prototype.convertCDataKey = '#cdata';
  9552. XMLStringifier.prototype.convertCommentKey = '#comment';
  9553. XMLStringifier.prototype.convertRawKey = '#raw';
  9554. XMLStringifier.prototype.assertLegalChar = function(str) {
  9555. var res;
  9556. res = str.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);
  9557. if (res) {
  9558. throw new Error("Invalid character in string: " + str + " at index " + res.index);
  9559. }
  9560. return str;
  9561. };
  9562. XMLStringifier.prototype.elEscape = function(str) {
  9563. var ampregex;
  9564. ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
  9565. return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
  9566. };
  9567. XMLStringifier.prototype.attEscape = function(str) {
  9568. var ampregex;
  9569. ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
  9570. return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
  9571. };
  9572. return XMLStringifier;
  9573. })();
  9574. }).call(this);
  9575. /***/ }),
  9576. /***/ 605:
  9577. /***/ (function(module, __unusedexports, __webpack_require__) {
  9578. var util = __webpack_require__(395).util;
  9579. var toBuffer = util.buffer.toBuffer;
  9580. /**
  9581. * A lossless representation of a signed, 64-bit integer. Instances of this
  9582. * class may be used in arithmetic expressions as if they were numeric
  9583. * primitives, but the binary representation will be preserved unchanged as the
  9584. * `bytes` property of the object. The bytes should be encoded as big-endian,
  9585. * two's complement integers.
  9586. * @param {Buffer} bytes
  9587. *
  9588. * @api private
  9589. */
  9590. function Int64(bytes) {
  9591. if (bytes.length !== 8) {
  9592. throw new Error('Int64 buffers must be exactly 8 bytes');
  9593. }
  9594. if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes);
  9595. this.bytes = bytes;
  9596. }
  9597. /**
  9598. * @param {number} number
  9599. * @returns {Int64}
  9600. *
  9601. * @api private
  9602. */
  9603. Int64.fromNumber = function(number) {
  9604. if (number > 9223372036854775807 || number < -9223372036854775808) {
  9605. throw new Error(
  9606. number + ' is too large (or, if negative, too small) to represent as an Int64'
  9607. );
  9608. }
  9609. var bytes = new Uint8Array(8);
  9610. for (
  9611. var i = 7, remaining = Math.abs(Math.round(number));
  9612. i > -1 && remaining > 0;
  9613. i--, remaining /= 256
  9614. ) {
  9615. bytes[i] = remaining;
  9616. }
  9617. if (number < 0) {
  9618. negate(bytes);
  9619. }
  9620. return new Int64(bytes);
  9621. };
  9622. /**
  9623. * @returns {number}
  9624. *
  9625. * @api private
  9626. */
  9627. Int64.prototype.valueOf = function() {
  9628. var bytes = this.bytes.slice(0);
  9629. var negative = bytes[0] & 128;
  9630. if (negative) {
  9631. negate(bytes);
  9632. }
  9633. return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1);
  9634. };
  9635. Int64.prototype.toString = function() {
  9636. return String(this.valueOf());
  9637. };
  9638. /**
  9639. * @param {Buffer} bytes
  9640. *
  9641. * @api private
  9642. */
  9643. function negate(bytes) {
  9644. for (var i = 0; i < 8; i++) {
  9645. bytes[i] ^= 0xFF;
  9646. }
  9647. for (var i = 7; i > -1; i--) {
  9648. bytes[i]++;
  9649. if (bytes[i] !== 0) {
  9650. break;
  9651. }
  9652. }
  9653. }
  9654. /**
  9655. * @api private
  9656. */
  9657. module.exports = {
  9658. Int64: Int64
  9659. };
  9660. /***/ }),
  9661. /***/ 606:
  9662. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  9663. var AWS = __webpack_require__(395);
  9664. var SequentialExecutor = __webpack_require__(610);
  9665. var DISCOVER_ENDPOINT = __webpack_require__(987).discoverEndpoint;
  9666. /**
  9667. * The namespace used to register global event listeners for request building
  9668. * and sending.
  9669. */
  9670. AWS.EventListeners = {
  9671. /**
  9672. * @!attribute VALIDATE_CREDENTIALS
  9673. * A request listener that validates whether the request is being
  9674. * sent with credentials.
  9675. * Handles the {AWS.Request~validate 'validate' Request event}
  9676. * @example Sending a request without validating credentials
  9677. * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS;
  9678. * request.removeListener('validate', listener);
  9679. * @readonly
  9680. * @return [Function]
  9681. * @!attribute VALIDATE_REGION
  9682. * A request listener that validates whether the region is set
  9683. * for a request.
  9684. * Handles the {AWS.Request~validate 'validate' Request event}
  9685. * @example Sending a request without validating region configuration
  9686. * var listener = AWS.EventListeners.Core.VALIDATE_REGION;
  9687. * request.removeListener('validate', listener);
  9688. * @readonly
  9689. * @return [Function]
  9690. * @!attribute VALIDATE_PARAMETERS
  9691. * A request listener that validates input parameters in a request.
  9692. * Handles the {AWS.Request~validate 'validate' Request event}
  9693. * @example Sending a request without validating parameters
  9694. * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS;
  9695. * request.removeListener('validate', listener);
  9696. * @example Disable parameter validation globally
  9697. * AWS.EventListeners.Core.removeListener('validate',
  9698. * AWS.EventListeners.Core.VALIDATE_REGION);
  9699. * @readonly
  9700. * @return [Function]
  9701. * @!attribute SEND
  9702. * A request listener that initiates the HTTP connection for a
  9703. * request being sent. Handles the {AWS.Request~send 'send' Request event}
  9704. * @example Replacing the HTTP handler
  9705. * var listener = AWS.EventListeners.Core.SEND;
  9706. * request.removeListener('send', listener);
  9707. * request.on('send', function(response) {
  9708. * customHandler.send(response);
  9709. * });
  9710. * @return [Function]
  9711. * @readonly
  9712. * @!attribute HTTP_DATA
  9713. * A request listener that reads data from the HTTP connection in order
  9714. * to build the response data.
  9715. * Handles the {AWS.Request~httpData 'httpData' Request event}.
  9716. * Remove this handler if you are overriding the 'httpData' event and
  9717. * do not want extra data processing and buffering overhead.
  9718. * @example Disabling default data processing
  9719. * var listener = AWS.EventListeners.Core.HTTP_DATA;
  9720. * request.removeListener('httpData', listener);
  9721. * @return [Function]
  9722. * @readonly
  9723. */
  9724. Core: {} /* doc hack */
  9725. };
  9726. /**
  9727. * @api private
  9728. */
  9729. function getOperationAuthtype(req) {
  9730. if (!req.service.api.operations) {
  9731. return '';
  9732. }
  9733. var operation = req.service.api.operations[req.operation];
  9734. return operation ? operation.authtype : '';
  9735. }
  9736. AWS.EventListeners = {
  9737. Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) {
  9738. addAsync('VALIDATE_CREDENTIALS', 'validate',
  9739. function VALIDATE_CREDENTIALS(req, done) {
  9740. if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none
  9741. req.service.config.getCredentials(function(err) {
  9742. if (err) {
  9743. req.response.error = AWS.util.error(err,
  9744. {code: 'CredentialsError', message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'});
  9745. }
  9746. done();
  9747. });
  9748. });
  9749. add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) {
  9750. if (!req.service.isGlobalEndpoint) {
  9751. var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);
  9752. if (!req.service.config.region) {
  9753. req.response.error = AWS.util.error(new Error(),
  9754. {code: 'ConfigError', message: 'Missing region in config'});
  9755. } else if (!dnsHostRegex.test(req.service.config.region)) {
  9756. req.response.error = AWS.util.error(new Error(),
  9757. {code: 'ConfigError', message: 'Invalid region in config'});
  9758. }
  9759. }
  9760. });
  9761. add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) {
  9762. if (!req.service.api.operations) {
  9763. return;
  9764. }
  9765. var operation = req.service.api.operations[req.operation];
  9766. if (!operation) {
  9767. return;
  9768. }
  9769. var idempotentMembers = operation.idempotentMembers;
  9770. if (!idempotentMembers.length) {
  9771. return;
  9772. }
  9773. // creates a copy of params so user's param object isn't mutated
  9774. var params = AWS.util.copy(req.params);
  9775. for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) {
  9776. if (!params[idempotentMembers[i]]) {
  9777. // add the member
  9778. params[idempotentMembers[i]] = AWS.util.uuid.v4();
  9779. }
  9780. }
  9781. req.params = params;
  9782. });
  9783. add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) {
  9784. if (!req.service.api.operations) {
  9785. return;
  9786. }
  9787. var rules = req.service.api.operations[req.operation].input;
  9788. var validation = req.service.config.paramValidation;
  9789. new AWS.ParamValidator(validation).validate(rules, req.params);
  9790. });
  9791. addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) {
  9792. req.haltHandlersOnError();
  9793. if (!req.service.api.operations) {
  9794. return;
  9795. }
  9796. var operation = req.service.api.operations[req.operation];
  9797. var authtype = operation ? operation.authtype : '';
  9798. if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none
  9799. if (req.service.getSignerClass(req) === AWS.Signers.V4) {
  9800. var body = req.httpRequest.body || '';
  9801. if (authtype.indexOf('unsigned-body') >= 0) {
  9802. req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD';
  9803. return done();
  9804. }
  9805. AWS.util.computeSha256(body, function(err, sha) {
  9806. if (err) {
  9807. done(err);
  9808. }
  9809. else {
  9810. req.httpRequest.headers['X-Amz-Content-Sha256'] = sha;
  9811. done();
  9812. }
  9813. });
  9814. } else {
  9815. done();
  9816. }
  9817. });
  9818. add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) {
  9819. var authtype = getOperationAuthtype(req);
  9820. var payloadMember = AWS.util.getRequestPayloadShape(req);
  9821. if (req.httpRequest.headers['Content-Length'] === undefined) {
  9822. try {
  9823. var length = AWS.util.string.byteLength(req.httpRequest.body);
  9824. req.httpRequest.headers['Content-Length'] = length;
  9825. } catch (err) {
  9826. if (payloadMember && payloadMember.isStreaming) {
  9827. if (payloadMember.requiresLength) {
  9828. //streaming payload requires length(s3, glacier)
  9829. throw err;
  9830. } else if (authtype.indexOf('unsigned-body') >= 0) {
  9831. //unbounded streaming payload(lex, mediastore)
  9832. req.httpRequest.headers['Transfer-Encoding'] = 'chunked';
  9833. return;
  9834. } else {
  9835. throw err;
  9836. }
  9837. }
  9838. throw err;
  9839. }
  9840. }
  9841. });
  9842. add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) {
  9843. req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host;
  9844. });
  9845. add('RESTART', 'restart', function RESTART() {
  9846. var err = this.response.error;
  9847. if (!err || !err.retryable) return;
  9848. this.httpRequest = new AWS.HttpRequest(
  9849. this.service.endpoint,
  9850. this.service.region
  9851. );
  9852. if (this.response.retryCount < this.service.config.maxRetries) {
  9853. this.response.retryCount++;
  9854. } else {
  9855. this.response.error = null;
  9856. }
  9857. });
  9858. var addToHead = true;
  9859. addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead);
  9860. addAsync('SIGN', 'sign', function SIGN(req, done) {
  9861. var service = req.service;
  9862. var operations = req.service.api.operations || {};
  9863. var operation = operations[req.operation];
  9864. var authtype = operation ? operation.authtype : '';
  9865. if (!service.api.signatureVersion && !authtype && !service.config.signatureVersion) return done(); // none
  9866. service.config.getCredentials(function (err, credentials) {
  9867. if (err) {
  9868. req.response.error = err;
  9869. return done();
  9870. }
  9871. try {
  9872. var date = service.getSkewCorrectedDate();
  9873. var SignerClass = service.getSignerClass(req);
  9874. var signer = new SignerClass(req.httpRequest,
  9875. service.getSigningName(),
  9876. {
  9877. signatureCache: service.config.signatureCache,
  9878. operation: operation,
  9879. signatureVersion: service.api.signatureVersion
  9880. });
  9881. signer.setServiceClientId(service._clientId);
  9882. // clear old authorization headers
  9883. delete req.httpRequest.headers['Authorization'];
  9884. delete req.httpRequest.headers['Date'];
  9885. delete req.httpRequest.headers['X-Amz-Date'];
  9886. // add new authorization
  9887. signer.addAuthorization(credentials, date);
  9888. req.signedAt = date;
  9889. } catch (e) {
  9890. req.response.error = e;
  9891. }
  9892. done();
  9893. });
  9894. });
  9895. add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) {
  9896. if (this.service.successfulResponse(resp, this)) {
  9897. resp.data = {};
  9898. resp.error = null;
  9899. } else {
  9900. resp.data = null;
  9901. resp.error = AWS.util.error(new Error(),
  9902. {code: 'UnknownError', message: 'An unknown error occurred.'});
  9903. }
  9904. });
  9905. addAsync('SEND', 'send', function SEND(resp, done) {
  9906. resp.httpResponse._abortCallback = done;
  9907. resp.error = null;
  9908. resp.data = null;
  9909. function callback(httpResp) {
  9910. resp.httpResponse.stream = httpResp;
  9911. var stream = resp.request.httpRequest.stream;
  9912. var service = resp.request.service;
  9913. var api = service.api;
  9914. var operationName = resp.request.operation;
  9915. var operation = api.operations[operationName] || {};
  9916. httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) {
  9917. resp.request.emit(
  9918. 'httpHeaders',
  9919. [statusCode, headers, resp, statusMessage]
  9920. );
  9921. if (!resp.httpResponse.streaming) {
  9922. if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check
  9923. // if we detect event streams, we're going to have to
  9924. // return the stream immediately
  9925. if (operation.hasEventOutput && service.successfulResponse(resp)) {
  9926. // skip reading the IncomingStream
  9927. resp.request.emit('httpDone');
  9928. done();
  9929. return;
  9930. }
  9931. httpResp.on('readable', function onReadable() {
  9932. var data = httpResp.read();
  9933. if (data !== null) {
  9934. resp.request.emit('httpData', [data, resp]);
  9935. }
  9936. });
  9937. } else { // legacy streams API
  9938. httpResp.on('data', function onData(data) {
  9939. resp.request.emit('httpData', [data, resp]);
  9940. });
  9941. }
  9942. }
  9943. });
  9944. httpResp.on('end', function onEnd() {
  9945. if (!stream || !stream.didCallback) {
  9946. if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) {
  9947. // don't concatenate response chunks when streaming event stream data when response is successful
  9948. return;
  9949. }
  9950. resp.request.emit('httpDone');
  9951. done();
  9952. }
  9953. });
  9954. }
  9955. function progress(httpResp) {
  9956. httpResp.on('sendProgress', function onSendProgress(value) {
  9957. resp.request.emit('httpUploadProgress', [value, resp]);
  9958. });
  9959. httpResp.on('receiveProgress', function onReceiveProgress(value) {
  9960. resp.request.emit('httpDownloadProgress', [value, resp]);
  9961. });
  9962. }
  9963. function error(err) {
  9964. if (err.code !== 'RequestAbortedError') {
  9965. var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError';
  9966. err = AWS.util.error(err, {
  9967. code: errCode,
  9968. region: resp.request.httpRequest.region,
  9969. hostname: resp.request.httpRequest.endpoint.hostname,
  9970. retryable: true
  9971. });
  9972. }
  9973. resp.error = err;
  9974. resp.request.emit('httpError', [resp.error, resp], function() {
  9975. done();
  9976. });
  9977. }
  9978. function executeSend() {
  9979. var http = AWS.HttpClient.getInstance();
  9980. var httpOptions = resp.request.service.config.httpOptions || {};
  9981. try {
  9982. var stream = http.handleRequest(resp.request.httpRequest, httpOptions,
  9983. callback, error);
  9984. progress(stream);
  9985. } catch (err) {
  9986. error(err);
  9987. }
  9988. }
  9989. var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000;
  9990. if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign
  9991. this.emit('sign', [this], function(err) {
  9992. if (err) done(err);
  9993. else executeSend();
  9994. });
  9995. } else {
  9996. executeSend();
  9997. }
  9998. });
  9999. add('HTTP_HEADERS', 'httpHeaders',
  10000. function HTTP_HEADERS(statusCode, headers, resp, statusMessage) {
  10001. resp.httpResponse.statusCode = statusCode;
  10002. resp.httpResponse.statusMessage = statusMessage;
  10003. resp.httpResponse.headers = headers;
  10004. resp.httpResponse.body = AWS.util.buffer.toBuffer('');
  10005. resp.httpResponse.buffers = [];
  10006. resp.httpResponse.numBytes = 0;
  10007. var dateHeader = headers.date || headers.Date;
  10008. var service = resp.request.service;
  10009. if (dateHeader) {
  10010. var serverTime = Date.parse(dateHeader);
  10011. if (service.config.correctClockSkew
  10012. && service.isClockSkewed(serverTime)) {
  10013. service.applyClockOffset(serverTime);
  10014. }
  10015. }
  10016. });
  10017. add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) {
  10018. if (chunk) {
  10019. if (AWS.util.isNode()) {
  10020. resp.httpResponse.numBytes += chunk.length;
  10021. var total = resp.httpResponse.headers['content-length'];
  10022. var progress = { loaded: resp.httpResponse.numBytes, total: total };
  10023. resp.request.emit('httpDownloadProgress', [progress, resp]);
  10024. }
  10025. resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk));
  10026. }
  10027. });
  10028. add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) {
  10029. // convert buffers array into single buffer
  10030. if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) {
  10031. var body = AWS.util.buffer.concat(resp.httpResponse.buffers);
  10032. resp.httpResponse.body = body;
  10033. }
  10034. delete resp.httpResponse.numBytes;
  10035. delete resp.httpResponse.buffers;
  10036. });
  10037. add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) {
  10038. if (resp.httpResponse.statusCode) {
  10039. resp.error.statusCode = resp.httpResponse.statusCode;
  10040. if (resp.error.retryable === undefined) {
  10041. resp.error.retryable = this.service.retryableError(resp.error, this);
  10042. }
  10043. }
  10044. });
  10045. add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) {
  10046. if (!resp.error) return;
  10047. switch (resp.error.code) {
  10048. case 'RequestExpired': // EC2 only
  10049. case 'ExpiredTokenException':
  10050. case 'ExpiredToken':
  10051. resp.error.retryable = true;
  10052. resp.request.service.config.credentials.expired = true;
  10053. }
  10054. });
  10055. add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) {
  10056. var err = resp.error;
  10057. if (!err) return;
  10058. if (typeof err.code === 'string' && typeof err.message === 'string') {
  10059. if (err.code.match(/Signature/) && err.message.match(/expired/)) {
  10060. resp.error.retryable = true;
  10061. }
  10062. }
  10063. });
  10064. add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) {
  10065. if (!resp.error) return;
  10066. if (this.service.clockSkewError(resp.error)
  10067. && this.service.config.correctClockSkew) {
  10068. resp.error.retryable = true;
  10069. }
  10070. });
  10071. add('REDIRECT', 'retry', function REDIRECT(resp) {
  10072. if (resp.error && resp.error.statusCode >= 300 &&
  10073. resp.error.statusCode < 400 && resp.httpResponse.headers['location']) {
  10074. this.httpRequest.endpoint =
  10075. new AWS.Endpoint(resp.httpResponse.headers['location']);
  10076. this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host;
  10077. resp.error.redirect = true;
  10078. resp.error.retryable = true;
  10079. }
  10080. });
  10081. add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) {
  10082. if (resp.error) {
  10083. if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {
  10084. resp.error.retryDelay = 0;
  10085. } else if (resp.retryCount < resp.maxRetries) {
  10086. resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0;
  10087. }
  10088. }
  10089. });
  10090. addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) {
  10091. var delay, willRetry = false;
  10092. if (resp.error) {
  10093. delay = resp.error.retryDelay || 0;
  10094. if (resp.error.retryable && resp.retryCount < resp.maxRetries) {
  10095. resp.retryCount++;
  10096. willRetry = true;
  10097. } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {
  10098. resp.redirectCount++;
  10099. willRetry = true;
  10100. }
  10101. }
  10102. // delay < 0 is a signal from customBackoff to skip retries
  10103. if (willRetry && delay >= 0) {
  10104. resp.error = null;
  10105. setTimeout(done, delay);
  10106. } else {
  10107. done();
  10108. }
  10109. });
  10110. }),
  10111. CorePost: new SequentialExecutor().addNamedListeners(function(add) {
  10112. add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId);
  10113. add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId);
  10114. add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) {
  10115. function isDNSError(err) {
  10116. return err.errno === 'ENOTFOUND' ||
  10117. typeof err.errno === 'number' &&
  10118. typeof AWS.util.getSystemErrorName === 'function' &&
  10119. ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0);
  10120. }
  10121. if (err.code === 'NetworkingError' && isDNSError(err)) {
  10122. var message = 'Inaccessible host: `' + err.hostname +
  10123. '\'. This service may not be available in the `' + err.region +
  10124. '\' region.';
  10125. this.response.error = AWS.util.error(new Error(message), {
  10126. code: 'UnknownEndpoint',
  10127. region: err.region,
  10128. hostname: err.hostname,
  10129. retryable: true,
  10130. originalError: err
  10131. });
  10132. }
  10133. });
  10134. }),
  10135. Logger: new SequentialExecutor().addNamedListeners(function(add) {
  10136. add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) {
  10137. var req = resp.request;
  10138. var logger = req.service.config.logger;
  10139. if (!logger) return;
  10140. function filterSensitiveLog(inputShape, shape) {
  10141. if (!shape) {
  10142. return shape;
  10143. }
  10144. if (inputShape.isSensitive) {
  10145. return '***SensitiveInformation***';
  10146. }
  10147. switch (inputShape.type) {
  10148. case 'structure':
  10149. var struct = {};
  10150. AWS.util.each(shape, function(subShapeName, subShape) {
  10151. if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) {
  10152. struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape);
  10153. } else {
  10154. struct[subShapeName] = subShape;
  10155. }
  10156. });
  10157. return struct;
  10158. case 'list':
  10159. var list = [];
  10160. AWS.util.arrayEach(shape, function(subShape, index) {
  10161. list.push(filterSensitiveLog(inputShape.member, subShape));
  10162. });
  10163. return list;
  10164. case 'map':
  10165. var map = {};
  10166. AWS.util.each(shape, function(key, value) {
  10167. map[key] = filterSensitiveLog(inputShape.value, value);
  10168. });
  10169. return map;
  10170. default:
  10171. return shape;
  10172. }
  10173. }
  10174. function buildMessage() {
  10175. var time = resp.request.service.getSkewCorrectedDate().getTime();
  10176. var delta = (time - req.startTime.getTime()) / 1000;
  10177. var ansi = logger.isTTY ? true : false;
  10178. var status = resp.httpResponse.statusCode;
  10179. var censoredParams = req.params;
  10180. if (
  10181. req.service.api.operations &&
  10182. req.service.api.operations[req.operation] &&
  10183. req.service.api.operations[req.operation].input
  10184. ) {
  10185. var inputShape = req.service.api.operations[req.operation].input;
  10186. censoredParams = filterSensitiveLog(inputShape, req.params);
  10187. }
  10188. var params = __webpack_require__(669).inspect(censoredParams, true, null);
  10189. var message = '';
  10190. if (ansi) message += '\x1B[33m';
  10191. message += '[AWS ' + req.service.serviceIdentifier + ' ' + status;
  10192. message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]';
  10193. if (ansi) message += '\x1B[0;1m';
  10194. message += ' ' + AWS.util.string.lowerFirst(req.operation);
  10195. message += '(' + params + ')';
  10196. if (ansi) message += '\x1B[0m';
  10197. return message;
  10198. }
  10199. var line = buildMessage();
  10200. if (typeof logger.log === 'function') {
  10201. logger.log(line);
  10202. } else if (typeof logger.write === 'function') {
  10203. logger.write(line + '\n');
  10204. }
  10205. });
  10206. }),
  10207. Json: new SequentialExecutor().addNamedListeners(function(add) {
  10208. var svc = __webpack_require__(912);
  10209. add('BUILD', 'build', svc.buildRequest);
  10210. add('EXTRACT_DATA', 'extractData', svc.extractData);
  10211. add('EXTRACT_ERROR', 'extractError', svc.extractError);
  10212. }),
  10213. Rest: new SequentialExecutor().addNamedListeners(function(add) {
  10214. var svc = __webpack_require__(618);
  10215. add('BUILD', 'build', svc.buildRequest);
  10216. add('EXTRACT_DATA', 'extractData', svc.extractData);
  10217. add('EXTRACT_ERROR', 'extractError', svc.extractError);
  10218. }),
  10219. RestJson: new SequentialExecutor().addNamedListeners(function(add) {
  10220. var svc = __webpack_require__(315);
  10221. add('BUILD', 'build', svc.buildRequest);
  10222. add('EXTRACT_DATA', 'extractData', svc.extractData);
  10223. add('EXTRACT_ERROR', 'extractError', svc.extractError);
  10224. }),
  10225. RestXml: new SequentialExecutor().addNamedListeners(function(add) {
  10226. var svc = __webpack_require__(2);
  10227. add('BUILD', 'build', svc.buildRequest);
  10228. add('EXTRACT_DATA', 'extractData', svc.extractData);
  10229. add('EXTRACT_ERROR', 'extractError', svc.extractError);
  10230. }),
  10231. Query: new SequentialExecutor().addNamedListeners(function(add) {
  10232. var svc = __webpack_require__(576);
  10233. add('BUILD', 'build', svc.buildRequest);
  10234. add('EXTRACT_DATA', 'extractData', svc.extractData);
  10235. add('EXTRACT_ERROR', 'extractError', svc.extractError);
  10236. })
  10237. };
  10238. /***/ }),
  10239. /***/ 608:
  10240. /***/ (function(module) {
  10241. "use strict";
  10242. module.exports = clone
  10243. function clone (obj) {
  10244. if (obj === null || typeof obj !== 'object')
  10245. return obj
  10246. if (obj instanceof Object)
  10247. var copy = { __proto__: obj.__proto__ }
  10248. else
  10249. var copy = Object.create(null)
  10250. Object.getOwnPropertyNames(obj).forEach(function (key) {
  10251. Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
  10252. })
  10253. return copy
  10254. }
  10255. /***/ }),
  10256. /***/ 610:
  10257. /***/ (function(module, __unusedexports, __webpack_require__) {
  10258. var AWS = __webpack_require__(395);
  10259. /**
  10260. * @api private
  10261. * @!method on(eventName, callback)
  10262. * Registers an event listener callback for the event given by `eventName`.
  10263. * Parameters passed to the callback function depend on the individual event
  10264. * being triggered. See the event documentation for those parameters.
  10265. *
  10266. * @param eventName [String] the event name to register the listener for
  10267. * @param callback [Function] the listener callback function
  10268. * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true.
  10269. * Default to be false.
  10270. * @return [AWS.SequentialExecutor] the same object for chaining
  10271. */
  10272. AWS.SequentialExecutor = AWS.util.inherit({
  10273. constructor: function SequentialExecutor() {
  10274. this._events = {};
  10275. },
  10276. /**
  10277. * @api private
  10278. */
  10279. listeners: function listeners(eventName) {
  10280. return this._events[eventName] ? this._events[eventName].slice(0) : [];
  10281. },
  10282. on: function on(eventName, listener, toHead) {
  10283. if (this._events[eventName]) {
  10284. toHead ?
  10285. this._events[eventName].unshift(listener) :
  10286. this._events[eventName].push(listener);
  10287. } else {
  10288. this._events[eventName] = [listener];
  10289. }
  10290. return this;
  10291. },
  10292. onAsync: function onAsync(eventName, listener, toHead) {
  10293. listener._isAsync = true;
  10294. return this.on(eventName, listener, toHead);
  10295. },
  10296. removeListener: function removeListener(eventName, listener) {
  10297. var listeners = this._events[eventName];
  10298. if (listeners) {
  10299. var length = listeners.length;
  10300. var position = -1;
  10301. for (var i = 0; i < length; ++i) {
  10302. if (listeners[i] === listener) {
  10303. position = i;
  10304. }
  10305. }
  10306. if (position > -1) {
  10307. listeners.splice(position, 1);
  10308. }
  10309. }
  10310. return this;
  10311. },
  10312. removeAllListeners: function removeAllListeners(eventName) {
  10313. if (eventName) {
  10314. delete this._events[eventName];
  10315. } else {
  10316. this._events = {};
  10317. }
  10318. return this;
  10319. },
  10320. /**
  10321. * @api private
  10322. */
  10323. emit: function emit(eventName, eventArgs, doneCallback) {
  10324. if (!doneCallback) doneCallback = function() { };
  10325. var listeners = this.listeners(eventName);
  10326. var count = listeners.length;
  10327. this.callListeners(listeners, eventArgs, doneCallback);
  10328. return count > 0;
  10329. },
  10330. /**
  10331. * @api private
  10332. */
  10333. callListeners: function callListeners(listeners, args, doneCallback, prevError) {
  10334. var self = this;
  10335. var error = prevError || null;
  10336. function callNextListener(err) {
  10337. if (err) {
  10338. error = AWS.util.error(error || new Error(), err);
  10339. if (self._haltHandlersOnError) {
  10340. return doneCallback.call(self, error);
  10341. }
  10342. }
  10343. self.callListeners(listeners, args, doneCallback, error);
  10344. }
  10345. while (listeners.length > 0) {
  10346. var listener = listeners.shift();
  10347. if (listener._isAsync) { // asynchronous listener
  10348. listener.apply(self, args.concat([callNextListener]));
  10349. return; // stop here, callNextListener will continue
  10350. } else { // synchronous listener
  10351. try {
  10352. listener.apply(self, args);
  10353. } catch (err) {
  10354. error = AWS.util.error(error || new Error(), err);
  10355. }
  10356. if (error && self._haltHandlersOnError) {
  10357. doneCallback.call(self, error);
  10358. return;
  10359. }
  10360. }
  10361. }
  10362. doneCallback.call(self, error);
  10363. },
  10364. /**
  10365. * Adds or copies a set of listeners from another list of
  10366. * listeners or SequentialExecutor object.
  10367. *
  10368. * @param listeners [map<String,Array<Function>>, AWS.SequentialExecutor]
  10369. * a list of events and callbacks, or an event emitter object
  10370. * containing listeners to add to this emitter object.
  10371. * @return [AWS.SequentialExecutor] the emitter object, for chaining.
  10372. * @example Adding listeners from a map of listeners
  10373. * emitter.addListeners({
  10374. * event1: [function() { ... }, function() { ... }],
  10375. * event2: [function() { ... }]
  10376. * });
  10377. * emitter.emit('event1'); // emitter has event1
  10378. * emitter.emit('event2'); // emitter has event2
  10379. * @example Adding listeners from another emitter object
  10380. * var emitter1 = new AWS.SequentialExecutor();
  10381. * emitter1.on('event1', function() { ... });
  10382. * emitter1.on('event2', function() { ... });
  10383. * var emitter2 = new AWS.SequentialExecutor();
  10384. * emitter2.addListeners(emitter1);
  10385. * emitter2.emit('event1'); // emitter2 has event1
  10386. * emitter2.emit('event2'); // emitter2 has event2
  10387. */
  10388. addListeners: function addListeners(listeners) {
  10389. var self = this;
  10390. // extract listeners if parameter is an SequentialExecutor object
  10391. if (listeners._events) listeners = listeners._events;
  10392. AWS.util.each(listeners, function(event, callbacks) {
  10393. if (typeof callbacks === 'function') callbacks = [callbacks];
  10394. AWS.util.arrayEach(callbacks, function(callback) {
  10395. self.on(event, callback);
  10396. });
  10397. });
  10398. return self;
  10399. },
  10400. /**
  10401. * Registers an event with {on} and saves the callback handle function
  10402. * as a property on the emitter object using a given `name`.
  10403. *
  10404. * @param name [String] the property name to set on this object containing
  10405. * the callback function handle so that the listener can be removed in
  10406. * the future.
  10407. * @param (see on)
  10408. * @return (see on)
  10409. * @example Adding a named listener DATA_CALLBACK
  10410. * var listener = function() { doSomething(); };
  10411. * emitter.addNamedListener('DATA_CALLBACK', 'data', listener);
  10412. *
  10413. * // the following prints: true
  10414. * console.log(emitter.DATA_CALLBACK == listener);
  10415. */
  10416. addNamedListener: function addNamedListener(name, eventName, callback, toHead) {
  10417. this[name] = callback;
  10418. this.addListener(eventName, callback, toHead);
  10419. return this;
  10420. },
  10421. /**
  10422. * @api private
  10423. */
  10424. addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) {
  10425. callback._isAsync = true;
  10426. return this.addNamedListener(name, eventName, callback, toHead);
  10427. },
  10428. /**
  10429. * Helper method to add a set of named listeners using
  10430. * {addNamedListener}. The callback contains a parameter
  10431. * with a handle to the `addNamedListener` method.
  10432. *
  10433. * @callback callback function(add)
  10434. * The callback function is called immediately in order to provide
  10435. * the `add` function to the block. This simplifies the addition of
  10436. * a large group of named listeners.
  10437. * @param add [Function] the {addNamedListener} function to call
  10438. * when registering listeners.
  10439. * @example Adding a set of named listeners
  10440. * emitter.addNamedListeners(function(add) {
  10441. * add('DATA_CALLBACK', 'data', function() { ... });
  10442. * add('OTHER', 'otherEvent', function() { ... });
  10443. * add('LAST', 'lastEvent', function() { ... });
  10444. * });
  10445. *
  10446. * // these properties are now set:
  10447. * emitter.DATA_CALLBACK;
  10448. * emitter.OTHER;
  10449. * emitter.LAST;
  10450. */
  10451. addNamedListeners: function addNamedListeners(callback) {
  10452. var self = this;
  10453. callback(
  10454. function() {
  10455. self.addNamedListener.apply(self, arguments);
  10456. },
  10457. function() {
  10458. self.addNamedAsyncListener.apply(self, arguments);
  10459. }
  10460. );
  10461. return this;
  10462. }
  10463. });
  10464. /**
  10465. * {on} is the prefered method.
  10466. * @api private
  10467. */
  10468. AWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on;
  10469. /**
  10470. * @api private
  10471. */
  10472. module.exports = AWS.SequentialExecutor;
  10473. /***/ }),
  10474. /***/ 614:
  10475. /***/ (function(module) {
  10476. module.exports = require("events");
  10477. /***/ }),
  10478. /***/ 616:
  10479. /***/ (function(module, __unusedexports, __webpack_require__) {
  10480. var AWS = __webpack_require__(395);
  10481. var inherit = AWS.util.inherit;
  10482. /**
  10483. * @api private
  10484. */
  10485. AWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, {
  10486. /**
  10487. * When building the stringToSign, these sub resource params should be
  10488. * part of the canonical resource string with their NON-decoded values
  10489. */
  10490. subResources: {
  10491. 'acl': 1,
  10492. 'accelerate': 1,
  10493. 'analytics': 1,
  10494. 'cors': 1,
  10495. 'lifecycle': 1,
  10496. 'delete': 1,
  10497. 'inventory': 1,
  10498. 'location': 1,
  10499. 'logging': 1,
  10500. 'metrics': 1,
  10501. 'notification': 1,
  10502. 'partNumber': 1,
  10503. 'policy': 1,
  10504. 'requestPayment': 1,
  10505. 'replication': 1,
  10506. 'restore': 1,
  10507. 'tagging': 1,
  10508. 'torrent': 1,
  10509. 'uploadId': 1,
  10510. 'uploads': 1,
  10511. 'versionId': 1,
  10512. 'versioning': 1,
  10513. 'versions': 1,
  10514. 'website': 1
  10515. },
  10516. // when building the stringToSign, these querystring params should be
  10517. // part of the canonical resource string with their NON-encoded values
  10518. responseHeaders: {
  10519. 'response-content-type': 1,
  10520. 'response-content-language': 1,
  10521. 'response-expires': 1,
  10522. 'response-cache-control': 1,
  10523. 'response-content-disposition': 1,
  10524. 'response-content-encoding': 1
  10525. },
  10526. addAuthorization: function addAuthorization(credentials, date) {
  10527. if (!this.request.headers['presigned-expires']) {
  10528. this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date);
  10529. }
  10530. if (credentials.sessionToken) {
  10531. // presigned URLs require this header to be lowercased
  10532. this.request.headers['x-amz-security-token'] = credentials.sessionToken;
  10533. }
  10534. var signature = this.sign(credentials.secretAccessKey, this.stringToSign());
  10535. var auth = 'AWS ' + credentials.accessKeyId + ':' + signature;
  10536. this.request.headers['Authorization'] = auth;
  10537. },
  10538. stringToSign: function stringToSign() {
  10539. var r = this.request;
  10540. var parts = [];
  10541. parts.push(r.method);
  10542. parts.push(r.headers['Content-MD5'] || '');
  10543. parts.push(r.headers['Content-Type'] || '');
  10544. // This is the "Date" header, but we use X-Amz-Date.
  10545. // The S3 signing mechanism requires us to pass an empty
  10546. // string for this Date header regardless.
  10547. parts.push(r.headers['presigned-expires'] || '');
  10548. var headers = this.canonicalizedAmzHeaders();
  10549. if (headers) parts.push(headers);
  10550. parts.push(this.canonicalizedResource());
  10551. return parts.join('\n');
  10552. },
  10553. canonicalizedAmzHeaders: function canonicalizedAmzHeaders() {
  10554. var amzHeaders = [];
  10555. AWS.util.each(this.request.headers, function (name) {
  10556. if (name.match(/^x-amz-/i))
  10557. amzHeaders.push(name);
  10558. });
  10559. amzHeaders.sort(function (a, b) {
  10560. return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
  10561. });
  10562. var parts = [];
  10563. AWS.util.arrayEach.call(this, amzHeaders, function (name) {
  10564. parts.push(name.toLowerCase() + ':' + String(this.request.headers[name]));
  10565. });
  10566. return parts.join('\n');
  10567. },
  10568. canonicalizedResource: function canonicalizedResource() {
  10569. var r = this.request;
  10570. var parts = r.path.split('?');
  10571. var path = parts[0];
  10572. var querystring = parts[1];
  10573. var resource = '';
  10574. if (r.virtualHostedBucket)
  10575. resource += '/' + r.virtualHostedBucket;
  10576. resource += path;
  10577. if (querystring) {
  10578. // collect a list of sub resources and query params that need to be signed
  10579. var resources = [];
  10580. AWS.util.arrayEach.call(this, querystring.split('&'), function (param) {
  10581. var name = param.split('=')[0];
  10582. var value = param.split('=')[1];
  10583. if (this.subResources[name] || this.responseHeaders[name]) {
  10584. var subresource = { name: name };
  10585. if (value !== undefined) {
  10586. if (this.subResources[name]) {
  10587. subresource.value = value;
  10588. } else {
  10589. subresource.value = decodeURIComponent(value);
  10590. }
  10591. }
  10592. resources.push(subresource);
  10593. }
  10594. });
  10595. resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; });
  10596. if (resources.length) {
  10597. querystring = [];
  10598. AWS.util.arrayEach(resources, function (res) {
  10599. if (res.value === undefined) {
  10600. querystring.push(res.name);
  10601. } else {
  10602. querystring.push(res.name + '=' + res.value);
  10603. }
  10604. });
  10605. resource += '?' + querystring.join('&');
  10606. }
  10607. }
  10608. return resource;
  10609. },
  10610. sign: function sign(secret, string) {
  10611. return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1');
  10612. }
  10613. });
  10614. /**
  10615. * @api private
  10616. */
  10617. module.exports = AWS.Signers.S3;
  10618. /***/ }),
  10619. /***/ 618:
  10620. /***/ (function(module, __unusedexports, __webpack_require__) {
  10621. var util = __webpack_require__(153);
  10622. var populateHostPrefix = __webpack_require__(904).populateHostPrefix;
  10623. function populateMethod(req) {
  10624. req.httpRequest.method = req.service.api.operations[req.operation].httpMethod;
  10625. }
  10626. function generateURI(endpointPath, operationPath, input, params) {
  10627. var uri = [endpointPath, operationPath].join('/');
  10628. uri = uri.replace(/\/+/g, '/');
  10629. var queryString = {}, queryStringSet = false;
  10630. util.each(input.members, function (name, member) {
  10631. var paramValue = params[name];
  10632. if (paramValue === null || paramValue === undefined) return;
  10633. if (member.location === 'uri') {
  10634. var regex = new RegExp('\\{' + member.name + '(\\+)?\\}');
  10635. uri = uri.replace(regex, function(_, plus) {
  10636. var fn = plus ? util.uriEscapePath : util.uriEscape;
  10637. return fn(String(paramValue));
  10638. });
  10639. } else if (member.location === 'querystring') {
  10640. queryStringSet = true;
  10641. if (member.type === 'list') {
  10642. queryString[member.name] = paramValue.map(function(val) {
  10643. return util.uriEscape(member.member.toWireFormat(val).toString());
  10644. });
  10645. } else if (member.type === 'map') {
  10646. util.each(paramValue, function(key, value) {
  10647. if (Array.isArray(value)) {
  10648. queryString[key] = value.map(function(val) {
  10649. return util.uriEscape(String(val));
  10650. });
  10651. } else {
  10652. queryString[key] = util.uriEscape(String(value));
  10653. }
  10654. });
  10655. } else {
  10656. queryString[member.name] = util.uriEscape(member.toWireFormat(paramValue).toString());
  10657. }
  10658. }
  10659. });
  10660. if (queryStringSet) {
  10661. uri += (uri.indexOf('?') >= 0 ? '&' : '?');
  10662. var parts = [];
  10663. util.arrayEach(Object.keys(queryString).sort(), function(key) {
  10664. if (!Array.isArray(queryString[key])) {
  10665. queryString[key] = [queryString[key]];
  10666. }
  10667. for (var i = 0; i < queryString[key].length; i++) {
  10668. parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]);
  10669. }
  10670. });
  10671. uri += parts.join('&');
  10672. }
  10673. return uri;
  10674. }
  10675. function populateURI(req) {
  10676. var operation = req.service.api.operations[req.operation];
  10677. var input = operation.input;
  10678. var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params);
  10679. req.httpRequest.path = uri;
  10680. }
  10681. function populateHeaders(req) {
  10682. var operation = req.service.api.operations[req.operation];
  10683. util.each(operation.input.members, function (name, member) {
  10684. var value = req.params[name];
  10685. if (value === null || value === undefined) return;
  10686. if (member.location === 'headers' && member.type === 'map') {
  10687. util.each(value, function(key, memberValue) {
  10688. req.httpRequest.headers[member.name + key] = memberValue;
  10689. });
  10690. } else if (member.location === 'header') {
  10691. value = member.toWireFormat(value).toString();
  10692. if (member.isJsonValue) {
  10693. value = util.base64.encode(value);
  10694. }
  10695. req.httpRequest.headers[member.name] = value;
  10696. }
  10697. });
  10698. }
  10699. function buildRequest(req) {
  10700. populateMethod(req);
  10701. populateURI(req);
  10702. populateHeaders(req);
  10703. populateHostPrefix(req);
  10704. }
  10705. function extractError() {
  10706. }
  10707. function extractData(resp) {
  10708. var req = resp.request;
  10709. var data = {};
  10710. var r = resp.httpResponse;
  10711. var operation = req.service.api.operations[req.operation];
  10712. var output = operation.output;
  10713. // normalize headers names to lower-cased keys for matching
  10714. var headers = {};
  10715. util.each(r.headers, function (k, v) {
  10716. headers[k.toLowerCase()] = v;
  10717. });
  10718. util.each(output.members, function(name, member) {
  10719. var header = (member.name || name).toLowerCase();
  10720. if (member.location === 'headers' && member.type === 'map') {
  10721. data[name] = {};
  10722. var location = member.isLocationName ? member.name : '';
  10723. var pattern = new RegExp('^' + location + '(.+)', 'i');
  10724. util.each(r.headers, function (k, v) {
  10725. var result = k.match(pattern);
  10726. if (result !== null) {
  10727. data[name][result[1]] = v;
  10728. }
  10729. });
  10730. } else if (member.location === 'header') {
  10731. if (headers[header] !== undefined) {
  10732. var value = member.isJsonValue ?
  10733. util.base64.decode(headers[header]) :
  10734. headers[header];
  10735. data[name] = member.toType(value);
  10736. }
  10737. } else if (member.location === 'statusCode') {
  10738. data[name] = parseInt(r.statusCode, 10);
  10739. }
  10740. });
  10741. resp.data = data;
  10742. }
  10743. /**
  10744. * @api private
  10745. */
  10746. module.exports = {
  10747. buildRequest: buildRequest,
  10748. extractError: extractError,
  10749. extractData: extractData,
  10750. generateURI: generateURI
  10751. };
  10752. /***/ }),
  10753. /***/ 619:
  10754. /***/ (function(module) {
  10755. module.exports = require("constants");
  10756. /***/ }),
  10757. /***/ 622:
  10758. /***/ (function(module) {
  10759. module.exports = require("path");
  10760. /***/ }),
  10761. /***/ 624:
  10762. /***/ (function(module, __unusedexports, __webpack_require__) {
  10763. var util = __webpack_require__(153);
  10764. var property = util.property;
  10765. function ResourceWaiter(name, waiter, options) {
  10766. options = options || {};
  10767. property(this, 'name', name);
  10768. property(this, 'api', options.api, false);
  10769. if (waiter.operation) {
  10770. property(this, 'operation', util.string.lowerFirst(waiter.operation));
  10771. }
  10772. var self = this;
  10773. var keys = [
  10774. 'type',
  10775. 'description',
  10776. 'delay',
  10777. 'maxAttempts',
  10778. 'acceptors'
  10779. ];
  10780. keys.forEach(function(key) {
  10781. var value = waiter[key];
  10782. if (value) {
  10783. property(self, key, value);
  10784. }
  10785. });
  10786. }
  10787. /**
  10788. * @api private
  10789. */
  10790. module.exports = ResourceWaiter;
  10791. /***/ }),
  10792. /***/ 625:
  10793. /***/ (function(module) {
  10794. /**
  10795. * Takes in a buffer of event messages and splits them into individual messages.
  10796. * @param {Buffer} buffer
  10797. * @api private
  10798. */
  10799. function eventMessageChunker(buffer) {
  10800. /** @type Buffer[] */
  10801. var messages = [];
  10802. var offset = 0;
  10803. while (offset < buffer.length) {
  10804. var totalLength = buffer.readInt32BE(offset);
  10805. // create new buffer for individual message (shares memory with original)
  10806. var message = buffer.slice(offset, totalLength + offset);
  10807. // increment offset to it starts at the next message
  10808. offset += totalLength;
  10809. messages.push(message);
  10810. }
  10811. return messages;
  10812. }
  10813. /**
  10814. * @api private
  10815. */
  10816. module.exports = {
  10817. eventMessageChunker: eventMessageChunker
  10818. };
  10819. /***/ }),
  10820. /***/ 629:
  10821. /***/ (function(__unusedmodule, exports) {
  10822. "use strict";
  10823. Object.defineProperty(exports, "__esModule", { value: true });
  10824. var LinkedListNode = /** @class */ (function () {
  10825. function LinkedListNode(key, value) {
  10826. this.key = key;
  10827. this.value = value;
  10828. }
  10829. return LinkedListNode;
  10830. }());
  10831. var LRUCache = /** @class */ (function () {
  10832. function LRUCache(size) {
  10833. this.nodeMap = {};
  10834. this.size = 0;
  10835. if (typeof size !== 'number' || size < 1) {
  10836. throw new Error('Cache size can only be positive number');
  10837. }
  10838. this.sizeLimit = size;
  10839. }
  10840. Object.defineProperty(LRUCache.prototype, "length", {
  10841. get: function () {
  10842. return this.size;
  10843. },
  10844. enumerable: true,
  10845. configurable: true
  10846. });
  10847. LRUCache.prototype.prependToList = function (node) {
  10848. if (!this.headerNode) {
  10849. this.tailNode = node;
  10850. }
  10851. else {
  10852. this.headerNode.prev = node;
  10853. node.next = this.headerNode;
  10854. }
  10855. this.headerNode = node;
  10856. this.size++;
  10857. };
  10858. LRUCache.prototype.removeFromTail = function () {
  10859. if (!this.tailNode) {
  10860. return undefined;
  10861. }
  10862. var node = this.tailNode;
  10863. var prevNode = node.prev;
  10864. if (prevNode) {
  10865. prevNode.next = undefined;
  10866. }
  10867. node.prev = undefined;
  10868. this.tailNode = prevNode;
  10869. this.size--;
  10870. return node;
  10871. };
  10872. LRUCache.prototype.detachFromList = function (node) {
  10873. if (this.headerNode === node) {
  10874. this.headerNode = node.next;
  10875. }
  10876. if (this.tailNode === node) {
  10877. this.tailNode = node.prev;
  10878. }
  10879. if (node.prev) {
  10880. node.prev.next = node.next;
  10881. }
  10882. if (node.next) {
  10883. node.next.prev = node.prev;
  10884. }
  10885. node.next = undefined;
  10886. node.prev = undefined;
  10887. this.size--;
  10888. };
  10889. LRUCache.prototype.get = function (key) {
  10890. if (this.nodeMap[key]) {
  10891. var node = this.nodeMap[key];
  10892. this.detachFromList(node);
  10893. this.prependToList(node);
  10894. return node.value;
  10895. }
  10896. };
  10897. LRUCache.prototype.remove = function (key) {
  10898. if (this.nodeMap[key]) {
  10899. var node = this.nodeMap[key];
  10900. this.detachFromList(node);
  10901. delete this.nodeMap[key];
  10902. }
  10903. };
  10904. LRUCache.prototype.put = function (key, value) {
  10905. if (this.nodeMap[key]) {
  10906. this.remove(key);
  10907. }
  10908. else if (this.size === this.sizeLimit) {
  10909. var tailNode = this.removeFromTail();
  10910. var key_1 = tailNode.key;
  10911. delete this.nodeMap[key_1];
  10912. }
  10913. var newNode = new LinkedListNode(key, value);
  10914. this.nodeMap[key] = newNode;
  10915. this.prependToList(newNode);
  10916. };
  10917. LRUCache.prototype.empty = function () {
  10918. var keys = Object.keys(this.nodeMap);
  10919. for (var i = 0; i < keys.length; i++) {
  10920. var key = keys[i];
  10921. var node = this.nodeMap[key];
  10922. this.detachFromList(node);
  10923. delete this.nodeMap[key];
  10924. }
  10925. };
  10926. return LRUCache;
  10927. }());
  10928. exports.LRUCache = LRUCache;
  10929. /***/ }),
  10930. /***/ 634:
  10931. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  10932. var AWS = __webpack_require__(395);
  10933. /**
  10934. * Represents credentials from a JSON file on disk.
  10935. * If the credentials expire, the SDK can {refresh} the credentials
  10936. * from the file.
  10937. *
  10938. * The format of the file should be similar to the options passed to
  10939. * {AWS.Config}:
  10940. *
  10941. * ```javascript
  10942. * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'}
  10943. * ```
  10944. *
  10945. * @example Loading credentials from disk
  10946. * var creds = new AWS.FileSystemCredentials('./configuration.json');
  10947. * creds.accessKeyId == 'AKID'
  10948. *
  10949. * @!attribute filename
  10950. * @readonly
  10951. * @return [String] the path to the JSON file on disk containing the
  10952. * credentials.
  10953. * @!macro nobrowser
  10954. */
  10955. AWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, {
  10956. /**
  10957. * @overload AWS.FileSystemCredentials(filename)
  10958. * Creates a new FileSystemCredentials object from a filename
  10959. *
  10960. * @param filename [String] the path on disk to the JSON file to load.
  10961. */
  10962. constructor: function FileSystemCredentials(filename) {
  10963. AWS.Credentials.call(this);
  10964. this.filename = filename;
  10965. this.get(function() {});
  10966. },
  10967. /**
  10968. * Loads the credentials from the {filename} on disk.
  10969. *
  10970. * @callback callback function(err)
  10971. * Called after the JSON file on disk is read and parsed. When this callback
  10972. * is called with no error, it means that the credentials information
  10973. * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`,
  10974. * and `sessionToken` properties).
  10975. * @param err [Error] if an error occurred, this value will be filled
  10976. * @see get
  10977. */
  10978. refresh: function refresh(callback) {
  10979. if (!callback) callback = AWS.util.fn.callback;
  10980. try {
  10981. var creds = JSON.parse(AWS.util.readFileSync(this.filename));
  10982. AWS.Credentials.call(this, creds);
  10983. if (!this.accessKeyId || !this.secretAccessKey) {
  10984. throw AWS.util.error(
  10985. new Error('Credentials not set in ' + this.filename),
  10986. { code: 'FileSystemCredentialsProviderFailure' }
  10987. );
  10988. }
  10989. this.expired = false;
  10990. callback();
  10991. } catch (err) {
  10992. callback(err);
  10993. }
  10994. }
  10995. });
  10996. /***/ }),
  10997. /***/ 645:
  10998. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10999. ;(function (sax) { // wrapper for non-node envs
  11000. sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
  11001. sax.SAXParser = SAXParser
  11002. sax.SAXStream = SAXStream
  11003. sax.createStream = createStream
  11004. // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
  11005. // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
  11006. // since that's the earliest that a buffer overrun could occur. This way, checks are
  11007. // as rare as required, but as often as necessary to ensure never crossing this bound.
  11008. // Furthermore, buffers are only tested at most once per write(), so passing a very
  11009. // large string into write() might have undesirable effects, but this is manageable by
  11010. // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
  11011. // edge case, result in creating at most one complete copy of the string passed in.
  11012. // Set to Infinity to have unlimited buffers.
  11013. sax.MAX_BUFFER_LENGTH = 64 * 1024
  11014. var buffers = [
  11015. 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
  11016. 'procInstName', 'procInstBody', 'entity', 'attribName',
  11017. 'attribValue', 'cdata', 'script'
  11018. ]
  11019. sax.EVENTS = [
  11020. 'text',
  11021. 'processinginstruction',
  11022. 'sgmldeclaration',
  11023. 'doctype',
  11024. 'comment',
  11025. 'opentagstart',
  11026. 'attribute',
  11027. 'opentag',
  11028. 'closetag',
  11029. 'opencdata',
  11030. 'cdata',
  11031. 'closecdata',
  11032. 'error',
  11033. 'end',
  11034. 'ready',
  11035. 'script',
  11036. 'opennamespace',
  11037. 'closenamespace'
  11038. ]
  11039. function SAXParser (strict, opt) {
  11040. if (!(this instanceof SAXParser)) {
  11041. return new SAXParser(strict, opt)
  11042. }
  11043. var parser = this
  11044. clearBuffers(parser)
  11045. parser.q = parser.c = ''
  11046. parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
  11047. parser.opt = opt || {}
  11048. parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
  11049. parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
  11050. parser.tags = []
  11051. parser.closed = parser.closedRoot = parser.sawRoot = false
  11052. parser.tag = parser.error = null
  11053. parser.strict = !!strict
  11054. parser.noscript = !!(strict || parser.opt.noscript)
  11055. parser.state = S.BEGIN
  11056. parser.strictEntities = parser.opt.strictEntities
  11057. parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
  11058. parser.attribList = []
  11059. // namespaces form a prototype chain.
  11060. // it always points at the current tag,
  11061. // which protos to its parent tag.
  11062. if (parser.opt.xmlns) {
  11063. parser.ns = Object.create(rootNS)
  11064. }
  11065. // mostly just for error reporting
  11066. parser.trackPosition = parser.opt.position !== false
  11067. if (parser.trackPosition) {
  11068. parser.position = parser.line = parser.column = 0
  11069. }
  11070. emit(parser, 'onready')
  11071. }
  11072. if (!Object.create) {
  11073. Object.create = function (o) {
  11074. function F () {}
  11075. F.prototype = o
  11076. var newf = new F()
  11077. return newf
  11078. }
  11079. }
  11080. if (!Object.keys) {
  11081. Object.keys = function (o) {
  11082. var a = []
  11083. for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
  11084. return a
  11085. }
  11086. }
  11087. function checkBufferLength (parser) {
  11088. var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
  11089. var maxActual = 0
  11090. for (var i = 0, l = buffers.length; i < l; i++) {
  11091. var len = parser[buffers[i]].length
  11092. if (len > maxAllowed) {
  11093. // Text/cdata nodes can get big, and since they're buffered,
  11094. // we can get here under normal conditions.
  11095. // Avoid issues by emitting the text node now,
  11096. // so at least it won't get any bigger.
  11097. switch (buffers[i]) {
  11098. case 'textNode':
  11099. closeText(parser)
  11100. break
  11101. case 'cdata':
  11102. emitNode(parser, 'oncdata', parser.cdata)
  11103. parser.cdata = ''
  11104. break
  11105. case 'script':
  11106. emitNode(parser, 'onscript', parser.script)
  11107. parser.script = ''
  11108. break
  11109. default:
  11110. error(parser, 'Max buffer length exceeded: ' + buffers[i])
  11111. }
  11112. }
  11113. maxActual = Math.max(maxActual, len)
  11114. }
  11115. // schedule the next check for the earliest possible buffer overrun.
  11116. var m = sax.MAX_BUFFER_LENGTH - maxActual
  11117. parser.bufferCheckPosition = m + parser.position
  11118. }
  11119. function clearBuffers (parser) {
  11120. for (var i = 0, l = buffers.length; i < l; i++) {
  11121. parser[buffers[i]] = ''
  11122. }
  11123. }
  11124. function flushBuffers (parser) {
  11125. closeText(parser)
  11126. if (parser.cdata !== '') {
  11127. emitNode(parser, 'oncdata', parser.cdata)
  11128. parser.cdata = ''
  11129. }
  11130. if (parser.script !== '') {
  11131. emitNode(parser, 'onscript', parser.script)
  11132. parser.script = ''
  11133. }
  11134. }
  11135. SAXParser.prototype = {
  11136. end: function () { end(this) },
  11137. write: write,
  11138. resume: function () { this.error = null; return this },
  11139. close: function () { return this.write(null) },
  11140. flush: function () { flushBuffers(this) }
  11141. }
  11142. var Stream
  11143. try {
  11144. Stream = __webpack_require__(413).Stream
  11145. } catch (ex) {
  11146. Stream = function () {}
  11147. }
  11148. var streamWraps = sax.EVENTS.filter(function (ev) {
  11149. return ev !== 'error' && ev !== 'end'
  11150. })
  11151. function createStream (strict, opt) {
  11152. return new SAXStream(strict, opt)
  11153. }
  11154. function SAXStream (strict, opt) {
  11155. if (!(this instanceof SAXStream)) {
  11156. return new SAXStream(strict, opt)
  11157. }
  11158. Stream.apply(this)
  11159. this._parser = new SAXParser(strict, opt)
  11160. this.writable = true
  11161. this.readable = true
  11162. var me = this
  11163. this._parser.onend = function () {
  11164. me.emit('end')
  11165. }
  11166. this._parser.onerror = function (er) {
  11167. me.emit('error', er)
  11168. // if didn't throw, then means error was handled.
  11169. // go ahead and clear error, so we can write again.
  11170. me._parser.error = null
  11171. }
  11172. this._decoder = null
  11173. streamWraps.forEach(function (ev) {
  11174. Object.defineProperty(me, 'on' + ev, {
  11175. get: function () {
  11176. return me._parser['on' + ev]
  11177. },
  11178. set: function (h) {
  11179. if (!h) {
  11180. me.removeAllListeners(ev)
  11181. me._parser['on' + ev] = h
  11182. return h
  11183. }
  11184. me.on(ev, h)
  11185. },
  11186. enumerable: true,
  11187. configurable: false
  11188. })
  11189. })
  11190. }
  11191. SAXStream.prototype = Object.create(Stream.prototype, {
  11192. constructor: {
  11193. value: SAXStream
  11194. }
  11195. })
  11196. SAXStream.prototype.write = function (data) {
  11197. if (typeof Buffer === 'function' &&
  11198. typeof Buffer.isBuffer === 'function' &&
  11199. Buffer.isBuffer(data)) {
  11200. if (!this._decoder) {
  11201. var SD = __webpack_require__(304).StringDecoder
  11202. this._decoder = new SD('utf8')
  11203. }
  11204. data = this._decoder.write(data)
  11205. }
  11206. this._parser.write(data.toString())
  11207. this.emit('data', data)
  11208. return true
  11209. }
  11210. SAXStream.prototype.end = function (chunk) {
  11211. if (chunk && chunk.length) {
  11212. this.write(chunk)
  11213. }
  11214. this._parser.end()
  11215. return true
  11216. }
  11217. SAXStream.prototype.on = function (ev, handler) {
  11218. var me = this
  11219. if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
  11220. me._parser['on' + ev] = function () {
  11221. var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
  11222. args.splice(0, 0, ev)
  11223. me.emit.apply(me, args)
  11224. }
  11225. }
  11226. return Stream.prototype.on.call(me, ev, handler)
  11227. }
  11228. // character classes and tokens
  11229. var whitespace = '\r\n\t '
  11230. // this really needs to be replaced with character classes.
  11231. // XML allows all manner of ridiculous numbers and digits.
  11232. var number = '0124356789'
  11233. var letter = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
  11234. // (Letter | "_" | ":")
  11235. var quote = '\'"'
  11236. var attribEnd = whitespace + '>'
  11237. var CDATA = '[CDATA['
  11238. var DOCTYPE = 'DOCTYPE'
  11239. var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
  11240. var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
  11241. var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
  11242. // turn all the string character sets into character class objects.
  11243. whitespace = charClass(whitespace)
  11244. number = charClass(number)
  11245. letter = charClass(letter)
  11246. // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
  11247. // This implementation works on strings, a single character at a time
  11248. // as such, it cannot ever support astral-plane characters (10000-EFFFF)
  11249. // without a significant breaking change to either this parser, or the
  11250. // JavaScript language. Implementation of an emoji-capable xml parser
  11251. // is left as an exercise for the reader.
  11252. var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
  11253. var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
  11254. var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
  11255. var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
  11256. quote = charClass(quote)
  11257. attribEnd = charClass(attribEnd)
  11258. function charClass (str) {
  11259. return str.split('').reduce(function (s, c) {
  11260. s[c] = true
  11261. return s
  11262. }, {})
  11263. }
  11264. function isRegExp (c) {
  11265. return Object.prototype.toString.call(c) === '[object RegExp]'
  11266. }
  11267. function is (charclass, c) {
  11268. return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
  11269. }
  11270. function not (charclass, c) {
  11271. return !is(charclass, c)
  11272. }
  11273. var S = 0
  11274. sax.STATE = {
  11275. BEGIN: S++, // leading byte order mark or whitespace
  11276. BEGIN_WHITESPACE: S++, // leading whitespace
  11277. TEXT: S++, // general stuff
  11278. TEXT_ENTITY: S++, // &amp and such.
  11279. OPEN_WAKA: S++, // <
  11280. SGML_DECL: S++, // <!BLARG
  11281. SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
  11282. DOCTYPE: S++, // <!DOCTYPE
  11283. DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
  11284. DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
  11285. DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
  11286. COMMENT_STARTING: S++, // <!-
  11287. COMMENT: S++, // <!--
  11288. COMMENT_ENDING: S++, // <!-- blah -
  11289. COMMENT_ENDED: S++, // <!-- blah --
  11290. CDATA: S++, // <![CDATA[ something
  11291. CDATA_ENDING: S++, // ]
  11292. CDATA_ENDING_2: S++, // ]]
  11293. PROC_INST: S++, // <?hi
  11294. PROC_INST_BODY: S++, // <?hi there
  11295. PROC_INST_ENDING: S++, // <?hi "there" ?
  11296. OPEN_TAG: S++, // <strong
  11297. OPEN_TAG_SLASH: S++, // <strong /
  11298. ATTRIB: S++, // <a
  11299. ATTRIB_NAME: S++, // <a foo
  11300. ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
  11301. ATTRIB_VALUE: S++, // <a foo=
  11302. ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
  11303. ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
  11304. ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
  11305. ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
  11306. ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
  11307. CLOSE_TAG: S++, // </a
  11308. CLOSE_TAG_SAW_WHITE: S++, // </a >
  11309. SCRIPT: S++, // <script> ...
  11310. SCRIPT_ENDING: S++ // <script> ... <
  11311. }
  11312. sax.XML_ENTITIES = {
  11313. 'amp': '&',
  11314. 'gt': '>',
  11315. 'lt': '<',
  11316. 'quot': '"',
  11317. 'apos': "'"
  11318. }
  11319. sax.ENTITIES = {
  11320. 'amp': '&',
  11321. 'gt': '>',
  11322. 'lt': '<',
  11323. 'quot': '"',
  11324. 'apos': "'",
  11325. 'AElig': 198,
  11326. 'Aacute': 193,
  11327. 'Acirc': 194,
  11328. 'Agrave': 192,
  11329. 'Aring': 197,
  11330. 'Atilde': 195,
  11331. 'Auml': 196,
  11332. 'Ccedil': 199,
  11333. 'ETH': 208,
  11334. 'Eacute': 201,
  11335. 'Ecirc': 202,
  11336. 'Egrave': 200,
  11337. 'Euml': 203,
  11338. 'Iacute': 205,
  11339. 'Icirc': 206,
  11340. 'Igrave': 204,
  11341. 'Iuml': 207,
  11342. 'Ntilde': 209,
  11343. 'Oacute': 211,
  11344. 'Ocirc': 212,
  11345. 'Ograve': 210,
  11346. 'Oslash': 216,
  11347. 'Otilde': 213,
  11348. 'Ouml': 214,
  11349. 'THORN': 222,
  11350. 'Uacute': 218,
  11351. 'Ucirc': 219,
  11352. 'Ugrave': 217,
  11353. 'Uuml': 220,
  11354. 'Yacute': 221,
  11355. 'aacute': 225,
  11356. 'acirc': 226,
  11357. 'aelig': 230,
  11358. 'agrave': 224,
  11359. 'aring': 229,
  11360. 'atilde': 227,
  11361. 'auml': 228,
  11362. 'ccedil': 231,
  11363. 'eacute': 233,
  11364. 'ecirc': 234,
  11365. 'egrave': 232,
  11366. 'eth': 240,
  11367. 'euml': 235,
  11368. 'iacute': 237,
  11369. 'icirc': 238,
  11370. 'igrave': 236,
  11371. 'iuml': 239,
  11372. 'ntilde': 241,
  11373. 'oacute': 243,
  11374. 'ocirc': 244,
  11375. 'ograve': 242,
  11376. 'oslash': 248,
  11377. 'otilde': 245,
  11378. 'ouml': 246,
  11379. 'szlig': 223,
  11380. 'thorn': 254,
  11381. 'uacute': 250,
  11382. 'ucirc': 251,
  11383. 'ugrave': 249,
  11384. 'uuml': 252,
  11385. 'yacute': 253,
  11386. 'yuml': 255,
  11387. 'copy': 169,
  11388. 'reg': 174,
  11389. 'nbsp': 160,
  11390. 'iexcl': 161,
  11391. 'cent': 162,
  11392. 'pound': 163,
  11393. 'curren': 164,
  11394. 'yen': 165,
  11395. 'brvbar': 166,
  11396. 'sect': 167,
  11397. 'uml': 168,
  11398. 'ordf': 170,
  11399. 'laquo': 171,
  11400. 'not': 172,
  11401. 'shy': 173,
  11402. 'macr': 175,
  11403. 'deg': 176,
  11404. 'plusmn': 177,
  11405. 'sup1': 185,
  11406. 'sup2': 178,
  11407. 'sup3': 179,
  11408. 'acute': 180,
  11409. 'micro': 181,
  11410. 'para': 182,
  11411. 'middot': 183,
  11412. 'cedil': 184,
  11413. 'ordm': 186,
  11414. 'raquo': 187,
  11415. 'frac14': 188,
  11416. 'frac12': 189,
  11417. 'frac34': 190,
  11418. 'iquest': 191,
  11419. 'times': 215,
  11420. 'divide': 247,
  11421. 'OElig': 338,
  11422. 'oelig': 339,
  11423. 'Scaron': 352,
  11424. 'scaron': 353,
  11425. 'Yuml': 376,
  11426. 'fnof': 402,
  11427. 'circ': 710,
  11428. 'tilde': 732,
  11429. 'Alpha': 913,
  11430. 'Beta': 914,
  11431. 'Gamma': 915,
  11432. 'Delta': 916,
  11433. 'Epsilon': 917,
  11434. 'Zeta': 918,
  11435. 'Eta': 919,
  11436. 'Theta': 920,
  11437. 'Iota': 921,
  11438. 'Kappa': 922,
  11439. 'Lambda': 923,
  11440. 'Mu': 924,
  11441. 'Nu': 925,
  11442. 'Xi': 926,
  11443. 'Omicron': 927,
  11444. 'Pi': 928,
  11445. 'Rho': 929,
  11446. 'Sigma': 931,
  11447. 'Tau': 932,
  11448. 'Upsilon': 933,
  11449. 'Phi': 934,
  11450. 'Chi': 935,
  11451. 'Psi': 936,
  11452. 'Omega': 937,
  11453. 'alpha': 945,
  11454. 'beta': 946,
  11455. 'gamma': 947,
  11456. 'delta': 948,
  11457. 'epsilon': 949,
  11458. 'zeta': 950,
  11459. 'eta': 951,
  11460. 'theta': 952,
  11461. 'iota': 953,
  11462. 'kappa': 954,
  11463. 'lambda': 955,
  11464. 'mu': 956,
  11465. 'nu': 957,
  11466. 'xi': 958,
  11467. 'omicron': 959,
  11468. 'pi': 960,
  11469. 'rho': 961,
  11470. 'sigmaf': 962,
  11471. 'sigma': 963,
  11472. 'tau': 964,
  11473. 'upsilon': 965,
  11474. 'phi': 966,
  11475. 'chi': 967,
  11476. 'psi': 968,
  11477. 'omega': 969,
  11478. 'thetasym': 977,
  11479. 'upsih': 978,
  11480. 'piv': 982,
  11481. 'ensp': 8194,
  11482. 'emsp': 8195,
  11483. 'thinsp': 8201,
  11484. 'zwnj': 8204,
  11485. 'zwj': 8205,
  11486. 'lrm': 8206,
  11487. 'rlm': 8207,
  11488. 'ndash': 8211,
  11489. 'mdash': 8212,
  11490. 'lsquo': 8216,
  11491. 'rsquo': 8217,
  11492. 'sbquo': 8218,
  11493. 'ldquo': 8220,
  11494. 'rdquo': 8221,
  11495. 'bdquo': 8222,
  11496. 'dagger': 8224,
  11497. 'Dagger': 8225,
  11498. 'bull': 8226,
  11499. 'hellip': 8230,
  11500. 'permil': 8240,
  11501. 'prime': 8242,
  11502. 'Prime': 8243,
  11503. 'lsaquo': 8249,
  11504. 'rsaquo': 8250,
  11505. 'oline': 8254,
  11506. 'frasl': 8260,
  11507. 'euro': 8364,
  11508. 'image': 8465,
  11509. 'weierp': 8472,
  11510. 'real': 8476,
  11511. 'trade': 8482,
  11512. 'alefsym': 8501,
  11513. 'larr': 8592,
  11514. 'uarr': 8593,
  11515. 'rarr': 8594,
  11516. 'darr': 8595,
  11517. 'harr': 8596,
  11518. 'crarr': 8629,
  11519. 'lArr': 8656,
  11520. 'uArr': 8657,
  11521. 'rArr': 8658,
  11522. 'dArr': 8659,
  11523. 'hArr': 8660,
  11524. 'forall': 8704,
  11525. 'part': 8706,
  11526. 'exist': 8707,
  11527. 'empty': 8709,
  11528. 'nabla': 8711,
  11529. 'isin': 8712,
  11530. 'notin': 8713,
  11531. 'ni': 8715,
  11532. 'prod': 8719,
  11533. 'sum': 8721,
  11534. 'minus': 8722,
  11535. 'lowast': 8727,
  11536. 'radic': 8730,
  11537. 'prop': 8733,
  11538. 'infin': 8734,
  11539. 'ang': 8736,
  11540. 'and': 8743,
  11541. 'or': 8744,
  11542. 'cap': 8745,
  11543. 'cup': 8746,
  11544. 'int': 8747,
  11545. 'there4': 8756,
  11546. 'sim': 8764,
  11547. 'cong': 8773,
  11548. 'asymp': 8776,
  11549. 'ne': 8800,
  11550. 'equiv': 8801,
  11551. 'le': 8804,
  11552. 'ge': 8805,
  11553. 'sub': 8834,
  11554. 'sup': 8835,
  11555. 'nsub': 8836,
  11556. 'sube': 8838,
  11557. 'supe': 8839,
  11558. 'oplus': 8853,
  11559. 'otimes': 8855,
  11560. 'perp': 8869,
  11561. 'sdot': 8901,
  11562. 'lceil': 8968,
  11563. 'rceil': 8969,
  11564. 'lfloor': 8970,
  11565. 'rfloor': 8971,
  11566. 'lang': 9001,
  11567. 'rang': 9002,
  11568. 'loz': 9674,
  11569. 'spades': 9824,
  11570. 'clubs': 9827,
  11571. 'hearts': 9829,
  11572. 'diams': 9830
  11573. }
  11574. Object.keys(sax.ENTITIES).forEach(function (key) {
  11575. var e = sax.ENTITIES[key]
  11576. var s = typeof e === 'number' ? String.fromCharCode(e) : e
  11577. sax.ENTITIES[key] = s
  11578. })
  11579. for (var s in sax.STATE) {
  11580. sax.STATE[sax.STATE[s]] = s
  11581. }
  11582. // shorthand
  11583. S = sax.STATE
  11584. function emit (parser, event, data) {
  11585. parser[event] && parser[event](data)
  11586. }
  11587. function emitNode (parser, nodeType, data) {
  11588. if (parser.textNode) closeText(parser)
  11589. emit(parser, nodeType, data)
  11590. }
  11591. function closeText (parser) {
  11592. parser.textNode = textopts(parser.opt, parser.textNode)
  11593. if (parser.textNode) emit(parser, 'ontext', parser.textNode)
  11594. parser.textNode = ''
  11595. }
  11596. function textopts (opt, text) {
  11597. if (opt.trim) text = text.trim()
  11598. if (opt.normalize) text = text.replace(/\s+/g, ' ')
  11599. return text
  11600. }
  11601. function error (parser, er) {
  11602. closeText(parser)
  11603. if (parser.trackPosition) {
  11604. er += '\nLine: ' + parser.line +
  11605. '\nColumn: ' + parser.column +
  11606. '\nChar: ' + parser.c
  11607. }
  11608. er = new Error(er)
  11609. parser.error = er
  11610. emit(parser, 'onerror', er)
  11611. return parser
  11612. }
  11613. function end (parser) {
  11614. if (parser.sawRoot && !parser.closedRoot) strictFail(parser, 'Unclosed root tag')
  11615. if ((parser.state !== S.BEGIN) &&
  11616. (parser.state !== S.BEGIN_WHITESPACE) &&
  11617. (parser.state !== S.TEXT)) {
  11618. error(parser, 'Unexpected end')
  11619. }
  11620. closeText(parser)
  11621. parser.c = ''
  11622. parser.closed = true
  11623. emit(parser, 'onend')
  11624. SAXParser.call(parser, parser.strict, parser.opt)
  11625. return parser
  11626. }
  11627. function strictFail (parser, message) {
  11628. if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
  11629. throw new Error('bad call to strictFail')
  11630. }
  11631. if (parser.strict) {
  11632. error(parser, message)
  11633. }
  11634. }
  11635. function newTag (parser) {
  11636. if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
  11637. var parent = parser.tags[parser.tags.length - 1] || parser
  11638. var tag = parser.tag = { name: parser.tagName, attributes: {} }
  11639. // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
  11640. if (parser.opt.xmlns) {
  11641. tag.ns = parent.ns
  11642. }
  11643. parser.attribList.length = 0
  11644. emitNode(parser, 'onopentagstart', tag)
  11645. }
  11646. function qname (name, attribute) {
  11647. var i = name.indexOf(':')
  11648. var qualName = i < 0 ? [ '', name ] : name.split(':')
  11649. var prefix = qualName[0]
  11650. var local = qualName[1]
  11651. // <x "xmlns"="http://foo">
  11652. if (attribute && name === 'xmlns') {
  11653. prefix = 'xmlns'
  11654. local = ''
  11655. }
  11656. return { prefix: prefix, local: local }
  11657. }
  11658. function attrib (parser) {
  11659. if (!parser.strict) {
  11660. parser.attribName = parser.attribName[parser.looseCase]()
  11661. }
  11662. if (parser.attribList.indexOf(parser.attribName) !== -1 ||
  11663. parser.tag.attributes.hasOwnProperty(parser.attribName)) {
  11664. parser.attribName = parser.attribValue = ''
  11665. return
  11666. }
  11667. if (parser.opt.xmlns) {
  11668. var qn = qname(parser.attribName, true)
  11669. var prefix = qn.prefix
  11670. var local = qn.local
  11671. if (prefix === 'xmlns') {
  11672. // namespace binding attribute. push the binding into scope
  11673. if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
  11674. strictFail(parser,
  11675. 'xml: prefix must be bound to ' + XML_NAMESPACE + '\n' +
  11676. 'Actual: ' + parser.attribValue)
  11677. } else if (local === 'xmlns' && parser.attribValue !== XMLNS_NAMESPACE) {
  11678. strictFail(parser,
  11679. 'xmlns: prefix must be bound to ' + XMLNS_NAMESPACE + '\n' +
  11680. 'Actual: ' + parser.attribValue)
  11681. } else {
  11682. var tag = parser.tag
  11683. var parent = parser.tags[parser.tags.length - 1] || parser
  11684. if (tag.ns === parent.ns) {
  11685. tag.ns = Object.create(parent.ns)
  11686. }
  11687. tag.ns[local] = parser.attribValue
  11688. }
  11689. }
  11690. // defer onattribute events until all attributes have been seen
  11691. // so any new bindings can take effect. preserve attribute order
  11692. // so deferred events can be emitted in document order
  11693. parser.attribList.push([parser.attribName, parser.attribValue])
  11694. } else {
  11695. // in non-xmlns mode, we can emit the event right away
  11696. parser.tag.attributes[parser.attribName] = parser.attribValue
  11697. emitNode(parser, 'onattribute', {
  11698. name: parser.attribName,
  11699. value: parser.attribValue
  11700. })
  11701. }
  11702. parser.attribName = parser.attribValue = ''
  11703. }
  11704. function openTag (parser, selfClosing) {
  11705. if (parser.opt.xmlns) {
  11706. // emit namespace binding events
  11707. var tag = parser.tag
  11708. // add namespace info to tag
  11709. var qn = qname(parser.tagName)
  11710. tag.prefix = qn.prefix
  11711. tag.local = qn.local
  11712. tag.uri = tag.ns[qn.prefix] || ''
  11713. if (tag.prefix && !tag.uri) {
  11714. strictFail(parser, 'Unbound namespace prefix: ' +
  11715. JSON.stringify(parser.tagName))
  11716. tag.uri = qn.prefix
  11717. }
  11718. var parent = parser.tags[parser.tags.length - 1] || parser
  11719. if (tag.ns && parent.ns !== tag.ns) {
  11720. Object.keys(tag.ns).forEach(function (p) {
  11721. emitNode(parser, 'onopennamespace', {
  11722. prefix: p,
  11723. uri: tag.ns[p]
  11724. })
  11725. })
  11726. }
  11727. // handle deferred onattribute events
  11728. // Note: do not apply default ns to attributes:
  11729. // http://www.w3.org/TR/REC-xml-names/#defaulting
  11730. for (var i = 0, l = parser.attribList.length; i < l; i++) {
  11731. var nv = parser.attribList[i]
  11732. var name = nv[0]
  11733. var value = nv[1]
  11734. var qualName = qname(name, true)
  11735. var prefix = qualName.prefix
  11736. var local = qualName.local
  11737. var uri = prefix === '' ? '' : (tag.ns[prefix] || '')
  11738. var a = {
  11739. name: name,
  11740. value: value,
  11741. prefix: prefix,
  11742. local: local,
  11743. uri: uri
  11744. }
  11745. // if there's any attributes with an undefined namespace,
  11746. // then fail on them now.
  11747. if (prefix && prefix !== 'xmlns' && !uri) {
  11748. strictFail(parser, 'Unbound namespace prefix: ' +
  11749. JSON.stringify(prefix))
  11750. a.uri = prefix
  11751. }
  11752. parser.tag.attributes[name] = a
  11753. emitNode(parser, 'onattribute', a)
  11754. }
  11755. parser.attribList.length = 0
  11756. }
  11757. parser.tag.isSelfClosing = !!selfClosing
  11758. // process the tag
  11759. parser.sawRoot = true
  11760. parser.tags.push(parser.tag)
  11761. emitNode(parser, 'onopentag', parser.tag)
  11762. if (!selfClosing) {
  11763. // special case for <script> in non-strict mode.
  11764. if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
  11765. parser.state = S.SCRIPT
  11766. } else {
  11767. parser.state = S.TEXT
  11768. }
  11769. parser.tag = null
  11770. parser.tagName = ''
  11771. }
  11772. parser.attribName = parser.attribValue = ''
  11773. parser.attribList.length = 0
  11774. }
  11775. function closeTag (parser) {
  11776. if (!parser.tagName) {
  11777. strictFail(parser, 'Weird empty close tag.')
  11778. parser.textNode += '</>'
  11779. parser.state = S.TEXT
  11780. return
  11781. }
  11782. if (parser.script) {
  11783. if (parser.tagName !== 'script') {
  11784. parser.script += '</' + parser.tagName + '>'
  11785. parser.tagName = ''
  11786. parser.state = S.SCRIPT
  11787. return
  11788. }
  11789. emitNode(parser, 'onscript', parser.script)
  11790. parser.script = ''
  11791. }
  11792. // first make sure that the closing tag actually exists.
  11793. // <a><b></c></b></a> will close everything, otherwise.
  11794. var t = parser.tags.length
  11795. var tagName = parser.tagName
  11796. if (!parser.strict) {
  11797. tagName = tagName[parser.looseCase]()
  11798. }
  11799. var closeTo = tagName
  11800. while (t--) {
  11801. var close = parser.tags[t]
  11802. if (close.name !== closeTo) {
  11803. // fail the first time in strict mode
  11804. strictFail(parser, 'Unexpected close tag')
  11805. } else {
  11806. break
  11807. }
  11808. }
  11809. // didn't find it. we already failed for strict, so just abort.
  11810. if (t < 0) {
  11811. strictFail(parser, 'Unmatched closing tag: ' + parser.tagName)
  11812. parser.textNode += '</' + parser.tagName + '>'
  11813. parser.state = S.TEXT
  11814. return
  11815. }
  11816. parser.tagName = tagName
  11817. var s = parser.tags.length
  11818. while (s-- > t) {
  11819. var tag = parser.tag = parser.tags.pop()
  11820. parser.tagName = parser.tag.name
  11821. emitNode(parser, 'onclosetag', parser.tagName)
  11822. var x = {}
  11823. for (var i in tag.ns) {
  11824. x[i] = tag.ns[i]
  11825. }
  11826. var parent = parser.tags[parser.tags.length - 1] || parser
  11827. if (parser.opt.xmlns && tag.ns !== parent.ns) {
  11828. // remove namespace bindings introduced by tag
  11829. Object.keys(tag.ns).forEach(function (p) {
  11830. var n = tag.ns[p]
  11831. emitNode(parser, 'onclosenamespace', { prefix: p, uri: n })
  11832. })
  11833. }
  11834. }
  11835. if (t === 0) parser.closedRoot = true
  11836. parser.tagName = parser.attribValue = parser.attribName = ''
  11837. parser.attribList.length = 0
  11838. parser.state = S.TEXT
  11839. }
  11840. function parseEntity (parser) {
  11841. var entity = parser.entity
  11842. var entityLC = entity.toLowerCase()
  11843. var num
  11844. var numStr = ''
  11845. if (parser.ENTITIES[entity]) {
  11846. return parser.ENTITIES[entity]
  11847. }
  11848. if (parser.ENTITIES[entityLC]) {
  11849. return parser.ENTITIES[entityLC]
  11850. }
  11851. entity = entityLC
  11852. if (entity.charAt(0) === '#') {
  11853. if (entity.charAt(1) === 'x') {
  11854. entity = entity.slice(2)
  11855. num = parseInt(entity, 16)
  11856. numStr = num.toString(16)
  11857. } else {
  11858. entity = entity.slice(1)
  11859. num = parseInt(entity, 10)
  11860. numStr = num.toString(10)
  11861. }
  11862. }
  11863. entity = entity.replace(/^0+/, '')
  11864. if (numStr.toLowerCase() !== entity) {
  11865. strictFail(parser, 'Invalid character entity')
  11866. return '&' + parser.entity + ';'
  11867. }
  11868. return String.fromCodePoint(num)
  11869. }
  11870. function beginWhiteSpace (parser, c) {
  11871. if (c === '<') {
  11872. parser.state = S.OPEN_WAKA
  11873. parser.startTagPosition = parser.position
  11874. } else if (not(whitespace, c)) {
  11875. // have to process this as a text node.
  11876. // weird, but happens.
  11877. strictFail(parser, 'Non-whitespace before first tag.')
  11878. parser.textNode = c
  11879. parser.state = S.TEXT
  11880. }
  11881. }
  11882. function charAt (chunk, i) {
  11883. var result = ''
  11884. if (i < chunk.length) {
  11885. result = chunk.charAt(i)
  11886. }
  11887. return result
  11888. }
  11889. function write (chunk) {
  11890. var parser = this
  11891. if (this.error) {
  11892. throw this.error
  11893. }
  11894. if (parser.closed) {
  11895. return error(parser,
  11896. 'Cannot write after close. Assign an onready handler.')
  11897. }
  11898. if (chunk === null) {
  11899. return end(parser)
  11900. }
  11901. if (typeof chunk === 'object') {
  11902. chunk = chunk.toString()
  11903. }
  11904. var i = 0
  11905. var c = ''
  11906. while (true) {
  11907. c = charAt(chunk, i++)
  11908. parser.c = c
  11909. if (!c) {
  11910. break
  11911. }
  11912. if (parser.trackPosition) {
  11913. parser.position++
  11914. if (c === '\n') {
  11915. parser.line++
  11916. parser.column = 0
  11917. } else {
  11918. parser.column++
  11919. }
  11920. }
  11921. switch (parser.state) {
  11922. case S.BEGIN:
  11923. parser.state = S.BEGIN_WHITESPACE
  11924. if (c === '\uFEFF') {
  11925. continue
  11926. }
  11927. beginWhiteSpace(parser, c)
  11928. continue
  11929. case S.BEGIN_WHITESPACE:
  11930. beginWhiteSpace(parser, c)
  11931. continue
  11932. case S.TEXT:
  11933. if (parser.sawRoot && !parser.closedRoot) {
  11934. var starti = i - 1
  11935. while (c && c !== '<' && c !== '&') {
  11936. c = charAt(chunk, i++)
  11937. if (c && parser.trackPosition) {
  11938. parser.position++
  11939. if (c === '\n') {
  11940. parser.line++
  11941. parser.column = 0
  11942. } else {
  11943. parser.column++
  11944. }
  11945. }
  11946. }
  11947. parser.textNode += chunk.substring(starti, i - 1)
  11948. }
  11949. if (c === '<' && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
  11950. parser.state = S.OPEN_WAKA
  11951. parser.startTagPosition = parser.position
  11952. } else {
  11953. if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot)) {
  11954. strictFail(parser, 'Text data outside of root node.')
  11955. }
  11956. if (c === '&') {
  11957. parser.state = S.TEXT_ENTITY
  11958. } else {
  11959. parser.textNode += c
  11960. }
  11961. }
  11962. continue
  11963. case S.SCRIPT:
  11964. // only non-strict
  11965. if (c === '<') {
  11966. parser.state = S.SCRIPT_ENDING
  11967. } else {
  11968. parser.script += c
  11969. }
  11970. continue
  11971. case S.SCRIPT_ENDING:
  11972. if (c === '/') {
  11973. parser.state = S.CLOSE_TAG
  11974. } else {
  11975. parser.script += '<' + c
  11976. parser.state = S.SCRIPT
  11977. }
  11978. continue
  11979. case S.OPEN_WAKA:
  11980. // either a /, ?, !, or text is coming next.
  11981. if (c === '!') {
  11982. parser.state = S.SGML_DECL
  11983. parser.sgmlDecl = ''
  11984. } else if (is(whitespace, c)) {
  11985. // wait for it...
  11986. } else if (is(nameStart, c)) {
  11987. parser.state = S.OPEN_TAG
  11988. parser.tagName = c
  11989. } else if (c === '/') {
  11990. parser.state = S.CLOSE_TAG
  11991. parser.tagName = ''
  11992. } else if (c === '?') {
  11993. parser.state = S.PROC_INST
  11994. parser.procInstName = parser.procInstBody = ''
  11995. } else {
  11996. strictFail(parser, 'Unencoded <')
  11997. // if there was some whitespace, then add that in.
  11998. if (parser.startTagPosition + 1 < parser.position) {
  11999. var pad = parser.position - parser.startTagPosition
  12000. c = new Array(pad).join(' ') + c
  12001. }
  12002. parser.textNode += '<' + c
  12003. parser.state = S.TEXT
  12004. }
  12005. continue
  12006. case S.SGML_DECL:
  12007. if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
  12008. emitNode(parser, 'onopencdata')
  12009. parser.state = S.CDATA
  12010. parser.sgmlDecl = ''
  12011. parser.cdata = ''
  12012. } else if (parser.sgmlDecl + c === '--') {
  12013. parser.state = S.COMMENT
  12014. parser.comment = ''
  12015. parser.sgmlDecl = ''
  12016. } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
  12017. parser.state = S.DOCTYPE
  12018. if (parser.doctype || parser.sawRoot) {
  12019. strictFail(parser,
  12020. 'Inappropriately located doctype declaration')
  12021. }
  12022. parser.doctype = ''
  12023. parser.sgmlDecl = ''
  12024. } else if (c === '>') {
  12025. emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl)
  12026. parser.sgmlDecl = ''
  12027. parser.state = S.TEXT
  12028. } else if (is(quote, c)) {
  12029. parser.state = S.SGML_DECL_QUOTED
  12030. parser.sgmlDecl += c
  12031. } else {
  12032. parser.sgmlDecl += c
  12033. }
  12034. continue
  12035. case S.SGML_DECL_QUOTED:
  12036. if (c === parser.q) {
  12037. parser.state = S.SGML_DECL
  12038. parser.q = ''
  12039. }
  12040. parser.sgmlDecl += c
  12041. continue
  12042. case S.DOCTYPE:
  12043. if (c === '>') {
  12044. parser.state = S.TEXT
  12045. emitNode(parser, 'ondoctype', parser.doctype)
  12046. parser.doctype = true // just remember that we saw it.
  12047. } else {
  12048. parser.doctype += c
  12049. if (c === '[') {
  12050. parser.state = S.DOCTYPE_DTD
  12051. } else if (is(quote, c)) {
  12052. parser.state = S.DOCTYPE_QUOTED
  12053. parser.q = c
  12054. }
  12055. }
  12056. continue
  12057. case S.DOCTYPE_QUOTED:
  12058. parser.doctype += c
  12059. if (c === parser.q) {
  12060. parser.q = ''
  12061. parser.state = S.DOCTYPE
  12062. }
  12063. continue
  12064. case S.DOCTYPE_DTD:
  12065. parser.doctype += c
  12066. if (c === ']') {
  12067. parser.state = S.DOCTYPE
  12068. } else if (is(quote, c)) {
  12069. parser.state = S.DOCTYPE_DTD_QUOTED
  12070. parser.q = c
  12071. }
  12072. continue
  12073. case S.DOCTYPE_DTD_QUOTED:
  12074. parser.doctype += c
  12075. if (c === parser.q) {
  12076. parser.state = S.DOCTYPE_DTD
  12077. parser.q = ''
  12078. }
  12079. continue
  12080. case S.COMMENT:
  12081. if (c === '-') {
  12082. parser.state = S.COMMENT_ENDING
  12083. } else {
  12084. parser.comment += c
  12085. }
  12086. continue
  12087. case S.COMMENT_ENDING:
  12088. if (c === '-') {
  12089. parser.state = S.COMMENT_ENDED
  12090. parser.comment = textopts(parser.opt, parser.comment)
  12091. if (parser.comment) {
  12092. emitNode(parser, 'oncomment', parser.comment)
  12093. }
  12094. parser.comment = ''
  12095. } else {
  12096. parser.comment += '-' + c
  12097. parser.state = S.COMMENT
  12098. }
  12099. continue
  12100. case S.COMMENT_ENDED:
  12101. if (c !== '>') {
  12102. strictFail(parser, 'Malformed comment')
  12103. // allow <!-- blah -- bloo --> in non-strict mode,
  12104. // which is a comment of " blah -- bloo "
  12105. parser.comment += '--' + c
  12106. parser.state = S.COMMENT
  12107. } else {
  12108. parser.state = S.TEXT
  12109. }
  12110. continue
  12111. case S.CDATA:
  12112. if (c === ']') {
  12113. parser.state = S.CDATA_ENDING
  12114. } else {
  12115. parser.cdata += c
  12116. }
  12117. continue
  12118. case S.CDATA_ENDING:
  12119. if (c === ']') {
  12120. parser.state = S.CDATA_ENDING_2
  12121. } else {
  12122. parser.cdata += ']' + c
  12123. parser.state = S.CDATA
  12124. }
  12125. continue
  12126. case S.CDATA_ENDING_2:
  12127. if (c === '>') {
  12128. if (parser.cdata) {
  12129. emitNode(parser, 'oncdata', parser.cdata)
  12130. }
  12131. emitNode(parser, 'onclosecdata')
  12132. parser.cdata = ''
  12133. parser.state = S.TEXT
  12134. } else if (c === ']') {
  12135. parser.cdata += ']'
  12136. } else {
  12137. parser.cdata += ']]' + c
  12138. parser.state = S.CDATA
  12139. }
  12140. continue
  12141. case S.PROC_INST:
  12142. if (c === '?') {
  12143. parser.state = S.PROC_INST_ENDING
  12144. } else if (is(whitespace, c)) {
  12145. parser.state = S.PROC_INST_BODY
  12146. } else {
  12147. parser.procInstName += c
  12148. }
  12149. continue
  12150. case S.PROC_INST_BODY:
  12151. if (!parser.procInstBody && is(whitespace, c)) {
  12152. continue
  12153. } else if (c === '?') {
  12154. parser.state = S.PROC_INST_ENDING
  12155. } else {
  12156. parser.procInstBody += c
  12157. }
  12158. continue
  12159. case S.PROC_INST_ENDING:
  12160. if (c === '>') {
  12161. emitNode(parser, 'onprocessinginstruction', {
  12162. name: parser.procInstName,
  12163. body: parser.procInstBody
  12164. })
  12165. parser.procInstName = parser.procInstBody = ''
  12166. parser.state = S.TEXT
  12167. } else {
  12168. parser.procInstBody += '?' + c
  12169. parser.state = S.PROC_INST_BODY
  12170. }
  12171. continue
  12172. case S.OPEN_TAG:
  12173. if (is(nameBody, c)) {
  12174. parser.tagName += c
  12175. } else {
  12176. newTag(parser)
  12177. if (c === '>') {
  12178. openTag(parser)
  12179. } else if (c === '/') {
  12180. parser.state = S.OPEN_TAG_SLASH
  12181. } else {
  12182. if (not(whitespace, c)) {
  12183. strictFail(parser, 'Invalid character in tag name')
  12184. }
  12185. parser.state = S.ATTRIB
  12186. }
  12187. }
  12188. continue
  12189. case S.OPEN_TAG_SLASH:
  12190. if (c === '>') {
  12191. openTag(parser, true)
  12192. closeTag(parser)
  12193. } else {
  12194. strictFail(parser, 'Forward-slash in opening tag not followed by >')
  12195. parser.state = S.ATTRIB
  12196. }
  12197. continue
  12198. case S.ATTRIB:
  12199. // haven't read the attribute name yet.
  12200. if (is(whitespace, c)) {
  12201. continue
  12202. } else if (c === '>') {
  12203. openTag(parser)
  12204. } else if (c === '/') {
  12205. parser.state = S.OPEN_TAG_SLASH
  12206. } else if (is(nameStart, c)) {
  12207. parser.attribName = c
  12208. parser.attribValue = ''
  12209. parser.state = S.ATTRIB_NAME
  12210. } else {
  12211. strictFail(parser, 'Invalid attribute name')
  12212. }
  12213. continue
  12214. case S.ATTRIB_NAME:
  12215. if (c === '=') {
  12216. parser.state = S.ATTRIB_VALUE
  12217. } else if (c === '>') {
  12218. strictFail(parser, 'Attribute without value')
  12219. parser.attribValue = parser.attribName
  12220. attrib(parser)
  12221. openTag(parser)
  12222. } else if (is(whitespace, c)) {
  12223. parser.state = S.ATTRIB_NAME_SAW_WHITE
  12224. } else if (is(nameBody, c)) {
  12225. parser.attribName += c
  12226. } else {
  12227. strictFail(parser, 'Invalid attribute name')
  12228. }
  12229. continue
  12230. case S.ATTRIB_NAME_SAW_WHITE:
  12231. if (c === '=') {
  12232. parser.state = S.ATTRIB_VALUE
  12233. } else if (is(whitespace, c)) {
  12234. continue
  12235. } else {
  12236. strictFail(parser, 'Attribute without value')
  12237. parser.tag.attributes[parser.attribName] = ''
  12238. parser.attribValue = ''
  12239. emitNode(parser, 'onattribute', {
  12240. name: parser.attribName,
  12241. value: ''
  12242. })
  12243. parser.attribName = ''
  12244. if (c === '>') {
  12245. openTag(parser)
  12246. } else if (is(nameStart, c)) {
  12247. parser.attribName = c
  12248. parser.state = S.ATTRIB_NAME
  12249. } else {
  12250. strictFail(parser, 'Invalid attribute name')
  12251. parser.state = S.ATTRIB
  12252. }
  12253. }
  12254. continue
  12255. case S.ATTRIB_VALUE:
  12256. if (is(whitespace, c)) {
  12257. continue
  12258. } else if (is(quote, c)) {
  12259. parser.q = c
  12260. parser.state = S.ATTRIB_VALUE_QUOTED
  12261. } else {
  12262. strictFail(parser, 'Unquoted attribute value')
  12263. parser.state = S.ATTRIB_VALUE_UNQUOTED
  12264. parser.attribValue = c
  12265. }
  12266. continue
  12267. case S.ATTRIB_VALUE_QUOTED:
  12268. if (c !== parser.q) {
  12269. if (c === '&') {
  12270. parser.state = S.ATTRIB_VALUE_ENTITY_Q
  12271. } else {
  12272. parser.attribValue += c
  12273. }
  12274. continue
  12275. }
  12276. attrib(parser)
  12277. parser.q = ''
  12278. parser.state = S.ATTRIB_VALUE_CLOSED
  12279. continue
  12280. case S.ATTRIB_VALUE_CLOSED:
  12281. if (is(whitespace, c)) {
  12282. parser.state = S.ATTRIB
  12283. } else if (c === '>') {
  12284. openTag(parser)
  12285. } else if (c === '/') {
  12286. parser.state = S.OPEN_TAG_SLASH
  12287. } else if (is(nameStart, c)) {
  12288. strictFail(parser, 'No whitespace between attributes')
  12289. parser.attribName = c
  12290. parser.attribValue = ''
  12291. parser.state = S.ATTRIB_NAME
  12292. } else {
  12293. strictFail(parser, 'Invalid attribute name')
  12294. }
  12295. continue
  12296. case S.ATTRIB_VALUE_UNQUOTED:
  12297. if (not(attribEnd, c)) {
  12298. if (c === '&') {
  12299. parser.state = S.ATTRIB_VALUE_ENTITY_U
  12300. } else {
  12301. parser.attribValue += c
  12302. }
  12303. continue
  12304. }
  12305. attrib(parser)
  12306. if (c === '>') {
  12307. openTag(parser)
  12308. } else {
  12309. parser.state = S.ATTRIB
  12310. }
  12311. continue
  12312. case S.CLOSE_TAG:
  12313. if (!parser.tagName) {
  12314. if (is(whitespace, c)) {
  12315. continue
  12316. } else if (not(nameStart, c)) {
  12317. if (parser.script) {
  12318. parser.script += '</' + c
  12319. parser.state = S.SCRIPT
  12320. } else {
  12321. strictFail(parser, 'Invalid tagname in closing tag.')
  12322. }
  12323. } else {
  12324. parser.tagName = c
  12325. }
  12326. } else if (c === '>') {
  12327. closeTag(parser)
  12328. } else if (is(nameBody, c)) {
  12329. parser.tagName += c
  12330. } else if (parser.script) {
  12331. parser.script += '</' + parser.tagName
  12332. parser.tagName = ''
  12333. parser.state = S.SCRIPT
  12334. } else {
  12335. if (not(whitespace, c)) {
  12336. strictFail(parser, 'Invalid tagname in closing tag')
  12337. }
  12338. parser.state = S.CLOSE_TAG_SAW_WHITE
  12339. }
  12340. continue
  12341. case S.CLOSE_TAG_SAW_WHITE:
  12342. if (is(whitespace, c)) {
  12343. continue
  12344. }
  12345. if (c === '>') {
  12346. closeTag(parser)
  12347. } else {
  12348. strictFail(parser, 'Invalid characters in closing tag')
  12349. }
  12350. continue
  12351. case S.TEXT_ENTITY:
  12352. case S.ATTRIB_VALUE_ENTITY_Q:
  12353. case S.ATTRIB_VALUE_ENTITY_U:
  12354. var returnState
  12355. var buffer
  12356. switch (parser.state) {
  12357. case S.TEXT_ENTITY:
  12358. returnState = S.TEXT
  12359. buffer = 'textNode'
  12360. break
  12361. case S.ATTRIB_VALUE_ENTITY_Q:
  12362. returnState = S.ATTRIB_VALUE_QUOTED
  12363. buffer = 'attribValue'
  12364. break
  12365. case S.ATTRIB_VALUE_ENTITY_U:
  12366. returnState = S.ATTRIB_VALUE_UNQUOTED
  12367. buffer = 'attribValue'
  12368. break
  12369. }
  12370. if (c === ';') {
  12371. parser[buffer] += parseEntity(parser)
  12372. parser.entity = ''
  12373. parser.state = returnState
  12374. } else if (is(parser.entity.length ? entityBody : entityStart, c)) {
  12375. parser.entity += c
  12376. } else {
  12377. strictFail(parser, 'Invalid character in entity name')
  12378. parser[buffer] += '&' + parser.entity + c
  12379. parser.entity = ''
  12380. parser.state = returnState
  12381. }
  12382. continue
  12383. default:
  12384. throw new Error(parser, 'Unknown state: ' + parser.state)
  12385. }
  12386. } // while
  12387. if (parser.position >= parser.bufferCheckPosition) {
  12388. checkBufferLength(parser)
  12389. }
  12390. return parser
  12391. }
  12392. /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
  12393. if (!String.fromCodePoint) {
  12394. (function () {
  12395. var stringFromCharCode = String.fromCharCode
  12396. var floor = Math.floor
  12397. var fromCodePoint = function () {
  12398. var MAX_SIZE = 0x4000
  12399. var codeUnits = []
  12400. var highSurrogate
  12401. var lowSurrogate
  12402. var index = -1
  12403. var length = arguments.length
  12404. if (!length) {
  12405. return ''
  12406. }
  12407. var result = ''
  12408. while (++index < length) {
  12409. var codePoint = Number(arguments[index])
  12410. if (
  12411. !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  12412. codePoint < 0 || // not a valid Unicode code point
  12413. codePoint > 0x10FFFF || // not a valid Unicode code point
  12414. floor(codePoint) !== codePoint // not an integer
  12415. ) {
  12416. throw RangeError('Invalid code point: ' + codePoint)
  12417. }
  12418. if (codePoint <= 0xFFFF) { // BMP code point
  12419. codeUnits.push(codePoint)
  12420. } else { // Astral code point; split in surrogate halves
  12421. // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  12422. codePoint -= 0x10000
  12423. highSurrogate = (codePoint >> 10) + 0xD800
  12424. lowSurrogate = (codePoint % 0x400) + 0xDC00
  12425. codeUnits.push(highSurrogate, lowSurrogate)
  12426. }
  12427. if (index + 1 === length || codeUnits.length > MAX_SIZE) {
  12428. result += stringFromCharCode.apply(null, codeUnits)
  12429. codeUnits.length = 0
  12430. }
  12431. }
  12432. return result
  12433. }
  12434. if (Object.defineProperty) {
  12435. Object.defineProperty(String, 'fromCodePoint', {
  12436. value: fromCodePoint,
  12437. configurable: true,
  12438. writable: true
  12439. })
  12440. } else {
  12441. String.fromCodePoint = fromCodePoint
  12442. }
  12443. }())
  12444. }
  12445. })( false ? undefined : exports)
  12446. /***/ }),
  12447. /***/ 657:
  12448. /***/ (function(module, __unusedexports, __webpack_require__) {
  12449. var parseMessage = __webpack_require__(683).parseMessage;
  12450. /**
  12451. *
  12452. * @param {*} parser
  12453. * @param {Buffer} message
  12454. * @param {*} shape
  12455. * @api private
  12456. */
  12457. function parseEvent(parser, message, shape) {
  12458. var parsedMessage = parseMessage(message);
  12459. // check if message is an event or error
  12460. var messageType = parsedMessage.headers[':message-type'];
  12461. if (messageType) {
  12462. if (messageType.value === 'error') {
  12463. throw parseError(parsedMessage);
  12464. } else if (messageType.value !== 'event') {
  12465. // not sure how to parse non-events/non-errors, ignore for now
  12466. return;
  12467. }
  12468. }
  12469. // determine event type
  12470. var eventType = parsedMessage.headers[':event-type'];
  12471. // check that the event type is modeled
  12472. var eventModel = shape.members[eventType.value];
  12473. if (!eventModel) {
  12474. return;
  12475. }
  12476. var result = {};
  12477. // check if an event payload exists
  12478. var eventPayloadMemberName = eventModel.eventPayloadMemberName;
  12479. if (eventPayloadMemberName) {
  12480. var payloadShape = eventModel.members[eventPayloadMemberName];
  12481. // if the shape is binary, return the byte array
  12482. if (payloadShape.type === 'binary') {
  12483. result[eventPayloadMemberName] = parsedMessage.body;
  12484. } else {
  12485. result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape);
  12486. }
  12487. }
  12488. // read event headers
  12489. var eventHeaderNames = eventModel.eventHeaderMemberNames;
  12490. for (var i = 0; i < eventHeaderNames.length; i++) {
  12491. var name = eventHeaderNames[i];
  12492. if (parsedMessage.headers[name]) {
  12493. // parse the header!
  12494. result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value);
  12495. }
  12496. }
  12497. var output = {};
  12498. output[eventType.value] = result;
  12499. return output;
  12500. }
  12501. function parseError(message) {
  12502. var errorCode = message.headers[':error-code'];
  12503. var errorMessage = message.headers[':error-message'];
  12504. var error = new Error(errorMessage.value || errorMessage);
  12505. error.code = error.name = errorCode.value || errorCode;
  12506. return error;
  12507. }
  12508. /**
  12509. * @api private
  12510. */
  12511. module.exports = {
  12512. parseEvent: parseEvent
  12513. };
  12514. /***/ }),
  12515. /***/ 660:
  12516. /***/ (function(module, __unusedexports, __webpack_require__) {
  12517. // Generated by CoffeeScript 1.12.7
  12518. (function() {
  12519. var XMLNode, XMLRaw,
  12520. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  12521. hasProp = {}.hasOwnProperty;
  12522. XMLNode = __webpack_require__(855);
  12523. module.exports = XMLRaw = (function(superClass) {
  12524. extend(XMLRaw, superClass);
  12525. function XMLRaw(parent, text) {
  12526. XMLRaw.__super__.constructor.call(this, parent);
  12527. if (text == null) {
  12528. throw new Error("Missing raw text");
  12529. }
  12530. this.value = this.stringify.raw(text);
  12531. }
  12532. XMLRaw.prototype.clone = function() {
  12533. return Object.create(this);
  12534. };
  12535. XMLRaw.prototype.toString = function(options) {
  12536. return this.options.writer.set(options).raw(this);
  12537. };
  12538. return XMLRaw;
  12539. })(XMLNode);
  12540. }).call(this);
  12541. /***/ }),
  12542. /***/ 661:
  12543. /***/ (function(module, __unusedexports, __webpack_require__) {
  12544. var eventMessageChunker = __webpack_require__(625).eventMessageChunker;
  12545. var parseEvent = __webpack_require__(657).parseEvent;
  12546. function createEventStream(body, parser, model) {
  12547. var eventMessages = eventMessageChunker(body);
  12548. var events = [];
  12549. for (var i = 0; i < eventMessages.length; i++) {
  12550. events.push(parseEvent(parser, eventMessages[i], model));
  12551. }
  12552. return events;
  12553. }
  12554. /**
  12555. * @api private
  12556. */
  12557. module.exports = {
  12558. createEventStream: createEventStream
  12559. };
  12560. /***/ }),
  12561. /***/ 669:
  12562. /***/ (function(module) {
  12563. module.exports = require("util");
  12564. /***/ }),
  12565. /***/ 679:
  12566. /***/ (function(module, __unusedexports, __webpack_require__) {
  12567. var crypto = __webpack_require__(417)
  12568. if (crypto.randomFillSync) {
  12569. // We reuse buffers with the same size to avoid memory fragmentations
  12570. // for better performance
  12571. var buffers = { }
  12572. module.exports = function (bytes) {
  12573. var buffer = buffers[bytes]
  12574. if (!buffer) {
  12575. // `Buffer.allocUnsafe()` faster because it don’t clean memory.
  12576. // We do not need it, since we will fill memory with new bytes anyway.
  12577. buffer = Buffer.allocUnsafe(bytes)
  12578. if (bytes <= 255) buffers[bytes] = buffer
  12579. }
  12580. return crypto.randomFillSync(buffer)
  12581. }
  12582. } else {
  12583. module.exports = crypto.randomBytes
  12584. }
  12585. /***/ }),
  12586. /***/ 682:
  12587. /***/ (function(module, __unusedexports, __webpack_require__) {
  12588. var Collection = __webpack_require__(583);
  12589. var util = __webpack_require__(153);
  12590. function property(obj, name, value) {
  12591. if (value !== null && value !== undefined) {
  12592. util.property.apply(this, arguments);
  12593. }
  12594. }
  12595. function memoizedProperty(obj, name) {
  12596. if (!obj.constructor.prototype[name]) {
  12597. util.memoizedProperty.apply(this, arguments);
  12598. }
  12599. }
  12600. function Shape(shape, options, memberName) {
  12601. options = options || {};
  12602. property(this, 'shape', shape.shape);
  12603. property(this, 'api', options.api, false);
  12604. property(this, 'type', shape.type);
  12605. property(this, 'enum', shape.enum);
  12606. property(this, 'min', shape.min);
  12607. property(this, 'max', shape.max);
  12608. property(this, 'pattern', shape.pattern);
  12609. property(this, 'location', shape.location || this.location || 'body');
  12610. property(this, 'name', this.name || shape.xmlName || shape.queryName ||
  12611. shape.locationName || memberName);
  12612. property(this, 'isStreaming', shape.streaming || this.isStreaming || false);
  12613. property(this, 'requiresLength', shape.requiresLength, false);
  12614. property(this, 'isComposite', shape.isComposite || false);
  12615. property(this, 'isShape', true, false);
  12616. property(this, 'isQueryName', Boolean(shape.queryName), false);
  12617. property(this, 'isLocationName', Boolean(shape.locationName), false);
  12618. property(this, 'isIdempotent', shape.idempotencyToken === true);
  12619. property(this, 'isJsonValue', shape.jsonvalue === true);
  12620. property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true);
  12621. property(this, 'isEventStream', Boolean(shape.eventstream), false);
  12622. property(this, 'isEvent', Boolean(shape.event), false);
  12623. property(this, 'isEventPayload', Boolean(shape.eventpayload), false);
  12624. property(this, 'isEventHeader', Boolean(shape.eventheader), false);
  12625. property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false);
  12626. property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false);
  12627. property(this, 'hostLabel', Boolean(shape.hostLabel), false);
  12628. if (options.documentation) {
  12629. property(this, 'documentation', shape.documentation);
  12630. property(this, 'documentationUrl', shape.documentationUrl);
  12631. }
  12632. if (shape.xmlAttribute) {
  12633. property(this, 'isXmlAttribute', shape.xmlAttribute || false);
  12634. }
  12635. // type conversion and parsing
  12636. property(this, 'defaultValue', null);
  12637. this.toWireFormat = function(value) {
  12638. if (value === null || value === undefined) return '';
  12639. return value;
  12640. };
  12641. this.toType = function(value) { return value; };
  12642. }
  12643. /**
  12644. * @api private
  12645. */
  12646. Shape.normalizedTypes = {
  12647. character: 'string',
  12648. double: 'float',
  12649. long: 'integer',
  12650. short: 'integer',
  12651. biginteger: 'integer',
  12652. bigdecimal: 'float',
  12653. blob: 'binary'
  12654. };
  12655. /**
  12656. * @api private
  12657. */
  12658. Shape.types = {
  12659. 'structure': StructureShape,
  12660. 'list': ListShape,
  12661. 'map': MapShape,
  12662. 'boolean': BooleanShape,
  12663. 'timestamp': TimestampShape,
  12664. 'float': FloatShape,
  12665. 'integer': IntegerShape,
  12666. 'string': StringShape,
  12667. 'base64': Base64Shape,
  12668. 'binary': BinaryShape
  12669. };
  12670. Shape.resolve = function resolve(shape, options) {
  12671. if (shape.shape) {
  12672. var refShape = options.api.shapes[shape.shape];
  12673. if (!refShape) {
  12674. throw new Error('Cannot find shape reference: ' + shape.shape);
  12675. }
  12676. return refShape;
  12677. } else {
  12678. return null;
  12679. }
  12680. };
  12681. Shape.create = function create(shape, options, memberName) {
  12682. if (shape.isShape) return shape;
  12683. var refShape = Shape.resolve(shape, options);
  12684. if (refShape) {
  12685. var filteredKeys = Object.keys(shape);
  12686. if (!options.documentation) {
  12687. filteredKeys = filteredKeys.filter(function(name) {
  12688. return !name.match(/documentation/);
  12689. });
  12690. }
  12691. // create an inline shape with extra members
  12692. var InlineShape = function() {
  12693. refShape.constructor.call(this, shape, options, memberName);
  12694. };
  12695. InlineShape.prototype = refShape;
  12696. return new InlineShape();
  12697. } else {
  12698. // set type if not set
  12699. if (!shape.type) {
  12700. if (shape.members) shape.type = 'structure';
  12701. else if (shape.member) shape.type = 'list';
  12702. else if (shape.key) shape.type = 'map';
  12703. else shape.type = 'string';
  12704. }
  12705. // normalize types
  12706. var origType = shape.type;
  12707. if (Shape.normalizedTypes[shape.type]) {
  12708. shape.type = Shape.normalizedTypes[shape.type];
  12709. }
  12710. if (Shape.types[shape.type]) {
  12711. return new Shape.types[shape.type](shape, options, memberName);
  12712. } else {
  12713. throw new Error('Unrecognized shape type: ' + origType);
  12714. }
  12715. }
  12716. };
  12717. function CompositeShape(shape) {
  12718. Shape.apply(this, arguments);
  12719. property(this, 'isComposite', true);
  12720. if (shape.flattened) {
  12721. property(this, 'flattened', shape.flattened || false);
  12722. }
  12723. }
  12724. function StructureShape(shape, options) {
  12725. var self = this;
  12726. var requiredMap = null, firstInit = !this.isShape;
  12727. CompositeShape.apply(this, arguments);
  12728. if (firstInit) {
  12729. property(this, 'defaultValue', function() { return {}; });
  12730. property(this, 'members', {});
  12731. property(this, 'memberNames', []);
  12732. property(this, 'required', []);
  12733. property(this, 'isRequired', function() { return false; });
  12734. }
  12735. if (shape.members) {
  12736. property(this, 'members', new Collection(shape.members, options, function(name, member) {
  12737. return Shape.create(member, options, name);
  12738. }));
  12739. memoizedProperty(this, 'memberNames', function() {
  12740. return shape.xmlOrder || Object.keys(shape.members);
  12741. });
  12742. if (shape.event) {
  12743. memoizedProperty(this, 'eventPayloadMemberName', function() {
  12744. var members = self.members;
  12745. var memberNames = self.memberNames;
  12746. // iterate over members to find ones that are event payloads
  12747. for (var i = 0, iLen = memberNames.length; i < iLen; i++) {
  12748. if (members[memberNames[i]].isEventPayload) {
  12749. return memberNames[i];
  12750. }
  12751. }
  12752. });
  12753. memoizedProperty(this, 'eventHeaderMemberNames', function() {
  12754. var members = self.members;
  12755. var memberNames = self.memberNames;
  12756. var eventHeaderMemberNames = [];
  12757. // iterate over members to find ones that are event headers
  12758. for (var i = 0, iLen = memberNames.length; i < iLen; i++) {
  12759. if (members[memberNames[i]].isEventHeader) {
  12760. eventHeaderMemberNames.push(memberNames[i]);
  12761. }
  12762. }
  12763. return eventHeaderMemberNames;
  12764. });
  12765. }
  12766. }
  12767. if (shape.required) {
  12768. property(this, 'required', shape.required);
  12769. property(this, 'isRequired', function(name) {
  12770. if (!requiredMap) {
  12771. requiredMap = {};
  12772. for (var i = 0; i < shape.required.length; i++) {
  12773. requiredMap[shape.required[i]] = true;
  12774. }
  12775. }
  12776. return requiredMap[name];
  12777. }, false, true);
  12778. }
  12779. property(this, 'resultWrapper', shape.resultWrapper || null);
  12780. if (shape.payload) {
  12781. property(this, 'payload', shape.payload);
  12782. }
  12783. if (typeof shape.xmlNamespace === 'string') {
  12784. property(this, 'xmlNamespaceUri', shape.xmlNamespace);
  12785. } else if (typeof shape.xmlNamespace === 'object') {
  12786. property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix);
  12787. property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri);
  12788. }
  12789. }
  12790. function ListShape(shape, options) {
  12791. var self = this, firstInit = !this.isShape;
  12792. CompositeShape.apply(this, arguments);
  12793. if (firstInit) {
  12794. property(this, 'defaultValue', function() { return []; });
  12795. }
  12796. if (shape.member) {
  12797. memoizedProperty(this, 'member', function() {
  12798. return Shape.create(shape.member, options);
  12799. });
  12800. }
  12801. if (this.flattened) {
  12802. var oldName = this.name;
  12803. memoizedProperty(this, 'name', function() {
  12804. return self.member.name || oldName;
  12805. });
  12806. }
  12807. }
  12808. function MapShape(shape, options) {
  12809. var firstInit = !this.isShape;
  12810. CompositeShape.apply(this, arguments);
  12811. if (firstInit) {
  12812. property(this, 'defaultValue', function() { return {}; });
  12813. property(this, 'key', Shape.create({type: 'string'}, options));
  12814. property(this, 'value', Shape.create({type: 'string'}, options));
  12815. }
  12816. if (shape.key) {
  12817. memoizedProperty(this, 'key', function() {
  12818. return Shape.create(shape.key, options);
  12819. });
  12820. }
  12821. if (shape.value) {
  12822. memoizedProperty(this, 'value', function() {
  12823. return Shape.create(shape.value, options);
  12824. });
  12825. }
  12826. }
  12827. function TimestampShape(shape) {
  12828. var self = this;
  12829. Shape.apply(this, arguments);
  12830. if (shape.timestampFormat) {
  12831. property(this, 'timestampFormat', shape.timestampFormat);
  12832. } else if (self.isTimestampFormatSet && this.timestampFormat) {
  12833. property(this, 'timestampFormat', this.timestampFormat);
  12834. } else if (this.location === 'header') {
  12835. property(this, 'timestampFormat', 'rfc822');
  12836. } else if (this.location === 'querystring') {
  12837. property(this, 'timestampFormat', 'iso8601');
  12838. } else if (this.api) {
  12839. switch (this.api.protocol) {
  12840. case 'json':
  12841. case 'rest-json':
  12842. property(this, 'timestampFormat', 'unixTimestamp');
  12843. break;
  12844. case 'rest-xml':
  12845. case 'query':
  12846. case 'ec2':
  12847. property(this, 'timestampFormat', 'iso8601');
  12848. break;
  12849. }
  12850. }
  12851. this.toType = function(value) {
  12852. if (value === null || value === undefined) return null;
  12853. if (typeof value.toUTCString === 'function') return value;
  12854. return typeof value === 'string' || typeof value === 'number' ?
  12855. util.date.parseTimestamp(value) : null;
  12856. };
  12857. this.toWireFormat = function(value) {
  12858. return util.date.format(value, self.timestampFormat);
  12859. };
  12860. }
  12861. function StringShape() {
  12862. Shape.apply(this, arguments);
  12863. var nullLessProtocols = ['rest-xml', 'query', 'ec2'];
  12864. this.toType = function(value) {
  12865. value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ?
  12866. value || '' : value;
  12867. if (this.isJsonValue) {
  12868. return JSON.parse(value);
  12869. }
  12870. return value && typeof value.toString === 'function' ?
  12871. value.toString() : value;
  12872. };
  12873. this.toWireFormat = function(value) {
  12874. return this.isJsonValue ? JSON.stringify(value) : value;
  12875. };
  12876. }
  12877. function FloatShape() {
  12878. Shape.apply(this, arguments);
  12879. this.toType = function(value) {
  12880. if (value === null || value === undefined) return null;
  12881. return parseFloat(value);
  12882. };
  12883. this.toWireFormat = this.toType;
  12884. }
  12885. function IntegerShape() {
  12886. Shape.apply(this, arguments);
  12887. this.toType = function(value) {
  12888. if (value === null || value === undefined) return null;
  12889. return parseInt(value, 10);
  12890. };
  12891. this.toWireFormat = this.toType;
  12892. }
  12893. function BinaryShape() {
  12894. Shape.apply(this, arguments);
  12895. this.toType = function(value) {
  12896. var buf = util.base64.decode(value);
  12897. if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') {
  12898. /* Node.js can create a Buffer that is not isolated.
  12899. * i.e. buf.byteLength !== buf.buffer.byteLength
  12900. * This means that the sensitive data is accessible to anyone with access to buf.buffer.
  12901. * If this is the node shared Buffer, then other code within this process _could_ find this secret.
  12902. * Copy sensitive data to an isolated Buffer and zero the sensitive data.
  12903. * While this is safe to do here, copying this code somewhere else may produce unexpected results.
  12904. */
  12905. var secureBuf = util.Buffer.alloc(buf.length, buf);
  12906. buf.fill(0);
  12907. buf = secureBuf;
  12908. }
  12909. return buf;
  12910. };
  12911. this.toWireFormat = util.base64.encode;
  12912. }
  12913. function Base64Shape() {
  12914. BinaryShape.apply(this, arguments);
  12915. }
  12916. function BooleanShape() {
  12917. Shape.apply(this, arguments);
  12918. this.toType = function(value) {
  12919. if (typeof value === 'boolean') return value;
  12920. if (value === null || value === undefined) return null;
  12921. return value === 'true';
  12922. };
  12923. }
  12924. /**
  12925. * @api private
  12926. */
  12927. Shape.shapes = {
  12928. StructureShape: StructureShape,
  12929. ListShape: ListShape,
  12930. MapShape: MapShape,
  12931. StringShape: StringShape,
  12932. BooleanShape: BooleanShape,
  12933. Base64Shape: Base64Shape
  12934. };
  12935. /**
  12936. * @api private
  12937. */
  12938. module.exports = Shape;
  12939. /***/ }),
  12940. /***/ 683:
  12941. /***/ (function(module, __unusedexports, __webpack_require__) {
  12942. var Int64 = __webpack_require__(605).Int64;
  12943. var splitMessage = __webpack_require__(175).splitMessage;
  12944. var BOOLEAN_TAG = 'boolean';
  12945. var BYTE_TAG = 'byte';
  12946. var SHORT_TAG = 'short';
  12947. var INT_TAG = 'integer';
  12948. var LONG_TAG = 'long';
  12949. var BINARY_TAG = 'binary';
  12950. var STRING_TAG = 'string';
  12951. var TIMESTAMP_TAG = 'timestamp';
  12952. var UUID_TAG = 'uuid';
  12953. /**
  12954. * @api private
  12955. *
  12956. * @param {Buffer} headers
  12957. */
  12958. function parseHeaders(headers) {
  12959. var out = {};
  12960. var position = 0;
  12961. while (position < headers.length) {
  12962. var nameLength = headers.readUInt8(position++);
  12963. var name = headers.slice(position, position + nameLength).toString();
  12964. position += nameLength;
  12965. switch (headers.readUInt8(position++)) {
  12966. case 0 /* boolTrue */:
  12967. out[name] = {
  12968. type: BOOLEAN_TAG,
  12969. value: true
  12970. };
  12971. break;
  12972. case 1 /* boolFalse */:
  12973. out[name] = {
  12974. type: BOOLEAN_TAG,
  12975. value: false
  12976. };
  12977. break;
  12978. case 2 /* byte */:
  12979. out[name] = {
  12980. type: BYTE_TAG,
  12981. value: headers.readInt8(position++)
  12982. };
  12983. break;
  12984. case 3 /* short */:
  12985. out[name] = {
  12986. type: SHORT_TAG,
  12987. value: headers.readInt16BE(position)
  12988. };
  12989. position += 2;
  12990. break;
  12991. case 4 /* integer */:
  12992. out[name] = {
  12993. type: INT_TAG,
  12994. value: headers.readInt32BE(position)
  12995. };
  12996. position += 4;
  12997. break;
  12998. case 5 /* long */:
  12999. out[name] = {
  13000. type: LONG_TAG,
  13001. value: new Int64(headers.slice(position, position + 8))
  13002. };
  13003. position += 8;
  13004. break;
  13005. case 6 /* byteArray */:
  13006. var binaryLength = headers.readUInt16BE(position);
  13007. position += 2;
  13008. out[name] = {
  13009. type: BINARY_TAG,
  13010. value: headers.slice(position, position + binaryLength)
  13011. };
  13012. position += binaryLength;
  13013. break;
  13014. case 7 /* string */:
  13015. var stringLength = headers.readUInt16BE(position);
  13016. position += 2;
  13017. out[name] = {
  13018. type: STRING_TAG,
  13019. value: headers.slice(
  13020. position,
  13021. position + stringLength
  13022. ).toString()
  13023. };
  13024. position += stringLength;
  13025. break;
  13026. case 8 /* timestamp */:
  13027. out[name] = {
  13028. type: TIMESTAMP_TAG,
  13029. value: new Date(
  13030. new Int64(headers.slice(position, position + 8))
  13031. .valueOf()
  13032. )
  13033. };
  13034. position += 8;
  13035. break;
  13036. case 9 /* uuid */:
  13037. var uuidChars = headers.slice(position, position + 16)
  13038. .toString('hex');
  13039. position += 16;
  13040. out[name] = {
  13041. type: UUID_TAG,
  13042. value: uuidChars.substr(0, 8) + '-' +
  13043. uuidChars.substr(8, 4) + '-' +
  13044. uuidChars.substr(12, 4) + '-' +
  13045. uuidChars.substr(16, 4) + '-' +
  13046. uuidChars.substr(20)
  13047. };
  13048. break;
  13049. default:
  13050. throw new Error('Unrecognized header type tag');
  13051. }
  13052. }
  13053. return out;
  13054. }
  13055. function parseMessage(message) {
  13056. var parsed = splitMessage(message);
  13057. return { headers: parseHeaders(parsed.headers), body: parsed.body };
  13058. }
  13059. /**
  13060. * @api private
  13061. */
  13062. module.exports = {
  13063. parseMessage: parseMessage
  13064. };
  13065. /***/ }),
  13066. /***/ 693:
  13067. /***/ (function(module) {
  13068. module.exports = {
  13069. //provide realtime clock for performance measurement
  13070. now: function now() {
  13071. var second = process.hrtime();
  13072. return second[0] * 1000 + (second[1] / 1000000);
  13073. }
  13074. };
  13075. /***/ }),
  13076. /***/ 694:
  13077. /***/ (function(module) {
  13078. module.exports = {"acm":{"name":"ACM","cors":true},"apigateway":{"name":"APIGateway","cors":true},"applicationautoscaling":{"prefix":"application-autoscaling","name":"ApplicationAutoScaling","cors":true},"appstream":{"name":"AppStream"},"autoscaling":{"name":"AutoScaling","cors":true},"batch":{"name":"Batch"},"budgets":{"name":"Budgets"},"clouddirectory":{"name":"CloudDirectory","versions":["2016-05-10*"]},"cloudformation":{"name":"CloudFormation","cors":true},"cloudfront":{"name":"CloudFront","versions":["2013-05-12*","2013-11-11*","2014-05-31*","2014-10-21*","2014-11-06*","2015-04-17*","2015-07-27*","2015-09-17*","2016-01-13*","2016-01-28*","2016-08-01*","2016-08-20*","2016-09-07*","2016-09-29*","2016-11-25*","2017-03-25*","2017-10-30*","2018-06-18*","2018-11-05*","2019-03-26*"],"cors":true},"cloudhsm":{"name":"CloudHSM","cors":true},"cloudsearch":{"name":"CloudSearch"},"cloudsearchdomain":{"name":"CloudSearchDomain"},"cloudtrail":{"name":"CloudTrail","cors":true},"cloudwatch":{"prefix":"monitoring","name":"CloudWatch","cors":true},"cloudwatchevents":{"prefix":"events","name":"CloudWatchEvents","versions":["2014-02-03*"],"cors":true},"cloudwatchlogs":{"prefix":"logs","name":"CloudWatchLogs","cors":true},"codebuild":{"name":"CodeBuild","cors":true},"codecommit":{"name":"CodeCommit","cors":true},"codedeploy":{"name":"CodeDeploy","cors":true},"codepipeline":{"name":"CodePipeline","cors":true},"cognitoidentity":{"prefix":"cognito-identity","name":"CognitoIdentity","cors":true},"cognitoidentityserviceprovider":{"prefix":"cognito-idp","name":"CognitoIdentityServiceProvider","cors":true},"cognitosync":{"prefix":"cognito-sync","name":"CognitoSync","cors":true},"configservice":{"prefix":"config","name":"ConfigService","cors":true},"cur":{"name":"CUR","cors":true},"datapipeline":{"name":"DataPipeline"},"devicefarm":{"name":"DeviceFarm","cors":true},"directconnect":{"name":"DirectConnect","cors":true},"directoryservice":{"prefix":"ds","name":"DirectoryService"},"discovery":{"name":"Discovery"},"dms":{"name":"DMS"},"dynamodb":{"name":"DynamoDB","cors":true},"dynamodbstreams":{"prefix":"streams.dynamodb","name":"DynamoDBStreams","cors":true},"ec2":{"name":"EC2","versions":["2013-06-15*","2013-10-15*","2014-02-01*","2014-05-01*","2014-06-15*","2014-09-01*","2014-10-01*","2015-03-01*","2015-04-15*","2015-10-01*","2016-04-01*","2016-09-15*"],"cors":true},"ecr":{"name":"ECR","cors":true},"ecs":{"name":"ECS","cors":true},"efs":{"prefix":"elasticfilesystem","name":"EFS","cors":true},"elasticache":{"name":"ElastiCache","versions":["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],"cors":true},"elasticbeanstalk":{"name":"ElasticBeanstalk","cors":true},"elb":{"prefix":"elasticloadbalancing","name":"ELB","cors":true},"elbv2":{"prefix":"elasticloadbalancingv2","name":"ELBv2","cors":true},"emr":{"prefix":"elasticmapreduce","name":"EMR","cors":true},"es":{"name":"ES"},"elastictranscoder":{"name":"ElasticTranscoder","cors":true},"firehose":{"name":"Firehose","cors":true},"gamelift":{"name":"GameLift","cors":true},"glacier":{"name":"Glacier"},"health":{"name":"Health"},"iam":{"name":"IAM","cors":true},"importexport":{"name":"ImportExport"},"inspector":{"name":"Inspector","versions":["2015-08-18*"],"cors":true},"iot":{"name":"Iot","cors":true},"iotdata":{"prefix":"iot-data","name":"IotData","cors":true},"kinesis":{"name":"Kinesis","cors":true},"kinesisanalytics":{"name":"KinesisAnalytics"},"kms":{"name":"KMS","cors":true},"lambda":{"name":"Lambda","cors":true},"lexruntime":{"prefix":"runtime.lex","name":"LexRuntime","cors":true},"lightsail":{"name":"Lightsail"},"machinelearning":{"name":"MachineLearning","cors":true},"marketplacecommerceanalytics":{"name":"MarketplaceCommerceAnalytics","cors":true},"marketplacemetering":{"prefix":"meteringmarketplace","name":"MarketplaceMetering"},"mturk":{"prefix":"mturk-requester","name":"MTurk","cors":true},"mobileanalytics":{"name":"MobileAnalytics","cors":true},"opsworks":{"name":"OpsWorks","cors":true},"opsworkscm":{"name":"OpsWorksCM"},"organizations":{"name":"Organizations"},"pinpoint":{"name":"Pinpoint"},"polly":{"name":"Polly","cors":true},"rds":{"name":"RDS","versions":["2014-09-01*"],"cors":true},"redshift":{"name":"Redshift","cors":true},"rekognition":{"name":"Rekognition","cors":true},"resourcegroupstaggingapi":{"name":"ResourceGroupsTaggingAPI"},"route53":{"name":"Route53","cors":true},"route53domains":{"name":"Route53Domains","cors":true},"s3":{"name":"S3","dualstackAvailable":true,"cors":true},"s3control":{"name":"S3Control","dualstackAvailable":true,"xmlNoDefaultLists":true},"servicecatalog":{"name":"ServiceCatalog","cors":true},"ses":{"prefix":"email","name":"SES","cors":true},"shield":{"name":"Shield"},"simpledb":{"prefix":"sdb","name":"SimpleDB"},"sms":{"name":"SMS"},"snowball":{"name":"Snowball"},"sns":{"name":"SNS","cors":true},"sqs":{"name":"SQS","cors":true},"ssm":{"name":"SSM","cors":true},"storagegateway":{"name":"StorageGateway","cors":true},"stepfunctions":{"prefix":"states","name":"StepFunctions"},"sts":{"name":"STS","cors":true},"support":{"name":"Support"},"swf":{"name":"SWF"},"xray":{"name":"XRay","cors":true},"waf":{"name":"WAF","cors":true},"wafregional":{"prefix":"waf-regional","name":"WAFRegional"},"workdocs":{"name":"WorkDocs","cors":true},"workspaces":{"name":"WorkSpaces"},"codestar":{"name":"CodeStar"},"lexmodelbuildingservice":{"prefix":"lex-models","name":"LexModelBuildingService","cors":true},"marketplaceentitlementservice":{"prefix":"entitlement.marketplace","name":"MarketplaceEntitlementService"},"athena":{"name":"Athena"},"greengrass":{"name":"Greengrass"},"dax":{"name":"DAX"},"migrationhub":{"prefix":"AWSMigrationHub","name":"MigrationHub"},"cloudhsmv2":{"name":"CloudHSMV2"},"glue":{"name":"Glue"},"mobile":{"name":"Mobile"},"pricing":{"name":"Pricing","cors":true},"costexplorer":{"prefix":"ce","name":"CostExplorer","cors":true},"mediaconvert":{"name":"MediaConvert"},"medialive":{"name":"MediaLive"},"mediapackage":{"name":"MediaPackage"},"mediastore":{"name":"MediaStore"},"mediastoredata":{"prefix":"mediastore-data","name":"MediaStoreData","cors":true},"appsync":{"name":"AppSync"},"guardduty":{"name":"GuardDuty"},"mq":{"name":"MQ"},"comprehend":{"name":"Comprehend","cors":true},"iotjobsdataplane":{"prefix":"iot-jobs-data","name":"IoTJobsDataPlane"},"kinesisvideoarchivedmedia":{"prefix":"kinesis-video-archived-media","name":"KinesisVideoArchivedMedia","cors":true},"kinesisvideomedia":{"prefix":"kinesis-video-media","name":"KinesisVideoMedia","cors":true},"kinesisvideo":{"name":"KinesisVideo","cors":true},"sagemakerruntime":{"prefix":"runtime.sagemaker","name":"SageMakerRuntime"},"sagemaker":{"name":"SageMaker"},"translate":{"name":"Translate","cors":true},"resourcegroups":{"prefix":"resource-groups","name":"ResourceGroups","cors":true},"alexaforbusiness":{"name":"AlexaForBusiness"},"cloud9":{"name":"Cloud9"},"serverlessapplicationrepository":{"prefix":"serverlessrepo","name":"ServerlessApplicationRepository"},"servicediscovery":{"name":"ServiceDiscovery"},"workmail":{"name":"WorkMail"},"autoscalingplans":{"prefix":"autoscaling-plans","name":"AutoScalingPlans"},"transcribeservice":{"prefix":"transcribe","name":"TranscribeService"},"connect":{"name":"Connect","cors":true},"acmpca":{"prefix":"acm-pca","name":"ACMPCA"},"fms":{"name":"FMS"},"secretsmanager":{"name":"SecretsManager","cors":true},"iotanalytics":{"name":"IoTAnalytics","cors":true},"iot1clickdevicesservice":{"prefix":"iot1click-devices","name":"IoT1ClickDevicesService"},"iot1clickprojects":{"prefix":"iot1click-projects","name":"IoT1ClickProjects"},"pi":{"name":"PI"},"neptune":{"name":"Neptune"},"mediatailor":{"name":"MediaTailor"},"eks":{"name":"EKS"},"macie":{"name":"Macie"},"dlm":{"name":"DLM"},"signer":{"name":"Signer"},"chime":{"name":"Chime"},"pinpointemail":{"prefix":"pinpoint-email","name":"PinpointEmail"},"ram":{"name":"RAM"},"route53resolver":{"name":"Route53Resolver"},"pinpointsmsvoice":{"prefix":"sms-voice","name":"PinpointSMSVoice"},"quicksight":{"name":"QuickSight"},"rdsdataservice":{"prefix":"rds-data","name":"RDSDataService"},"amplify":{"name":"Amplify"},"datasync":{"name":"DataSync"},"robomaker":{"name":"RoboMaker"},"transfer":{"name":"Transfer"},"globalaccelerator":{"name":"GlobalAccelerator"},"comprehendmedical":{"name":"ComprehendMedical","cors":true},"kinesisanalyticsv2":{"name":"KinesisAnalyticsV2"},"mediaconnect":{"name":"MediaConnect"},"fsx":{"name":"FSx"},"securityhub":{"name":"SecurityHub"},"appmesh":{"name":"AppMesh","versions":["2018-10-01*"]},"licensemanager":{"prefix":"license-manager","name":"LicenseManager"},"kafka":{"name":"Kafka"},"apigatewaymanagementapi":{"name":"ApiGatewayManagementApi"},"apigatewayv2":{"name":"ApiGatewayV2"},"docdb":{"name":"DocDB"},"backup":{"name":"Backup"},"worklink":{"name":"WorkLink"},"textract":{"name":"Textract"},"managedblockchain":{"name":"ManagedBlockchain"},"mediapackagevod":{"prefix":"mediapackage-vod","name":"MediaPackageVod"},"groundstation":{"name":"GroundStation"},"iotthingsgraph":{"name":"IoTThingsGraph"},"iotevents":{"name":"IoTEvents"},"ioteventsdata":{"prefix":"iotevents-data","name":"IoTEventsData"},"personalize":{"name":"Personalize","cors":true},"personalizeevents":{"prefix":"personalize-events","name":"PersonalizeEvents","cors":true},"personalizeruntime":{"prefix":"personalize-runtime","name":"PersonalizeRuntime","cors":true},"applicationinsights":{"prefix":"application-insights","name":"ApplicationInsights"},"servicequotas":{"prefix":"service-quotas","name":"ServiceQuotas"},"ec2instanceconnect":{"prefix":"ec2-instance-connect","name":"EC2InstanceConnect"},"eventbridge":{"name":"EventBridge"},"lakeformation":{"name":"LakeFormation"},"forecastservice":{"prefix":"forecast","name":"ForecastService","cors":true},"forecastqueryservice":{"prefix":"forecastquery","name":"ForecastQueryService","cors":true},"qldb":{"name":"QLDB"},"qldbsession":{"prefix":"qldb-session","name":"QLDBSession"},"workmailmessageflow":{"name":"WorkMailMessageFlow"},"codestarnotifications":{"prefix":"codestar-notifications","name":"CodeStarNotifications"},"savingsplans":{"name":"SavingsPlans"},"sso":{"name":"SSO"},"ssooidc":{"prefix":"sso-oidc","name":"SSOOIDC"},"marketplacecatalog":{"prefix":"marketplace-catalog","name":"MarketplaceCatalog"},"dataexchange":{"name":"DataExchange"},"sesv2":{"name":"SESV2"},"migrationhubconfig":{"prefix":"migrationhub-config","name":"MigrationHubConfig"},"connectparticipant":{"name":"ConnectParticipant"},"appconfig":{"name":"AppConfig"},"iotsecuretunneling":{"name":"IoTSecureTunneling"},"wafv2":{"name":"WAFV2"},"elasticinference":{"prefix":"elastic-inference","name":"ElasticInference"},"imagebuilder":{"name":"Imagebuilder"},"schemas":{"name":"Schemas"},"accessanalyzer":{"name":"AccessAnalyzer"},"codegurureviewer":{"prefix":"codeguru-reviewer","name":"CodeGuruReviewer"},"codeguruprofiler":{"name":"CodeGuruProfiler"},"computeoptimizer":{"prefix":"compute-optimizer","name":"ComputeOptimizer"},"frauddetector":{"name":"FraudDetector"},"kendra":{"name":"Kendra"},"networkmanager":{"name":"NetworkManager"},"outposts":{"name":"Outposts"},"augmentedairuntime":{"prefix":"sagemaker-a2i-runtime","name":"AugmentedAIRuntime"},"ebs":{"name":"EBS"},"kinesisvideosignalingchannels":{"prefix":"kinesis-video-signaling","name":"KinesisVideoSignalingChannels","cors":true},"detective":{"name":"Detective"},"codestarconnections":{"prefix":"codestar-connections","name":"CodeStarconnections"},"synthetics":{"name":"Synthetics"},"iotsitewise":{"name":"IoTSiteWise"},"macie2":{"name":"Macie2"},"codeartifact":{"name":"CodeArtifact"},"honeycode":{"name":"Honeycode"},"ivs":{"name":"IVS"},"braket":{"name":"Braket"},"identitystore":{"name":"IdentityStore"},"appflow":{"name":"Appflow"},"redshiftdata":{"prefix":"redshift-data","name":"RedshiftData"},"ssoadmin":{"prefix":"sso-admin","name":"SSOAdmin"},"timestreamquery":{"prefix":"timestream-query","name":"TimestreamQuery"},"timestreamwrite":{"prefix":"timestream-write","name":"TimestreamWrite"},"s3outposts":{"name":"S3Outposts"},"databrew":{"name":"DataBrew"},"servicecatalogappregistry":{"prefix":"servicecatalog-appregistry","name":"ServiceCatalogAppRegistry"},"networkfirewall":{"prefix":"network-firewall","name":"NetworkFirewall"},"mwaa":{"name":"MWAA"},"amplifybackend":{"name":"AmplifyBackend"},"appintegrations":{"name":"AppIntegrations"},"connectcontactlens":{"prefix":"connect-contact-lens","name":"ConnectContactLens"},"devopsguru":{"prefix":"devops-guru","name":"DevOpsGuru"},"ecrpublic":{"prefix":"ecr-public","name":"ECRPUBLIC"},"lookoutvision":{"name":"LookoutVision"},"sagemakerfeaturestoreruntime":{"prefix":"sagemaker-featurestore-runtime","name":"SageMakerFeatureStoreRuntime"},"customerprofiles":{"prefix":"customer-profiles","name":"CustomerProfiles"},"auditmanager":{"name":"AuditManager"},"emrcontainers":{"prefix":"emr-containers","name":"EMRcontainers"},"healthlake":{"name":"HealthLake"},"sagemakeredge":{"prefix":"sagemaker-edge","name":"SagemakerEdge"},"amp":{"name":"Amp"},"greengrassv2":{"name":"GreengrassV2"},"iotdeviceadvisor":{"name":"IotDeviceAdvisor"},"iotfleethub":{"name":"IoTFleetHub"},"iotwireless":{"name":"IoTWireless"},"location":{"name":"Location"},"wellarchitected":{"name":"WellArchitected"}};
  13079. /***/ }),
  13080. /***/ 696:
  13081. /***/ (function(module) {
  13082. function AcceptorStateMachine(states, state) {
  13083. this.currentState = state || null;
  13084. this.states = states || {};
  13085. }
  13086. AcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) {
  13087. if (typeof finalState === 'function') {
  13088. inputError = bindObject; bindObject = done;
  13089. done = finalState; finalState = null;
  13090. }
  13091. var self = this;
  13092. var state = self.states[self.currentState];
  13093. state.fn.call(bindObject || self, inputError, function(err) {
  13094. if (err) {
  13095. if (state.fail) self.currentState = state.fail;
  13096. else return done ? done.call(bindObject, err) : null;
  13097. } else {
  13098. if (state.accept) self.currentState = state.accept;
  13099. else return done ? done.call(bindObject) : null;
  13100. }
  13101. if (self.currentState === finalState) {
  13102. return done ? done.call(bindObject, err) : null;
  13103. }
  13104. self.runTo(finalState, done, bindObject, err);
  13105. });
  13106. };
  13107. AcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) {
  13108. if (typeof acceptState === 'function') {
  13109. fn = acceptState; acceptState = null; failState = null;
  13110. } else if (typeof failState === 'function') {
  13111. fn = failState; failState = null;
  13112. }
  13113. if (!this.currentState) this.currentState = name;
  13114. this.states[name] = { accept: acceptState, fail: failState, fn: fn };
  13115. return this;
  13116. };
  13117. /**
  13118. * @api private
  13119. */
  13120. module.exports = AcceptorStateMachine;
  13121. /***/ }),
  13122. /***/ 701:
  13123. /***/ (function(module, __unusedexports, __webpack_require__) {
  13124. var util = __webpack_require__(395).util;
  13125. var dgram = __webpack_require__(200);
  13126. var stringToBuffer = util.buffer.toBuffer;
  13127. var MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB
  13128. /**
  13129. * Publishes metrics via udp.
  13130. * @param {object} options Paramters for Publisher constructor
  13131. * @param {number} [options.port = 31000] Port number
  13132. * @param {string} [options.clientId = ''] Client Identifier
  13133. * @param {boolean} [options.enabled = false] enable sending metrics datagram
  13134. * @api private
  13135. */
  13136. function Publisher(options) {
  13137. // handle configuration
  13138. options = options || {};
  13139. this.enabled = options.enabled || false;
  13140. this.port = options.port || 31000;
  13141. this.clientId = options.clientId || '';
  13142. this.address = options.host || '127.0.0.1';
  13143. if (this.clientId.length > 255) {
  13144. // ClientId has a max length of 255
  13145. this.clientId = this.clientId.substr(0, 255);
  13146. }
  13147. this.messagesInFlight = 0;
  13148. }
  13149. Publisher.prototype.fieldsToTrim = {
  13150. UserAgent: 256,
  13151. SdkException: 128,
  13152. SdkExceptionMessage: 512,
  13153. AwsException: 128,
  13154. AwsExceptionMessage: 512,
  13155. FinalSdkException: 128,
  13156. FinalSdkExceptionMessage: 512,
  13157. FinalAwsException: 128,
  13158. FinalAwsExceptionMessage: 512
  13159. };
  13160. /**
  13161. * Trims fields that have a specified max length.
  13162. * @param {object} event ApiCall or ApiCallAttempt event.
  13163. * @returns {object}
  13164. * @api private
  13165. */
  13166. Publisher.prototype.trimFields = function(event) {
  13167. var trimmableFields = Object.keys(this.fieldsToTrim);
  13168. for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) {
  13169. var field = trimmableFields[i];
  13170. if (event.hasOwnProperty(field)) {
  13171. var maxLength = this.fieldsToTrim[field];
  13172. var value = event[field];
  13173. if (value && value.length > maxLength) {
  13174. event[field] = value.substr(0, maxLength);
  13175. }
  13176. }
  13177. }
  13178. return event;
  13179. };
  13180. /**
  13181. * Handles ApiCall and ApiCallAttempt events.
  13182. * @param {Object} event apiCall or apiCallAttempt event.
  13183. * @api private
  13184. */
  13185. Publisher.prototype.eventHandler = function(event) {
  13186. // set the clientId
  13187. event.ClientId = this.clientId;
  13188. this.trimFields(event);
  13189. var message = stringToBuffer(JSON.stringify(event));
  13190. if (!this.enabled || message.length > MAX_MESSAGE_SIZE) {
  13191. // drop the message if publisher not enabled or it is too large
  13192. return;
  13193. }
  13194. this.publishDatagram(message);
  13195. };
  13196. /**
  13197. * Publishes message to an agent.
  13198. * @param {Buffer} message JSON message to send to agent.
  13199. * @api private
  13200. */
  13201. Publisher.prototype.publishDatagram = function(message) {
  13202. var self = this;
  13203. var client = this.getClient();
  13204. this.messagesInFlight++;
  13205. this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) {
  13206. if (--self.messagesInFlight <= 0) {
  13207. // destroy existing client so the event loop isn't kept open
  13208. self.destroyClient();
  13209. }
  13210. });
  13211. };
  13212. /**
  13213. * Returns an existing udp socket, or creates one if it doesn't already exist.
  13214. * @api private
  13215. */
  13216. Publisher.prototype.getClient = function() {
  13217. if (!this.client) {
  13218. this.client = dgram.createSocket('udp4');
  13219. }
  13220. return this.client;
  13221. };
  13222. /**
  13223. * Destroys the udp socket.
  13224. * @api private
  13225. */
  13226. Publisher.prototype.destroyClient = function() {
  13227. if (this.client) {
  13228. this.client.close();
  13229. this.client = void 0;
  13230. }
  13231. };
  13232. module.exports = {
  13233. Publisher: Publisher
  13234. };
  13235. /***/ }),
  13236. /***/ 703:
  13237. /***/ (function(module, __unusedexports, __webpack_require__) {
  13238. "use strict";
  13239. var alphabet = __webpack_require__(963);
  13240. var build = __webpack_require__(713);
  13241. var isValid = __webpack_require__(182);
  13242. // if you are using cluster or multiple servers use this to make each instance
  13243. // has a unique value for worker
  13244. // Note: I don't know if this is automatically set when using third
  13245. // party cluster solutions such as pm2.
  13246. var clusterWorkerId = __webpack_require__(600) || 0;
  13247. /**
  13248. * Set the seed.
  13249. * Highly recommended if you don't want people to try to figure out your id schema.
  13250. * exposed as shortid.seed(int)
  13251. * @param seed Integer value to seed the random alphabet. ALWAYS USE THE SAME SEED or you might get overlaps.
  13252. */
  13253. function seed(seedValue) {
  13254. alphabet.seed(seedValue);
  13255. return module.exports;
  13256. }
  13257. /**
  13258. * Set the cluster worker or machine id
  13259. * exposed as shortid.worker(int)
  13260. * @param workerId worker must be positive integer. Number less than 16 is recommended.
  13261. * returns shortid module so it can be chained.
  13262. */
  13263. function worker(workerId) {
  13264. clusterWorkerId = workerId;
  13265. return module.exports;
  13266. }
  13267. /**
  13268. *
  13269. * sets new characters to use in the alphabet
  13270. * returns the shuffled alphabet
  13271. */
  13272. function characters(newCharacters) {
  13273. if (newCharacters !== undefined) {
  13274. alphabet.characters(newCharacters);
  13275. }
  13276. return alphabet.shuffled();
  13277. }
  13278. /**
  13279. * Generate unique id
  13280. * Returns string id
  13281. */
  13282. function generate() {
  13283. return build(clusterWorkerId);
  13284. }
  13285. // Export all other functions as properties of the generate function
  13286. module.exports = generate;
  13287. module.exports.generate = generate;
  13288. module.exports.seed = seed;
  13289. module.exports.worker = worker;
  13290. module.exports.characters = characters;
  13291. module.exports.isValid = isValid;
  13292. /***/ }),
  13293. /***/ 707:
  13294. /***/ (function(module) {
  13295. module.exports = {"pagination":{"ListBuckets":{"result_key":"Buckets"},"ListMultipartUploads":{"input_token":["KeyMarker","UploadIdMarker"],"limit_key":"MaxUploads","more_results":"IsTruncated","output_token":["NextKeyMarker","NextUploadIdMarker"],"result_key":["Uploads","CommonPrefixes"]},"ListObjectVersions":{"input_token":["KeyMarker","VersionIdMarker"],"limit_key":"MaxKeys","more_results":"IsTruncated","output_token":["NextKeyMarker","NextVersionIdMarker"],"result_key":["Versions","DeleteMarkers","CommonPrefixes"]},"ListObjects":{"input_token":"Marker","limit_key":"MaxKeys","more_results":"IsTruncated","output_token":"NextMarker || Contents[-1].Key","result_key":["Contents","CommonPrefixes"]},"ListObjectsV2":{"input_token":"ContinuationToken","limit_key":"MaxKeys","output_token":"NextContinuationToken","result_key":["Contents","CommonPrefixes"]},"ListParts":{"input_token":"PartNumberMarker","limit_key":"MaxParts","more_results":"IsTruncated","output_token":"NextPartNumberMarker","result_key":"Parts"}}};
  13296. /***/ }),
  13297. /***/ 708:
  13298. /***/ (function(module, __unusedexports, __webpack_require__) {
  13299. // Generated by CoffeeScript 1.12.7
  13300. (function() {
  13301. var XMLNode, XMLText,
  13302. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13303. hasProp = {}.hasOwnProperty;
  13304. XMLNode = __webpack_require__(855);
  13305. module.exports = XMLText = (function(superClass) {
  13306. extend(XMLText, superClass);
  13307. function XMLText(parent, text) {
  13308. XMLText.__super__.constructor.call(this, parent);
  13309. if (text == null) {
  13310. throw new Error("Missing element text");
  13311. }
  13312. this.value = this.stringify.eleText(text);
  13313. }
  13314. XMLText.prototype.clone = function() {
  13315. return Object.create(this);
  13316. };
  13317. XMLText.prototype.toString = function(options) {
  13318. return this.options.writer.set(options).text(this);
  13319. };
  13320. return XMLText;
  13321. })(XMLNode);
  13322. }).call(this);
  13323. /***/ }),
  13324. /***/ 711:
  13325. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  13326. var AWS = __webpack_require__(395);
  13327. var inherit = AWS.util.inherit;
  13328. /**
  13329. * The endpoint that a service will talk to, for example,
  13330. * `'https://ec2.ap-southeast-1.amazonaws.com'`. If
  13331. * you need to override an endpoint for a service, you can
  13332. * set the endpoint on a service by passing the endpoint
  13333. * object with the `endpoint` option key:
  13334. *
  13335. * ```javascript
  13336. * var ep = new AWS.Endpoint('awsproxy.example.com');
  13337. * var s3 = new AWS.S3({endpoint: ep});
  13338. * s3.service.endpoint.hostname == 'awsproxy.example.com'
  13339. * ```
  13340. *
  13341. * Note that if you do not specify a protocol, the protocol will
  13342. * be selected based on your current {AWS.config} configuration.
  13343. *
  13344. * @!attribute protocol
  13345. * @return [String] the protocol (http or https) of the endpoint
  13346. * URL
  13347. * @!attribute hostname
  13348. * @return [String] the host portion of the endpoint, e.g.,
  13349. * example.com
  13350. * @!attribute host
  13351. * @return [String] the host portion of the endpoint including
  13352. * the port, e.g., example.com:80
  13353. * @!attribute port
  13354. * @return [Integer] the port of the endpoint
  13355. * @!attribute href
  13356. * @return [String] the full URL of the endpoint
  13357. */
  13358. AWS.Endpoint = inherit({
  13359. /**
  13360. * @overload Endpoint(endpoint)
  13361. * Constructs a new endpoint given an endpoint URL. If the
  13362. * URL omits a protocol (http or https), the default protocol
  13363. * set in the global {AWS.config} will be used.
  13364. * @param endpoint [String] the URL to construct an endpoint from
  13365. */
  13366. constructor: function Endpoint(endpoint, config) {
  13367. AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']);
  13368. if (typeof endpoint === 'undefined' || endpoint === null) {
  13369. throw new Error('Invalid endpoint: ' + endpoint);
  13370. } else if (typeof endpoint !== 'string') {
  13371. return AWS.util.copy(endpoint);
  13372. }
  13373. if (!endpoint.match(/^http/)) {
  13374. var useSSL = config && config.sslEnabled !== undefined ?
  13375. config.sslEnabled : AWS.config.sslEnabled;
  13376. endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint;
  13377. }
  13378. AWS.util.update(this, AWS.util.urlParse(endpoint));
  13379. // Ensure the port property is set as an integer
  13380. if (this.port) {
  13381. this.port = parseInt(this.port, 10);
  13382. } else {
  13383. this.port = this.protocol === 'https:' ? 443 : 80;
  13384. }
  13385. }
  13386. });
  13387. /**
  13388. * The low level HTTP request object, encapsulating all HTTP header
  13389. * and body data sent by a service request.
  13390. *
  13391. * @!attribute method
  13392. * @return [String] the HTTP method of the request
  13393. * @!attribute path
  13394. * @return [String] the path portion of the URI, e.g.,
  13395. * "/list/?start=5&num=10"
  13396. * @!attribute headers
  13397. * @return [map<String,String>]
  13398. * a map of header keys and their respective values
  13399. * @!attribute body
  13400. * @return [String] the request body payload
  13401. * @!attribute endpoint
  13402. * @return [AWS.Endpoint] the endpoint for the request
  13403. * @!attribute region
  13404. * @api private
  13405. * @return [String] the region, for signing purposes only.
  13406. */
  13407. AWS.HttpRequest = inherit({
  13408. /**
  13409. * @api private
  13410. */
  13411. constructor: function HttpRequest(endpoint, region) {
  13412. endpoint = new AWS.Endpoint(endpoint);
  13413. this.method = 'POST';
  13414. this.path = endpoint.path || '/';
  13415. this.headers = {};
  13416. this.body = '';
  13417. this.endpoint = endpoint;
  13418. this.region = region;
  13419. this._userAgent = '';
  13420. this.setUserAgent();
  13421. },
  13422. /**
  13423. * @api private
  13424. */
  13425. setUserAgent: function setUserAgent() {
  13426. this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent();
  13427. },
  13428. getUserAgentHeaderName: function getUserAgentHeaderName() {
  13429. var prefix = AWS.util.isBrowser() ? 'X-Amz-' : '';
  13430. return prefix + 'User-Agent';
  13431. },
  13432. /**
  13433. * @api private
  13434. */
  13435. appendToUserAgent: function appendToUserAgent(agentPartial) {
  13436. if (typeof agentPartial === 'string' && agentPartial) {
  13437. this._userAgent += ' ' + agentPartial;
  13438. }
  13439. this.headers[this.getUserAgentHeaderName()] = this._userAgent;
  13440. },
  13441. /**
  13442. * @api private
  13443. */
  13444. getUserAgent: function getUserAgent() {
  13445. return this._userAgent;
  13446. },
  13447. /**
  13448. * @return [String] the part of the {path} excluding the
  13449. * query string
  13450. */
  13451. pathname: function pathname() {
  13452. return this.path.split('?', 1)[0];
  13453. },
  13454. /**
  13455. * @return [String] the query string portion of the {path}
  13456. */
  13457. search: function search() {
  13458. var query = this.path.split('?', 2)[1];
  13459. if (query) {
  13460. query = AWS.util.queryStringParse(query);
  13461. return AWS.util.queryParamsToString(query);
  13462. }
  13463. return '';
  13464. },
  13465. /**
  13466. * @api private
  13467. * update httpRequest endpoint with endpoint string
  13468. */
  13469. updateEndpoint: function updateEndpoint(endpointStr) {
  13470. var newEndpoint = new AWS.Endpoint(endpointStr);
  13471. this.endpoint = newEndpoint;
  13472. this.path = newEndpoint.path || '/';
  13473. if (this.headers['Host']) {
  13474. this.headers['Host'] = newEndpoint.host;
  13475. }
  13476. }
  13477. });
  13478. /**
  13479. * The low level HTTP response object, encapsulating all HTTP header
  13480. * and body data returned from the request.
  13481. *
  13482. * @!attribute statusCode
  13483. * @return [Integer] the HTTP status code of the response (e.g., 200, 404)
  13484. * @!attribute headers
  13485. * @return [map<String,String>]
  13486. * a map of response header keys and their respective values
  13487. * @!attribute body
  13488. * @return [String] the response body payload
  13489. * @!attribute [r] streaming
  13490. * @return [Boolean] whether this response is being streamed at a low-level.
  13491. * Defaults to `false` (buffered reads). Do not modify this manually, use
  13492. * {createUnbufferedStream} to convert the stream to unbuffered mode
  13493. * instead.
  13494. */
  13495. AWS.HttpResponse = inherit({
  13496. /**
  13497. * @api private
  13498. */
  13499. constructor: function HttpResponse() {
  13500. this.statusCode = undefined;
  13501. this.headers = {};
  13502. this.body = undefined;
  13503. this.streaming = false;
  13504. this.stream = null;
  13505. },
  13506. /**
  13507. * Disables buffering on the HTTP response and returns the stream for reading.
  13508. * @return [Stream, XMLHttpRequest, null] the underlying stream object.
  13509. * Use this object to directly read data off of the stream.
  13510. * @note This object is only available after the {AWS.Request~httpHeaders}
  13511. * event has fired. This method must be called prior to
  13512. * {AWS.Request~httpData}.
  13513. * @example Taking control of a stream
  13514. * request.on('httpHeaders', function(statusCode, headers) {
  13515. * if (statusCode < 300) {
  13516. * if (headers.etag === 'xyz') {
  13517. * // pipe the stream, disabling buffering
  13518. * var stream = this.response.httpResponse.createUnbufferedStream();
  13519. * stream.pipe(process.stdout);
  13520. * } else { // abort this request and set a better error message
  13521. * this.abort();
  13522. * this.response.error = new Error('Invalid ETag');
  13523. * }
  13524. * }
  13525. * }).send(console.log);
  13526. */
  13527. createUnbufferedStream: function createUnbufferedStream() {
  13528. this.streaming = true;
  13529. return this.stream;
  13530. }
  13531. });
  13532. AWS.HttpClient = inherit({});
  13533. /**
  13534. * @api private
  13535. */
  13536. AWS.HttpClient.getInstance = function getInstance() {
  13537. if (this.singleton === undefined) {
  13538. this.singleton = new this();
  13539. }
  13540. return this.singleton;
  13541. };
  13542. /***/ }),
  13543. /***/ 713:
  13544. /***/ (function(module, __unusedexports, __webpack_require__) {
  13545. "use strict";
  13546. var generate = __webpack_require__(482);
  13547. var alphabet = __webpack_require__(963);
  13548. // Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness.
  13549. // This number should be updated every year or so to keep the generated id short.
  13550. // To regenerate `new Date() - 0` and bump the version. Always bump the version!
  13551. var REDUCE_TIME = 1567752802062;
  13552. // don't change unless we change the algos or REDUCE_TIME
  13553. // must be an integer and less than 16
  13554. var version = 7;
  13555. // Counter is used when shortid is called multiple times in one second.
  13556. var counter;
  13557. // Remember the last time shortid was called in case counter is needed.
  13558. var previousSeconds;
  13559. /**
  13560. * Generate unique id
  13561. * Returns string id
  13562. */
  13563. function build(clusterWorkerId) {
  13564. var str = '';
  13565. var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);
  13566. if (seconds === previousSeconds) {
  13567. counter++;
  13568. } else {
  13569. counter = 0;
  13570. previousSeconds = seconds;
  13571. }
  13572. str = str + generate(version);
  13573. str = str + generate(clusterWorkerId);
  13574. if (counter > 0) {
  13575. str = str + generate(counter);
  13576. }
  13577. str = str + generate(seconds);
  13578. return str;
  13579. }
  13580. module.exports = build;
  13581. /***/ }),
  13582. /***/ 715:
  13583. /***/ (function(module) {
  13584. module.exports = {"version":"2.0","metadata":{"apiVersion":"2011-06-15","endpointPrefix":"sts","globalEndpoint":"sts.amazonaws.com","protocol":"query","serviceAbbreviation":"AWS STS","serviceFullName":"AWS Security Token Service","serviceId":"STS","signatureVersion":"v4","uid":"sts-2011-06-15","xmlNamespace":"https://sts.amazonaws.com/doc/2011-06-15/"},"operations":{"AssumeRole":{"input":{"type":"structure","required":["RoleArn","RoleSessionName"],"members":{"RoleArn":{},"RoleSessionName":{},"PolicyArns":{"shape":"S4"},"Policy":{},"DurationSeconds":{"type":"integer"},"Tags":{"shape":"S8"},"TransitiveTagKeys":{"type":"list","member":{}},"ExternalId":{},"SerialNumber":{},"TokenCode":{}}},"output":{"resultWrapper":"AssumeRoleResult","type":"structure","members":{"Credentials":{"shape":"Sh"},"AssumedRoleUser":{"shape":"Sm"},"PackedPolicySize":{"type":"integer"}}}},"AssumeRoleWithSAML":{"input":{"type":"structure","required":["RoleArn","PrincipalArn","SAMLAssertion"],"members":{"RoleArn":{},"PrincipalArn":{},"SAMLAssertion":{},"PolicyArns":{"shape":"S4"},"Policy":{},"DurationSeconds":{"type":"integer"}}},"output":{"resultWrapper":"AssumeRoleWithSAMLResult","type":"structure","members":{"Credentials":{"shape":"Sh"},"AssumedRoleUser":{"shape":"Sm"},"PackedPolicySize":{"type":"integer"},"Subject":{},"SubjectType":{},"Issuer":{},"Audience":{},"NameQualifier":{}}}},"AssumeRoleWithWebIdentity":{"input":{"type":"structure","required":["RoleArn","RoleSessionName","WebIdentityToken"],"members":{"RoleArn":{},"RoleSessionName":{},"WebIdentityToken":{},"ProviderId":{},"PolicyArns":{"shape":"S4"},"Policy":{},"DurationSeconds":{"type":"integer"}}},"output":{"resultWrapper":"AssumeRoleWithWebIdentityResult","type":"structure","members":{"Credentials":{"shape":"Sh"},"SubjectFromWebIdentityToken":{},"AssumedRoleUser":{"shape":"Sm"},"PackedPolicySize":{"type":"integer"},"Provider":{},"Audience":{}}}},"DecodeAuthorizationMessage":{"input":{"type":"structure","required":["EncodedMessage"],"members":{"EncodedMessage":{}}},"output":{"resultWrapper":"DecodeAuthorizationMessageResult","type":"structure","members":{"DecodedMessage":{}}}},"GetAccessKeyInfo":{"input":{"type":"structure","required":["AccessKeyId"],"members":{"AccessKeyId":{}}},"output":{"resultWrapper":"GetAccessKeyInfoResult","type":"structure","members":{"Account":{}}}},"GetCallerIdentity":{"input":{"type":"structure","members":{}},"output":{"resultWrapper":"GetCallerIdentityResult","type":"structure","members":{"UserId":{},"Account":{},"Arn":{}}}},"GetFederationToken":{"input":{"type":"structure","required":["Name"],"members":{"Name":{},"Policy":{},"PolicyArns":{"shape":"S4"},"DurationSeconds":{"type":"integer"},"Tags":{"shape":"S8"}}},"output":{"resultWrapper":"GetFederationTokenResult","type":"structure","members":{"Credentials":{"shape":"Sh"},"FederatedUser":{"type":"structure","required":["FederatedUserId","Arn"],"members":{"FederatedUserId":{},"Arn":{}}},"PackedPolicySize":{"type":"integer"}}}},"GetSessionToken":{"input":{"type":"structure","members":{"DurationSeconds":{"type":"integer"},"SerialNumber":{},"TokenCode":{}}},"output":{"resultWrapper":"GetSessionTokenResult","type":"structure","members":{"Credentials":{"shape":"Sh"}}}}},"shapes":{"S4":{"type":"list","member":{"type":"structure","members":{"arn":{}}}},"S8":{"type":"list","member":{"type":"structure","required":["Key","Value"],"members":{"Key":{},"Value":{}}}},"Sh":{"type":"structure","required":["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],"members":{"AccessKeyId":{},"SecretAccessKey":{},"SessionToken":{},"Expiration":{"type":"timestamp"}}},"Sm":{"type":"structure","required":["AssumedRoleId","Arn"],"members":{"AssumedRoleId":{},"Arn":{}}}}};
  13585. /***/ }),
  13586. /***/ 722:
  13587. /***/ (function(module) {
  13588. /**
  13589. * Convert array of 16 byte values to UUID string format of the form:
  13590. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  13591. */
  13592. var byteToHex = [];
  13593. for (var i = 0; i < 256; ++i) {
  13594. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  13595. }
  13596. function bytesToUuid(buf, offset) {
  13597. var i = offset || 0;
  13598. var bth = byteToHex;
  13599. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  13600. return ([bth[buf[i++]], bth[buf[i++]],
  13601. bth[buf[i++]], bth[buf[i++]], '-',
  13602. bth[buf[i++]], bth[buf[i++]], '-',
  13603. bth[buf[i++]], bth[buf[i++]], '-',
  13604. bth[buf[i++]], bth[buf[i++]], '-',
  13605. bth[buf[i++]], bth[buf[i++]],
  13606. bth[buf[i++]], bth[buf[i++]],
  13607. bth[buf[i++]], bth[buf[i++]]]).join('');
  13608. }
  13609. module.exports = bytesToUuid;
  13610. /***/ }),
  13611. /***/ 723:
  13612. /***/ (function(module, __unusedexports, __webpack_require__) {
  13613. var Transform = __webpack_require__(413).Transform;
  13614. var parseEvent = __webpack_require__(657).parseEvent;
  13615. /** @type {Transform} */
  13616. function EventUnmarshallerStream(options) {
  13617. options = options || {};
  13618. // set output to object mode
  13619. options.readableObjectMode = true;
  13620. Transform.call(this, options);
  13621. this._readableState.objectMode = true;
  13622. this.parser = options.parser;
  13623. this.eventStreamModel = options.eventStreamModel;
  13624. }
  13625. EventUnmarshallerStream.prototype = Object.create(Transform.prototype);
  13626. /**
  13627. *
  13628. * @param {Buffer} chunk
  13629. * @param {string} encoding
  13630. * @param {*} callback
  13631. */
  13632. EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) {
  13633. try {
  13634. var event = parseEvent(this.parser, chunk, this.eventStreamModel);
  13635. this.push(event);
  13636. return callback();
  13637. } catch (err) {
  13638. callback(err);
  13639. }
  13640. };
  13641. /**
  13642. * @api private
  13643. */
  13644. module.exports = {
  13645. EventUnmarshallerStream: EventUnmarshallerStream
  13646. };
  13647. /***/ }),
  13648. /***/ 733:
  13649. /***/ (function(module, __unusedexports, __webpack_require__) {
  13650. __webpack_require__(234);
  13651. var AWS = __webpack_require__(395);
  13652. var Service = AWS.Service;
  13653. var apiLoader = AWS.apiLoader;
  13654. apiLoader.services['sts'] = {};
  13655. AWS.STS = Service.defineService('sts', ['2011-06-15']);
  13656. __webpack_require__(861);
  13657. Object.defineProperty(apiLoader.services['sts'], '2011-06-15', {
  13658. get: function get() {
  13659. var model = __webpack_require__(715);
  13660. model.paginators = __webpack_require__(262).pagination;
  13661. return model;
  13662. },
  13663. enumerable: true,
  13664. configurable: true
  13665. });
  13666. module.exports = AWS.STS;
  13667. /***/ }),
  13668. /***/ 735:
  13669. /***/ (function(module, __unusedexports, __webpack_require__) {
  13670. // Generated by CoffeeScript 1.12.7
  13671. (function() {
  13672. var XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNode, isObject,
  13673. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13674. hasProp = {}.hasOwnProperty;
  13675. isObject = __webpack_require__(582).isObject;
  13676. XMLNode = __webpack_require__(855);
  13677. XMLDTDAttList = __webpack_require__(801);
  13678. XMLDTDEntity = __webpack_require__(755);
  13679. XMLDTDElement = __webpack_require__(463);
  13680. XMLDTDNotation = __webpack_require__(19);
  13681. module.exports = XMLDocType = (function(superClass) {
  13682. extend(XMLDocType, superClass);
  13683. function XMLDocType(parent, pubID, sysID) {
  13684. var ref, ref1;
  13685. XMLDocType.__super__.constructor.call(this, parent);
  13686. this.documentObject = parent;
  13687. if (isObject(pubID)) {
  13688. ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
  13689. }
  13690. if (sysID == null) {
  13691. ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
  13692. }
  13693. if (pubID != null) {
  13694. this.pubID = this.stringify.dtdPubID(pubID);
  13695. }
  13696. if (sysID != null) {
  13697. this.sysID = this.stringify.dtdSysID(sysID);
  13698. }
  13699. }
  13700. XMLDocType.prototype.element = function(name, value) {
  13701. var child;
  13702. child = new XMLDTDElement(this, name, value);
  13703. this.children.push(child);
  13704. return this;
  13705. };
  13706. XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  13707. var child;
  13708. child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
  13709. this.children.push(child);
  13710. return this;
  13711. };
  13712. XMLDocType.prototype.entity = function(name, value) {
  13713. var child;
  13714. child = new XMLDTDEntity(this, false, name, value);
  13715. this.children.push(child);
  13716. return this;
  13717. };
  13718. XMLDocType.prototype.pEntity = function(name, value) {
  13719. var child;
  13720. child = new XMLDTDEntity(this, true, name, value);
  13721. this.children.push(child);
  13722. return this;
  13723. };
  13724. XMLDocType.prototype.notation = function(name, value) {
  13725. var child;
  13726. child = new XMLDTDNotation(this, name, value);
  13727. this.children.push(child);
  13728. return this;
  13729. };
  13730. XMLDocType.prototype.toString = function(options) {
  13731. return this.options.writer.set(options).docType(this);
  13732. };
  13733. XMLDocType.prototype.ele = function(name, value) {
  13734. return this.element(name, value);
  13735. };
  13736. XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  13737. return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
  13738. };
  13739. XMLDocType.prototype.ent = function(name, value) {
  13740. return this.entity(name, value);
  13741. };
  13742. XMLDocType.prototype.pent = function(name, value) {
  13743. return this.pEntity(name, value);
  13744. };
  13745. XMLDocType.prototype.not = function(name, value) {
  13746. return this.notation(name, value);
  13747. };
  13748. XMLDocType.prototype.up = function() {
  13749. return this.root() || this.documentObject;
  13750. };
  13751. return XMLDocType;
  13752. })(XMLNode);
  13753. }).call(this);
  13754. /***/ }),
  13755. /***/ 738:
  13756. /***/ (function(module, __unusedexports, __webpack_require__) {
  13757. // Generated by CoffeeScript 1.12.7
  13758. (function() {
  13759. var XMLDeclaration, XMLNode, isObject,
  13760. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13761. hasProp = {}.hasOwnProperty;
  13762. isObject = __webpack_require__(582).isObject;
  13763. XMLNode = __webpack_require__(855);
  13764. module.exports = XMLDeclaration = (function(superClass) {
  13765. extend(XMLDeclaration, superClass);
  13766. function XMLDeclaration(parent, version, encoding, standalone) {
  13767. var ref;
  13768. XMLDeclaration.__super__.constructor.call(this, parent);
  13769. if (isObject(version)) {
  13770. ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
  13771. }
  13772. if (!version) {
  13773. version = '1.0';
  13774. }
  13775. this.version = this.stringify.xmlVersion(version);
  13776. if (encoding != null) {
  13777. this.encoding = this.stringify.xmlEncoding(encoding);
  13778. }
  13779. if (standalone != null) {
  13780. this.standalone = this.stringify.xmlStandalone(standalone);
  13781. }
  13782. }
  13783. XMLDeclaration.prototype.toString = function(options) {
  13784. return this.options.writer.set(options).declaration(this);
  13785. };
  13786. return XMLDeclaration;
  13787. })(XMLNode);
  13788. }).call(this);
  13789. /***/ }),
  13790. /***/ 747:
  13791. /***/ (function(module) {
  13792. module.exports = require("fs");
  13793. /***/ }),
  13794. /***/ 750:
  13795. /***/ (function(module, __unusedexports, __webpack_require__) {
  13796. // Generated by CoffeeScript 1.12.7
  13797. (function() {
  13798. var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLText, XMLWriterBase,
  13799. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  13800. hasProp = {}.hasOwnProperty;
  13801. XMLDeclaration = __webpack_require__(738);
  13802. XMLDocType = __webpack_require__(735);
  13803. XMLCData = __webpack_require__(35);
  13804. XMLComment = __webpack_require__(919);
  13805. XMLElement = __webpack_require__(796);
  13806. XMLRaw = __webpack_require__(660);
  13807. XMLText = __webpack_require__(708);
  13808. XMLProcessingInstruction = __webpack_require__(491);
  13809. XMLDTDAttList = __webpack_require__(801);
  13810. XMLDTDElement = __webpack_require__(463);
  13811. XMLDTDEntity = __webpack_require__(755);
  13812. XMLDTDNotation = __webpack_require__(19);
  13813. XMLWriterBase = __webpack_require__(423);
  13814. module.exports = XMLStringWriter = (function(superClass) {
  13815. extend(XMLStringWriter, superClass);
  13816. function XMLStringWriter(options) {
  13817. XMLStringWriter.__super__.constructor.call(this, options);
  13818. }
  13819. XMLStringWriter.prototype.document = function(doc) {
  13820. var child, i, len, r, ref;
  13821. this.textispresent = false;
  13822. r = '';
  13823. ref = doc.children;
  13824. for (i = 0, len = ref.length; i < len; i++) {
  13825. child = ref[i];
  13826. r += (function() {
  13827. switch (false) {
  13828. case !(child instanceof XMLDeclaration):
  13829. return this.declaration(child);
  13830. case !(child instanceof XMLDocType):
  13831. return this.docType(child);
  13832. case !(child instanceof XMLComment):
  13833. return this.comment(child);
  13834. case !(child instanceof XMLProcessingInstruction):
  13835. return this.processingInstruction(child);
  13836. default:
  13837. return this.element(child, 0);
  13838. }
  13839. }).call(this);
  13840. }
  13841. if (this.pretty && r.slice(-this.newline.length) === this.newline) {
  13842. r = r.slice(0, -this.newline.length);
  13843. }
  13844. return r;
  13845. };
  13846. XMLStringWriter.prototype.attribute = function(att) {
  13847. return ' ' + att.name + '="' + att.value + '"';
  13848. };
  13849. XMLStringWriter.prototype.cdata = function(node, level) {
  13850. return this.space(level) + '<![CDATA[' + node.text + ']]>' + this.newline;
  13851. };
  13852. XMLStringWriter.prototype.comment = function(node, level) {
  13853. return this.space(level) + '<!-- ' + node.text + ' -->' + this.newline;
  13854. };
  13855. XMLStringWriter.prototype.declaration = function(node, level) {
  13856. var r;
  13857. r = this.space(level);
  13858. r += '<?xml version="' + node.version + '"';
  13859. if (node.encoding != null) {
  13860. r += ' encoding="' + node.encoding + '"';
  13861. }
  13862. if (node.standalone != null) {
  13863. r += ' standalone="' + node.standalone + '"';
  13864. }
  13865. r += this.spacebeforeslash + '?>';
  13866. r += this.newline;
  13867. return r;
  13868. };
  13869. XMLStringWriter.prototype.docType = function(node, level) {
  13870. var child, i, len, r, ref;
  13871. level || (level = 0);
  13872. r = this.space(level);
  13873. r += '<!DOCTYPE ' + node.root().name;
  13874. if (node.pubID && node.sysID) {
  13875. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  13876. } else if (node.sysID) {
  13877. r += ' SYSTEM "' + node.sysID + '"';
  13878. }
  13879. if (node.children.length > 0) {
  13880. r += ' [';
  13881. r += this.newline;
  13882. ref = node.children;
  13883. for (i = 0, len = ref.length; i < len; i++) {
  13884. child = ref[i];
  13885. r += (function() {
  13886. switch (false) {
  13887. case !(child instanceof XMLDTDAttList):
  13888. return this.dtdAttList(child, level + 1);
  13889. case !(child instanceof XMLDTDElement):
  13890. return this.dtdElement(child, level + 1);
  13891. case !(child instanceof XMLDTDEntity):
  13892. return this.dtdEntity(child, level + 1);
  13893. case !(child instanceof XMLDTDNotation):
  13894. return this.dtdNotation(child, level + 1);
  13895. case !(child instanceof XMLCData):
  13896. return this.cdata(child, level + 1);
  13897. case !(child instanceof XMLComment):
  13898. return this.comment(child, level + 1);
  13899. case !(child instanceof XMLProcessingInstruction):
  13900. return this.processingInstruction(child, level + 1);
  13901. default:
  13902. throw new Error("Unknown DTD node type: " + child.constructor.name);
  13903. }
  13904. }).call(this);
  13905. }
  13906. r += ']';
  13907. }
  13908. r += this.spacebeforeslash + '>';
  13909. r += this.newline;
  13910. return r;
  13911. };
  13912. XMLStringWriter.prototype.element = function(node, level) {
  13913. var att, child, i, j, len, len1, name, r, ref, ref1, ref2, space, textispresentwasset;
  13914. level || (level = 0);
  13915. textispresentwasset = false;
  13916. if (this.textispresent) {
  13917. this.newline = '';
  13918. this.pretty = false;
  13919. } else {
  13920. this.newline = this.newlinedefault;
  13921. this.pretty = this.prettydefault;
  13922. }
  13923. space = this.space(level);
  13924. r = '';
  13925. r += space + '<' + node.name;
  13926. ref = node.attributes;
  13927. for (name in ref) {
  13928. if (!hasProp.call(ref, name)) continue;
  13929. att = ref[name];
  13930. r += this.attribute(att);
  13931. }
  13932. if (node.children.length === 0 || node.children.every(function(e) {
  13933. return e.value === '';
  13934. })) {
  13935. if (this.allowEmpty) {
  13936. r += '></' + node.name + '>' + this.newline;
  13937. } else {
  13938. r += this.spacebeforeslash + '/>' + this.newline;
  13939. }
  13940. } else if (this.pretty && node.children.length === 1 && (node.children[0].value != null)) {
  13941. r += '>';
  13942. r += node.children[0].value;
  13943. r += '</' + node.name + '>' + this.newline;
  13944. } else {
  13945. if (this.dontprettytextnodes) {
  13946. ref1 = node.children;
  13947. for (i = 0, len = ref1.length; i < len; i++) {
  13948. child = ref1[i];
  13949. if (child.value != null) {
  13950. this.textispresent++;
  13951. textispresentwasset = true;
  13952. break;
  13953. }
  13954. }
  13955. }
  13956. if (this.textispresent) {
  13957. this.newline = '';
  13958. this.pretty = false;
  13959. space = this.space(level);
  13960. }
  13961. r += '>' + this.newline;
  13962. ref2 = node.children;
  13963. for (j = 0, len1 = ref2.length; j < len1; j++) {
  13964. child = ref2[j];
  13965. r += (function() {
  13966. switch (false) {
  13967. case !(child instanceof XMLCData):
  13968. return this.cdata(child, level + 1);
  13969. case !(child instanceof XMLComment):
  13970. return this.comment(child, level + 1);
  13971. case !(child instanceof XMLElement):
  13972. return this.element(child, level + 1);
  13973. case !(child instanceof XMLRaw):
  13974. return this.raw(child, level + 1);
  13975. case !(child instanceof XMLText):
  13976. return this.text(child, level + 1);
  13977. case !(child instanceof XMLProcessingInstruction):
  13978. return this.processingInstruction(child, level + 1);
  13979. default:
  13980. throw new Error("Unknown XML node type: " + child.constructor.name);
  13981. }
  13982. }).call(this);
  13983. }
  13984. if (textispresentwasset) {
  13985. this.textispresent--;
  13986. }
  13987. if (!this.textispresent) {
  13988. this.newline = this.newlinedefault;
  13989. this.pretty = this.prettydefault;
  13990. }
  13991. r += space + '</' + node.name + '>' + this.newline;
  13992. }
  13993. return r;
  13994. };
  13995. XMLStringWriter.prototype.processingInstruction = function(node, level) {
  13996. var r;
  13997. r = this.space(level) + '<?' + node.target;
  13998. if (node.value) {
  13999. r += ' ' + node.value;
  14000. }
  14001. r += this.spacebeforeslash + '?>' + this.newline;
  14002. return r;
  14003. };
  14004. XMLStringWriter.prototype.raw = function(node, level) {
  14005. return this.space(level) + node.value + this.newline;
  14006. };
  14007. XMLStringWriter.prototype.text = function(node, level) {
  14008. return this.space(level) + node.value + this.newline;
  14009. };
  14010. XMLStringWriter.prototype.dtdAttList = function(node, level) {
  14011. var r;
  14012. r = this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
  14013. if (node.defaultValueType !== '#DEFAULT') {
  14014. r += ' ' + node.defaultValueType;
  14015. }
  14016. if (node.defaultValue) {
  14017. r += ' "' + node.defaultValue + '"';
  14018. }
  14019. r += this.spacebeforeslash + '>' + this.newline;
  14020. return r;
  14021. };
  14022. XMLStringWriter.prototype.dtdElement = function(node, level) {
  14023. return this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value + this.spacebeforeslash + '>' + this.newline;
  14024. };
  14025. XMLStringWriter.prototype.dtdEntity = function(node, level) {
  14026. var r;
  14027. r = this.space(level) + '<!ENTITY';
  14028. if (node.pe) {
  14029. r += ' %';
  14030. }
  14031. r += ' ' + node.name;
  14032. if (node.value) {
  14033. r += ' "' + node.value + '"';
  14034. } else {
  14035. if (node.pubID && node.sysID) {
  14036. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  14037. } else if (node.sysID) {
  14038. r += ' SYSTEM "' + node.sysID + '"';
  14039. }
  14040. if (node.nData) {
  14041. r += ' NDATA ' + node.nData;
  14042. }
  14043. }
  14044. r += this.spacebeforeslash + '>' + this.newline;
  14045. return r;
  14046. };
  14047. XMLStringWriter.prototype.dtdNotation = function(node, level) {
  14048. var r;
  14049. r = this.space(level) + '<!NOTATION ' + node.name;
  14050. if (node.pubID && node.sysID) {
  14051. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  14052. } else if (node.pubID) {
  14053. r += ' PUBLIC "' + node.pubID + '"';
  14054. } else if (node.sysID) {
  14055. r += ' SYSTEM "' + node.sysID + '"';
  14056. }
  14057. r += this.spacebeforeslash + '>' + this.newline;
  14058. return r;
  14059. };
  14060. XMLStringWriter.prototype.openNode = function(node, level) {
  14061. var att, name, r, ref;
  14062. level || (level = 0);
  14063. if (node instanceof XMLElement) {
  14064. r = this.space(level) + '<' + node.name;
  14065. ref = node.attributes;
  14066. for (name in ref) {
  14067. if (!hasProp.call(ref, name)) continue;
  14068. att = ref[name];
  14069. r += this.attribute(att);
  14070. }
  14071. r += (node.children ? '>' : '/>') + this.newline;
  14072. return r;
  14073. } else {
  14074. r = this.space(level) + '<!DOCTYPE ' + node.rootNodeName;
  14075. if (node.pubID && node.sysID) {
  14076. r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
  14077. } else if (node.sysID) {
  14078. r += ' SYSTEM "' + node.sysID + '"';
  14079. }
  14080. r += (node.children ? ' [' : '>') + this.newline;
  14081. return r;
  14082. }
  14083. };
  14084. XMLStringWriter.prototype.closeNode = function(node, level) {
  14085. level || (level = 0);
  14086. switch (false) {
  14087. case !(node instanceof XMLElement):
  14088. return this.space(level) + '</' + node.name + '>' + this.newline;
  14089. case !(node instanceof XMLDocType):
  14090. return this.space(level) + ']>' + this.newline;
  14091. }
  14092. };
  14093. return XMLStringWriter;
  14094. })(XMLWriterBase);
  14095. }).call(this);
  14096. /***/ }),
  14097. /***/ 751:
  14098. /***/ (function(module, __unusedexports, __webpack_require__) {
  14099. var AWS = __webpack_require__(395);
  14100. __webpack_require__(711);
  14101. var inherit = AWS.util.inherit;
  14102. /**
  14103. * Represents a metadata service available on EC2 instances. Using the
  14104. * {request} method, you can receieve metadata about any available resource
  14105. * on the metadata service.
  14106. *
  14107. * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED
  14108. * environment variable to a truthy value.
  14109. *
  14110. * @!attribute [r] httpOptions
  14111. * @return [map] a map of options to pass to the underlying HTTP request:
  14112. *
  14113. * * **timeout** (Number) &mdash; a timeout value in milliseconds to wait
  14114. * before aborting the connection. Set to 0 for no timeout.
  14115. *
  14116. * @!macro nobrowser
  14117. */
  14118. AWS.MetadataService = inherit({
  14119. /**
  14120. * @return [String] the hostname of the instance metadata service
  14121. */
  14122. host: '169.254.169.254',
  14123. /**
  14124. * @!ignore
  14125. */
  14126. /**
  14127. * Default HTTP options. By default, the metadata service is set to not
  14128. * timeout on long requests. This means that on non-EC2 machines, this
  14129. * request will never return. If you are calling this operation from an
  14130. * environment that may not always run on EC2, set a `timeout` value so
  14131. * the SDK will abort the request after a given number of milliseconds.
  14132. */
  14133. httpOptions: { timeout: 0 },
  14134. /**
  14135. * when enabled, metadata service will not fetch token
  14136. */
  14137. disableFetchToken: false,
  14138. /**
  14139. * Creates a new MetadataService object with a given set of options.
  14140. *
  14141. * @option options host [String] the hostname of the instance metadata
  14142. * service
  14143. * @option options httpOptions [map] a map of options to pass to the
  14144. * underlying HTTP request:
  14145. *
  14146. * * **timeout** (Number) &mdash; a timeout value in milliseconds to wait
  14147. * before aborting the connection. Set to 0 for no timeout.
  14148. * @option options maxRetries [Integer] the maximum number of retries to
  14149. * perform for timeout errors
  14150. * @option options retryDelayOptions [map] A set of options to configure the
  14151. * retry delay on retryable errors. See AWS.Config for details.
  14152. */
  14153. constructor: function MetadataService(options) {
  14154. AWS.util.update(this, options);
  14155. },
  14156. /**
  14157. * Sends a request to the instance metadata service for a given resource.
  14158. *
  14159. * @param path [String] the path of the resource to get
  14160. *
  14161. * @param options [map] an optional map used to make request
  14162. *
  14163. * * **method** (String) &mdash; HTTP request method
  14164. *
  14165. * * **headers** (map<String,String>) &mdash; a map of response header keys and their respective values
  14166. *
  14167. * @callback callback function(err, data)
  14168. * Called when a response is available from the service.
  14169. * @param err [Error, null] if an error occurred, this value will be set
  14170. * @param data [String, null] if the request was successful, the body of
  14171. * the response
  14172. */
  14173. request: function request(path, options, callback) {
  14174. if (arguments.length === 2) {
  14175. callback = options;
  14176. options = {};
  14177. }
  14178. if (process.env[AWS.util.imdsDisabledEnv]) {
  14179. callback(new Error('EC2 Instance Metadata Service access disabled'));
  14180. return;
  14181. }
  14182. path = path || '/';
  14183. var httpRequest = new AWS.HttpRequest('http://' + this.host + path);
  14184. httpRequest.method = options.method || 'GET';
  14185. if (options.headers) {
  14186. httpRequest.headers = options.headers;
  14187. }
  14188. AWS.util.handleRequestWithRetries(httpRequest, this, callback);
  14189. },
  14190. /**
  14191. * @api private
  14192. */
  14193. loadCredentialsCallbacks: [],
  14194. /**
  14195. * Fetches metadata token used for getting credentials
  14196. *
  14197. * @api private
  14198. * @callback callback function(err, token)
  14199. * Called when token is loaded from the resource
  14200. */
  14201. fetchMetadataToken: function fetchMetadataToken(callback) {
  14202. var self = this;
  14203. var tokenFetchPath = '/latest/api/token';
  14204. self.request(
  14205. tokenFetchPath,
  14206. {
  14207. 'method': 'PUT',
  14208. 'headers': {
  14209. 'x-aws-ec2-metadata-token-ttl-seconds': '21600'
  14210. }
  14211. },
  14212. callback
  14213. );
  14214. },
  14215. /**
  14216. * Fetches credentials
  14217. *
  14218. * @api private
  14219. * @callback cb function(err, creds)
  14220. * Called when credentials are loaded from the resource
  14221. */
  14222. fetchCredentials: function fetchCredentials(options, cb) {
  14223. var self = this;
  14224. var basePath = '/latest/meta-data/iam/security-credentials/';
  14225. self.request(basePath, options, function (err, roleName) {
  14226. if (err) {
  14227. self.disableFetchToken = !(err.statusCode === 401);
  14228. cb(AWS.util.error(
  14229. err,
  14230. {
  14231. message: 'EC2 Metadata roleName request returned error'
  14232. }
  14233. ));
  14234. return;
  14235. }
  14236. roleName = roleName.split('\n')[0]; // grab first (and only) role
  14237. self.request(basePath + roleName, options, function (credErr, credData) {
  14238. if (credErr) {
  14239. self.disableFetchToken = !(credErr.statusCode === 401);
  14240. cb(AWS.util.error(
  14241. credErr,
  14242. {
  14243. message: 'EC2 Metadata creds request returned error'
  14244. }
  14245. ));
  14246. return;
  14247. }
  14248. try {
  14249. var credentials = JSON.parse(credData);
  14250. cb(null, credentials);
  14251. } catch (parseError) {
  14252. cb(parseError);
  14253. }
  14254. });
  14255. });
  14256. },
  14257. /**
  14258. * Loads a set of credentials stored in the instance metadata service
  14259. *
  14260. * @api private
  14261. * @callback callback function(err, credentials)
  14262. * Called when credentials are loaded from the resource
  14263. * @param err [Error] if an error occurred, this value will be set
  14264. * @param credentials [Object] the raw JSON object containing all
  14265. * metadata from the credentials resource
  14266. */
  14267. loadCredentials: function loadCredentials(callback) {
  14268. var self = this;
  14269. self.loadCredentialsCallbacks.push(callback);
  14270. if (self.loadCredentialsCallbacks.length > 1) { return; }
  14271. function callbacks(err, creds) {
  14272. var cb;
  14273. while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) {
  14274. cb(err, creds);
  14275. }
  14276. }
  14277. if (self.disableFetchToken) {
  14278. self.fetchCredentials({}, callbacks);
  14279. } else {
  14280. self.fetchMetadataToken(function(tokenError, token) {
  14281. if (tokenError) {
  14282. if (tokenError.code === 'TimeoutError') {
  14283. self.disableFetchToken = true;
  14284. } else if (tokenError.retryable === true) {
  14285. callbacks(AWS.util.error(
  14286. tokenError,
  14287. {
  14288. message: 'EC2 Metadata token request returned error'
  14289. }
  14290. ));
  14291. return;
  14292. } else if (tokenError.statusCode === 400) {
  14293. callbacks(AWS.util.error(
  14294. tokenError,
  14295. {
  14296. message: 'EC2 Metadata token request returned 400'
  14297. }
  14298. ));
  14299. return;
  14300. }
  14301. }
  14302. var options = {};
  14303. if (token) {
  14304. options.headers = {
  14305. 'x-aws-ec2-metadata-token': token
  14306. };
  14307. }
  14308. self.fetchCredentials(options, callbacks);
  14309. });
  14310. }
  14311. }
  14312. });
  14313. /**
  14314. * @api private
  14315. */
  14316. module.exports = AWS.MetadataService;
  14317. /***/ }),
  14318. /***/ 754:
  14319. /***/ (function(module, __unusedexports, __webpack_require__) {
  14320. var AWS = __webpack_require__(395);
  14321. var v4Credentials = __webpack_require__(819);
  14322. var inherit = AWS.util.inherit;
  14323. /**
  14324. * @api private
  14325. */
  14326. var expiresHeader = 'presigned-expires';
  14327. /**
  14328. * @api private
  14329. */
  14330. AWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, {
  14331. constructor: function V4(request, serviceName, options) {
  14332. AWS.Signers.RequestSigner.call(this, request);
  14333. this.serviceName = serviceName;
  14334. options = options || {};
  14335. this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true;
  14336. this.operation = options.operation;
  14337. this.signatureVersion = options.signatureVersion;
  14338. },
  14339. algorithm: 'AWS4-HMAC-SHA256',
  14340. addAuthorization: function addAuthorization(credentials, date) {
  14341. var datetime = AWS.util.date.iso8601(date).replace(/[:\-]|\.\d{3}/g, '');
  14342. if (this.isPresigned()) {
  14343. this.updateForPresigned(credentials, datetime);
  14344. } else {
  14345. this.addHeaders(credentials, datetime);
  14346. }
  14347. this.request.headers['Authorization'] =
  14348. this.authorization(credentials, datetime);
  14349. },
  14350. addHeaders: function addHeaders(credentials, datetime) {
  14351. this.request.headers['X-Amz-Date'] = datetime;
  14352. if (credentials.sessionToken) {
  14353. this.request.headers['x-amz-security-token'] = credentials.sessionToken;
  14354. }
  14355. },
  14356. updateForPresigned: function updateForPresigned(credentials, datetime) {
  14357. var credString = this.credentialString(datetime);
  14358. var qs = {
  14359. 'X-Amz-Date': datetime,
  14360. 'X-Amz-Algorithm': this.algorithm,
  14361. 'X-Amz-Credential': credentials.accessKeyId + '/' + credString,
  14362. 'X-Amz-Expires': this.request.headers[expiresHeader],
  14363. 'X-Amz-SignedHeaders': this.signedHeaders()
  14364. };
  14365. if (credentials.sessionToken) {
  14366. qs['X-Amz-Security-Token'] = credentials.sessionToken;
  14367. }
  14368. if (this.request.headers['Content-Type']) {
  14369. qs['Content-Type'] = this.request.headers['Content-Type'];
  14370. }
  14371. if (this.request.headers['Content-MD5']) {
  14372. qs['Content-MD5'] = this.request.headers['Content-MD5'];
  14373. }
  14374. if (this.request.headers['Cache-Control']) {
  14375. qs['Cache-Control'] = this.request.headers['Cache-Control'];
  14376. }
  14377. // need to pull in any other X-Amz-* headers
  14378. AWS.util.each.call(this, this.request.headers, function(key, value) {
  14379. if (key === expiresHeader) return;
  14380. if (this.isSignableHeader(key)) {
  14381. var lowerKey = key.toLowerCase();
  14382. // Metadata should be normalized
  14383. if (lowerKey.indexOf('x-amz-meta-') === 0) {
  14384. qs[lowerKey] = value;
  14385. } else if (lowerKey.indexOf('x-amz-') === 0) {
  14386. qs[key] = value;
  14387. }
  14388. }
  14389. });
  14390. var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?';
  14391. this.request.path += sep + AWS.util.queryParamsToString(qs);
  14392. },
  14393. authorization: function authorization(credentials, datetime) {
  14394. var parts = [];
  14395. var credString = this.credentialString(datetime);
  14396. parts.push(this.algorithm + ' Credential=' +
  14397. credentials.accessKeyId + '/' + credString);
  14398. parts.push('SignedHeaders=' + this.signedHeaders());
  14399. parts.push('Signature=' + this.signature(credentials, datetime));
  14400. return parts.join(', ');
  14401. },
  14402. signature: function signature(credentials, datetime) {
  14403. var signingKey = v4Credentials.getSigningKey(
  14404. credentials,
  14405. datetime.substr(0, 8),
  14406. this.request.region,
  14407. this.serviceName,
  14408. this.signatureCache
  14409. );
  14410. return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex');
  14411. },
  14412. stringToSign: function stringToSign(datetime) {
  14413. var parts = [];
  14414. parts.push('AWS4-HMAC-SHA256');
  14415. parts.push(datetime);
  14416. parts.push(this.credentialString(datetime));
  14417. parts.push(this.hexEncodedHash(this.canonicalString()));
  14418. return parts.join('\n');
  14419. },
  14420. canonicalString: function canonicalString() {
  14421. var parts = [], pathname = this.request.pathname();
  14422. if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname);
  14423. parts.push(this.request.method);
  14424. parts.push(pathname);
  14425. parts.push(this.request.search());
  14426. parts.push(this.canonicalHeaders() + '\n');
  14427. parts.push(this.signedHeaders());
  14428. parts.push(this.hexEncodedBodyHash());
  14429. return parts.join('\n');
  14430. },
  14431. canonicalHeaders: function canonicalHeaders() {
  14432. var headers = [];
  14433. AWS.util.each.call(this, this.request.headers, function (key, item) {
  14434. headers.push([key, item]);
  14435. });
  14436. headers.sort(function (a, b) {
  14437. return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1;
  14438. });
  14439. var parts = [];
  14440. AWS.util.arrayEach.call(this, headers, function (item) {
  14441. var key = item[0].toLowerCase();
  14442. if (this.isSignableHeader(key)) {
  14443. var value = item[1];
  14444. if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') {
  14445. throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), {
  14446. code: 'InvalidHeader'
  14447. });
  14448. }
  14449. parts.push(key + ':' +
  14450. this.canonicalHeaderValues(value.toString()));
  14451. }
  14452. });
  14453. return parts.join('\n');
  14454. },
  14455. canonicalHeaderValues: function canonicalHeaderValues(values) {
  14456. return values.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '');
  14457. },
  14458. signedHeaders: function signedHeaders() {
  14459. var keys = [];
  14460. AWS.util.each.call(this, this.request.headers, function (key) {
  14461. key = key.toLowerCase();
  14462. if (this.isSignableHeader(key)) keys.push(key);
  14463. });
  14464. return keys.sort().join(';');
  14465. },
  14466. credentialString: function credentialString(datetime) {
  14467. return v4Credentials.createScope(
  14468. datetime.substr(0, 8),
  14469. this.request.region,
  14470. this.serviceName
  14471. );
  14472. },
  14473. hexEncodedHash: function hash(string) {
  14474. return AWS.util.crypto.sha256(string, 'hex');
  14475. },
  14476. hexEncodedBodyHash: function hexEncodedBodyHash() {
  14477. var request = this.request;
  14478. if (this.isPresigned() && this.serviceName === 's3' && !request.body) {
  14479. return 'UNSIGNED-PAYLOAD';
  14480. } else if (request.headers['X-Amz-Content-Sha256']) {
  14481. return request.headers['X-Amz-Content-Sha256'];
  14482. } else {
  14483. return this.hexEncodedHash(this.request.body || '');
  14484. }
  14485. },
  14486. unsignableHeaders: [
  14487. 'authorization',
  14488. 'content-type',
  14489. 'content-length',
  14490. 'user-agent',
  14491. expiresHeader,
  14492. 'expect',
  14493. 'x-amzn-trace-id'
  14494. ],
  14495. isSignableHeader: function isSignableHeader(key) {
  14496. if (key.toLowerCase().indexOf('x-amz-') === 0) return true;
  14497. return this.unsignableHeaders.indexOf(key) < 0;
  14498. },
  14499. isPresigned: function isPresigned() {
  14500. return this.request.headers[expiresHeader] ? true : false;
  14501. }
  14502. });
  14503. /**
  14504. * @api private
  14505. */
  14506. module.exports = AWS.Signers.V4;
  14507. /***/ }),
  14508. /***/ 755:
  14509. /***/ (function(module, __unusedexports, __webpack_require__) {
  14510. // Generated by CoffeeScript 1.12.7
  14511. (function() {
  14512. var XMLDTDEntity, XMLNode, isObject,
  14513. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  14514. hasProp = {}.hasOwnProperty;
  14515. isObject = __webpack_require__(582).isObject;
  14516. XMLNode = __webpack_require__(855);
  14517. module.exports = XMLDTDEntity = (function(superClass) {
  14518. extend(XMLDTDEntity, superClass);
  14519. function XMLDTDEntity(parent, pe, name, value) {
  14520. XMLDTDEntity.__super__.constructor.call(this, parent);
  14521. if (name == null) {
  14522. throw new Error("Missing entity name");
  14523. }
  14524. if (value == null) {
  14525. throw new Error("Missing entity value");
  14526. }
  14527. this.pe = !!pe;
  14528. this.name = this.stringify.eleName(name);
  14529. if (!isObject(value)) {
  14530. this.value = this.stringify.dtdEntityValue(value);
  14531. } else {
  14532. if (!value.pubID && !value.sysID) {
  14533. throw new Error("Public and/or system identifiers are required for an external entity");
  14534. }
  14535. if (value.pubID && !value.sysID) {
  14536. throw new Error("System identifier is required for a public external entity");
  14537. }
  14538. if (value.pubID != null) {
  14539. this.pubID = this.stringify.dtdPubID(value.pubID);
  14540. }
  14541. if (value.sysID != null) {
  14542. this.sysID = this.stringify.dtdSysID(value.sysID);
  14543. }
  14544. if (value.nData != null) {
  14545. this.nData = this.stringify.dtdNData(value.nData);
  14546. }
  14547. if (this.pe && this.nData) {
  14548. throw new Error("Notation declaration is not allowed in a parameter entity");
  14549. }
  14550. }
  14551. }
  14552. XMLDTDEntity.prototype.toString = function(options) {
  14553. return this.options.writer.set(options).dtdEntity(this);
  14554. };
  14555. return XMLDTDEntity;
  14556. })(XMLNode);
  14557. }).call(this);
  14558. /***/ }),
  14559. /***/ 762:
  14560. /***/ (function(module, __unusedexports, __webpack_require__) {
  14561. var AWS = __webpack_require__(395);
  14562. /**
  14563. * Resolve client-side monitoring configuration from either environmental variables
  14564. * or shared config file. Configurations from environmental variables have higher priority
  14565. * than those from shared config file. The resolver will try to read the shared config file
  14566. * no matter whether the AWS_SDK_LOAD_CONFIG variable is set.
  14567. * @api private
  14568. */
  14569. function resolveMonitoringConfig() {
  14570. var config = {
  14571. port: undefined,
  14572. clientId: undefined,
  14573. enabled: undefined,
  14574. host: undefined
  14575. };
  14576. if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config);
  14577. return toJSType(config);
  14578. }
  14579. /**
  14580. * Resolve configurations from environmental variables.
  14581. * @param {object} client side monitoring config object needs to be resolved
  14582. * @returns {boolean} whether resolving configurations is done
  14583. * @api private
  14584. */
  14585. function fromEnvironment(config) {
  14586. config.port = config.port || process.env.AWS_CSM_PORT;
  14587. config.enabled = config.enabled || process.env.AWS_CSM_ENABLED;
  14588. config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID;
  14589. config.host = config.host || process.env.AWS_CSM_HOST;
  14590. return config.port && config.enabled && config.clientId && config.host ||
  14591. ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled
  14592. }
  14593. /**
  14594. * Resolve cofigurations from shared config file with specified role name
  14595. * @param {object} client side monitoring config object needs to be resolved
  14596. * @returns {boolean} whether resolving configurations is done
  14597. * @api private
  14598. */
  14599. function fromConfigFile(config) {
  14600. var sharedFileConfig;
  14601. try {
  14602. var configFile = AWS.util.iniLoader.loadFrom({
  14603. isConfig: true,
  14604. filename: process.env[AWS.util.sharedConfigFileEnv]
  14605. });
  14606. var sharedFileConfig = configFile[
  14607. process.env.AWS_PROFILE || AWS.util.defaultProfile
  14608. ];
  14609. } catch (err) {
  14610. return false;
  14611. }
  14612. if (!sharedFileConfig) return config;
  14613. config.port = config.port || sharedFileConfig.csm_port;
  14614. config.enabled = config.enabled || sharedFileConfig.csm_enabled;
  14615. config.clientId = config.clientId || sharedFileConfig.csm_client_id;
  14616. config.host = config.host || sharedFileConfig.csm_host;
  14617. return config.port && config.enabled && config.clientId && config.host;
  14618. }
  14619. /**
  14620. * Transfer the resolved configuration value to proper types: port as number, enabled
  14621. * as boolean and clientId as string. The 'enabled' flag is valued to false when set
  14622. * to 'false' or '0'.
  14623. * @param {object} resolved client side monitoring config
  14624. * @api private
  14625. */
  14626. function toJSType(config) {
  14627. //config.XXX is either undefined or string
  14628. var falsyNotations = ['false', '0', undefined];
  14629. if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) {
  14630. config.enabled = false;
  14631. } else {
  14632. config.enabled = true;
  14633. }
  14634. config.port = config.port ? parseInt(config.port, 10) : undefined;
  14635. return config;
  14636. }
  14637. module.exports = resolveMonitoringConfig;
  14638. /***/ }),
  14639. /***/ 768:
  14640. /***/ (function(module, __unusedexports, __webpack_require__) {
  14641. // Generated by CoffeeScript 1.12.7
  14642. (function() {
  14643. var XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, isFunction, isObject, isPlainObject, ref,
  14644. hasProp = {}.hasOwnProperty;
  14645. ref = __webpack_require__(582), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject;
  14646. XMLElement = __webpack_require__(796);
  14647. XMLCData = __webpack_require__(35);
  14648. XMLComment = __webpack_require__(919);
  14649. XMLRaw = __webpack_require__(660);
  14650. XMLText = __webpack_require__(708);
  14651. XMLProcessingInstruction = __webpack_require__(491);
  14652. XMLDeclaration = __webpack_require__(738);
  14653. XMLDocType = __webpack_require__(735);
  14654. XMLDTDAttList = __webpack_require__(801);
  14655. XMLDTDEntity = __webpack_require__(755);
  14656. XMLDTDElement = __webpack_require__(463);
  14657. XMLDTDNotation = __webpack_require__(19);
  14658. XMLAttribute = __webpack_require__(884);
  14659. XMLStringifier = __webpack_require__(602);
  14660. XMLStringWriter = __webpack_require__(750);
  14661. module.exports = XMLDocumentCB = (function() {
  14662. function XMLDocumentCB(options, onData, onEnd) {
  14663. var writerOptions;
  14664. options || (options = {});
  14665. if (!options.writer) {
  14666. options.writer = new XMLStringWriter(options);
  14667. } else if (isPlainObject(options.writer)) {
  14668. writerOptions = options.writer;
  14669. options.writer = new XMLStringWriter(writerOptions);
  14670. }
  14671. this.options = options;
  14672. this.writer = options.writer;
  14673. this.stringify = new XMLStringifier(options);
  14674. this.onDataCallback = onData || function() {};
  14675. this.onEndCallback = onEnd || function() {};
  14676. this.currentNode = null;
  14677. this.currentLevel = -1;
  14678. this.openTags = {};
  14679. this.documentStarted = false;
  14680. this.documentCompleted = false;
  14681. this.root = null;
  14682. }
  14683. XMLDocumentCB.prototype.node = function(name, attributes, text) {
  14684. var ref1;
  14685. if (name == null) {
  14686. throw new Error("Missing node name");
  14687. }
  14688. if (this.root && this.currentLevel === -1) {
  14689. throw new Error("Document can only have one root node");
  14690. }
  14691. this.openCurrent();
  14692. name = name.valueOf();
  14693. if (attributes == null) {
  14694. attributes = {};
  14695. }
  14696. attributes = attributes.valueOf();
  14697. if (!isObject(attributes)) {
  14698. ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
  14699. }
  14700. this.currentNode = new XMLElement(this, name, attributes);
  14701. this.currentNode.children = false;
  14702. this.currentLevel++;
  14703. this.openTags[this.currentLevel] = this.currentNode;
  14704. if (text != null) {
  14705. this.text(text);
  14706. }
  14707. return this;
  14708. };
  14709. XMLDocumentCB.prototype.element = function(name, attributes, text) {
  14710. if (this.currentNode && this.currentNode instanceof XMLDocType) {
  14711. return this.dtdElement.apply(this, arguments);
  14712. } else {
  14713. return this.node(name, attributes, text);
  14714. }
  14715. };
  14716. XMLDocumentCB.prototype.attribute = function(name, value) {
  14717. var attName, attValue;
  14718. if (!this.currentNode || this.currentNode.children) {
  14719. throw new Error("att() can only be used immediately after an ele() call in callback mode");
  14720. }
  14721. if (name != null) {
  14722. name = name.valueOf();
  14723. }
  14724. if (isObject(name)) {
  14725. for (attName in name) {
  14726. if (!hasProp.call(name, attName)) continue;
  14727. attValue = name[attName];
  14728. this.attribute(attName, attValue);
  14729. }
  14730. } else {
  14731. if (isFunction(value)) {
  14732. value = value.apply();
  14733. }
  14734. if (!this.options.skipNullAttributes || (value != null)) {
  14735. this.currentNode.attributes[name] = new XMLAttribute(this, name, value);
  14736. }
  14737. }
  14738. return this;
  14739. };
  14740. XMLDocumentCB.prototype.text = function(value) {
  14741. var node;
  14742. this.openCurrent();
  14743. node = new XMLText(this, value);
  14744. this.onData(this.writer.text(node, this.currentLevel + 1));
  14745. return this;
  14746. };
  14747. XMLDocumentCB.prototype.cdata = function(value) {
  14748. var node;
  14749. this.openCurrent();
  14750. node = new XMLCData(this, value);
  14751. this.onData(this.writer.cdata(node, this.currentLevel + 1));
  14752. return this;
  14753. };
  14754. XMLDocumentCB.prototype.comment = function(value) {
  14755. var node;
  14756. this.openCurrent();
  14757. node = new XMLComment(this, value);
  14758. this.onData(this.writer.comment(node, this.currentLevel + 1));
  14759. return this;
  14760. };
  14761. XMLDocumentCB.prototype.raw = function(value) {
  14762. var node;
  14763. this.openCurrent();
  14764. node = new XMLRaw(this, value);
  14765. this.onData(this.writer.raw(node, this.currentLevel + 1));
  14766. return this;
  14767. };
  14768. XMLDocumentCB.prototype.instruction = function(target, value) {
  14769. var i, insTarget, insValue, len, node;
  14770. this.openCurrent();
  14771. if (target != null) {
  14772. target = target.valueOf();
  14773. }
  14774. if (value != null) {
  14775. value = value.valueOf();
  14776. }
  14777. if (Array.isArray(target)) {
  14778. for (i = 0, len = target.length; i < len; i++) {
  14779. insTarget = target[i];
  14780. this.instruction(insTarget);
  14781. }
  14782. } else if (isObject(target)) {
  14783. for (insTarget in target) {
  14784. if (!hasProp.call(target, insTarget)) continue;
  14785. insValue = target[insTarget];
  14786. this.instruction(insTarget, insValue);
  14787. }
  14788. } else {
  14789. if (isFunction(value)) {
  14790. value = value.apply();
  14791. }
  14792. node = new XMLProcessingInstruction(this, target, value);
  14793. this.onData(this.writer.processingInstruction(node, this.currentLevel + 1));
  14794. }
  14795. return this;
  14796. };
  14797. XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) {
  14798. var node;
  14799. this.openCurrent();
  14800. if (this.documentStarted) {
  14801. throw new Error("declaration() must be the first node");
  14802. }
  14803. node = new XMLDeclaration(this, version, encoding, standalone);
  14804. this.onData(this.writer.declaration(node, this.currentLevel + 1));
  14805. return this;
  14806. };
  14807. XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {
  14808. this.openCurrent();
  14809. if (root == null) {
  14810. throw new Error("Missing root node name");
  14811. }
  14812. if (this.root) {
  14813. throw new Error("dtd() must come before the root node");
  14814. }
  14815. this.currentNode = new XMLDocType(this, pubID, sysID);
  14816. this.currentNode.rootNodeName = root;
  14817. this.currentNode.children = false;
  14818. this.currentLevel++;
  14819. this.openTags[this.currentLevel] = this.currentNode;
  14820. return this;
  14821. };
  14822. XMLDocumentCB.prototype.dtdElement = function(name, value) {
  14823. var node;
  14824. this.openCurrent();
  14825. node = new XMLDTDElement(this, name, value);
  14826. this.onData(this.writer.dtdElement(node, this.currentLevel + 1));
  14827. return this;
  14828. };
  14829. XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  14830. var node;
  14831. this.openCurrent();
  14832. node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
  14833. this.onData(this.writer.dtdAttList(node, this.currentLevel + 1));
  14834. return this;
  14835. };
  14836. XMLDocumentCB.prototype.entity = function(name, value) {
  14837. var node;
  14838. this.openCurrent();
  14839. node = new XMLDTDEntity(this, false, name, value);
  14840. this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
  14841. return this;
  14842. };
  14843. XMLDocumentCB.prototype.pEntity = function(name, value) {
  14844. var node;
  14845. this.openCurrent();
  14846. node = new XMLDTDEntity(this, true, name, value);
  14847. this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
  14848. return this;
  14849. };
  14850. XMLDocumentCB.prototype.notation = function(name, value) {
  14851. var node;
  14852. this.openCurrent();
  14853. node = new XMLDTDNotation(this, name, value);
  14854. this.onData(this.writer.dtdNotation(node, this.currentLevel + 1));
  14855. return this;
  14856. };
  14857. XMLDocumentCB.prototype.up = function() {
  14858. if (this.currentLevel < 0) {
  14859. throw new Error("The document node has no parent");
  14860. }
  14861. if (this.currentNode) {
  14862. if (this.currentNode.children) {
  14863. this.closeNode(this.currentNode);
  14864. } else {
  14865. this.openNode(this.currentNode);
  14866. }
  14867. this.currentNode = null;
  14868. } else {
  14869. this.closeNode(this.openTags[this.currentLevel]);
  14870. }
  14871. delete this.openTags[this.currentLevel];
  14872. this.currentLevel--;
  14873. return this;
  14874. };
  14875. XMLDocumentCB.prototype.end = function() {
  14876. while (this.currentLevel >= 0) {
  14877. this.up();
  14878. }
  14879. return this.onEnd();
  14880. };
  14881. XMLDocumentCB.prototype.openCurrent = function() {
  14882. if (this.currentNode) {
  14883. this.currentNode.children = true;
  14884. return this.openNode(this.currentNode);
  14885. }
  14886. };
  14887. XMLDocumentCB.prototype.openNode = function(node) {
  14888. if (!node.isOpen) {
  14889. if (!this.root && this.currentLevel === 0 && node instanceof XMLElement) {
  14890. this.root = node;
  14891. }
  14892. this.onData(this.writer.openNode(node, this.currentLevel));
  14893. return node.isOpen = true;
  14894. }
  14895. };
  14896. XMLDocumentCB.prototype.closeNode = function(node) {
  14897. if (!node.isClosed) {
  14898. this.onData(this.writer.closeNode(node, this.currentLevel));
  14899. return node.isClosed = true;
  14900. }
  14901. };
  14902. XMLDocumentCB.prototype.onData = function(chunk) {
  14903. this.documentStarted = true;
  14904. return this.onDataCallback(chunk);
  14905. };
  14906. XMLDocumentCB.prototype.onEnd = function() {
  14907. this.documentCompleted = true;
  14908. return this.onEndCallback();
  14909. };
  14910. XMLDocumentCB.prototype.ele = function() {
  14911. return this.element.apply(this, arguments);
  14912. };
  14913. XMLDocumentCB.prototype.nod = function(name, attributes, text) {
  14914. return this.node(name, attributes, text);
  14915. };
  14916. XMLDocumentCB.prototype.txt = function(value) {
  14917. return this.text(value);
  14918. };
  14919. XMLDocumentCB.prototype.dat = function(value) {
  14920. return this.cdata(value);
  14921. };
  14922. XMLDocumentCB.prototype.com = function(value) {
  14923. return this.comment(value);
  14924. };
  14925. XMLDocumentCB.prototype.ins = function(target, value) {
  14926. return this.instruction(target, value);
  14927. };
  14928. XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {
  14929. return this.declaration(version, encoding, standalone);
  14930. };
  14931. XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {
  14932. return this.doctype(root, pubID, sysID);
  14933. };
  14934. XMLDocumentCB.prototype.e = function(name, attributes, text) {
  14935. return this.element(name, attributes, text);
  14936. };
  14937. XMLDocumentCB.prototype.n = function(name, attributes, text) {
  14938. return this.node(name, attributes, text);
  14939. };
  14940. XMLDocumentCB.prototype.t = function(value) {
  14941. return this.text(value);
  14942. };
  14943. XMLDocumentCB.prototype.d = function(value) {
  14944. return this.cdata(value);
  14945. };
  14946. XMLDocumentCB.prototype.c = function(value) {
  14947. return this.comment(value);
  14948. };
  14949. XMLDocumentCB.prototype.r = function(value) {
  14950. return this.raw(value);
  14951. };
  14952. XMLDocumentCB.prototype.i = function(target, value) {
  14953. return this.instruction(target, value);
  14954. };
  14955. XMLDocumentCB.prototype.att = function() {
  14956. if (this.currentNode && this.currentNode instanceof XMLDocType) {
  14957. return this.attList.apply(this, arguments);
  14958. } else {
  14959. return this.attribute.apply(this, arguments);
  14960. }
  14961. };
  14962. XMLDocumentCB.prototype.a = function() {
  14963. if (this.currentNode && this.currentNode instanceof XMLDocType) {
  14964. return this.attList.apply(this, arguments);
  14965. } else {
  14966. return this.attribute.apply(this, arguments);
  14967. }
  14968. };
  14969. XMLDocumentCB.prototype.ent = function(name, value) {
  14970. return this.entity(name, value);
  14971. };
  14972. XMLDocumentCB.prototype.pent = function(name, value) {
  14973. return this.pEntity(name, value);
  14974. };
  14975. XMLDocumentCB.prototype.not = function(name, value) {
  14976. return this.notation(name, value);
  14977. };
  14978. return XMLDocumentCB;
  14979. })();
  14980. }).call(this);
  14981. /***/ }),
  14982. /***/ 777:
  14983. /***/ (function(module, __unusedexports, __webpack_require__) {
  14984. __webpack_require__(234);
  14985. var AWS = __webpack_require__(395);
  14986. var Service = AWS.Service;
  14987. var apiLoader = AWS.apiLoader;
  14988. apiLoader.services['s3'] = {};
  14989. AWS.S3 = Service.defineService('s3', ['2006-03-01']);
  14990. __webpack_require__(16);
  14991. Object.defineProperty(apiLoader.services['s3'], '2006-03-01', {
  14992. get: function get() {
  14993. var model = __webpack_require__(897);
  14994. model.paginators = __webpack_require__(707).pagination;
  14995. model.waiters = __webpack_require__(152).waiters;
  14996. return model;
  14997. },
  14998. enumerable: true,
  14999. configurable: true
  15000. });
  15001. module.exports = AWS.S3;
  15002. /***/ }),
  15003. /***/ 779:
  15004. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15005. "use strict";
  15006. /*!
  15007. * mime-types
  15008. * Copyright(c) 2014 Jonathan Ong
  15009. * Copyright(c) 2015 Douglas Christopher Wilson
  15010. * MIT Licensed
  15011. */
  15012. /**
  15013. * Module dependencies.
  15014. * @private
  15015. */
  15016. var db = __webpack_require__(852)
  15017. var extname = __webpack_require__(622).extname
  15018. /**
  15019. * Module variables.
  15020. * @private
  15021. */
  15022. var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
  15023. var TEXT_TYPE_REGEXP = /^text\//i
  15024. /**
  15025. * Module exports.
  15026. * @public
  15027. */
  15028. exports.charset = charset
  15029. exports.charsets = { lookup: charset }
  15030. exports.contentType = contentType
  15031. exports.extension = extension
  15032. exports.extensions = Object.create(null)
  15033. exports.lookup = lookup
  15034. exports.types = Object.create(null)
  15035. // Populate the extensions/types maps
  15036. populateMaps(exports.extensions, exports.types)
  15037. /**
  15038. * Get the default charset for a MIME type.
  15039. *
  15040. * @param {string} type
  15041. * @return {boolean|string}
  15042. */
  15043. function charset (type) {
  15044. if (!type || typeof type !== 'string') {
  15045. return false
  15046. }
  15047. // TODO: use media-typer
  15048. var match = EXTRACT_TYPE_REGEXP.exec(type)
  15049. var mime = match && db[match[1].toLowerCase()]
  15050. if (mime && mime.charset) {
  15051. return mime.charset
  15052. }
  15053. // default text/* to utf-8
  15054. if (match && TEXT_TYPE_REGEXP.test(match[1])) {
  15055. return 'UTF-8'
  15056. }
  15057. return false
  15058. }
  15059. /**
  15060. * Create a full Content-Type header given a MIME type or extension.
  15061. *
  15062. * @param {string} str
  15063. * @return {boolean|string}
  15064. */
  15065. function contentType (str) {
  15066. // TODO: should this even be in this module?
  15067. if (!str || typeof str !== 'string') {
  15068. return false
  15069. }
  15070. var mime = str.indexOf('/') === -1
  15071. ? exports.lookup(str)
  15072. : str
  15073. if (!mime) {
  15074. return false
  15075. }
  15076. // TODO: use content-type or other module
  15077. if (mime.indexOf('charset') === -1) {
  15078. var charset = exports.charset(mime)
  15079. if (charset) mime += '; charset=' + charset.toLowerCase()
  15080. }
  15081. return mime
  15082. }
  15083. /**
  15084. * Get the default extension for a MIME type.
  15085. *
  15086. * @param {string} type
  15087. * @return {boolean|string}
  15088. */
  15089. function extension (type) {
  15090. if (!type || typeof type !== 'string') {
  15091. return false
  15092. }
  15093. // TODO: use media-typer
  15094. var match = EXTRACT_TYPE_REGEXP.exec(type)
  15095. // get extensions
  15096. var exts = match && exports.extensions[match[1].toLowerCase()]
  15097. if (!exts || !exts.length) {
  15098. return false
  15099. }
  15100. return exts[0]
  15101. }
  15102. /**
  15103. * Lookup the MIME type for a file path/extension.
  15104. *
  15105. * @param {string} path
  15106. * @return {boolean|string}
  15107. */
  15108. function lookup (path) {
  15109. if (!path || typeof path !== 'string') {
  15110. return false
  15111. }
  15112. // get the extension ("ext" or ".ext" or full path)
  15113. var extension = extname('x.' + path)
  15114. .toLowerCase()
  15115. .substr(1)
  15116. if (!extension) {
  15117. return false
  15118. }
  15119. return exports.types[extension] || false
  15120. }
  15121. /**
  15122. * Populate the extensions and types maps.
  15123. * @private
  15124. */
  15125. function populateMaps (extensions, types) {
  15126. // source preference (least -> most)
  15127. var preference = ['nginx', 'apache', undefined, 'iana']
  15128. Object.keys(db).forEach(function forEachMimeType (type) {
  15129. var mime = db[type]
  15130. var exts = mime.extensions
  15131. if (!exts || !exts.length) {
  15132. return
  15133. }
  15134. // mime -> extensions
  15135. extensions[type] = exts
  15136. // extension -> mime
  15137. for (var i = 0; i < exts.length; i++) {
  15138. var extension = exts[i]
  15139. if (types[extension]) {
  15140. var from = preference.indexOf(db[types[extension]].source)
  15141. var to = preference.indexOf(mime.source)
  15142. if (types[extension] !== 'application/octet-stream' &&
  15143. (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
  15144. // skip the remapping
  15145. continue
  15146. }
  15147. }
  15148. // set the extension -> mime
  15149. types[extension] = type
  15150. }
  15151. })
  15152. }
  15153. /***/ }),
  15154. /***/ 788:
  15155. /***/ (function(module, __unusedexports, __webpack_require__) {
  15156. var Collection = __webpack_require__(583);
  15157. var Operation = __webpack_require__(964);
  15158. var Shape = __webpack_require__(682);
  15159. var Paginator = __webpack_require__(265);
  15160. var ResourceWaiter = __webpack_require__(624);
  15161. var metadata = __webpack_require__(694);
  15162. var util = __webpack_require__(153);
  15163. var property = util.property;
  15164. var memoizedProperty = util.memoizedProperty;
  15165. function Api(api, options) {
  15166. var self = this;
  15167. api = api || {};
  15168. options = options || {};
  15169. options.api = this;
  15170. api.metadata = api.metadata || {};
  15171. var serviceIdentifier = options.serviceIdentifier;
  15172. delete options.serviceIdentifier;
  15173. property(this, 'isApi', true, false);
  15174. property(this, 'apiVersion', api.metadata.apiVersion);
  15175. property(this, 'endpointPrefix', api.metadata.endpointPrefix);
  15176. property(this, 'signingName', api.metadata.signingName);
  15177. property(this, 'globalEndpoint', api.metadata.globalEndpoint);
  15178. property(this, 'signatureVersion', api.metadata.signatureVersion);
  15179. property(this, 'jsonVersion', api.metadata.jsonVersion);
  15180. property(this, 'targetPrefix', api.metadata.targetPrefix);
  15181. property(this, 'protocol', api.metadata.protocol);
  15182. property(this, 'timestampFormat', api.metadata.timestampFormat);
  15183. property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace);
  15184. property(this, 'abbreviation', api.metadata.serviceAbbreviation);
  15185. property(this, 'fullName', api.metadata.serviceFullName);
  15186. property(this, 'serviceId', api.metadata.serviceId);
  15187. if (serviceIdentifier && metadata[serviceIdentifier]) {
  15188. property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false);
  15189. }
  15190. memoizedProperty(this, 'className', function() {
  15191. var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName;
  15192. if (!name) return null;
  15193. name = name.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g, '');
  15194. if (name === 'ElasticLoadBalancing') name = 'ELB';
  15195. return name;
  15196. });
  15197. function addEndpointOperation(name, operation) {
  15198. if (operation.endpointoperation === true) {
  15199. property(self, 'endpointOperation', util.string.lowerFirst(name));
  15200. }
  15201. if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) {
  15202. property(
  15203. self,
  15204. 'hasRequiredEndpointDiscovery',
  15205. operation.endpointdiscovery.required === true
  15206. );
  15207. }
  15208. }
  15209. property(this, 'operations', new Collection(api.operations, options, function(name, operation) {
  15210. return new Operation(name, operation, options);
  15211. }, util.string.lowerFirst, addEndpointOperation));
  15212. property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) {
  15213. return Shape.create(shape, options);
  15214. }));
  15215. property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) {
  15216. return new Paginator(name, paginator, options);
  15217. }));
  15218. property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) {
  15219. return new ResourceWaiter(name, waiter, options);
  15220. }, util.string.lowerFirst));
  15221. if (options.documentation) {
  15222. property(this, 'documentation', api.documentation);
  15223. property(this, 'documentationUrl', api.documentationUrl);
  15224. }
  15225. }
  15226. /**
  15227. * @api private
  15228. */
  15229. module.exports = Api;
  15230. /***/ }),
  15231. /***/ 791:
  15232. /***/ (function(module, __unusedexports, __webpack_require__) {
  15233. var AWS = __webpack_require__(395);
  15234. var inherit = AWS.util.inherit;
  15235. /**
  15236. * @api private
  15237. */
  15238. AWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, {
  15239. addAuthorization: function addAuthorization(credentials, date) {
  15240. var datetime = AWS.util.date.rfc822(date);
  15241. this.request.headers['X-Amz-Date'] = datetime;
  15242. if (credentials.sessionToken) {
  15243. this.request.headers['x-amz-security-token'] = credentials.sessionToken;
  15244. }
  15245. this.request.headers['X-Amzn-Authorization'] =
  15246. this.authorization(credentials, datetime);
  15247. },
  15248. authorization: function authorization(credentials) {
  15249. return 'AWS3 ' +
  15250. 'AWSAccessKeyId=' + credentials.accessKeyId + ',' +
  15251. 'Algorithm=HmacSHA256,' +
  15252. 'SignedHeaders=' + this.signedHeaders() + ',' +
  15253. 'Signature=' + this.signature(credentials);
  15254. },
  15255. signedHeaders: function signedHeaders() {
  15256. var headers = [];
  15257. AWS.util.arrayEach(this.headersToSign(), function iterator(h) {
  15258. headers.push(h.toLowerCase());
  15259. });
  15260. return headers.sort().join(';');
  15261. },
  15262. canonicalHeaders: function canonicalHeaders() {
  15263. var headers = this.request.headers;
  15264. var parts = [];
  15265. AWS.util.arrayEach(this.headersToSign(), function iterator(h) {
  15266. parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim());
  15267. });
  15268. return parts.sort().join('\n') + '\n';
  15269. },
  15270. headersToSign: function headersToSign() {
  15271. var headers = [];
  15272. AWS.util.each(this.request.headers, function iterator(k) {
  15273. if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) {
  15274. headers.push(k);
  15275. }
  15276. });
  15277. return headers;
  15278. },
  15279. signature: function signature(credentials) {
  15280. return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');
  15281. },
  15282. stringToSign: function stringToSign() {
  15283. var parts = [];
  15284. parts.push(this.request.method);
  15285. parts.push('/');
  15286. parts.push('');
  15287. parts.push(this.canonicalHeaders());
  15288. parts.push(this.request.body);
  15289. return AWS.util.crypto.sha256(parts.join('\n'));
  15290. }
  15291. });
  15292. /**
  15293. * @api private
  15294. */
  15295. module.exports = AWS.Signers.V3;
  15296. /***/ }),
  15297. /***/ 796:
  15298. /***/ (function(module, __unusedexports, __webpack_require__) {
  15299. // Generated by CoffeeScript 1.12.7
  15300. (function() {
  15301. var XMLAttribute, XMLElement, XMLNode, isFunction, isObject, ref,
  15302. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  15303. hasProp = {}.hasOwnProperty;
  15304. ref = __webpack_require__(582), isObject = ref.isObject, isFunction = ref.isFunction;
  15305. XMLNode = __webpack_require__(855);
  15306. XMLAttribute = __webpack_require__(884);
  15307. module.exports = XMLElement = (function(superClass) {
  15308. extend(XMLElement, superClass);
  15309. function XMLElement(parent, name, attributes) {
  15310. XMLElement.__super__.constructor.call(this, parent);
  15311. if (name == null) {
  15312. throw new Error("Missing element name");
  15313. }
  15314. this.name = this.stringify.eleName(name);
  15315. this.attributes = {};
  15316. if (attributes != null) {
  15317. this.attribute(attributes);
  15318. }
  15319. if (parent.isDocument) {
  15320. this.isRoot = true;
  15321. this.documentObject = parent;
  15322. parent.rootObject = this;
  15323. }
  15324. }
  15325. XMLElement.prototype.clone = function() {
  15326. var att, attName, clonedSelf, ref1;
  15327. clonedSelf = Object.create(this);
  15328. if (clonedSelf.isRoot) {
  15329. clonedSelf.documentObject = null;
  15330. }
  15331. clonedSelf.attributes = {};
  15332. ref1 = this.attributes;
  15333. for (attName in ref1) {
  15334. if (!hasProp.call(ref1, attName)) continue;
  15335. att = ref1[attName];
  15336. clonedSelf.attributes[attName] = att.clone();
  15337. }
  15338. clonedSelf.children = [];
  15339. this.children.forEach(function(child) {
  15340. var clonedChild;
  15341. clonedChild = child.clone();
  15342. clonedChild.parent = clonedSelf;
  15343. return clonedSelf.children.push(clonedChild);
  15344. });
  15345. return clonedSelf;
  15346. };
  15347. XMLElement.prototype.attribute = function(name, value) {
  15348. var attName, attValue;
  15349. if (name != null) {
  15350. name = name.valueOf();
  15351. }
  15352. if (isObject(name)) {
  15353. for (attName in name) {
  15354. if (!hasProp.call(name, attName)) continue;
  15355. attValue = name[attName];
  15356. this.attribute(attName, attValue);
  15357. }
  15358. } else {
  15359. if (isFunction(value)) {
  15360. value = value.apply();
  15361. }
  15362. if (!this.options.skipNullAttributes || (value != null)) {
  15363. this.attributes[name] = new XMLAttribute(this, name, value);
  15364. }
  15365. }
  15366. return this;
  15367. };
  15368. XMLElement.prototype.removeAttribute = function(name) {
  15369. var attName, i, len;
  15370. if (name == null) {
  15371. throw new Error("Missing attribute name");
  15372. }
  15373. name = name.valueOf();
  15374. if (Array.isArray(name)) {
  15375. for (i = 0, len = name.length; i < len; i++) {
  15376. attName = name[i];
  15377. delete this.attributes[attName];
  15378. }
  15379. } else {
  15380. delete this.attributes[name];
  15381. }
  15382. return this;
  15383. };
  15384. XMLElement.prototype.toString = function(options) {
  15385. return this.options.writer.set(options).element(this);
  15386. };
  15387. XMLElement.prototype.att = function(name, value) {
  15388. return this.attribute(name, value);
  15389. };
  15390. XMLElement.prototype.a = function(name, value) {
  15391. return this.attribute(name, value);
  15392. };
  15393. return XMLElement;
  15394. })(XMLNode);
  15395. }).call(this);
  15396. /***/ }),
  15397. /***/ 801:
  15398. /***/ (function(module, __unusedexports, __webpack_require__) {
  15399. // Generated by CoffeeScript 1.12.7
  15400. (function() {
  15401. var XMLDTDAttList, XMLNode,
  15402. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  15403. hasProp = {}.hasOwnProperty;
  15404. XMLNode = __webpack_require__(855);
  15405. module.exports = XMLDTDAttList = (function(superClass) {
  15406. extend(XMLDTDAttList, superClass);
  15407. function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
  15408. XMLDTDAttList.__super__.constructor.call(this, parent);
  15409. if (elementName == null) {
  15410. throw new Error("Missing DTD element name");
  15411. }
  15412. if (attributeName == null) {
  15413. throw new Error("Missing DTD attribute name");
  15414. }
  15415. if (!attributeType) {
  15416. throw new Error("Missing DTD attribute type");
  15417. }
  15418. if (!defaultValueType) {
  15419. throw new Error("Missing DTD attribute default");
  15420. }
  15421. if (defaultValueType.indexOf('#') !== 0) {
  15422. defaultValueType = '#' + defaultValueType;
  15423. }
  15424. if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
  15425. throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
  15426. }
  15427. if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
  15428. throw new Error("Default value only applies to #FIXED or #DEFAULT");
  15429. }
  15430. this.elementName = this.stringify.eleName(elementName);
  15431. this.attributeName = this.stringify.attName(attributeName);
  15432. this.attributeType = this.stringify.dtdAttType(attributeType);
  15433. this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
  15434. this.defaultValueType = defaultValueType;
  15435. }
  15436. XMLDTDAttList.prototype.toString = function(options) {
  15437. return this.options.writer.set(options).dtdAttList(this);
  15438. };
  15439. return XMLDTDAttList;
  15440. })(XMLNode);
  15441. }).call(this);
  15442. /***/ }),
  15443. /***/ 802:
  15444. /***/ (function(__unusedmodule, exports) {
  15445. (function(exports) {
  15446. "use strict";
  15447. function isArray(obj) {
  15448. if (obj !== null) {
  15449. return Object.prototype.toString.call(obj) === "[object Array]";
  15450. } else {
  15451. return false;
  15452. }
  15453. }
  15454. function isObject(obj) {
  15455. if (obj !== null) {
  15456. return Object.prototype.toString.call(obj) === "[object Object]";
  15457. } else {
  15458. return false;
  15459. }
  15460. }
  15461. function strictDeepEqual(first, second) {
  15462. // Check the scalar case first.
  15463. if (first === second) {
  15464. return true;
  15465. }
  15466. // Check if they are the same type.
  15467. var firstType = Object.prototype.toString.call(first);
  15468. if (firstType !== Object.prototype.toString.call(second)) {
  15469. return false;
  15470. }
  15471. // We know that first and second have the same type so we can just check the
  15472. // first type from now on.
  15473. if (isArray(first) === true) {
  15474. // Short circuit if they're not the same length;
  15475. if (first.length !== second.length) {
  15476. return false;
  15477. }
  15478. for (var i = 0; i < first.length; i++) {
  15479. if (strictDeepEqual(first[i], second[i]) === false) {
  15480. return false;
  15481. }
  15482. }
  15483. return true;
  15484. }
  15485. if (isObject(first) === true) {
  15486. // An object is equal if it has the same key/value pairs.
  15487. var keysSeen = {};
  15488. for (var key in first) {
  15489. if (hasOwnProperty.call(first, key)) {
  15490. if (strictDeepEqual(first[key], second[key]) === false) {
  15491. return false;
  15492. }
  15493. keysSeen[key] = true;
  15494. }
  15495. }
  15496. // Now check that there aren't any keys in second that weren't
  15497. // in first.
  15498. for (var key2 in second) {
  15499. if (hasOwnProperty.call(second, key2)) {
  15500. if (keysSeen[key2] !== true) {
  15501. return false;
  15502. }
  15503. }
  15504. }
  15505. return true;
  15506. }
  15507. return false;
  15508. }
  15509. function isFalse(obj) {
  15510. // From the spec:
  15511. // A false value corresponds to the following values:
  15512. // Empty list
  15513. // Empty object
  15514. // Empty string
  15515. // False boolean
  15516. // null value
  15517. // First check the scalar values.
  15518. if (obj === "" || obj === false || obj === null) {
  15519. return true;
  15520. } else if (isArray(obj) && obj.length === 0) {
  15521. // Check for an empty array.
  15522. return true;
  15523. } else if (isObject(obj)) {
  15524. // Check for an empty object.
  15525. for (var key in obj) {
  15526. // If there are any keys, then
  15527. // the object is not empty so the object
  15528. // is not false.
  15529. if (obj.hasOwnProperty(key)) {
  15530. return false;
  15531. }
  15532. }
  15533. return true;
  15534. } else {
  15535. return false;
  15536. }
  15537. }
  15538. function objValues(obj) {
  15539. var keys = Object.keys(obj);
  15540. var values = [];
  15541. for (var i = 0; i < keys.length; i++) {
  15542. values.push(obj[keys[i]]);
  15543. }
  15544. return values;
  15545. }
  15546. function merge(a, b) {
  15547. var merged = {};
  15548. for (var key in a) {
  15549. merged[key] = a[key];
  15550. }
  15551. for (var key2 in b) {
  15552. merged[key2] = b[key2];
  15553. }
  15554. return merged;
  15555. }
  15556. var trimLeft;
  15557. if (typeof String.prototype.trimLeft === "function") {
  15558. trimLeft = function(str) {
  15559. return str.trimLeft();
  15560. };
  15561. } else {
  15562. trimLeft = function(str) {
  15563. return str.match(/^\s*(.*)/)[1];
  15564. };
  15565. }
  15566. // Type constants used to define functions.
  15567. var TYPE_NUMBER = 0;
  15568. var TYPE_ANY = 1;
  15569. var TYPE_STRING = 2;
  15570. var TYPE_ARRAY = 3;
  15571. var TYPE_OBJECT = 4;
  15572. var TYPE_BOOLEAN = 5;
  15573. var TYPE_EXPREF = 6;
  15574. var TYPE_NULL = 7;
  15575. var TYPE_ARRAY_NUMBER = 8;
  15576. var TYPE_ARRAY_STRING = 9;
  15577. var TOK_EOF = "EOF";
  15578. var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier";
  15579. var TOK_QUOTEDIDENTIFIER = "QuotedIdentifier";
  15580. var TOK_RBRACKET = "Rbracket";
  15581. var TOK_RPAREN = "Rparen";
  15582. var TOK_COMMA = "Comma";
  15583. var TOK_COLON = "Colon";
  15584. var TOK_RBRACE = "Rbrace";
  15585. var TOK_NUMBER = "Number";
  15586. var TOK_CURRENT = "Current";
  15587. var TOK_EXPREF = "Expref";
  15588. var TOK_PIPE = "Pipe";
  15589. var TOK_OR = "Or";
  15590. var TOK_AND = "And";
  15591. var TOK_EQ = "EQ";
  15592. var TOK_GT = "GT";
  15593. var TOK_LT = "LT";
  15594. var TOK_GTE = "GTE";
  15595. var TOK_LTE = "LTE";
  15596. var TOK_NE = "NE";
  15597. var TOK_FLATTEN = "Flatten";
  15598. var TOK_STAR = "Star";
  15599. var TOK_FILTER = "Filter";
  15600. var TOK_DOT = "Dot";
  15601. var TOK_NOT = "Not";
  15602. var TOK_LBRACE = "Lbrace";
  15603. var TOK_LBRACKET = "Lbracket";
  15604. var TOK_LPAREN= "Lparen";
  15605. var TOK_LITERAL= "Literal";
  15606. // The "&", "[", "<", ">" tokens
  15607. // are not in basicToken because
  15608. // there are two token variants
  15609. // ("&&", "[?", "<=", ">="). This is specially handled
  15610. // below.
  15611. var basicTokens = {
  15612. ".": TOK_DOT,
  15613. "*": TOK_STAR,
  15614. ",": TOK_COMMA,
  15615. ":": TOK_COLON,
  15616. "{": TOK_LBRACE,
  15617. "}": TOK_RBRACE,
  15618. "]": TOK_RBRACKET,
  15619. "(": TOK_LPAREN,
  15620. ")": TOK_RPAREN,
  15621. "@": TOK_CURRENT
  15622. };
  15623. var operatorStartToken = {
  15624. "<": true,
  15625. ">": true,
  15626. "=": true,
  15627. "!": true
  15628. };
  15629. var skipChars = {
  15630. " ": true,
  15631. "\t": true,
  15632. "\n": true
  15633. };
  15634. function isAlpha(ch) {
  15635. return (ch >= "a" && ch <= "z") ||
  15636. (ch >= "A" && ch <= "Z") ||
  15637. ch === "_";
  15638. }
  15639. function isNum(ch) {
  15640. return (ch >= "0" && ch <= "9") ||
  15641. ch === "-";
  15642. }
  15643. function isAlphaNum(ch) {
  15644. return (ch >= "a" && ch <= "z") ||
  15645. (ch >= "A" && ch <= "Z") ||
  15646. (ch >= "0" && ch <= "9") ||
  15647. ch === "_";
  15648. }
  15649. function Lexer() {
  15650. }
  15651. Lexer.prototype = {
  15652. tokenize: function(stream) {
  15653. var tokens = [];
  15654. this._current = 0;
  15655. var start;
  15656. var identifier;
  15657. var token;
  15658. while (this._current < stream.length) {
  15659. if (isAlpha(stream[this._current])) {
  15660. start = this._current;
  15661. identifier = this._consumeUnquotedIdentifier(stream);
  15662. tokens.push({type: TOK_UNQUOTEDIDENTIFIER,
  15663. value: identifier,
  15664. start: start});
  15665. } else if (basicTokens[stream[this._current]] !== undefined) {
  15666. tokens.push({type: basicTokens[stream[this._current]],
  15667. value: stream[this._current],
  15668. start: this._current});
  15669. this._current++;
  15670. } else if (isNum(stream[this._current])) {
  15671. token = this._consumeNumber(stream);
  15672. tokens.push(token);
  15673. } else if (stream[this._current] === "[") {
  15674. // No need to increment this._current. This happens
  15675. // in _consumeLBracket
  15676. token = this._consumeLBracket(stream);
  15677. tokens.push(token);
  15678. } else if (stream[this._current] === "\"") {
  15679. start = this._current;
  15680. identifier = this._consumeQuotedIdentifier(stream);
  15681. tokens.push({type: TOK_QUOTEDIDENTIFIER,
  15682. value: identifier,
  15683. start: start});
  15684. } else if (stream[this._current] === "'") {
  15685. start = this._current;
  15686. identifier = this._consumeRawStringLiteral(stream);
  15687. tokens.push({type: TOK_LITERAL,
  15688. value: identifier,
  15689. start: start});
  15690. } else if (stream[this._current] === "`") {
  15691. start = this._current;
  15692. var literal = this._consumeLiteral(stream);
  15693. tokens.push({type: TOK_LITERAL,
  15694. value: literal,
  15695. start: start});
  15696. } else if (operatorStartToken[stream[this._current]] !== undefined) {
  15697. tokens.push(this._consumeOperator(stream));
  15698. } else if (skipChars[stream[this._current]] !== undefined) {
  15699. // Ignore whitespace.
  15700. this._current++;
  15701. } else if (stream[this._current] === "&") {
  15702. start = this._current;
  15703. this._current++;
  15704. if (stream[this._current] === "&") {
  15705. this._current++;
  15706. tokens.push({type: TOK_AND, value: "&&", start: start});
  15707. } else {
  15708. tokens.push({type: TOK_EXPREF, value: "&", start: start});
  15709. }
  15710. } else if (stream[this._current] === "|") {
  15711. start = this._current;
  15712. this._current++;
  15713. if (stream[this._current] === "|") {
  15714. this._current++;
  15715. tokens.push({type: TOK_OR, value: "||", start: start});
  15716. } else {
  15717. tokens.push({type: TOK_PIPE, value: "|", start: start});
  15718. }
  15719. } else {
  15720. var error = new Error("Unknown character:" + stream[this._current]);
  15721. error.name = "LexerError";
  15722. throw error;
  15723. }
  15724. }
  15725. return tokens;
  15726. },
  15727. _consumeUnquotedIdentifier: function(stream) {
  15728. var start = this._current;
  15729. this._current++;
  15730. while (this._current < stream.length && isAlphaNum(stream[this._current])) {
  15731. this._current++;
  15732. }
  15733. return stream.slice(start, this._current);
  15734. },
  15735. _consumeQuotedIdentifier: function(stream) {
  15736. var start = this._current;
  15737. this._current++;
  15738. var maxLength = stream.length;
  15739. while (stream[this._current] !== "\"" && this._current < maxLength) {
  15740. // You can escape a double quote and you can escape an escape.
  15741. var current = this._current;
  15742. if (stream[current] === "\\" && (stream[current + 1] === "\\" ||
  15743. stream[current + 1] === "\"")) {
  15744. current += 2;
  15745. } else {
  15746. current++;
  15747. }
  15748. this._current = current;
  15749. }
  15750. this._current++;
  15751. return JSON.parse(stream.slice(start, this._current));
  15752. },
  15753. _consumeRawStringLiteral: function(stream) {
  15754. var start = this._current;
  15755. this._current++;
  15756. var maxLength = stream.length;
  15757. while (stream[this._current] !== "'" && this._current < maxLength) {
  15758. // You can escape a single quote and you can escape an escape.
  15759. var current = this._current;
  15760. if (stream[current] === "\\" && (stream[current + 1] === "\\" ||
  15761. stream[current + 1] === "'")) {
  15762. current += 2;
  15763. } else {
  15764. current++;
  15765. }
  15766. this._current = current;
  15767. }
  15768. this._current++;
  15769. var literal = stream.slice(start + 1, this._current - 1);
  15770. return literal.replace("\\'", "'");
  15771. },
  15772. _consumeNumber: function(stream) {
  15773. var start = this._current;
  15774. this._current++;
  15775. var maxLength = stream.length;
  15776. while (isNum(stream[this._current]) && this._current < maxLength) {
  15777. this._current++;
  15778. }
  15779. var value = parseInt(stream.slice(start, this._current));
  15780. return {type: TOK_NUMBER, value: value, start: start};
  15781. },
  15782. _consumeLBracket: function(stream) {
  15783. var start = this._current;
  15784. this._current++;
  15785. if (stream[this._current] === "?") {
  15786. this._current++;
  15787. return {type: TOK_FILTER, value: "[?", start: start};
  15788. } else if (stream[this._current] === "]") {
  15789. this._current++;
  15790. return {type: TOK_FLATTEN, value: "[]", start: start};
  15791. } else {
  15792. return {type: TOK_LBRACKET, value: "[", start: start};
  15793. }
  15794. },
  15795. _consumeOperator: function(stream) {
  15796. var start = this._current;
  15797. var startingChar = stream[start];
  15798. this._current++;
  15799. if (startingChar === "!") {
  15800. if (stream[this._current] === "=") {
  15801. this._current++;
  15802. return {type: TOK_NE, value: "!=", start: start};
  15803. } else {
  15804. return {type: TOK_NOT, value: "!", start: start};
  15805. }
  15806. } else if (startingChar === "<") {
  15807. if (stream[this._current] === "=") {
  15808. this._current++;
  15809. return {type: TOK_LTE, value: "<=", start: start};
  15810. } else {
  15811. return {type: TOK_LT, value: "<", start: start};
  15812. }
  15813. } else if (startingChar === ">") {
  15814. if (stream[this._current] === "=") {
  15815. this._current++;
  15816. return {type: TOK_GTE, value: ">=", start: start};
  15817. } else {
  15818. return {type: TOK_GT, value: ">", start: start};
  15819. }
  15820. } else if (startingChar === "=") {
  15821. if (stream[this._current] === "=") {
  15822. this._current++;
  15823. return {type: TOK_EQ, value: "==", start: start};
  15824. }
  15825. }
  15826. },
  15827. _consumeLiteral: function(stream) {
  15828. this._current++;
  15829. var start = this._current;
  15830. var maxLength = stream.length;
  15831. var literal;
  15832. while(stream[this._current] !== "`" && this._current < maxLength) {
  15833. // You can escape a literal char or you can escape the escape.
  15834. var current = this._current;
  15835. if (stream[current] === "\\" && (stream[current + 1] === "\\" ||
  15836. stream[current + 1] === "`")) {
  15837. current += 2;
  15838. } else {
  15839. current++;
  15840. }
  15841. this._current = current;
  15842. }
  15843. var literalString = trimLeft(stream.slice(start, this._current));
  15844. literalString = literalString.replace("\\`", "`");
  15845. if (this._looksLikeJSON(literalString)) {
  15846. literal = JSON.parse(literalString);
  15847. } else {
  15848. // Try to JSON parse it as "<literal>"
  15849. literal = JSON.parse("\"" + literalString + "\"");
  15850. }
  15851. // +1 gets us to the ending "`", +1 to move on to the next char.
  15852. this._current++;
  15853. return literal;
  15854. },
  15855. _looksLikeJSON: function(literalString) {
  15856. var startingChars = "[{\"";
  15857. var jsonLiterals = ["true", "false", "null"];
  15858. var numberLooking = "-0123456789";
  15859. if (literalString === "") {
  15860. return false;
  15861. } else if (startingChars.indexOf(literalString[0]) >= 0) {
  15862. return true;
  15863. } else if (jsonLiterals.indexOf(literalString) >= 0) {
  15864. return true;
  15865. } else if (numberLooking.indexOf(literalString[0]) >= 0) {
  15866. try {
  15867. JSON.parse(literalString);
  15868. return true;
  15869. } catch (ex) {
  15870. return false;
  15871. }
  15872. } else {
  15873. return false;
  15874. }
  15875. }
  15876. };
  15877. var bindingPower = {};
  15878. bindingPower[TOK_EOF] = 0;
  15879. bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0;
  15880. bindingPower[TOK_QUOTEDIDENTIFIER] = 0;
  15881. bindingPower[TOK_RBRACKET] = 0;
  15882. bindingPower[TOK_RPAREN] = 0;
  15883. bindingPower[TOK_COMMA] = 0;
  15884. bindingPower[TOK_RBRACE] = 0;
  15885. bindingPower[TOK_NUMBER] = 0;
  15886. bindingPower[TOK_CURRENT] = 0;
  15887. bindingPower[TOK_EXPREF] = 0;
  15888. bindingPower[TOK_PIPE] = 1;
  15889. bindingPower[TOK_OR] = 2;
  15890. bindingPower[TOK_AND] = 3;
  15891. bindingPower[TOK_EQ] = 5;
  15892. bindingPower[TOK_GT] = 5;
  15893. bindingPower[TOK_LT] = 5;
  15894. bindingPower[TOK_GTE] = 5;
  15895. bindingPower[TOK_LTE] = 5;
  15896. bindingPower[TOK_NE] = 5;
  15897. bindingPower[TOK_FLATTEN] = 9;
  15898. bindingPower[TOK_STAR] = 20;
  15899. bindingPower[TOK_FILTER] = 21;
  15900. bindingPower[TOK_DOT] = 40;
  15901. bindingPower[TOK_NOT] = 45;
  15902. bindingPower[TOK_LBRACE] = 50;
  15903. bindingPower[TOK_LBRACKET] = 55;
  15904. bindingPower[TOK_LPAREN] = 60;
  15905. function Parser() {
  15906. }
  15907. Parser.prototype = {
  15908. parse: function(expression) {
  15909. this._loadTokens(expression);
  15910. this.index = 0;
  15911. var ast = this.expression(0);
  15912. if (this._lookahead(0) !== TOK_EOF) {
  15913. var t = this._lookaheadToken(0);
  15914. var error = new Error(
  15915. "Unexpected token type: " + t.type + ", value: " + t.value);
  15916. error.name = "ParserError";
  15917. throw error;
  15918. }
  15919. return ast;
  15920. },
  15921. _loadTokens: function(expression) {
  15922. var lexer = new Lexer();
  15923. var tokens = lexer.tokenize(expression);
  15924. tokens.push({type: TOK_EOF, value: "", start: expression.length});
  15925. this.tokens = tokens;
  15926. },
  15927. expression: function(rbp) {
  15928. var leftToken = this._lookaheadToken(0);
  15929. this._advance();
  15930. var left = this.nud(leftToken);
  15931. var currentToken = this._lookahead(0);
  15932. while (rbp < bindingPower[currentToken]) {
  15933. this._advance();
  15934. left = this.led(currentToken, left);
  15935. currentToken = this._lookahead(0);
  15936. }
  15937. return left;
  15938. },
  15939. _lookahead: function(number) {
  15940. return this.tokens[this.index + number].type;
  15941. },
  15942. _lookaheadToken: function(number) {
  15943. return this.tokens[this.index + number];
  15944. },
  15945. _advance: function() {
  15946. this.index++;
  15947. },
  15948. nud: function(token) {
  15949. var left;
  15950. var right;
  15951. var expression;
  15952. switch (token.type) {
  15953. case TOK_LITERAL:
  15954. return {type: "Literal", value: token.value};
  15955. case TOK_UNQUOTEDIDENTIFIER:
  15956. return {type: "Field", name: token.value};
  15957. case TOK_QUOTEDIDENTIFIER:
  15958. var node = {type: "Field", name: token.value};
  15959. if (this._lookahead(0) === TOK_LPAREN) {
  15960. throw new Error("Quoted identifier not allowed for function names.");
  15961. } else {
  15962. return node;
  15963. }
  15964. break;
  15965. case TOK_NOT:
  15966. right = this.expression(bindingPower.Not);
  15967. return {type: "NotExpression", children: [right]};
  15968. case TOK_STAR:
  15969. left = {type: "Identity"};
  15970. right = null;
  15971. if (this._lookahead(0) === TOK_RBRACKET) {
  15972. // This can happen in a multiselect,
  15973. // [a, b, *]
  15974. right = {type: "Identity"};
  15975. } else {
  15976. right = this._parseProjectionRHS(bindingPower.Star);
  15977. }
  15978. return {type: "ValueProjection", children: [left, right]};
  15979. case TOK_FILTER:
  15980. return this.led(token.type, {type: "Identity"});
  15981. case TOK_LBRACE:
  15982. return this._parseMultiselectHash();
  15983. case TOK_FLATTEN:
  15984. left = {type: TOK_FLATTEN, children: [{type: "Identity"}]};
  15985. right = this._parseProjectionRHS(bindingPower.Flatten);
  15986. return {type: "Projection", children: [left, right]};
  15987. case TOK_LBRACKET:
  15988. if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) {
  15989. right = this._parseIndexExpression();
  15990. return this._projectIfSlice({type: "Identity"}, right);
  15991. } else if (this._lookahead(0) === TOK_STAR &&
  15992. this._lookahead(1) === TOK_RBRACKET) {
  15993. this._advance();
  15994. this._advance();
  15995. right = this._parseProjectionRHS(bindingPower.Star);
  15996. return {type: "Projection",
  15997. children: [{type: "Identity"}, right]};
  15998. } else {
  15999. return this._parseMultiselectList();
  16000. }
  16001. break;
  16002. case TOK_CURRENT:
  16003. return {type: TOK_CURRENT};
  16004. case TOK_EXPREF:
  16005. expression = this.expression(bindingPower.Expref);
  16006. return {type: "ExpressionReference", children: [expression]};
  16007. case TOK_LPAREN:
  16008. var args = [];
  16009. while (this._lookahead(0) !== TOK_RPAREN) {
  16010. if (this._lookahead(0) === TOK_CURRENT) {
  16011. expression = {type: TOK_CURRENT};
  16012. this._advance();
  16013. } else {
  16014. expression = this.expression(0);
  16015. }
  16016. args.push(expression);
  16017. }
  16018. this._match(TOK_RPAREN);
  16019. return args[0];
  16020. default:
  16021. this._errorToken(token);
  16022. }
  16023. },
  16024. led: function(tokenName, left) {
  16025. var right;
  16026. switch(tokenName) {
  16027. case TOK_DOT:
  16028. var rbp = bindingPower.Dot;
  16029. if (this._lookahead(0) !== TOK_STAR) {
  16030. right = this._parseDotRHS(rbp);
  16031. return {type: "Subexpression", children: [left, right]};
  16032. } else {
  16033. // Creating a projection.
  16034. this._advance();
  16035. right = this._parseProjectionRHS(rbp);
  16036. return {type: "ValueProjection", children: [left, right]};
  16037. }
  16038. break;
  16039. case TOK_PIPE:
  16040. right = this.expression(bindingPower.Pipe);
  16041. return {type: TOK_PIPE, children: [left, right]};
  16042. case TOK_OR:
  16043. right = this.expression(bindingPower.Or);
  16044. return {type: "OrExpression", children: [left, right]};
  16045. case TOK_AND:
  16046. right = this.expression(bindingPower.And);
  16047. return {type: "AndExpression", children: [left, right]};
  16048. case TOK_LPAREN:
  16049. var name = left.name;
  16050. var args = [];
  16051. var expression, node;
  16052. while (this._lookahead(0) !== TOK_RPAREN) {
  16053. if (this._lookahead(0) === TOK_CURRENT) {
  16054. expression = {type: TOK_CURRENT};
  16055. this._advance();
  16056. } else {
  16057. expression = this.expression(0);
  16058. }
  16059. if (this._lookahead(0) === TOK_COMMA) {
  16060. this._match(TOK_COMMA);
  16061. }
  16062. args.push(expression);
  16063. }
  16064. this._match(TOK_RPAREN);
  16065. node = {type: "Function", name: name, children: args};
  16066. return node;
  16067. case TOK_FILTER:
  16068. var condition = this.expression(0);
  16069. this._match(TOK_RBRACKET);
  16070. if (this._lookahead(0) === TOK_FLATTEN) {
  16071. right = {type: "Identity"};
  16072. } else {
  16073. right = this._parseProjectionRHS(bindingPower.Filter);
  16074. }
  16075. return {type: "FilterProjection", children: [left, right, condition]};
  16076. case TOK_FLATTEN:
  16077. var leftNode = {type: TOK_FLATTEN, children: [left]};
  16078. var rightNode = this._parseProjectionRHS(bindingPower.Flatten);
  16079. return {type: "Projection", children: [leftNode, rightNode]};
  16080. case TOK_EQ:
  16081. case TOK_NE:
  16082. case TOK_GT:
  16083. case TOK_GTE:
  16084. case TOK_LT:
  16085. case TOK_LTE:
  16086. return this._parseComparator(left, tokenName);
  16087. case TOK_LBRACKET:
  16088. var token = this._lookaheadToken(0);
  16089. if (token.type === TOK_NUMBER || token.type === TOK_COLON) {
  16090. right = this._parseIndexExpression();
  16091. return this._projectIfSlice(left, right);
  16092. } else {
  16093. this._match(TOK_STAR);
  16094. this._match(TOK_RBRACKET);
  16095. right = this._parseProjectionRHS(bindingPower.Star);
  16096. return {type: "Projection", children: [left, right]};
  16097. }
  16098. break;
  16099. default:
  16100. this._errorToken(this._lookaheadToken(0));
  16101. }
  16102. },
  16103. _match: function(tokenType) {
  16104. if (this._lookahead(0) === tokenType) {
  16105. this._advance();
  16106. } else {
  16107. var t = this._lookaheadToken(0);
  16108. var error = new Error("Expected " + tokenType + ", got: " + t.type);
  16109. error.name = "ParserError";
  16110. throw error;
  16111. }
  16112. },
  16113. _errorToken: function(token) {
  16114. var error = new Error("Invalid token (" +
  16115. token.type + "): \"" +
  16116. token.value + "\"");
  16117. error.name = "ParserError";
  16118. throw error;
  16119. },
  16120. _parseIndexExpression: function() {
  16121. if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) {
  16122. return this._parseSliceExpression();
  16123. } else {
  16124. var node = {
  16125. type: "Index",
  16126. value: this._lookaheadToken(0).value};
  16127. this._advance();
  16128. this._match(TOK_RBRACKET);
  16129. return node;
  16130. }
  16131. },
  16132. _projectIfSlice: function(left, right) {
  16133. var indexExpr = {type: "IndexExpression", children: [left, right]};
  16134. if (right.type === "Slice") {
  16135. return {
  16136. type: "Projection",
  16137. children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)]
  16138. };
  16139. } else {
  16140. return indexExpr;
  16141. }
  16142. },
  16143. _parseSliceExpression: function() {
  16144. // [start:end:step] where each part is optional, as well as the last
  16145. // colon.
  16146. var parts = [null, null, null];
  16147. var index = 0;
  16148. var currentToken = this._lookahead(0);
  16149. while (currentToken !== TOK_RBRACKET && index < 3) {
  16150. if (currentToken === TOK_COLON) {
  16151. index++;
  16152. this._advance();
  16153. } else if (currentToken === TOK_NUMBER) {
  16154. parts[index] = this._lookaheadToken(0).value;
  16155. this._advance();
  16156. } else {
  16157. var t = this._lookahead(0);
  16158. var error = new Error("Syntax error, unexpected token: " +
  16159. t.value + "(" + t.type + ")");
  16160. error.name = "Parsererror";
  16161. throw error;
  16162. }
  16163. currentToken = this._lookahead(0);
  16164. }
  16165. this._match(TOK_RBRACKET);
  16166. return {
  16167. type: "Slice",
  16168. children: parts
  16169. };
  16170. },
  16171. _parseComparator: function(left, comparator) {
  16172. var right = this.expression(bindingPower[comparator]);
  16173. return {type: "Comparator", name: comparator, children: [left, right]};
  16174. },
  16175. _parseDotRHS: function(rbp) {
  16176. var lookahead = this._lookahead(0);
  16177. var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR];
  16178. if (exprTokens.indexOf(lookahead) >= 0) {
  16179. return this.expression(rbp);
  16180. } else if (lookahead === TOK_LBRACKET) {
  16181. this._match(TOK_LBRACKET);
  16182. return this._parseMultiselectList();
  16183. } else if (lookahead === TOK_LBRACE) {
  16184. this._match(TOK_LBRACE);
  16185. return this._parseMultiselectHash();
  16186. }
  16187. },
  16188. _parseProjectionRHS: function(rbp) {
  16189. var right;
  16190. if (bindingPower[this._lookahead(0)] < 10) {
  16191. right = {type: "Identity"};
  16192. } else if (this._lookahead(0) === TOK_LBRACKET) {
  16193. right = this.expression(rbp);
  16194. } else if (this._lookahead(0) === TOK_FILTER) {
  16195. right = this.expression(rbp);
  16196. } else if (this._lookahead(0) === TOK_DOT) {
  16197. this._match(TOK_DOT);
  16198. right = this._parseDotRHS(rbp);
  16199. } else {
  16200. var t = this._lookaheadToken(0);
  16201. var error = new Error("Sytanx error, unexpected token: " +
  16202. t.value + "(" + t.type + ")");
  16203. error.name = "ParserError";
  16204. throw error;
  16205. }
  16206. return right;
  16207. },
  16208. _parseMultiselectList: function() {
  16209. var expressions = [];
  16210. while (this._lookahead(0) !== TOK_RBRACKET) {
  16211. var expression = this.expression(0);
  16212. expressions.push(expression);
  16213. if (this._lookahead(0) === TOK_COMMA) {
  16214. this._match(TOK_COMMA);
  16215. if (this._lookahead(0) === TOK_RBRACKET) {
  16216. throw new Error("Unexpected token Rbracket");
  16217. }
  16218. }
  16219. }
  16220. this._match(TOK_RBRACKET);
  16221. return {type: "MultiSelectList", children: expressions};
  16222. },
  16223. _parseMultiselectHash: function() {
  16224. var pairs = [];
  16225. var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER];
  16226. var keyToken, keyName, value, node;
  16227. for (;;) {
  16228. keyToken = this._lookaheadToken(0);
  16229. if (identifierTypes.indexOf(keyToken.type) < 0) {
  16230. throw new Error("Expecting an identifier token, got: " +
  16231. keyToken.type);
  16232. }
  16233. keyName = keyToken.value;
  16234. this._advance();
  16235. this._match(TOK_COLON);
  16236. value = this.expression(0);
  16237. node = {type: "KeyValuePair", name: keyName, value: value};
  16238. pairs.push(node);
  16239. if (this._lookahead(0) === TOK_COMMA) {
  16240. this._match(TOK_COMMA);
  16241. } else if (this._lookahead(0) === TOK_RBRACE) {
  16242. this._match(TOK_RBRACE);
  16243. break;
  16244. }
  16245. }
  16246. return {type: "MultiSelectHash", children: pairs};
  16247. }
  16248. };
  16249. function TreeInterpreter(runtime) {
  16250. this.runtime = runtime;
  16251. }
  16252. TreeInterpreter.prototype = {
  16253. search: function(node, value) {
  16254. return this.visit(node, value);
  16255. },
  16256. visit: function(node, value) {
  16257. var matched, current, result, first, second, field, left, right, collected, i;
  16258. switch (node.type) {
  16259. case "Field":
  16260. if (value === null ) {
  16261. return null;
  16262. } else if (isObject(value)) {
  16263. field = value[node.name];
  16264. if (field === undefined) {
  16265. return null;
  16266. } else {
  16267. return field;
  16268. }
  16269. } else {
  16270. return null;
  16271. }
  16272. break;
  16273. case "Subexpression":
  16274. result = this.visit(node.children[0], value);
  16275. for (i = 1; i < node.children.length; i++) {
  16276. result = this.visit(node.children[1], result);
  16277. if (result === null) {
  16278. return null;
  16279. }
  16280. }
  16281. return result;
  16282. case "IndexExpression":
  16283. left = this.visit(node.children[0], value);
  16284. right = this.visit(node.children[1], left);
  16285. return right;
  16286. case "Index":
  16287. if (!isArray(value)) {
  16288. return null;
  16289. }
  16290. var index = node.value;
  16291. if (index < 0) {
  16292. index = value.length + index;
  16293. }
  16294. result = value[index];
  16295. if (result === undefined) {
  16296. result = null;
  16297. }
  16298. return result;
  16299. case "Slice":
  16300. if (!isArray(value)) {
  16301. return null;
  16302. }
  16303. var sliceParams = node.children.slice(0);
  16304. var computed = this.computeSliceParams(value.length, sliceParams);
  16305. var start = computed[0];
  16306. var stop = computed[1];
  16307. var step = computed[2];
  16308. result = [];
  16309. if (step > 0) {
  16310. for (i = start; i < stop; i += step) {
  16311. result.push(value[i]);
  16312. }
  16313. } else {
  16314. for (i = start; i > stop; i += step) {
  16315. result.push(value[i]);
  16316. }
  16317. }
  16318. return result;
  16319. case "Projection":
  16320. // Evaluate left child.
  16321. var base = this.visit(node.children[0], value);
  16322. if (!isArray(base)) {
  16323. return null;
  16324. }
  16325. collected = [];
  16326. for (i = 0; i < base.length; i++) {
  16327. current = this.visit(node.children[1], base[i]);
  16328. if (current !== null) {
  16329. collected.push(current);
  16330. }
  16331. }
  16332. return collected;
  16333. case "ValueProjection":
  16334. // Evaluate left child.
  16335. base = this.visit(node.children[0], value);
  16336. if (!isObject(base)) {
  16337. return null;
  16338. }
  16339. collected = [];
  16340. var values = objValues(base);
  16341. for (i = 0; i < values.length; i++) {
  16342. current = this.visit(node.children[1], values[i]);
  16343. if (current !== null) {
  16344. collected.push(current);
  16345. }
  16346. }
  16347. return collected;
  16348. case "FilterProjection":
  16349. base = this.visit(node.children[0], value);
  16350. if (!isArray(base)) {
  16351. return null;
  16352. }
  16353. var filtered = [];
  16354. var finalResults = [];
  16355. for (i = 0; i < base.length; i++) {
  16356. matched = this.visit(node.children[2], base[i]);
  16357. if (!isFalse(matched)) {
  16358. filtered.push(base[i]);
  16359. }
  16360. }
  16361. for (var j = 0; j < filtered.length; j++) {
  16362. current = this.visit(node.children[1], filtered[j]);
  16363. if (current !== null) {
  16364. finalResults.push(current);
  16365. }
  16366. }
  16367. return finalResults;
  16368. case "Comparator":
  16369. first = this.visit(node.children[0], value);
  16370. second = this.visit(node.children[1], value);
  16371. switch(node.name) {
  16372. case TOK_EQ:
  16373. result = strictDeepEqual(first, second);
  16374. break;
  16375. case TOK_NE:
  16376. result = !strictDeepEqual(first, second);
  16377. break;
  16378. case TOK_GT:
  16379. result = first > second;
  16380. break;
  16381. case TOK_GTE:
  16382. result = first >= second;
  16383. break;
  16384. case TOK_LT:
  16385. result = first < second;
  16386. break;
  16387. case TOK_LTE:
  16388. result = first <= second;
  16389. break;
  16390. default:
  16391. throw new Error("Unknown comparator: " + node.name);
  16392. }
  16393. return result;
  16394. case TOK_FLATTEN:
  16395. var original = this.visit(node.children[0], value);
  16396. if (!isArray(original)) {
  16397. return null;
  16398. }
  16399. var merged = [];
  16400. for (i = 0; i < original.length; i++) {
  16401. current = original[i];
  16402. if (isArray(current)) {
  16403. merged.push.apply(merged, current);
  16404. } else {
  16405. merged.push(current);
  16406. }
  16407. }
  16408. return merged;
  16409. case "Identity":
  16410. return value;
  16411. case "MultiSelectList":
  16412. if (value === null) {
  16413. return null;
  16414. }
  16415. collected = [];
  16416. for (i = 0; i < node.children.length; i++) {
  16417. collected.push(this.visit(node.children[i], value));
  16418. }
  16419. return collected;
  16420. case "MultiSelectHash":
  16421. if (value === null) {
  16422. return null;
  16423. }
  16424. collected = {};
  16425. var child;
  16426. for (i = 0; i < node.children.length; i++) {
  16427. child = node.children[i];
  16428. collected[child.name] = this.visit(child.value, value);
  16429. }
  16430. return collected;
  16431. case "OrExpression":
  16432. matched = this.visit(node.children[0], value);
  16433. if (isFalse(matched)) {
  16434. matched = this.visit(node.children[1], value);
  16435. }
  16436. return matched;
  16437. case "AndExpression":
  16438. first = this.visit(node.children[0], value);
  16439. if (isFalse(first) === true) {
  16440. return first;
  16441. }
  16442. return this.visit(node.children[1], value);
  16443. case "NotExpression":
  16444. first = this.visit(node.children[0], value);
  16445. return isFalse(first);
  16446. case "Literal":
  16447. return node.value;
  16448. case TOK_PIPE:
  16449. left = this.visit(node.children[0], value);
  16450. return this.visit(node.children[1], left);
  16451. case TOK_CURRENT:
  16452. return value;
  16453. case "Function":
  16454. var resolvedArgs = [];
  16455. for (i = 0; i < node.children.length; i++) {
  16456. resolvedArgs.push(this.visit(node.children[i], value));
  16457. }
  16458. return this.runtime.callFunction(node.name, resolvedArgs);
  16459. case "ExpressionReference":
  16460. var refNode = node.children[0];
  16461. // Tag the node with a specific attribute so the type
  16462. // checker verify the type.
  16463. refNode.jmespathType = TOK_EXPREF;
  16464. return refNode;
  16465. default:
  16466. throw new Error("Unknown node type: " + node.type);
  16467. }
  16468. },
  16469. computeSliceParams: function(arrayLength, sliceParams) {
  16470. var start = sliceParams[0];
  16471. var stop = sliceParams[1];
  16472. var step = sliceParams[2];
  16473. var computed = [null, null, null];
  16474. if (step === null) {
  16475. step = 1;
  16476. } else if (step === 0) {
  16477. var error = new Error("Invalid slice, step cannot be 0");
  16478. error.name = "RuntimeError";
  16479. throw error;
  16480. }
  16481. var stepValueNegative = step < 0 ? true : false;
  16482. if (start === null) {
  16483. start = stepValueNegative ? arrayLength - 1 : 0;
  16484. } else {
  16485. start = this.capSliceRange(arrayLength, start, step);
  16486. }
  16487. if (stop === null) {
  16488. stop = stepValueNegative ? -1 : arrayLength;
  16489. } else {
  16490. stop = this.capSliceRange(arrayLength, stop, step);
  16491. }
  16492. computed[0] = start;
  16493. computed[1] = stop;
  16494. computed[2] = step;
  16495. return computed;
  16496. },
  16497. capSliceRange: function(arrayLength, actualValue, step) {
  16498. if (actualValue < 0) {
  16499. actualValue += arrayLength;
  16500. if (actualValue < 0) {
  16501. actualValue = step < 0 ? -1 : 0;
  16502. }
  16503. } else if (actualValue >= arrayLength) {
  16504. actualValue = step < 0 ? arrayLength - 1 : arrayLength;
  16505. }
  16506. return actualValue;
  16507. }
  16508. };
  16509. function Runtime(interpreter) {
  16510. this._interpreter = interpreter;
  16511. this.functionTable = {
  16512. // name: [function, <signature>]
  16513. // The <signature> can be:
  16514. //
  16515. // {
  16516. // args: [[type1, type2], [type1, type2]],
  16517. // variadic: true|false
  16518. // }
  16519. //
  16520. // Each arg in the arg list is a list of valid types
  16521. // (if the function is overloaded and supports multiple
  16522. // types. If the type is "any" then no type checking
  16523. // occurs on the argument. Variadic is optional
  16524. // and if not provided is assumed to be false.
  16525. abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]},
  16526. avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]},
  16527. ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]},
  16528. contains: {
  16529. _func: this._functionContains,
  16530. _signature: [{types: [TYPE_STRING, TYPE_ARRAY]},
  16531. {types: [TYPE_ANY]}]},
  16532. "ends_with": {
  16533. _func: this._functionEndsWith,
  16534. _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]},
  16535. floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]},
  16536. length: {
  16537. _func: this._functionLength,
  16538. _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]},
  16539. map: {
  16540. _func: this._functionMap,
  16541. _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]},
  16542. max: {
  16543. _func: this._functionMax,
  16544. _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]},
  16545. "merge": {
  16546. _func: this._functionMerge,
  16547. _signature: [{types: [TYPE_OBJECT], variadic: true}]
  16548. },
  16549. "max_by": {
  16550. _func: this._functionMaxBy,
  16551. _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]
  16552. },
  16553. sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]},
  16554. "starts_with": {
  16555. _func: this._functionStartsWith,
  16556. _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]},
  16557. min: {
  16558. _func: this._functionMin,
  16559. _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]},
  16560. "min_by": {
  16561. _func: this._functionMinBy,
  16562. _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]
  16563. },
  16564. type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]},
  16565. keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]},
  16566. values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]},
  16567. sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]},
  16568. "sort_by": {
  16569. _func: this._functionSortBy,
  16570. _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]
  16571. },
  16572. join: {
  16573. _func: this._functionJoin,
  16574. _signature: [
  16575. {types: [TYPE_STRING]},
  16576. {types: [TYPE_ARRAY_STRING]}
  16577. ]
  16578. },
  16579. reverse: {
  16580. _func: this._functionReverse,
  16581. _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]},
  16582. "to_array": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]},
  16583. "to_string": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]},
  16584. "to_number": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]},
  16585. "not_null": {
  16586. _func: this._functionNotNull,
  16587. _signature: [{types: [TYPE_ANY], variadic: true}]
  16588. }
  16589. };
  16590. }
  16591. Runtime.prototype = {
  16592. callFunction: function(name, resolvedArgs) {
  16593. var functionEntry = this.functionTable[name];
  16594. if (functionEntry === undefined) {
  16595. throw new Error("Unknown function: " + name + "()");
  16596. }
  16597. this._validateArgs(name, resolvedArgs, functionEntry._signature);
  16598. return functionEntry._func.call(this, resolvedArgs);
  16599. },
  16600. _validateArgs: function(name, args, signature) {
  16601. // Validating the args requires validating
  16602. // the correct arity and the correct type of each arg.
  16603. // If the last argument is declared as variadic, then we need
  16604. // a minimum number of args to be required. Otherwise it has to
  16605. // be an exact amount.
  16606. var pluralized;
  16607. if (signature[signature.length - 1].variadic) {
  16608. if (args.length < signature.length) {
  16609. pluralized = signature.length === 1 ? " argument" : " arguments";
  16610. throw new Error("ArgumentError: " + name + "() " +
  16611. "takes at least" + signature.length + pluralized +
  16612. " but received " + args.length);
  16613. }
  16614. } else if (args.length !== signature.length) {
  16615. pluralized = signature.length === 1 ? " argument" : " arguments";
  16616. throw new Error("ArgumentError: " + name + "() " +
  16617. "takes " + signature.length + pluralized +
  16618. " but received " + args.length);
  16619. }
  16620. var currentSpec;
  16621. var actualType;
  16622. var typeMatched;
  16623. for (var i = 0; i < signature.length; i++) {
  16624. typeMatched = false;
  16625. currentSpec = signature[i].types;
  16626. actualType = this._getTypeName(args[i]);
  16627. for (var j = 0; j < currentSpec.length; j++) {
  16628. if (this._typeMatches(actualType, currentSpec[j], args[i])) {
  16629. typeMatched = true;
  16630. break;
  16631. }
  16632. }
  16633. if (!typeMatched) {
  16634. throw new Error("TypeError: " + name + "() " +
  16635. "expected argument " + (i + 1) +
  16636. " to be type " + currentSpec +
  16637. " but received type " + actualType +
  16638. " instead.");
  16639. }
  16640. }
  16641. },
  16642. _typeMatches: function(actual, expected, argValue) {
  16643. if (expected === TYPE_ANY) {
  16644. return true;
  16645. }
  16646. if (expected === TYPE_ARRAY_STRING ||
  16647. expected === TYPE_ARRAY_NUMBER ||
  16648. expected === TYPE_ARRAY) {
  16649. // The expected type can either just be array,
  16650. // or it can require a specific subtype (array of numbers).
  16651. //
  16652. // The simplest case is if "array" with no subtype is specified.
  16653. if (expected === TYPE_ARRAY) {
  16654. return actual === TYPE_ARRAY;
  16655. } else if (actual === TYPE_ARRAY) {
  16656. // Otherwise we need to check subtypes.
  16657. // I think this has potential to be improved.
  16658. var subtype;
  16659. if (expected === TYPE_ARRAY_NUMBER) {
  16660. subtype = TYPE_NUMBER;
  16661. } else if (expected === TYPE_ARRAY_STRING) {
  16662. subtype = TYPE_STRING;
  16663. }
  16664. for (var i = 0; i < argValue.length; i++) {
  16665. if (!this._typeMatches(
  16666. this._getTypeName(argValue[i]), subtype,
  16667. argValue[i])) {
  16668. return false;
  16669. }
  16670. }
  16671. return true;
  16672. }
  16673. } else {
  16674. return actual === expected;
  16675. }
  16676. },
  16677. _getTypeName: function(obj) {
  16678. switch (Object.prototype.toString.call(obj)) {
  16679. case "[object String]":
  16680. return TYPE_STRING;
  16681. case "[object Number]":
  16682. return TYPE_NUMBER;
  16683. case "[object Array]":
  16684. return TYPE_ARRAY;
  16685. case "[object Boolean]":
  16686. return TYPE_BOOLEAN;
  16687. case "[object Null]":
  16688. return TYPE_NULL;
  16689. case "[object Object]":
  16690. // Check if it's an expref. If it has, it's been
  16691. // tagged with a jmespathType attr of 'Expref';
  16692. if (obj.jmespathType === TOK_EXPREF) {
  16693. return TYPE_EXPREF;
  16694. } else {
  16695. return TYPE_OBJECT;
  16696. }
  16697. }
  16698. },
  16699. _functionStartsWith: function(resolvedArgs) {
  16700. return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0;
  16701. },
  16702. _functionEndsWith: function(resolvedArgs) {
  16703. var searchStr = resolvedArgs[0];
  16704. var suffix = resolvedArgs[1];
  16705. return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1;
  16706. },
  16707. _functionReverse: function(resolvedArgs) {
  16708. var typeName = this._getTypeName(resolvedArgs[0]);
  16709. if (typeName === TYPE_STRING) {
  16710. var originalStr = resolvedArgs[0];
  16711. var reversedStr = "";
  16712. for (var i = originalStr.length - 1; i >= 0; i--) {
  16713. reversedStr += originalStr[i];
  16714. }
  16715. return reversedStr;
  16716. } else {
  16717. var reversedArray = resolvedArgs[0].slice(0);
  16718. reversedArray.reverse();
  16719. return reversedArray;
  16720. }
  16721. },
  16722. _functionAbs: function(resolvedArgs) {
  16723. return Math.abs(resolvedArgs[0]);
  16724. },
  16725. _functionCeil: function(resolvedArgs) {
  16726. return Math.ceil(resolvedArgs[0]);
  16727. },
  16728. _functionAvg: function(resolvedArgs) {
  16729. var sum = 0;
  16730. var inputArray = resolvedArgs[0];
  16731. for (var i = 0; i < inputArray.length; i++) {
  16732. sum += inputArray[i];
  16733. }
  16734. return sum / inputArray.length;
  16735. },
  16736. _functionContains: function(resolvedArgs) {
  16737. return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0;
  16738. },
  16739. _functionFloor: function(resolvedArgs) {
  16740. return Math.floor(resolvedArgs[0]);
  16741. },
  16742. _functionLength: function(resolvedArgs) {
  16743. if (!isObject(resolvedArgs[0])) {
  16744. return resolvedArgs[0].length;
  16745. } else {
  16746. // As far as I can tell, there's no way to get the length
  16747. // of an object without O(n) iteration through the object.
  16748. return Object.keys(resolvedArgs[0]).length;
  16749. }
  16750. },
  16751. _functionMap: function(resolvedArgs) {
  16752. var mapped = [];
  16753. var interpreter = this._interpreter;
  16754. var exprefNode = resolvedArgs[0];
  16755. var elements = resolvedArgs[1];
  16756. for (var i = 0; i < elements.length; i++) {
  16757. mapped.push(interpreter.visit(exprefNode, elements[i]));
  16758. }
  16759. return mapped;
  16760. },
  16761. _functionMerge: function(resolvedArgs) {
  16762. var merged = {};
  16763. for (var i = 0; i < resolvedArgs.length; i++) {
  16764. var current = resolvedArgs[i];
  16765. for (var key in current) {
  16766. merged[key] = current[key];
  16767. }
  16768. }
  16769. return merged;
  16770. },
  16771. _functionMax: function(resolvedArgs) {
  16772. if (resolvedArgs[0].length > 0) {
  16773. var typeName = this._getTypeName(resolvedArgs[0][0]);
  16774. if (typeName === TYPE_NUMBER) {
  16775. return Math.max.apply(Math, resolvedArgs[0]);
  16776. } else {
  16777. var elements = resolvedArgs[0];
  16778. var maxElement = elements[0];
  16779. for (var i = 1; i < elements.length; i++) {
  16780. if (maxElement.localeCompare(elements[i]) < 0) {
  16781. maxElement = elements[i];
  16782. }
  16783. }
  16784. return maxElement;
  16785. }
  16786. } else {
  16787. return null;
  16788. }
  16789. },
  16790. _functionMin: function(resolvedArgs) {
  16791. if (resolvedArgs[0].length > 0) {
  16792. var typeName = this._getTypeName(resolvedArgs[0][0]);
  16793. if (typeName === TYPE_NUMBER) {
  16794. return Math.min.apply(Math, resolvedArgs[0]);
  16795. } else {
  16796. var elements = resolvedArgs[0];
  16797. var minElement = elements[0];
  16798. for (var i = 1; i < elements.length; i++) {
  16799. if (elements[i].localeCompare(minElement) < 0) {
  16800. minElement = elements[i];
  16801. }
  16802. }
  16803. return minElement;
  16804. }
  16805. } else {
  16806. return null;
  16807. }
  16808. },
  16809. _functionSum: function(resolvedArgs) {
  16810. var sum = 0;
  16811. var listToSum = resolvedArgs[0];
  16812. for (var i = 0; i < listToSum.length; i++) {
  16813. sum += listToSum[i];
  16814. }
  16815. return sum;
  16816. },
  16817. _functionType: function(resolvedArgs) {
  16818. switch (this._getTypeName(resolvedArgs[0])) {
  16819. case TYPE_NUMBER:
  16820. return "number";
  16821. case TYPE_STRING:
  16822. return "string";
  16823. case TYPE_ARRAY:
  16824. return "array";
  16825. case TYPE_OBJECT:
  16826. return "object";
  16827. case TYPE_BOOLEAN:
  16828. return "boolean";
  16829. case TYPE_EXPREF:
  16830. return "expref";
  16831. case TYPE_NULL:
  16832. return "null";
  16833. }
  16834. },
  16835. _functionKeys: function(resolvedArgs) {
  16836. return Object.keys(resolvedArgs[0]);
  16837. },
  16838. _functionValues: function(resolvedArgs) {
  16839. var obj = resolvedArgs[0];
  16840. var keys = Object.keys(obj);
  16841. var values = [];
  16842. for (var i = 0; i < keys.length; i++) {
  16843. values.push(obj[keys[i]]);
  16844. }
  16845. return values;
  16846. },
  16847. _functionJoin: function(resolvedArgs) {
  16848. var joinChar = resolvedArgs[0];
  16849. var listJoin = resolvedArgs[1];
  16850. return listJoin.join(joinChar);
  16851. },
  16852. _functionToArray: function(resolvedArgs) {
  16853. if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) {
  16854. return resolvedArgs[0];
  16855. } else {
  16856. return [resolvedArgs[0]];
  16857. }
  16858. },
  16859. _functionToString: function(resolvedArgs) {
  16860. if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) {
  16861. return resolvedArgs[0];
  16862. } else {
  16863. return JSON.stringify(resolvedArgs[0]);
  16864. }
  16865. },
  16866. _functionToNumber: function(resolvedArgs) {
  16867. var typeName = this._getTypeName(resolvedArgs[0]);
  16868. var convertedValue;
  16869. if (typeName === TYPE_NUMBER) {
  16870. return resolvedArgs[0];
  16871. } else if (typeName === TYPE_STRING) {
  16872. convertedValue = +resolvedArgs[0];
  16873. if (!isNaN(convertedValue)) {
  16874. return convertedValue;
  16875. }
  16876. }
  16877. return null;
  16878. },
  16879. _functionNotNull: function(resolvedArgs) {
  16880. for (var i = 0; i < resolvedArgs.length; i++) {
  16881. if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) {
  16882. return resolvedArgs[i];
  16883. }
  16884. }
  16885. return null;
  16886. },
  16887. _functionSort: function(resolvedArgs) {
  16888. var sortedArray = resolvedArgs[0].slice(0);
  16889. sortedArray.sort();
  16890. return sortedArray;
  16891. },
  16892. _functionSortBy: function(resolvedArgs) {
  16893. var sortedArray = resolvedArgs[0].slice(0);
  16894. if (sortedArray.length === 0) {
  16895. return sortedArray;
  16896. }
  16897. var interpreter = this._interpreter;
  16898. var exprefNode = resolvedArgs[1];
  16899. var requiredType = this._getTypeName(
  16900. interpreter.visit(exprefNode, sortedArray[0]));
  16901. if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) {
  16902. throw new Error("TypeError");
  16903. }
  16904. var that = this;
  16905. // In order to get a stable sort out of an unstable
  16906. // sort algorithm, we decorate/sort/undecorate (DSU)
  16907. // by creating a new list of [index, element] pairs.
  16908. // In the cmp function, if the evaluated elements are
  16909. // equal, then the index will be used as the tiebreaker.
  16910. // After the decorated list has been sorted, it will be
  16911. // undecorated to extract the original elements.
  16912. var decorated = [];
  16913. for (var i = 0; i < sortedArray.length; i++) {
  16914. decorated.push([i, sortedArray[i]]);
  16915. }
  16916. decorated.sort(function(a, b) {
  16917. var exprA = interpreter.visit(exprefNode, a[1]);
  16918. var exprB = interpreter.visit(exprefNode, b[1]);
  16919. if (that._getTypeName(exprA) !== requiredType) {
  16920. throw new Error(
  16921. "TypeError: expected " + requiredType + ", received " +
  16922. that._getTypeName(exprA));
  16923. } else if (that._getTypeName(exprB) !== requiredType) {
  16924. throw new Error(
  16925. "TypeError: expected " + requiredType + ", received " +
  16926. that._getTypeName(exprB));
  16927. }
  16928. if (exprA > exprB) {
  16929. return 1;
  16930. } else if (exprA < exprB) {
  16931. return -1;
  16932. } else {
  16933. // If they're equal compare the items by their
  16934. // order to maintain relative order of equal keys
  16935. // (i.e. to get a stable sort).
  16936. return a[0] - b[0];
  16937. }
  16938. });
  16939. // Undecorate: extract out the original list elements.
  16940. for (var j = 0; j < decorated.length; j++) {
  16941. sortedArray[j] = decorated[j][1];
  16942. }
  16943. return sortedArray;
  16944. },
  16945. _functionMaxBy: function(resolvedArgs) {
  16946. var exprefNode = resolvedArgs[1];
  16947. var resolvedArray = resolvedArgs[0];
  16948. var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);
  16949. var maxNumber = -Infinity;
  16950. var maxRecord;
  16951. var current;
  16952. for (var i = 0; i < resolvedArray.length; i++) {
  16953. current = keyFunction(resolvedArray[i]);
  16954. if (current > maxNumber) {
  16955. maxNumber = current;
  16956. maxRecord = resolvedArray[i];
  16957. }
  16958. }
  16959. return maxRecord;
  16960. },
  16961. _functionMinBy: function(resolvedArgs) {
  16962. var exprefNode = resolvedArgs[1];
  16963. var resolvedArray = resolvedArgs[0];
  16964. var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);
  16965. var minNumber = Infinity;
  16966. var minRecord;
  16967. var current;
  16968. for (var i = 0; i < resolvedArray.length; i++) {
  16969. current = keyFunction(resolvedArray[i]);
  16970. if (current < minNumber) {
  16971. minNumber = current;
  16972. minRecord = resolvedArray[i];
  16973. }
  16974. }
  16975. return minRecord;
  16976. },
  16977. createKeyFunction: function(exprefNode, allowedTypes) {
  16978. var that = this;
  16979. var interpreter = this._interpreter;
  16980. var keyFunc = function(x) {
  16981. var current = interpreter.visit(exprefNode, x);
  16982. if (allowedTypes.indexOf(that._getTypeName(current)) < 0) {
  16983. var msg = "TypeError: expected one of " + allowedTypes +
  16984. ", received " + that._getTypeName(current);
  16985. throw new Error(msg);
  16986. }
  16987. return current;
  16988. };
  16989. return keyFunc;
  16990. }
  16991. };
  16992. function compile(stream) {
  16993. var parser = new Parser();
  16994. var ast = parser.parse(stream);
  16995. return ast;
  16996. }
  16997. function tokenize(stream) {
  16998. var lexer = new Lexer();
  16999. return lexer.tokenize(stream);
  17000. }
  17001. function search(data, expression) {
  17002. var parser = new Parser();
  17003. // This needs to be improved. Both the interpreter and runtime depend on
  17004. // each other. The runtime needs the interpreter to support exprefs.
  17005. // There's likely a clean way to avoid the cyclic dependency.
  17006. var runtime = new Runtime();
  17007. var interpreter = new TreeInterpreter(runtime);
  17008. runtime._interpreter = interpreter;
  17009. var node = parser.parse(expression);
  17010. return interpreter.search(node, data);
  17011. }
  17012. exports.tokenize = tokenize;
  17013. exports.compile = compile;
  17014. exports.search = search;
  17015. exports.strictDeepEqual = strictDeepEqual;
  17016. })( false ? undefined : exports);
  17017. /***/ }),
  17018. /***/ 806:
  17019. /***/ (function(module, __unusedexports, __webpack_require__) {
  17020. var util = __webpack_require__(153);
  17021. function JsonParser() { }
  17022. JsonParser.prototype.parse = function(value, shape) {
  17023. return translate(JSON.parse(value), shape);
  17024. };
  17025. function translate(value, shape) {
  17026. if (!shape || value === undefined) return undefined;
  17027. switch (shape.type) {
  17028. case 'structure': return translateStructure(value, shape);
  17029. case 'map': return translateMap(value, shape);
  17030. case 'list': return translateList(value, shape);
  17031. default: return translateScalar(value, shape);
  17032. }
  17033. }
  17034. function translateStructure(structure, shape) {
  17035. if (structure == null) return undefined;
  17036. var struct = {};
  17037. var shapeMembers = shape.members;
  17038. util.each(shapeMembers, function(name, memberShape) {
  17039. var locationName = memberShape.isLocationName ? memberShape.name : name;
  17040. if (Object.prototype.hasOwnProperty.call(structure, locationName)) {
  17041. var value = structure[locationName];
  17042. var result = translate(value, memberShape);
  17043. if (result !== undefined) struct[name] = result;
  17044. }
  17045. });
  17046. return struct;
  17047. }
  17048. function translateList(list, shape) {
  17049. if (list == null) return undefined;
  17050. var out = [];
  17051. util.arrayEach(list, function(value) {
  17052. var result = translate(value, shape.member);
  17053. if (result === undefined) out.push(null);
  17054. else out.push(result);
  17055. });
  17056. return out;
  17057. }
  17058. function translateMap(map, shape) {
  17059. if (map == null) return undefined;
  17060. var out = {};
  17061. util.each(map, function(key, value) {
  17062. var result = translate(value, shape.value);
  17063. if (result === undefined) out[key] = null;
  17064. else out[key] = result;
  17065. });
  17066. return out;
  17067. }
  17068. function translateScalar(value, shape) {
  17069. return shape.toType(value);
  17070. }
  17071. /**
  17072. * @api private
  17073. */
  17074. module.exports = JsonParser;
  17075. /***/ }),
  17076. /***/ 810:
  17077. /***/ (function(module, __unusedexports, __webpack_require__) {
  17078. var AWS = __webpack_require__(395);
  17079. var util = AWS.util;
  17080. var Shape = AWS.Model.Shape;
  17081. var xml2js = __webpack_require__(992);
  17082. /**
  17083. * @api private
  17084. */
  17085. var options = { // options passed to xml2js parser
  17086. explicitCharkey: false, // undocumented
  17087. trim: false, // trim the leading/trailing whitespace from text nodes
  17088. normalize: false, // trim interior whitespace inside text nodes
  17089. explicitRoot: false, // return the root node in the resulting object?
  17090. emptyTag: null, // the default value for empty nodes
  17091. explicitArray: true, // always put child nodes in an array
  17092. ignoreAttrs: false, // ignore attributes, only create text nodes
  17093. mergeAttrs: false, // merge attributes and child elements
  17094. validator: null // a callable validator
  17095. };
  17096. function NodeXmlParser() { }
  17097. NodeXmlParser.prototype.parse = function(xml, shape) {
  17098. shape = shape || {};
  17099. var result = null;
  17100. var error = null;
  17101. var parser = new xml2js.Parser(options);
  17102. parser.parseString(xml, function (e, r) {
  17103. error = e;
  17104. result = r;
  17105. });
  17106. if (result) {
  17107. var data = parseXml(result, shape);
  17108. if (result.ResponseMetadata) {
  17109. data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {});
  17110. }
  17111. return data;
  17112. } else if (error) {
  17113. throw util.error(error, {code: 'XMLParserError', retryable: true});
  17114. } else { // empty xml document
  17115. return parseXml({}, shape);
  17116. }
  17117. };
  17118. function parseXml(xml, shape) {
  17119. switch (shape.type) {
  17120. case 'structure': return parseStructure(xml, shape);
  17121. case 'map': return parseMap(xml, shape);
  17122. case 'list': return parseList(xml, shape);
  17123. case undefined: case null: return parseUnknown(xml);
  17124. default: return parseScalar(xml, shape);
  17125. }
  17126. }
  17127. function parseStructure(xml, shape) {
  17128. var data = {};
  17129. if (xml === null) return data;
  17130. util.each(shape.members, function(memberName, memberShape) {
  17131. var xmlName = memberShape.name;
  17132. if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) {
  17133. var xmlChild = xml[xmlName];
  17134. if (!memberShape.flattened) xmlChild = xmlChild[0];
  17135. data[memberName] = parseXml(xmlChild, memberShape);
  17136. } else if (memberShape.isXmlAttribute &&
  17137. xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) {
  17138. data[memberName] = parseScalar(xml.$[xmlName], memberShape);
  17139. } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) {
  17140. data[memberName] = memberShape.defaultValue;
  17141. }
  17142. });
  17143. return data;
  17144. }
  17145. function parseMap(xml, shape) {
  17146. var data = {};
  17147. if (xml === null) return data;
  17148. var xmlKey = shape.key.name || 'key';
  17149. var xmlValue = shape.value.name || 'value';
  17150. var iterable = shape.flattened ? xml : xml.entry;
  17151. if (Array.isArray(iterable)) {
  17152. util.arrayEach(iterable, function(child) {
  17153. data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value);
  17154. });
  17155. }
  17156. return data;
  17157. }
  17158. function parseList(xml, shape) {
  17159. var data = [];
  17160. var name = shape.member.name || 'member';
  17161. if (shape.flattened) {
  17162. util.arrayEach(xml, function(xmlChild) {
  17163. data.push(parseXml(xmlChild, shape.member));
  17164. });
  17165. } else if (xml && Array.isArray(xml[name])) {
  17166. util.arrayEach(xml[name], function(child) {
  17167. data.push(parseXml(child, shape.member));
  17168. });
  17169. }
  17170. return data;
  17171. }
  17172. function parseScalar(text, shape) {
  17173. if (text && text.$ && text.$.encoding === 'base64') {
  17174. shape = new Shape.create({type: text.$.encoding});
  17175. }
  17176. if (text && text._) text = text._;
  17177. if (typeof shape.toType === 'function') {
  17178. return shape.toType(text);
  17179. } else {
  17180. return text;
  17181. }
  17182. }
  17183. function parseUnknown(xml) {
  17184. if (xml === undefined || xml === null) return '';
  17185. if (typeof xml === 'string') return xml;
  17186. // parse a list
  17187. if (Array.isArray(xml)) {
  17188. var arr = [];
  17189. for (i = 0; i < xml.length; i++) {
  17190. arr.push(parseXml(xml[i], {}));
  17191. }
  17192. return arr;
  17193. }
  17194. // empty object
  17195. var keys = Object.keys(xml), i;
  17196. if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) {
  17197. return {};
  17198. }
  17199. // object, parse as structure
  17200. var data = {};
  17201. for (i = 0; i < keys.length; i++) {
  17202. var key = keys[i], value = xml[key];
  17203. if (key === '$') continue;
  17204. if (value.length > 1) { // this member is a list
  17205. data[key] = parseList(value, {member: {}});
  17206. } else { // this member is a single item
  17207. data[key] = parseXml(value[0], {});
  17208. }
  17209. }
  17210. return data;
  17211. }
  17212. /**
  17213. * @api private
  17214. */
  17215. module.exports = NodeXmlParser;
  17216. /***/ }),
  17217. /***/ 818:
  17218. /***/ (function(module, __unusedexports, __webpack_require__) {
  17219. var AWS = __webpack_require__(395);
  17220. var os = __webpack_require__(87);
  17221. var path = __webpack_require__(622);
  17222. function parseFile(filename, isConfig) {
  17223. var content = AWS.util.ini.parse(AWS.util.readFileSync(filename));
  17224. var tmpContent = {};
  17225. Object.keys(content).forEach(function(profileName) {
  17226. var profileContent = content[profileName];
  17227. profileName = isConfig ? profileName.replace(/^profile\s/, '') : profileName;
  17228. Object.defineProperty(tmpContent, profileName, {
  17229. value: profileContent,
  17230. enumerable: true
  17231. });
  17232. });
  17233. return tmpContent;
  17234. }
  17235. /**
  17236. * Ini file loader class the same as that used in the SDK. It loads and
  17237. * parses config and credentials files in .ini format and cache the content
  17238. * to assure files are only read once.
  17239. * Note that calling operations on the instance instantiated from this class
  17240. * won't affect the behavior of SDK since SDK uses an internal singleton of
  17241. * this class.
  17242. * @!macro nobrowser
  17243. */
  17244. AWS.IniLoader = AWS.util.inherit({
  17245. constructor: function IniLoader() {
  17246. this.resolvedProfiles = {};
  17247. },
  17248. /** Remove all cached files. Used after config files are updated. */
  17249. clearCachedFiles: function clearCachedFiles() {
  17250. this.resolvedProfiles = {};
  17251. },
  17252. /**
  17253. * Load configurations from config/credentials files and cache them
  17254. * for later use. If no file is specified it will try to load default
  17255. * files.
  17256. * @param options [map] information describing the file
  17257. * @option options filename [String] ('~/.aws/credentials' or defined by
  17258. * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if
  17259. * isConfig is set to true)
  17260. * path to the file to be read.
  17261. * @option options isConfig [Boolean] (false) True to read config file.
  17262. * @return [map<String,String>] object containing contents from file in key-value
  17263. * pairs.
  17264. */
  17265. loadFrom: function loadFrom(options) {
  17266. options = options || {};
  17267. var isConfig = options.isConfig === true;
  17268. var filename = options.filename || this.getDefaultFilePath(isConfig);
  17269. if (!this.resolvedProfiles[filename]) {
  17270. var fileContent = this.parseFile(filename, isConfig);
  17271. Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent });
  17272. }
  17273. return this.resolvedProfiles[filename];
  17274. },
  17275. /**
  17276. * @api private
  17277. */
  17278. parseFile: parseFile,
  17279. /**
  17280. * @api private
  17281. */
  17282. getDefaultFilePath: function getDefaultFilePath(isConfig) {
  17283. return path.join(
  17284. this.getHomeDir(),
  17285. '.aws',
  17286. isConfig ? 'config' : 'credentials'
  17287. );
  17288. },
  17289. /**
  17290. * @api private
  17291. */
  17292. getHomeDir: function getHomeDir() {
  17293. var env = process.env;
  17294. var home = env.HOME ||
  17295. env.USERPROFILE ||
  17296. (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null);
  17297. if (home) {
  17298. return home;
  17299. }
  17300. if (typeof os.homedir === 'function') {
  17301. return os.homedir();
  17302. }
  17303. throw AWS.util.error(
  17304. new Error('Cannot load credentials, HOME path not set')
  17305. );
  17306. }
  17307. });
  17308. var IniLoader = AWS.IniLoader;
  17309. module.exports = {
  17310. IniLoader: IniLoader,
  17311. parseFile: parseFile,
  17312. };
  17313. /***/ }),
  17314. /***/ 819:
  17315. /***/ (function(module, __unusedexports, __webpack_require__) {
  17316. var AWS = __webpack_require__(395);
  17317. /**
  17318. * @api private
  17319. */
  17320. var cachedSecret = {};
  17321. /**
  17322. * @api private
  17323. */
  17324. var cacheQueue = [];
  17325. /**
  17326. * @api private
  17327. */
  17328. var maxCacheEntries = 50;
  17329. /**
  17330. * @api private
  17331. */
  17332. var v4Identifier = 'aws4_request';
  17333. /**
  17334. * @api private
  17335. */
  17336. module.exports = {
  17337. /**
  17338. * @api private
  17339. *
  17340. * @param date [String]
  17341. * @param region [String]
  17342. * @param serviceName [String]
  17343. * @return [String]
  17344. */
  17345. createScope: function createScope(date, region, serviceName) {
  17346. return [
  17347. date.substr(0, 8),
  17348. region,
  17349. serviceName,
  17350. v4Identifier
  17351. ].join('/');
  17352. },
  17353. /**
  17354. * @api private
  17355. *
  17356. * @param credentials [Credentials]
  17357. * @param date [String]
  17358. * @param region [String]
  17359. * @param service [String]
  17360. * @param shouldCache [Boolean]
  17361. * @return [String]
  17362. */
  17363. getSigningKey: function getSigningKey(
  17364. credentials,
  17365. date,
  17366. region,
  17367. service,
  17368. shouldCache
  17369. ) {
  17370. var credsIdentifier = AWS.util.crypto
  17371. .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64');
  17372. var cacheKey = [credsIdentifier, date, region, service].join('_');
  17373. shouldCache = shouldCache !== false;
  17374. if (shouldCache && (cacheKey in cachedSecret)) {
  17375. return cachedSecret[cacheKey];
  17376. }
  17377. var kDate = AWS.util.crypto.hmac(
  17378. 'AWS4' + credentials.secretAccessKey,
  17379. date,
  17380. 'buffer'
  17381. );
  17382. var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer');
  17383. var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer');
  17384. var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer');
  17385. if (shouldCache) {
  17386. cachedSecret[cacheKey] = signingKey;
  17387. cacheQueue.push(cacheKey);
  17388. if (cacheQueue.length > maxCacheEntries) {
  17389. // remove the oldest entry (not the least recently used)
  17390. delete cachedSecret[cacheQueue.shift()];
  17391. }
  17392. }
  17393. return signingKey;
  17394. },
  17395. /**
  17396. * @api private
  17397. *
  17398. * Empties the derived signing key cache. Made available for testing purposes
  17399. * only.
  17400. */
  17401. emptyCache: function emptyCache() {
  17402. cachedSecret = {};
  17403. cacheQueue = [];
  17404. }
  17405. };
  17406. /***/ }),
  17407. /***/ 826:
  17408. /***/ (function(module, __unusedexports, __webpack_require__) {
  17409. var rng = __webpack_require__(139);
  17410. var bytesToUuid = __webpack_require__(722);
  17411. function v4(options, buf, offset) {
  17412. var i = buf && offset || 0;
  17413. if (typeof(options) == 'string') {
  17414. buf = options === 'binary' ? new Array(16) : null;
  17415. options = null;
  17416. }
  17417. options = options || {};
  17418. var rnds = options.random || (options.rng || rng)();
  17419. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  17420. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  17421. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  17422. // Copy bytes to buffer, if provided
  17423. if (buf) {
  17424. for (var ii = 0; ii < 16; ++ii) {
  17425. buf[i + ii] = rnds[ii];
  17426. }
  17427. }
  17428. return buf || bytesToUuid(rnds);
  17429. }
  17430. module.exports = v4;
  17431. /***/ }),
  17432. /***/ 828:
  17433. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  17434. var AWS = __webpack_require__(395);
  17435. var inherit = AWS.util.inherit;
  17436. var jmespath = __webpack_require__(802);
  17437. /**
  17438. * This class encapsulates the response information
  17439. * from a service request operation sent through {AWS.Request}.
  17440. * The response object has two main properties for getting information
  17441. * back from a request:
  17442. *
  17443. * ## The `data` property
  17444. *
  17445. * The `response.data` property contains the serialized object data
  17446. * retrieved from the service request. For instance, for an
  17447. * Amazon DynamoDB `listTables` method call, the response data might
  17448. * look like:
  17449. *
  17450. * ```
  17451. * > resp.data
  17452. * { TableNames:
  17453. * [ 'table1', 'table2', ... ] }
  17454. * ```
  17455. *
  17456. * The `data` property can be null if an error occurs (see below).
  17457. *
  17458. * ## The `error` property
  17459. *
  17460. * In the event of a service error (or transfer error), the
  17461. * `response.error` property will be filled with the given
  17462. * error data in the form:
  17463. *
  17464. * ```
  17465. * { code: 'SHORT_UNIQUE_ERROR_CODE',
  17466. * message: 'Some human readable error message' }
  17467. * ```
  17468. *
  17469. * In the case of an error, the `data` property will be `null`.
  17470. * Note that if you handle events that can be in a failure state,
  17471. * you should always check whether `response.error` is set
  17472. * before attempting to access the `response.data` property.
  17473. *
  17474. * @!attribute data
  17475. * @readonly
  17476. * @!group Data Properties
  17477. * @note Inside of a {AWS.Request~httpData} event, this
  17478. * property contains a single raw packet instead of the
  17479. * full de-serialized service response.
  17480. * @return [Object] the de-serialized response data
  17481. * from the service.
  17482. *
  17483. * @!attribute error
  17484. * An structure containing information about a service
  17485. * or networking error.
  17486. * @readonly
  17487. * @!group Data Properties
  17488. * @note This attribute is only filled if a service or
  17489. * networking error occurs.
  17490. * @return [Error]
  17491. * * code [String] a unique short code representing the
  17492. * error that was emitted.
  17493. * * message [String] a longer human readable error message
  17494. * * retryable [Boolean] whether the error message is
  17495. * retryable.
  17496. * * statusCode [Numeric] in the case of a request that reached the service,
  17497. * this value contains the response status code.
  17498. * * time [Date] the date time object when the error occurred.
  17499. * * hostname [String] set when a networking error occurs to easily
  17500. * identify the endpoint of the request.
  17501. * * region [String] set when a networking error occurs to easily
  17502. * identify the region of the request.
  17503. *
  17504. * @!attribute requestId
  17505. * @readonly
  17506. * @!group Data Properties
  17507. * @return [String] the unique request ID associated with the response.
  17508. * Log this value when debugging requests for AWS support.
  17509. *
  17510. * @!attribute retryCount
  17511. * @readonly
  17512. * @!group Operation Properties
  17513. * @return [Integer] the number of retries that were
  17514. * attempted before the request was completed.
  17515. *
  17516. * @!attribute redirectCount
  17517. * @readonly
  17518. * @!group Operation Properties
  17519. * @return [Integer] the number of redirects that were
  17520. * followed before the request was completed.
  17521. *
  17522. * @!attribute httpResponse
  17523. * @readonly
  17524. * @!group HTTP Properties
  17525. * @return [AWS.HttpResponse] the raw HTTP response object
  17526. * containing the response headers and body information
  17527. * from the server.
  17528. *
  17529. * @see AWS.Request
  17530. */
  17531. AWS.Response = inherit({
  17532. /**
  17533. * @api private
  17534. */
  17535. constructor: function Response(request) {
  17536. this.request = request;
  17537. this.data = null;
  17538. this.error = null;
  17539. this.retryCount = 0;
  17540. this.redirectCount = 0;
  17541. this.httpResponse = new AWS.HttpResponse();
  17542. if (request) {
  17543. this.maxRetries = request.service.numRetries();
  17544. this.maxRedirects = request.service.config.maxRedirects;
  17545. }
  17546. },
  17547. /**
  17548. * Creates a new request for the next page of response data, calling the
  17549. * callback with the page data if a callback is provided.
  17550. *
  17551. * @callback callback function(err, data)
  17552. * Called when a page of data is returned from the next request.
  17553. *
  17554. * @param err [Error] an error object, if an error occurred in the request
  17555. * @param data [Object] the next page of data, or null, if there are no
  17556. * more pages left.
  17557. * @return [AWS.Request] the request object for the next page of data
  17558. * @return [null] if no callback is provided and there are no pages left
  17559. * to retrieve.
  17560. * @since v1.4.0
  17561. */
  17562. nextPage: function nextPage(callback) {
  17563. var config;
  17564. var service = this.request.service;
  17565. var operation = this.request.operation;
  17566. try {
  17567. config = service.paginationConfig(operation, true);
  17568. } catch (e) { this.error = e; }
  17569. if (!this.hasNextPage()) {
  17570. if (callback) callback(this.error, null);
  17571. else if (this.error) throw this.error;
  17572. return null;
  17573. }
  17574. var params = AWS.util.copy(this.request.params);
  17575. if (!this.nextPageTokens) {
  17576. return callback ? callback(null, null) : null;
  17577. } else {
  17578. var inputTokens = config.inputToken;
  17579. if (typeof inputTokens === 'string') inputTokens = [inputTokens];
  17580. for (var i = 0; i < inputTokens.length; i++) {
  17581. params[inputTokens[i]] = this.nextPageTokens[i];
  17582. }
  17583. return service.makeRequest(this.request.operation, params, callback);
  17584. }
  17585. },
  17586. /**
  17587. * @return [Boolean] whether more pages of data can be returned by further
  17588. * requests
  17589. * @since v1.4.0
  17590. */
  17591. hasNextPage: function hasNextPage() {
  17592. this.cacheNextPageTokens();
  17593. if (this.nextPageTokens) return true;
  17594. if (this.nextPageTokens === undefined) return undefined;
  17595. else return false;
  17596. },
  17597. /**
  17598. * @api private
  17599. */
  17600. cacheNextPageTokens: function cacheNextPageTokens() {
  17601. if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens;
  17602. this.nextPageTokens = undefined;
  17603. var config = this.request.service.paginationConfig(this.request.operation);
  17604. if (!config) return this.nextPageTokens;
  17605. this.nextPageTokens = null;
  17606. if (config.moreResults) {
  17607. if (!jmespath.search(this.data, config.moreResults)) {
  17608. return this.nextPageTokens;
  17609. }
  17610. }
  17611. var exprs = config.outputToken;
  17612. if (typeof exprs === 'string') exprs = [exprs];
  17613. AWS.util.arrayEach.call(this, exprs, function (expr) {
  17614. var output = jmespath.search(this.data, expr);
  17615. if (output) {
  17616. this.nextPageTokens = this.nextPageTokens || [];
  17617. this.nextPageTokens.push(output);
  17618. }
  17619. });
  17620. return this.nextPageTokens;
  17621. }
  17622. });
  17623. /***/ }),
  17624. /***/ 835:
  17625. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  17626. var AWS = __webpack_require__(395);
  17627. var inherit = AWS.util.inherit;
  17628. /**
  17629. * @api private
  17630. */
  17631. AWS.Signers.RequestSigner = inherit({
  17632. constructor: function RequestSigner(request) {
  17633. this.request = request;
  17634. },
  17635. setServiceClientId: function setServiceClientId(id) {
  17636. this.serviceClientId = id;
  17637. },
  17638. getServiceClientId: function getServiceClientId() {
  17639. return this.serviceClientId;
  17640. }
  17641. });
  17642. AWS.Signers.RequestSigner.getVersion = function getVersion(version) {
  17643. switch (version) {
  17644. case 'v2': return AWS.Signers.V2;
  17645. case 'v3': return AWS.Signers.V3;
  17646. case 's3v4': return AWS.Signers.V4;
  17647. case 'v4': return AWS.Signers.V4;
  17648. case 's3': return AWS.Signers.S3;
  17649. case 'v3https': return AWS.Signers.V3Https;
  17650. }
  17651. throw new Error('Unknown signing version ' + version);
  17652. };
  17653. __webpack_require__(220);
  17654. __webpack_require__(791);
  17655. __webpack_require__(566);
  17656. __webpack_require__(754);
  17657. __webpack_require__(616);
  17658. __webpack_require__(951);
  17659. /***/ }),
  17660. /***/ 852:
  17661. /***/ (function(module, __unusedexports, __webpack_require__) {
  17662. /*!
  17663. * mime-db
  17664. * Copyright(c) 2014 Jonathan Ong
  17665. * MIT Licensed
  17666. */
  17667. /**
  17668. * Module exports.
  17669. */
  17670. module.exports = __webpack_require__(512)
  17671. /***/ }),
  17672. /***/ 855:
  17673. /***/ (function(module, __unusedexports, __webpack_require__) {
  17674. // Generated by CoffeeScript 1.12.7
  17675. (function() {
  17676. var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLProcessingInstruction, XMLRaw, XMLText, isEmpty, isFunction, isObject, ref,
  17677. hasProp = {}.hasOwnProperty;
  17678. ref = __webpack_require__(582), isObject = ref.isObject, isFunction = ref.isFunction, isEmpty = ref.isEmpty;
  17679. XMLElement = null;
  17680. XMLCData = null;
  17681. XMLComment = null;
  17682. XMLDeclaration = null;
  17683. XMLDocType = null;
  17684. XMLRaw = null;
  17685. XMLText = null;
  17686. XMLProcessingInstruction = null;
  17687. module.exports = XMLNode = (function() {
  17688. function XMLNode(parent) {
  17689. this.parent = parent;
  17690. if (this.parent) {
  17691. this.options = this.parent.options;
  17692. this.stringify = this.parent.stringify;
  17693. }
  17694. this.children = [];
  17695. if (!XMLElement) {
  17696. XMLElement = __webpack_require__(796);
  17697. XMLCData = __webpack_require__(35);
  17698. XMLComment = __webpack_require__(919);
  17699. XMLDeclaration = __webpack_require__(738);
  17700. XMLDocType = __webpack_require__(735);
  17701. XMLRaw = __webpack_require__(660);
  17702. XMLText = __webpack_require__(708);
  17703. XMLProcessingInstruction = __webpack_require__(491);
  17704. }
  17705. }
  17706. XMLNode.prototype.element = function(name, attributes, text) {
  17707. var childNode, item, j, k, key, lastChild, len, len1, ref1, val;
  17708. lastChild = null;
  17709. if (attributes == null) {
  17710. attributes = {};
  17711. }
  17712. attributes = attributes.valueOf();
  17713. if (!isObject(attributes)) {
  17714. ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
  17715. }
  17716. if (name != null) {
  17717. name = name.valueOf();
  17718. }
  17719. if (Array.isArray(name)) {
  17720. for (j = 0, len = name.length; j < len; j++) {
  17721. item = name[j];
  17722. lastChild = this.element(item);
  17723. }
  17724. } else if (isFunction(name)) {
  17725. lastChild = this.element(name.apply());
  17726. } else if (isObject(name)) {
  17727. for (key in name) {
  17728. if (!hasProp.call(name, key)) continue;
  17729. val = name[key];
  17730. if (isFunction(val)) {
  17731. val = val.apply();
  17732. }
  17733. if ((isObject(val)) && (isEmpty(val))) {
  17734. val = null;
  17735. }
  17736. if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
  17737. lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
  17738. } else if (!this.options.separateArrayItems && Array.isArray(val)) {
  17739. for (k = 0, len1 = val.length; k < len1; k++) {
  17740. item = val[k];
  17741. childNode = {};
  17742. childNode[key] = item;
  17743. lastChild = this.element(childNode);
  17744. }
  17745. } else if (isObject(val)) {
  17746. lastChild = this.element(key);
  17747. lastChild.element(val);
  17748. } else {
  17749. lastChild = this.element(key, val);
  17750. }
  17751. }
  17752. } else {
  17753. if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
  17754. lastChild = this.text(text);
  17755. } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
  17756. lastChild = this.cdata(text);
  17757. } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
  17758. lastChild = this.comment(text);
  17759. } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
  17760. lastChild = this.raw(text);
  17761. } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
  17762. lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
  17763. } else {
  17764. lastChild = this.node(name, attributes, text);
  17765. }
  17766. }
  17767. if (lastChild == null) {
  17768. throw new Error("Could not create any elements with: " + name);
  17769. }
  17770. return lastChild;
  17771. };
  17772. XMLNode.prototype.insertBefore = function(name, attributes, text) {
  17773. var child, i, removed;
  17774. if (this.isRoot) {
  17775. throw new Error("Cannot insert elements at root level");
  17776. }
  17777. i = this.parent.children.indexOf(this);
  17778. removed = this.parent.children.splice(i);
  17779. child = this.parent.element(name, attributes, text);
  17780. Array.prototype.push.apply(this.parent.children, removed);
  17781. return child;
  17782. };
  17783. XMLNode.prototype.insertAfter = function(name, attributes, text) {
  17784. var child, i, removed;
  17785. if (this.isRoot) {
  17786. throw new Error("Cannot insert elements at root level");
  17787. }
  17788. i = this.parent.children.indexOf(this);
  17789. removed = this.parent.children.splice(i + 1);
  17790. child = this.parent.element(name, attributes, text);
  17791. Array.prototype.push.apply(this.parent.children, removed);
  17792. return child;
  17793. };
  17794. XMLNode.prototype.remove = function() {
  17795. var i, ref1;
  17796. if (this.isRoot) {
  17797. throw new Error("Cannot remove the root element");
  17798. }
  17799. i = this.parent.children.indexOf(this);
  17800. [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;
  17801. return this.parent;
  17802. };
  17803. XMLNode.prototype.node = function(name, attributes, text) {
  17804. var child, ref1;
  17805. if (name != null) {
  17806. name = name.valueOf();
  17807. }
  17808. attributes || (attributes = {});
  17809. attributes = attributes.valueOf();
  17810. if (!isObject(attributes)) {
  17811. ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
  17812. }
  17813. child = new XMLElement(this, name, attributes);
  17814. if (text != null) {
  17815. child.text(text);
  17816. }
  17817. this.children.push(child);
  17818. return child;
  17819. };
  17820. XMLNode.prototype.text = function(value) {
  17821. var child;
  17822. child = new XMLText(this, value);
  17823. this.children.push(child);
  17824. return this;
  17825. };
  17826. XMLNode.prototype.cdata = function(value) {
  17827. var child;
  17828. child = new XMLCData(this, value);
  17829. this.children.push(child);
  17830. return this;
  17831. };
  17832. XMLNode.prototype.comment = function(value) {
  17833. var child;
  17834. child = new XMLComment(this, value);
  17835. this.children.push(child);
  17836. return this;
  17837. };
  17838. XMLNode.prototype.commentBefore = function(value) {
  17839. var child, i, removed;
  17840. i = this.parent.children.indexOf(this);
  17841. removed = this.parent.children.splice(i);
  17842. child = this.parent.comment(value);
  17843. Array.prototype.push.apply(this.parent.children, removed);
  17844. return this;
  17845. };
  17846. XMLNode.prototype.commentAfter = function(value) {
  17847. var child, i, removed;
  17848. i = this.parent.children.indexOf(this);
  17849. removed = this.parent.children.splice(i + 1);
  17850. child = this.parent.comment(value);
  17851. Array.prototype.push.apply(this.parent.children, removed);
  17852. return this;
  17853. };
  17854. XMLNode.prototype.raw = function(value) {
  17855. var child;
  17856. child = new XMLRaw(this, value);
  17857. this.children.push(child);
  17858. return this;
  17859. };
  17860. XMLNode.prototype.instruction = function(target, value) {
  17861. var insTarget, insValue, instruction, j, len;
  17862. if (target != null) {
  17863. target = target.valueOf();
  17864. }
  17865. if (value != null) {
  17866. value = value.valueOf();
  17867. }
  17868. if (Array.isArray(target)) {
  17869. for (j = 0, len = target.length; j < len; j++) {
  17870. insTarget = target[j];
  17871. this.instruction(insTarget);
  17872. }
  17873. } else if (isObject(target)) {
  17874. for (insTarget in target) {
  17875. if (!hasProp.call(target, insTarget)) continue;
  17876. insValue = target[insTarget];
  17877. this.instruction(insTarget, insValue);
  17878. }
  17879. } else {
  17880. if (isFunction(value)) {
  17881. value = value.apply();
  17882. }
  17883. instruction = new XMLProcessingInstruction(this, target, value);
  17884. this.children.push(instruction);
  17885. }
  17886. return this;
  17887. };
  17888. XMLNode.prototype.instructionBefore = function(target, value) {
  17889. var child, i, removed;
  17890. i = this.parent.children.indexOf(this);
  17891. removed = this.parent.children.splice(i);
  17892. child = this.parent.instruction(target, value);
  17893. Array.prototype.push.apply(this.parent.children, removed);
  17894. return this;
  17895. };
  17896. XMLNode.prototype.instructionAfter = function(target, value) {
  17897. var child, i, removed;
  17898. i = this.parent.children.indexOf(this);
  17899. removed = this.parent.children.splice(i + 1);
  17900. child = this.parent.instruction(target, value);
  17901. Array.prototype.push.apply(this.parent.children, removed);
  17902. return this;
  17903. };
  17904. XMLNode.prototype.declaration = function(version, encoding, standalone) {
  17905. var doc, xmldec;
  17906. doc = this.document();
  17907. xmldec = new XMLDeclaration(doc, version, encoding, standalone);
  17908. if (doc.children[0] instanceof XMLDeclaration) {
  17909. doc.children[0] = xmldec;
  17910. } else {
  17911. doc.children.unshift(xmldec);
  17912. }
  17913. return doc.root() || doc;
  17914. };
  17915. XMLNode.prototype.doctype = function(pubID, sysID) {
  17916. var child, doc, doctype, i, j, k, len, len1, ref1, ref2;
  17917. doc = this.document();
  17918. doctype = new XMLDocType(doc, pubID, sysID);
  17919. ref1 = doc.children;
  17920. for (i = j = 0, len = ref1.length; j < len; i = ++j) {
  17921. child = ref1[i];
  17922. if (child instanceof XMLDocType) {
  17923. doc.children[i] = doctype;
  17924. return doctype;
  17925. }
  17926. }
  17927. ref2 = doc.children;
  17928. for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) {
  17929. child = ref2[i];
  17930. if (child.isRoot) {
  17931. doc.children.splice(i, 0, doctype);
  17932. return doctype;
  17933. }
  17934. }
  17935. doc.children.push(doctype);
  17936. return doctype;
  17937. };
  17938. XMLNode.prototype.up = function() {
  17939. if (this.isRoot) {
  17940. throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
  17941. }
  17942. return this.parent;
  17943. };
  17944. XMLNode.prototype.root = function() {
  17945. var node;
  17946. node = this;
  17947. while (node) {
  17948. if (node.isDocument) {
  17949. return node.rootObject;
  17950. } else if (node.isRoot) {
  17951. return node;
  17952. } else {
  17953. node = node.parent;
  17954. }
  17955. }
  17956. };
  17957. XMLNode.prototype.document = function() {
  17958. var node;
  17959. node = this;
  17960. while (node) {
  17961. if (node.isDocument) {
  17962. return node;
  17963. } else {
  17964. node = node.parent;
  17965. }
  17966. }
  17967. };
  17968. XMLNode.prototype.end = function(options) {
  17969. return this.document().end(options);
  17970. };
  17971. XMLNode.prototype.prev = function() {
  17972. var i;
  17973. i = this.parent.children.indexOf(this);
  17974. if (i < 1) {
  17975. throw new Error("Already at the first node");
  17976. }
  17977. return this.parent.children[i - 1];
  17978. };
  17979. XMLNode.prototype.next = function() {
  17980. var i;
  17981. i = this.parent.children.indexOf(this);
  17982. if (i === -1 || i === this.parent.children.length - 1) {
  17983. throw new Error("Already at the last node");
  17984. }
  17985. return this.parent.children[i + 1];
  17986. };
  17987. XMLNode.prototype.importDocument = function(doc) {
  17988. var clonedRoot;
  17989. clonedRoot = doc.root().clone();
  17990. clonedRoot.parent = this;
  17991. clonedRoot.isRoot = false;
  17992. this.children.push(clonedRoot);
  17993. return this;
  17994. };
  17995. XMLNode.prototype.ele = function(name, attributes, text) {
  17996. return this.element(name, attributes, text);
  17997. };
  17998. XMLNode.prototype.nod = function(name, attributes, text) {
  17999. return this.node(name, attributes, text);
  18000. };
  18001. XMLNode.prototype.txt = function(value) {
  18002. return this.text(value);
  18003. };
  18004. XMLNode.prototype.dat = function(value) {
  18005. return this.cdata(value);
  18006. };
  18007. XMLNode.prototype.com = function(value) {
  18008. return this.comment(value);
  18009. };
  18010. XMLNode.prototype.ins = function(target, value) {
  18011. return this.instruction(target, value);
  18012. };
  18013. XMLNode.prototype.doc = function() {
  18014. return this.document();
  18015. };
  18016. XMLNode.prototype.dec = function(version, encoding, standalone) {
  18017. return this.declaration(version, encoding, standalone);
  18018. };
  18019. XMLNode.prototype.dtd = function(pubID, sysID) {
  18020. return this.doctype(pubID, sysID);
  18021. };
  18022. XMLNode.prototype.e = function(name, attributes, text) {
  18023. return this.element(name, attributes, text);
  18024. };
  18025. XMLNode.prototype.n = function(name, attributes, text) {
  18026. return this.node(name, attributes, text);
  18027. };
  18028. XMLNode.prototype.t = function(value) {
  18029. return this.text(value);
  18030. };
  18031. XMLNode.prototype.d = function(value) {
  18032. return this.cdata(value);
  18033. };
  18034. XMLNode.prototype.c = function(value) {
  18035. return this.comment(value);
  18036. };
  18037. XMLNode.prototype.r = function(value) {
  18038. return this.raw(value);
  18039. };
  18040. XMLNode.prototype.i = function(target, value) {
  18041. return this.instruction(target, value);
  18042. };
  18043. XMLNode.prototype.u = function() {
  18044. return this.up();
  18045. };
  18046. XMLNode.prototype.importXMLBuilder = function(doc) {
  18047. return this.importDocument(doc);
  18048. };
  18049. return XMLNode;
  18050. })();
  18051. }).call(this);
  18052. /***/ }),
  18053. /***/ 856:
  18054. /***/ (function(module, __unusedexports, __webpack_require__) {
  18055. var AWS = __webpack_require__(395);
  18056. var byteLength = AWS.util.string.byteLength;
  18057. var Buffer = AWS.util.Buffer;
  18058. /**
  18059. * The managed uploader allows for easy and efficient uploading of buffers,
  18060. * blobs, or streams, using a configurable amount of concurrency to perform
  18061. * multipart uploads where possible. This abstraction also enables uploading
  18062. * streams of unknown size due to the use of multipart uploads.
  18063. *
  18064. * To construct a managed upload object, see the {constructor} function.
  18065. *
  18066. * ## Tracking upload progress
  18067. *
  18068. * The managed upload object can also track progress by attaching an
  18069. * 'httpUploadProgress' listener to the upload manager. This event is similar
  18070. * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress
  18071. * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more
  18072. * information.
  18073. *
  18074. * ## Handling Multipart Cleanup
  18075. *
  18076. * By default, this class will automatically clean up any multipart uploads
  18077. * when an individual part upload fails. This behavior can be disabled in order
  18078. * to manually handle failures by setting the `leavePartsOnError` configuration
  18079. * option to `true` when initializing the upload object.
  18080. *
  18081. * @!event httpUploadProgress(progress)
  18082. * Triggered when the uploader has uploaded more data.
  18083. * @note The `total` property may not be set if the stream being uploaded has
  18084. * not yet finished chunking. In this case the `total` will be undefined
  18085. * until the total stream size is known.
  18086. * @note This event will not be emitted in Node.js 0.8.x.
  18087. * @param progress [map] An object containing the `loaded` and `total` bytes
  18088. * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload
  18089. * size is known.
  18090. * @context (see AWS.Request~send)
  18091. */
  18092. AWS.S3.ManagedUpload = AWS.util.inherit({
  18093. /**
  18094. * Creates a managed upload object with a set of configuration options.
  18095. *
  18096. * @note A "Body" parameter is required to be set prior to calling {send}.
  18097. * @note In Node.js, sending "Body" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream}
  18098. * may result in upload hangs. Using buffer stream is preferable.
  18099. * @option options params [map] a map of parameters to pass to the upload
  18100. * requests. The "Body" parameter is required to be specified either on
  18101. * the service or in the params option.
  18102. * @note ContentMD5 should not be provided when using the managed upload object.
  18103. * Instead, setting "computeChecksums" to true will enable automatic ContentMD5 generation
  18104. * by the managed upload object.
  18105. * @option options queueSize [Number] (4) the size of the concurrent queue
  18106. * manager to upload parts in parallel. Set to 1 for synchronous uploading
  18107. * of parts. Note that the uploader will buffer at most queueSize * partSize
  18108. * bytes into memory at any given time.
  18109. * @option options partSize [Number] (5mb) the size in bytes for each
  18110. * individual part to be uploaded. Adjust the part size to ensure the number
  18111. * of parts does not exceed {maxTotalParts}. See {minPartSize} for the
  18112. * minimum allowed part size.
  18113. * @option options leavePartsOnError [Boolean] (false) whether to abort the
  18114. * multipart upload if an error occurs. Set to true if you want to handle
  18115. * failures manually.
  18116. * @option options service [AWS.S3] an optional S3 service object to use for
  18117. * requests. This object might have bound parameters used by the uploader.
  18118. * @option options tags [Array<map>] The tags to apply to the uploaded object.
  18119. * Each tag should have a `Key` and `Value` keys.
  18120. * @example Creating a default uploader for a stream object
  18121. * var upload = new AWS.S3.ManagedUpload({
  18122. * params: {Bucket: 'bucket', Key: 'key', Body: stream}
  18123. * });
  18124. * @example Creating an uploader with concurrency of 1 and partSize of 10mb
  18125. * var upload = new AWS.S3.ManagedUpload({
  18126. * partSize: 10 * 1024 * 1024, queueSize: 1,
  18127. * params: {Bucket: 'bucket', Key: 'key', Body: stream}
  18128. * });
  18129. * @example Creating an uploader with tags
  18130. * var upload = new AWS.S3.ManagedUpload({
  18131. * params: {Bucket: 'bucket', Key: 'key', Body: stream},
  18132. * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}]
  18133. * });
  18134. * @see send
  18135. */
  18136. constructor: function ManagedUpload(options) {
  18137. var self = this;
  18138. AWS.SequentialExecutor.call(self);
  18139. self.body = null;
  18140. self.sliceFn = null;
  18141. self.callback = null;
  18142. self.parts = {};
  18143. self.completeInfo = [];
  18144. self.fillQueue = function() {
  18145. self.callback(new Error('Unsupported body payload ' + typeof self.body));
  18146. };
  18147. self.configure(options);
  18148. },
  18149. /**
  18150. * @api private
  18151. */
  18152. configure: function configure(options) {
  18153. options = options || {};
  18154. this.partSize = this.minPartSize;
  18155. if (options.queueSize) this.queueSize = options.queueSize;
  18156. if (options.partSize) this.partSize = options.partSize;
  18157. if (options.leavePartsOnError) this.leavePartsOnError = true;
  18158. if (options.tags) {
  18159. if (!Array.isArray(options.tags)) {
  18160. throw new Error('Tags must be specified as an array; ' +
  18161. typeof options.tags + ' provided.');
  18162. }
  18163. this.tags = options.tags;
  18164. }
  18165. if (this.partSize < this.minPartSize) {
  18166. throw new Error('partSize must be greater than ' +
  18167. this.minPartSize);
  18168. }
  18169. this.service = options.service;
  18170. this.bindServiceObject(options.params);
  18171. this.validateBody();
  18172. this.adjustTotalBytes();
  18173. },
  18174. /**
  18175. * @api private
  18176. */
  18177. leavePartsOnError: false,
  18178. /**
  18179. * @api private
  18180. */
  18181. queueSize: 4,
  18182. /**
  18183. * @api private
  18184. */
  18185. partSize: null,
  18186. /**
  18187. * @readonly
  18188. * @return [Number] the minimum number of bytes for an individual part
  18189. * upload.
  18190. */
  18191. minPartSize: 1024 * 1024 * 5,
  18192. /**
  18193. * @readonly
  18194. * @return [Number] the maximum allowed number of parts in a multipart upload.
  18195. */
  18196. maxTotalParts: 10000,
  18197. /**
  18198. * Initiates the managed upload for the payload.
  18199. *
  18200. * @callback callback function(err, data)
  18201. * @param err [Error] an error or null if no error occurred.
  18202. * @param data [map] The response data from the successful upload:
  18203. * * `Location` (String) the URL of the uploaded object
  18204. * * `ETag` (String) the ETag of the uploaded object
  18205. * * `Bucket` (String) the bucket to which the object was uploaded
  18206. * * `Key` (String) the key to which the object was uploaded
  18207. * @example Sending a managed upload object
  18208. * var params = {Bucket: 'bucket', Key: 'key', Body: stream};
  18209. * var upload = new AWS.S3.ManagedUpload({params: params});
  18210. * upload.send(function(err, data) {
  18211. * console.log(err, data);
  18212. * });
  18213. */
  18214. send: function(callback) {
  18215. var self = this;
  18216. self.failed = false;
  18217. self.callback = callback || function(err) { if (err) throw err; };
  18218. var runFill = true;
  18219. if (self.sliceFn) {
  18220. self.fillQueue = self.fillBuffer;
  18221. } else if (AWS.util.isNode()) {
  18222. var Stream = AWS.util.stream.Stream;
  18223. if (self.body instanceof Stream) {
  18224. runFill = false;
  18225. self.fillQueue = self.fillStream;
  18226. self.partBuffers = [];
  18227. self.body.
  18228. on('error', function(err) { self.cleanup(err); }).
  18229. on('readable', function() { self.fillQueue(); }).
  18230. on('end', function() {
  18231. self.isDoneChunking = true;
  18232. self.numParts = self.totalPartNumbers;
  18233. self.fillQueue.call(self);
  18234. if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) {
  18235. self.finishMultiPart();
  18236. }
  18237. });
  18238. }
  18239. }
  18240. if (runFill) self.fillQueue.call(self);
  18241. },
  18242. /**
  18243. * @!method promise()
  18244. * Returns a 'thenable' promise.
  18245. *
  18246. * Two callbacks can be provided to the `then` method on the returned promise.
  18247. * The first callback will be called if the promise is fulfilled, and the second
  18248. * callback will be called if the promise is rejected.
  18249. * @callback fulfilledCallback function(data)
  18250. * Called if the promise is fulfilled.
  18251. * @param data [map] The response data from the successful upload:
  18252. * `Location` (String) the URL of the uploaded object
  18253. * `ETag` (String) the ETag of the uploaded object
  18254. * `Bucket` (String) the bucket to which the object was uploaded
  18255. * `Key` (String) the key to which the object was uploaded
  18256. * @callback rejectedCallback function(err)
  18257. * Called if the promise is rejected.
  18258. * @param err [Error] an error or null if no error occurred.
  18259. * @return [Promise] A promise that represents the state of the upload request.
  18260. * @example Sending an upload request using promises.
  18261. * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream});
  18262. * var promise = upload.promise();
  18263. * promise.then(function(data) { ... }, function(err) { ... });
  18264. */
  18265. /**
  18266. * Aborts a managed upload, including all concurrent upload requests.
  18267. * @note By default, calling this function will cleanup a multipart upload
  18268. * if one was created. To leave the multipart upload around after aborting
  18269. * a request, configure `leavePartsOnError` to `true` in the {constructor}.
  18270. * @note Calling {abort} in the browser environment will not abort any requests
  18271. * that are already in flight. If a multipart upload was created, any parts
  18272. * not yet uploaded will not be sent, and the multipart upload will be cleaned up.
  18273. * @example Aborting an upload
  18274. * var params = {
  18275. * Bucket: 'bucket', Key: 'key',
  18276. * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload
  18277. * };
  18278. * var upload = s3.upload(params);
  18279. * upload.send(function (err, data) {
  18280. * if (err) console.log("Error:", err.code, err.message);
  18281. * else console.log(data);
  18282. * });
  18283. *
  18284. * // abort request in 1 second
  18285. * setTimeout(upload.abort.bind(upload), 1000);
  18286. */
  18287. abort: function() {
  18288. var self = this;
  18289. //abort putObject request
  18290. if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) {
  18291. self.singlePart.abort();
  18292. } else {
  18293. self.cleanup(AWS.util.error(new Error('Request aborted by user'), {
  18294. code: 'RequestAbortedError', retryable: false
  18295. }));
  18296. }
  18297. },
  18298. /**
  18299. * @api private
  18300. */
  18301. validateBody: function validateBody() {
  18302. var self = this;
  18303. self.body = self.service.config.params.Body;
  18304. if (typeof self.body === 'string') {
  18305. self.body = AWS.util.buffer.toBuffer(self.body);
  18306. } else if (!self.body) {
  18307. throw new Error('params.Body is required');
  18308. }
  18309. self.sliceFn = AWS.util.arraySliceFn(self.body);
  18310. },
  18311. /**
  18312. * @api private
  18313. */
  18314. bindServiceObject: function bindServiceObject(params) {
  18315. params = params || {};
  18316. var self = this;
  18317. // bind parameters to new service object
  18318. if (!self.service) {
  18319. self.service = new AWS.S3({params: params});
  18320. } else {
  18321. var service = self.service;
  18322. var config = AWS.util.copy(service._originalConfig || {});
  18323. config.signatureVersion = service.getSignatureVersion();
  18324. self.service = new service.constructor.__super__(config);
  18325. self.service.config.params =
  18326. AWS.util.merge(self.service.config.params || {}, params);
  18327. }
  18328. },
  18329. /**
  18330. * @api private
  18331. */
  18332. adjustTotalBytes: function adjustTotalBytes() {
  18333. var self = this;
  18334. try { // try to get totalBytes
  18335. self.totalBytes = byteLength(self.body);
  18336. } catch (e) { }
  18337. // try to adjust partSize if we know payload length
  18338. if (self.totalBytes) {
  18339. var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts);
  18340. if (newPartSize > self.partSize) self.partSize = newPartSize;
  18341. } else {
  18342. self.totalBytes = undefined;
  18343. }
  18344. },
  18345. /**
  18346. * @api private
  18347. */
  18348. isDoneChunking: false,
  18349. /**
  18350. * @api private
  18351. */
  18352. partPos: 0,
  18353. /**
  18354. * @api private
  18355. */
  18356. totalChunkedBytes: 0,
  18357. /**
  18358. * @api private
  18359. */
  18360. totalUploadedBytes: 0,
  18361. /**
  18362. * @api private
  18363. */
  18364. totalBytes: undefined,
  18365. /**
  18366. * @api private
  18367. */
  18368. numParts: 0,
  18369. /**
  18370. * @api private
  18371. */
  18372. totalPartNumbers: 0,
  18373. /**
  18374. * @api private
  18375. */
  18376. activeParts: 0,
  18377. /**
  18378. * @api private
  18379. */
  18380. doneParts: 0,
  18381. /**
  18382. * @api private
  18383. */
  18384. parts: null,
  18385. /**
  18386. * @api private
  18387. */
  18388. completeInfo: null,
  18389. /**
  18390. * @api private
  18391. */
  18392. failed: false,
  18393. /**
  18394. * @api private
  18395. */
  18396. multipartReq: null,
  18397. /**
  18398. * @api private
  18399. */
  18400. partBuffers: null,
  18401. /**
  18402. * @api private
  18403. */
  18404. partBufferLength: 0,
  18405. /**
  18406. * @api private
  18407. */
  18408. fillBuffer: function fillBuffer() {
  18409. var self = this;
  18410. var bodyLen = byteLength(self.body);
  18411. if (bodyLen === 0) {
  18412. self.isDoneChunking = true;
  18413. self.numParts = 1;
  18414. self.nextChunk(self.body);
  18415. return;
  18416. }
  18417. while (self.activeParts < self.queueSize && self.partPos < bodyLen) {
  18418. var endPos = Math.min(self.partPos + self.partSize, bodyLen);
  18419. var buf = self.sliceFn.call(self.body, self.partPos, endPos);
  18420. self.partPos += self.partSize;
  18421. if (byteLength(buf) < self.partSize || self.partPos === bodyLen) {
  18422. self.isDoneChunking = true;
  18423. self.numParts = self.totalPartNumbers + 1;
  18424. }
  18425. self.nextChunk(buf);
  18426. }
  18427. },
  18428. /**
  18429. * @api private
  18430. */
  18431. fillStream: function fillStream() {
  18432. var self = this;
  18433. if (self.activeParts >= self.queueSize) return;
  18434. var buf = self.body.read(self.partSize - self.partBufferLength) ||
  18435. self.body.read();
  18436. if (buf) {
  18437. self.partBuffers.push(buf);
  18438. self.partBufferLength += buf.length;
  18439. self.totalChunkedBytes += buf.length;
  18440. }
  18441. if (self.partBufferLength >= self.partSize) {
  18442. // if we have single buffer we avoid copyfull concat
  18443. var pbuf = self.partBuffers.length === 1 ?
  18444. self.partBuffers[0] : Buffer.concat(self.partBuffers);
  18445. self.partBuffers = [];
  18446. self.partBufferLength = 0;
  18447. // if we have more than partSize, push the rest back on the queue
  18448. if (pbuf.length > self.partSize) {
  18449. var rest = pbuf.slice(self.partSize);
  18450. self.partBuffers.push(rest);
  18451. self.partBufferLength += rest.length;
  18452. pbuf = pbuf.slice(0, self.partSize);
  18453. }
  18454. self.nextChunk(pbuf);
  18455. }
  18456. if (self.isDoneChunking && !self.isDoneSending) {
  18457. // if we have single buffer we avoid copyfull concat
  18458. pbuf = self.partBuffers.length === 1 ?
  18459. self.partBuffers[0] : Buffer.concat(self.partBuffers);
  18460. self.partBuffers = [];
  18461. self.partBufferLength = 0;
  18462. self.totalBytes = self.totalChunkedBytes;
  18463. self.isDoneSending = true;
  18464. if (self.numParts === 0 || pbuf.length > 0) {
  18465. self.numParts++;
  18466. self.nextChunk(pbuf);
  18467. }
  18468. }
  18469. self.body.read(0);
  18470. },
  18471. /**
  18472. * @api private
  18473. */
  18474. nextChunk: function nextChunk(chunk) {
  18475. var self = this;
  18476. if (self.failed) return null;
  18477. var partNumber = ++self.totalPartNumbers;
  18478. if (self.isDoneChunking && partNumber === 1) {
  18479. var params = {Body: chunk};
  18480. if (this.tags) {
  18481. params.Tagging = this.getTaggingHeader();
  18482. }
  18483. var req = self.service.putObject(params);
  18484. req._managedUpload = self;
  18485. req.on('httpUploadProgress', self.progress).send(self.finishSinglePart);
  18486. self.singlePart = req; //save the single part request
  18487. return null;
  18488. } else if (self.service.config.params.ContentMD5) {
  18489. var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), {
  18490. code: 'InvalidDigest', retryable: false
  18491. });
  18492. self.cleanup(err);
  18493. return null;
  18494. }
  18495. if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) {
  18496. return null; // Already uploaded this part.
  18497. }
  18498. self.activeParts++;
  18499. if (!self.service.config.params.UploadId) {
  18500. if (!self.multipartReq) { // create multipart
  18501. self.multipartReq = self.service.createMultipartUpload();
  18502. self.multipartReq.on('success', function(resp) {
  18503. self.service.config.params.UploadId = resp.data.UploadId;
  18504. self.multipartReq = null;
  18505. });
  18506. self.queueChunks(chunk, partNumber);
  18507. self.multipartReq.on('error', function(err) {
  18508. self.cleanup(err);
  18509. });
  18510. self.multipartReq.send();
  18511. } else {
  18512. self.queueChunks(chunk, partNumber);
  18513. }
  18514. } else { // multipart is created, just send
  18515. self.uploadPart(chunk, partNumber);
  18516. }
  18517. },
  18518. /**
  18519. * @api private
  18520. */
  18521. getTaggingHeader: function getTaggingHeader() {
  18522. var kvPairStrings = [];
  18523. for (var i = 0; i < this.tags.length; i++) {
  18524. kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' +
  18525. AWS.util.uriEscape(this.tags[i].Value));
  18526. }
  18527. return kvPairStrings.join('&');
  18528. },
  18529. /**
  18530. * @api private
  18531. */
  18532. uploadPart: function uploadPart(chunk, partNumber) {
  18533. var self = this;
  18534. var partParams = {
  18535. Body: chunk,
  18536. ContentLength: AWS.util.string.byteLength(chunk),
  18537. PartNumber: partNumber
  18538. };
  18539. var partInfo = {ETag: null, PartNumber: partNumber};
  18540. self.completeInfo[partNumber] = partInfo;
  18541. var req = self.service.uploadPart(partParams);
  18542. self.parts[partNumber] = req;
  18543. req._lastUploadedBytes = 0;
  18544. req._managedUpload = self;
  18545. req.on('httpUploadProgress', self.progress);
  18546. req.send(function(err, data) {
  18547. delete self.parts[partParams.PartNumber];
  18548. self.activeParts--;
  18549. if (!err && (!data || !data.ETag)) {
  18550. var message = 'No access to ETag property on response.';
  18551. if (AWS.util.isBrowser()) {
  18552. message += ' Check CORS configuration to expose ETag header.';
  18553. }
  18554. err = AWS.util.error(new Error(message), {
  18555. code: 'ETagMissing', retryable: false
  18556. });
  18557. }
  18558. if (err) return self.cleanup(err);
  18559. //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304)
  18560. if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null;
  18561. partInfo.ETag = data.ETag;
  18562. self.doneParts++;
  18563. if (self.isDoneChunking && self.doneParts === self.numParts) {
  18564. self.finishMultiPart();
  18565. } else {
  18566. self.fillQueue.call(self);
  18567. }
  18568. });
  18569. },
  18570. /**
  18571. * @api private
  18572. */
  18573. queueChunks: function queueChunks(chunk, partNumber) {
  18574. var self = this;
  18575. self.multipartReq.on('success', function() {
  18576. self.uploadPart(chunk, partNumber);
  18577. });
  18578. },
  18579. /**
  18580. * @api private
  18581. */
  18582. cleanup: function cleanup(err) {
  18583. var self = this;
  18584. if (self.failed) return;
  18585. // clean up stream
  18586. if (typeof self.body.removeAllListeners === 'function' &&
  18587. typeof self.body.resume === 'function') {
  18588. self.body.removeAllListeners('readable');
  18589. self.body.removeAllListeners('end');
  18590. self.body.resume();
  18591. }
  18592. // cleanup multipartReq listeners
  18593. if (self.multipartReq) {
  18594. self.multipartReq.removeAllListeners('success');
  18595. self.multipartReq.removeAllListeners('error');
  18596. self.multipartReq.removeAllListeners('complete');
  18597. delete self.multipartReq;
  18598. }
  18599. if (self.service.config.params.UploadId && !self.leavePartsOnError) {
  18600. self.service.abortMultipartUpload().send();
  18601. } else if (self.leavePartsOnError) {
  18602. self.isDoneChunking = false;
  18603. }
  18604. AWS.util.each(self.parts, function(partNumber, part) {
  18605. part.removeAllListeners('complete');
  18606. part.abort();
  18607. });
  18608. self.activeParts = 0;
  18609. self.partPos = 0;
  18610. self.numParts = 0;
  18611. self.totalPartNumbers = 0;
  18612. self.parts = {};
  18613. self.failed = true;
  18614. self.callback(err);
  18615. },
  18616. /**
  18617. * @api private
  18618. */
  18619. finishMultiPart: function finishMultiPart() {
  18620. var self = this;
  18621. var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } };
  18622. self.service.completeMultipartUpload(completeParams, function(err, data) {
  18623. if (err) {
  18624. return self.cleanup(err);
  18625. }
  18626. if (data && typeof data.Location === 'string') {
  18627. data.Location = data.Location.replace(/%2F/g, '/');
  18628. }
  18629. if (Array.isArray(self.tags)) {
  18630. for (var i = 0; i < self.tags.length; i++) {
  18631. self.tags[i].Value = String(self.tags[i].Value);
  18632. }
  18633. self.service.putObjectTagging(
  18634. {Tagging: {TagSet: self.tags}},
  18635. function(e, d) {
  18636. if (e) {
  18637. self.callback(e);
  18638. } else {
  18639. self.callback(e, data);
  18640. }
  18641. }
  18642. );
  18643. } else {
  18644. self.callback(err, data);
  18645. }
  18646. });
  18647. },
  18648. /**
  18649. * @api private
  18650. */
  18651. finishSinglePart: function finishSinglePart(err, data) {
  18652. var upload = this.request._managedUpload;
  18653. var httpReq = this.request.httpRequest;
  18654. var endpoint = httpReq.endpoint;
  18655. if (err) return upload.callback(err);
  18656. data.Location =
  18657. [endpoint.protocol, '//', endpoint.host, httpReq.path].join('');
  18658. data.key = this.request.params.Key; // will stay undocumented
  18659. data.Key = this.request.params.Key;
  18660. data.Bucket = this.request.params.Bucket;
  18661. upload.callback(err, data);
  18662. },
  18663. /**
  18664. * @api private
  18665. */
  18666. progress: function progress(info) {
  18667. var upload = this._managedUpload;
  18668. if (this.operation === 'putObject') {
  18669. info.part = 1;
  18670. info.key = this.params.Key;
  18671. } else {
  18672. upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes;
  18673. this._lastUploadedBytes = info.loaded;
  18674. info = {
  18675. loaded: upload.totalUploadedBytes,
  18676. total: upload.totalBytes,
  18677. part: this.params.PartNumber,
  18678. key: this.params.Key
  18679. };
  18680. }
  18681. upload.emit('httpUploadProgress', [info]);
  18682. }
  18683. });
  18684. AWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor);
  18685. /**
  18686. * @api private
  18687. */
  18688. AWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) {
  18689. this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency);
  18690. };
  18691. /**
  18692. * @api private
  18693. */
  18694. AWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() {
  18695. delete this.prototype.promise;
  18696. };
  18697. AWS.util.addPromises(AWS.S3.ManagedUpload);
  18698. /**
  18699. * @api private
  18700. */
  18701. module.exports = AWS.S3.ManagedUpload;
  18702. /***/ }),
  18703. /***/ 861:
  18704. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  18705. var AWS = __webpack_require__(395);
  18706. var resolveRegionalEndpointsFlag = __webpack_require__(232);
  18707. var ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS';
  18708. var CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints';
  18709. AWS.util.update(AWS.STS.prototype, {
  18710. /**
  18711. * @overload credentialsFrom(data, credentials = null)
  18712. * Creates a credentials object from STS response data containing
  18713. * credentials information. Useful for quickly setting AWS credentials.
  18714. *
  18715. * @note This is a low-level utility function. If you want to load temporary
  18716. * credentials into your process for subsequent requests to AWS resources,
  18717. * you should use {AWS.TemporaryCredentials} instead.
  18718. * @param data [map] data retrieved from a call to {getFederatedToken},
  18719. * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}.
  18720. * @param credentials [AWS.Credentials] an optional credentials object to
  18721. * fill instead of creating a new object. Useful when modifying an
  18722. * existing credentials object from a refresh call.
  18723. * @return [AWS.TemporaryCredentials] the set of temporary credentials
  18724. * loaded from a raw STS operation response.
  18725. * @example Using credentialsFrom to load global AWS credentials
  18726. * var sts = new AWS.STS();
  18727. * sts.getSessionToken(function (err, data) {
  18728. * if (err) console.log("Error getting credentials");
  18729. * else {
  18730. * AWS.config.credentials = sts.credentialsFrom(data);
  18731. * }
  18732. * });
  18733. * @see AWS.TemporaryCredentials
  18734. */
  18735. credentialsFrom: function credentialsFrom(data, credentials) {
  18736. if (!data) return null;
  18737. if (!credentials) credentials = new AWS.TemporaryCredentials();
  18738. credentials.expired = false;
  18739. credentials.accessKeyId = data.Credentials.AccessKeyId;
  18740. credentials.secretAccessKey = data.Credentials.SecretAccessKey;
  18741. credentials.sessionToken = data.Credentials.SessionToken;
  18742. credentials.expireTime = data.Credentials.Expiration;
  18743. return credentials;
  18744. },
  18745. assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) {
  18746. return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback);
  18747. },
  18748. assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) {
  18749. return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback);
  18750. },
  18751. /**
  18752. * @api private
  18753. */
  18754. setupRequestListeners: function setupRequestListeners(request) {
  18755. request.addListener('validate', this.optInRegionalEndpoint, true);
  18756. },
  18757. /**
  18758. * @api private
  18759. */
  18760. optInRegionalEndpoint: function optInRegionalEndpoint(req) {
  18761. var service = req.service;
  18762. var config = service.config;
  18763. config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, {
  18764. env: ENV_REGIONAL_ENDPOINT_ENABLED,
  18765. sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED,
  18766. clientConfig: 'stsRegionalEndpoints'
  18767. });
  18768. if (
  18769. config.stsRegionalEndpoints === 'regional' &&
  18770. service.isGlobalEndpoint
  18771. ) {
  18772. //client will throw if region is not supplied; request will be signed with specified region
  18773. if (!config.region) {
  18774. throw AWS.util.error(new Error(),
  18775. {code: 'ConfigError', message: 'Missing region in config'});
  18776. }
  18777. var insertPoint = config.endpoint.indexOf('.amazonaws.com');
  18778. var regionalEndpoint = config.endpoint.substring(0, insertPoint) +
  18779. '.' + config.region + config.endpoint.substring(insertPoint);
  18780. req.httpRequest.updateEndpoint(regionalEndpoint);
  18781. req.httpRequest.region = config.region;
  18782. }
  18783. }
  18784. });
  18785. /***/ }),
  18786. /***/ 862:
  18787. /***/ (function(module, __unusedexports, __webpack_require__) {
  18788. var util = __webpack_require__(395).util;
  18789. var Transform = __webpack_require__(413).Transform;
  18790. var allocBuffer = util.buffer.alloc;
  18791. /** @type {Transform} */
  18792. function EventMessageChunkerStream(options) {
  18793. Transform.call(this, options);
  18794. this.currentMessageTotalLength = 0;
  18795. this.currentMessagePendingLength = 0;
  18796. /** @type {Buffer} */
  18797. this.currentMessage = null;
  18798. /** @type {Buffer} */
  18799. this.messageLengthBuffer = null;
  18800. }
  18801. EventMessageChunkerStream.prototype = Object.create(Transform.prototype);
  18802. /**
  18803. *
  18804. * @param {Buffer} chunk
  18805. * @param {string} encoding
  18806. * @param {*} callback
  18807. */
  18808. EventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) {
  18809. var chunkLength = chunk.length;
  18810. var currentOffset = 0;
  18811. while (currentOffset < chunkLength) {
  18812. // create new message if necessary
  18813. if (!this.currentMessage) {
  18814. // working on a new message, determine total length
  18815. var bytesRemaining = chunkLength - currentOffset;
  18816. // prevent edge case where total length spans 2 chunks
  18817. if (!this.messageLengthBuffer) {
  18818. this.messageLengthBuffer = allocBuffer(4);
  18819. }
  18820. var numBytesForTotal = Math.min(
  18821. 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer
  18822. bytesRemaining // bytes left in chunk
  18823. );
  18824. chunk.copy(
  18825. this.messageLengthBuffer,
  18826. this.currentMessagePendingLength,
  18827. currentOffset,
  18828. currentOffset + numBytesForTotal
  18829. );
  18830. this.currentMessagePendingLength += numBytesForTotal;
  18831. currentOffset += numBytesForTotal;
  18832. if (this.currentMessagePendingLength < 4) {
  18833. // not enough information to create the current message
  18834. break;
  18835. }
  18836. this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0));
  18837. this.messageLengthBuffer = null;
  18838. }
  18839. // write data into current message
  18840. var numBytesToWrite = Math.min(
  18841. this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message
  18842. chunkLength - currentOffset // number of bytes left in the original chunk
  18843. );
  18844. chunk.copy(
  18845. this.currentMessage, // target buffer
  18846. this.currentMessagePendingLength, // target offset
  18847. currentOffset, // chunk offset
  18848. currentOffset + numBytesToWrite // chunk end to write
  18849. );
  18850. this.currentMessagePendingLength += numBytesToWrite;
  18851. currentOffset += numBytesToWrite;
  18852. // check if a message is ready to be pushed
  18853. if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) {
  18854. // push out the message
  18855. this.push(this.currentMessage);
  18856. // cleanup
  18857. this.currentMessage = null;
  18858. this.currentMessageTotalLength = 0;
  18859. this.currentMessagePendingLength = 0;
  18860. }
  18861. }
  18862. callback();
  18863. };
  18864. EventMessageChunkerStream.prototype._flush = function(callback) {
  18865. if (this.currentMessageTotalLength) {
  18866. if (this.currentMessageTotalLength === this.currentMessagePendingLength) {
  18867. callback(null, this.currentMessage);
  18868. } else {
  18869. callback(new Error('Truncated event message received.'));
  18870. }
  18871. } else {
  18872. callback();
  18873. }
  18874. };
  18875. /**
  18876. * @param {number} size Size of the message to be allocated.
  18877. * @api private
  18878. */
  18879. EventMessageChunkerStream.prototype.allocateMessage = function(size) {
  18880. if (typeof size !== 'number') {
  18881. throw new Error('Attempted to allocate an event message where size was not a number: ' + size);
  18882. }
  18883. this.currentMessageTotalLength = size;
  18884. this.currentMessagePendingLength = 4;
  18885. this.currentMessage = allocBuffer(size);
  18886. this.currentMessage.writeUInt32BE(size, 0);
  18887. };
  18888. /**
  18889. * @api private
  18890. */
  18891. module.exports = {
  18892. EventMessageChunkerStream: EventMessageChunkerStream
  18893. };
  18894. /***/ }),
  18895. /***/ 868:
  18896. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  18897. var AWS = __webpack_require__(395);
  18898. var fs = __webpack_require__(747);
  18899. var STS = __webpack_require__(733);
  18900. var iniLoader = AWS.util.iniLoader;
  18901. /**
  18902. * Represents OIDC credentials from a file on disk
  18903. * If the credentials expire, the SDK can {refresh} the credentials
  18904. * from the file.
  18905. *
  18906. * ## Using the web identity token file
  18907. *
  18908. * This provider is checked by default in the Node.js environment. To use
  18909. * the provider simply add your OIDC token to a file (ASCII encoding) and
  18910. * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment
  18911. * variable or web_identity_token_file shared config variable
  18912. *
  18913. * The file contains encoded OIDC token and the characters are
  18914. * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT).
  18915. * JWT's are 3 base64 encoded strings joined by the '.' character.
  18916. *
  18917. * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE
  18918. * environment variable or web_identity_token_file shared config variable,
  18919. * and get the OIDC token from filename.
  18920. * It will also read IAM role to be assumed from AWS_ROLE_ARN
  18921. * environment variable or role_arn shared config variable.
  18922. * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity}
  18923. * service operation
  18924. *
  18925. * @!macro nobrowser
  18926. */
  18927. AWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {
  18928. /**
  18929. * @example Creating a new credentials object
  18930. * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials(
  18931. * // optionally provide configuration to apply to the underlying AWS.STS service client
  18932. * // if configuration is not provided, then configuration will be pulled from AWS.config
  18933. * {
  18934. * // specify timeout options
  18935. * httpOptions: {
  18936. * timeout: 100
  18937. * }
  18938. * });
  18939. * @see AWS.Config
  18940. */
  18941. constructor: function TokenFileWebIdentityCredentials(clientConfig) {
  18942. AWS.Credentials.call(this);
  18943. this.data = null;
  18944. this.clientConfig = AWS.util.copy(clientConfig || {});
  18945. },
  18946. /**
  18947. * Returns params from environment variables
  18948. *
  18949. * @api private
  18950. */
  18951. getParamsFromEnv: function getParamsFromEnv() {
  18952. var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE',
  18953. ENV_ROLE_ARN = 'AWS_ROLE_ARN';
  18954. if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) {
  18955. return [{
  18956. envTokenFile: process.env[ENV_TOKEN_FILE],
  18957. roleArn: process.env[ENV_ROLE_ARN],
  18958. roleSessionName: process.env['AWS_ROLE_SESSION_NAME']
  18959. }];
  18960. }
  18961. },
  18962. /**
  18963. * Returns params from shared config variables
  18964. *
  18965. * @api private
  18966. */
  18967. getParamsFromSharedConfig: function getParamsFromSharedConfig() {
  18968. var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader);
  18969. var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile;
  18970. var profile = profiles[profileName] || {};
  18971. if (Object.keys(profile).length === 0) {
  18972. throw AWS.util.error(
  18973. new Error('Profile ' + profileName + ' not found'),
  18974. { code: 'TokenFileWebIdentityCredentialsProviderFailure' }
  18975. );
  18976. }
  18977. var paramsArray = [];
  18978. while (!profile['web_identity_token_file'] && profile['source_profile']) {
  18979. paramsArray.unshift({
  18980. roleArn: profile['role_arn'],
  18981. roleSessionName: profile['role_session_name']
  18982. });
  18983. var sourceProfile = profile['source_profile'];
  18984. profile = profiles[sourceProfile];
  18985. }
  18986. paramsArray.unshift({
  18987. envTokenFile: profile['web_identity_token_file'],
  18988. roleArn: profile['role_arn'],
  18989. roleSessionName: profile['role_session_name']
  18990. });
  18991. return paramsArray;
  18992. },
  18993. /**
  18994. * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}
  18995. *
  18996. * @callback callback function(err)
  18997. * Called when the STS service responds (or fails). When
  18998. * this callback is called with no error, it means that the credentials
  18999. * information has been loaded into the object (as the `accessKeyId`,
  19000. * `secretAccessKey`, and `sessionToken` properties).
  19001. * @param err [Error] if an error occurred, this value will be filled
  19002. * @see AWS.Credentials.get
  19003. */
  19004. refresh: function refresh(callback) {
  19005. this.coalesceRefresh(callback || AWS.util.fn.callback);
  19006. },
  19007. /**
  19008. * @api private
  19009. */
  19010. assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) {
  19011. var self = this;
  19012. if (paramsArray.length === 0) {
  19013. self.service.credentialsFrom(self.data, self);
  19014. callback();
  19015. } else {
  19016. var params = paramsArray.shift();
  19017. self.service.config.credentials = self.service.credentialsFrom(self.data, self);
  19018. self.service.assumeRole(
  19019. {
  19020. RoleArn: params.roleArn,
  19021. RoleSessionName: params.roleSessionName || 'token-file-web-identity'
  19022. },
  19023. function (err, data) {
  19024. self.data = null;
  19025. if (err) {
  19026. callback(err);
  19027. } else {
  19028. self.data = data;
  19029. self.assumeRoleChaining(paramsArray, callback);
  19030. }
  19031. }
  19032. );
  19033. }
  19034. },
  19035. /**
  19036. * @api private
  19037. */
  19038. load: function load(callback) {
  19039. var self = this;
  19040. try {
  19041. var paramsArray = self.getParamsFromEnv();
  19042. if (!paramsArray) {
  19043. paramsArray = self.getParamsFromSharedConfig();
  19044. }
  19045. if (paramsArray) {
  19046. var params = paramsArray.shift();
  19047. var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'});
  19048. if (!self.service) {
  19049. self.createClients();
  19050. }
  19051. self.service.assumeRoleWithWebIdentity(
  19052. {
  19053. WebIdentityToken: oidcToken,
  19054. RoleArn: params.roleArn,
  19055. RoleSessionName: params.roleSessionName || 'token-file-web-identity'
  19056. },
  19057. function (err, data) {
  19058. self.data = null;
  19059. if (err) {
  19060. callback(err);
  19061. } else {
  19062. self.data = data;
  19063. self.assumeRoleChaining(paramsArray, callback);
  19064. }
  19065. }
  19066. );
  19067. }
  19068. } catch (err) {
  19069. callback(err);
  19070. }
  19071. },
  19072. /**
  19073. * @api private
  19074. */
  19075. createClients: function() {
  19076. if (!this.service) {
  19077. var stsConfig = AWS.util.merge({}, this.clientConfig);
  19078. this.service = new STS(stsConfig);
  19079. // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken
  19080. this.service.retryableError = function(error) {
  19081. if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') {
  19082. return true;
  19083. } else {
  19084. return AWS.Service.prototype.retryableError.call(this, error);
  19085. }
  19086. };
  19087. }
  19088. }
  19089. });
  19090. /***/ }),
  19091. /***/ 872:
  19092. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  19093. var AWS = __webpack_require__(395);
  19094. /**
  19095. * Represents credentials from the environment.
  19096. *
  19097. * By default, this class will look for the matching environment variables
  19098. * prefixed by a given {envPrefix}. The un-prefixed environment variable names
  19099. * for each credential value is listed below:
  19100. *
  19101. * ```javascript
  19102. * accessKeyId: ACCESS_KEY_ID
  19103. * secretAccessKey: SECRET_ACCESS_KEY
  19104. * sessionToken: SESSION_TOKEN
  19105. * ```
  19106. *
  19107. * With the default prefix of 'AWS', the environment variables would be:
  19108. *
  19109. * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
  19110. *
  19111. * @!attribute envPrefix
  19112. * @readonly
  19113. * @return [String] the prefix for the environment variable names excluding
  19114. * the separating underscore ('_').
  19115. */
  19116. AWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, {
  19117. /**
  19118. * Creates a new EnvironmentCredentials class with a given variable
  19119. * prefix {envPrefix}. For example, to load credentials using the 'AWS'
  19120. * prefix:
  19121. *
  19122. * ```javascript
  19123. * var creds = new AWS.EnvironmentCredentials('AWS');
  19124. * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var
  19125. * ```
  19126. *
  19127. * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment
  19128. * variables. Do not include the separating underscore.
  19129. */
  19130. constructor: function EnvironmentCredentials(envPrefix) {
  19131. AWS.Credentials.call(this);
  19132. this.envPrefix = envPrefix;
  19133. this.get(function() {});
  19134. },
  19135. /**
  19136. * Loads credentials from the environment using the prefixed
  19137. * environment variables.
  19138. *
  19139. * @callback callback function(err)
  19140. * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and
  19141. * SESSION_TOKEN environment variables are read. When this callback is
  19142. * called with no error, it means that the credentials information has
  19143. * been loaded into the object (as the `accessKeyId`, `secretAccessKey`,
  19144. * and `sessionToken` properties).
  19145. * @param err [Error] if an error occurred, this value will be filled
  19146. * @see get
  19147. */
  19148. refresh: function refresh(callback) {
  19149. if (!callback) callback = AWS.util.fn.callback;
  19150. if (!process || !process.env) {
  19151. callback(AWS.util.error(
  19152. new Error('No process info or environment variables available'),
  19153. { code: 'EnvironmentCredentialsProviderFailure' }
  19154. ));
  19155. return;
  19156. }
  19157. var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN'];
  19158. var values = [];
  19159. for (var i = 0; i < keys.length; i++) {
  19160. var prefix = '';
  19161. if (this.envPrefix) prefix = this.envPrefix + '_';
  19162. values[i] = process.env[prefix + keys[i]];
  19163. if (!values[i] && keys[i] !== 'SESSION_TOKEN') {
  19164. callback(AWS.util.error(
  19165. new Error('Variable ' + prefix + keys[i] + ' not set.'),
  19166. { code: 'EnvironmentCredentialsProviderFailure' }
  19167. ));
  19168. return;
  19169. }
  19170. }
  19171. this.expired = false;
  19172. AWS.Credentials.apply(this, values);
  19173. callback();
  19174. }
  19175. });
  19176. /***/ }),
  19177. /***/ 876:
  19178. /***/ (function(module) {
  19179. module.exports = require("http");
  19180. /***/ }),
  19181. /***/ 884:
  19182. /***/ (function(module) {
  19183. // Generated by CoffeeScript 1.12.7
  19184. (function() {
  19185. var XMLAttribute;
  19186. module.exports = XMLAttribute = (function() {
  19187. function XMLAttribute(parent, name, value) {
  19188. this.options = parent.options;
  19189. this.stringify = parent.stringify;
  19190. if (name == null) {
  19191. throw new Error("Missing attribute name of element " + parent.name);
  19192. }
  19193. if (value == null) {
  19194. throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
  19195. }
  19196. this.name = this.stringify.attName(name);
  19197. this.value = this.stringify.attValue(value);
  19198. }
  19199. XMLAttribute.prototype.clone = function() {
  19200. return Object.create(this);
  19201. };
  19202. XMLAttribute.prototype.toString = function(options) {
  19203. return this.options.writer.set(options).attribute(this);
  19204. };
  19205. return XMLAttribute;
  19206. })();
  19207. }).call(this);
  19208. /***/ }),
  19209. /***/ 885:
  19210. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  19211. // Generated by CoffeeScript 1.12.7
  19212. (function() {
  19213. "use strict";
  19214. var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate,
  19215. bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
  19216. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  19217. hasProp = {}.hasOwnProperty;
  19218. sax = __webpack_require__(645);
  19219. events = __webpack_require__(614);
  19220. bom = __webpack_require__(210);
  19221. processors = __webpack_require__(350);
  19222. setImmediate = __webpack_require__(213).setImmediate;
  19223. defaults = __webpack_require__(514).defaults;
  19224. isEmpty = function(thing) {
  19225. return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0;
  19226. };
  19227. processItem = function(processors, item, key) {
  19228. var i, len, process;
  19229. for (i = 0, len = processors.length; i < len; i++) {
  19230. process = processors[i];
  19231. item = process(item, key);
  19232. }
  19233. return item;
  19234. };
  19235. exports.Parser = (function(superClass) {
  19236. extend(Parser, superClass);
  19237. function Parser(opts) {
  19238. this.parseString = bind(this.parseString, this);
  19239. this.reset = bind(this.reset, this);
  19240. this.assignOrPush = bind(this.assignOrPush, this);
  19241. this.processAsync = bind(this.processAsync, this);
  19242. var key, ref, value;
  19243. if (!(this instanceof exports.Parser)) {
  19244. return new exports.Parser(opts);
  19245. }
  19246. this.options = {};
  19247. ref = defaults["0.2"];
  19248. for (key in ref) {
  19249. if (!hasProp.call(ref, key)) continue;
  19250. value = ref[key];
  19251. this.options[key] = value;
  19252. }
  19253. for (key in opts) {
  19254. if (!hasProp.call(opts, key)) continue;
  19255. value = opts[key];
  19256. this.options[key] = value;
  19257. }
  19258. if (this.options.xmlns) {
  19259. this.options.xmlnskey = this.options.attrkey + "ns";
  19260. }
  19261. if (this.options.normalizeTags) {
  19262. if (!this.options.tagNameProcessors) {
  19263. this.options.tagNameProcessors = [];
  19264. }
  19265. this.options.tagNameProcessors.unshift(processors.normalize);
  19266. }
  19267. this.reset();
  19268. }
  19269. Parser.prototype.processAsync = function() {
  19270. var chunk, err;
  19271. try {
  19272. if (this.remaining.length <= this.options.chunkSize) {
  19273. chunk = this.remaining;
  19274. this.remaining = '';
  19275. this.saxParser = this.saxParser.write(chunk);
  19276. return this.saxParser.close();
  19277. } else {
  19278. chunk = this.remaining.substr(0, this.options.chunkSize);
  19279. this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
  19280. this.saxParser = this.saxParser.write(chunk);
  19281. return setImmediate(this.processAsync);
  19282. }
  19283. } catch (error1) {
  19284. err = error1;
  19285. if (!this.saxParser.errThrown) {
  19286. this.saxParser.errThrown = true;
  19287. return this.emit(err);
  19288. }
  19289. }
  19290. };
  19291. Parser.prototype.assignOrPush = function(obj, key, newValue) {
  19292. if (!(key in obj)) {
  19293. if (!this.options.explicitArray) {
  19294. return obj[key] = newValue;
  19295. } else {
  19296. return obj[key] = [newValue];
  19297. }
  19298. } else {
  19299. if (!(obj[key] instanceof Array)) {
  19300. obj[key] = [obj[key]];
  19301. }
  19302. return obj[key].push(newValue);
  19303. }
  19304. };
  19305. Parser.prototype.reset = function() {
  19306. var attrkey, charkey, ontext, stack;
  19307. this.removeAllListeners();
  19308. this.saxParser = sax.parser(this.options.strict, {
  19309. trim: false,
  19310. normalize: false,
  19311. xmlns: this.options.xmlns
  19312. });
  19313. this.saxParser.errThrown = false;
  19314. this.saxParser.onerror = (function(_this) {
  19315. return function(error) {
  19316. _this.saxParser.resume();
  19317. if (!_this.saxParser.errThrown) {
  19318. _this.saxParser.errThrown = true;
  19319. return _this.emit("error", error);
  19320. }
  19321. };
  19322. })(this);
  19323. this.saxParser.onend = (function(_this) {
  19324. return function() {
  19325. if (!_this.saxParser.ended) {
  19326. _this.saxParser.ended = true;
  19327. return _this.emit("end", _this.resultObject);
  19328. }
  19329. };
  19330. })(this);
  19331. this.saxParser.ended = false;
  19332. this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
  19333. this.resultObject = null;
  19334. stack = [];
  19335. attrkey = this.options.attrkey;
  19336. charkey = this.options.charkey;
  19337. this.saxParser.onopentag = (function(_this) {
  19338. return function(node) {
  19339. var key, newValue, obj, processedKey, ref;
  19340. obj = {};
  19341. obj[charkey] = "";
  19342. if (!_this.options.ignoreAttrs) {
  19343. ref = node.attributes;
  19344. for (key in ref) {
  19345. if (!hasProp.call(ref, key)) continue;
  19346. if (!(attrkey in obj) && !_this.options.mergeAttrs) {
  19347. obj[attrkey] = {};
  19348. }
  19349. newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
  19350. processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
  19351. if (_this.options.mergeAttrs) {
  19352. _this.assignOrPush(obj, processedKey, newValue);
  19353. } else {
  19354. obj[attrkey][processedKey] = newValue;
  19355. }
  19356. }
  19357. }
  19358. obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
  19359. if (_this.options.xmlns) {
  19360. obj[_this.options.xmlnskey] = {
  19361. uri: node.uri,
  19362. local: node.local
  19363. };
  19364. }
  19365. return stack.push(obj);
  19366. };
  19367. })(this);
  19368. this.saxParser.onclosetag = (function(_this) {
  19369. return function() {
  19370. var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
  19371. obj = stack.pop();
  19372. nodeName = obj["#name"];
  19373. if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
  19374. delete obj["#name"];
  19375. }
  19376. if (obj.cdata === true) {
  19377. cdata = obj.cdata;
  19378. delete obj.cdata;
  19379. }
  19380. s = stack[stack.length - 1];
  19381. if (obj[charkey].match(/^\s*$/) && !cdata) {
  19382. emptyStr = obj[charkey];
  19383. delete obj[charkey];
  19384. } else {
  19385. if (_this.options.trim) {
  19386. obj[charkey] = obj[charkey].trim();
  19387. }
  19388. if (_this.options.normalize) {
  19389. obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
  19390. }
  19391. obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
  19392. if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
  19393. obj = obj[charkey];
  19394. }
  19395. }
  19396. if (isEmpty(obj)) {
  19397. obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
  19398. }
  19399. if (_this.options.validator != null) {
  19400. xpath = "/" + ((function() {
  19401. var i, len, results;
  19402. results = [];
  19403. for (i = 0, len = stack.length; i < len; i++) {
  19404. node = stack[i];
  19405. results.push(node["#name"]);
  19406. }
  19407. return results;
  19408. })()).concat(nodeName).join("/");
  19409. (function() {
  19410. var err;
  19411. try {
  19412. return obj = _this.options.validator(xpath, s && s[nodeName], obj);
  19413. } catch (error1) {
  19414. err = error1;
  19415. return _this.emit("error", err);
  19416. }
  19417. })();
  19418. }
  19419. if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
  19420. if (!_this.options.preserveChildrenOrder) {
  19421. node = {};
  19422. if (_this.options.attrkey in obj) {
  19423. node[_this.options.attrkey] = obj[_this.options.attrkey];
  19424. delete obj[_this.options.attrkey];
  19425. }
  19426. if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
  19427. node[_this.options.charkey] = obj[_this.options.charkey];
  19428. delete obj[_this.options.charkey];
  19429. }
  19430. if (Object.getOwnPropertyNames(obj).length > 0) {
  19431. node[_this.options.childkey] = obj;
  19432. }
  19433. obj = node;
  19434. } else if (s) {
  19435. s[_this.options.childkey] = s[_this.options.childkey] || [];
  19436. objClone = {};
  19437. for (key in obj) {
  19438. if (!hasProp.call(obj, key)) continue;
  19439. objClone[key] = obj[key];
  19440. }
  19441. s[_this.options.childkey].push(objClone);
  19442. delete obj["#name"];
  19443. if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
  19444. obj = obj[charkey];
  19445. }
  19446. }
  19447. }
  19448. if (stack.length > 0) {
  19449. return _this.assignOrPush(s, nodeName, obj);
  19450. } else {
  19451. if (_this.options.explicitRoot) {
  19452. old = obj;
  19453. obj = {};
  19454. obj[nodeName] = old;
  19455. }
  19456. _this.resultObject = obj;
  19457. _this.saxParser.ended = true;
  19458. return _this.emit("end", _this.resultObject);
  19459. }
  19460. };
  19461. })(this);
  19462. ontext = (function(_this) {
  19463. return function(text) {
  19464. var charChild, s;
  19465. s = stack[stack.length - 1];
  19466. if (s) {
  19467. s[charkey] += text;
  19468. if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) {
  19469. s[_this.options.childkey] = s[_this.options.childkey] || [];
  19470. charChild = {
  19471. '#name': '__text__'
  19472. };
  19473. charChild[charkey] = text;
  19474. if (_this.options.normalize) {
  19475. charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
  19476. }
  19477. s[_this.options.childkey].push(charChild);
  19478. }
  19479. return s;
  19480. }
  19481. };
  19482. })(this);
  19483. this.saxParser.ontext = ontext;
  19484. return this.saxParser.oncdata = (function(_this) {
  19485. return function(text) {
  19486. var s;
  19487. s = ontext(text);
  19488. if (s) {
  19489. return s.cdata = true;
  19490. }
  19491. };
  19492. })(this);
  19493. };
  19494. Parser.prototype.parseString = function(str, cb) {
  19495. var err;
  19496. if ((cb != null) && typeof cb === "function") {
  19497. this.on("end", function(result) {
  19498. this.reset();
  19499. return cb(null, result);
  19500. });
  19501. this.on("error", function(err) {
  19502. this.reset();
  19503. return cb(err);
  19504. });
  19505. }
  19506. try {
  19507. str = str.toString();
  19508. if (str.trim() === '') {
  19509. this.emit("end", null);
  19510. return true;
  19511. }
  19512. str = bom.stripBOM(str);
  19513. if (this.options.async) {
  19514. this.remaining = str;
  19515. setImmediate(this.processAsync);
  19516. return this.saxParser;
  19517. }
  19518. return this.saxParser.write(str).close();
  19519. } catch (error1) {
  19520. err = error1;
  19521. if (!(this.saxParser.errThrown || this.saxParser.ended)) {
  19522. this.emit('error', err);
  19523. return this.saxParser.errThrown = true;
  19524. } else if (this.saxParser.ended) {
  19525. throw err;
  19526. }
  19527. }
  19528. };
  19529. return Parser;
  19530. })(events.EventEmitter);
  19531. exports.parseString = function(str, a, b) {
  19532. var cb, options, parser;
  19533. if (b != null) {
  19534. if (typeof b === 'function') {
  19535. cb = b;
  19536. }
  19537. if (typeof a === 'object') {
  19538. options = a;
  19539. }
  19540. } else {
  19541. if (typeof a === 'function') {
  19542. cb = a;
  19543. }
  19544. options = {};
  19545. }
  19546. parser = new exports.Parser(options);
  19547. return parser.parseString(str, cb);
  19548. };
  19549. }).call(this);
  19550. /***/ }),
  19551. /***/ 888:
  19552. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  19553. var AWS = __webpack_require__(395);
  19554. var Stream = AWS.util.stream.Stream;
  19555. var TransformStream = AWS.util.stream.Transform;
  19556. var ReadableStream = AWS.util.stream.Readable;
  19557. __webpack_require__(711);
  19558. var CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED';
  19559. /**
  19560. * @api private
  19561. */
  19562. AWS.NodeHttpClient = AWS.util.inherit({
  19563. handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) {
  19564. var self = this;
  19565. var endpoint = httpRequest.endpoint;
  19566. var pathPrefix = '';
  19567. if (!httpOptions) httpOptions = {};
  19568. if (httpOptions.proxy) {
  19569. pathPrefix = endpoint.protocol + '//' + endpoint.hostname;
  19570. if (endpoint.port !== 80 && endpoint.port !== 443) {
  19571. pathPrefix += ':' + endpoint.port;
  19572. }
  19573. endpoint = new AWS.Endpoint(httpOptions.proxy);
  19574. }
  19575. var useSSL = endpoint.protocol === 'https:';
  19576. var http = useSSL ? __webpack_require__(211) : __webpack_require__(876);
  19577. var options = {
  19578. host: endpoint.hostname,
  19579. port: endpoint.port,
  19580. method: httpRequest.method,
  19581. headers: httpRequest.headers,
  19582. path: pathPrefix + httpRequest.path
  19583. };
  19584. if (!httpOptions.agent) {
  19585. options.agent = this.getAgent(useSSL, {
  19586. keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false
  19587. });
  19588. }
  19589. AWS.util.update(options, httpOptions);
  19590. delete options.proxy; // proxy isn't an HTTP option
  19591. delete options.timeout; // timeout isn't an HTTP option
  19592. var stream = http.request(options, function (httpResp) {
  19593. if (stream.didCallback) return;
  19594. callback(httpResp);
  19595. httpResp.emit(
  19596. 'headers',
  19597. httpResp.statusCode,
  19598. httpResp.headers,
  19599. httpResp.statusMessage
  19600. );
  19601. });
  19602. httpRequest.stream = stream; // attach stream to httpRequest
  19603. stream.didCallback = false;
  19604. // connection timeout support
  19605. if (httpOptions.connectTimeout) {
  19606. var connectTimeoutId;
  19607. stream.on('socket', function(socket) {
  19608. if (socket.connecting) {
  19609. connectTimeoutId = setTimeout(function connectTimeout() {
  19610. if (stream.didCallback) return; stream.didCallback = true;
  19611. stream.abort();
  19612. errCallback(AWS.util.error(
  19613. new Error('Socket timed out without establishing a connection'),
  19614. {code: 'TimeoutError'}
  19615. ));
  19616. }, httpOptions.connectTimeout);
  19617. socket.on('connect', function() {
  19618. clearTimeout(connectTimeoutId);
  19619. connectTimeoutId = null;
  19620. });
  19621. }
  19622. });
  19623. }
  19624. // timeout support
  19625. stream.setTimeout(httpOptions.timeout || 0, function() {
  19626. if (stream.didCallback) return; stream.didCallback = true;
  19627. var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms';
  19628. errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'}));
  19629. stream.abort();
  19630. });
  19631. stream.on('error', function() {
  19632. if (connectTimeoutId) {
  19633. clearTimeout(connectTimeoutId);
  19634. connectTimeoutId = null;
  19635. }
  19636. if (stream.didCallback) return; stream.didCallback = true;
  19637. errCallback.apply(stream, arguments);
  19638. });
  19639. var expect = httpRequest.headers.Expect || httpRequest.headers.expect;
  19640. if (expect === '100-continue') {
  19641. stream.on('continue', function() {
  19642. self.writeBody(stream, httpRequest);
  19643. });
  19644. } else {
  19645. this.writeBody(stream, httpRequest);
  19646. }
  19647. return stream;
  19648. },
  19649. writeBody: function writeBody(stream, httpRequest) {
  19650. var body = httpRequest.body;
  19651. var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10);
  19652. if (body instanceof Stream) {
  19653. // For progress support of streaming content -
  19654. // pipe the data through a transform stream to emit 'sendProgress' events
  19655. var progressStream = this.progressStream(stream, totalBytes);
  19656. if (progressStream) {
  19657. body.pipe(progressStream).pipe(stream);
  19658. } else {
  19659. body.pipe(stream);
  19660. }
  19661. } else if (body) {
  19662. // The provided body is a buffer/string and is already fully available in memory -
  19663. // For performance it's best to send it as a whole by calling stream.end(body),
  19664. // Callers expect a 'sendProgress' event which is best emitted once
  19665. // the http request stream has been fully written and all data flushed.
  19666. // The use of totalBytes is important over body.length for strings where
  19667. // length is char length and not byte length.
  19668. stream.once('finish', function() {
  19669. stream.emit('sendProgress', {
  19670. loaded: totalBytes,
  19671. total: totalBytes
  19672. });
  19673. });
  19674. stream.end(body);
  19675. } else {
  19676. // no request body
  19677. stream.end();
  19678. }
  19679. },
  19680. /**
  19681. * Create the https.Agent or http.Agent according to the request schema.
  19682. */
  19683. getAgent: function getAgent(useSSL, agentOptions) {
  19684. var http = useSSL ? __webpack_require__(211) : __webpack_require__(876);
  19685. if (useSSL) {
  19686. if (!AWS.NodeHttpClient.sslAgent) {
  19687. AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({
  19688. rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true
  19689. }, agentOptions || {}));
  19690. AWS.NodeHttpClient.sslAgent.setMaxListeners(0);
  19691. // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity.
  19692. // Users can bypass this default by supplying their own Agent as part of SDK configuration.
  19693. Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', {
  19694. enumerable: true,
  19695. get: function() {
  19696. var defaultMaxSockets = 50;
  19697. var globalAgent = http.globalAgent;
  19698. if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') {
  19699. return globalAgent.maxSockets;
  19700. }
  19701. return defaultMaxSockets;
  19702. }
  19703. });
  19704. }
  19705. return AWS.NodeHttpClient.sslAgent;
  19706. } else {
  19707. if (!AWS.NodeHttpClient.agent) {
  19708. AWS.NodeHttpClient.agent = new http.Agent(agentOptions);
  19709. }
  19710. return AWS.NodeHttpClient.agent;
  19711. }
  19712. },
  19713. progressStream: function progressStream(stream, totalBytes) {
  19714. if (typeof TransformStream === 'undefined') {
  19715. // for node 0.8 there is no streaming progress
  19716. return;
  19717. }
  19718. var loadedBytes = 0;
  19719. var reporter = new TransformStream();
  19720. reporter._transform = function(chunk, encoding, callback) {
  19721. if (chunk) {
  19722. loadedBytes += chunk.length;
  19723. stream.emit('sendProgress', {
  19724. loaded: loadedBytes,
  19725. total: totalBytes
  19726. });
  19727. }
  19728. callback(null, chunk);
  19729. };
  19730. return reporter;
  19731. },
  19732. emitter: null
  19733. });
  19734. /**
  19735. * @!ignore
  19736. */
  19737. /**
  19738. * @api private
  19739. */
  19740. AWS.HttpClient.prototype = AWS.NodeHttpClient.prototype;
  19741. /**
  19742. * @api private
  19743. */
  19744. AWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1;
  19745. /***/ }),
  19746. /***/ 892:
  19747. /***/ (function(module, __unusedexports, __webpack_require__) {
  19748. var IniLoader = __webpack_require__(818).IniLoader;
  19749. /**
  19750. * Singleton object to load specified config/credentials files.
  19751. * It will cache all the files ever loaded;
  19752. */
  19753. module.exports.iniLoader = new IniLoader();
  19754. /***/ }),
  19755. /***/ 897:
  19756. /***/ (function(module) {
  19757. module.exports = {"version":"2.0","metadata":{"apiVersion":"2006-03-01","checksumFormat":"md5","endpointPrefix":"s3","globalEndpoint":"s3.amazonaws.com","protocol":"rest-xml","serviceAbbreviation":"Amazon S3","serviceFullName":"Amazon Simple Storage Service","serviceId":"S3","signatureVersion":"s3","uid":"s3-2006-03-01"},"operations":{"AbortMultipartUpload":{"http":{"method":"DELETE","requestUri":"/{Bucket}/{Key+}","responseCode":204},"input":{"type":"structure","required":["Bucket","Key","UploadId"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"UploadId":{"location":"querystring","locationName":"uploadId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"CompleteMultipartUpload":{"http":{"requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","Key","UploadId"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"MultipartUpload":{"locationName":"CompleteMultipartUpload","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"Parts":{"locationName":"Part","type":"list","member":{"type":"structure","members":{"ETag":{},"PartNumber":{"type":"integer"}}},"flattened":true}}},"UploadId":{"location":"querystring","locationName":"uploadId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"MultipartUpload"},"output":{"type":"structure","members":{"Location":{},"Bucket":{},"Key":{},"Expiration":{"location":"header","locationName":"x-amz-expiration"},"ETag":{},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"VersionId":{"location":"header","locationName":"x-amz-version-id"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"CopyObject":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","CopySource","Key"],"members":{"ACL":{"location":"header","locationName":"x-amz-acl"},"Bucket":{"location":"uri","locationName":"Bucket"},"CacheControl":{"location":"header","locationName":"Cache-Control"},"ContentDisposition":{"location":"header","locationName":"Content-Disposition"},"ContentEncoding":{"location":"header","locationName":"Content-Encoding"},"ContentLanguage":{"location":"header","locationName":"Content-Language"},"ContentType":{"location":"header","locationName":"Content-Type"},"CopySource":{"location":"header","locationName":"x-amz-copy-source"},"CopySourceIfMatch":{"location":"header","locationName":"x-amz-copy-source-if-match"},"CopySourceIfModifiedSince":{"location":"header","locationName":"x-amz-copy-source-if-modified-since","type":"timestamp"},"CopySourceIfNoneMatch":{"location":"header","locationName":"x-amz-copy-source-if-none-match"},"CopySourceIfUnmodifiedSince":{"location":"header","locationName":"x-amz-copy-source-if-unmodified-since","type":"timestamp"},"Expires":{"location":"header","locationName":"Expires","type":"timestamp"},"GrantFullControl":{"location":"header","locationName":"x-amz-grant-full-control"},"GrantRead":{"location":"header","locationName":"x-amz-grant-read"},"GrantReadACP":{"location":"header","locationName":"x-amz-grant-read-acp"},"GrantWriteACP":{"location":"header","locationName":"x-amz-grant-write-acp"},"Key":{"location":"uri","locationName":"Key"},"Metadata":{"shape":"S13","location":"headers","locationName":"x-amz-meta-"},"MetadataDirective":{"location":"header","locationName":"x-amz-metadata-directive"},"TaggingDirective":{"location":"header","locationName":"x-amz-tagging-directive"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"StorageClass":{"location":"header","locationName":"x-amz-storage-class"},"WebsiteRedirectLocation":{"location":"header","locationName":"x-amz-website-redirect-location"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"SSEKMSEncryptionContext":{"shape":"S1d","location":"header","locationName":"x-amz-server-side-encryption-context"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"CopySourceSSECustomerAlgorithm":{"location":"header","locationName":"x-amz-copy-source-server-side-encryption-customer-algorithm"},"CopySourceSSECustomerKey":{"shape":"S1f","location":"header","locationName":"x-amz-copy-source-server-side-encryption-customer-key"},"CopySourceSSECustomerKeyMD5":{"location":"header","locationName":"x-amz-copy-source-server-side-encryption-customer-key-MD5"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"Tagging":{"location":"header","locationName":"x-amz-tagging"},"ObjectLockMode":{"location":"header","locationName":"x-amz-object-lock-mode"},"ObjectLockRetainUntilDate":{"shape":"S1j","location":"header","locationName":"x-amz-object-lock-retain-until-date"},"ObjectLockLegalHoldStatus":{"location":"header","locationName":"x-amz-object-lock-legal-hold"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"},"ExpectedSourceBucketOwner":{"location":"header","locationName":"x-amz-source-expected-bucket-owner"}}},"output":{"type":"structure","members":{"CopyObjectResult":{"type":"structure","members":{"ETag":{},"LastModified":{"type":"timestamp"}}},"Expiration":{"location":"header","locationName":"x-amz-expiration"},"CopySourceVersionId":{"location":"header","locationName":"x-amz-copy-source-version-id"},"VersionId":{"location":"header","locationName":"x-amz-version-id"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"SSEKMSEncryptionContext":{"shape":"S1d","location":"header","locationName":"x-amz-server-side-encryption-context"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}},"payload":"CopyObjectResult"},"alias":"PutObjectCopy"},"CreateBucket":{"http":{"method":"PUT","requestUri":"/{Bucket}"},"input":{"type":"structure","required":["Bucket"],"members":{"ACL":{"location":"header","locationName":"x-amz-acl"},"Bucket":{"location":"uri","locationName":"Bucket"},"CreateBucketConfiguration":{"locationName":"CreateBucketConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"LocationConstraint":{}}},"GrantFullControl":{"location":"header","locationName":"x-amz-grant-full-control"},"GrantRead":{"location":"header","locationName":"x-amz-grant-read"},"GrantReadACP":{"location":"header","locationName":"x-amz-grant-read-acp"},"GrantWrite":{"location":"header","locationName":"x-amz-grant-write"},"GrantWriteACP":{"location":"header","locationName":"x-amz-grant-write-acp"},"ObjectLockEnabledForBucket":{"location":"header","locationName":"x-amz-bucket-object-lock-enabled","type":"boolean"}},"payload":"CreateBucketConfiguration"},"output":{"type":"structure","members":{"Location":{"location":"header","locationName":"Location"}}},"alias":"PutBucket"},"CreateMultipartUpload":{"http":{"requestUri":"/{Bucket}/{Key+}?uploads"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"ACL":{"location":"header","locationName":"x-amz-acl"},"Bucket":{"location":"uri","locationName":"Bucket"},"CacheControl":{"location":"header","locationName":"Cache-Control"},"ContentDisposition":{"location":"header","locationName":"Content-Disposition"},"ContentEncoding":{"location":"header","locationName":"Content-Encoding"},"ContentLanguage":{"location":"header","locationName":"Content-Language"},"ContentType":{"location":"header","locationName":"Content-Type"},"Expires":{"location":"header","locationName":"Expires","type":"timestamp"},"GrantFullControl":{"location":"header","locationName":"x-amz-grant-full-control"},"GrantRead":{"location":"header","locationName":"x-amz-grant-read"},"GrantReadACP":{"location":"header","locationName":"x-amz-grant-read-acp"},"GrantWriteACP":{"location":"header","locationName":"x-amz-grant-write-acp"},"Key":{"location":"uri","locationName":"Key"},"Metadata":{"shape":"S13","location":"headers","locationName":"x-amz-meta-"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"StorageClass":{"location":"header","locationName":"x-amz-storage-class"},"WebsiteRedirectLocation":{"location":"header","locationName":"x-amz-website-redirect-location"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"SSEKMSEncryptionContext":{"shape":"S1d","location":"header","locationName":"x-amz-server-side-encryption-context"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"Tagging":{"location":"header","locationName":"x-amz-tagging"},"ObjectLockMode":{"location":"header","locationName":"x-amz-object-lock-mode"},"ObjectLockRetainUntilDate":{"shape":"S1j","location":"header","locationName":"x-amz-object-lock-retain-until-date"},"ObjectLockLegalHoldStatus":{"location":"header","locationName":"x-amz-object-lock-legal-hold"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"AbortDate":{"location":"header","locationName":"x-amz-abort-date","type":"timestamp"},"AbortRuleId":{"location":"header","locationName":"x-amz-abort-rule-id"},"Bucket":{"locationName":"Bucket"},"Key":{},"UploadId":{},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"SSEKMSEncryptionContext":{"shape":"S1d","location":"header","locationName":"x-amz-server-side-encryption-context"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}},"alias":"InitiateMultipartUpload"},"DeleteBucket":{"http":{"method":"DELETE","requestUri":"/{Bucket}","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketAnalyticsConfiguration":{"http":{"method":"DELETE","requestUri":"/{Bucket}?analytics","responseCode":204},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketCors":{"http":{"method":"DELETE","requestUri":"/{Bucket}?cors","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketEncryption":{"http":{"method":"DELETE","requestUri":"/{Bucket}?encryption","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketIntelligentTieringConfiguration":{"http":{"method":"DELETE","requestUri":"/{Bucket}?intelligent-tiering","responseCode":204},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"}}}},"DeleteBucketInventoryConfiguration":{"http":{"method":"DELETE","requestUri":"/{Bucket}?inventory","responseCode":204},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketLifecycle":{"http":{"method":"DELETE","requestUri":"/{Bucket}?lifecycle","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketMetricsConfiguration":{"http":{"method":"DELETE","requestUri":"/{Bucket}?metrics","responseCode":204},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketOwnershipControls":{"http":{"method":"DELETE","requestUri":"/{Bucket}?ownershipControls","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketPolicy":{"http":{"method":"DELETE","requestUri":"/{Bucket}?policy","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketReplication":{"http":{"method":"DELETE","requestUri":"/{Bucket}?replication","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketTagging":{"http":{"method":"DELETE","requestUri":"/{Bucket}?tagging","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteBucketWebsite":{"http":{"method":"DELETE","requestUri":"/{Bucket}?website","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"DeleteObject":{"http":{"method":"DELETE","requestUri":"/{Bucket}/{Key+}","responseCode":204},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"MFA":{"location":"header","locationName":"x-amz-mfa"},"VersionId":{"location":"querystring","locationName":"versionId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"BypassGovernanceRetention":{"location":"header","locationName":"x-amz-bypass-governance-retention","type":"boolean"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"DeleteMarker":{"location":"header","locationName":"x-amz-delete-marker","type":"boolean"},"VersionId":{"location":"header","locationName":"x-amz-version-id"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"DeleteObjectTagging":{"http":{"method":"DELETE","requestUri":"/{Bucket}/{Key+}?tagging","responseCode":204},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"VersionId":{"location":"header","locationName":"x-amz-version-id"}}}},"DeleteObjects":{"http":{"requestUri":"/{Bucket}?delete"},"input":{"type":"structure","required":["Bucket","Delete"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Delete":{"locationName":"Delete","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","required":["Objects"],"members":{"Objects":{"locationName":"Object","type":"list","member":{"type":"structure","required":["Key"],"members":{"Key":{},"VersionId":{}}},"flattened":true},"Quiet":{"type":"boolean"}}},"MFA":{"location":"header","locationName":"x-amz-mfa"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"BypassGovernanceRetention":{"location":"header","locationName":"x-amz-bypass-governance-retention","type":"boolean"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Delete"},"output":{"type":"structure","members":{"Deleted":{"type":"list","member":{"type":"structure","members":{"Key":{},"VersionId":{},"DeleteMarker":{"type":"boolean"},"DeleteMarkerVersionId":{}}},"flattened":true},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"},"Errors":{"locationName":"Error","type":"list","member":{"type":"structure","members":{"Key":{},"VersionId":{},"Code":{},"Message":{}}},"flattened":true}}},"alias":"DeleteMultipleObjects","httpChecksumRequired":true},"DeletePublicAccessBlock":{"http":{"method":"DELETE","requestUri":"/{Bucket}?publicAccessBlock","responseCode":204},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"GetBucketAccelerateConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?accelerate"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Status":{}}}},"GetBucketAcl":{"http":{"method":"GET","requestUri":"/{Bucket}?acl"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Owner":{"shape":"S37"},"Grants":{"shape":"S3a","locationName":"AccessControlList"}}}},"GetBucketAnalyticsConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?analytics"},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"AnalyticsConfiguration":{"shape":"S3j"}},"payload":"AnalyticsConfiguration"}},"GetBucketCors":{"http":{"method":"GET","requestUri":"/{Bucket}?cors"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"CORSRules":{"shape":"S3y","locationName":"CORSRule"}}}},"GetBucketEncryption":{"http":{"method":"GET","requestUri":"/{Bucket}?encryption"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"ServerSideEncryptionConfiguration":{"shape":"S4b"}},"payload":"ServerSideEncryptionConfiguration"}},"GetBucketIntelligentTieringConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?intelligent-tiering"},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"}}},"output":{"type":"structure","members":{"IntelligentTieringConfiguration":{"shape":"S4h"}},"payload":"IntelligentTieringConfiguration"}},"GetBucketInventoryConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?inventory"},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"InventoryConfiguration":{"shape":"S4r"}},"payload":"InventoryConfiguration"}},"GetBucketLifecycle":{"http":{"method":"GET","requestUri":"/{Bucket}?lifecycle"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Rules":{"shape":"S57","locationName":"Rule"}}},"deprecated":true},"GetBucketLifecycleConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?lifecycle"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Rules":{"shape":"S5m","locationName":"Rule"}}}},"GetBucketLocation":{"http":{"method":"GET","requestUri":"/{Bucket}?location"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"LocationConstraint":{}}}},"GetBucketLogging":{"http":{"method":"GET","requestUri":"/{Bucket}?logging"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"LoggingEnabled":{"shape":"S5w"}}}},"GetBucketMetricsConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?metrics"},"input":{"type":"structure","required":["Bucket","Id"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"MetricsConfiguration":{"shape":"S64"}},"payload":"MetricsConfiguration"}},"GetBucketNotification":{"http":{"method":"GET","requestUri":"/{Bucket}?notification"},"input":{"shape":"S67"},"output":{"shape":"S68"},"deprecated":true},"GetBucketNotificationConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?notification"},"input":{"shape":"S67"},"output":{"shape":"S6j"}},"GetBucketOwnershipControls":{"http":{"method":"GET","requestUri":"/{Bucket}?ownershipControls"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"OwnershipControls":{"shape":"S6z"}},"payload":"OwnershipControls"}},"GetBucketPolicy":{"http":{"method":"GET","requestUri":"/{Bucket}?policy"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Policy":{}},"payload":"Policy"}},"GetBucketPolicyStatus":{"http":{"method":"GET","requestUri":"/{Bucket}?policyStatus"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"PolicyStatus":{"type":"structure","members":{"IsPublic":{"locationName":"IsPublic","type":"boolean"}}}},"payload":"PolicyStatus"}},"GetBucketReplication":{"http":{"method":"GET","requestUri":"/{Bucket}?replication"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"ReplicationConfiguration":{"shape":"S7c"}},"payload":"ReplicationConfiguration"}},"GetBucketRequestPayment":{"http":{"method":"GET","requestUri":"/{Bucket}?requestPayment"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Payer":{}}}},"GetBucketTagging":{"http":{"method":"GET","requestUri":"/{Bucket}?tagging"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","required":["TagSet"],"members":{"TagSet":{"shape":"S3p"}}}},"GetBucketVersioning":{"http":{"method":"GET","requestUri":"/{Bucket}?versioning"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Status":{},"MFADelete":{"locationName":"MfaDelete"}}}},"GetBucketWebsite":{"http":{"method":"GET","requestUri":"/{Bucket}?website"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"RedirectAllRequestsTo":{"shape":"S8f"},"IndexDocument":{"shape":"S8i"},"ErrorDocument":{"shape":"S8k"},"RoutingRules":{"shape":"S8l"}}}},"GetObject":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"IfMatch":{"location":"header","locationName":"If-Match"},"IfModifiedSince":{"location":"header","locationName":"If-Modified-Since","type":"timestamp"},"IfNoneMatch":{"location":"header","locationName":"If-None-Match"},"IfUnmodifiedSince":{"location":"header","locationName":"If-Unmodified-Since","type":"timestamp"},"Key":{"location":"uri","locationName":"Key"},"Range":{"location":"header","locationName":"Range"},"ResponseCacheControl":{"location":"querystring","locationName":"response-cache-control"},"ResponseContentDisposition":{"location":"querystring","locationName":"response-content-disposition"},"ResponseContentEncoding":{"location":"querystring","locationName":"response-content-encoding"},"ResponseContentLanguage":{"location":"querystring","locationName":"response-content-language"},"ResponseContentType":{"location":"querystring","locationName":"response-content-type"},"ResponseExpires":{"location":"querystring","locationName":"response-expires","type":"timestamp"},"VersionId":{"location":"querystring","locationName":"versionId"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"PartNumber":{"location":"querystring","locationName":"partNumber","type":"integer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Body":{"streaming":true,"type":"blob"},"DeleteMarker":{"location":"header","locationName":"x-amz-delete-marker","type":"boolean"},"AcceptRanges":{"location":"header","locationName":"accept-ranges"},"Expiration":{"location":"header","locationName":"x-amz-expiration"},"Restore":{"location":"header","locationName":"x-amz-restore"},"LastModified":{"location":"header","locationName":"Last-Modified","type":"timestamp"},"ContentLength":{"location":"header","locationName":"Content-Length","type":"long"},"ETag":{"location":"header","locationName":"ETag"},"MissingMeta":{"location":"header","locationName":"x-amz-missing-meta","type":"integer"},"VersionId":{"location":"header","locationName":"x-amz-version-id"},"CacheControl":{"location":"header","locationName":"Cache-Control"},"ContentDisposition":{"location":"header","locationName":"Content-Disposition"},"ContentEncoding":{"location":"header","locationName":"Content-Encoding"},"ContentLanguage":{"location":"header","locationName":"Content-Language"},"ContentRange":{"location":"header","locationName":"Content-Range"},"ContentType":{"location":"header","locationName":"Content-Type"},"Expires":{"location":"header","locationName":"Expires","type":"timestamp"},"WebsiteRedirectLocation":{"location":"header","locationName":"x-amz-website-redirect-location"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"Metadata":{"shape":"S13","location":"headers","locationName":"x-amz-meta-"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"StorageClass":{"location":"header","locationName":"x-amz-storage-class"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"},"ReplicationStatus":{"location":"header","locationName":"x-amz-replication-status"},"PartsCount":{"location":"header","locationName":"x-amz-mp-parts-count","type":"integer"},"TagCount":{"location":"header","locationName":"x-amz-tagging-count","type":"integer"},"ObjectLockMode":{"location":"header","locationName":"x-amz-object-lock-mode"},"ObjectLockRetainUntilDate":{"shape":"S1j","location":"header","locationName":"x-amz-object-lock-retain-until-date"},"ObjectLockLegalHoldStatus":{"location":"header","locationName":"x-amz-object-lock-legal-hold"}},"payload":"Body"}},"GetObjectAcl":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}?acl"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Owner":{"shape":"S37"},"Grants":{"shape":"S3a","locationName":"AccessControlList"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"GetObjectLegalHold":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}?legal-hold"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"LegalHold":{"shape":"S9k"}},"payload":"LegalHold"}},"GetObjectLockConfiguration":{"http":{"method":"GET","requestUri":"/{Bucket}?object-lock"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"ObjectLockConfiguration":{"shape":"S9n"}},"payload":"ObjectLockConfiguration"}},"GetObjectRetention":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}?retention"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Retention":{"shape":"S9v"}},"payload":"Retention"}},"GetObjectTagging":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}?tagging"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","required":["TagSet"],"members":{"VersionId":{"location":"header","locationName":"x-amz-version-id"},"TagSet":{"shape":"S3p"}}}},"GetObjectTorrent":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}?torrent"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Body":{"streaming":true,"type":"blob"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}},"payload":"Body"}},"GetPublicAccessBlock":{"http":{"method":"GET","requestUri":"/{Bucket}?publicAccessBlock"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"PublicAccessBlockConfiguration":{"shape":"Sa2"}},"payload":"PublicAccessBlockConfiguration"}},"HeadBucket":{"http":{"method":"HEAD","requestUri":"/{Bucket}"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}}},"HeadObject":{"http":{"method":"HEAD","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"IfMatch":{"location":"header","locationName":"If-Match"},"IfModifiedSince":{"location":"header","locationName":"If-Modified-Since","type":"timestamp"},"IfNoneMatch":{"location":"header","locationName":"If-None-Match"},"IfUnmodifiedSince":{"location":"header","locationName":"If-Unmodified-Since","type":"timestamp"},"Key":{"location":"uri","locationName":"Key"},"Range":{"location":"header","locationName":"Range"},"VersionId":{"location":"querystring","locationName":"versionId"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"PartNumber":{"location":"querystring","locationName":"partNumber","type":"integer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"DeleteMarker":{"location":"header","locationName":"x-amz-delete-marker","type":"boolean"},"AcceptRanges":{"location":"header","locationName":"accept-ranges"},"Expiration":{"location":"header","locationName":"x-amz-expiration"},"Restore":{"location":"header","locationName":"x-amz-restore"},"ArchiveStatus":{"location":"header","locationName":"x-amz-archive-status"},"LastModified":{"location":"header","locationName":"Last-Modified","type":"timestamp"},"ContentLength":{"location":"header","locationName":"Content-Length","type":"long"},"ETag":{"location":"header","locationName":"ETag"},"MissingMeta":{"location":"header","locationName":"x-amz-missing-meta","type":"integer"},"VersionId":{"location":"header","locationName":"x-amz-version-id"},"CacheControl":{"location":"header","locationName":"Cache-Control"},"ContentDisposition":{"location":"header","locationName":"Content-Disposition"},"ContentEncoding":{"location":"header","locationName":"Content-Encoding"},"ContentLanguage":{"location":"header","locationName":"Content-Language"},"ContentType":{"location":"header","locationName":"Content-Type"},"Expires":{"location":"header","locationName":"Expires","type":"timestamp"},"WebsiteRedirectLocation":{"location":"header","locationName":"x-amz-website-redirect-location"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"Metadata":{"shape":"S13","location":"headers","locationName":"x-amz-meta-"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"StorageClass":{"location":"header","locationName":"x-amz-storage-class"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"},"ReplicationStatus":{"location":"header","locationName":"x-amz-replication-status"},"PartsCount":{"location":"header","locationName":"x-amz-mp-parts-count","type":"integer"},"ObjectLockMode":{"location":"header","locationName":"x-amz-object-lock-mode"},"ObjectLockRetainUntilDate":{"shape":"S1j","location":"header","locationName":"x-amz-object-lock-retain-until-date"},"ObjectLockLegalHoldStatus":{"location":"header","locationName":"x-amz-object-lock-legal-hold"}}}},"ListBucketAnalyticsConfigurations":{"http":{"method":"GET","requestUri":"/{Bucket}?analytics"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContinuationToken":{"location":"querystring","locationName":"continuation-token"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"IsTruncated":{"type":"boolean"},"ContinuationToken":{},"NextContinuationToken":{},"AnalyticsConfigurationList":{"locationName":"AnalyticsConfiguration","type":"list","member":{"shape":"S3j"},"flattened":true}}}},"ListBucketIntelligentTieringConfigurations":{"http":{"method":"GET","requestUri":"/{Bucket}?intelligent-tiering"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContinuationToken":{"location":"querystring","locationName":"continuation-token"}}},"output":{"type":"structure","members":{"IsTruncated":{"type":"boolean"},"ContinuationToken":{},"NextContinuationToken":{},"IntelligentTieringConfigurationList":{"locationName":"IntelligentTieringConfiguration","type":"list","member":{"shape":"S4h"},"flattened":true}}}},"ListBucketInventoryConfigurations":{"http":{"method":"GET","requestUri":"/{Bucket}?inventory"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContinuationToken":{"location":"querystring","locationName":"continuation-token"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"ContinuationToken":{},"InventoryConfigurationList":{"locationName":"InventoryConfiguration","type":"list","member":{"shape":"S4r"},"flattened":true},"IsTruncated":{"type":"boolean"},"NextContinuationToken":{}}}},"ListBucketMetricsConfigurations":{"http":{"method":"GET","requestUri":"/{Bucket}?metrics"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContinuationToken":{"location":"querystring","locationName":"continuation-token"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"IsTruncated":{"type":"boolean"},"ContinuationToken":{},"NextContinuationToken":{},"MetricsConfigurationList":{"locationName":"MetricsConfiguration","type":"list","member":{"shape":"S64"},"flattened":true}}}},"ListBuckets":{"http":{"method":"GET"},"output":{"type":"structure","members":{"Buckets":{"type":"list","member":{"locationName":"Bucket","type":"structure","members":{"Name":{},"CreationDate":{"type":"timestamp"}}}},"Owner":{"shape":"S37"}}},"alias":"GetService"},"ListMultipartUploads":{"http":{"method":"GET","requestUri":"/{Bucket}?uploads"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Delimiter":{"location":"querystring","locationName":"delimiter"},"EncodingType":{"location":"querystring","locationName":"encoding-type"},"KeyMarker":{"location":"querystring","locationName":"key-marker"},"MaxUploads":{"location":"querystring","locationName":"max-uploads","type":"integer"},"Prefix":{"location":"querystring","locationName":"prefix"},"UploadIdMarker":{"location":"querystring","locationName":"upload-id-marker"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Bucket":{},"KeyMarker":{},"UploadIdMarker":{},"NextKeyMarker":{},"Prefix":{},"Delimiter":{},"NextUploadIdMarker":{},"MaxUploads":{"type":"integer"},"IsTruncated":{"type":"boolean"},"Uploads":{"locationName":"Upload","type":"list","member":{"type":"structure","members":{"UploadId":{},"Key":{},"Initiated":{"type":"timestamp"},"StorageClass":{},"Owner":{"shape":"S37"},"Initiator":{"shape":"Sb3"}}},"flattened":true},"CommonPrefixes":{"shape":"Sb4"},"EncodingType":{}}}},"ListObjectVersions":{"http":{"method":"GET","requestUri":"/{Bucket}?versions"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Delimiter":{"location":"querystring","locationName":"delimiter"},"EncodingType":{"location":"querystring","locationName":"encoding-type"},"KeyMarker":{"location":"querystring","locationName":"key-marker"},"MaxKeys":{"location":"querystring","locationName":"max-keys","type":"integer"},"Prefix":{"location":"querystring","locationName":"prefix"},"VersionIdMarker":{"location":"querystring","locationName":"version-id-marker"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"IsTruncated":{"type":"boolean"},"KeyMarker":{},"VersionIdMarker":{},"NextKeyMarker":{},"NextVersionIdMarker":{},"Versions":{"locationName":"Version","type":"list","member":{"type":"structure","members":{"ETag":{},"Size":{"type":"integer"},"StorageClass":{},"Key":{},"VersionId":{},"IsLatest":{"type":"boolean"},"LastModified":{"type":"timestamp"},"Owner":{"shape":"S37"}}},"flattened":true},"DeleteMarkers":{"locationName":"DeleteMarker","type":"list","member":{"type":"structure","members":{"Owner":{"shape":"S37"},"Key":{},"VersionId":{},"IsLatest":{"type":"boolean"},"LastModified":{"type":"timestamp"}}},"flattened":true},"Name":{},"Prefix":{},"Delimiter":{},"MaxKeys":{"type":"integer"},"CommonPrefixes":{"shape":"Sb4"},"EncodingType":{}}},"alias":"GetBucketObjectVersions"},"ListObjects":{"http":{"method":"GET","requestUri":"/{Bucket}"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Delimiter":{"location":"querystring","locationName":"delimiter"},"EncodingType":{"location":"querystring","locationName":"encoding-type"},"Marker":{"location":"querystring","locationName":"marker"},"MaxKeys":{"location":"querystring","locationName":"max-keys","type":"integer"},"Prefix":{"location":"querystring","locationName":"prefix"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"IsTruncated":{"type":"boolean"},"Marker":{},"NextMarker":{},"Contents":{"shape":"Sbm"},"Name":{},"Prefix":{},"Delimiter":{},"MaxKeys":{"type":"integer"},"CommonPrefixes":{"shape":"Sb4"},"EncodingType":{}}},"alias":"GetBucket"},"ListObjectsV2":{"http":{"method":"GET","requestUri":"/{Bucket}?list-type=2"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Delimiter":{"location":"querystring","locationName":"delimiter"},"EncodingType":{"location":"querystring","locationName":"encoding-type"},"MaxKeys":{"location":"querystring","locationName":"max-keys","type":"integer"},"Prefix":{"location":"querystring","locationName":"prefix"},"ContinuationToken":{"location":"querystring","locationName":"continuation-token"},"FetchOwner":{"location":"querystring","locationName":"fetch-owner","type":"boolean"},"StartAfter":{"location":"querystring","locationName":"start-after"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"IsTruncated":{"type":"boolean"},"Contents":{"shape":"Sbm"},"Name":{},"Prefix":{},"Delimiter":{},"MaxKeys":{"type":"integer"},"CommonPrefixes":{"shape":"Sb4"},"EncodingType":{},"KeyCount":{"type":"integer"},"ContinuationToken":{},"NextContinuationToken":{},"StartAfter":{}}}},"ListParts":{"http":{"method":"GET","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","Key","UploadId"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"MaxParts":{"location":"querystring","locationName":"max-parts","type":"integer"},"PartNumberMarker":{"location":"querystring","locationName":"part-number-marker","type":"integer"},"UploadId":{"location":"querystring","locationName":"uploadId"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"AbortDate":{"location":"header","locationName":"x-amz-abort-date","type":"timestamp"},"AbortRuleId":{"location":"header","locationName":"x-amz-abort-rule-id"},"Bucket":{},"Key":{},"UploadId":{},"PartNumberMarker":{"type":"integer"},"NextPartNumberMarker":{"type":"integer"},"MaxParts":{"type":"integer"},"IsTruncated":{"type":"boolean"},"Parts":{"locationName":"Part","type":"list","member":{"type":"structure","members":{"PartNumber":{"type":"integer"},"LastModified":{"type":"timestamp"},"ETag":{},"Size":{"type":"integer"}}},"flattened":true},"Initiator":{"shape":"Sb3"},"Owner":{"shape":"S37"},"StorageClass":{},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"PutBucketAccelerateConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?accelerate"},"input":{"type":"structure","required":["Bucket","AccelerateConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"AccelerateConfiguration":{"locationName":"AccelerateConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"Status":{}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"AccelerateConfiguration"}},"PutBucketAcl":{"http":{"method":"PUT","requestUri":"/{Bucket}?acl"},"input":{"type":"structure","required":["Bucket"],"members":{"ACL":{"location":"header","locationName":"x-amz-acl"},"AccessControlPolicy":{"shape":"Sc4","locationName":"AccessControlPolicy","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"GrantFullControl":{"location":"header","locationName":"x-amz-grant-full-control"},"GrantRead":{"location":"header","locationName":"x-amz-grant-read"},"GrantReadACP":{"location":"header","locationName":"x-amz-grant-read-acp"},"GrantWrite":{"location":"header","locationName":"x-amz-grant-write"},"GrantWriteACP":{"location":"header","locationName":"x-amz-grant-write-acp"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"AccessControlPolicy"},"httpChecksumRequired":true},"PutBucketAnalyticsConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?analytics"},"input":{"type":"structure","required":["Bucket","Id","AnalyticsConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"AnalyticsConfiguration":{"shape":"S3j","locationName":"AnalyticsConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"AnalyticsConfiguration"}},"PutBucketCors":{"http":{"method":"PUT","requestUri":"/{Bucket}?cors"},"input":{"type":"structure","required":["Bucket","CORSConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"CORSConfiguration":{"locationName":"CORSConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","required":["CORSRules"],"members":{"CORSRules":{"shape":"S3y","locationName":"CORSRule"}}},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"CORSConfiguration"},"httpChecksumRequired":true},"PutBucketEncryption":{"http":{"method":"PUT","requestUri":"/{Bucket}?encryption"},"input":{"type":"structure","required":["Bucket","ServerSideEncryptionConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ServerSideEncryptionConfiguration":{"shape":"S4b","locationName":"ServerSideEncryptionConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"ServerSideEncryptionConfiguration"},"httpChecksumRequired":true},"PutBucketIntelligentTieringConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?intelligent-tiering"},"input":{"type":"structure","required":["Bucket","Id","IntelligentTieringConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"IntelligentTieringConfiguration":{"shape":"S4h","locationName":"IntelligentTieringConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}}},"payload":"IntelligentTieringConfiguration"}},"PutBucketInventoryConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?inventory"},"input":{"type":"structure","required":["Bucket","Id","InventoryConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"InventoryConfiguration":{"shape":"S4r","locationName":"InventoryConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"InventoryConfiguration"}},"PutBucketLifecycle":{"http":{"method":"PUT","requestUri":"/{Bucket}?lifecycle"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"LifecycleConfiguration":{"locationName":"LifecycleConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","required":["Rules"],"members":{"Rules":{"shape":"S57","locationName":"Rule"}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"LifecycleConfiguration"},"deprecated":true,"httpChecksumRequired":true},"PutBucketLifecycleConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?lifecycle"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"LifecycleConfiguration":{"locationName":"LifecycleConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","required":["Rules"],"members":{"Rules":{"shape":"S5m","locationName":"Rule"}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"LifecycleConfiguration"},"httpChecksumRequired":true},"PutBucketLogging":{"http":{"method":"PUT","requestUri":"/{Bucket}?logging"},"input":{"type":"structure","required":["Bucket","BucketLoggingStatus"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"BucketLoggingStatus":{"locationName":"BucketLoggingStatus","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"LoggingEnabled":{"shape":"S5w"}}},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"BucketLoggingStatus"},"httpChecksumRequired":true},"PutBucketMetricsConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?metrics"},"input":{"type":"structure","required":["Bucket","Id","MetricsConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Id":{"location":"querystring","locationName":"id"},"MetricsConfiguration":{"shape":"S64","locationName":"MetricsConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"MetricsConfiguration"}},"PutBucketNotification":{"http":{"method":"PUT","requestUri":"/{Bucket}?notification"},"input":{"type":"structure","required":["Bucket","NotificationConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"NotificationConfiguration":{"shape":"S68","locationName":"NotificationConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"NotificationConfiguration"},"deprecated":true,"httpChecksumRequired":true},"PutBucketNotificationConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?notification"},"input":{"type":"structure","required":["Bucket","NotificationConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"NotificationConfiguration":{"shape":"S6j","locationName":"NotificationConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"NotificationConfiguration"}},"PutBucketOwnershipControls":{"http":{"method":"PUT","requestUri":"/{Bucket}?ownershipControls"},"input":{"type":"structure","required":["Bucket","OwnershipControls"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"},"OwnershipControls":{"shape":"S6z","locationName":"OwnershipControls","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}}},"payload":"OwnershipControls"},"httpChecksumRequired":true},"PutBucketPolicy":{"http":{"method":"PUT","requestUri":"/{Bucket}?policy"},"input":{"type":"structure","required":["Bucket","Policy"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ConfirmRemoveSelfBucketAccess":{"location":"header","locationName":"x-amz-confirm-remove-self-bucket-access","type":"boolean"},"Policy":{},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Policy"},"httpChecksumRequired":true},"PutBucketReplication":{"http":{"method":"PUT","requestUri":"/{Bucket}?replication"},"input":{"type":"structure","required":["Bucket","ReplicationConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ReplicationConfiguration":{"shape":"S7c","locationName":"ReplicationConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"Token":{"location":"header","locationName":"x-amz-bucket-object-lock-token"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"ReplicationConfiguration"},"httpChecksumRequired":true},"PutBucketRequestPayment":{"http":{"method":"PUT","requestUri":"/{Bucket}?requestPayment"},"input":{"type":"structure","required":["Bucket","RequestPaymentConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"RequestPaymentConfiguration":{"locationName":"RequestPaymentConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","required":["Payer"],"members":{"Payer":{}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"RequestPaymentConfiguration"},"httpChecksumRequired":true},"PutBucketTagging":{"http":{"method":"PUT","requestUri":"/{Bucket}?tagging"},"input":{"type":"structure","required":["Bucket","Tagging"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"Tagging":{"shape":"Sct","locationName":"Tagging","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Tagging"},"httpChecksumRequired":true},"PutBucketVersioning":{"http":{"method":"PUT","requestUri":"/{Bucket}?versioning"},"input":{"type":"structure","required":["Bucket","VersioningConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"MFA":{"location":"header","locationName":"x-amz-mfa"},"VersioningConfiguration":{"locationName":"VersioningConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"MFADelete":{"locationName":"MfaDelete"},"Status":{}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"VersioningConfiguration"},"httpChecksumRequired":true},"PutBucketWebsite":{"http":{"method":"PUT","requestUri":"/{Bucket}?website"},"input":{"type":"structure","required":["Bucket","WebsiteConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"WebsiteConfiguration":{"locationName":"WebsiteConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"ErrorDocument":{"shape":"S8k"},"IndexDocument":{"shape":"S8i"},"RedirectAllRequestsTo":{"shape":"S8f"},"RoutingRules":{"shape":"S8l"}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"WebsiteConfiguration"},"httpChecksumRequired":true},"PutObject":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"ACL":{"location":"header","locationName":"x-amz-acl"},"Body":{"streaming":true,"type":"blob"},"Bucket":{"location":"uri","locationName":"Bucket"},"CacheControl":{"location":"header","locationName":"Cache-Control"},"ContentDisposition":{"location":"header","locationName":"Content-Disposition"},"ContentEncoding":{"location":"header","locationName":"Content-Encoding"},"ContentLanguage":{"location":"header","locationName":"Content-Language"},"ContentLength":{"location":"header","locationName":"Content-Length","type":"long"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ContentType":{"location":"header","locationName":"Content-Type"},"Expires":{"location":"header","locationName":"Expires","type":"timestamp"},"GrantFullControl":{"location":"header","locationName":"x-amz-grant-full-control"},"GrantRead":{"location":"header","locationName":"x-amz-grant-read"},"GrantReadACP":{"location":"header","locationName":"x-amz-grant-read-acp"},"GrantWriteACP":{"location":"header","locationName":"x-amz-grant-write-acp"},"Key":{"location":"uri","locationName":"Key"},"Metadata":{"shape":"S13","location":"headers","locationName":"x-amz-meta-"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"StorageClass":{"location":"header","locationName":"x-amz-storage-class"},"WebsiteRedirectLocation":{"location":"header","locationName":"x-amz-website-redirect-location"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"SSEKMSEncryptionContext":{"shape":"S1d","location":"header","locationName":"x-amz-server-side-encryption-context"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"Tagging":{"location":"header","locationName":"x-amz-tagging"},"ObjectLockMode":{"location":"header","locationName":"x-amz-object-lock-mode"},"ObjectLockRetainUntilDate":{"shape":"S1j","location":"header","locationName":"x-amz-object-lock-retain-until-date"},"ObjectLockLegalHoldStatus":{"location":"header","locationName":"x-amz-object-lock-legal-hold"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Body"},"output":{"type":"structure","members":{"Expiration":{"location":"header","locationName":"x-amz-expiration"},"ETag":{"location":"header","locationName":"ETag"},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"VersionId":{"location":"header","locationName":"x-amz-version-id"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"SSEKMSEncryptionContext":{"shape":"S1d","location":"header","locationName":"x-amz-server-side-encryption-context"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"PutObjectAcl":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}?acl"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"ACL":{"location":"header","locationName":"x-amz-acl"},"AccessControlPolicy":{"shape":"Sc4","locationName":"AccessControlPolicy","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"GrantFullControl":{"location":"header","locationName":"x-amz-grant-full-control"},"GrantRead":{"location":"header","locationName":"x-amz-grant-read"},"GrantReadACP":{"location":"header","locationName":"x-amz-grant-read-acp"},"GrantWrite":{"location":"header","locationName":"x-amz-grant-write"},"GrantWriteACP":{"location":"header","locationName":"x-amz-grant-write-acp"},"Key":{"location":"uri","locationName":"Key"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"VersionId":{"location":"querystring","locationName":"versionId"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"AccessControlPolicy"},"output":{"type":"structure","members":{"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}},"httpChecksumRequired":true},"PutObjectLegalHold":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}?legal-hold"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"LegalHold":{"shape":"S9k","locationName":"LegalHold","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"VersionId":{"location":"querystring","locationName":"versionId"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"LegalHold"},"output":{"type":"structure","members":{"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}},"httpChecksumRequired":true},"PutObjectLockConfiguration":{"http":{"method":"PUT","requestUri":"/{Bucket}?object-lock"},"input":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ObjectLockConfiguration":{"shape":"S9n","locationName":"ObjectLockConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"Token":{"location":"header","locationName":"x-amz-bucket-object-lock-token"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"ObjectLockConfiguration"},"output":{"type":"structure","members":{"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}},"httpChecksumRequired":true},"PutObjectRetention":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}?retention"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"Retention":{"shape":"S9v","locationName":"Retention","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"VersionId":{"location":"querystring","locationName":"versionId"},"BypassGovernanceRetention":{"location":"header","locationName":"x-amz-bypass-governance-retention","type":"boolean"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Retention"},"output":{"type":"structure","members":{"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}},"httpChecksumRequired":true},"PutObjectTagging":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}?tagging"},"input":{"type":"structure","required":["Bucket","Key","Tagging"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"Tagging":{"shape":"Sct","locationName":"Tagging","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Tagging"},"output":{"type":"structure","members":{"VersionId":{"location":"header","locationName":"x-amz-version-id"}}},"httpChecksumRequired":true},"PutPublicAccessBlock":{"http":{"method":"PUT","requestUri":"/{Bucket}?publicAccessBlock"},"input":{"type":"structure","required":["Bucket","PublicAccessBlockConfiguration"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"PublicAccessBlockConfiguration":{"shape":"Sa2","locationName":"PublicAccessBlockConfiguration","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"PublicAccessBlockConfiguration"},"httpChecksumRequired":true},"RestoreObject":{"http":{"requestUri":"/{Bucket}/{Key+}?restore"},"input":{"type":"structure","required":["Bucket","Key"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"VersionId":{"location":"querystring","locationName":"versionId"},"RestoreRequest":{"locationName":"RestoreRequest","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","members":{"Days":{"type":"integer"},"GlacierJobParameters":{"type":"structure","required":["Tier"],"members":{"Tier":{}}},"Type":{},"Tier":{},"Description":{},"SelectParameters":{"type":"structure","required":["InputSerialization","ExpressionType","Expression","OutputSerialization"],"members":{"InputSerialization":{"shape":"Sdj"},"ExpressionType":{},"Expression":{},"OutputSerialization":{"shape":"Sdy"}}},"OutputLocation":{"type":"structure","members":{"S3":{"type":"structure","required":["BucketName","Prefix"],"members":{"BucketName":{},"Prefix":{},"Encryption":{"type":"structure","required":["EncryptionType"],"members":{"EncryptionType":{},"KMSKeyId":{"shape":"Sk"},"KMSContext":{}}},"CannedACL":{},"AccessControlList":{"shape":"S3a"},"Tagging":{"shape":"Sct"},"UserMetadata":{"type":"list","member":{"locationName":"MetadataEntry","type":"structure","members":{"Name":{},"Value":{}}}},"StorageClass":{}}}}}}},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"RestoreRequest"},"output":{"type":"structure","members":{"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"},"RestoreOutputPath":{"location":"header","locationName":"x-amz-restore-output-path"}}},"alias":"PostObjectRestore"},"SelectObjectContent":{"http":{"requestUri":"/{Bucket}/{Key+}?select&select-type=2"},"input":{"locationName":"SelectObjectContentRequest","xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"},"type":"structure","required":["Bucket","Key","Expression","ExpressionType","InputSerialization","OutputSerialization"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"Key":{"location":"uri","locationName":"Key"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"Expression":{},"ExpressionType":{},"RequestProgress":{"type":"structure","members":{"Enabled":{"type":"boolean"}}},"InputSerialization":{"shape":"Sdj"},"OutputSerialization":{"shape":"Sdy"},"ScanRange":{"type":"structure","members":{"Start":{"type":"long"},"End":{"type":"long"}}},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"output":{"type":"structure","members":{"Payload":{"type":"structure","members":{"Records":{"type":"structure","members":{"Payload":{"eventpayload":true,"type":"blob"}},"event":true},"Stats":{"type":"structure","members":{"Details":{"eventpayload":true,"type":"structure","members":{"BytesScanned":{"type":"long"},"BytesProcessed":{"type":"long"},"BytesReturned":{"type":"long"}}}},"event":true},"Progress":{"type":"structure","members":{"Details":{"eventpayload":true,"type":"structure","members":{"BytesScanned":{"type":"long"},"BytesProcessed":{"type":"long"},"BytesReturned":{"type":"long"}}}},"event":true},"Cont":{"type":"structure","members":{},"event":true},"End":{"type":"structure","members":{},"event":true}},"eventstream":true}},"payload":"Payload"}},"UploadPart":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","Key","PartNumber","UploadId"],"members":{"Body":{"streaming":true,"type":"blob"},"Bucket":{"location":"uri","locationName":"Bucket"},"ContentLength":{"location":"header","locationName":"Content-Length","type":"long"},"ContentMD5":{"location":"header","locationName":"Content-MD5"},"Key":{"location":"uri","locationName":"Key"},"PartNumber":{"location":"querystring","locationName":"partNumber","type":"integer"},"UploadId":{"location":"querystring","locationName":"uploadId"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}},"payload":"Body"},"output":{"type":"structure","members":{"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"ETag":{"location":"header","locationName":"ETag"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}}}},"UploadPartCopy":{"http":{"method":"PUT","requestUri":"/{Bucket}/{Key+}"},"input":{"type":"structure","required":["Bucket","CopySource","Key","PartNumber","UploadId"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"CopySource":{"location":"header","locationName":"x-amz-copy-source"},"CopySourceIfMatch":{"location":"header","locationName":"x-amz-copy-source-if-match"},"CopySourceIfModifiedSince":{"location":"header","locationName":"x-amz-copy-source-if-modified-since","type":"timestamp"},"CopySourceIfNoneMatch":{"location":"header","locationName":"x-amz-copy-source-if-none-match"},"CopySourceIfUnmodifiedSince":{"location":"header","locationName":"x-amz-copy-source-if-unmodified-since","type":"timestamp"},"CopySourceRange":{"location":"header","locationName":"x-amz-copy-source-range"},"Key":{"location":"uri","locationName":"Key"},"PartNumber":{"location":"querystring","locationName":"partNumber","type":"integer"},"UploadId":{"location":"querystring","locationName":"uploadId"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKey":{"shape":"S1b","location":"header","locationName":"x-amz-server-side-encryption-customer-key"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"CopySourceSSECustomerAlgorithm":{"location":"header","locationName":"x-amz-copy-source-server-side-encryption-customer-algorithm"},"CopySourceSSECustomerKey":{"shape":"S1f","location":"header","locationName":"x-amz-copy-source-server-side-encryption-customer-key"},"CopySourceSSECustomerKeyMD5":{"location":"header","locationName":"x-amz-copy-source-server-side-encryption-customer-key-MD5"},"RequestPayer":{"location":"header","locationName":"x-amz-request-payer"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"},"ExpectedSourceBucketOwner":{"location":"header","locationName":"x-amz-source-expected-bucket-owner"}}},"output":{"type":"structure","members":{"CopySourceVersionId":{"location":"header","locationName":"x-amz-copy-source-version-id"},"CopyPartResult":{"type":"structure","members":{"ETag":{},"LastModified":{"type":"timestamp"}}},"ServerSideEncryption":{"location":"header","locationName":"x-amz-server-side-encryption"},"SSECustomerAlgorithm":{"location":"header","locationName":"x-amz-server-side-encryption-customer-algorithm"},"SSECustomerKeyMD5":{"location":"header","locationName":"x-amz-server-side-encryption-customer-key-MD5"},"SSEKMSKeyId":{"shape":"Sk","location":"header","locationName":"x-amz-server-side-encryption-aws-kms-key-id"},"BucketKeyEnabled":{"location":"header","locationName":"x-amz-server-side-encryption-bucket-key-enabled","type":"boolean"},"RequestCharged":{"location":"header","locationName":"x-amz-request-charged"}},"payload":"CopyPartResult"}}},"shapes":{"Sk":{"type":"string","sensitive":true},"S13":{"type":"map","key":{},"value":{}},"S1b":{"type":"blob","sensitive":true},"S1d":{"type":"string","sensitive":true},"S1f":{"type":"blob","sensitive":true},"S1j":{"type":"timestamp","timestampFormat":"iso8601"},"S37":{"type":"structure","members":{"DisplayName":{},"ID":{}}},"S3a":{"type":"list","member":{"locationName":"Grant","type":"structure","members":{"Grantee":{"shape":"S3c"},"Permission":{}}}},"S3c":{"type":"structure","required":["Type"],"members":{"DisplayName":{},"EmailAddress":{},"ID":{},"Type":{"locationName":"xsi:type","xmlAttribute":true},"URI":{}},"xmlNamespace":{"prefix":"xsi","uri":"http://www.w3.org/2001/XMLSchema-instance"}},"S3j":{"type":"structure","required":["Id","StorageClassAnalysis"],"members":{"Id":{},"Filter":{"type":"structure","members":{"Prefix":{},"Tag":{"shape":"S3m"},"And":{"type":"structure","members":{"Prefix":{},"Tags":{"shape":"S3p","flattened":true,"locationName":"Tag"}}}}},"StorageClassAnalysis":{"type":"structure","members":{"DataExport":{"type":"structure","required":["OutputSchemaVersion","Destination"],"members":{"OutputSchemaVersion":{},"Destination":{"type":"structure","required":["S3BucketDestination"],"members":{"S3BucketDestination":{"type":"structure","required":["Format","Bucket"],"members":{"Format":{},"BucketAccountId":{},"Bucket":{},"Prefix":{}}}}}}}}}}},"S3m":{"type":"structure","required":["Key","Value"],"members":{"Key":{},"Value":{}}},"S3p":{"type":"list","member":{"shape":"S3m","locationName":"Tag"}},"S3y":{"type":"list","member":{"type":"structure","required":["AllowedMethods","AllowedOrigins"],"members":{"AllowedHeaders":{"locationName":"AllowedHeader","type":"list","member":{},"flattened":true},"AllowedMethods":{"locationName":"AllowedMethod","type":"list","member":{},"flattened":true},"AllowedOrigins":{"locationName":"AllowedOrigin","type":"list","member":{},"flattened":true},"ExposeHeaders":{"locationName":"ExposeHeader","type":"list","member":{},"flattened":true},"MaxAgeSeconds":{"type":"integer"}}},"flattened":true},"S4b":{"type":"structure","required":["Rules"],"members":{"Rules":{"locationName":"Rule","type":"list","member":{"type":"structure","members":{"ApplyServerSideEncryptionByDefault":{"type":"structure","required":["SSEAlgorithm"],"members":{"SSEAlgorithm":{},"KMSMasterKeyID":{"shape":"Sk"}}},"BucketKeyEnabled":{"type":"boolean"}}},"flattened":true}}},"S4h":{"type":"structure","required":["Id","Status","Tierings"],"members":{"Id":{},"Filter":{"type":"structure","members":{"Prefix":{},"Tag":{"shape":"S3m"},"And":{"type":"structure","members":{"Prefix":{},"Tags":{"shape":"S3p","flattened":true,"locationName":"Tag"}}}}},"Status":{},"Tierings":{"locationName":"Tiering","type":"list","member":{"type":"structure","required":["Days","AccessTier"],"members":{"Days":{"type":"integer"},"AccessTier":{}}},"flattened":true}}},"S4r":{"type":"structure","required":["Destination","IsEnabled","Id","IncludedObjectVersions","Schedule"],"members":{"Destination":{"type":"structure","required":["S3BucketDestination"],"members":{"S3BucketDestination":{"type":"structure","required":["Bucket","Format"],"members":{"AccountId":{},"Bucket":{},"Format":{},"Prefix":{},"Encryption":{"type":"structure","members":{"SSES3":{"locationName":"SSE-S3","type":"structure","members":{}},"SSEKMS":{"locationName":"SSE-KMS","type":"structure","required":["KeyId"],"members":{"KeyId":{"shape":"Sk"}}}}}}}}},"IsEnabled":{"type":"boolean"},"Filter":{"type":"structure","required":["Prefix"],"members":{"Prefix":{}}},"Id":{},"IncludedObjectVersions":{},"OptionalFields":{"type":"list","member":{"locationName":"Field"}},"Schedule":{"type":"structure","required":["Frequency"],"members":{"Frequency":{}}}}},"S57":{"type":"list","member":{"type":"structure","required":["Prefix","Status"],"members":{"Expiration":{"shape":"S59"},"ID":{},"Prefix":{},"Status":{},"Transition":{"shape":"S5e"},"NoncurrentVersionTransition":{"shape":"S5g"},"NoncurrentVersionExpiration":{"shape":"S5h"},"AbortIncompleteMultipartUpload":{"shape":"S5i"}}},"flattened":true},"S59":{"type":"structure","members":{"Date":{"shape":"S5a"},"Days":{"type":"integer"},"ExpiredObjectDeleteMarker":{"type":"boolean"}}},"S5a":{"type":"timestamp","timestampFormat":"iso8601"},"S5e":{"type":"structure","members":{"Date":{"shape":"S5a"},"Days":{"type":"integer"},"StorageClass":{}}},"S5g":{"type":"structure","members":{"NoncurrentDays":{"type":"integer"},"StorageClass":{}}},"S5h":{"type":"structure","members":{"NoncurrentDays":{"type":"integer"}}},"S5i":{"type":"structure","members":{"DaysAfterInitiation":{"type":"integer"}}},"S5m":{"type":"list","member":{"type":"structure","required":["Status"],"members":{"Expiration":{"shape":"S59"},"ID":{},"Prefix":{"deprecated":true},"Filter":{"type":"structure","members":{"Prefix":{},"Tag":{"shape":"S3m"},"And":{"type":"structure","members":{"Prefix":{},"Tags":{"shape":"S3p","flattened":true,"locationName":"Tag"}}}}},"Status":{},"Transitions":{"locationName":"Transition","type":"list","member":{"shape":"S5e"},"flattened":true},"NoncurrentVersionTransitions":{"locationName":"NoncurrentVersionTransition","type":"list","member":{"shape":"S5g"},"flattened":true},"NoncurrentVersionExpiration":{"shape":"S5h"},"AbortIncompleteMultipartUpload":{"shape":"S5i"}}},"flattened":true},"S5w":{"type":"structure","required":["TargetBucket","TargetPrefix"],"members":{"TargetBucket":{},"TargetGrants":{"type":"list","member":{"locationName":"Grant","type":"structure","members":{"Grantee":{"shape":"S3c"},"Permission":{}}}},"TargetPrefix":{}}},"S64":{"type":"structure","required":["Id"],"members":{"Id":{},"Filter":{"type":"structure","members":{"Prefix":{},"Tag":{"shape":"S3m"},"And":{"type":"structure","members":{"Prefix":{},"Tags":{"shape":"S3p","flattened":true,"locationName":"Tag"}}}}}}},"S67":{"type":"structure","required":["Bucket"],"members":{"Bucket":{"location":"uri","locationName":"Bucket"},"ExpectedBucketOwner":{"location":"header","locationName":"x-amz-expected-bucket-owner"}}},"S68":{"type":"structure","members":{"TopicConfiguration":{"type":"structure","members":{"Id":{},"Events":{"shape":"S6b","locationName":"Event"},"Event":{"deprecated":true},"Topic":{}}},"QueueConfiguration":{"type":"structure","members":{"Id":{},"Event":{"deprecated":true},"Events":{"shape":"S6b","locationName":"Event"},"Queue":{}}},"CloudFunctionConfiguration":{"type":"structure","members":{"Id":{},"Event":{"deprecated":true},"Events":{"shape":"S6b","locationName":"Event"},"CloudFunction":{},"InvocationRole":{}}}}},"S6b":{"type":"list","member":{},"flattened":true},"S6j":{"type":"structure","members":{"TopicConfigurations":{"locationName":"TopicConfiguration","type":"list","member":{"type":"structure","required":["TopicArn","Events"],"members":{"Id":{},"TopicArn":{"locationName":"Topic"},"Events":{"shape":"S6b","locationName":"Event"},"Filter":{"shape":"S6m"}}},"flattened":true},"QueueConfigurations":{"locationName":"QueueConfiguration","type":"list","member":{"type":"structure","required":["QueueArn","Events"],"members":{"Id":{},"QueueArn":{"locationName":"Queue"},"Events":{"shape":"S6b","locationName":"Event"},"Filter":{"shape":"S6m"}}},"flattened":true},"LambdaFunctionConfigurations":{"locationName":"CloudFunctionConfiguration","type":"list","member":{"type":"structure","required":["LambdaFunctionArn","Events"],"members":{"Id":{},"LambdaFunctionArn":{"locationName":"CloudFunction"},"Events":{"shape":"S6b","locationName":"Event"},"Filter":{"shape":"S6m"}}},"flattened":true}}},"S6m":{"type":"structure","members":{"Key":{"locationName":"S3Key","type":"structure","members":{"FilterRules":{"locationName":"FilterRule","type":"list","member":{"type":"structure","members":{"Name":{},"Value":{}}},"flattened":true}}}}},"S6z":{"type":"structure","required":["Rules"],"members":{"Rules":{"locationName":"Rule","type":"list","member":{"type":"structure","required":["ObjectOwnership"],"members":{"ObjectOwnership":{}}},"flattened":true}}},"S7c":{"type":"structure","required":["Role","Rules"],"members":{"Role":{},"Rules":{"locationName":"Rule","type":"list","member":{"type":"structure","required":["Status","Destination"],"members":{"ID":{},"Priority":{"type":"integer"},"Prefix":{"deprecated":true},"Filter":{"type":"structure","members":{"Prefix":{},"Tag":{"shape":"S3m"},"And":{"type":"structure","members":{"Prefix":{},"Tags":{"shape":"S3p","flattened":true,"locationName":"Tag"}}}}},"Status":{},"SourceSelectionCriteria":{"type":"structure","members":{"SseKmsEncryptedObjects":{"type":"structure","required":["Status"],"members":{"Status":{}}},"ReplicaModifications":{"type":"structure","required":["Status"],"members":{"Status":{}}}}},"ExistingObjectReplication":{"type":"structure","required":["Status"],"members":{"Status":{}}},"Destination":{"type":"structure","required":["Bucket"],"members":{"Bucket":{},"Account":{},"StorageClass":{},"AccessControlTranslation":{"type":"structure","required":["Owner"],"members":{"Owner":{}}},"EncryptionConfiguration":{"type":"structure","members":{"ReplicaKmsKeyID":{}}},"ReplicationTime":{"type":"structure","required":["Status","Time"],"members":{"Status":{},"Time":{"shape":"S7y"}}},"Metrics":{"type":"structure","required":["Status"],"members":{"Status":{},"EventThreshold":{"shape":"S7y"}}}}},"DeleteMarkerReplication":{"type":"structure","members":{"Status":{}}}}},"flattened":true}}},"S7y":{"type":"structure","members":{"Minutes":{"type":"integer"}}},"S8f":{"type":"structure","required":["HostName"],"members":{"HostName":{},"Protocol":{}}},"S8i":{"type":"structure","required":["Suffix"],"members":{"Suffix":{}}},"S8k":{"type":"structure","required":["Key"],"members":{"Key":{}}},"S8l":{"type":"list","member":{"locationName":"RoutingRule","type":"structure","required":["Redirect"],"members":{"Condition":{"type":"structure","members":{"HttpErrorCodeReturnedEquals":{},"KeyPrefixEquals":{}}},"Redirect":{"type":"structure","members":{"HostName":{},"HttpRedirectCode":{},"Protocol":{},"ReplaceKeyPrefixWith":{},"ReplaceKeyWith":{}}}}}},"S9k":{"type":"structure","members":{"Status":{}}},"S9n":{"type":"structure","members":{"ObjectLockEnabled":{},"Rule":{"type":"structure","members":{"DefaultRetention":{"type":"structure","members":{"Mode":{},"Days":{"type":"integer"},"Years":{"type":"integer"}}}}}}},"S9v":{"type":"structure","members":{"Mode":{},"RetainUntilDate":{"shape":"S5a"}}},"Sa2":{"type":"structure","members":{"BlockPublicAcls":{"locationName":"BlockPublicAcls","type":"boolean"},"IgnorePublicAcls":{"locationName":"IgnorePublicAcls","type":"boolean"},"BlockPublicPolicy":{"locationName":"BlockPublicPolicy","type":"boolean"},"RestrictPublicBuckets":{"locationName":"RestrictPublicBuckets","type":"boolean"}}},"Sb3":{"type":"structure","members":{"ID":{},"DisplayName":{}}},"Sb4":{"type":"list","member":{"type":"structure","members":{"Prefix":{}}},"flattened":true},"Sbm":{"type":"list","member":{"type":"structure","members":{"Key":{},"LastModified":{"type":"timestamp"},"ETag":{},"Size":{"type":"integer"},"StorageClass":{},"Owner":{"shape":"S37"}}},"flattened":true},"Sc4":{"type":"structure","members":{"Grants":{"shape":"S3a","locationName":"AccessControlList"},"Owner":{"shape":"S37"}}},"Sct":{"type":"structure","required":["TagSet"],"members":{"TagSet":{"shape":"S3p"}}},"Sdj":{"type":"structure","members":{"CSV":{"type":"structure","members":{"FileHeaderInfo":{},"Comments":{},"QuoteEscapeCharacter":{},"RecordDelimiter":{},"FieldDelimiter":{},"QuoteCharacter":{},"AllowQuotedRecordDelimiter":{"type":"boolean"}}},"CompressionType":{},"JSON":{"type":"structure","members":{"Type":{}}},"Parquet":{"type":"structure","members":{}}}},"Sdy":{"type":"structure","members":{"CSV":{"type":"structure","members":{"QuoteFields":{},"QuoteEscapeCharacter":{},"RecordDelimiter":{},"FieldDelimiter":{},"QuoteCharacter":{}}},"JSON":{"type":"structure","members":{"RecordDelimiter":{}}}}}}};
  19758. /***/ }),
  19759. /***/ 898:
  19760. /***/ (function(module, __unusedexports, __webpack_require__) {
  19761. var v1 = __webpack_require__(86);
  19762. var v4 = __webpack_require__(826);
  19763. var uuid = v4;
  19764. uuid.v1 = v1;
  19765. uuid.v4 = v4;
  19766. module.exports = uuid;
  19767. /***/ }),
  19768. /***/ 904:
  19769. /***/ (function(module, __unusedexports, __webpack_require__) {
  19770. var util = __webpack_require__(153);
  19771. var AWS = __webpack_require__(395);
  19772. /**
  19773. * Prepend prefix defined by API model to endpoint that's already
  19774. * constructed. This feature does not apply to operations using
  19775. * endpoint discovery and can be disabled.
  19776. * @api private
  19777. */
  19778. function populateHostPrefix(request) {
  19779. var enabled = request.service.config.hostPrefixEnabled;
  19780. if (!enabled) return request;
  19781. var operationModel = request.service.api.operations[request.operation];
  19782. //don't marshal host prefix when operation has endpoint discovery traits
  19783. if (hasEndpointDiscover(request)) return request;
  19784. if (operationModel.endpoint && operationModel.endpoint.hostPrefix) {
  19785. var hostPrefixNotation = operationModel.endpoint.hostPrefix;
  19786. var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input);
  19787. prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix);
  19788. validateHostname(request.httpRequest.endpoint.hostname);
  19789. }
  19790. return request;
  19791. }
  19792. /**
  19793. * @api private
  19794. */
  19795. function hasEndpointDiscover(request) {
  19796. var api = request.service.api;
  19797. var operationModel = api.operations[request.operation];
  19798. var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name));
  19799. return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true);
  19800. }
  19801. /**
  19802. * @api private
  19803. */
  19804. function expandHostPrefix(hostPrefixNotation, params, shape) {
  19805. util.each(shape.members, function(name, member) {
  19806. if (member.hostLabel === true) {
  19807. if (typeof params[name] !== 'string' || params[name] === '') {
  19808. throw util.error(new Error(), {
  19809. message: 'Parameter ' + name + ' should be a non-empty string.',
  19810. code: 'InvalidParameter'
  19811. });
  19812. }
  19813. var regex = new RegExp('\\{' + name + '\\}', 'g');
  19814. hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]);
  19815. }
  19816. });
  19817. return hostPrefixNotation;
  19818. }
  19819. /**
  19820. * @api private
  19821. */
  19822. function prependEndpointPrefix(endpoint, prefix) {
  19823. if (endpoint.host) {
  19824. endpoint.host = prefix + endpoint.host;
  19825. }
  19826. if (endpoint.hostname) {
  19827. endpoint.hostname = prefix + endpoint.hostname;
  19828. }
  19829. }
  19830. /**
  19831. * @api private
  19832. */
  19833. function validateHostname(hostname) {
  19834. var labels = hostname.split('.');
  19835. //Reference: https://tools.ietf.org/html/rfc1123#section-2
  19836. var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;
  19837. util.arrayEach(labels, function(label) {
  19838. if (!label.length || label.length < 1 || label.length > 63) {
  19839. throw util.error(new Error(), {
  19840. code: 'ValidationError',
  19841. message: 'Hostname label length should be between 1 to 63 characters, inclusive.'
  19842. });
  19843. }
  19844. if (!hostPattern.test(label)) {
  19845. throw AWS.util.error(new Error(),
  19846. {code: 'ValidationError', message: label + ' is not hostname compatible.'});
  19847. }
  19848. });
  19849. }
  19850. module.exports = {
  19851. populateHostPrefix: populateHostPrefix
  19852. };
  19853. /***/ }),
  19854. /***/ 906:
  19855. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  19856. var AWS = __webpack_require__(395);
  19857. /**
  19858. * Creates a credential provider chain that searches for AWS credentials
  19859. * in a list of credential providers specified by the {providers} property.
  19860. *
  19861. * By default, the chain will use the {defaultProviders} to resolve credentials.
  19862. * These providers will look in the environment using the
  19863. * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes.
  19864. *
  19865. * ## Setting Providers
  19866. *
  19867. * Each provider in the {providers} list should be a function that returns
  19868. * a {AWS.Credentials} object, or a hardcoded credentials object. The function
  19869. * form allows for delayed execution of the credential construction.
  19870. *
  19871. * ## Resolving Credentials from a Chain
  19872. *
  19873. * Call {resolve} to return the first valid credential object that can be
  19874. * loaded by the provider chain.
  19875. *
  19876. * For example, to resolve a chain with a custom provider that checks a file
  19877. * on disk after the set of {defaultProviders}:
  19878. *
  19879. * ```javascript
  19880. * var diskProvider = new AWS.FileSystemCredentials('./creds.json');
  19881. * var chain = new AWS.CredentialProviderChain();
  19882. * chain.providers.push(diskProvider);
  19883. * chain.resolve();
  19884. * ```
  19885. *
  19886. * The above code will return the `diskProvider` object if the
  19887. * file contains credentials and the `defaultProviders` do not contain
  19888. * any credential settings.
  19889. *
  19890. * @!attribute providers
  19891. * @return [Array<AWS.Credentials, Function>]
  19892. * a list of credentials objects or functions that return credentials
  19893. * objects. If the provider is a function, the function will be
  19894. * executed lazily when the provider needs to be checked for valid
  19895. * credentials. By default, this object will be set to the
  19896. * {defaultProviders}.
  19897. * @see defaultProviders
  19898. */
  19899. AWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, {
  19900. /**
  19901. * Creates a new CredentialProviderChain with a default set of providers
  19902. * specified by {defaultProviders}.
  19903. */
  19904. constructor: function CredentialProviderChain(providers) {
  19905. if (providers) {
  19906. this.providers = providers;
  19907. } else {
  19908. this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0);
  19909. }
  19910. this.resolveCallbacks = [];
  19911. },
  19912. /**
  19913. * @!method resolvePromise()
  19914. * Returns a 'thenable' promise.
  19915. * Resolves the provider chain by searching for the first set of
  19916. * credentials in {providers}.
  19917. *
  19918. * Two callbacks can be provided to the `then` method on the returned promise.
  19919. * The first callback will be called if the promise is fulfilled, and the second
  19920. * callback will be called if the promise is rejected.
  19921. * @callback fulfilledCallback function(credentials)
  19922. * Called if the promise is fulfilled and the provider resolves the chain
  19923. * to a credentials object
  19924. * @param credentials [AWS.Credentials] the credentials object resolved
  19925. * by the provider chain.
  19926. * @callback rejectedCallback function(error)
  19927. * Called if the promise is rejected.
  19928. * @param err [Error] the error object returned if no credentials are found.
  19929. * @return [Promise] A promise that represents the state of the `resolve` method call.
  19930. * @example Calling the `resolvePromise` method.
  19931. * var promise = chain.resolvePromise();
  19932. * promise.then(function(credentials) { ... }, function(err) { ... });
  19933. */
  19934. /**
  19935. * Resolves the provider chain by searching for the first set of
  19936. * credentials in {providers}.
  19937. *
  19938. * @callback callback function(err, credentials)
  19939. * Called when the provider resolves the chain to a credentials object
  19940. * or null if no credentials can be found.
  19941. *
  19942. * @param err [Error] the error object returned if no credentials are
  19943. * found.
  19944. * @param credentials [AWS.Credentials] the credentials object resolved
  19945. * by the provider chain.
  19946. * @return [AWS.CredentialProviderChain] the provider, for chaining.
  19947. */
  19948. resolve: function resolve(callback) {
  19949. var self = this;
  19950. if (self.providers.length === 0) {
  19951. callback(new Error('No providers'));
  19952. return self;
  19953. }
  19954. if (self.resolveCallbacks.push(callback) === 1) {
  19955. var index = 0;
  19956. var providers = self.providers.slice(0);
  19957. function resolveNext(err, creds) {
  19958. if ((!err && creds) || index === providers.length) {
  19959. AWS.util.arrayEach(self.resolveCallbacks, function (callback) {
  19960. callback(err, creds);
  19961. });
  19962. self.resolveCallbacks.length = 0;
  19963. return;
  19964. }
  19965. var provider = providers[index++];
  19966. if (typeof provider === 'function') {
  19967. creds = provider.call();
  19968. } else {
  19969. creds = provider;
  19970. }
  19971. if (creds.get) {
  19972. creds.get(function (getErr) {
  19973. resolveNext(getErr, getErr ? null : creds);
  19974. });
  19975. } else {
  19976. resolveNext(null, creds);
  19977. }
  19978. }
  19979. resolveNext();
  19980. }
  19981. return self;
  19982. }
  19983. });
  19984. /**
  19985. * The default set of providers used by a vanilla CredentialProviderChain.
  19986. *
  19987. * In the browser:
  19988. *
  19989. * ```javascript
  19990. * AWS.CredentialProviderChain.defaultProviders = []
  19991. * ```
  19992. *
  19993. * In Node.js:
  19994. *
  19995. * ```javascript
  19996. * AWS.CredentialProviderChain.defaultProviders = [
  19997. * function () { return new AWS.EnvironmentCredentials('AWS'); },
  19998. * function () { return new AWS.EnvironmentCredentials('AMAZON'); },
  19999. * function () { return new AWS.SharedIniFileCredentials(); },
  20000. * function () { return new AWS.ECSCredentials(); },
  20001. * function () { return new AWS.ProcessCredentials(); },
  20002. * function () { return new AWS.TokenFileWebIdentityCredentials(); },
  20003. * function () { return new AWS.EC2MetadataCredentials() }
  20004. * ]
  20005. * ```
  20006. */
  20007. AWS.CredentialProviderChain.defaultProviders = [];
  20008. /**
  20009. * @api private
  20010. */
  20011. AWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) {
  20012. this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency);
  20013. };
  20014. /**
  20015. * @api private
  20016. */
  20017. AWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() {
  20018. delete this.prototype.resolvePromise;
  20019. };
  20020. AWS.util.addPromises(AWS.CredentialProviderChain);
  20021. /***/ }),
  20022. /***/ 907:
  20023. /***/ (function(module) {
  20024. /**
  20025. * Secure random string generator with custom alphabet.
  20026. *
  20027. * Alphabet must contain 256 symbols or less. Otherwise, the generator
  20028. * will not be secure.
  20029. *
  20030. * @param {generator} random The random bytes generator.
  20031. * @param {string} alphabet Symbols to be used in new random string.
  20032. * @param {size} size The number of symbols in new random string.
  20033. *
  20034. * @return {string} Random string.
  20035. *
  20036. * @example
  20037. * const format = require('nanoid/format')
  20038. *
  20039. * function random (size) {
  20040. * const result = []
  20041. * for (let i = 0; i < size; i++) {
  20042. * result.push(randomByte())
  20043. * }
  20044. * return result
  20045. * }
  20046. *
  20047. * format(random, "abcdef", 5) //=> "fbaef"
  20048. *
  20049. * @name format
  20050. * @function
  20051. */
  20052. module.exports = function (random, alphabet, size) {
  20053. // We can’t use bytes bigger than the alphabet. To make bytes values closer
  20054. // to the alphabet, we apply bitmask on them. We look for the closest
  20055. // `2 ** x - 1` number, which will be bigger than alphabet size. If we have
  20056. // 30 symbols in the alphabet, we will take 31 (00011111).
  20057. var mask = (2 << 31 - Math.clz32((alphabet.length - 1) | 1)) - 1
  20058. // Bitmask is not a perfect solution (in our example it will pass 31 bytes,
  20059. // which is bigger than the alphabet). As a result, we will need more bytes,
  20060. // than ID size, because we will refuse bytes bigger than the alphabet.
  20061. // Every hardware random generator call is costly,
  20062. // because we need to wait for entropy collection. This is why often it will
  20063. // be faster to ask for few extra bytes in advance, to avoid additional calls.
  20064. // Here we calculate how many random bytes should we call in advance.
  20065. // It depends on ID length, mask / alphabet size and magic number 1.6
  20066. // (which was selected according benchmarks).
  20067. var step = Math.ceil(1.6 * mask * size / alphabet.length)
  20068. var id = ''
  20069. while (true) {
  20070. var bytes = random(step)
  20071. // Compact alternative for `for (var i = 0; i < step; i++)`
  20072. var i = step
  20073. while (i--) {
  20074. // If random byte is bigger than alphabet even after bitmask,
  20075. // we refuse it by `|| ''`.
  20076. id += alphabet[bytes[i] & mask] || ''
  20077. // More compact than `id.length + 1 === size`
  20078. if (id.length === +size) return id
  20079. }
  20080. }
  20081. }
  20082. /**
  20083. * @callback generator
  20084. * @param {number} bytes The number of bytes to generate.
  20085. * @return {number[]} Random bytes.
  20086. */
  20087. /***/ }),
  20088. /***/ 912:
  20089. /***/ (function(module, __unusedexports, __webpack_require__) {
  20090. var util = __webpack_require__(153);
  20091. var JsonBuilder = __webpack_require__(337);
  20092. var JsonParser = __webpack_require__(806);
  20093. var populateHostPrefix = __webpack_require__(904).populateHostPrefix;
  20094. function buildRequest(req) {
  20095. var httpRequest = req.httpRequest;
  20096. var api = req.service.api;
  20097. var target = api.targetPrefix + '.' + api.operations[req.operation].name;
  20098. var version = api.jsonVersion || '1.0';
  20099. var input = api.operations[req.operation].input;
  20100. var builder = new JsonBuilder();
  20101. if (version === 1) version = '1.0';
  20102. httpRequest.body = builder.build(req.params || {}, input);
  20103. httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version;
  20104. httpRequest.headers['X-Amz-Target'] = target;
  20105. populateHostPrefix(req);
  20106. }
  20107. function extractError(resp) {
  20108. var error = {};
  20109. var httpResponse = resp.httpResponse;
  20110. error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError';
  20111. if (typeof error.code === 'string') {
  20112. error.code = error.code.split(':')[0];
  20113. }
  20114. if (httpResponse.body.length > 0) {
  20115. try {
  20116. var e = JSON.parse(httpResponse.body.toString());
  20117. var code = e.__type || e.code || e.Code;
  20118. if (code) {
  20119. error.code = code.split('#').pop();
  20120. }
  20121. if (error.code === 'RequestEntityTooLarge') {
  20122. error.message = 'Request body must be less than 1 MB';
  20123. } else {
  20124. error.message = (e.message || e.Message || null);
  20125. }
  20126. } catch (e) {
  20127. error.statusCode = httpResponse.statusCode;
  20128. error.message = httpResponse.statusMessage;
  20129. }
  20130. } else {
  20131. error.statusCode = httpResponse.statusCode;
  20132. error.message = httpResponse.statusCode.toString();
  20133. }
  20134. resp.error = util.error(new Error(), error);
  20135. }
  20136. function extractData(resp) {
  20137. var body = resp.httpResponse.body.toString() || '{}';
  20138. if (resp.request.service.config.convertResponseTypes === false) {
  20139. resp.data = JSON.parse(body);
  20140. } else {
  20141. var operation = resp.request.service.api.operations[resp.request.operation];
  20142. var shape = operation.output || {};
  20143. var parser = new JsonParser();
  20144. resp.data = parser.parse(body, shape);
  20145. }
  20146. }
  20147. /**
  20148. * @api private
  20149. */
  20150. module.exports = {
  20151. buildRequest: buildRequest,
  20152. extractError: extractError,
  20153. extractData: extractData
  20154. };
  20155. /***/ }),
  20156. /***/ 918:
  20157. /***/ (function(module) {
  20158. /**
  20159. * Escapes characters that can not be in an XML attribute.
  20160. */
  20161. function escapeAttribute(value) {
  20162. return value.replace(/&/g, '&amp;').replace(/'/g, '&apos;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
  20163. }
  20164. /**
  20165. * @api private
  20166. */
  20167. module.exports = {
  20168. escapeAttribute: escapeAttribute
  20169. };
  20170. /***/ }),
  20171. /***/ 919:
  20172. /***/ (function(module, __unusedexports, __webpack_require__) {
  20173. // Generated by CoffeeScript 1.12.7
  20174. (function() {
  20175. var XMLComment, XMLNode,
  20176. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  20177. hasProp = {}.hasOwnProperty;
  20178. XMLNode = __webpack_require__(855);
  20179. module.exports = XMLComment = (function(superClass) {
  20180. extend(XMLComment, superClass);
  20181. function XMLComment(parent, text) {
  20182. XMLComment.__super__.constructor.call(this, parent);
  20183. if (text == null) {
  20184. throw new Error("Missing comment text");
  20185. }
  20186. this.text = this.stringify.comment(text);
  20187. }
  20188. XMLComment.prototype.clone = function() {
  20189. return Object.create(this);
  20190. };
  20191. XMLComment.prototype.toString = function(options) {
  20192. return this.options.writer.set(options).comment(this);
  20193. };
  20194. return XMLComment;
  20195. })(XMLNode);
  20196. }).call(this);
  20197. /***/ }),
  20198. /***/ 923:
  20199. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  20200. var AWS = __webpack_require__(395);
  20201. /**
  20202. * Represents your AWS security credentials, specifically the
  20203. * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}.
  20204. * Creating a `Credentials` object allows you to pass around your
  20205. * security information to configuration and service objects.
  20206. *
  20207. * Note that this class typically does not need to be constructed manually,
  20208. * as the {AWS.Config} and {AWS.Service} classes both accept simple
  20209. * options hashes with the three keys. These structures will be converted
  20210. * into Credentials objects automatically.
  20211. *
  20212. * ## Expiring and Refreshing Credentials
  20213. *
  20214. * Occasionally credentials can expire in the middle of a long-running
  20215. * application. In this case, the SDK will automatically attempt to
  20216. * refresh the credentials from the storage location if the Credentials
  20217. * class implements the {refresh} method.
  20218. *
  20219. * If you are implementing a credential storage location, you
  20220. * will want to create a subclass of the `Credentials` class and
  20221. * override the {refresh} method. This method allows credentials to be
  20222. * retrieved from the backing store, be it a file system, database, or
  20223. * some network storage. The method should reset the credential attributes
  20224. * on the object.
  20225. *
  20226. * @!attribute expired
  20227. * @return [Boolean] whether the credentials have been expired and
  20228. * require a refresh. Used in conjunction with {expireTime}.
  20229. * @!attribute expireTime
  20230. * @return [Date] a time when credentials should be considered expired. Used
  20231. * in conjunction with {expired}.
  20232. * @!attribute accessKeyId
  20233. * @return [String] the AWS access key ID
  20234. * @!attribute secretAccessKey
  20235. * @return [String] the AWS secret access key
  20236. * @!attribute sessionToken
  20237. * @return [String] an optional AWS session token
  20238. */
  20239. AWS.Credentials = AWS.util.inherit({
  20240. /**
  20241. * A credentials object can be created using positional arguments or an options
  20242. * hash.
  20243. *
  20244. * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null)
  20245. * Creates a Credentials object with a given set of credential information
  20246. * as positional arguments.
  20247. * @param accessKeyId [String] the AWS access key ID
  20248. * @param secretAccessKey [String] the AWS secret access key
  20249. * @param sessionToken [String] the optional AWS session token
  20250. * @example Create a credentials object with AWS credentials
  20251. * var creds = new AWS.Credentials('akid', 'secret', 'session');
  20252. * @overload AWS.Credentials(options)
  20253. * Creates a Credentials object with a given set of credential information
  20254. * as an options hash.
  20255. * @option options accessKeyId [String] the AWS access key ID
  20256. * @option options secretAccessKey [String] the AWS secret access key
  20257. * @option options sessionToken [String] the optional AWS session token
  20258. * @example Create a credentials object with AWS credentials
  20259. * var creds = new AWS.Credentials({
  20260. * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session'
  20261. * });
  20262. */
  20263. constructor: function Credentials() {
  20264. // hide secretAccessKey from being displayed with util.inspect
  20265. AWS.util.hideProperties(this, ['secretAccessKey']);
  20266. this.expired = false;
  20267. this.expireTime = null;
  20268. this.refreshCallbacks = [];
  20269. if (arguments.length === 1 && typeof arguments[0] === 'object') {
  20270. var creds = arguments[0].credentials || arguments[0];
  20271. this.accessKeyId = creds.accessKeyId;
  20272. this.secretAccessKey = creds.secretAccessKey;
  20273. this.sessionToken = creds.sessionToken;
  20274. } else {
  20275. this.accessKeyId = arguments[0];
  20276. this.secretAccessKey = arguments[1];
  20277. this.sessionToken = arguments[2];
  20278. }
  20279. },
  20280. /**
  20281. * @return [Integer] the number of seconds before {expireTime} during which
  20282. * the credentials will be considered expired.
  20283. */
  20284. expiryWindow: 15,
  20285. /**
  20286. * @return [Boolean] whether the credentials object should call {refresh}
  20287. * @note Subclasses should override this method to provide custom refresh
  20288. * logic.
  20289. */
  20290. needsRefresh: function needsRefresh() {
  20291. var currentTime = AWS.util.date.getDate().getTime();
  20292. var adjustedTime = new Date(currentTime + this.expiryWindow * 1000);
  20293. if (this.expireTime && adjustedTime > this.expireTime) {
  20294. return true;
  20295. } else {
  20296. return this.expired || !this.accessKeyId || !this.secretAccessKey;
  20297. }
  20298. },
  20299. /**
  20300. * Gets the existing credentials, refreshing them if they are not yet loaded
  20301. * or have expired. Users should call this method before using {refresh},
  20302. * as this will not attempt to reload credentials when they are already
  20303. * loaded into the object.
  20304. *
  20305. * @callback callback function(err)
  20306. * When this callback is called with no error, it means either credentials
  20307. * do not need to be refreshed or refreshed credentials information has
  20308. * been loaded into the object (as the `accessKeyId`, `secretAccessKey`,
  20309. * and `sessionToken` properties).
  20310. * @param err [Error] if an error occurred, this value will be filled
  20311. */
  20312. get: function get(callback) {
  20313. var self = this;
  20314. if (this.needsRefresh()) {
  20315. this.refresh(function(err) {
  20316. if (!err) self.expired = false; // reset expired flag
  20317. if (callback) callback(err);
  20318. });
  20319. } else if (callback) {
  20320. callback();
  20321. }
  20322. },
  20323. /**
  20324. * @!method getPromise()
  20325. * Returns a 'thenable' promise.
  20326. * Gets the existing credentials, refreshing them if they are not yet loaded
  20327. * or have expired. Users should call this method before using {refresh},
  20328. * as this will not attempt to reload credentials when they are already
  20329. * loaded into the object.
  20330. *
  20331. * Two callbacks can be provided to the `then` method on the returned promise.
  20332. * The first callback will be called if the promise is fulfilled, and the second
  20333. * callback will be called if the promise is rejected.
  20334. * @callback fulfilledCallback function()
  20335. * Called if the promise is fulfilled. When this callback is called, it
  20336. * means either credentials do not need to be refreshed or refreshed
  20337. * credentials information has been loaded into the object (as the
  20338. * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).
  20339. * @callback rejectedCallback function(err)
  20340. * Called if the promise is rejected.
  20341. * @param err [Error] if an error occurred, this value will be filled
  20342. * @return [Promise] A promise that represents the state of the `get` call.
  20343. * @example Calling the `getPromise` method.
  20344. * var promise = credProvider.getPromise();
  20345. * promise.then(function() { ... }, function(err) { ... });
  20346. */
  20347. /**
  20348. * @!method refreshPromise()
  20349. * Returns a 'thenable' promise.
  20350. * Refreshes the credentials. Users should call {get} before attempting
  20351. * to forcibly refresh credentials.
  20352. *
  20353. * Two callbacks can be provided to the `then` method on the returned promise.
  20354. * The first callback will be called if the promise is fulfilled, and the second
  20355. * callback will be called if the promise is rejected.
  20356. * @callback fulfilledCallback function()
  20357. * Called if the promise is fulfilled. When this callback is called, it
  20358. * means refreshed credentials information has been loaded into the object
  20359. * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).
  20360. * @callback rejectedCallback function(err)
  20361. * Called if the promise is rejected.
  20362. * @param err [Error] if an error occurred, this value will be filled
  20363. * @return [Promise] A promise that represents the state of the `refresh` call.
  20364. * @example Calling the `refreshPromise` method.
  20365. * var promise = credProvider.refreshPromise();
  20366. * promise.then(function() { ... }, function(err) { ... });
  20367. */
  20368. /**
  20369. * Refreshes the credentials. Users should call {get} before attempting
  20370. * to forcibly refresh credentials.
  20371. *
  20372. * @callback callback function(err)
  20373. * When this callback is called with no error, it means refreshed
  20374. * credentials information has been loaded into the object (as the
  20375. * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).
  20376. * @param err [Error] if an error occurred, this value will be filled
  20377. * @note Subclasses should override this class to reset the
  20378. * {accessKeyId}, {secretAccessKey} and optional {sessionToken}
  20379. * on the credentials object and then call the callback with
  20380. * any error information.
  20381. * @see get
  20382. */
  20383. refresh: function refresh(callback) {
  20384. this.expired = false;
  20385. callback();
  20386. },
  20387. /**
  20388. * @api private
  20389. * @param callback
  20390. */
  20391. coalesceRefresh: function coalesceRefresh(callback, sync) {
  20392. var self = this;
  20393. if (self.refreshCallbacks.push(callback) === 1) {
  20394. self.load(function onLoad(err) {
  20395. AWS.util.arrayEach(self.refreshCallbacks, function(callback) {
  20396. if (sync) {
  20397. callback(err);
  20398. } else {
  20399. // callback could throw, so defer to ensure all callbacks are notified
  20400. AWS.util.defer(function () {
  20401. callback(err);
  20402. });
  20403. }
  20404. });
  20405. self.refreshCallbacks.length = 0;
  20406. });
  20407. }
  20408. },
  20409. /**
  20410. * @api private
  20411. * @param callback
  20412. */
  20413. load: function load(callback) {
  20414. callback();
  20415. }
  20416. });
  20417. /**
  20418. * @api private
  20419. */
  20420. AWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) {
  20421. this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency);
  20422. this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency);
  20423. };
  20424. /**
  20425. * @api private
  20426. */
  20427. AWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() {
  20428. delete this.prototype.getPromise;
  20429. delete this.prototype.refreshPromise;
  20430. };
  20431. AWS.util.addPromises(AWS.Credentials);
  20432. /***/ }),
  20433. /***/ 930:
  20434. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  20435. /**
  20436. * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  20437. *
  20438. * Licensed under the Apache License, Version 2.0 (the "License"). You
  20439. * may not use this file except in compliance with the License. A copy of
  20440. * the License is located at
  20441. *
  20442. * http://aws.amazon.com/apache2.0/
  20443. *
  20444. * or in the "license" file accompanying this file. This file is
  20445. * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
  20446. * ANY KIND, either express or implied. See the License for the specific
  20447. * language governing permissions and limitations under the License.
  20448. */
  20449. var AWS = __webpack_require__(395);
  20450. var inherit = AWS.util.inherit;
  20451. var jmespath = __webpack_require__(802);
  20452. /**
  20453. * @api private
  20454. */
  20455. function CHECK_ACCEPTORS(resp) {
  20456. var waiter = resp.request._waiter;
  20457. var acceptors = waiter.config.acceptors;
  20458. var acceptorMatched = false;
  20459. var state = 'retry';
  20460. acceptors.forEach(function(acceptor) {
  20461. if (!acceptorMatched) {
  20462. var matcher = waiter.matchers[acceptor.matcher];
  20463. if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) {
  20464. acceptorMatched = true;
  20465. state = acceptor.state;
  20466. }
  20467. }
  20468. });
  20469. if (!acceptorMatched && resp.error) state = 'failure';
  20470. if (state === 'success') {
  20471. waiter.setSuccess(resp);
  20472. } else {
  20473. waiter.setError(resp, state === 'retry');
  20474. }
  20475. }
  20476. /**
  20477. * @api private
  20478. */
  20479. AWS.ResourceWaiter = inherit({
  20480. /**
  20481. * Waits for a given state on a service object
  20482. * @param service [Service] the service object to wait on
  20483. * @param state [String] the state (defined in waiter configuration) to wait
  20484. * for.
  20485. * @example Create a waiter for running EC2 instances
  20486. * var ec2 = new AWS.EC2;
  20487. * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning');
  20488. */
  20489. constructor: function constructor(service, state) {
  20490. this.service = service;
  20491. this.state = state;
  20492. this.loadWaiterConfig(this.state);
  20493. },
  20494. service: null,
  20495. state: null,
  20496. config: null,
  20497. matchers: {
  20498. path: function(resp, expected, argument) {
  20499. try {
  20500. var result = jmespath.search(resp.data, argument);
  20501. } catch (err) {
  20502. return false;
  20503. }
  20504. return jmespath.strictDeepEqual(result,expected);
  20505. },
  20506. pathAll: function(resp, expected, argument) {
  20507. try {
  20508. var results = jmespath.search(resp.data, argument);
  20509. } catch (err) {
  20510. return false;
  20511. }
  20512. if (!Array.isArray(results)) results = [results];
  20513. var numResults = results.length;
  20514. if (!numResults) return false;
  20515. for (var ind = 0 ; ind < numResults; ind++) {
  20516. if (!jmespath.strictDeepEqual(results[ind], expected)) {
  20517. return false;
  20518. }
  20519. }
  20520. return true;
  20521. },
  20522. pathAny: function(resp, expected, argument) {
  20523. try {
  20524. var results = jmespath.search(resp.data, argument);
  20525. } catch (err) {
  20526. return false;
  20527. }
  20528. if (!Array.isArray(results)) results = [results];
  20529. var numResults = results.length;
  20530. for (var ind = 0 ; ind < numResults; ind++) {
  20531. if (jmespath.strictDeepEqual(results[ind], expected)) {
  20532. return true;
  20533. }
  20534. }
  20535. return false;
  20536. },
  20537. status: function(resp, expected) {
  20538. var statusCode = resp.httpResponse.statusCode;
  20539. return (typeof statusCode === 'number') && (statusCode === expected);
  20540. },
  20541. error: function(resp, expected) {
  20542. if (typeof expected === 'string' && resp.error) {
  20543. return expected === resp.error.code;
  20544. }
  20545. // if expected is not string, can be boolean indicating presence of error
  20546. return expected === !!resp.error;
  20547. }
  20548. },
  20549. listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) {
  20550. add('RETRY_CHECK', 'retry', function(resp) {
  20551. var waiter = resp.request._waiter;
  20552. if (resp.error && resp.error.code === 'ResourceNotReady') {
  20553. resp.error.retryDelay = (waiter.config.delay || 0) * 1000;
  20554. }
  20555. });
  20556. add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS);
  20557. add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS);
  20558. }),
  20559. /**
  20560. * @return [AWS.Request]
  20561. */
  20562. wait: function wait(params, callback) {
  20563. if (typeof params === 'function') {
  20564. callback = params; params = undefined;
  20565. }
  20566. if (params && params.$waiter) {
  20567. params = AWS.util.copy(params);
  20568. if (typeof params.$waiter.delay === 'number') {
  20569. this.config.delay = params.$waiter.delay;
  20570. }
  20571. if (typeof params.$waiter.maxAttempts === 'number') {
  20572. this.config.maxAttempts = params.$waiter.maxAttempts;
  20573. }
  20574. delete params.$waiter;
  20575. }
  20576. var request = this.service.makeRequest(this.config.operation, params);
  20577. request._waiter = this;
  20578. request.response.maxRetries = this.config.maxAttempts;
  20579. request.addListeners(this.listeners);
  20580. if (callback) request.send(callback);
  20581. return request;
  20582. },
  20583. setSuccess: function setSuccess(resp) {
  20584. resp.error = null;
  20585. resp.data = resp.data || {};
  20586. resp.request.removeAllListeners('extractData');
  20587. },
  20588. setError: function setError(resp, retryable) {
  20589. resp.data = null;
  20590. resp.error = AWS.util.error(resp.error || new Error(), {
  20591. code: 'ResourceNotReady',
  20592. message: 'Resource is not in the state ' + this.state,
  20593. retryable: retryable
  20594. });
  20595. },
  20596. /**
  20597. * Loads waiter configuration from API configuration
  20598. *
  20599. * @api private
  20600. */
  20601. loadWaiterConfig: function loadWaiterConfig(state) {
  20602. if (!this.service.api.waiters[state]) {
  20603. throw new AWS.util.error(new Error(), {
  20604. code: 'StateNotFoundError',
  20605. message: 'State ' + state + ' not found.'
  20606. });
  20607. }
  20608. this.config = AWS.util.copy(this.service.api.waiters[state]);
  20609. }
  20610. });
  20611. /***/ }),
  20612. /***/ 948:
  20613. /***/ (function(module, __unusedexports, __webpack_require__) {
  20614. var escapeElement = __webpack_require__(965).escapeElement;
  20615. /**
  20616. * Represents an XML text value.
  20617. * @api private
  20618. */
  20619. function XmlText(value) {
  20620. this.value = value;
  20621. }
  20622. XmlText.prototype.toString = function () {
  20623. return escapeElement('' + this.value);
  20624. };
  20625. /**
  20626. * @api private
  20627. */
  20628. module.exports = {
  20629. XmlText: XmlText
  20630. };
  20631. /***/ }),
  20632. /***/ 951:
  20633. /***/ (function(module, __unusedexports, __webpack_require__) {
  20634. var AWS = __webpack_require__(395);
  20635. var inherit = AWS.util.inherit;
  20636. /**
  20637. * @api private
  20638. */
  20639. var expiresHeader = 'presigned-expires';
  20640. /**
  20641. * @api private
  20642. */
  20643. function signedUrlBuilder(request) {
  20644. var expires = request.httpRequest.headers[expiresHeader];
  20645. var signerClass = request.service.getSignerClass(request);
  20646. delete request.httpRequest.headers['User-Agent'];
  20647. delete request.httpRequest.headers['X-Amz-User-Agent'];
  20648. if (signerClass === AWS.Signers.V4) {
  20649. if (expires > 604800) { // one week expiry is invalid
  20650. var message = 'Presigning does not support expiry time greater ' +
  20651. 'than a week with SigV4 signing.';
  20652. throw AWS.util.error(new Error(), {
  20653. code: 'InvalidExpiryTime', message: message, retryable: false
  20654. });
  20655. }
  20656. request.httpRequest.headers[expiresHeader] = expires;
  20657. } else if (signerClass === AWS.Signers.S3) {
  20658. var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate();
  20659. request.httpRequest.headers[expiresHeader] = parseInt(
  20660. AWS.util.date.unixTimestamp(now) + expires, 10).toString();
  20661. } else {
  20662. throw AWS.util.error(new Error(), {
  20663. message: 'Presigning only supports S3 or SigV4 signing.',
  20664. code: 'UnsupportedSigner', retryable: false
  20665. });
  20666. }
  20667. }
  20668. /**
  20669. * @api private
  20670. */
  20671. function signedUrlSigner(request) {
  20672. var endpoint = request.httpRequest.endpoint;
  20673. var parsedUrl = AWS.util.urlParse(request.httpRequest.path);
  20674. var queryParams = {};
  20675. if (parsedUrl.search) {
  20676. queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1));
  20677. }
  20678. var auth = request.httpRequest.headers['Authorization'].split(' ');
  20679. if (auth[0] === 'AWS') {
  20680. auth = auth[1].split(':');
  20681. queryParams['Signature'] = auth.pop();
  20682. queryParams['AWSAccessKeyId'] = auth.join(':');
  20683. AWS.util.each(request.httpRequest.headers, function (key, value) {
  20684. if (key === expiresHeader) key = 'Expires';
  20685. if (key.indexOf('x-amz-meta-') === 0) {
  20686. // Delete existing, potentially not normalized key
  20687. delete queryParams[key];
  20688. key = key.toLowerCase();
  20689. }
  20690. queryParams[key] = value;
  20691. });
  20692. delete request.httpRequest.headers[expiresHeader];
  20693. delete queryParams['Authorization'];
  20694. delete queryParams['Host'];
  20695. } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing
  20696. auth.shift();
  20697. var rest = auth.join(' ');
  20698. var signature = rest.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];
  20699. queryParams['X-Amz-Signature'] = signature;
  20700. delete queryParams['Expires'];
  20701. }
  20702. // build URL
  20703. endpoint.pathname = parsedUrl.pathname;
  20704. endpoint.search = AWS.util.queryParamsToString(queryParams);
  20705. }
  20706. /**
  20707. * @api private
  20708. */
  20709. AWS.Signers.Presign = inherit({
  20710. /**
  20711. * @api private
  20712. */
  20713. sign: function sign(request, expireTime, callback) {
  20714. request.httpRequest.headers[expiresHeader] = expireTime || 3600;
  20715. request.on('build', signedUrlBuilder);
  20716. request.on('sign', signedUrlSigner);
  20717. request.removeListener('afterBuild',
  20718. AWS.EventListeners.Core.SET_CONTENT_LENGTH);
  20719. request.removeListener('afterBuild',
  20720. AWS.EventListeners.Core.COMPUTE_SHA256);
  20721. request.emit('beforePresign', [request]);
  20722. if (callback) {
  20723. request.build(function() {
  20724. if (this.response.error) callback(this.response.error);
  20725. else {
  20726. callback(null, AWS.util.urlFormat(request.httpRequest.endpoint));
  20727. }
  20728. });
  20729. } else {
  20730. request.build();
  20731. if (request.response.error) throw request.response.error;
  20732. return AWS.util.urlFormat(request.httpRequest.endpoint);
  20733. }
  20734. }
  20735. });
  20736. /**
  20737. * @api private
  20738. */
  20739. module.exports = AWS.Signers.Presign;
  20740. /***/ }),
  20741. /***/ 963:
  20742. /***/ (function(module, __unusedexports, __webpack_require__) {
  20743. "use strict";
  20744. var randomFromSeed = __webpack_require__(323);
  20745. var ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-';
  20746. var alphabet;
  20747. var previousSeed;
  20748. var shuffled;
  20749. function reset() {
  20750. shuffled = false;
  20751. }
  20752. function setCharacters(_alphabet_) {
  20753. if (!_alphabet_) {
  20754. if (alphabet !== ORIGINAL) {
  20755. alphabet = ORIGINAL;
  20756. reset();
  20757. }
  20758. return;
  20759. }
  20760. if (_alphabet_ === alphabet) {
  20761. return;
  20762. }
  20763. if (_alphabet_.length !== ORIGINAL.length) {
  20764. throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. You submitted ' + _alphabet_.length + ' characters: ' + _alphabet_);
  20765. }
  20766. var unique = _alphabet_.split('').filter(function(item, ind, arr){
  20767. return ind !== arr.lastIndexOf(item);
  20768. });
  20769. if (unique.length) {
  20770. throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. These characters were not unique: ' + unique.join(', '));
  20771. }
  20772. alphabet = _alphabet_;
  20773. reset();
  20774. }
  20775. function characters(_alphabet_) {
  20776. setCharacters(_alphabet_);
  20777. return alphabet;
  20778. }
  20779. function setSeed(seed) {
  20780. randomFromSeed.seed(seed);
  20781. if (previousSeed !== seed) {
  20782. reset();
  20783. previousSeed = seed;
  20784. }
  20785. }
  20786. function shuffle() {
  20787. if (!alphabet) {
  20788. setCharacters(ORIGINAL);
  20789. }
  20790. var sourceArray = alphabet.split('');
  20791. var targetArray = [];
  20792. var r = randomFromSeed.nextValue();
  20793. var characterIndex;
  20794. while (sourceArray.length > 0) {
  20795. r = randomFromSeed.nextValue();
  20796. characterIndex = Math.floor(r * sourceArray.length);
  20797. targetArray.push(sourceArray.splice(characterIndex, 1)[0]);
  20798. }
  20799. return targetArray.join('');
  20800. }
  20801. function getShuffled() {
  20802. if (shuffled) {
  20803. return shuffled;
  20804. }
  20805. shuffled = shuffle();
  20806. return shuffled;
  20807. }
  20808. /**
  20809. * lookup shuffled letter
  20810. * @param index
  20811. * @returns {string}
  20812. */
  20813. function lookup(index) {
  20814. var alphabetShuffled = getShuffled();
  20815. return alphabetShuffled[index];
  20816. }
  20817. function get () {
  20818. return alphabet || ORIGINAL;
  20819. }
  20820. module.exports = {
  20821. get: get,
  20822. characters: characters,
  20823. seed: setSeed,
  20824. lookup: lookup,
  20825. shuffled: getShuffled
  20826. };
  20827. /***/ }),
  20828. /***/ 964:
  20829. /***/ (function(module, __unusedexports, __webpack_require__) {
  20830. var Shape = __webpack_require__(682);
  20831. var util = __webpack_require__(153);
  20832. var property = util.property;
  20833. var memoizedProperty = util.memoizedProperty;
  20834. function Operation(name, operation, options) {
  20835. var self = this;
  20836. options = options || {};
  20837. property(this, 'name', operation.name || name);
  20838. property(this, 'api', options.api, false);
  20839. operation.http = operation.http || {};
  20840. property(this, 'endpoint', operation.endpoint);
  20841. property(this, 'httpMethod', operation.http.method || 'POST');
  20842. property(this, 'httpPath', operation.http.requestUri || '/');
  20843. property(this, 'authtype', operation.authtype || '');
  20844. property(
  20845. this,
  20846. 'endpointDiscoveryRequired',
  20847. operation.endpointdiscovery ?
  20848. (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') :
  20849. 'NULL'
  20850. );
  20851. memoizedProperty(this, 'input', function() {
  20852. if (!operation.input) {
  20853. return new Shape.create({type: 'structure'}, options);
  20854. }
  20855. return Shape.create(operation.input, options);
  20856. });
  20857. memoizedProperty(this, 'output', function() {
  20858. if (!operation.output) {
  20859. return new Shape.create({type: 'structure'}, options);
  20860. }
  20861. return Shape.create(operation.output, options);
  20862. });
  20863. memoizedProperty(this, 'errors', function() {
  20864. var list = [];
  20865. if (!operation.errors) return null;
  20866. for (var i = 0; i < operation.errors.length; i++) {
  20867. list.push(Shape.create(operation.errors[i], options));
  20868. }
  20869. return list;
  20870. });
  20871. memoizedProperty(this, 'paginator', function() {
  20872. return options.api.paginators[name];
  20873. });
  20874. if (options.documentation) {
  20875. property(this, 'documentation', operation.documentation);
  20876. property(this, 'documentationUrl', operation.documentationUrl);
  20877. }
  20878. // idempotentMembers only tracks top-level input shapes
  20879. memoizedProperty(this, 'idempotentMembers', function() {
  20880. var idempotentMembers = [];
  20881. var input = self.input;
  20882. var members = input.members;
  20883. if (!input.members) {
  20884. return idempotentMembers;
  20885. }
  20886. for (var name in members) {
  20887. if (!members.hasOwnProperty(name)) {
  20888. continue;
  20889. }
  20890. if (members[name].isIdempotent === true) {
  20891. idempotentMembers.push(name);
  20892. }
  20893. }
  20894. return idempotentMembers;
  20895. });
  20896. memoizedProperty(this, 'hasEventOutput', function() {
  20897. var output = self.output;
  20898. return hasEventStream(output);
  20899. });
  20900. }
  20901. function hasEventStream(topLevelShape) {
  20902. var members = topLevelShape.members;
  20903. var payload = topLevelShape.payload;
  20904. if (!topLevelShape.members) {
  20905. return false;
  20906. }
  20907. if (payload) {
  20908. var payloadMember = members[payload];
  20909. return payloadMember.isEventStream;
  20910. }
  20911. // check if any member is an event stream
  20912. for (var name in members) {
  20913. if (!members.hasOwnProperty(name)) {
  20914. if (members[name].isEventStream === true) {
  20915. return true;
  20916. }
  20917. }
  20918. }
  20919. return false;
  20920. }
  20921. /**
  20922. * @api private
  20923. */
  20924. module.exports = Operation;
  20925. /***/ }),
  20926. /***/ 965:
  20927. /***/ (function(module) {
  20928. /**
  20929. * Escapes characters that can not be in an XML element.
  20930. */
  20931. function escapeElement(value) {
  20932. return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  20933. }
  20934. /**
  20935. * @api private
  20936. */
  20937. module.exports = {
  20938. escapeElement: escapeElement
  20939. };
  20940. /***/ }),
  20941. /***/ 966:
  20942. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  20943. var AWS = __webpack_require__(395);
  20944. var STS = __webpack_require__(733);
  20945. /**
  20946. * Represents credentials retrieved from STS SAML support.
  20947. *
  20948. * By default this provider gets credentials using the
  20949. * {AWS.STS.assumeRoleWithSAML} service operation. This operation
  20950. * requires a `RoleArn` containing the ARN of the IAM trust policy for the
  20951. * application for which credentials will be given, as well as a `PrincipalArn`
  20952. * representing the ARN for the SAML identity provider. In addition, the
  20953. * `SAMLAssertion` must be set to the token provided by the identity
  20954. * provider. See {constructor} for an example on creating a credentials
  20955. * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values.
  20956. *
  20957. * ## Refreshing Credentials from Identity Service
  20958. *
  20959. * In addition to AWS credentials expiring after a given amount of time, the
  20960. * login token from the identity provider will also expire. Once this token
  20961. * expires, it will not be usable to refresh AWS credentials, and another
  20962. * token will be needed. The SDK does not manage refreshing of the token value,
  20963. * but this can be done through a "refresh token" supported by most identity
  20964. * providers. Consult the documentation for the identity provider for refreshing
  20965. * tokens. Once the refreshed token is acquired, you should make sure to update
  20966. * this new token in the credentials object's {params} property. The following
  20967. * code will update the SAMLAssertion, assuming you have retrieved an updated
  20968. * token from the identity provider:
  20969. *
  20970. * ```javascript
  20971. * AWS.config.credentials.params.SAMLAssertion = updatedToken;
  20972. * ```
  20973. *
  20974. * Future calls to `credentials.refresh()` will now use the new token.
  20975. *
  20976. * @!attribute params
  20977. * @return [map] the map of params passed to
  20978. * {AWS.STS.assumeRoleWithSAML}. To update the token, set the
  20979. * `params.SAMLAssertion` property.
  20980. */
  20981. AWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, {
  20982. /**
  20983. * Creates a new credentials object.
  20984. * @param (see AWS.STS.assumeRoleWithSAML)
  20985. * @example Creating a new credentials object
  20986. * AWS.config.credentials = new AWS.SAMLCredentials({
  20987. * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole',
  20988. * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal',
  20989. * SAMLAssertion: 'base64-token', // base64-encoded token from IdP
  20990. * });
  20991. * @see AWS.STS.assumeRoleWithSAML
  20992. */
  20993. constructor: function SAMLCredentials(params) {
  20994. AWS.Credentials.call(this);
  20995. this.expired = true;
  20996. this.params = params;
  20997. },
  20998. /**
  20999. * Refreshes credentials using {AWS.STS.assumeRoleWithSAML}
  21000. *
  21001. * @callback callback function(err)
  21002. * Called when the STS service responds (or fails). When
  21003. * this callback is called with no error, it means that the credentials
  21004. * information has been loaded into the object (as the `accessKeyId`,
  21005. * `secretAccessKey`, and `sessionToken` properties).
  21006. * @param err [Error] if an error occurred, this value will be filled
  21007. * @see get
  21008. */
  21009. refresh: function refresh(callback) {
  21010. this.coalesceRefresh(callback || AWS.util.fn.callback);
  21011. },
  21012. /**
  21013. * @api private
  21014. */
  21015. load: function load(callback) {
  21016. var self = this;
  21017. self.createClients();
  21018. self.service.assumeRoleWithSAML(function (err, data) {
  21019. if (!err) {
  21020. self.service.credentialsFrom(data, self);
  21021. }
  21022. callback(err);
  21023. });
  21024. },
  21025. /**
  21026. * @api private
  21027. */
  21028. createClients: function() {
  21029. this.service = this.service || new STS({params: this.params});
  21030. }
  21031. });
  21032. /***/ }),
  21033. /***/ 977:
  21034. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  21035. var AWS = __webpack_require__(395);
  21036. /**
  21037. * @api private
  21038. */
  21039. AWS.ParamValidator = AWS.util.inherit({
  21040. /**
  21041. * Create a new validator object.
  21042. *
  21043. * @param validation [Boolean|map] whether input parameters should be
  21044. * validated against the operation description before sending the
  21045. * request. Pass a map to enable any of the following specific
  21046. * validation features:
  21047. *
  21048. * * **min** [Boolean] &mdash; Validates that a value meets the min
  21049. * constraint. This is enabled by default when paramValidation is set
  21050. * to `true`.
  21051. * * **max** [Boolean] &mdash; Validates that a value meets the max
  21052. * constraint.
  21053. * * **pattern** [Boolean] &mdash; Validates that a string value matches a
  21054. * regular expression.
  21055. * * **enum** [Boolean] &mdash; Validates that a string value matches one
  21056. * of the allowable enum values.
  21057. */
  21058. constructor: function ParamValidator(validation) {
  21059. if (validation === true || validation === undefined) {
  21060. validation = {'min': true};
  21061. }
  21062. this.validation = validation;
  21063. },
  21064. validate: function validate(shape, params, context) {
  21065. this.errors = [];
  21066. this.validateMember(shape, params || {}, context || 'params');
  21067. if (this.errors.length > 1) {
  21068. var msg = this.errors.join('\n* ');
  21069. msg = 'There were ' + this.errors.length +
  21070. ' validation errors:\n* ' + msg;
  21071. throw AWS.util.error(new Error(msg),
  21072. {code: 'MultipleValidationErrors', errors: this.errors});
  21073. } else if (this.errors.length === 1) {
  21074. throw this.errors[0];
  21075. } else {
  21076. return true;
  21077. }
  21078. },
  21079. fail: function fail(code, message) {
  21080. this.errors.push(AWS.util.error(new Error(message), {code: code}));
  21081. },
  21082. validateStructure: function validateStructure(shape, params, context) {
  21083. this.validateType(params, context, ['object'], 'structure');
  21084. var paramName;
  21085. for (var i = 0; shape.required && i < shape.required.length; i++) {
  21086. paramName = shape.required[i];
  21087. var value = params[paramName];
  21088. if (value === undefined || value === null) {
  21089. this.fail('MissingRequiredParameter',
  21090. 'Missing required key \'' + paramName + '\' in ' + context);
  21091. }
  21092. }
  21093. // validate hash members
  21094. for (paramName in params) {
  21095. if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue;
  21096. var paramValue = params[paramName],
  21097. memberShape = shape.members[paramName];
  21098. if (memberShape !== undefined) {
  21099. var memberContext = [context, paramName].join('.');
  21100. this.validateMember(memberShape, paramValue, memberContext);
  21101. } else {
  21102. this.fail('UnexpectedParameter',
  21103. 'Unexpected key \'' + paramName + '\' found in ' + context);
  21104. }
  21105. }
  21106. return true;
  21107. },
  21108. validateMember: function validateMember(shape, param, context) {
  21109. switch (shape.type) {
  21110. case 'structure':
  21111. return this.validateStructure(shape, param, context);
  21112. case 'list':
  21113. return this.validateList(shape, param, context);
  21114. case 'map':
  21115. return this.validateMap(shape, param, context);
  21116. default:
  21117. return this.validateScalar(shape, param, context);
  21118. }
  21119. },
  21120. validateList: function validateList(shape, params, context) {
  21121. if (this.validateType(params, context, [Array])) {
  21122. this.validateRange(shape, params.length, context, 'list member count');
  21123. // validate array members
  21124. for (var i = 0; i < params.length; i++) {
  21125. this.validateMember(shape.member, params[i], context + '[' + i + ']');
  21126. }
  21127. }
  21128. },
  21129. validateMap: function validateMap(shape, params, context) {
  21130. if (this.validateType(params, context, ['object'], 'map')) {
  21131. // Build up a count of map members to validate range traits.
  21132. var mapCount = 0;
  21133. for (var param in params) {
  21134. if (!Object.prototype.hasOwnProperty.call(params, param)) continue;
  21135. // Validate any map key trait constraints
  21136. this.validateMember(shape.key, param,
  21137. context + '[key=\'' + param + '\']');
  21138. this.validateMember(shape.value, params[param],
  21139. context + '[\'' + param + '\']');
  21140. mapCount++;
  21141. }
  21142. this.validateRange(shape, mapCount, context, 'map member count');
  21143. }
  21144. },
  21145. validateScalar: function validateScalar(shape, value, context) {
  21146. switch (shape.type) {
  21147. case null:
  21148. case undefined:
  21149. case 'string':
  21150. return this.validateString(shape, value, context);
  21151. case 'base64':
  21152. case 'binary':
  21153. return this.validatePayload(value, context);
  21154. case 'integer':
  21155. case 'float':
  21156. return this.validateNumber(shape, value, context);
  21157. case 'boolean':
  21158. return this.validateType(value, context, ['boolean']);
  21159. case 'timestamp':
  21160. return this.validateType(value, context, [Date,
  21161. /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'number'],
  21162. 'Date object, ISO-8601 string, or a UNIX timestamp');
  21163. default:
  21164. return this.fail('UnkownType', 'Unhandled type ' +
  21165. shape.type + ' for ' + context);
  21166. }
  21167. },
  21168. validateString: function validateString(shape, value, context) {
  21169. var validTypes = ['string'];
  21170. if (shape.isJsonValue) {
  21171. validTypes = validTypes.concat(['number', 'object', 'boolean']);
  21172. }
  21173. if (value !== null && this.validateType(value, context, validTypes)) {
  21174. this.validateEnum(shape, value, context);
  21175. this.validateRange(shape, value.length, context, 'string length');
  21176. this.validatePattern(shape, value, context);
  21177. this.validateUri(shape, value, context);
  21178. }
  21179. },
  21180. validateUri: function validateUri(shape, value, context) {
  21181. if (shape['location'] === 'uri') {
  21182. if (value.length === 0) {
  21183. this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,'
  21184. + ' but found "' + value +'" for ' + context);
  21185. }
  21186. }
  21187. },
  21188. validatePattern: function validatePattern(shape, value, context) {
  21189. if (this.validation['pattern'] && shape['pattern'] !== undefined) {
  21190. if (!(new RegExp(shape['pattern'])).test(value)) {
  21191. this.fail('PatternMatchError', 'Provided value "' + value + '" '
  21192. + 'does not match regex pattern /' + shape['pattern'] + '/ for '
  21193. + context);
  21194. }
  21195. }
  21196. },
  21197. validateRange: function validateRange(shape, value, context, descriptor) {
  21198. if (this.validation['min']) {
  21199. if (shape['min'] !== undefined && value < shape['min']) {
  21200. this.fail('MinRangeError', 'Expected ' + descriptor + ' >= '
  21201. + shape['min'] + ', but found ' + value + ' for ' + context);
  21202. }
  21203. }
  21204. if (this.validation['max']) {
  21205. if (shape['max'] !== undefined && value > shape['max']) {
  21206. this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= '
  21207. + shape['max'] + ', but found ' + value + ' for ' + context);
  21208. }
  21209. }
  21210. },
  21211. validateEnum: function validateRange(shape, value, context) {
  21212. if (this.validation['enum'] && shape['enum'] !== undefined) {
  21213. // Fail if the string value is not present in the enum list
  21214. if (shape['enum'].indexOf(value) === -1) {
  21215. this.fail('EnumError', 'Found string value of ' + value + ', but '
  21216. + 'expected ' + shape['enum'].join('|') + ' for ' + context);
  21217. }
  21218. }
  21219. },
  21220. validateType: function validateType(value, context, acceptedTypes, type) {
  21221. // We will not log an error for null or undefined, but we will return
  21222. // false so that callers know that the expected type was not strictly met.
  21223. if (value === null || value === undefined) return false;
  21224. var foundInvalidType = false;
  21225. for (var i = 0; i < acceptedTypes.length; i++) {
  21226. if (typeof acceptedTypes[i] === 'string') {
  21227. if (typeof value === acceptedTypes[i]) return true;
  21228. } else if (acceptedTypes[i] instanceof RegExp) {
  21229. if ((value || '').toString().match(acceptedTypes[i])) return true;
  21230. } else {
  21231. if (value instanceof acceptedTypes[i]) return true;
  21232. if (AWS.util.isType(value, acceptedTypes[i])) return true;
  21233. if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice();
  21234. acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]);
  21235. }
  21236. foundInvalidType = true;
  21237. }
  21238. var acceptedType = type;
  21239. if (!acceptedType) {
  21240. acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1');
  21241. }
  21242. var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : '';
  21243. this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' +
  21244. vowel + ' ' + acceptedType);
  21245. return false;
  21246. },
  21247. validateNumber: function validateNumber(shape, value, context) {
  21248. if (value === null || value === undefined) return;
  21249. if (typeof value === 'string') {
  21250. var castedValue = parseFloat(value);
  21251. if (castedValue.toString() === value) value = castedValue;
  21252. }
  21253. if (this.validateType(value, context, ['number'])) {
  21254. this.validateRange(shape, value, context, 'numeric value');
  21255. }
  21256. },
  21257. validatePayload: function validatePayload(value, context) {
  21258. if (value === null || value === undefined) return;
  21259. if (typeof value === 'string') return;
  21260. if (value && typeof value.byteLength === 'number') return; // typed arrays
  21261. if (AWS.util.isNode()) { // special check for buffer/stream in Node.js
  21262. var Stream = AWS.util.stream.Stream;
  21263. if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return;
  21264. } else {
  21265. if (typeof Blob !== void 0 && value instanceof Blob) return;
  21266. }
  21267. var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView'];
  21268. if (value) {
  21269. for (var i = 0; i < types.length; i++) {
  21270. if (AWS.util.isType(value, types[i])) return;
  21271. if (AWS.util.typeName(value.constructor) === types[i]) return;
  21272. }
  21273. }
  21274. this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' +
  21275. 'string, Buffer, Stream, Blob, or typed array object');
  21276. }
  21277. });
  21278. /***/ }),
  21279. /***/ 982:
  21280. /***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {
  21281. var AWS = __webpack_require__(395);
  21282. var proc = __webpack_require__(129);
  21283. var iniLoader = AWS.util.iniLoader;
  21284. /**
  21285. * Represents credentials loaded from shared credentials file
  21286. * (defaulting to ~/.aws/credentials or defined by the
  21287. * `AWS_SHARED_CREDENTIALS_FILE` environment variable).
  21288. *
  21289. * ## Using process credentials
  21290. *
  21291. * The credentials file can specify a credential provider that executes
  21292. * a given process and attempts to read its stdout to recieve a JSON payload
  21293. * containing the credentials:
  21294. *
  21295. * [default]
  21296. * credential_process = /usr/bin/credential_proc
  21297. *
  21298. * Automatically handles refreshing credentials if an Expiration time is
  21299. * provided in the credentials payload. Credentials supplied in the same profile
  21300. * will take precedence over the credential_process.
  21301. *
  21302. * Sourcing credentials from an external process can potentially be dangerous,
  21303. * so proceed with caution. Other credential providers should be preferred if
  21304. * at all possible. If using this option, you should make sure that the shared
  21305. * credentials file is as locked down as possible using security best practices
  21306. * for your operating system.
  21307. *
  21308. * ## Using custom profiles
  21309. *
  21310. * The SDK supports loading credentials for separate profiles. This can be done
  21311. * in two ways:
  21312. *
  21313. * 1. Set the `AWS_PROFILE` environment variable in your process prior to
  21314. * loading the SDK.
  21315. * 2. Directly load the AWS.ProcessCredentials provider:
  21316. *
  21317. * ```javascript
  21318. * var creds = new AWS.ProcessCredentials({profile: 'myprofile'});
  21319. * AWS.config.credentials = creds;
  21320. * ```
  21321. *
  21322. * @!macro nobrowser
  21323. */
  21324. AWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, {
  21325. /**
  21326. * Creates a new ProcessCredentials object.
  21327. *
  21328. * @param options [map] a set of options
  21329. * @option options profile [String] (AWS_PROFILE env var or 'default')
  21330. * the name of the profile to load.
  21331. * @option options filename [String] ('~/.aws/credentials' or defined by
  21332. * AWS_SHARED_CREDENTIALS_FILE process env var)
  21333. * the filename to use when loading credentials.
  21334. * @option options callback [Function] (err) Credentials are eagerly loaded
  21335. * by the constructor. When the callback is called with no error, the
  21336. * credentials have been loaded successfully.
  21337. */
  21338. constructor: function ProcessCredentials(options) {
  21339. AWS.Credentials.call(this);
  21340. options = options || {};
  21341. this.filename = options.filename;
  21342. this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;
  21343. this.get(options.callback || AWS.util.fn.noop);
  21344. },
  21345. /**
  21346. * @api private
  21347. */
  21348. load: function load(callback) {
  21349. var self = this;
  21350. try {
  21351. var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);
  21352. var profile = profiles[this.profile] || {};
  21353. if (Object.keys(profile).length === 0) {
  21354. throw AWS.util.error(
  21355. new Error('Profile ' + this.profile + ' not found'),
  21356. { code: 'ProcessCredentialsProviderFailure' }
  21357. );
  21358. }
  21359. if (profile['credential_process']) {
  21360. this.loadViaCredentialProcess(profile, function(err, data) {
  21361. if (err) {
  21362. callback(err, null);
  21363. } else {
  21364. self.expired = false;
  21365. self.accessKeyId = data.AccessKeyId;
  21366. self.secretAccessKey = data.SecretAccessKey;
  21367. self.sessionToken = data.SessionToken;
  21368. if (data.Expiration) {
  21369. self.expireTime = new Date(data.Expiration);
  21370. }
  21371. callback(null);
  21372. }
  21373. });
  21374. } else {
  21375. throw AWS.util.error(
  21376. new Error('Profile ' + this.profile + ' did not include credential process'),
  21377. { code: 'ProcessCredentialsProviderFailure' }
  21378. );
  21379. }
  21380. } catch (err) {
  21381. callback(err);
  21382. }
  21383. },
  21384. /**
  21385. * Executes the credential_process and retrieves
  21386. * credentials from the output
  21387. * @api private
  21388. * @param profile [map] credentials profile
  21389. * @throws ProcessCredentialsProviderFailure
  21390. */
  21391. loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) {
  21392. proc.exec(profile['credential_process'], function(err, stdOut, stdErr) {
  21393. if (err) {
  21394. callback(AWS.util.error(
  21395. new Error('credential_process returned error'),
  21396. { code: 'ProcessCredentialsProviderFailure'}
  21397. ), null);
  21398. } else {
  21399. try {
  21400. var credData = JSON.parse(stdOut);
  21401. if (credData.Expiration) {
  21402. var currentTime = AWS.util.date.getDate();
  21403. var expireTime = new Date(credData.Expiration);
  21404. if (expireTime < currentTime) {
  21405. throw Error('credential_process returned expired credentials');
  21406. }
  21407. }
  21408. if (credData.Version !== 1) {
  21409. throw Error('credential_process does not return Version == 1');
  21410. }
  21411. callback(null, credData);
  21412. } catch (err) {
  21413. callback(AWS.util.error(
  21414. new Error(err.message),
  21415. { code: 'ProcessCredentialsProviderFailure'}
  21416. ), null);
  21417. }
  21418. }
  21419. });
  21420. },
  21421. /**
  21422. * Loads the credentials from the credential process
  21423. *
  21424. * @callback callback function(err)
  21425. * Called after the credential process has been executed. When this
  21426. * callback is called with no error, it means that the credentials
  21427. * information has been loaded into the object (as the `accessKeyId`,
  21428. * `secretAccessKey`, and `sessionToken` properties).
  21429. * @param err [Error] if an error occurred, this value will be filled
  21430. * @see get
  21431. */
  21432. refresh: function refresh(callback) {
  21433. iniLoader.clearCachedFiles();
  21434. this.coalesceRefresh(callback || AWS.util.fn.callback);
  21435. }
  21436. });
  21437. /***/ }),
  21438. /***/ 987:
  21439. /***/ (function(module, __unusedexports, __webpack_require__) {
  21440. var AWS = __webpack_require__(395);
  21441. var util = __webpack_require__(153);
  21442. var endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED'];
  21443. /**
  21444. * Generate key (except resources and operation part) to index the endpoints in the cache
  21445. * If input shape has endpointdiscoveryid trait then use
  21446. * accessKey + operation + resources + region + service as cache key
  21447. * If input shape doesn't have endpointdiscoveryid trait then use
  21448. * accessKey + region + service as cache key
  21449. * @return [map<String,String>] object with keys to index endpoints.
  21450. * @api private
  21451. */
  21452. function getCacheKey(request) {
  21453. var service = request.service;
  21454. var api = service.api || {};
  21455. var operations = api.operations;
  21456. var identifiers = {};
  21457. if (service.config.region) {
  21458. identifiers.region = service.config.region;
  21459. }
  21460. if (api.serviceId) {
  21461. identifiers.serviceId = api.serviceId;
  21462. }
  21463. if (service.config.credentials.accessKeyId) {
  21464. identifiers.accessKeyId = service.config.credentials.accessKeyId;
  21465. }
  21466. return identifiers;
  21467. }
  21468. /**
  21469. * Recursive helper for marshallCustomIdentifiers().
  21470. * Looks for required string input members that have 'endpointdiscoveryid' trait.
  21471. * @api private
  21472. */
  21473. function marshallCustomIdentifiersHelper(result, params, shape) {
  21474. if (!shape || params === undefined || params === null) return;
  21475. if (shape.type === 'structure' && shape.required && shape.required.length > 0) {
  21476. util.arrayEach(shape.required, function(name) {
  21477. var memberShape = shape.members[name];
  21478. if (memberShape.endpointDiscoveryId === true) {
  21479. var locationName = memberShape.isLocationName ? memberShape.name : name;
  21480. result[locationName] = String(params[name]);
  21481. } else {
  21482. marshallCustomIdentifiersHelper(result, params[name], memberShape);
  21483. }
  21484. });
  21485. }
  21486. }
  21487. /**
  21488. * Get custom identifiers for cache key.
  21489. * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait.
  21490. * @param [object] request object
  21491. * @param [object] input shape of the given operation's api
  21492. * @api private
  21493. */
  21494. function marshallCustomIdentifiers(request, shape) {
  21495. var identifiers = {};
  21496. marshallCustomIdentifiersHelper(identifiers, request.params, shape);
  21497. return identifiers;
  21498. }
  21499. /**
  21500. * Call endpoint discovery operation when it's optional.
  21501. * When endpoint is available in cache then use the cached endpoints. If endpoints
  21502. * are unavailable then use regional endpoints and call endpoint discovery operation
  21503. * asynchronously. This is turned off by default.
  21504. * @param [object] request object
  21505. * @api private
  21506. */
  21507. function optionalDiscoverEndpoint(request) {
  21508. var service = request.service;
  21509. var api = service.api;
  21510. var operationModel = api.operations ? api.operations[request.operation] : undefined;
  21511. var inputShape = operationModel ? operationModel.input : undefined;
  21512. var identifiers = marshallCustomIdentifiers(request, inputShape);
  21513. var cacheKey = getCacheKey(request);
  21514. if (Object.keys(identifiers).length > 0) {
  21515. cacheKey = util.update(cacheKey, identifiers);
  21516. if (operationModel) cacheKey.operation = operationModel.name;
  21517. }
  21518. var endpoints = AWS.endpointCache.get(cacheKey);
  21519. if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') {
  21520. //endpoint operation is being made but response not yet received
  21521. //or endpoint operation just failed in 1 minute
  21522. return;
  21523. } else if (endpoints && endpoints.length > 0) {
  21524. //found endpoint record from cache
  21525. request.httpRequest.updateEndpoint(endpoints[0].Address);
  21526. } else {
  21527. //endpoint record not in cache or outdated. make discovery operation
  21528. var endpointRequest = service.makeRequest(api.endpointOperation, {
  21529. Operation: operationModel.name,
  21530. Identifiers: identifiers,
  21531. });
  21532. addApiVersionHeader(endpointRequest);
  21533. endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);
  21534. endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK);
  21535. //put in a placeholder for endpoints already requested, prevent
  21536. //too much in-flight calls
  21537. AWS.endpointCache.put(cacheKey, [{
  21538. Address: '',
  21539. CachePeriodInMinutes: 1
  21540. }]);
  21541. endpointRequest.send(function(err, data) {
  21542. if (data && data.Endpoints) {
  21543. AWS.endpointCache.put(cacheKey, data.Endpoints);
  21544. } else if (err) {
  21545. AWS.endpointCache.put(cacheKey, [{
  21546. Address: '',
  21547. CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute
  21548. }]);
  21549. }
  21550. });
  21551. }
  21552. }
  21553. var requestQueue = {};
  21554. /**
  21555. * Call endpoint discovery operation when it's required.
  21556. * When endpoint is available in cache then use cached ones. If endpoints are
  21557. * unavailable then SDK should call endpoint operation then use returned new
  21558. * endpoint for the api call. SDK will automatically attempt to do endpoint
  21559. * discovery. This is turned off by default
  21560. * @param [object] request object
  21561. * @api private
  21562. */
  21563. function requiredDiscoverEndpoint(request, done) {
  21564. var service = request.service;
  21565. var api = service.api;
  21566. var operationModel = api.operations ? api.operations[request.operation] : undefined;
  21567. var inputShape = operationModel ? operationModel.input : undefined;
  21568. var identifiers = marshallCustomIdentifiers(request, inputShape);
  21569. var cacheKey = getCacheKey(request);
  21570. if (Object.keys(identifiers).length > 0) {
  21571. cacheKey = util.update(cacheKey, identifiers);
  21572. if (operationModel) cacheKey.operation = operationModel.name;
  21573. }
  21574. var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey);
  21575. var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys
  21576. if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') {
  21577. //endpoint operation is being made but response not yet received
  21578. //push request object to a pending queue
  21579. if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = [];
  21580. requestQueue[cacheKeyStr].push({request: request, callback: done});
  21581. return;
  21582. } else if (endpoints && endpoints.length > 0) {
  21583. request.httpRequest.updateEndpoint(endpoints[0].Address);
  21584. done();
  21585. } else {
  21586. var endpointRequest = service.makeRequest(api.endpointOperation, {
  21587. Operation: operationModel.name,
  21588. Identifiers: identifiers,
  21589. });
  21590. endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);
  21591. addApiVersionHeader(endpointRequest);
  21592. //put in a placeholder for endpoints already requested, prevent
  21593. //too much in-flight calls
  21594. AWS.endpointCache.put(cacheKeyStr, [{
  21595. Address: '',
  21596. CachePeriodInMinutes: 60 //long-live cache
  21597. }]);
  21598. endpointRequest.send(function(err, data) {
  21599. if (err) {
  21600. request.response.error = util.error(err, { retryable: false });
  21601. AWS.endpointCache.remove(cacheKey);
  21602. //fail all the pending requests in batch
  21603. if (requestQueue[cacheKeyStr]) {
  21604. var pendingRequests = requestQueue[cacheKeyStr];
  21605. util.arrayEach(pendingRequests, function(requestContext) {
  21606. requestContext.request.response.error = util.error(err, { retryable: false });
  21607. requestContext.callback();
  21608. });
  21609. delete requestQueue[cacheKeyStr];
  21610. }
  21611. } else if (data) {
  21612. AWS.endpointCache.put(cacheKeyStr, data.Endpoints);
  21613. request.httpRequest.updateEndpoint(data.Endpoints[0].Address);
  21614. //update the endpoint for all the pending requests in batch
  21615. if (requestQueue[cacheKeyStr]) {
  21616. var pendingRequests = requestQueue[cacheKeyStr];
  21617. util.arrayEach(pendingRequests, function(requestContext) {
  21618. requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address);
  21619. requestContext.callback();
  21620. });
  21621. delete requestQueue[cacheKeyStr];
  21622. }
  21623. }
  21624. done();
  21625. });
  21626. }
  21627. }
  21628. /**
  21629. * add api version header to endpoint operation
  21630. * @api private
  21631. */
  21632. function addApiVersionHeader(endpointRequest) {
  21633. var api = endpointRequest.service.api;
  21634. var apiVersion = api.apiVersion;
  21635. if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) {
  21636. endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion;
  21637. }
  21638. }
  21639. /**
  21640. * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid
  21641. * endpoint from cache.
  21642. * @api private
  21643. */
  21644. function invalidateCachedEndpoints(response) {
  21645. var error = response.error;
  21646. var httpResponse = response.httpResponse;
  21647. if (error &&
  21648. (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)
  21649. ) {
  21650. var request = response.request;
  21651. var operations = request.service.api.operations || {};
  21652. var inputShape = operations[request.operation] ? operations[request.operation].input : undefined;
  21653. var identifiers = marshallCustomIdentifiers(request, inputShape);
  21654. var cacheKey = getCacheKey(request);
  21655. if (Object.keys(identifiers).length > 0) {
  21656. cacheKey = util.update(cacheKey, identifiers);
  21657. if (operations[request.operation]) cacheKey.operation = operations[request.operation].name;
  21658. }
  21659. AWS.endpointCache.remove(cacheKey);
  21660. }
  21661. }
  21662. /**
  21663. * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime.
  21664. * @param [object] client Service client object.
  21665. * @api private
  21666. */
  21667. function hasCustomEndpoint(client) {
  21668. //if set endpoint is set for specific client, enable endpoint discovery will raise an error.
  21669. if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {
  21670. throw util.error(new Error(), {
  21671. code: 'ConfigurationException',
  21672. message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.'
  21673. });
  21674. };
  21675. var svcConfig = AWS.config[client.serviceIdentifier] || {};
  21676. return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint));
  21677. }
  21678. /**
  21679. * @api private
  21680. */
  21681. function isFalsy(value) {
  21682. return ['false', '0'].indexOf(value) >= 0;
  21683. }
  21684. /**
  21685. * If endpoint discovery should perform for this request when no operation requires endpoint
  21686. * discovery for the given service.
  21687. * SDK performs config resolution in order like below:
  21688. * 1. If set in client configuration.
  21689. * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY.
  21690. * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'.
  21691. * @param [object] request request object.
  21692. * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this
  21693. * function returns undefined
  21694. * @api private
  21695. */
  21696. function resolveEndpointDiscoveryConfig(request) {
  21697. var service = request.service || {};
  21698. if (service.config.endpointDiscoveryEnabled !== undefined) {
  21699. return service.config.endpointDiscoveryEnabled;
  21700. }
  21701. //shared ini file is only available in Node
  21702. //not to check env in browser
  21703. if (util.isBrowser()) return undefined;
  21704. // If any of recognized endpoint discovery config env is set
  21705. for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) {
  21706. var env = endpointDiscoveryEnabledEnvs[i];
  21707. if (Object.prototype.hasOwnProperty.call(process.env, env)) {
  21708. if (process.env[env] === '' || process.env[env] === undefined) {
  21709. throw util.error(new Error(), {
  21710. code: 'ConfigurationException',
  21711. message: 'environmental variable ' + env + ' cannot be set to nothing'
  21712. });
  21713. }
  21714. return !isFalsy(process.env[env]);
  21715. }
  21716. }
  21717. var configFile = {};
  21718. try {
  21719. configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({
  21720. isConfig: true,
  21721. filename: process.env[AWS.util.sharedConfigFileEnv]
  21722. }) : {};
  21723. } catch (e) {}
  21724. var sharedFileConfig = configFile[
  21725. process.env.AWS_PROFILE || AWS.util.defaultProfile
  21726. ] || {};
  21727. if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) {
  21728. if (sharedFileConfig.endpoint_discovery_enabled === undefined) {
  21729. throw util.error(new Error(), {
  21730. code: 'ConfigurationException',
  21731. message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing'
  21732. });
  21733. }
  21734. return !isFalsy(sharedFileConfig.endpoint_discovery_enabled);
  21735. }
  21736. return undefined;
  21737. }
  21738. /**
  21739. * attach endpoint discovery logic to request object
  21740. * @param [object] request
  21741. * @api private
  21742. */
  21743. function discoverEndpoint(request, done) {
  21744. var service = request.service || {};
  21745. if (hasCustomEndpoint(service) || request.isPresigned()) return done();
  21746. var operations = service.api.operations || {};
  21747. var operationModel = operations[request.operation];
  21748. var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL';
  21749. var isEnabled = resolveEndpointDiscoveryConfig(request);
  21750. var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery;
  21751. if (isEnabled || hasRequiredEndpointDiscovery) {
  21752. // Once a customer enables endpoint discovery, the SDK should start appending
  21753. // the string endpoint-discovery to the user-agent on all requests.
  21754. request.httpRequest.appendToUserAgent('endpoint-discovery');
  21755. }
  21756. switch (isEndpointDiscoveryRequired) {
  21757. case 'OPTIONAL':
  21758. if (isEnabled || hasRequiredEndpointDiscovery) {
  21759. // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery
  21760. // by default for all operations of that service, including operations where endpoint discovery is optional.
  21761. optionalDiscoverEndpoint(request);
  21762. request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);
  21763. }
  21764. done();
  21765. break;
  21766. case 'REQUIRED':
  21767. if (isEnabled === false) {
  21768. // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client,
  21769. // then the SDK must return a clear and actionable exception.
  21770. request.response.error = util.error(new Error(), {
  21771. code: 'ConfigurationException',
  21772. message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation +
  21773. '() requires it. Please check your configurations.'
  21774. });
  21775. done();
  21776. break;
  21777. }
  21778. request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);
  21779. requiredDiscoverEndpoint(request, done);
  21780. break;
  21781. case 'NULL':
  21782. default:
  21783. done();
  21784. break;
  21785. }
  21786. }
  21787. module.exports = {
  21788. discoverEndpoint: discoverEndpoint,
  21789. requiredDiscoverEndpoint: requiredDiscoverEndpoint,
  21790. optionalDiscoverEndpoint: optionalDiscoverEndpoint,
  21791. marshallCustomIdentifiers: marshallCustomIdentifiers,
  21792. getCacheKey: getCacheKey,
  21793. invalidateCachedEndpoint: invalidateCachedEndpoints,
  21794. };
  21795. /***/ }),
  21796. /***/ 992:
  21797. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  21798. // Generated by CoffeeScript 1.12.7
  21799. (function() {
  21800. "use strict";
  21801. var builder, defaults, parser, processors,
  21802. extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  21803. hasProp = {}.hasOwnProperty;
  21804. defaults = __webpack_require__(514);
  21805. builder = __webpack_require__(476);
  21806. parser = __webpack_require__(885);
  21807. processors = __webpack_require__(350);
  21808. exports.defaults = defaults.defaults;
  21809. exports.processors = processors;
  21810. exports.ValidationError = (function(superClass) {
  21811. extend(ValidationError, superClass);
  21812. function ValidationError(message) {
  21813. this.message = message;
  21814. }
  21815. return ValidationError;
  21816. })(Error);
  21817. exports.Builder = builder.Builder;
  21818. exports.Parser = parser.Parser;
  21819. exports.parseString = parser.parseString;
  21820. }).call(this);
  21821. /***/ })
  21822. /******/ });