diff --git a/build/aws.js b/build/aws.js index ad2bbec..f723fb7 100644 --- a/build/aws.js +++ b/build/aws.js @@ -1,2 +1,2 @@ -(()=>{var e={393:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;rs});var s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"awsConfig",void 0),i(this,"serviceName",void 0),i(this,"_host",void 0),i(this,"_scheme",void 0),this.awsConfig=t,this.serviceName=r}var t,r,n;return t=e,(r=[{key:"host",get:function(){return null==this._host&&(this._host="".concat(this.serviceName,".").concat(this.awsConfig.region,".").concat(this.awsConfig.endpoint)),this._host},set:function(e){this._host=e}},{key:"scheme",get:function(){return null==this._scheme&&(this._scheme=this.awsConfig.scheme),this._scheme},set:function(e){this._scheme=e}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},223:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=s();return function(){var r,o=u(e);if(t){var i=u(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},i(e)}function a(e,t,r){return a=s()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o},a.apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;rv,o:()=>p});var p=function(){function e(t){if(f(this,e),d(this,"region",void 0),d(this,"accessKeyId",void 0),d(this,"secretAccessKey",void 0),d(this,"sessionToken",void 0),d(this,"scheme","https"),d(this,"endpoint","amazonaws.com"),!t.region||""===t.region)throw new v('invalid AWS region; reason: expected a valid AWS region name (e.g. "us-east-1"), got `'.concat(t.region,"`"));if(!t.accessKeyId||""===t.accessKeyId)throw new v("invalid AWS access key ID; reason: expected a non empty string, got `".concat(t.accessKeyId,"`"));if(t.accessKeyId.length<16||t.accessKeyId.length>128)throw new v("invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ".concat(t.accessKeyId.length));if(!t.secretAccessKey||""===t.secretAccessKey)throw new v("invalid AWS secret access key; reason: expected a non empty string, got `".concat(t.secretAccessKey,"`"));if(t.secretAccessKey.length<16||t.secretAccessKey.length>128)throw new v("invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ".concat(t.secretAccessKey.length));this.region=t.region,this.accessKeyId=t.accessKeyId,this.secretAccessKey=t.secretAccessKey,void 0!==t.sessionToken&&(this.sessionToken=t.sessionToken),void 0!==t.scheme&&(this.scheme=t.scheme),void 0!==t.endpoint&&(this.endpoint=t.endpoint)}return h(e,null,[{key:"fromEnvironment",value:function(t){return new e({region:__ENV.AWS_REGION,accessKeyId:__ENV.AWS_ACCESS_KEY_ID,secretAccessKey:__ENV.AWS_SECRET_ACCESS_KEY,sessionToken:__ENV.AWS_SESSION_TOKEN,scheme:null==t?void 0:t.scheme,endpoint:null==t?void 0:t.endpoint})}}]),e}(),v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(r,e);var t=o(r);function r(e){return f(this,r),t.call(this,e)}return h(r)}(i(Error))},592:(e,t,r)=>{"use strict";r.d(t,{$l:()=>o,Aq:()=>b,B3:()=>v,Dz:()=>p,K0:()=>n,NL:()=>u,Qk:()=>i,R$:()=>f,SG:()=>S,U4:()=>h,VR:()=>c,a_:()=>l,al:()=>g,cG:()=>s,mc:()=>d,md:()=>m,n8:()=>j,sH:()=>O,th:()=>w,w1:()=>y,zC:()=>a});var n="X-Amz-Algorithm",o="X-Amz-Credential",i="X-Amz-Date",a="X-Amz-Expires",s="X-Amz-Signature",c="X-Amz-SignedHeaders",u="X-Amz-Security-Token",f="x-amz-content-sha256",l=i.toLowerCase(),h=s.toLowerCase(),d="X-Amz-Target".toLowerCase(),y=u.toLowerCase(),p="authorization",v=[p,l,"date"],m="host",b={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},g="aws4_request",S="AWS4-HMAC-SHA256",w=604800,O="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",j="UNSIGNED-PAYLOAD"},380:(e,t,r)=>{"use strict";r.d(t,{t:()=>y});var n=r(255);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r{"use strict";function n(e,t){e=e.toLowerCase();for(var r=0,n=Object.keys(t);rn})},137:(e,t,r)=>{"use strict";r.d(t,{L:()=>O,w:()=>j});var n=r(400),o=r.n(n),i=r(592),a=r(380),s=r(491),c=r(23);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=v(v({},{signingDate:new Date,unsignableHeaders:new Set,signableHeaders:new Set}),t),n=_(r.signingDate),o=n.longDate,a=n.shortDate,c=r.signingService||this.service,u=r.signingRegion||this.region,f="".concat(a,"/").concat(u,"/").concat(c,"/").concat(i.al);e.headers[i.md]=e.hostname;for(var l=0,h=Object.keys(e.headers);l-1&&delete e.headers[d]}e.headers[i.a_]=o,this.credentials.sessionToken&&(e.headers[i.w1]=this.credentials.sessionToken),ArrayBuffer.isView(e.body)&&(e.body=e.body.buffer),e.body||(e.body="");var y=this.computePayloadHash(e);!(0,s.L)(i.R$,e.headers)&&this.applyChecksum&&(e.headers[i.R$]=y);var p=this.computeCanonicalHeaders(e,r.unsignableHeaders,r.signableHeaders),m=this.calculateSignature(o,f,this.deriveSigningKey(this.credentials,c,u,a),this.createCanonicalRequest(e,p,y));e.headers[i.Dz]="".concat(i.SG," ")+"Credential=".concat(this.credentials.accessKeyId,"/").concat(f,", ")+"SignedHeaders=".concat(Object.keys(p).sort().join(";"),", ")+"Signature=".concat(m);var b="".concat(e.protocol,"://").concat(e.hostname);return e.path&&(b+=e.path),e.query&&(b+="?".concat(this.serializeQueryParameters(e.query))),v({url:b},e)}},{key:"presign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.signingDate,n=void 0===r?new Date:r,o=t.expiresIn,a=void 0===o?3600:o,s=t.unsignableHeaders,c=t.unhoistableHeaders,u=t.signableHeaders,f=t.signingRegion,l=t.signingService,h=_(n),d=h.longDate,y=h.shortDate,p=f||this.region,m=l||this.service;if(a>i.th)throw new j("Signature version 4 presigned URLs can't be valid for more than 7 days");var b="".concat(y,"/").concat(p,"/").concat(m,"/").concat(i.al),g=this.moveHeadersToQuery(e,{unhoistableHeaders:c});g.headers[i.md]=e.hostname,this.credentials.sessionToken&&(g.query[i.NL]=this.credentials.sessionToken),g.query[i.K0]=i.SG,g.query[i.$l]="".concat(this.credentials.accessKeyId,"/").concat(b),g.query[i.Qk]=d,g.query[i.zC]=a.toString(10);var S=this.computeCanonicalHeaders(g,s,u);g.query[i.VR]=Object.keys(S).sort().join(";");var w=this.deriveSigningKey(this.credentials,m,p,y),O=this.computePayloadHash(e),P=this.createCanonicalRequest(g,S,O);g.query[i.cG]=this.calculateSignature(d,b,w,P);var k="".concat(g.protocol,"://").concat(g.hostname);return g.path&&(k+=g.path),g.query&&(k+="?".concat(this.serializeQueryParameters(g.query))),v({url:k},g)}},{key:"createCanonicalRequest",value:function(e,t,r){var n=Object.keys(t).sort(),o=n.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),i=n.join(";");return"".concat(e.method,"\n")+"".concat(this.computeCanonicalURI(e),"\n")+"".concat(this.computeCanonicalQuerystring(e),"\n")+"".concat(o,"\n\n")+"".concat(i,"\n")+"".concat(r)}},{key:"createStringToSign",value:function(e,t,r){var n=o().sha256(r,"hex");return"".concat(i.SG,"\n")+"".concat(e,"\n")+"".concat(t,"\n")+"".concat(n)}},{key:"calculateSignature",value:function(e,t,r,n){var i=this.createStringToSign(e,t,n);return o().hmac("sha256",r,i,"hex")}},{key:"deriveSigningKey",value:function(e,t,r,n){var i=e.secretAccessKey,a=o().hmac("sha256","AWS4"+i,n,"binary"),s=o().hmac("sha256",a,r,"binary"),c=o().hmac("sha256",s,t,"binary");return o().hmac("sha256",c,"aws4_request","binary")}},{key:"computeCanonicalURI",value:function(e){var t=e.path;if(this.uriEscapePath){var r,n=[],o=d(t.split("/"));try{for(o.s();!(r=o.n()).done;){var i=r.value;0!==(null==i?void 0:i.length)&&("."!==i&&(".."===i?n.pop():n.push(i)))}}catch(e){o.e(e)}finally{o.f()}var a=null!=t&&t.startsWith("/")?"/":"",s=n.join("/"),c=n.length>0&&null!=t&&t.endsWith("/")?"/":"",u="".concat(a).concat(s).concat(c);return encodeURIComponent(u).replace(/%2F/g,"/")}return t}},{key:"computeCanonicalQuerystring",value:function(e){var t,r=e.query,n=void 0===r?{}:r,o=[],a={},s=function(e){if(e.toLowerCase()===i.U4)return"continue";o.push(e);var t=n[e];"string"==typeof t?a[e]="".concat(P(e),"=").concat(P(t)):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,r){return t.concat(["".concat(P(e),"=").concat(P(r))])}),[]).join("&"))},c=d(Object.keys(n).sort());try{for(c.s();!(t=c.n()).done;)s(t.value)}catch(e){c.e(e)}finally{c.f()}return o.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}},{key:"computeCanonicalHeaders",value:function(e,t,r){var n,o=e.headers,a={},s=d(Object.keys(o).sort());try{for(s.s();!(n=s.n()).done;){var c=n.value;if(null!=o[c]){var u=c.toLowerCase();(u in i.Aq||null!=t&&t.has(u))&&(!r||r&&!r.has(u))||(a[u]=o[c].trim().replace(/\s+/g," "))}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"computePayloadHash",value:function(e){var t=e.headers,r=e.body;return t[i.R$]?t[i.R$]:null==r?i.sH:"string"==typeof r||(0,c.e)(r)?o().sha256(r,"hex").toLowerCase():ArrayBuffer.isView(r)?o().sha256(r.buffer,"hex").toLowerCase():i.n8}},{key:"moveHeadersToQuery",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.parse(JSON.stringify(e)),n=r.headers,o=r.query,i=void 0===o?{}:o,a=0,s=Object.keys(n);a{"use strict";function n(e){return"function"==typeof ArrayBuffer&&(e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e))}function o(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))),t}),[]).join("&")}r.d(t,{C:()=>o,e:()=>n})},41:(e,t,r)=>{"use strict";r.d(t,{SQSClient:()=>j});r(223);var n=r(137),o=r(393),i=r(409),a=r.n(i),s=r(23),c=r(380);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n={Action:"SendMessage",Version:O,QueueUrl:e,MessageBody:t};void 0!==r.messageDeduplicationId&&(n=l(l({},n),{},{MessageDeduplicationId:r.messageDeduplicationId})),void 0!==r.messageGroupId&&(n=l(l({},n),{},{MessageGroupId:r.messageGroupId}));var o=this.signature.sign({method:"POST",protocol:"https",hostname:this.host,path:"/",headers:l({},this.commonHeaders),body:(0,s.C)(n)},{}),i=a().request("POST",o.url,o.body||"",{headers:o.headers});this._handleError("SendMessage",i);var c=i.html("SendMessageResponse > SendMessageResult");return new P(c.find("MessageId").text(),c.find("MD5OfMessageBody").text())}},{key:"listQueues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={Action:"ListQueues",Version:O};void 0!==(null==e?void 0:e.maxResults)&&(t=l(l({},t),{},{MaxResults:e.maxResults})),void 0!==(null==e?void 0:e.nextToken)&&(t=l(l({},t),{},{NextToken:e.nextToken})),void 0!==(null==e?void 0:e.queueNamePrefix)&&(t=l(l({},t),{},{QueueNamePrefix:e.queueNamePrefix}));var r=this.signature.sign({method:"POST",protocol:"https",hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},{Host:this.host}),body:(0,s.C)(t)},{}),n=a().request("POST",r.url,r.body||"",{headers:r.headers});this._handleError("ListQueues",n);var o=n.html();return{urls:o.find("QueueUrl").toArray().map((function(e){return e.text()})),nextToken:o.find("NextToken").text()||void 0}}},{key:"_handleError",value:function(e,t){var r=t.error_code;if(""!=t.error||0!==r){var o=c.t.parseXML(t.body);if("AuthorizationHeaderMalformed"===o.code)throw new n.w(o.message,o.code);throw new _(o.message,o.code||"unknown",e)}}}]),r}(o.k),P=y((function e(t,r){h(this,e),S(this,"id",void 0),S(this,"bodyMD5",void 0),this.id=t,this.bodyMD5=r})),_=function(e){p(r,e);var t=m(r);function r(e,n,o){var i;return h(this,r),S(b(i=t.call(this,e,n)),"operation",void 0),i.name="SQSServiceError",i.operation=o,i}return y(r)}(c.t)},877:(e,t,r)=>{var n=r(570),o=r(171),i=o;i.v1=n,i.v4=o,e.exports=i},327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},570:(e,t,r)=>{var n,o,i=r(217),a=r(327),s=0,c=0;e.exports=function(e,t,r){var u=t&&r||0,f=t||[],l=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==h){var d=i();null==l&&(l=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var y=void 0!==e.msecs?e.msecs:(new Date).getTime(),p=void 0!==e.nsecs?e.nsecs:c+1,v=y-s+(p-c)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||y>s)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=y,c=p,o=h;var m=(1e4*(268435455&(y+=122192928e5))+p)%4294967296;f[u++]=m>>>24&255,f[u++]=m>>>16&255,f[u++]=m>>>8&255,f[u++]=255&m;var b=y/4294967296*1e4&268435455;f[u++]=b>>>8&255,f[u++]=255&b,f[u++]=b>>>24&15|16,f[u++]=b>>>16&255,f[u++]=h>>>8|128,f[u++]=255&h;for(var g=0;g<6;++g)f[u+g]=l[g];return t||a(f)}},171:(e,t,r)=>{var n=r(217),o=r(327);e.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},400:e=>{"use strict";e.exports=require("k6/crypto")},255:e=>{"use strict";e.exports=require("k6/html")},409:e=>{"use strict";e.exports=require("k6/http")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{AMZ_CONTENT_SHA256_HEADER:()=>o.R$,AWSConfig:()=>t.o,InvalidAWSConfigError:()=>t.l,InvalidSignatureError:()=>e.w,KMSClient:()=>O,KMSDataKey:()=>P,KMSServiceError:()=>_,KinesisClient:()=>ze,S3Bucket:()=>z,S3Client:()=>L,S3Object:()=>J,S3ServiceError:()=>U,SQSClient:()=>Ce.SQSClient,Secret:()=>se,SecretsManagerClient:()=>ae,SecretsManagerServiceError:()=>ce,SignatureV4:()=>e.L,SystemsManagerClient:()=>je,SystemsManagerParameter:()=>Pe,SystemsManagerServiceError:()=>_e,UNSIGNED_PAYLOAD:()=>o.n8});var e=r(137),t=r(223),o=r(592),i=r(409),a=r.n(i),s=r(393),c=r(380);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:C.Size256,r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},S({},o.mc,"TrentService.GenerateDataKey")),body:JSON.stringify({KeyId:e,NumberOfBytes:t})},{}),n=a().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(k.GenerateDataKey,n),P.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new _(i,o.__type,t)}if(1500===n)throw new _("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),j=function(){function e(t,r){h(this,e),S(this,"keyArn",void 0),S(this,"keyId",void 0),this.keyArn=t,this.keyId=r}return y(e,null,[{key:"fromJSON",value:function(t){return new e(t.KeyArn,t.KeyId)}}]),e}(),P=function(){function e(t,r,n){h(this,e),S(this,"id",void 0),S(this,"ciphertextBlob",void 0),S(this,"plaintext",void 0),this.ciphertextBlob=t,this.id=r,this.plaintext=n}return y(e,null,[{key:"fromJSON",value:function(t){return new e(t.CiphertextBlob,t.KeyId,t.Plaintext)}}]),e}(),_=function(e){p(r,e);var t=m(r);function r(e,n,o){var i;return h(this,r),S(b(i=t.call(this,e,n)),"operation",void 0),i.name="KMSServiceError",i.operation=o,i}return y(r)}(c.t),k=function(e){return e.GenerateDataKey="GenerateDataKey",e.ListKeys="ListKeys",e}(k||{}),C=function(e){return e[e.Size256=32]="Size256",e[e.Size512=64]="Size512",e}(C||{}),E=r(255);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var r=0;r".concat(e.partNumber,"").concat(e.eTag,"")})).join(""),""),c=this.signature.sign({method:o,protocol:this.scheme,hostname:i,path:"/".concat(t),headers:{},body:s,query:{uploadId:"".concat(r)}},{}),u=a().request(o,c.url,c.body||"",{headers:c.headers});this._handle_error("CompleteMultipartUpload",u)}},{key:"abortMultipartUpload",value:function(e,t,r){var n="DELETE",o="".concat(e,".").concat(this.host),i=this.signature.sign({method:n,protocol:this.scheme,hostname:o,path:"/".concat(t),headers:{},query:{uploadId:"".concat(r)}},{}),s=a().request(n,i.url,i.body||"",{headers:i.headers});this._handle_error("AbortMultipartUpload",s)}},{key:"_handle_error",value:function(t,r){var n=r.status,o=r.error_code,i=r.error;if(!(n>=200&&n<300&&""==i&&0===o)){if(301==n||i&&i.startsWith("301"))throw new U("Resource not found","ResourceNotFound",t);var a=c.t.parseXML(r.body);if("AuthorizationHeaderMalformed"===a.code)throw new e.w(a.message,a.code);throw new U(a.message,a.code||"unknown",t)}}}]),n}(s.k),z=A((function e(t,r){N(this,e),q(this,"name",void 0),q(this,"creationDate",void 0),this.name=t,this.creationDate=r})),J=A((function e(t,r,n,o,i,a){N(this,e),q(this,"key",void 0),q(this,"lastModified",void 0),q(this,"etag",void 0),q(this,"size",void 0),q(this,"storageClass",void 0),q(this,"data",void 0),this.key=t,this.lastModified=r,this.etag=n,this.size=o,this.storageClass=i,this.data=a})),B=A((function e(t,r){N(this,e),q(this,"key",void 0),q(this,"uploadId",void 0),this.key=t,this.uploadId=r})),G=A((function e(t,r){N(this,e),q(this,"partNumber",void 0),q(this,"eTag",void 0),this.partNumber=t,this.eTag=r})),U=function(e){D(r,e);var t=I(r);function r(e,n,o){var i;return N(this,r),q(K(i=t.call(this,e,n)),"operation",void 0),i.name="S3ServiceError",i.operation=o,i}return A(r)}(c.t),V=r(877);function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new ce(i,o.__type,t)}if(1500===n)throw new ce("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),se=function(){function e(t,r,n,o,i,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];F(this,e),oe(this,"name",void 0),oe(this,"arn",void 0),oe(this,"secret",void 0),oe(this,"createdDate",void 0),oe(this,"lastAccessedDate",void 0),oe(this,"lastChangedDate",void 0),oe(this,"tags",void 0),this.name=t,this.arn=r,this.secret=n,this.createdDate=o,this.lastAccessedDate=i,this.lastChangedDate=a,this.tags=s}return Y(e,null,[{key:"fromJSON",value:function(t){return new e(t.Name,t.ARN,t.SecretString,t.CreatedDate,t.LastAccessedDate,t.LastChangedDate,t.Tags)}}]),e}(),ce=function(e){Z(r,e);var t=te(r);function r(e,n,o){var i;return F(this,r),oe(re(i=t.call(this,e,n)),"operation",void 0),i.name="SecretsManagerServiceError",i.operation=o,i}return Y(r)}(c.t),ue=function(e){return e.ListSecrets="ListSecrets",e.GetSecretValue="GetSecretValue",e.CreateSecret="CreateSecret",e.PutSecretValue="PutSecretValue",e.DeleteSecret="DeleteSecret",e}(ue||{});function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function he(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:he(he({},this.commonHeaders),{},we({},o.mc,"AmazonSSM.GetParameter")),body:JSON.stringify({Name:e,WithDecryption:t})},{}),n=a().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(ke.GetParameter,n),Pe.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new _e(i,o.__type,t)}if(1500===n)throw new _e("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),Pe=function(){function e(t,r,n,o,i,a,s,c,u){de(this,e),we(this,"arn",void 0),we(this,"dataType",void 0),we(this,"lastModifiedDate",void 0),we(this,"name",void 0),we(this,"selector",void 0),we(this,"sourceResult",void 0),we(this,"type",void 0),we(this,"value",void 0),we(this,"version",void 0),this.arn=t,this.dataType=r,this.lastModifiedDate=n,this.name=o,this.selector=i,this.sourceResult=a,this.type=s,this.value=c,this.version=u}return pe(e,null,[{key:"fromJSON",value:function(t){var r=t.Parameter;return new e(r.ARN,r.DataType,r.LastModifiedDate,r.Name,r.Selector,r.SourceResult,r.Type,r.Value,r.Version)}}]),e}(),_e=function(e){ve(r,e);var t=be(r);function r(e,n,o){var i;return de(this,r),we(ge(i=t.call(this,e,n)),"operation",void 0),i.name="SystemsManagerServiceError",i.operation=o,i}return pe(r)}(c.t),ke=function(e){return e.GetParameter="GetParameter",e}(ke||{}),Ce=r(41);function Ee(e){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(e)}function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({StreamName:e},t.shardCount&&{ShardCount:t.shardCount}),t.streamModeDetails&&{StreamMode:t.streamModeDetails.streamMode});this._send_request("CreateStream",r)}},{key:"deleteStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({StreamName:e},t.streamARN&&{StreamARN:t.streamARN}),t.enforceConsumerDeletion&&{EnforceConsumerDeletion:t.enforceConsumerDeletion});this._send_request("DeleteStream",r)}},{key:"listStreams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ne(Ne(Ne({},e.exclusiveStartStreamName&&{ExclusiveStartStreamName:e.exclusiveStartStreamName}),e.limit&&{Limit:e.limit}),e.nextToken&&{NextToken:e.nextToken}),r=this._send_request("ListStreams",t);return Be.fromJson(null==r?void 0:r.json())}},{key:"putRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.streamName&&!t.streamARN)throw new Error("Either streamName or streamARN must be provided");var r=Ne(Ne({Records:e},t.streamName&&{StreamName:t.streamName}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("PutRecords",r);return Ue.fromJson(null==n?void 0:n.json())}},{key:"getRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({ShardIterator:e},t.limit&&{Limit:t.limit}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("GetRecords",r);return We.fromJson(null==n?void 0:n.json())}},{key:"listShards",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({StreamName:e},t.nextToken&&{NextToken:t.nextToken}),t.maxResults&&{MaxResults:t.maxResults}),n=this._send_request("ListShards",r);return Xe.fromJson(null==n?void 0:n.json())}},{key:"getShardIterator",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Ne(Ne({StreamName:e,ShardId:t,ShardIteratorType:r},n.startingSequenceNumber&&{StartingSequenceNumber:n.startingSequenceNumber}),n.timestamp&&{Timestamp:n.timestamp}),i=this._send_request("GetShardIterator",o);return $e.fromJson(null==i?void 0:i.json())}},{key:"_send_request",value:function(e,t){var r=this.signature.sign({method:"POST",protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:Ne(Ne({},this.commonHeaders),{},He({},o.mc,"".concat(this.serviceVersion,".").concat(e))),body:JSON.stringify(t)},{}),n=a().request("POST",r.url,r.body,{headers:r.headers});return this._handle_error(e,n),n}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new Je(i,o.__type,t)}if(1500===n)throw new Je("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),Je=function(e){xe(r,e);var t=Ke(r);function r(e,n,o){var i;return Re(this,r),He(Me(i=t.call(this,e,n)),"operation",void 0),i.name="KinesisServiceError",i.operation=o,i}return De(r)}(c.t),Be=function(){function e(t,r,n,o){Re(this,e),He(this,"HasMoreStreams",void 0),He(this,"NextToken",void 0),He(this,"StreamNames",void 0),He(this,"StreamSummaries",void 0),this.HasMoreStreams=t,this.NextToken=r,this.StreamNames=n,this.StreamSummaries=o}return De(e,null,[{key:"fromJson",value:function(t){var r=t.HasMoreStreams,n=void 0!==r&&r,o=t.NextToken,i=void 0===o?"":o,a=t.StreamNames,s=void 0===a?[]:a,c=t.StreamSummaries,u=void 0===c?[]:c;return new e(n,i,s.map((function(e){return String(e)})),u.map(Ge.fromJson))}}]),e}(),Ge=function(){function e(t,r,n,o,i){Re(this,e),He(this,"StreamARN",void 0),He(this,"StreamCreationTimestamp",void 0),He(this,"StreamModeDetails",void 0),He(this,"StreamName",void 0),He(this,"StreamStatus",void 0),this.StreamARN=t,this.StreamCreationTimestamp=r,this.StreamModeDetails=n,this.StreamName=o,this.StreamStatus=i}return De(e,null,[{key:"fromJson",value:function(t){var r=t.StreamARN,n=void 0===r?"":r,o=t.StreamCreationTimestamp,i=void 0===o?0:o,a=t.StreamModeDetails,s=void 0===a?{}:a,c=t.StreamName,u=void 0===c?"":c,f=t.StreamStatus;return new e(n,i,s,u,void 0===f?"":f)}}]),e}(),Ue=function(){function e(t,r,n){Re(this,e),He(this,"EncryptionType",void 0),He(this,"FailedRecordCount",void 0),He(this,"Records",void 0),this.EncryptionType=t,this.FailedRecordCount=r,this.Records=n}return De(e,null,[{key:"fromJson",value:function(t){var r=t.EncryptionType,n=void 0===r?"NONE":r,o=t.FailedRecordCount,i=void 0===o?0:o,a=t.Records;return new e(n,i,(void 0===a?[]:a).map((function(e){return Ve.fromJson(e)})))}}]),e}(),Ve=function(){function e(t,r){Re(this,e),He(this,"SequenceNumber",void 0),He(this,"ShardId",void 0),this.SequenceNumber=t,this.ShardId=r}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.SequenceNumber,t.ShardId)}}]),e}(),We=function(){function e(t,r){Re(this,e),He(this,"NextShardIterator",void 0),He(this,"Records",void 0),this.NextShardIterator=t,this.Records=r}return De(e,null,[{key:"fromJson",value:function(t){var r=t.NextShardIterator,n=void 0===r?"":r,o=t.Records;return new e(n,(void 0===o?[]:o).map((function(e){return Qe.fromJson(e)})))}}]),e}(),Qe=function(){function e(t,r,n){Re(this,e),He(this,"Data",void 0),He(this,"PartitionKey",void 0),He(this,"SequenceNumber",void 0),this.Data=t,this.PartitionKey=r,this.SequenceNumber=n}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.Data,t.PartitionKey,t.SequenceNumber)}}]),e}(),Xe=function(){function e(t,r){Re(this,e),He(this,"Shards",void 0),He(this,"NextToken",void 0),this.Shards=t,this.NextToken=r}return De(e,null,[{key:"fromJson",value:function(t){var r=t.Shards,n=void 0===r?[]:r,o=t.NextToken;return new e(n.map((function(e){return Fe.fromJson(e)})),o)}}]),e}(),Fe=function(){function e(t,r,n,o,i){Re(this,e),He(this,"Id",void 0),He(this,"ParentShardId",void 0),He(this,"AdjacentParentShardId",void 0),He(this,"HashKeyRange",void 0),He(this,"SequenceNumberRange",void 0),this.Id=t,this.ParentShardId=o,this.AdjacentParentShardId=i,this.HashKeyRange=r,this.SequenceNumberRange=n}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardId,t.HashKeyRange,t.SequenceNumberRange,t.ParentShardId,t.AdjacentParentShardId)}}]),e}(),$e=function(){function e(t){Re(this,e),He(this,"ShardIterator",void 0),this.ShardIterator=t}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardIterator)}}]),e}()})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); +(()=>{var e={393:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;rs});var s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"awsConfig",void 0),i(this,"serviceName",void 0),i(this,"_host",void 0),i(this,"_scheme",void 0),this.awsConfig=t,this.serviceName=r}var t,r,n;return t=e,(r=[{key:"host",get:function(){return null==this._host&&(this._host="".concat(this.serviceName,".").concat(this.awsConfig.region,".").concat(this.awsConfig.endpoint)),this._host},set:function(e){this._host=e}},{key:"scheme",get:function(){return null==this._scheme&&(this._scheme=this.awsConfig.scheme),this._scheme},set:function(e){this._scheme=e}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},592:(e,t,r)=>{"use strict";r.d(t,{$l:()=>o,Aq:()=>b,B3:()=>v,Dz:()=>p,K0:()=>n,NL:()=>u,Qk:()=>i,R$:()=>f,SG:()=>S,U4:()=>h,VR:()=>c,a_:()=>l,al:()=>g,cG:()=>s,mc:()=>d,md:()=>m,n8:()=>j,sH:()=>O,th:()=>w,w1:()=>y,zC:()=>a});var n="X-Amz-Algorithm",o="X-Amz-Credential",i="X-Amz-Date",a="X-Amz-Expires",s="X-Amz-Signature",c="X-Amz-SignedHeaders",u="X-Amz-Security-Token",f="x-amz-content-sha256",l=i.toLowerCase(),h=s.toLowerCase(),d="X-Amz-Target".toLowerCase(),y=u.toLowerCase(),p="authorization",v=[p,l,"date"],m="host",b={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},g="aws4_request",S="AWS4-HMAC-SHA256",w=604800,O="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",j="UNSIGNED-PAYLOAD"},380:(e,t,r)=>{"use strict";r.d(t,{t:()=>y});var n=r(255);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r{"use strict";function n(e,t){e=e.toLowerCase();for(var r=0,n=Object.keys(t);rn})},137:(e,t,r)=>{"use strict";r.d(t,{L:()=>O,w:()=>j});var n=r(400),o=r.n(n),i=r(592),a=r(380),s=r(491),c=r(23);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=v(v({},{signingDate:new Date,unsignableHeaders:new Set,signableHeaders:new Set}),t),n=_(r.signingDate),o=n.longDate,a=n.shortDate,c=r.signingService||this.service,u=r.signingRegion||this.region,f="".concat(a,"/").concat(u,"/").concat(c,"/").concat(i.al);e.headers[i.md]=e.hostname;for(var l=0,h=Object.keys(e.headers);l-1&&delete e.headers[d]}e.headers[i.a_]=o,this.credentials.sessionToken&&(e.headers[i.w1]=this.credentials.sessionToken),ArrayBuffer.isView(e.body)&&(e.body=e.body.buffer),e.body||(e.body="");var y=this.computePayloadHash(e);!(0,s.L)(i.R$,e.headers)&&this.applyChecksum&&(e.headers[i.R$]=y);var p=this.computeCanonicalHeaders(e,r.unsignableHeaders,r.signableHeaders),m=this.calculateSignature(o,f,this.deriveSigningKey(this.credentials,c,u,a),this.createCanonicalRequest(e,p,y));e.headers[i.Dz]="".concat(i.SG," ")+"Credential=".concat(this.credentials.accessKeyId,"/").concat(f,", ")+"SignedHeaders=".concat(Object.keys(p).sort().join(";"),", ")+"Signature=".concat(m);var b="".concat(e.protocol,"://").concat(e.hostname);return e.path&&(b+=e.path),e.query&&(b+="?".concat(this.serializeQueryParameters(e.query))),v({url:b},e)}},{key:"presign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.signingDate,n=void 0===r?new Date:r,o=t.expiresIn,a=void 0===o?3600:o,s=t.unsignableHeaders,c=t.unhoistableHeaders,u=t.signableHeaders,f=t.signingRegion,l=t.signingService,h=_(n),d=h.longDate,y=h.shortDate,p=f||this.region,m=l||this.service;if(a>i.th)throw new j("Signature version 4 presigned URLs can't be valid for more than 7 days");var b="".concat(y,"/").concat(p,"/").concat(m,"/").concat(i.al),g=this.moveHeadersToQuery(e,{unhoistableHeaders:c});g.headers[i.md]=e.hostname,this.credentials.sessionToken&&(g.query[i.NL]=this.credentials.sessionToken),g.query[i.K0]=i.SG,g.query[i.$l]="".concat(this.credentials.accessKeyId,"/").concat(b),g.query[i.Qk]=d,g.query[i.zC]=a.toString(10);var S=this.computeCanonicalHeaders(g,s,u);g.query[i.VR]=Object.keys(S).sort().join(";");var w=this.deriveSigningKey(this.credentials,m,p,y),O=this.computePayloadHash(e),P=this.createCanonicalRequest(g,S,O);g.query[i.cG]=this.calculateSignature(d,b,w,P);var k="".concat(g.protocol,"://").concat(g.hostname);return g.path&&(k+=g.path),g.query&&(k+="?".concat(this.serializeQueryParameters(g.query))),v({url:k},g)}},{key:"createCanonicalRequest",value:function(e,t,r){var n=Object.keys(t).sort(),o=n.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),i=n.join(";");return"".concat(e.method,"\n")+"".concat(this.computeCanonicalURI(e),"\n")+"".concat(this.computeCanonicalQuerystring(e),"\n")+"".concat(o,"\n\n")+"".concat(i,"\n")+"".concat(r)}},{key:"createStringToSign",value:function(e,t,r){var n=o().sha256(r,"hex");return"".concat(i.SG,"\n")+"".concat(e,"\n")+"".concat(t,"\n")+"".concat(n)}},{key:"calculateSignature",value:function(e,t,r,n){var i=this.createStringToSign(e,t,n);return o().hmac("sha256",r,i,"hex")}},{key:"deriveSigningKey",value:function(e,t,r,n){var i=e.secretAccessKey,a=o().hmac("sha256","AWS4"+i,n,"binary"),s=o().hmac("sha256",a,r,"binary"),c=o().hmac("sha256",s,t,"binary");return o().hmac("sha256",c,"aws4_request","binary")}},{key:"computeCanonicalURI",value:function(e){var t=e.path;if(this.uriEscapePath){var r,n=[],o=d(t.split("/"));try{for(o.s();!(r=o.n()).done;){var i=r.value;0!==(null==i?void 0:i.length)&&("."!==i&&(".."===i?n.pop():n.push(i)))}}catch(e){o.e(e)}finally{o.f()}var a=null!=t&&t.startsWith("/")?"/":"",s=n.join("/"),c=n.length>0&&null!=t&&t.endsWith("/")?"/":"",u="".concat(a).concat(s).concat(c);return encodeURIComponent(u).replace(/%2F/g,"/")}return t}},{key:"computeCanonicalQuerystring",value:function(e){var t,r=e.query,n=void 0===r?{}:r,o=[],a={},s=function(e){if(e.toLowerCase()===i.U4)return"continue";o.push(e);var t=n[e];"string"==typeof t?a[e]="".concat(P(e),"=").concat(P(t)):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,r){return t.concat(["".concat(P(e),"=").concat(P(r))])}),[]).join("&"))},c=d(Object.keys(n).sort());try{for(c.s();!(t=c.n()).done;)s(t.value)}catch(e){c.e(e)}finally{c.f()}return o.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}},{key:"computeCanonicalHeaders",value:function(e,t,r){var n,o=e.headers,a={},s=d(Object.keys(o).sort());try{for(s.s();!(n=s.n()).done;){var c=n.value;if(null!=o[c]){var u=c.toLowerCase();(u in i.Aq||null!=t&&t.has(u))&&(!r||r&&!r.has(u))||(a[u]=o[c].trim().replace(/\s+/g," "))}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"computePayloadHash",value:function(e){var t=e.headers,r=e.body;return t[i.R$]?t[i.R$]:null==r?i.sH:"string"==typeof r||(0,c.e)(r)?o().sha256(r,"hex").toLowerCase():ArrayBuffer.isView(r)?o().sha256(r.buffer,"hex").toLowerCase():i.n8}},{key:"moveHeadersToQuery",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.parse(JSON.stringify(e)),n=r.headers,o=r.query,i=void 0===o?{}:o,a=0,s=Object.keys(n);a{"use strict";function n(e){return"function"==typeof ArrayBuffer&&(e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e))}function o(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))),t}),[]).join("&")}r.d(t,{C:()=>o,e:()=>n})},41:(e,t,r)=>{"use strict";r.d(t,{SQSClient:()=>j});var n=r(137),o=r(393),i=r(409),a=r.n(i),s=r(23),c=r(380);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n={Action:"SendMessage",Version:O,QueueUrl:e,MessageBody:t};void 0!==r.messageDeduplicationId&&(n=l(l({},n),{},{MessageDeduplicationId:r.messageDeduplicationId})),void 0!==r.messageGroupId&&(n=l(l({},n),{},{MessageGroupId:r.messageGroupId}));var o=this.signature.sign({method:"POST",protocol:this.scheme,hostname:this.host,path:"/",headers:l({},this.commonHeaders),body:(0,s.C)(n)},{}),i=a().request("POST",o.url,o.body||"",{headers:o.headers});this._handleError("SendMessage",i);var c=i.html("SendMessageResponse > SendMessageResult");return new P(c.find("MessageId").text(),c.find("MD5OfMessageBody").text())}},{key:"listQueues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={Action:"ListQueues",Version:O};void 0!==(null==e?void 0:e.maxResults)&&(t=l(l({},t),{},{MaxResults:e.maxResults})),void 0!==(null==e?void 0:e.nextToken)&&(t=l(l({},t),{},{NextToken:e.nextToken})),void 0!==(null==e?void 0:e.queueNamePrefix)&&(t=l(l({},t),{},{QueueNamePrefix:e.queueNamePrefix}));var r=this.signature.sign({method:"POST",protocol:this.scheme,hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},{Host:this.host}),body:(0,s.C)(t)},{}),n=a().request("POST",r.url,r.body||"",{headers:r.headers});this._handleError("ListQueues",n);var o=n.html();return{urls:o.find("QueueUrl").toArray().map((function(e){return e.text()})),nextToken:o.find("NextToken").text()||void 0}}},{key:"_handleError",value:function(e,t){var r=t.error_code;if(""!=t.error||0!==r){var o=c.t.parseXML(t.body);if("AuthorizationHeaderMalformed"===o.code)throw new n.w(o.message,o.code);throw new _(o.message,o.code||"unknown",e)}}}]),r}(o.k),P=y((function e(t,r){h(this,e),S(this,"id",void 0),S(this,"bodyMD5",void 0),this.id=t,this.bodyMD5=r})),_=function(e){p(r,e);var t=m(r);function r(e,n,o){var i;return h(this,r),S(b(i=t.call(this,e,n)),"operation",void 0),i.name="SQSServiceError",i.operation=o,i}return y(r)}(c.t)},877:(e,t,r)=>{var n=r(570),o=r(171),i=o;i.v1=n,i.v4=o,e.exports=i},327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},570:(e,t,r)=>{var n,o,i=r(217),a=r(327),s=0,c=0;e.exports=function(e,t,r){var u=t&&r||0,f=t||[],l=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==h){var d=i();null==l&&(l=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var y=void 0!==e.msecs?e.msecs:(new Date).getTime(),p=void 0!==e.nsecs?e.nsecs:c+1,v=y-s+(p-c)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||y>s)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=y,c=p,o=h;var m=(1e4*(268435455&(y+=122192928e5))+p)%4294967296;f[u++]=m>>>24&255,f[u++]=m>>>16&255,f[u++]=m>>>8&255,f[u++]=255&m;var b=y/4294967296*1e4&268435455;f[u++]=b>>>8&255,f[u++]=255&b,f[u++]=b>>>24&15|16,f[u++]=b>>>16&255,f[u++]=h>>>8|128,f[u++]=255&h;for(var g=0;g<6;++g)f[u+g]=l[g];return t||a(f)}},171:(e,t,r)=>{var n=r(217),o=r(327);e.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},400:e=>{"use strict";e.exports=require("k6/crypto")},255:e=>{"use strict";e.exports=require("k6/html")},409:e=>{"use strict";e.exports=require("k6/http")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{AMZ_CONTENT_SHA256_HEADER:()=>m.R$,AWSConfig:()=>p,InvalidAWSConfigError:()=>v,InvalidSignatureError:()=>e.w,KMSClient:()=>I,KMSDataKey:()=>M,KMSServiceError:()=>q,KinesisClient:()=>et,S3Bucket:()=>ee,S3Client:()=>Z,S3Object:()=>te,S3ServiceError:()=>oe,SQSClient:()=>Le.SQSClient,Secret:()=>Se,SecretsManagerClient:()=>ge,SecretsManagerServiceError:()=>we,SignatureV4:()=>e.L,SystemsManagerClient:()=>Ke,SystemsManagerParameter:()=>Me,SystemsManagerServiceError:()=>qe,UNSIGNED_PAYLOAD:()=>m.n8});var e=r(137);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function o(e){var r=s();return function(){var n,o=u(e);if(r){var i=u(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},i(e)}function a(e,t,r){return a=s()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o},a.apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;r128)throw new v("invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ".concat(t.accessKeyId.length));if(!t.secretAccessKey||""===t.secretAccessKey)throw new v("invalid AWS secret access key; reason: expected a non empty string, got `".concat(t.secretAccessKey,"`"));if(t.secretAccessKey.length<16||t.secretAccessKey.length>128)throw new v("invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ".concat(t.secretAccessKey.length));this.region=t.region,this.accessKeyId=t.accessKeyId,this.secretAccessKey=t.secretAccessKey,void 0!==t.sessionToken&&(this.sessionToken=t.sessionToken),void 0!==t.scheme&&(this.scheme=t.scheme),void 0!==t.endpoint&&(this.endpoint=t.endpoint)}return h(e,null,[{key:"fromEnvironment",value:function(t){return new e({region:__ENV.AWS_REGION,accessKeyId:__ENV.AWS_ACCESS_KEY_ID,secretAccessKey:__ENV.AWS_SECRET_ACCESS_KEY,sessionToken:__ENV.AWS_SESSION_TOKEN,scheme:null==t?void 0:t.scheme,endpoint:null==t?void 0:t.endpoint})}}]),e}(),v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(r,e);var t=o(r);function r(e){return f(this,r),t.call(this,e)}return h(r)}(i(Error)),m=r(592),b=r(409),g=r.n(b),S=r(393),w=r(380);function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:L.Size256,r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:P(P({},this.commonHeaders),{},D({},m.mc,"TrentService.GenerateDataKey")),body:JSON.stringify({KeyId:e,NumberOfBytes:t})},{}),n=g().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(H.GenerateDataKey,n),M.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new q(i,o.__type,t)}if(1500===n)throw new q("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),K=function(){function e(t,r){_(this,e),D(this,"keyArn",void 0),D(this,"keyId",void 0),this.keyArn=t,this.keyId=r}return C(e,null,[{key:"fromJSON",value:function(t){return new e(t.KeyArn,t.KeyId)}}]),e}(),M=function(){function e(t,r,n){_(this,e),D(this,"id",void 0),D(this,"ciphertextBlob",void 0),D(this,"plaintext",void 0),this.ciphertextBlob=t,this.id=r,this.plaintext=n}return C(e,null,[{key:"fromJSON",value:function(t){return new e(t.CiphertextBlob,t.KeyId,t.Plaintext)}}]),e}(),q=function(e){E(r,e);var t=N(r);function r(e,n,o){var i;return _(this,r),D(R(i=t.call(this,e,n)),"operation",void 0),i.name="KMSServiceError",i.operation=o,i}return C(r)}(w.t),H=function(e){return e.GenerateDataKey="GenerateDataKey",e.ListKeys="ListKeys",e}(H||{}),L=function(e){return e[e.Size256=32]="Size256",e[e.Size512=64]="Size512",e}(L||{}),z=r(255);function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var r=0;r".concat(e.partNumber,"").concat(e.eTag,"")})).join(""),""),s=this.signature.sign({method:o,protocol:this.scheme,hostname:i,path:"/".concat(t),headers:{},body:a,query:{uploadId:"".concat(r)}},{}),c=g().request(o,s.url,s.body||"",{headers:s.headers});this._handle_error("CompleteMultipartUpload",c)}},{key:"abortMultipartUpload",value:function(e,t,r){var n="DELETE",o="".concat(e,".").concat(this.host),i=this.signature.sign({method:n,protocol:this.scheme,hostname:o,path:"/".concat(t),headers:{},query:{uploadId:"".concat(r)}},{}),a=g().request(n,i.url,i.body||"",{headers:i.headers});this._handle_error("AbortMultipartUpload",a)}},{key:"_handle_error",value:function(t,r){var n=r.status,o=r.error_code,i=r.error;if(!(n>=200&&n<300&&""==i&&0===o)){if(301==n||i&&i.startsWith("301"))throw new oe("Resource not found","ResourceNotFound",t);var a=w.t.parseXML(r.body);if("AuthorizationHeaderMalformed"===a.code)throw new e.w(a.message,a.code);throw new oe(a.message,a.code||"unknown",t)}}}]),n}(S.k),ee=U((function e(t,r){B(this,e),$(this,"name",void 0),$(this,"creationDate",void 0),this.name=t,this.creationDate=r})),te=U((function e(t,r,n,o,i,a){B(this,e),$(this,"key",void 0),$(this,"lastModified",void 0),$(this,"etag",void 0),$(this,"size",void 0),$(this,"storageClass",void 0),$(this,"data",void 0),this.key=t,this.lastModified=r,this.etag=n,this.size=o,this.storageClass=i,this.data=a})),re=U((function e(t,r){B(this,e),$(this,"key",void 0),$(this,"uploadId",void 0),this.key=t,this.uploadId=r})),ne=U((function e(t,r){B(this,e),$(this,"partNumber",void 0),$(this,"eTag",void 0),this.partNumber=t,this.eTag=r})),oe=function(e){V(r,e);var t=Q(r);function r(e,n,o){var i;return B(this,r),$(X(i=t.call(this,e,n)),"operation",void 0),i.name="S3ServiceError",i.operation=o,i}return U(r)}(w.t),ie=r(877);function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new we(i,o.__type,t)}if(1500===n)throw new we("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),Se=function(){function e(t,r,n,o,i,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];ue(this,e),me(this,"name",void 0),me(this,"arn",void 0),me(this,"secret",void 0),me(this,"createdDate",void 0),me(this,"lastAccessedDate",void 0),me(this,"lastChangedDate",void 0),me(this,"tags",void 0),this.name=t,this.arn=r,this.secret=n,this.createdDate=o,this.lastAccessedDate=i,this.lastChangedDate=a,this.tags=s}return le(e,null,[{key:"fromJSON",value:function(t){return new e(t.Name,t.ARN,t.SecretString,t.CreatedDate,t.LastAccessedDate,t.LastChangedDate,t.Tags)}}]),e}(),we=function(e){he(r,e);var t=ye(r);function r(e,n,o){var i;return ue(this,r),me(pe(i=t.call(this,e,n)),"operation",void 0),i.name="SecretsManagerServiceError",i.operation=o,i}return le(r)}(w.t),Oe=function(e){return e.ListSecrets="ListSecrets",e.GetSecretValue="GetSecretValue",e.CreateSecret="CreateSecret",e.PutSecretValue="PutSecretValue",e.DeleteSecret="DeleteSecret",e}(Oe||{});function je(e){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(e)}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:_e(_e({},this.commonHeaders),{},xe({},m.mc,"AmazonSSM.GetParameter")),body:JSON.stringify({Name:e,WithDecryption:t})},{}),n=g().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(He.GetParameter,n),Me.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new qe(i,o.__type,t)}if(1500===n)throw new qe("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),Me=function(){function e(t,r,n,o,i,a,s,c,u){ke(this,e),xe(this,"arn",void 0),xe(this,"dataType",void 0),xe(this,"lastModifiedDate",void 0),xe(this,"name",void 0),xe(this,"selector",void 0),xe(this,"sourceResult",void 0),xe(this,"type",void 0),xe(this,"value",void 0),xe(this,"version",void 0),this.arn=t,this.dataType=r,this.lastModifiedDate=n,this.name=o,this.selector=i,this.sourceResult=a,this.type=s,this.value=c,this.version=u}return Ee(e,null,[{key:"fromJSON",value:function(t){var r=t.Parameter;return new e(r.ARN,r.DataType,r.LastModifiedDate,r.Name,r.Selector,r.SourceResult,r.Type,r.Value,r.Version)}}]),e}(),qe=function(e){Te(r,e);var t=Re(r);function r(e,n,o){var i;return ke(this,r),xe(Ae(i=t.call(this,e,n)),"operation",void 0),i.name="SystemsManagerServiceError",i.operation=o,i}return Ee(r)}(w.t),He=function(e){return e.GetParameter="GetParameter",e}(He||{}),Le=r(41);function ze(e){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(e)}function Je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({StreamName:e},t.shardCount&&{ShardCount:t.shardCount}),t.streamModeDetails&&{StreamMode:t.streamModeDetails.streamMode});this._send_request("CreateStream",r)}},{key:"deleteStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({StreamName:e},t.streamARN&&{StreamARN:t.streamARN}),t.enforceConsumerDeletion&&{EnforceConsumerDeletion:t.enforceConsumerDeletion});this._send_request("DeleteStream",r)}},{key:"listStreams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Be(Be(Be({},e.exclusiveStartStreamName&&{ExclusiveStartStreamName:e.exclusiveStartStreamName}),e.limit&&{Limit:e.limit}),e.nextToken&&{NextToken:e.nextToken}),r=this._send_request("ListStreams",t);return rt.fromJson(null==r?void 0:r.json())}},{key:"putRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.streamName&&!t.streamARN)throw new Error("Either streamName or streamARN must be provided");var r=Be(Be({Records:e},t.streamName&&{StreamName:t.streamName}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("PutRecords",r);return ot.fromJson(null==n?void 0:n.json())}},{key:"getRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({ShardIterator:e},t.limit&&{Limit:t.limit}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("GetRecords",r);return at.fromJson(null==n?void 0:n.json())}},{key:"listShards",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({StreamName:e},t.nextToken&&{NextToken:t.nextToken}),t.maxResults&&{MaxResults:t.maxResults}),n=this._send_request("ListShards",r);return ct.fromJson(null==n?void 0:n.json())}},{key:"getShardIterator",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Be(Be({StreamName:e,ShardId:t,ShardIteratorType:r},n.startingSequenceNumber&&{StartingSequenceNumber:n.startingSequenceNumber}),n.timestamp&&{Timestamp:n.timestamp}),i=this._send_request("GetShardIterator",o);return ft.fromJson(null==i?void 0:i.json())}},{key:"_send_request",value:function(e,t){var r=this.signature.sign({method:"POST",protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:Be(Be({},this.commonHeaders),{},Ye({},m.mc,"".concat(this.serviceVersion,".").concat(e))),body:JSON.stringify(t)},{}),n=g().request("POST",r.url,r.body,{headers:r.headers});return this._handle_error(e,n),n}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new tt(i,o.__type,t)}if(1500===n)throw new tt("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),tt=function(e){We(r,e);var t=Xe(r);function r(e,n,o){var i;return Ge(this,r),Ye(Fe(i=t.call(this,e,n)),"operation",void 0),i.name="KinesisServiceError",i.operation=o,i}return Ve(r)}(w.t),rt=function(){function e(t,r,n,o){Ge(this,e),Ye(this,"HasMoreStreams",void 0),Ye(this,"NextToken",void 0),Ye(this,"StreamNames",void 0),Ye(this,"StreamSummaries",void 0),this.HasMoreStreams=t,this.NextToken=r,this.StreamNames=n,this.StreamSummaries=o}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.HasMoreStreams,n=void 0!==r&&r,o=t.NextToken,i=void 0===o?"":o,a=t.StreamNames,s=void 0===a?[]:a,c=t.StreamSummaries,u=void 0===c?[]:c;return new e(n,i,s.map((function(e){return String(e)})),u.map(nt.fromJson))}}]),e}(),nt=function(){function e(t,r,n,o,i){Ge(this,e),Ye(this,"StreamARN",void 0),Ye(this,"StreamCreationTimestamp",void 0),Ye(this,"StreamModeDetails",void 0),Ye(this,"StreamName",void 0),Ye(this,"StreamStatus",void 0),this.StreamARN=t,this.StreamCreationTimestamp=r,this.StreamModeDetails=n,this.StreamName=o,this.StreamStatus=i}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.StreamARN,n=void 0===r?"":r,o=t.StreamCreationTimestamp,i=void 0===o?0:o,a=t.StreamModeDetails,s=void 0===a?{}:a,c=t.StreamName,u=void 0===c?"":c,f=t.StreamStatus;return new e(n,i,s,u,void 0===f?"":f)}}]),e}(),ot=function(){function e(t,r,n){Ge(this,e),Ye(this,"EncryptionType",void 0),Ye(this,"FailedRecordCount",void 0),Ye(this,"Records",void 0),this.EncryptionType=t,this.FailedRecordCount=r,this.Records=n}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.EncryptionType,n=void 0===r?"NONE":r,o=t.FailedRecordCount,i=void 0===o?0:o,a=t.Records;return new e(n,i,(void 0===a?[]:a).map((function(e){return it.fromJson(e)})))}}]),e}(),it=function(){function e(t,r){Ge(this,e),Ye(this,"SequenceNumber",void 0),Ye(this,"ShardId",void 0),this.SequenceNumber=t,this.ShardId=r}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.SequenceNumber,t.ShardId)}}]),e}(),at=function(){function e(t,r){Ge(this,e),Ye(this,"NextShardIterator",void 0),Ye(this,"Records",void 0),this.NextShardIterator=t,this.Records=r}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.NextShardIterator,n=void 0===r?"":r,o=t.Records;return new e(n,(void 0===o?[]:o).map((function(e){return st.fromJson(e)})))}}]),e}(),st=function(){function e(t,r,n){Ge(this,e),Ye(this,"Data",void 0),Ye(this,"PartitionKey",void 0),Ye(this,"SequenceNumber",void 0),this.Data=t,this.PartitionKey=r,this.SequenceNumber=n}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.Data,t.PartitionKey,t.SequenceNumber)}}]),e}(),ct=function(){function e(t,r){Ge(this,e),Ye(this,"Shards",void 0),Ye(this,"NextToken",void 0),this.Shards=t,this.NextToken=r}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.Shards,n=void 0===r?[]:r,o=t.NextToken;return new e(n.map((function(e){return ut.fromJson(e)})),o)}}]),e}(),ut=function(){function e(t,r,n,o,i){Ge(this,e),Ye(this,"Id",void 0),Ye(this,"ParentShardId",void 0),Ye(this,"AdjacentParentShardId",void 0),Ye(this,"HashKeyRange",void 0),Ye(this,"SequenceNumberRange",void 0),this.Id=t,this.ParentShardId=o,this.AdjacentParentShardId=i,this.HashKeyRange=r,this.SequenceNumberRange=n}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardId,t.HashKeyRange,t.SequenceNumberRange,t.ParentShardId,t.AdjacentParentShardId)}}]),e}(),ft=function(){function e(t){Ge(this,e),Ye(this,"ShardIterator",void 0),this.ShardIterator=t}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardIterator)}}]),e}()})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); //# sourceMappingURL=aws.js.map \ No newline at end of file diff --git a/build/aws.js.map b/build/aws.js.map index 68ca436..8bfbc82 100644 --- a/build/aws.js.map +++ b/build/aws.js.map @@ -1 +1 @@ -{"version":3,"file":"aws.js","mappings":"04BAUO,IAAMA,EAAS,WAWlB,SAAAA,EAAYC,EAAsBC,I,4FAAqBC,CAAA,KAAAH,GAAAI,EAAA,yBAAAA,EAAA,2BAAAA,EAAA,qBAAAA,EAAA,uBACnDC,KAAK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C1C,KAACwN,CAAA,CA3B0B,GAiClBsD,GAAK,WAuBd,SAAAA,EACIlQ,EACAmQ,EACAC,EACAC,EACAC,GACF9gB,GAAA,KAAA0gB,GA5BFzgB,GAAA,kBAKAA,GAAA,6BAKAA,GAAA,qCAKAA,GAAA,4BAAAA,GAAA,mCAcIC,KAAK6gB,GAAKvQ,EACVtQ,KAAK8gB,cAAgBH,EACrB3gB,KAAK+gB,sBAAwBH,EAC7B5gB,KAAKghB,aAAeP,EACpBzgB,KAAKihB,oBAAsBP,CAC/B,CAUC,OAVAvf,GAAAqf,EAAA,OAAAvgB,IAAA,WAAAmB,MAED,SAAgBmT,GACZ,OAAO,IAAIiM,EACPjM,EAAK8I,QACL9I,EAAKyM,aACLzM,EAAK0M,oBACL1M,EAAKuM,cACLvM,EAAKwM,sBAEb,KAACP,CAAA,CA7Ca,GAoFZ7C,GAAwB,WAM1B,SAAAA,EAAYZ,GAAuBjd,GAAA,KAAA6d,GALnC5d,GAAA,6BAMIC,KAAKgd,cAAgBD,CACzB,CAIC,OAJA5b,GAAAwc,EAAA,OAAA1d,IAAA,WAAAmB,MAED,SAAgBmT,GACZ,OAAO,IAAIoJ,EAAyBpJ,EAAKyI,cAC7C,KAACW,CAAA,CAZyB,E","sources":["webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/./src/internal/sqs.ts","webpack://k6-jslib-aws/./node_modules/uuid/index.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/bytesToUuid.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/rng-browser.js","webpack://k6-jslib-aws/./node_modules/uuid/v1.js","webpack://k6-jslib-aws/./node_modules/uuid/v4.js","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/kms.ts","webpack://k6-jslib-aws/./src/internal/s3.ts","webpack://k6-jslib-aws/./src/internal/secrets-manager.ts","webpack://k6-jslib-aws/./src/internal/ssm.ts","webpack://k6-jslib-aws/./src/internal/kinesis.ts"],"sourcesContent":["import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","import { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { SignatureV4, InvalidSignatureError } from './signature'\nimport { HTTPHeaders, SignedHTTPRequest } from './http'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\nimport { toFormUrlEncoded } from './utils'\nimport { AWSError } from './error'\n\nconst API_VERSION = '2012-11-05'\n\nexport class SQSClient extends AWSClient {\n private readonly signature: SignatureV4\n private readonly commonHeaders: HTTPHeaders\n\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'sqs')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken\n },\n uriEscapePath: true,\n applyChecksum: true\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }\n\n /**\n * Delivers a message to the specified queue.\n *\n * @param {string} queueUrl - The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.\n * @param {string} messageBody - The message to send. The minimum size is one character. The maximum size is 256 KB.\n * @param {Object} options - Options for the request\n * @param {string} [options.messageDeduplicationId] - The message deduplication id.\n * @param {string} [options.messageGroupId] - The message group ID for FIFO queues\n * @returns {Message} - The message that was sent.\n */\n sendMessage(queueUrl: string, messageBody: string, options: { messageDeduplicationId?: string; messageGroupId?: string} = {}): Message {\n const method = 'POST'\n\n let body: any = {\n Action: 'SendMessage',\n Version: API_VERSION,\n QueueUrl: queueUrl,\n MessageBody: messageBody,\n }\n\n if (typeof(options.messageDeduplicationId) !== 'undefined') {\n body = { ...body,\n MessageDeduplicationId: options.messageDeduplicationId\n }\n }\n\n if (typeof(options.messageGroupId) !== 'undefined') {\n body = { ...body,\n MessageGroupId: options.messageGroupId\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: 'https',\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('SendMessage', res)\n\n const parsed = res.html('SendMessageResponse > SendMessageResult')\n return new Message(\n parsed.find('MessageId').text(),\n parsed.find('MD5OfMessageBody').text()\n )\n }\n\n /**\n * Returns a list of your queues in the current region.\n *\n * @param {ListQueuesRequestParameters} [parameters={}] request parameters\n * @param {number} [ListQueuesRequestParameters.maxResults] Maximum number of results to include in the response. Value range is 1 to 1000. You must set maxResults to receive a value for nextToken in the response.\n * @param {string} [ListQueuesRequestParameters.nextToken] Pagination token to request the next set of results.\n * @param {string} [ListQueuesRequestParameters.queueNamePrefix] A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * @returns {Object}\n * @returns {string[]} Object.queueUrls - A list of queue URLs, up to 1000 entries.\n * @returns {string} [Object.nextToken] - In the future, you can use NextToken to request the next set of results.\n */\n listQueues(parameters: ListQueuesRequestParameters = {}): ListQueuesResponse {\n const method = 'POST'\n\n let body: any = {\n Action: 'ListQueues',\n Version: API_VERSION,\n }\n\n if (typeof(parameters?.maxResults) !== 'undefined') {\n body = { ...body,\n MaxResults: parameters.maxResults\n }\n }\n\n if (typeof(parameters?.nextToken) !== 'undefined') {\n body = { ...body,\n NextToken: parameters.nextToken\n }\n }\n\n if (typeof(parameters?.queueNamePrefix) !== 'undefined') {\n body = { ...body,\n QueueNamePrefix: parameters.queueNamePrefix\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: 'https',\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n 'Host': this.host\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('ListQueues', res)\n\n let parsed = res.html()\n return {\n urls: parsed.find('QueueUrl').toArray().map(e => e.text()),\n nextToken: parsed.find('NextToken').text() || undefined\n }\n }\n\n private _handleError(operation: SQSOperation, response: RefinedResponse) {\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n if (errorMessage == '' && errorCode === 0) {\n return\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new SQSServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/**\n * An Amazon SQS message.\n */\nexport class Message {\n /**\n * A unique identifier for the message.\n * A MessageIdis considered unique across all AWS accounts for an extended period of time.\n */\n id: string\n\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n bodyMD5: string\n\n /**\n * Instantiates a new Message object.\n *\n * @param id\n * @param md5Ofbody\n */\n constructor(id: string, bodyMD5: string) {\n this.id = id\n this.bodyMD5 = bodyMD5\n }\n}\n\n/**\n * SQSServiceError indicates an error occurred while interacting with the SQS API.\n */\nexport class SQSServiceError extends AWSError {\n operation: SQSOperation;\n\n constructor(message: string, code: string, operation: SQSOperation) {\n super(message, code)\n this.name = 'SQSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SQSOperation describes possible SQS operations.\n */\ntype SQSOperation = 'ListQueues' | 'SendMessage'\n\nexport interface SendMessageOptions {\n /*\n * The message deduplication ID for FIFO queues\n */\n messageDeduplicationId?: string\n\n /*\n * The message group ID for FIFO queues\n */\n messageGroupId?: string\n}\n\nexport interface ListQueuesRequestParameters {\n /**\n * Maximum number of results to include in the response. Value range is 1 to 1000.\n */\n maxResults?: number\n /**\n * Pagination token to request the next set of results.\n */\n nextToken?: string\n /**\n * A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * Queue URLs and names are case-sensitive.\n */\n queueNamePrefix?: string\n}\n\nexport interface ListQueuesResponse {\n /**\n * A list of queue URLs, up to 1,000 entries, or the value of MaxResults you sent in the request.\n */\n urls: string[]\n /**\n * Pagination token to include in the next request.\n */\n nextToken?: string\n}","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","module.exports = require(\"k6/crypto\");","module.exports = require(\"k6/html\");","module.exports = require(\"k6/http\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's KMS service\n */\nexport class KMSClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a KMSClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kms')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the KMS service\n // are made via the GET or POST method.\n this.method = 'POST'\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Gets a list of all the KMS keys in the caller's AWS\n * account and region.\n *\n * @returns an array of all the available keys\n */\n listKeys(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.ListKeys`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.ListKeys, res)\n\n const json: JSONArray = res.json('Keys') as JSONArray\n return json.map((k) => KMSKey.fromJSON(k as JSONObject))\n }\n\n /**\n * GenerateDataKey returns a unique symmetric data key for use outside of AWS KMS.\n *\n * This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.\n * The bytes in the plaintext key are random; they are not related to the caller or the KMS key.\n * You can use the plaintext key to encrypt your data outside of AWS KMS and store the encrypted data key with the encrypted data.\n *\n * To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key.\n * You cannot use an asymmetric KMS key to encrypt data keys.\n *\n * Used to generate data key with the KMS key defined\n * @param {string} id - Specifies the symmetric encryption KMS key that encrypts the data key. Use its key ID, key ARN, alias name, or alias ARN.\n * @param {KMKeySize} size - Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). Default is 32, and generates a 256-bit data key.\n * @throws {KMSServiceError}\n * @throws {InvalidSignatureError}\n * @returns {KMSDataKey} - The generated data key.\n */\n generateDataKey(id: string, size: KMSKeySize = KMSKeySize.Size256): KMSDataKey | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.GenerateDataKey`,\n },\n body: JSON.stringify({ KeyId: id, NumberOfBytes: size }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.GenerateDataKey, res)\n\n return KMSDataKey.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(operation: KMSOperation, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KMSServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KMSServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a KMS key\n */\nexport class KMSKey {\n /**\n * ARN of the key\n */\n keyArn: string\n\n /**\n * Unique identifier of the key\n */\n keyId: string\n\n constructor(keyArn: string, KeyId: string) {\n this.keyArn = keyArn\n this.keyId = KeyId\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSKey(json.KeyArn as string, json.KeyId as string)\n }\n}\n\n/**\n * Class representing a data key\n */\nexport class KMSDataKey {\n /**\n * The Amazon Resource Name (key ARN) of the KMS key that encrypted the data key.\n */\n id: string\n\n /**\n * The (base64-encoded) encrypted copy of the data key.\n */\n ciphertextBlob: string\n\n /**\n * The plaintext data key.\n * Use this data key to encrypt your data outside of KMS. Then, remove it from memory as soon as possible.\n */\n plaintext: string\n\n constructor(CiphertextBlob: string, KeyId: string, Plaintext: string) {\n this.ciphertextBlob = CiphertextBlob\n this.id = KeyId\n this.plaintext = Plaintext\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSDataKey(\n json.CiphertextBlob as string,\n json.KeyId as string,\n json.Plaintext as string\n )\n }\n}\n\nexport class KMSServiceError extends AWSError {\n operation: KMSOperation\n\n /**\n * Constructs a KMSServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: KMSOperation) {\n super(message, code)\n this.name = 'KMSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * KMSOperation defines all currently implemented KMS Service operations.\n */\nenum KMSOperation {\n GenerateDataKey = 'GenerateDataKey',\n ListKeys = 'ListKeys',\n}\n\n/**\n * KMSKeyLength describes possible key lenght values for KMS API data key operations.\n */\nenum KMSKeySize {\n Size256 = 32,\n Size512 = 64,\n}\n","import { bytes } from 'k6'\nimport { parseHTML } from 'k6/html'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AWSError } from './error'\nimport { SignedHTTPRequest } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n\n/** Class allowing to interact with Amazon AWS's S3 service */\nexport class S3Client extends AWSClient {\n signature: SignatureV4\n\n /**\n * Create a S3Client\n *\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 's3')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n }\n\n /**\n * Returns a list of all buckets owned by the authenticated sender of the request.\n * To use this operation, you must have the s3:ListAllMyBuckets permission.\n *\n * @return {Array.} buckets - An array of objects describing S3 buckets\n * with the following fields: name, and creationDate.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listBuckets(): Array {\n const method = 'GET'\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListBuckets', res)\n\n let buckets: Array = []\n\n const doc = parseHTML(res.body as string)\n\n doc.find('Buckets')\n .children()\n .each((_, bucketDefinition) => {\n let bucket = {}\n\n bucketDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'name':\n Object.assign(bucket, { name: child.textContent() })\n break\n case 'creationdate':\n Object.assign(bucket, {\n creationDate: Date.parse(child.textContent()),\n })\n }\n })\n\n buckets.push(bucket as S3Bucket)\n })\n\n return buckets\n }\n\n /**\n * Returns some or all (up to 1,000) of the objects in a bucket.\n *\n * @param {string} bucketName - Bucket name to list.\n * @param {string?} prefix='' - Limits the response to keys that begin with the specified prefix.\n * @return {Array.} - returns an array of objects describing S3 objects\n * with the following fields: key, lastModified, etag, size and storageClass.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listObjects(bucketName: string, prefix?: string): Array {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/`,\n query: {\n 'list-type': '2',\n prefix: prefix || '',\n },\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListObjectsV2', res)\n\n let objects: Array = []\n\n // Extract the objects definition from\n // the XML response\n parseHTML(res.body as string)\n .find('Contents')\n .each((_, objectDefinition) => {\n let obj = {}\n\n objectDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'key':\n Object.assign(obj, { key: child.textContent() })\n break\n case 'lastmodified':\n Object.assign(obj, { lastModified: Date.parse(child.textContent()) })\n break\n case 'etag':\n Object.assign(obj, { etag: child.textContent() })\n break\n case 'size':\n Object.assign(obj, { size: parseInt(child.textContent()) })\n break\n case 'storageclass':\n Object.assign(obj, { storageClass: child.textContent() })\n }\n })\n\n objects.push(obj as S3Object)\n })\n\n return objects\n }\n /**\n * Retrieves an Object from Amazon S3.\n *\n * To use getObject, you must have `READ` access to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to get.\n * @return {S3Object} - returns the content of the fetched S3 Object.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n getObject(bucketName: string, objectKey: string): S3Object {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('GetObject', res)\n\n return new S3Object(\n objectKey,\n Date.parse(res.headers['Last-Modified']),\n res.headers['ETag'],\n parseInt(res.headers['Content-Length']),\n\n // The X-Amz-Storage-Class header is only set if the storage class is\n // not the default 'STANDARD' one.\n (res.headers['X-Amz-Storage-Class'] ?? 'STANDARD') as StorageClass,\n\n res.body\n )\n }\n /**\n * Adds an object to a bucket.\n *\n * You must have WRITE permissions on a bucket to add an object to it.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to put.\n * @param {string | ArrayBuffer} data - the content of the S3 Object to upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {\n // Prepare request\n const method = 'PUT'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {\n Host: host,\n },\n body: data,\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error('PutObject', res)\n }\n\n /**\n * Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteObject(bucketName: string, objectKey: string): void {\n // Prepare request\n const method = 'DELETE'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('DeleteObject', res)\n }\n\n /**\n * Creates a new multipart upload for a given objectKey.\n * The uploadId returned can be used to upload parts to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @return {S3MultipartUpload} - returns the uploadId of the newly created multipart upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n createMultipartUpload(bucketName: string, objectKey: string): S3MultipartUpload {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: { uploads: '' },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('CreateMultipartUpload', res)\n\n return new S3MultipartUpload(\n objectKey,\n parseHTML(res.body as string)\n .find('UploadId')\n .text()\n )\n }\n\n /**\n * Uploads a part in a multipart upload.\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @param {string} uploadId - The uploadId of the multipart upload.\n * @param {number} partNumber - The part number of the part to upload.\n * @param {string | ArrayBuffer} data - The content of the part to upload.\n * @return {S3Part} - returns the ETag of the uploaded part.\n * @throws {S3ServiceError}\n */\n uploadPart(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n partNumber: number,\n data: string | ArrayBuffer\n ): S3Part {\n // Prepare request\n const method = 'PUT'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: data,\n query: {\n partNumber: `${partNumber}`,\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('UploadPart', res)\n\n return new S3Part(partNumber, res.headers['Etag'])\n }\n\n /**\n * Completes a multipart upload by assembling previously uploaded parts.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to complete.\n * @param {S3Part[]} parts - The parts to assemble.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n completeMultipartUpload(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n parts: S3Part[]\n ) {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n const body = `${parts\n .map(\n (part) =>\n `${part.partNumber}${part.eTag}`\n )\n .join('')}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: body,\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n\n this._handle_error('CompleteMultipartUpload', res)\n }\n\n /**\n * Aborts a multipart upload.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to abort.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string) {\n // Prepare request\n const method = 'DELETE'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('AbortMultipartUpload', res)\n }\n\n _handle_error(operation: S3Operation, response: RefinedResponse) {\n const status: number = response.status\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n // We consider codes 200-299 as success\n if (status >= 200 && status < 300 && errorMessage == '' && errorCode === 0) {\n return\n }\n\n // A 301 response is returned when the bucket is not found.\n // Generally meaning that either the bucket name is wrong or the\n // region is wrong.\n //\n // See: https://github.com/grafana/k6/issues/2474\n // See: https://github.com/golang/go/issues/49281\n if (status == 301 || (errorMessage && errorMessage.startsWith('301'))) {\n throw new S3ServiceError('Resource not found', 'ResourceNotFound', operation)\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new S3ServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/** Class representing a S3 Bucket */\nexport class S3Bucket {\n name: string\n creationDate: Date\n\n /**\n * Create an S3 Bucket\n *\n * @param {string} name - S3 bucket's name\n * @param {Date} creationDate - S3 bucket's creation date\n */\n constructor(name: string, creationDate: Date) {\n this.name = name\n this.creationDate = creationDate\n }\n}\n\n/** Class representing an S3 Object */\nexport class S3Object {\n key: string\n lastModified: number\n etag: string\n size: number\n storageClass: StorageClass\n data?: string | bytes | null\n\n /**\n * Create an S3 Object\n *\n * @param {string} key - S3 object's key\n * @param {Date} lastModified - S3 object last modification date\n * @param {string} etag - S3 object's etag\n * @param {number} size - S3 object's size\n * @param {StorageClass} storageClass - S3 object's storage class\n * @param {string | bytes | null} data=null - S3 Object's data\n */\n constructor(\n key: string,\n lastModified: number,\n etag: string,\n size: number,\n storageClass: StorageClass,\n data?: string | bytes | null\n ) {\n this.key = key\n this.lastModified = lastModified\n this.etag = etag\n this.size = size\n this.storageClass = storageClass\n this.data = data\n }\n}\n\n/** Class representing a S3 Multipart Upload */\nexport class S3MultipartUpload {\n key: string\n uploadId: string\n\n /**\n * Create an S3 Multipart Upload\n * @param {string} key - S3 object's key\n * @param {string} uploadId - S3 multipart upload id\n */\n\n constructor(key: string, uploadId: string) {\n this.key = key\n this.uploadId = uploadId\n }\n}\n\n/** Class representing a S3 Part */\nexport class S3Part {\n partNumber: number\n eTag: string\n\n /**\n * Create an S3 Part\n * @param {number} partNumber - Part number\n * @param {string} eTag - Part's etag\n */\n\n constructor(partNumber: number, eTag: string) {\n this.partNumber = partNumber\n this.eTag = eTag\n }\n}\n\n/**\n * Error indicating a S3 operation failed\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class S3ServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a S3ServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'S3ServiceError'\n this.operation = operation\n }\n}\n\n/**\n * S3Operation describes possible values for S3 API operations,\n * as defined by AWS APIs.\n */\ntype S3Operation =\n | 'ListBuckets'\n | 'ListObjectsV2'\n | 'GetObject'\n | 'PutObject'\n | 'DeleteObject'\n | 'CreateMultipartUpload'\n | 'CompleteMultipartUpload'\n | 'UploadPart'\n | 'AbortMultipartUpload'\n\n/**\n * Describes the class of storage used to store a S3 object.\n */\ntype StorageClass =\n | 'STANDARD'\n | 'REDUCED_REDUNDANCY'\n | 'GLACIER'\n | 'STANDARD_IA'\n | 'INTELLIGENT_TIERING'\n | 'DEEP_ARCHIVE'\n | 'OUTPOSTS'\n | 'GLACIER_IR'\n | undefined\n","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's SecretsManager service\n */\nexport class SecretsManagerClient extends AWSClient {\n /**\n * HTTP Method to use when interacting with the Secrets Manager service.\n */\n method: HTTPMethod\n\n /**\n * HTTP headers to use accross all requests to the Secrets Manager service.\n */\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a SecretsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'secretsmanager')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the Secrets Manager service\n // are made via the GET or POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Returns a list of all secrets owned by the authenticated sender of the request.\n * To use this operation, you must have the secretsmanager:ListSecrets permission.\n *\n * @return {Array.} secrets - An array of objects describing Secret Manager's secrets\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n listSecrets(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.ListSecrets`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.ListSecrets, res)\n const json: JSONArray = res.json('SecretList') as JSONArray\n\n return json.map((s) => Secret.fromJSON(s as JSONObject))\n }\n\n /**\n * Retrieves a secret from Amazon Sercets Manager\n *\n * @param {string} id - The ARN or name of the secret to retrieve.\n * @returns {Secret} - returns the content of the fetched Secret object.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getSecret(id: string): Secret | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.GetSecretValue`,\n },\n body: JSON.stringify({ SecretId: id }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(SecretsManagerOperation.GetSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Creates a new secret\n *\n * Note that this method only supports string-based values at the moment.\n *\n * @param {string} name - The name of the new secret.\n * The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {string} description - The description of the secret.\n * @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * algorithm.\n * @param {Array.} tags=[] - A list of tags to attach to the secret. Each tag is a key and\n * value pair of strings in a JSON text string. Note that tag key names are case sensitive.\n * @returns {Secret} - returns the created secret\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n createSecret(\n name: string,\n secret: string,\n description: string,\n versionID?: string,\n tags?: Array\n ): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.CreateSecret`,\n },\n body: JSON.stringify({\n Name: name,\n Description: description,\n SecretString: secret,\n ClientRequestToken: versionID,\n Tags: tags,\n }),\n },\n {}\n )\n\n // Ensure to include the desired 'Action' in the X-Amz-Target\n // header field, as documented by the AWS API docs.\n // headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.CreateSecret, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n /**\n * Update a secret's value.\n *\n * Note that this method only support string-based values at the moment.\n *\n * @param {string} id - The ARN or name of the secret to update.\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n putSecretValue(id: string, secret: string, versionID?: string): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.PutSecretValue`,\n },\n body: JSON.stringify({\n SecretId: id,\n SecretString: secret,\n ClientRequestToken: versionID,\n }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.PutSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Deletes a secret and all of its versions.\n *\n * You can specify a recovery window during which you can restore the secret.\n * The minimum recovery window is 7 days. The default recovery window is 30 days.\n *\n * @param {string} secretID - The ARN or name of the secret to delete.\n * @param {number} recoveryWindow - The number of days from 7 to 30 that Secrets Manager\n * waits before permanently deleting the secret.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteSecret(\n id: string,\n { recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }\n ) {\n const payload: { [key: string]: string | boolean | number } = {\n SecretId: id,\n }\n\n // noRecovery and recoveryWindow are exclusive parameters\n if (noRecovery === true) {\n payload['ForceDeleteWithoutRecovery'] = true\n } else {\n payload['RecoveryWindowInDays'] = recoveryWindow\n }\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.DeleteSecret`,\n },\n body: JSON.stringify(payload),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.DeleteSecret, res)\n }\n\n _handle_error(\n operation: SecretsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SecretsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SecretsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n// TODO: create a Tags type\n\n/**\n * Class representing a Secret Manager's secret\n */\nexport class Secret {\n name: string\n arn: string\n secret: string\n createdDate: number\n lastAccessedDate: number\n lastChangedDate: number\n tags: Array<{ [key: string]: string }>\n\n /**\n * Constructs a Secret Manager's Secret\n *\n * @param {string} name - The friendly name of the secret.\n * @param {string} arn - The ARN of the secret.\n * @param {number} createdDate - The date and time that this version of the secret was created.\n * @param {number} lastAccessedDate - The last date that this secret was accessed. This value is\n * truncated to midnight of the date and therefore shows only the date, not the time.\n * @param {number} lastChangedDate - The last date and time that this secret was modified in any way.\n * @param {Array.} tags - The list of user-defined tags associated with the secret.\n */\n constructor(\n name: string,\n arn: string,\n secretString: string,\n createdDate: number,\n lastAccessedDate: number,\n lastChangedDate: number,\n tags: Array<{ [key: string]: string }> = []\n ) {\n this.name = name\n this.arn = arn\n this.secret = secretString\n this.createdDate = createdDate\n this.lastAccessedDate = lastAccessedDate\n this.lastChangedDate = lastChangedDate\n this.tags = tags\n }\n\n /**\n * Parses and constructs a Secret Manager's Secret from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {Secret}\n */\n static fromJSON(json: JSONObject) {\n return new Secret(\n json.Name as string,\n json.ARN as string,\n json.SecretString as string,\n json.CreatedDate as number,\n json.LastAccessedDate as number,\n json.LastChangedDate as number,\n json.Tags as Array<{ [key: string]: string }>\n )\n }\n}\n\nexport class SecretsManagerServiceError extends AWSError {\n operation: SecretsManagerOperation\n\n /**\n * Constructs a SecretsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SecretsManagerOperation) {\n super(message, code)\n this.name = 'SecretsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SecretsManagerOperation defines all currently implemented Secrets Manager Service operations.\n */\nenum SecretsManagerOperation {\n ListSecrets = 'ListSecrets',\n GetSecretValue = 'GetSecretValue',\n CreateSecret = 'CreateSecret',\n PutSecretValue = 'PutSecretValue',\n DeleteSecret = 'DeleteSecret',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's Systems Manager service\n */\nexport class SystemsManagerClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n signature: SignatureV4\n\n /**\n * Create a SystemsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'ssm')\n\n // All interactions with the Systems Manager service\n // are made via the POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n }\n\n /**\n * Retrieves a parameter from Amazon Systems Manager\n *\n * @param {string} name - The ARN or name of the parameter to retrieve.\n * @param {boolean} withDecryption - whether returned secure string parameters should be decrypted.\n * @returns {SystemsManagerParameter} - returns the fetched Parameter object.\n * @throws {SystemsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getParameter(\n name: string,\n withDecryption: boolean = false\n ): SystemsManagerParameter | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `AmazonSSM.GetParameter`,\n },\n body: JSON.stringify({ Name: name, WithDecryption: withDecryption }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SystemsManagerOperation.GetParameter, res)\n\n return SystemsManagerParameter.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(\n operation: SystemsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SystemsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SystemsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a Systems Manager's Parameter\n */\nexport class SystemsManagerParameter {\n /**\n * The Amazon Resource Name (ARN) of the parameter.\n */\n arn: string\n\n /**\n * The data type of the parameter, such as text or aws:ec2:image.\n * The default is text.\n */\n dataType: string\n\n /**\n * Date the parameter was last changed or updated and the parameter version was created.\n */\n lastModifiedDate: number\n\n /**\n * The friendly name of the parameter.\n */\n name: string\n\n /**\n * Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n */\n selector: string\n\n /**\n * plies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n */\n sourceResult: string\n\n /**\n * The type of parameter. Valid values include the following: String, StringList, and SecureString.\n */\n type: string\n\n /**\n * The parameter value.\n */\n value: string\n\n /**\n * The parameter version.\n */\n version: number\n\n /**\n * Constructs a Systems Manager's Parameter\n *\n * @param {string} arn - The Amazon Resource Name (ARN) of the parameter.\n * @param {string} dataType - The data type of the parameter, such as text or aws:ec2:image. The default is text.\n * @param {number} lastModifiedDate - Date the parameter was last changed or updated and the parameter version was created.\n * @param {string} name - The friendly name of the parameter.\n * @param {string} selector - Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n * @param {string} sourceResult - Applies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n * @param {string} type - The type of parameter. Valid values include the following: String, StringList, and SecureString.\n * @param {string} value - The parameter value.\n * @param {number} version - The parameter version.\n */\n constructor(\n arn: string,\n dataType: string,\n lastModifiedDate: number,\n name: string,\n selector: string,\n sourceResult: string,\n type: string,\n value: string,\n version: number\n ) {\n this.arn = arn\n this.dataType = dataType\n this.lastModifiedDate = lastModifiedDate\n this.name = name\n this.selector = selector\n this.sourceResult = sourceResult\n this.type = type\n this.value = value\n this.version = version\n }\n\n /**\n * Parses and constructs a Systems Manager's Parameter from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {SystemsManagerParameter}\n */\n static fromJSON(json: JSONObject): SystemsManagerParameter {\n const parameter = json.Parameter as JSONObject\n\n return new SystemsManagerParameter(\n parameter.ARN as string,\n parameter.DataType as string,\n parameter.LastModifiedDate as number,\n parameter.Name as string,\n parameter.Selector as string,\n parameter.SourceResult as string,\n parameter.Type as string,\n parameter.Value as string,\n parameter.Version as number\n )\n }\n}\n\nexport class SystemsManagerServiceError extends AWSError {\n operation: SystemsManagerOperation\n\n /**\n * Constructs a SystemsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {SystemsManagerOperation} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SystemsManagerOperation) {\n super(message, code)\n this.name = 'SystemsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SystemsManagerOperation defines all currently implemented Systems Manager operations.\n */\nenum SystemsManagerOperation {\n GetParameter = 'GetParameter',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\n\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\nThis API is based on\nhttps://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html\n*/\n\n/**\n * Allows interacting with the Kinesis API.\n */\nexport class KinesisClient extends AWSClient {\n /**\n * The SignatureV4 object used to sign requests.\n */\n signature: SignatureV4\n\n /**\n * The common headers that are used for all requests.\n */\n commonHeaders: HTTPHeaders\n\n /**\n * The version of the Kinesis API that is used for all requests.\n */\n serviceVersion: string\n\n /**\n * A constructor function that creates a new instance of the Kinesis class.\n * @param {AWSConfig} awsConfig - AWSConfig - This is the configuration object that is passed to\n * the constructor.\n * @returns A Proxy object.\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kinesis')\n\n this.serviceVersion = 'Kinesis_20131202'\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Creates a new Kinesis stream with the specified name and options.\n *\n * @param {string} streamName - The name of the stream to create.\n * @param {{\n * shardCount?: number;\n * streamModeDetails?: {\n * streamMode: StreamMode;\n * };\n * }} [options={}] - An optional object containing configuration options for the stream.\n * @param {number} [options.shardCount] - The number of shards for the stream. If not provided, the default value will be used.\n * @param {{streamMode: StreamMode}} [options.streamModeDetails] - An optional object containing the stream mode details.\n * @param {StreamMode} [options.streamModeDetails.streamMode] - The mode of the stream. If not provided, the default mode will be used.\n *\n * @throws {Error} Throws an error if the stream creation request fails.\n * @returns {void}\n */\n createStream(\n streamName: string,\n options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(options.shardCount && { ShardCount: options.shardCount }),\n ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }),\n }\n\n this._send_request('CreateStream', body)\n }\n\n /**\n * Deletes a Kinesis stream with the specified parameters.\n *\n * @param {string} streamName - The name of the stream to delete.\n * @param {{\n * streamARN?: string;\n * enforceConsumerDeletion?: boolean;\n * }} [parameters={}] - An optional object containing configuration options for the stream deletion.\n * @param {string} [parameters.streamARN] - The Amazon Resource Name (ARN) of the stream. If not provided, the ARN will be derived from the stream name.\n * @param {boolean} [parameters.enforceConsumerDeletion] - Whether to enforce the deletion of all registered consumers before deleting the stream. Defaults to false.\n *\n * @throws {Error} Throws an error if the stream deletion request fails.\n * @returns {void}\n */\n deleteStream(\n streamName: string,\n parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n ...(parameters.enforceConsumerDeletion && {\n EnforceConsumerDeletion: parameters.enforceConsumerDeletion,\n }),\n }\n\n this._send_request('DeleteStream', body)\n }\n\n /**\n * Returns a list of Kinesis streams with the specified parameters.\n *\n * @param {{\n * exclusiveStartStreamName?: string;\n * limit?: number;\n * nextToken?: string;\n * }} [parameters={}] - An optional object containing configuration options for listing the streams.\n * @param {string} [parameters.exclusiveStartStreamName] - The name of the stream to start listing from. If not provided, the listing starts from the beginning.\n * @param {number} [parameters.limit] - The maximum number of streams to list. If not provided, the default value will be used.\n * @param {string} [parameters.nextToken] - A token to paginate the list of streams. If not provided, the first page will be returned.\n *\n * @throws {Error} Throws an error if the list streams request fails.\n * @returns {Partial} A partial of the ListStreamsResponse class.\n */\n listStreams(\n parameters: {\n exclusiveStartStreamName?: string\n limit?: number\n nextToken?: string\n } = {}\n ): ListStreamsResponse {\n const body: any = {\n ...(parameters.exclusiveStartStreamName && {\n ExclusiveStartStreamName: parameters.exclusiveStartStreamName,\n }),\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n }\n\n const res = this._send_request('ListStreams', body)\n return ListStreamsResponse.fromJson(res?.json())\n }\n\n /**\n * Sends multiple records to a Kinesis stream in a single request.\n *\n * @param {string} streamName - The name of the stream to put records into.\n * @param {PutRecordsRequestEntry[]} records - An array of records to put into the stream.\n *\n * @throws {Error} Throws an error if the put records request fails.\n * @returns {Partial} A partial of the PutRecordsResponse class.\n */\n putRecords(\n records: PutRecordsRequestEntry[],\n parameters: { streamName?: string; streamARN?: string } = {}\n ): PutRecordsResponse {\n if (!parameters.streamName && !parameters.streamARN) {\n throw new Error('Either streamName or streamARN must be provided')\n }\n\n const body: any = {\n Records: records,\n ...(parameters.streamName && { StreamName: parameters.streamName }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('PutRecords', body)\n return PutRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves records from a Kinesis stream.\n *\n * @param {string} shardIterator - The shard iterator to start retrieving records from.\n * @param {number} [limit] - The maximum number of records to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the get records request fails.\n * @returns {Partial} A partial of the GetRecordsResponse class.\n */\n getRecords(\n shardIterator: string,\n parameters: { limit?: number; streamARN?: string } = {}\n ): GetRecordsResponse {\n const body: any = {\n ShardIterator: shardIterator,\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('GetRecords', body)\n return GetRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Lists the shards in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream to list shards from.\n * @param {{\n * nextToken?: string;\n * maxResults?: number;\n * }} [parameters={}] - An optional object containing configuration options for listing shards.\n * @param {string} [parameters.nextToken] - A token to specify where to start paginating the shard list. If not provided, the first page will be returned.\n * @param {number} [parameters.maxResults] - The maximum number of shards to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the list shards request fails.\n * @returns {ListShardsResponse} A ListShardsResponse class instance.\n */\n listShards(\n streamName: string,\n parameters: { nextToken?: string; maxResults?: number } = {}\n ): ListShardsResponse {\n const body: any = {\n StreamName: streamName,\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n ...(parameters.maxResults && {\n MaxResults: parameters.maxResults,\n }),\n }\n\n const res = this._send_request('ListShards', body)\n return ListShardsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves a shard iterator for the specified shard in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream.\n * @param {string} shardId - The shard ID for which to get the iterator.\n * @param {string} shardIteratorType - The shard iterator type. One of 'AT_SEQUENCE_NUMBER', 'AFTER_SEQUENCE_NUMBER', 'TRIM_HORIZON', 'LATEST', or 'AT_TIMESTAMP'.\n * @param {{\n * startingSequenceNumber?: string;\n * timestamp?: number;\n * }} [parameters={}] - An optional object containing configuration options for the shard iterator.\n * @param {string} [parameters.startingSequenceNumber] - The sequence number to start with when using 'AT_SEQUENCE_NUMBER' or 'AFTER_SEQUENCE_NUMBER' iterator types.\n * @param {number} [parameters.timestamp] - The timestamp to start with when using the 'AT_TIMESTAMP' iterator type.\n *\n * @throws {Error} Throws an error if the get shard iterator request fails.\n * @returns {string} The next position in the shard from which to start sequentially reading data records. If set to null, the shard has been closed and the requested iterator does not return any more data.\n */\n getShardIterator(\n streamName: string,\n shardId: string,\n shardIteratorType: ShardIteratorKind,\n parameters: { startingSequenceNumber?: string; timestamp?: number } = {}\n ): GetShardIteratorResponse {\n const body: any = {\n StreamName: streamName,\n ShardId: shardId,\n ShardIteratorType: shardIteratorType,\n ...(parameters.startingSequenceNumber && {\n StartingSequenceNumber: parameters.startingSequenceNumber,\n }),\n ...(parameters.timestamp && { Timestamp: parameters.timestamp }),\n }\n\n const res = this._send_request('GetShardIterator', body)\n return GetShardIteratorResponse.fromJson(res?.json())\n }\n\n private _send_request(action: string, body: any): any {\n const signedRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceVersion}.${action}`,\n },\n body: JSON.stringify(body),\n },\n {}\n )\n\n const res = http.request('POST', signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(action, res)\n return res\n }\n\n /**\n * If the response is an error, throw an error\n *\n * @param {string} operation - The name of the operation that was called.\n * @param response - RefinedResponse\n * @returns The response is being returned.\n */\n _handle_error(operation: string, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KinesisServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KinesisServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/* `KinesisServiceError` is a subclass of `AWSError` that adds an `operation` property */\nexport class KinesisServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a KinesisServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'KinesisServiceError'\n this.operation = operation\n }\n}\n\n/**\n * Describes the options for a Kinesis stream.\n */\ntype StreamMode = 'PROVISIONED' | 'ON_DEMAND'\n\n/**\n * Determines how the shard iterator is used to start reading data records from the shard.\n */\nexport type ShardIteratorKind =\n | 'AT_SEQUENCE_NUMBER'\n | 'AFTER_SEQUENCE_NUMBER'\n | 'TRIM_HORIZON'\n | 'LATEST'\n | 'AT_TIMESTAMP'\n\n/**\n * Describes the status of a Kinesis data stream.\n */\nexport type StreamStatus = 'CREATING' | 'DELETING' | 'ACTIVE' | 'UPDATING'\n\nexport type StreamModeDetails = {\n /**\n * Specifies the capacity mode to which you want to set your data stream.\n */\n SteamMode: 'PROVISIONED' | 'ON_DEMAND'\n}\n\nexport class ListStreamsResponse {\n /**\n * Indicates whether there are more streams available to list.\n */\n HasMoreStreams: boolean\n\n /**\n * The token that identifies which batch of results you can retrieve.\n */\n NextToken?: string\n\n /**\n * The names of the streams that are associated with the AWS account making the ListStreams request.\n */\n StreamNames: string[]\n\n /**\n * A list of StreamSummary objects.\n */\n StreamSummaries: StreamSummary[]\n\n constructor(\n HasMoreStreams: boolean,\n NextToken: string,\n StreamNames: string[],\n StreamSummaries: StreamSummary[]\n ) {\n this.HasMoreStreams = HasMoreStreams\n this.NextToken = NextToken\n this.StreamNames = StreamNames\n this.StreamSummaries = StreamSummaries\n }\n\n static fromJson(result: any): ListStreamsResponse {\n const {\n HasMoreStreams = false,\n NextToken = '',\n StreamNames = [],\n StreamSummaries = [],\n } = result\n\n return new ListStreamsResponse(\n HasMoreStreams,\n NextToken,\n StreamNames.map((s: any) => String(s)),\n StreamSummaries.map(StreamSummary.fromJson)\n )\n }\n}\n\n/**\n * Summarizes a Stream\n */\nexport class StreamSummary {\n /**\n * The Amazon Resource Name (ARN) for the stream.\n */\n StreamARN: string\n\n /**\n * The time at which the stream was created.\n */\n StreamCreationTimestamp: number\n\n /**\n * Specify the capacity mode to which you want to set your data stream.\n */\n StreamModeDetails: StreamModeDetails\n\n /**\n * The name of the stream.\n */\n StreamName: string\n\n /**\n * The current status of the stream being described.\n */\n StreamStatus: StreamStatus\n\n constructor(\n StreamARN: string,\n StreamCreationTimestamp: number,\n StreamMode: StreamModeDetails,\n StreamName: string,\n StreamStatus: StreamStatus\n ) {\n this.StreamARN = StreamARN\n this.StreamCreationTimestamp = StreamCreationTimestamp\n this.StreamModeDetails = StreamMode\n this.StreamName = StreamName\n this.StreamStatus = StreamStatus\n }\n\n static fromJson(summary: any): StreamSummary {\n const {\n StreamARN = '',\n StreamCreationTimestamp = 0,\n StreamModeDetails = {},\n StreamName = '',\n StreamStatus = '',\n } = summary\n\n return new StreamSummary(\n StreamARN,\n StreamCreationTimestamp,\n StreamModeDetails,\n StreamName,\n StreamStatus\n )\n }\n}\n\n/**\n * Represents the output for PutRecords.\n */\nexport interface PutRecordsRequestEntry {\n /**\n * The data blob to put into the record, which is base64-encoded when the blob is serialized.\n */\n Data: string | ArrayBuffer\n\n /**\n * Datemines which share in the stream the data record is assigned to.\n */\n PartitionKey: string\n}\n\n// Response class for PutRecords API\nexport class PutRecordsResponse {\n /**\n * The encryption type used on the records. This parameter can be one of the following values:\n * - NONE: Do not encrypt the records.\n * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key.\n */\n EncryptionType: 'NONE' | 'KMS'\n\n /**\n * The number of unsuccessfully processed records in a PutRecords request.\n */\n FailedRecordCount: number\n\n /**\n * An array of succesffully and unsuccessfully processed record results.\n */\n Records: PutRecordsResultEntry[]\n\n constructor(\n encryptionType: 'NONE' | 'KMS',\n failedRecordCount: number,\n records: PutRecordsResultEntry[]\n ) {\n this.EncryptionType = encryptionType\n this.FailedRecordCount = failedRecordCount\n this.Records = records\n }\n\n static fromJson(json: any): PutRecordsResponse {\n const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json\n const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record))\n\n return new PutRecordsResponse(EncryptionType, FailedRecordCount, records)\n }\n}\n\n/**\n * Represents the result of an individual record from a PutRecords request.\n */\nexport class PutRecordsResultEntry {\n /**\n * The sequence number for an individual record result.\n */\n SequenceNumber: string\n\n /**\n * The shard ID for an individual record result.\n */\n ShardId: string\n\n constructor(sequenceNumber: string, shardId: string) {\n this.SequenceNumber = sequenceNumber\n this.ShardId = shardId\n }\n\n static fromJson(json: any): PutRecordsResultEntry {\n return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId)\n }\n}\n\n/**\n * Represents the response format of the GetRecords operation.\n */\nexport class GetRecordsResponse {\n /**\n * The next position in the shard from which to start sequentially reading data records.\n */\n NextShardIterator: string\n\n /**\n * The data records retrieved from the shard.\n */\n Records: Record[]\n\n constructor(nextShardIterator: string, records: Record[]) {\n this.NextShardIterator = nextShardIterator\n this.Records = records\n }\n\n static fromJson(json: any): GetRecordsResponse {\n const { NextShardIterator = '', Records = [] } = json\n const records = Records.map((record: Record) => Record.fromJson(record))\n\n return new GetRecordsResponse(NextShardIterator, records)\n }\n}\n\n/**\n * The unit of data of the Kinesis data stream, which is composed of a sequence\n * number, a partition key, and a data blob.\n */\nclass Record {\n /**\n * The data blob.\n */\n Data: string | ArrayBuffer\n\n /**\n * Identifies which shard in the stream the data record is assigned to.\n */\n PartitionKey: string\n\n /**\n * The unique identifier of the record in the stream.\n */\n SequenceNumber: string\n\n constructor(data: string | ArrayBuffer, partitionKey: string, sequenceNumber: string) {\n this.Data = data\n this.PartitionKey = partitionKey\n this.SequenceNumber = sequenceNumber\n }\n\n static fromJson(json: any): Record {\n return new Record(json.Data, json.PartitionKey, json.SequenceNumber)\n }\n}\n\n// Response class for ListShards API\nexport class ListShardsResponse {\n /**\n * An array of JSON objects.\n *\n * Each object represents one shard and specifies the IDs of the shard, the\n * shard's parent, and the shard that's adjacent to the shard's parent.\n */\n Shards: Shard[]\n\n /**\n * When the number of shards in the data stream is greater than the\n * default value for the MaxResults parameter, or if you explicitly specify\n * a value for MaxResults that is less than the number of shards in the data\n * stream, the response includes a pagination token named NextToken.\n */\n NextToken?: string\n\n constructor(shards: Shard[], nextToken?: string) {\n this.Shards = shards\n this.NextToken = nextToken\n }\n\n static fromJson(json: any): ListShardsResponse {\n const { Shards = [], NextToken } = json\n const shards = Shards.map((shard: Shard) => Shard.fromJson(shard))\n\n return new ListShardsResponse(shards, NextToken)\n }\n}\n\n/**\n * A uniquely identified group of data records in a Kinesis data stream.\n */\nexport class Shard {\n /**\n * The unique identifier of the shard within the stream.\n */\n Id: string\n\n /**\n * The shard ID of the shard's parent.\n */\n ParentShardId?: string\n\n /**\n * The shard ID of the shard adjacent to the shard's parent.\n */\n AdjacentParentShardId?: string\n\n /**\n * The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.\n */\n HashKeyRange: HashKeyRange\n\n SequenceNumberRange: SequenceNumberRange\n\n constructor(\n id: string,\n hashKeyRange: HashKeyRange,\n sequenceNumberRange: SequenceNumberRange,\n parentShardId?: string,\n adjacentParentShardId?: string\n ) {\n this.Id = id\n this.ParentShardId = parentShardId\n this.AdjacentParentShardId = adjacentParentShardId\n this.HashKeyRange = hashKeyRange\n this.SequenceNumberRange = sequenceNumberRange\n }\n\n static fromJson(json: any): Shard {\n return new Shard(\n json.ShardId,\n json.HashKeyRange,\n json.SequenceNumberRange,\n json.ParentShardId,\n json.AdjacentParentShardId\n )\n }\n}\n\n/**\n * Describes the range of possible hash key values for the shard, which is\n * a set of ordered contiguous positive integers.\n */\nexport interface HashKeyRange {\n /**\n * The starting hash key of the hash key range.\n */\n StartingHashKey: string\n\n /**\n * The ending hash key of the hash key range.\n */\n EndingHashKey: string\n}\n\n/**\n * The range of possible sequence numbers for the shard.\n */\nexport interface SequenceNumberRange {\n /**\n * The ending sequence number for the range.\n *\n * Shards that are in the OPEN state have an ending sequence number of null.\n */\n EndingSequenceNumber?: string\n\n /**\n * The starting sequence number for the range.\n */\n StartingSequenceNumber: string\n}\n\n/**\n * Describes a shard iterator response.\n */\nclass GetShardIteratorResponse {\n /**\n * The position in the shard from which to start reading data records sequentially.\n */\n ShardIterator: string\n\n constructor(shardIterator: string) {\n this.ShardIterator = shardIterator\n }\n\n static fromJson(json: any): GetShardIteratorResponse {\n return new GetShardIteratorResponse(json.ShardIterator)\n }\n}\n"],"names":["AWSClient","awsConfig","serviceName","_classCallCheck","_defineProperty","this","key","get","undefined","_host","concat","region","endpoint","set","host","_scheme","scheme","AWSConfig","options","InvalidAWSConfigError","accessKeyId","length","secretAccessKey","sessionToken","_createClass","value","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","call","_wrapNativeSuper","Error","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","MAX_PRESIGNED_TTL","EMPTY_SHA256","UNSIGNED_PAYLOAD","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","hasHeader","soughtHeader","headers","_i","_Object$keys","Object","keys","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","hostname","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","isArrayBuffer","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","prototype","toFormUrlEncoded","form","params","API_VERSION","SQSClient","_AWSClient","commonHeaders","queueUrl","messageBody","Action","Version","QueueUrl","MessageBody","messageDeduplicationId","MessageDeduplicationId","messageGroupId","MessageGroupId","signedRequest","sign","res","http","_handleError","parsed","html","Message","parameters","maxResults","MaxResults","nextToken","NextToken","queueNamePrefix","QueueNamePrefix","urls","toArray","operation","response","errorCode","error_code","error","awsError","SQSServiceError","id","bodyMD5","_super2","_this2","v1","v4","uuid","module","exports","byteToHex","i","substr","buf","offset","bth","getRandomValues","bind","window","msCrypto","rnds8","Uint8Array","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","b","node","clockseq","seedBytes","msecs","getTime","nsecs","dt","tl","tmh","ii","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","KMSClient","_handle_error","KMSOperation","ListKeys","json","k","KMSKey","fromJSON","size","KMSKeySize","Size256","KeyId","NumberOfBytes","GenerateDataKey","KMSDataKey","errorMessage","__type","KMSServiceError","keyArn","keyId","KeyArn","CiphertextBlob","Plaintext","ciphertextBlob","plaintext","S3Client","buckets","children","each","_","bucketDefinition","bucket","forEach","child","nodeName","assign","textContent","creationDate","bucketName","prefix","objects","objectDefinition","lastModified","etag","parseInt","storageClass","objectKey","_res$headers$XAmzSt","S3Object","data","Host","uploads","S3MultipartUpload","uploadId","partNumber","S3Part","parts","part","eTag","status","S3ServiceError","S3Bucket","SecretsManagerClient","SecretsManagerOperation","ListSecrets","Secret","SecretId","GetSecretValue","secret","description","versionID","tags","uuidv4","Name","Description","SecretString","ClientRequestToken","Tags","CreateSecret","PutSecretValue","_ref$recoveryWindow","recoveryWindow","_ref$noRecovery","noRecovery","payload","DeleteSecret","SecretsManagerServiceError","arn","secretString","createdDate","lastAccessedDate","lastChangedDate","ARN","CreatedDate","LastAccessedDate","LastChangedDate","SystemsManagerClient","withDecryption","WithDecryption","SystemsManagerOperation","GetParameter","SystemsManagerParameter","SystemsManagerServiceError","dataType","lastModifiedDate","selector","sourceResult","type","version","parameter","Parameter","DataType","LastModifiedDate","Selector","SourceResult","Type","Value","KinesisClient","serviceVersion","streamName","StreamName","shardCount","ShardCount","streamModeDetails","StreamMode","streamMode","_send_request","streamARN","StreamARN","enforceConsumerDeletion","EnforceConsumerDeletion","exclusiveStartStreamName","ExclusiveStartStreamName","limit","Limit","ListStreamsResponse","fromJson","records","Records","PutRecordsResponse","shardIterator","ShardIterator","GetRecordsResponse","ListShardsResponse","shardId","shardIteratorType","ShardId","ShardIteratorType","startingSequenceNumber","StartingSequenceNumber","timestamp","Timestamp","GetShardIteratorResponse","action","KinesisServiceError","HasMoreStreams","StreamNames","StreamSummaries","result","_result$HasMoreStream","_result$NextToken","_result$StreamNames","_result$StreamSummari","String","StreamSummary","StreamCreationTimestamp","StreamStatus","StreamModeDetails","summary","_summary$StreamARN","_summary$StreamCreati","_summary$StreamModeDe","_summary$StreamName","_summary$StreamStatus","encryptionType","failedRecordCount","EncryptionType","FailedRecordCount","_json$EncryptionType","_json$FailedRecordCou","_json$Records","record","PutRecordsResultEntry","sequenceNumber","SequenceNumber","nextShardIterator","NextShardIterator","_json$NextShardIterat","_json$Records2","Record","partitionKey","Data","PartitionKey","shards","Shards","_json$Shards","shard","Shard","hashKeyRange","sequenceNumberRange","parentShardId","adjacentParentShardId","Id","ParentShardId","AdjacentParentShardId","HashKeyRange","SequenceNumberRange"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"aws.js","mappings":"04BAUO,IAAMA,EAAS,WAWlB,SAAAA,EAAYC,EAAsBC,I,4FAAqBC,CAAA,KAAAH,GAAAI,EAAA,yBAAAA,EAAA,2BAAAA,EAAA,qBAAAA,EAAA,uBACnDC,KAAKJ,UAAYA,EACjBI,KAAKH,YAAcA,CACvB,C,UAiCD,O,EA/BCF,G,EAAA,EAAAM,IAAA,OAAAC,IAIA,WAII,OAHkBC,MAAdH,KAAKI,QACPJ,KAAKI,MAAQ,GAAHC,OAAML,KAAKH,YAAW,KAAAQ,OAAIL,KAAKJ,UAAUU,OAAM,KAAAD,OAAIL,KAAKJ,UAAUW,WAEvEP,KAAKI,KAChB,EAACI,IAED,SAAgBC,GACZT,KAAKI,MAAQK,CACjB,GAEE,CAAAR,IAAA,SAAAC,IAKF,WAKE,OAHoBC,MAAhBH,KAAKU,UACPV,KAAKU,QAAUV,KAAKJ,UAAUe,QAEzBX,KAAKU,OACd,EAEAF,IACA,SAAkBG,GAChBX,KAAKU,QAAUC,CACnB,M,8EAAChB,CAAA,CA/CmB,E,mOCPf,IAAMiB,EAA4B,kBAC5BC,EAA6B,mBAC7BC,EAAuB,aACvBC,EAA0B,gBAC1BC,EAA4B,kBAC5BC,EAAiC,sBAEjCC,EAAwB,uBAKxBC,EAA4B,uBAC5BC,EAAkBN,EAAqBO,cACvCC,EAAuBN,EAA0BK,cACjDE,EATyB,eASkBF,cAC3CG,EAAmBN,EAAsBG,cAKzCI,EAAuB,gBAMvBC,EAAoB,CAACD,EAAsBL,EAL7B,QAMdO,EAAc,OAMdC,EAA4B,CACrCC,eAAe,EACf,iBAAiB,EACjBC,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webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/./src/internal/sqs.ts","webpack://k6-jslib-aws/./node_modules/uuid/index.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/bytesToUuid.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/rng-browser.js","webpack://k6-jslib-aws/./node_modules/uuid/v1.js","webpack://k6-jslib-aws/./node_modules/uuid/v4.js","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/./src/internal/kms.ts","webpack://k6-jslib-aws/./src/internal/s3.ts","webpack://k6-jslib-aws/./src/internal/secrets-manager.ts","webpack://k6-jslib-aws/./src/internal/ssm.ts","webpack://k6-jslib-aws/./src/internal/kinesis.ts"],"sourcesContent":["import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","import { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { SignatureV4, InvalidSignatureError } from './signature'\nimport { HTTPHeaders, SignedHTTPRequest } from './http'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\nimport { toFormUrlEncoded } from './utils'\nimport { AWSError } from './error'\n\nconst API_VERSION = '2012-11-05'\n\nexport class SQSClient extends AWSClient {\n private readonly signature: SignatureV4\n private readonly commonHeaders: HTTPHeaders\n\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'sqs')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken\n },\n uriEscapePath: true,\n applyChecksum: true\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }\n\n /**\n * Delivers a message to the specified queue.\n *\n * @param {string} queueUrl - The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.\n * @param {string} messageBody - The message to send. The minimum size is one character. The maximum size is 256 KB.\n * @param {Object} options - Options for the request\n * @param {string} [options.messageDeduplicationId] - The message deduplication id.\n * @param {string} [options.messageGroupId] - The message group ID for FIFO queues\n * @returns {Message} - The message that was sent.\n */\n sendMessage(queueUrl: string, messageBody: string, options: { messageDeduplicationId?: string; messageGroupId?: string} = {}): Message {\n const method = 'POST'\n\n let body: any = {\n Action: 'SendMessage',\n Version: API_VERSION,\n QueueUrl: queueUrl,\n MessageBody: messageBody,\n }\n\n if (typeof(options.messageDeduplicationId) !== 'undefined') {\n body = { ...body,\n MessageDeduplicationId: options.messageDeduplicationId\n }\n }\n\n if (typeof(options.messageGroupId) !== 'undefined') {\n body = { ...body,\n MessageGroupId: options.messageGroupId\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('SendMessage', res)\n\n const parsed = res.html('SendMessageResponse > SendMessageResult')\n return new Message(\n parsed.find('MessageId').text(),\n parsed.find('MD5OfMessageBody').text()\n )\n }\n\n /**\n * Returns a list of your queues in the current region.\n *\n * @param {ListQueuesRequestParameters} [parameters={}] request parameters\n * @param {number} [ListQueuesRequestParameters.maxResults] Maximum number of results to include in the response. Value range is 1 to 1000. You must set maxResults to receive a value for nextToken in the response.\n * @param {string} [ListQueuesRequestParameters.nextToken] Pagination token to request the next set of results.\n * @param {string} [ListQueuesRequestParameters.queueNamePrefix] A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * @returns {Object}\n * @returns {string[]} Object.queueUrls - A list of queue URLs, up to 1000 entries.\n * @returns {string} [Object.nextToken] - In the future, you can use NextToken to request the next set of results.\n */\n listQueues(parameters: ListQueuesRequestParameters = {}): ListQueuesResponse {\n const method = 'POST'\n\n let body: any = {\n Action: 'ListQueues',\n Version: API_VERSION,\n }\n\n if (typeof(parameters?.maxResults) !== 'undefined') {\n body = { ...body,\n MaxResults: parameters.maxResults\n }\n }\n\n if (typeof(parameters?.nextToken) !== 'undefined') {\n body = { ...body,\n NextToken: parameters.nextToken\n }\n }\n\n if (typeof(parameters?.queueNamePrefix) !== 'undefined') {\n body = { ...body,\n QueueNamePrefix: parameters.queueNamePrefix\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n 'Host': this.host\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('ListQueues', res)\n\n let parsed = res.html()\n return {\n urls: parsed.find('QueueUrl').toArray().map(e => e.text()),\n nextToken: parsed.find('NextToken').text() || undefined\n }\n }\n\n private _handleError(operation: SQSOperation, response: RefinedResponse) {\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n if (errorMessage == '' && errorCode === 0) {\n return\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new SQSServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/**\n * An Amazon SQS message.\n */\nexport class Message {\n /**\n * A unique identifier for the message.\n * A MessageIdis considered unique across all AWS accounts for an extended period of time.\n */\n id: string\n\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n bodyMD5: string\n\n /**\n * Instantiates a new Message object.\n *\n * @param id\n * @param md5Ofbody\n */\n constructor(id: string, bodyMD5: string) {\n this.id = id\n this.bodyMD5 = bodyMD5\n }\n}\n\n/**\n * SQSServiceError indicates an error occurred while interacting with the SQS API.\n */\nexport class SQSServiceError extends AWSError {\n operation: SQSOperation;\n\n constructor(message: string, code: string, operation: SQSOperation) {\n super(message, code)\n this.name = 'SQSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SQSOperation describes possible SQS operations.\n */\ntype SQSOperation = 'ListQueues' | 'SendMessage'\n\nexport interface SendMessageOptions {\n /*\n * The message deduplication ID for FIFO queues\n */\n messageDeduplicationId?: string\n\n /*\n * The message group ID for FIFO queues\n */\n messageGroupId?: string\n}\n\nexport interface ListQueuesRequestParameters {\n /**\n * Maximum number of results to include in the response. Value range is 1 to 1000.\n */\n maxResults?: number\n /**\n * Pagination token to request the next set of results.\n */\n nextToken?: string\n /**\n * A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * Queue URLs and names are case-sensitive.\n */\n queueNamePrefix?: string\n}\n\nexport interface ListQueuesResponse {\n /**\n * A list of queue URLs, up to 1,000 entries, or the value of MaxResults you sent in the request.\n */\n urls: string[]\n /**\n * Pagination token to include in the next request.\n */\n nextToken?: string\n}\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","module.exports = require(\"k6/crypto\");","module.exports = require(\"k6/html\");","module.exports = require(\"k6/http\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's KMS service\n */\nexport class KMSClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a KMSClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kms')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the KMS service\n // are made via the GET or POST method.\n this.method = 'POST'\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Gets a list of all the KMS keys in the caller's AWS\n * account and region.\n *\n * @returns an array of all the available keys\n */\n listKeys(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.ListKeys`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.ListKeys, res)\n\n const json: JSONArray = res.json('Keys') as JSONArray\n return json.map((k) => KMSKey.fromJSON(k as JSONObject))\n }\n\n /**\n * GenerateDataKey returns a unique symmetric data key for use outside of AWS KMS.\n *\n * This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.\n * The bytes in the plaintext key are random; they are not related to the caller or the KMS key.\n * You can use the plaintext key to encrypt your data outside of AWS KMS and store the encrypted data key with the encrypted data.\n *\n * To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key.\n * You cannot use an asymmetric KMS key to encrypt data keys.\n *\n * Used to generate data key with the KMS key defined\n * @param {string} id - Specifies the symmetric encryption KMS key that encrypts the data key. Use its key ID, key ARN, alias name, or alias ARN.\n * @param {KMKeySize} size - Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). Default is 32, and generates a 256-bit data key.\n * @throws {KMSServiceError}\n * @throws {InvalidSignatureError}\n * @returns {KMSDataKey} - The generated data key.\n */\n generateDataKey(id: string, size: KMSKeySize = KMSKeySize.Size256): KMSDataKey | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.GenerateDataKey`,\n },\n body: JSON.stringify({ KeyId: id, NumberOfBytes: size }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.GenerateDataKey, res)\n\n return KMSDataKey.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(operation: KMSOperation, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KMSServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KMSServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a KMS key\n */\nexport class KMSKey {\n /**\n * ARN of the key\n */\n keyArn: string\n\n /**\n * Unique identifier of the key\n */\n keyId: string\n\n constructor(keyArn: string, KeyId: string) {\n this.keyArn = keyArn\n this.keyId = KeyId\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSKey(json.KeyArn as string, json.KeyId as string)\n }\n}\n\n/**\n * Class representing a data key\n */\nexport class KMSDataKey {\n /**\n * The Amazon Resource Name (key ARN) of the KMS key that encrypted the data key.\n */\n id: string\n\n /**\n * The (base64-encoded) encrypted copy of the data key.\n */\n ciphertextBlob: string\n\n /**\n * The plaintext data key.\n * Use this data key to encrypt your data outside of KMS. Then, remove it from memory as soon as possible.\n */\n plaintext: string\n\n constructor(CiphertextBlob: string, KeyId: string, Plaintext: string) {\n this.ciphertextBlob = CiphertextBlob\n this.id = KeyId\n this.plaintext = Plaintext\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSDataKey(\n json.CiphertextBlob as string,\n json.KeyId as string,\n json.Plaintext as string\n )\n }\n}\n\nexport class KMSServiceError extends AWSError {\n operation: KMSOperation\n\n /**\n * Constructs a KMSServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: KMSOperation) {\n super(message, code)\n this.name = 'KMSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * KMSOperation defines all currently implemented KMS Service operations.\n */\nenum KMSOperation {\n GenerateDataKey = 'GenerateDataKey',\n ListKeys = 'ListKeys',\n}\n\n/**\n * KMSKeyLength describes possible key lenght values for KMS API data key operations.\n */\nenum KMSKeySize {\n Size256 = 32,\n Size512 = 64,\n}\n","import { bytes } from 'k6'\nimport { parseHTML } from 'k6/html'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AWSError } from './error'\nimport { SignedHTTPRequest } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n\n/** Class allowing to interact with Amazon AWS's S3 service */\nexport class S3Client extends AWSClient {\n signature: SignatureV4\n\n /**\n * Create a S3Client\n *\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 's3')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n }\n\n /**\n * Returns a list of all buckets owned by the authenticated sender of the request.\n * To use this operation, you must have the s3:ListAllMyBuckets permission.\n *\n * @return {Array.} buckets - An array of objects describing S3 buckets\n * with the following fields: name, and creationDate.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listBuckets(): Array {\n const method = 'GET'\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListBuckets', res)\n\n let buckets: Array = []\n\n const doc = parseHTML(res.body as string)\n\n doc.find('Buckets')\n .children()\n .each((_, bucketDefinition) => {\n let bucket = {}\n\n bucketDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'name':\n Object.assign(bucket, { name: child.textContent() })\n break\n case 'creationdate':\n Object.assign(bucket, {\n creationDate: Date.parse(child.textContent()),\n })\n }\n })\n\n buckets.push(bucket as S3Bucket)\n })\n\n return buckets\n }\n\n /**\n * Returns some or all (up to 1,000) of the objects in a bucket.\n *\n * @param {string} bucketName - Bucket name to list.\n * @param {string?} prefix='' - Limits the response to keys that begin with the specified prefix.\n * @return {Array.} - returns an array of objects describing S3 objects\n * with the following fields: key, lastModified, etag, size and storageClass.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listObjects(bucketName: string, prefix?: string): Array {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/`,\n query: {\n 'list-type': '2',\n prefix: prefix || '',\n },\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListObjectsV2', res)\n\n let objects: Array = []\n\n // Extract the objects definition from\n // the XML response\n parseHTML(res.body as string)\n .find('Contents')\n .each((_, objectDefinition) => {\n let obj = {}\n\n objectDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'key':\n Object.assign(obj, { key: child.textContent() })\n break\n case 'lastmodified':\n Object.assign(obj, { lastModified: Date.parse(child.textContent()) })\n break\n case 'etag':\n Object.assign(obj, { etag: child.textContent() })\n break\n case 'size':\n Object.assign(obj, { size: parseInt(child.textContent()) })\n break\n case 'storageclass':\n Object.assign(obj, { storageClass: child.textContent() })\n }\n })\n\n objects.push(obj as S3Object)\n })\n\n return objects\n }\n /**\n * Retrieves an Object from Amazon S3.\n *\n * To use getObject, you must have `READ` access to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to get.\n * @return {S3Object} - returns the content of the fetched S3 Object.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n getObject(bucketName: string, objectKey: string): S3Object {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('GetObject', res)\n\n return new S3Object(\n objectKey,\n Date.parse(res.headers['Last-Modified']),\n res.headers['ETag'],\n parseInt(res.headers['Content-Length']),\n\n // The X-Amz-Storage-Class header is only set if the storage class is\n // not the default 'STANDARD' one.\n (res.headers['X-Amz-Storage-Class'] ?? 'STANDARD') as StorageClass,\n\n res.body\n )\n }\n /**\n * Adds an object to a bucket.\n *\n * You must have WRITE permissions on a bucket to add an object to it.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to put.\n * @param {string | ArrayBuffer} data - the content of the S3 Object to upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {\n // Prepare request\n const method = 'PUT'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {\n Host: host,\n },\n body: data,\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error('PutObject', res)\n }\n\n /**\n * Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteObject(bucketName: string, objectKey: string): void {\n // Prepare request\n const method = 'DELETE'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('DeleteObject', res)\n }\n\n /**\n * Creates a new multipart upload for a given objectKey.\n * The uploadId returned can be used to upload parts to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @return {S3MultipartUpload} - returns the uploadId of the newly created multipart upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n createMultipartUpload(bucketName: string, objectKey: string): S3MultipartUpload {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: { uploads: '' },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('CreateMultipartUpload', res)\n\n return new S3MultipartUpload(\n objectKey,\n parseHTML(res.body as string)\n .find('UploadId')\n .text()\n )\n }\n\n /**\n * Uploads a part in a multipart upload.\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @param {string} uploadId - The uploadId of the multipart upload.\n * @param {number} partNumber - The part number of the part to upload.\n * @param {string | ArrayBuffer} data - The content of the part to upload.\n * @return {S3Part} - returns the ETag of the uploaded part.\n * @throws {S3ServiceError}\n */\n uploadPart(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n partNumber: number,\n data: string | ArrayBuffer\n ): S3Part {\n // Prepare request\n const method = 'PUT'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: data,\n query: {\n partNumber: `${partNumber}`,\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('UploadPart', res)\n\n return new S3Part(partNumber, res.headers['Etag'])\n }\n\n /**\n * Completes a multipart upload by assembling previously uploaded parts.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to complete.\n * @param {S3Part[]} parts - The parts to assemble.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n completeMultipartUpload(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n parts: S3Part[]\n ) {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n const body = `${parts\n .map(\n (part) =>\n `${part.partNumber}${part.eTag}`\n )\n .join('')}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: body,\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n\n this._handle_error('CompleteMultipartUpload', res)\n }\n\n /**\n * Aborts a multipart upload.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to abort.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string) {\n // Prepare request\n const method = 'DELETE'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('AbortMultipartUpload', res)\n }\n\n _handle_error(operation: S3Operation, response: RefinedResponse) {\n const status: number = response.status\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n // We consider codes 200-299 as success\n if (status >= 200 && status < 300 && errorMessage == '' && errorCode === 0) {\n return\n }\n\n // A 301 response is returned when the bucket is not found.\n // Generally meaning that either the bucket name is wrong or the\n // region is wrong.\n //\n // See: https://github.com/grafana/k6/issues/2474\n // See: https://github.com/golang/go/issues/49281\n if (status == 301 || (errorMessage && errorMessage.startsWith('301'))) {\n throw new S3ServiceError('Resource not found', 'ResourceNotFound', operation)\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new S3ServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/** Class representing a S3 Bucket */\nexport class S3Bucket {\n name: string\n creationDate: Date\n\n /**\n * Create an S3 Bucket\n *\n * @param {string} name - S3 bucket's name\n * @param {Date} creationDate - S3 bucket's creation date\n */\n constructor(name: string, creationDate: Date) {\n this.name = name\n this.creationDate = creationDate\n }\n}\n\n/** Class representing an S3 Object */\nexport class S3Object {\n key: string\n lastModified: number\n etag: string\n size: number\n storageClass: StorageClass\n data?: string | bytes | null\n\n /**\n * Create an S3 Object\n *\n * @param {string} key - S3 object's key\n * @param {Date} lastModified - S3 object last modification date\n * @param {string} etag - S3 object's etag\n * @param {number} size - S3 object's size\n * @param {StorageClass} storageClass - S3 object's storage class\n * @param {string | bytes | null} data=null - S3 Object's data\n */\n constructor(\n key: string,\n lastModified: number,\n etag: string,\n size: number,\n storageClass: StorageClass,\n data?: string | bytes | null\n ) {\n this.key = key\n this.lastModified = lastModified\n this.etag = etag\n this.size = size\n this.storageClass = storageClass\n this.data = data\n }\n}\n\n/** Class representing a S3 Multipart Upload */\nexport class S3MultipartUpload {\n key: string\n uploadId: string\n\n /**\n * Create an S3 Multipart Upload\n * @param {string} key - S3 object's key\n * @param {string} uploadId - S3 multipart upload id\n */\n\n constructor(key: string, uploadId: string) {\n this.key = key\n this.uploadId = uploadId\n }\n}\n\n/** Class representing a S3 Part */\nexport class S3Part {\n partNumber: number\n eTag: string\n\n /**\n * Create an S3 Part\n * @param {number} partNumber - Part number\n * @param {string} eTag - Part's etag\n */\n\n constructor(partNumber: number, eTag: string) {\n this.partNumber = partNumber\n this.eTag = eTag\n }\n}\n\n/**\n * Error indicating a S3 operation failed\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class S3ServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a S3ServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'S3ServiceError'\n this.operation = operation\n }\n}\n\n/**\n * S3Operation describes possible values for S3 API operations,\n * as defined by AWS APIs.\n */\ntype S3Operation =\n | 'ListBuckets'\n | 'ListObjectsV2'\n | 'GetObject'\n | 'PutObject'\n | 'DeleteObject'\n | 'CreateMultipartUpload'\n | 'CompleteMultipartUpload'\n | 'UploadPart'\n | 'AbortMultipartUpload'\n\n/**\n * Describes the class of storage used to store a S3 object.\n */\ntype StorageClass =\n | 'STANDARD'\n | 'REDUCED_REDUNDANCY'\n | 'GLACIER'\n | 'STANDARD_IA'\n | 'INTELLIGENT_TIERING'\n | 'DEEP_ARCHIVE'\n | 'OUTPOSTS'\n | 'GLACIER_IR'\n | undefined\n","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's SecretsManager service\n */\nexport class SecretsManagerClient extends AWSClient {\n /**\n * HTTP Method to use when interacting with the Secrets Manager service.\n */\n method: HTTPMethod\n\n /**\n * HTTP headers to use accross all requests to the Secrets Manager service.\n */\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a SecretsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'secretsmanager')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the Secrets Manager service\n // are made via the GET or POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Returns a list of all secrets owned by the authenticated sender of the request.\n * To use this operation, you must have the secretsmanager:ListSecrets permission.\n *\n * @return {Array.} secrets - An array of objects describing Secret Manager's secrets\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n listSecrets(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.ListSecrets`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.ListSecrets, res)\n const json: JSONArray = res.json('SecretList') as JSONArray\n\n return json.map((s) => Secret.fromJSON(s as JSONObject))\n }\n\n /**\n * Retrieves a secret from Amazon Sercets Manager\n *\n * @param {string} id - The ARN or name of the secret to retrieve.\n * @returns {Secret} - returns the content of the fetched Secret object.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getSecret(id: string): Secret | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.GetSecretValue`,\n },\n body: JSON.stringify({ SecretId: id }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(SecretsManagerOperation.GetSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Creates a new secret\n *\n * Note that this method only supports string-based values at the moment.\n *\n * @param {string} name - The name of the new secret.\n * The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {string} description - The description of the secret.\n * @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * algorithm.\n * @param {Array.} tags=[] - A list of tags to attach to the secret. Each tag is a key and\n * value pair of strings in a JSON text string. Note that tag key names are case sensitive.\n * @returns {Secret} - returns the created secret\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n createSecret(\n name: string,\n secret: string,\n description: string,\n versionID?: string,\n tags?: Array\n ): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.CreateSecret`,\n },\n body: JSON.stringify({\n Name: name,\n Description: description,\n SecretString: secret,\n ClientRequestToken: versionID,\n Tags: tags,\n }),\n },\n {}\n )\n\n // Ensure to include the desired 'Action' in the X-Amz-Target\n // header field, as documented by the AWS API docs.\n // headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.CreateSecret, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n /**\n * Update a secret's value.\n *\n * Note that this method only support string-based values at the moment.\n *\n * @param {string} id - The ARN or name of the secret to update.\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n putSecretValue(id: string, secret: string, versionID?: string): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.PutSecretValue`,\n },\n body: JSON.stringify({\n SecretId: id,\n SecretString: secret,\n ClientRequestToken: versionID,\n }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.PutSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Deletes a secret and all of its versions.\n *\n * You can specify a recovery window during which you can restore the secret.\n * The minimum recovery window is 7 days. The default recovery window is 30 days.\n *\n * @param {string} secretID - The ARN or name of the secret to delete.\n * @param {number} recoveryWindow - The number of days from 7 to 30 that Secrets Manager\n * waits before permanently deleting the secret.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteSecret(\n id: string,\n { recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }\n ) {\n const payload: { [key: string]: string | boolean | number } = {\n SecretId: id,\n }\n\n // noRecovery and recoveryWindow are exclusive parameters\n if (noRecovery === true) {\n payload['ForceDeleteWithoutRecovery'] = true\n } else {\n payload['RecoveryWindowInDays'] = recoveryWindow\n }\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.DeleteSecret`,\n },\n body: JSON.stringify(payload),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.DeleteSecret, res)\n }\n\n _handle_error(\n operation: SecretsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SecretsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SecretsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n// TODO: create a Tags type\n\n/**\n * Class representing a Secret Manager's secret\n */\nexport class Secret {\n name: string\n arn: string\n secret: string\n createdDate: number\n lastAccessedDate: number\n lastChangedDate: number\n tags: Array<{ [key: string]: string }>\n\n /**\n * Constructs a Secret Manager's Secret\n *\n * @param {string} name - The friendly name of the secret.\n * @param {string} arn - The ARN of the secret.\n * @param {number} createdDate - The date and time that this version of the secret was created.\n * @param {number} lastAccessedDate - The last date that this secret was accessed. This value is\n * truncated to midnight of the date and therefore shows only the date, not the time.\n * @param {number} lastChangedDate - The last date and time that this secret was modified in any way.\n * @param {Array.} tags - The list of user-defined tags associated with the secret.\n */\n constructor(\n name: string,\n arn: string,\n secretString: string,\n createdDate: number,\n lastAccessedDate: number,\n lastChangedDate: number,\n tags: Array<{ [key: string]: string }> = []\n ) {\n this.name = name\n this.arn = arn\n this.secret = secretString\n this.createdDate = createdDate\n this.lastAccessedDate = lastAccessedDate\n this.lastChangedDate = lastChangedDate\n this.tags = tags\n }\n\n /**\n * Parses and constructs a Secret Manager's Secret from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {Secret}\n */\n static fromJSON(json: JSONObject) {\n return new Secret(\n json.Name as string,\n json.ARN as string,\n json.SecretString as string,\n json.CreatedDate as number,\n json.LastAccessedDate as number,\n json.LastChangedDate as number,\n json.Tags as Array<{ [key: string]: string }>\n )\n }\n}\n\nexport class SecretsManagerServiceError extends AWSError {\n operation: SecretsManagerOperation\n\n /**\n * Constructs a SecretsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SecretsManagerOperation) {\n super(message, code)\n this.name = 'SecretsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SecretsManagerOperation defines all currently implemented Secrets Manager Service operations.\n */\nenum SecretsManagerOperation {\n ListSecrets = 'ListSecrets',\n GetSecretValue = 'GetSecretValue',\n CreateSecret = 'CreateSecret',\n PutSecretValue = 'PutSecretValue',\n DeleteSecret = 'DeleteSecret',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's Systems Manager service\n */\nexport class SystemsManagerClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n signature: SignatureV4\n\n /**\n * Create a SystemsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'ssm')\n\n // All interactions with the Systems Manager service\n // are made via the POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n }\n\n /**\n * Retrieves a parameter from Amazon Systems Manager\n *\n * @param {string} name - The ARN or name of the parameter to retrieve.\n * @param {boolean} withDecryption - whether returned secure string parameters should be decrypted.\n * @returns {SystemsManagerParameter} - returns the fetched Parameter object.\n * @throws {SystemsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getParameter(\n name: string,\n withDecryption: boolean = false\n ): SystemsManagerParameter | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `AmazonSSM.GetParameter`,\n },\n body: JSON.stringify({ Name: name, WithDecryption: withDecryption }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SystemsManagerOperation.GetParameter, res)\n\n return SystemsManagerParameter.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(\n operation: SystemsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SystemsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SystemsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a Systems Manager's Parameter\n */\nexport class SystemsManagerParameter {\n /**\n * The Amazon Resource Name (ARN) of the parameter.\n */\n arn: string\n\n /**\n * The data type of the parameter, such as text or aws:ec2:image.\n * The default is text.\n */\n dataType: string\n\n /**\n * Date the parameter was last changed or updated and the parameter version was created.\n */\n lastModifiedDate: number\n\n /**\n * The friendly name of the parameter.\n */\n name: string\n\n /**\n * Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n */\n selector: string\n\n /**\n * plies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n */\n sourceResult: string\n\n /**\n * The type of parameter. Valid values include the following: String, StringList, and SecureString.\n */\n type: string\n\n /**\n * The parameter value.\n */\n value: string\n\n /**\n * The parameter version.\n */\n version: number\n\n /**\n * Constructs a Systems Manager's Parameter\n *\n * @param {string} arn - The Amazon Resource Name (ARN) of the parameter.\n * @param {string} dataType - The data type of the parameter, such as text or aws:ec2:image. The default is text.\n * @param {number} lastModifiedDate - Date the parameter was last changed or updated and the parameter version was created.\n * @param {string} name - The friendly name of the parameter.\n * @param {string} selector - Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n * @param {string} sourceResult - Applies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n * @param {string} type - The type of parameter. Valid values include the following: String, StringList, and SecureString.\n * @param {string} value - The parameter value.\n * @param {number} version - The parameter version.\n */\n constructor(\n arn: string,\n dataType: string,\n lastModifiedDate: number,\n name: string,\n selector: string,\n sourceResult: string,\n type: string,\n value: string,\n version: number\n ) {\n this.arn = arn\n this.dataType = dataType\n this.lastModifiedDate = lastModifiedDate\n this.name = name\n this.selector = selector\n this.sourceResult = sourceResult\n this.type = type\n this.value = value\n this.version = version\n }\n\n /**\n * Parses and constructs a Systems Manager's Parameter from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {SystemsManagerParameter}\n */\n static fromJSON(json: JSONObject): SystemsManagerParameter {\n const parameter = json.Parameter as JSONObject\n\n return new SystemsManagerParameter(\n parameter.ARN as string,\n parameter.DataType as string,\n parameter.LastModifiedDate as number,\n parameter.Name as string,\n parameter.Selector as string,\n parameter.SourceResult as string,\n parameter.Type as string,\n parameter.Value as string,\n parameter.Version as number\n )\n }\n}\n\nexport class SystemsManagerServiceError extends AWSError {\n operation: SystemsManagerOperation\n\n /**\n * Constructs a SystemsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {SystemsManagerOperation} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SystemsManagerOperation) {\n super(message, code)\n this.name = 'SystemsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SystemsManagerOperation defines all currently implemented Systems Manager operations.\n */\nenum SystemsManagerOperation {\n GetParameter = 'GetParameter',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\n\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\nThis API is based on\nhttps://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html\n*/\n\n/**\n * Allows interacting with the Kinesis API.\n */\nexport class KinesisClient extends AWSClient {\n /**\n * The SignatureV4 object used to sign requests.\n */\n signature: SignatureV4\n\n /**\n * The common headers that are used for all requests.\n */\n commonHeaders: HTTPHeaders\n\n /**\n * The version of the Kinesis API that is used for all requests.\n */\n serviceVersion: string\n\n /**\n * A constructor function that creates a new instance of the Kinesis class.\n * @param {AWSConfig} awsConfig - AWSConfig - This is the configuration object that is passed to\n * the constructor.\n * @returns A Proxy object.\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kinesis')\n\n this.serviceVersion = 'Kinesis_20131202'\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Creates a new Kinesis stream with the specified name and options.\n *\n * @param {string} streamName - The name of the stream to create.\n * @param {{\n * shardCount?: number;\n * streamModeDetails?: {\n * streamMode: StreamMode;\n * };\n * }} [options={}] - An optional object containing configuration options for the stream.\n * @param {number} [options.shardCount] - The number of shards for the stream. If not provided, the default value will be used.\n * @param {{streamMode: StreamMode}} [options.streamModeDetails] - An optional object containing the stream mode details.\n * @param {StreamMode} [options.streamModeDetails.streamMode] - The mode of the stream. If not provided, the default mode will be used.\n *\n * @throws {Error} Throws an error if the stream creation request fails.\n * @returns {void}\n */\n createStream(\n streamName: string,\n options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(options.shardCount && { ShardCount: options.shardCount }),\n ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }),\n }\n\n this._send_request('CreateStream', body)\n }\n\n /**\n * Deletes a Kinesis stream with the specified parameters.\n *\n * @param {string} streamName - The name of the stream to delete.\n * @param {{\n * streamARN?: string;\n * enforceConsumerDeletion?: boolean;\n * }} [parameters={}] - An optional object containing configuration options for the stream deletion.\n * @param {string} [parameters.streamARN] - The Amazon Resource Name (ARN) of the stream. If not provided, the ARN will be derived from the stream name.\n * @param {boolean} [parameters.enforceConsumerDeletion] - Whether to enforce the deletion of all registered consumers before deleting the stream. Defaults to false.\n *\n * @throws {Error} Throws an error if the stream deletion request fails.\n * @returns {void}\n */\n deleteStream(\n streamName: string,\n parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n ...(parameters.enforceConsumerDeletion && {\n EnforceConsumerDeletion: parameters.enforceConsumerDeletion,\n }),\n }\n\n this._send_request('DeleteStream', body)\n }\n\n /**\n * Returns a list of Kinesis streams with the specified parameters.\n *\n * @param {{\n * exclusiveStartStreamName?: string;\n * limit?: number;\n * nextToken?: string;\n * }} [parameters={}] - An optional object containing configuration options for listing the streams.\n * @param {string} [parameters.exclusiveStartStreamName] - The name of the stream to start listing from. If not provided, the listing starts from the beginning.\n * @param {number} [parameters.limit] - The maximum number of streams to list. If not provided, the default value will be used.\n * @param {string} [parameters.nextToken] - A token to paginate the list of streams. If not provided, the first page will be returned.\n *\n * @throws {Error} Throws an error if the list streams request fails.\n * @returns {Partial} A partial of the ListStreamsResponse class.\n */\n listStreams(\n parameters: {\n exclusiveStartStreamName?: string\n limit?: number\n nextToken?: string\n } = {}\n ): ListStreamsResponse {\n const body: any = {\n ...(parameters.exclusiveStartStreamName && {\n ExclusiveStartStreamName: parameters.exclusiveStartStreamName,\n }),\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n }\n\n const res = this._send_request('ListStreams', body)\n return ListStreamsResponse.fromJson(res?.json())\n }\n\n /**\n * Sends multiple records to a Kinesis stream in a single request.\n *\n * @param {string} streamName - The name of the stream to put records into.\n * @param {PutRecordsRequestEntry[]} records - An array of records to put into the stream.\n *\n * @throws {Error} Throws an error if the put records request fails.\n * @returns {Partial} A partial of the PutRecordsResponse class.\n */\n putRecords(\n records: PutRecordsRequestEntry[],\n parameters: { streamName?: string; streamARN?: string } = {}\n ): PutRecordsResponse {\n if (!parameters.streamName && !parameters.streamARN) {\n throw new Error('Either streamName or streamARN must be provided')\n }\n\n const body: any = {\n Records: records,\n ...(parameters.streamName && { StreamName: parameters.streamName }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('PutRecords', body)\n return PutRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves records from a Kinesis stream.\n *\n * @param {string} shardIterator - The shard iterator to start retrieving records from.\n * @param {number} [limit] - The maximum number of records to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the get records request fails.\n * @returns {Partial} A partial of the GetRecordsResponse class.\n */\n getRecords(\n shardIterator: string,\n parameters: { limit?: number; streamARN?: string } = {}\n ): GetRecordsResponse {\n const body: any = {\n ShardIterator: shardIterator,\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('GetRecords', body)\n return GetRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Lists the shards in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream to list shards from.\n * @param {{\n * nextToken?: string;\n * maxResults?: number;\n * }} [parameters={}] - An optional object containing configuration options for listing shards.\n * @param {string} [parameters.nextToken] - A token to specify where to start paginating the shard list. If not provided, the first page will be returned.\n * @param {number} [parameters.maxResults] - The maximum number of shards to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the list shards request fails.\n * @returns {ListShardsResponse} A ListShardsResponse class instance.\n */\n listShards(\n streamName: string,\n parameters: { nextToken?: string; maxResults?: number } = {}\n ): ListShardsResponse {\n const body: any = {\n StreamName: streamName,\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n ...(parameters.maxResults && {\n MaxResults: parameters.maxResults,\n }),\n }\n\n const res = this._send_request('ListShards', body)\n return ListShardsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves a shard iterator for the specified shard in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream.\n * @param {string} shardId - The shard ID for which to get the iterator.\n * @param {string} shardIteratorType - The shard iterator type. One of 'AT_SEQUENCE_NUMBER', 'AFTER_SEQUENCE_NUMBER', 'TRIM_HORIZON', 'LATEST', or 'AT_TIMESTAMP'.\n * @param {{\n * startingSequenceNumber?: string;\n * timestamp?: number;\n * }} [parameters={}] - An optional object containing configuration options for the shard iterator.\n * @param {string} [parameters.startingSequenceNumber] - The sequence number to start with when using 'AT_SEQUENCE_NUMBER' or 'AFTER_SEQUENCE_NUMBER' iterator types.\n * @param {number} [parameters.timestamp] - The timestamp to start with when using the 'AT_TIMESTAMP' iterator type.\n *\n * @throws {Error} Throws an error if the get shard iterator request fails.\n * @returns {string} The next position in the shard from which to start sequentially reading data records. If set to null, the shard has been closed and the requested iterator does not return any more data.\n */\n getShardIterator(\n streamName: string,\n shardId: string,\n shardIteratorType: ShardIteratorKind,\n parameters: { startingSequenceNumber?: string; timestamp?: number } = {}\n ): GetShardIteratorResponse {\n const body: any = {\n StreamName: streamName,\n ShardId: shardId,\n ShardIteratorType: shardIteratorType,\n ...(parameters.startingSequenceNumber && {\n StartingSequenceNumber: parameters.startingSequenceNumber,\n }),\n ...(parameters.timestamp && { Timestamp: parameters.timestamp }),\n }\n\n const res = this._send_request('GetShardIterator', body)\n return GetShardIteratorResponse.fromJson(res?.json())\n }\n\n private _send_request(action: string, body: any): any {\n const signedRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceVersion}.${action}`,\n },\n body: JSON.stringify(body),\n },\n {}\n )\n\n const res = http.request('POST', signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(action, res)\n return res\n }\n\n /**\n * If the response is an error, throw an error\n *\n * @param {string} operation - The name of the operation that was called.\n * @param response - RefinedResponse\n * @returns The response is being returned.\n */\n _handle_error(operation: string, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KinesisServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KinesisServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/* `KinesisServiceError` is a subclass of `AWSError` that adds an `operation` property */\nexport class KinesisServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a KinesisServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'KinesisServiceError'\n this.operation = operation\n }\n}\n\n/**\n * Describes the options for a Kinesis stream.\n */\ntype StreamMode = 'PROVISIONED' | 'ON_DEMAND'\n\n/**\n * Determines how the shard iterator is used to start reading data records from the shard.\n */\nexport type ShardIteratorKind =\n | 'AT_SEQUENCE_NUMBER'\n | 'AFTER_SEQUENCE_NUMBER'\n | 'TRIM_HORIZON'\n | 'LATEST'\n | 'AT_TIMESTAMP'\n\n/**\n * Describes the status of a Kinesis data stream.\n */\nexport type StreamStatus = 'CREATING' | 'DELETING' | 'ACTIVE' | 'UPDATING'\n\nexport type StreamModeDetails = {\n /**\n * Specifies the capacity mode to which you want to set your data stream.\n */\n SteamMode: 'PROVISIONED' | 'ON_DEMAND'\n}\n\nexport class ListStreamsResponse {\n /**\n * Indicates whether there are more streams available to list.\n */\n HasMoreStreams: boolean\n\n /**\n * The token that identifies which batch of results you can retrieve.\n */\n NextToken?: string\n\n /**\n * The names of the streams that are associated with the AWS account making the ListStreams request.\n */\n StreamNames: string[]\n\n /**\n * A list of StreamSummary objects.\n */\n StreamSummaries: StreamSummary[]\n\n constructor(\n HasMoreStreams: boolean,\n NextToken: string,\n StreamNames: string[],\n StreamSummaries: StreamSummary[]\n ) {\n this.HasMoreStreams = HasMoreStreams\n this.NextToken = NextToken\n this.StreamNames = StreamNames\n this.StreamSummaries = StreamSummaries\n }\n\n static fromJson(result: any): ListStreamsResponse {\n const {\n HasMoreStreams = false,\n NextToken = '',\n StreamNames = [],\n StreamSummaries = [],\n } = result\n\n return new ListStreamsResponse(\n HasMoreStreams,\n NextToken,\n StreamNames.map((s: any) => String(s)),\n StreamSummaries.map(StreamSummary.fromJson)\n )\n }\n}\n\n/**\n * Summarizes a Stream\n */\nexport class StreamSummary {\n /**\n * The Amazon Resource Name (ARN) for the stream.\n */\n StreamARN: string\n\n /**\n * The time at which the stream was created.\n */\n StreamCreationTimestamp: number\n\n /**\n * Specify the capacity mode to which you want to set your data stream.\n */\n StreamModeDetails: StreamModeDetails\n\n /**\n * The name of the stream.\n */\n StreamName: string\n\n /**\n * The current status of the stream being described.\n */\n StreamStatus: StreamStatus\n\n constructor(\n StreamARN: string,\n StreamCreationTimestamp: number,\n StreamMode: StreamModeDetails,\n StreamName: string,\n StreamStatus: StreamStatus\n ) {\n this.StreamARN = StreamARN\n this.StreamCreationTimestamp = StreamCreationTimestamp\n this.StreamModeDetails = StreamMode\n this.StreamName = StreamName\n this.StreamStatus = StreamStatus\n }\n\n static fromJson(summary: any): StreamSummary {\n const {\n StreamARN = '',\n StreamCreationTimestamp = 0,\n StreamModeDetails = {},\n StreamName = '',\n StreamStatus = '',\n } = summary\n\n return new StreamSummary(\n StreamARN,\n StreamCreationTimestamp,\n StreamModeDetails,\n StreamName,\n StreamStatus\n )\n }\n}\n\n/**\n * Represents the output for PutRecords.\n */\nexport interface PutRecordsRequestEntry {\n /**\n * The data blob to put into the record, which is base64-encoded when the blob is serialized.\n */\n Data: string | ArrayBuffer\n\n /**\n * Datemines which share in the stream the data record is assigned to.\n */\n PartitionKey: string\n}\n\n// Response class for PutRecords API\nexport class PutRecordsResponse {\n /**\n * The encryption type used on the records. This parameter can be one of the following values:\n * - NONE: Do not encrypt the records.\n * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key.\n */\n EncryptionType: 'NONE' | 'KMS'\n\n /**\n * The number of unsuccessfully processed records in a PutRecords request.\n */\n FailedRecordCount: number\n\n /**\n * An array of succesffully and unsuccessfully processed record results.\n */\n Records: PutRecordsResultEntry[]\n\n constructor(\n encryptionType: 'NONE' | 'KMS',\n failedRecordCount: number,\n records: PutRecordsResultEntry[]\n ) {\n this.EncryptionType = encryptionType\n this.FailedRecordCount = failedRecordCount\n this.Records = records\n }\n\n static fromJson(json: any): PutRecordsResponse {\n const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json\n const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record))\n\n return new PutRecordsResponse(EncryptionType, FailedRecordCount, records)\n }\n}\n\n/**\n * Represents the result of an individual record from a PutRecords request.\n */\nexport class PutRecordsResultEntry {\n /**\n * The sequence number for an individual record result.\n */\n SequenceNumber: string\n\n /**\n * The shard ID for an individual record result.\n */\n ShardId: string\n\n constructor(sequenceNumber: string, shardId: string) {\n this.SequenceNumber = sequenceNumber\n this.ShardId = shardId\n }\n\n static fromJson(json: any): PutRecordsResultEntry {\n return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId)\n }\n}\n\n/**\n * Represents the response format of the GetRecords operation.\n */\nexport class GetRecordsResponse {\n /**\n * The next position in the shard from which to start sequentially reading data records.\n */\n NextShardIterator: string\n\n /**\n * The data records retrieved from the shard.\n */\n Records: Record[]\n\n constructor(nextShardIterator: string, records: Record[]) {\n this.NextShardIterator = nextShardIterator\n this.Records = records\n }\n\n static fromJson(json: any): GetRecordsResponse {\n const { NextShardIterator = '', Records = [] } = json\n const records = Records.map((record: Record) => Record.fromJson(record))\n\n return new GetRecordsResponse(NextShardIterator, records)\n }\n}\n\n/**\n * The unit of data of the Kinesis data stream, which is composed of a sequence\n * number, a partition key, and a data blob.\n */\nclass Record {\n /**\n * The data blob.\n */\n Data: string | ArrayBuffer\n\n /**\n * Identifies which shard in the stream the data record is assigned to.\n */\n PartitionKey: string\n\n /**\n * The unique identifier of the record in the stream.\n */\n SequenceNumber: string\n\n constructor(data: string | ArrayBuffer, partitionKey: string, sequenceNumber: string) {\n this.Data = data\n this.PartitionKey = partitionKey\n this.SequenceNumber = sequenceNumber\n }\n\n static fromJson(json: any): Record {\n return new Record(json.Data, json.PartitionKey, json.SequenceNumber)\n }\n}\n\n// Response class for ListShards API\nexport class ListShardsResponse {\n /**\n * An array of JSON objects.\n *\n * Each object represents one shard and specifies the IDs of the shard, the\n * shard's parent, and the shard that's adjacent to the shard's parent.\n */\n Shards: Shard[]\n\n /**\n * When the number of shards in the data stream is greater than the\n * default value for the MaxResults parameter, or if you explicitly specify\n * a value for MaxResults that is less than the number of shards in the data\n * stream, the response includes a pagination token named NextToken.\n */\n NextToken?: string\n\n constructor(shards: Shard[], nextToken?: string) {\n this.Shards = shards\n this.NextToken = nextToken\n }\n\n static fromJson(json: any): ListShardsResponse {\n const { Shards = [], NextToken } = json\n const shards = Shards.map((shard: Shard) => Shard.fromJson(shard))\n\n return new ListShardsResponse(shards, NextToken)\n }\n}\n\n/**\n * A uniquely identified group of data records in a Kinesis data stream.\n */\nexport class Shard {\n /**\n * The unique identifier of the shard within the stream.\n */\n Id: string\n\n /**\n * The shard ID of the shard's parent.\n */\n ParentShardId?: string\n\n /**\n * The shard ID of the shard adjacent to the shard's parent.\n */\n AdjacentParentShardId?: string\n\n /**\n * The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.\n */\n HashKeyRange: HashKeyRange\n\n SequenceNumberRange: SequenceNumberRange\n\n constructor(\n id: string,\n hashKeyRange: HashKeyRange,\n sequenceNumberRange: SequenceNumberRange,\n parentShardId?: string,\n adjacentParentShardId?: string\n ) {\n this.Id = id\n this.ParentShardId = parentShardId\n this.AdjacentParentShardId = adjacentParentShardId\n this.HashKeyRange = hashKeyRange\n this.SequenceNumberRange = sequenceNumberRange\n }\n\n static fromJson(json: any): Shard {\n return new Shard(\n json.ShardId,\n json.HashKeyRange,\n json.SequenceNumberRange,\n json.ParentShardId,\n json.AdjacentParentShardId\n )\n }\n}\n\n/**\n * Describes the range of possible hash key values for the shard, which is\n * a set of ordered contiguous positive integers.\n */\nexport interface HashKeyRange {\n /**\n * The starting hash key of the hash key range.\n */\n StartingHashKey: string\n\n /**\n * The ending hash key of the hash key range.\n */\n EndingHashKey: string\n}\n\n/**\n * The range of possible sequence numbers for the shard.\n */\nexport interface SequenceNumberRange {\n /**\n * The ending sequence number for the range.\n *\n * Shards that are in the OPEN state have an ending sequence number of null.\n */\n EndingSequenceNumber?: string\n\n /**\n * The starting sequence number for the range.\n */\n StartingSequenceNumber: string\n}\n\n/**\n * Describes a shard iterator response.\n */\nclass GetShardIteratorResponse {\n /**\n * The position in the shard from which to start reading data records sequentially.\n */\n ShardIterator: string\n\n constructor(shardIterator: string) {\n this.ShardIterator = shardIterator\n }\n\n static fromJson(json: any): GetShardIteratorResponse {\n return new GetShardIteratorResponse(json.ShardIterator)\n }\n}\n"],"names":["AWSClient","awsConfig","serviceName","_classCallCheck","_defineProperty","this","key","get","undefined","_host","concat","region","endpoint","set","host","_scheme","scheme","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","MAX_PRESIGNED_TTL","EMPTY_SHA256","UNSIGNED_PAYLOAD","AWSError","_Error","_inherits","_super","_createSuper","message","code","_this","call","_assertThisInitialized","name","value","xmlDocument","doc","parseHTML","find","text","_wrapNativeSuper","Error","hasHeader","soughtHeader","headers","_i","_Object$keys","Object","keys","length","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","_createClass","request","options","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","hostname","headerName","indexOf","sessionToken","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","accessKeyId","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","secretAccessKey","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","isArrayBuffer","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","prototype","toFormUrlEncoded","form","params","API_VERSION","SQSClient","_AWSClient","commonHeaders","queueUrl","messageBody","Action","Version","QueueUrl","MessageBody","messageDeduplicationId","MessageDeduplicationId","messageGroupId","MessageGroupId","signedRequest","sign","res","http","_handleError","parsed","html","Message","parameters","maxResults","MaxResults","nextToken","NextToken","queueNamePrefix","QueueNamePrefix","urls","toArray","operation","response","errorCode","error_code","error","awsError","parseXML","SQSServiceError","id","bodyMD5","_super2","_this2","v1","v4","uuid","module","exports","byteToHex","i","substr","buf","offset","bth","getRandomValues","bind","window","msCrypto","rnds8","Uint8Array","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","b","node","clockseq","seedBytes","msecs","getTime","nsecs","dt","tl","tmh","ii","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","AWSConfig","InvalidAWSConfigError","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","KMSClient","_handle_error","KMSOperation","ListKeys","json","k","KMSKey","fromJSON","size","KMSKeySize","Size256","KeyId","NumberOfBytes","GenerateDataKey","KMSDataKey","errorMessage","__type","KMSServiceError","keyArn","keyId","KeyArn","CiphertextBlob","Plaintext","ciphertextBlob","plaintext","S3Client","buckets","children","each","_","bucketDefinition","bucket","forEach","child","nodeName","assign","textContent","creationDate","bucketName","prefix","objects","objectDefinition","lastModified","etag","parseInt","storageClass","objectKey","_res$headers$XAmzSt","S3Object","data","Host","uploads","S3MultipartUpload","uploadId","partNumber","S3Part","parts","part","eTag","status","S3ServiceError","S3Bucket","SecretsManagerClient","SecretsManagerOperation","ListSecrets","Secret","SecretId","GetSecretValue","secret","description","versionID","tags","uuidv4","Name","Description","SecretString","ClientRequestToken","Tags","CreateSecret","PutSecretValue","_ref$recoveryWindow","recoveryWindow","_ref$noRecovery","noRecovery","payload","DeleteSecret","SecretsManagerServiceError","arn","secretString","createdDate","lastAccessedDate","lastChangedDate","ARN","CreatedDate","LastAccessedDate","LastChangedDate","SystemsManagerClient","withDecryption","WithDecryption","SystemsManagerOperation","GetParameter","SystemsManagerParameter","SystemsManagerServiceError","dataType","lastModifiedDate","selector","sourceResult","type","version","parameter","Parameter","DataType","LastModifiedDate","Selector","SourceResult","Type","Value","KinesisClient","serviceVersion","streamName","StreamName","shardCount","ShardCount","streamModeDetails","StreamMode","streamMode","_send_request","streamARN","StreamARN","enforceConsumerDeletion","EnforceConsumerDeletion","exclusiveStartStreamName","ExclusiveStartStreamName","limit","Limit","ListStreamsResponse","fromJson","records","Records","PutRecordsResponse","shardIterator","ShardIterator","GetRecordsResponse","ListShardsResponse","shardId","shardIteratorType","ShardId","ShardIteratorType","startingSequenceNumber","StartingSequenceNumber","timestamp","Timestamp","GetShardIteratorResponse","action","KinesisServiceError","HasMoreStreams","StreamNames","StreamSummaries","result","_result$HasMoreStream","_result$NextToken","_result$StreamNames","_result$StreamSummari","String","StreamSummary","StreamCreationTimestamp","StreamStatus","StreamModeDetails","summary","_summary$StreamARN","_summary$StreamCreati","_summary$StreamModeDe","_summary$StreamName","_summary$StreamStatus","encryptionType","failedRecordCount","EncryptionType","FailedRecordCount","_json$EncryptionType","_json$FailedRecordCou","_json$Records","record","PutRecordsResultEntry","sequenceNumber","SequenceNumber","nextShardIterator","NextShardIterator","_json$NextShardIterat","_json$Records2","Record","partitionKey","Data","PartitionKey","shards","Shards","_json$Shards","shard","Shard","hashKeyRange","sequenceNumberRange","parentShardId","adjacentParentShardId","Id","ParentShardId","AdjacentParentShardId","HashKeyRange","SequenceNumberRange"],"sourceRoot":""} \ No newline at end of file diff --git a/build/index.js b/build/index.js index 471a5b8..cfec113 100644 --- a/build/index.js +++ b/build/index.js @@ -1,2 +1,2 @@ -(()=>{var e={393:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;rs});var s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"awsConfig",void 0),i(this,"serviceName",void 0),i(this,"_host",void 0),i(this,"_scheme",void 0),this.awsConfig=t,this.serviceName=r}var t,r,n;return t=e,(r=[{key:"host",get:function(){return null==this._host&&(this._host="".concat(this.serviceName,".").concat(this.awsConfig.region,".").concat(this.awsConfig.endpoint)),this._host},set:function(e){this._host=e}},{key:"scheme",get:function(){return null==this._scheme&&(this._scheme=this.awsConfig.scheme),this._scheme},set:function(e){this._scheme=e}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},223:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=s();return function(){var r,o=u(e);if(t){var i=u(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},i(e)}function a(e,t,r){return a=s()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o},a.apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;rv,o:()=>p});var p=function(){function e(t){if(f(this,e),d(this,"region",void 0),d(this,"accessKeyId",void 0),d(this,"secretAccessKey",void 0),d(this,"sessionToken",void 0),d(this,"scheme","https"),d(this,"endpoint","amazonaws.com"),!t.region||""===t.region)throw new v('invalid AWS region; reason: expected a valid AWS region name (e.g. "us-east-1"), got `'.concat(t.region,"`"));if(!t.accessKeyId||""===t.accessKeyId)throw new v("invalid AWS access key ID; reason: expected a non empty string, got `".concat(t.accessKeyId,"`"));if(t.accessKeyId.length<16||t.accessKeyId.length>128)throw new v("invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ".concat(t.accessKeyId.length));if(!t.secretAccessKey||""===t.secretAccessKey)throw new v("invalid AWS secret access key; reason: expected a non empty string, got `".concat(t.secretAccessKey,"`"));if(t.secretAccessKey.length<16||t.secretAccessKey.length>128)throw new v("invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ".concat(t.secretAccessKey.length));this.region=t.region,this.accessKeyId=t.accessKeyId,this.secretAccessKey=t.secretAccessKey,void 0!==t.sessionToken&&(this.sessionToken=t.sessionToken),void 0!==t.scheme&&(this.scheme=t.scheme),void 0!==t.endpoint&&(this.endpoint=t.endpoint)}return h(e,null,[{key:"fromEnvironment",value:function(t){return new e({region:__ENV.AWS_REGION,accessKeyId:__ENV.AWS_ACCESS_KEY_ID,secretAccessKey:__ENV.AWS_SECRET_ACCESS_KEY,sessionToken:__ENV.AWS_SESSION_TOKEN,scheme:null==t?void 0:t.scheme,endpoint:null==t?void 0:t.endpoint})}}]),e}(),v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(r,e);var t=o(r);function r(e){return f(this,r),t.call(this,e)}return h(r)}(i(Error))},592:(e,t,r)=>{"use strict";r.d(t,{$l:()=>o,Aq:()=>b,B3:()=>v,Dz:()=>p,K0:()=>n,NL:()=>u,Qk:()=>i,R$:()=>f,SG:()=>S,U4:()=>h,VR:()=>c,a_:()=>l,al:()=>g,cG:()=>s,mc:()=>d,md:()=>m,n8:()=>j,sH:()=>O,th:()=>w,w1:()=>y,zC:()=>a});var n="X-Amz-Algorithm",o="X-Amz-Credential",i="X-Amz-Date",a="X-Amz-Expires",s="X-Amz-Signature",c="X-Amz-SignedHeaders",u="X-Amz-Security-Token",f="x-amz-content-sha256",l=i.toLowerCase(),h=s.toLowerCase(),d="X-Amz-Target".toLowerCase(),y=u.toLowerCase(),p="authorization",v=[p,l,"date"],m="host",b={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},g="aws4_request",S="AWS4-HMAC-SHA256",w=604800,O="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",j="UNSIGNED-PAYLOAD"},380:(e,t,r)=>{"use strict";r.d(t,{t:()=>y});var n=r(255);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r{"use strict";function n(e,t){e=e.toLowerCase();for(var r=0,n=Object.keys(t);rn})},137:(e,t,r)=>{"use strict";r.d(t,{L:()=>O,w:()=>j});var n=r(400),o=r.n(n),i=r(592),a=r(380),s=r(491),c=r(23);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=v(v({},{signingDate:new Date,unsignableHeaders:new Set,signableHeaders:new Set}),t),n=_(r.signingDate),o=n.longDate,a=n.shortDate,c=r.signingService||this.service,u=r.signingRegion||this.region,f="".concat(a,"/").concat(u,"/").concat(c,"/").concat(i.al);e.headers[i.md]=e.hostname;for(var l=0,h=Object.keys(e.headers);l-1&&delete e.headers[d]}e.headers[i.a_]=o,this.credentials.sessionToken&&(e.headers[i.w1]=this.credentials.sessionToken),ArrayBuffer.isView(e.body)&&(e.body=e.body.buffer),e.body||(e.body="");var y=this.computePayloadHash(e);!(0,s.L)(i.R$,e.headers)&&this.applyChecksum&&(e.headers[i.R$]=y);var p=this.computeCanonicalHeaders(e,r.unsignableHeaders,r.signableHeaders),m=this.calculateSignature(o,f,this.deriveSigningKey(this.credentials,c,u,a),this.createCanonicalRequest(e,p,y));e.headers[i.Dz]="".concat(i.SG," ")+"Credential=".concat(this.credentials.accessKeyId,"/").concat(f,", ")+"SignedHeaders=".concat(Object.keys(p).sort().join(";"),", ")+"Signature=".concat(m);var b="".concat(e.protocol,"://").concat(e.hostname);return e.path&&(b+=e.path),e.query&&(b+="?".concat(this.serializeQueryParameters(e.query))),v({url:b},e)}},{key:"presign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.signingDate,n=void 0===r?new Date:r,o=t.expiresIn,a=void 0===o?3600:o,s=t.unsignableHeaders,c=t.unhoistableHeaders,u=t.signableHeaders,f=t.signingRegion,l=t.signingService,h=_(n),d=h.longDate,y=h.shortDate,p=f||this.region,m=l||this.service;if(a>i.th)throw new j("Signature version 4 presigned URLs can't be valid for more than 7 days");var b="".concat(y,"/").concat(p,"/").concat(m,"/").concat(i.al),g=this.moveHeadersToQuery(e,{unhoistableHeaders:c});g.headers[i.md]=e.hostname,this.credentials.sessionToken&&(g.query[i.NL]=this.credentials.sessionToken),g.query[i.K0]=i.SG,g.query[i.$l]="".concat(this.credentials.accessKeyId,"/").concat(b),g.query[i.Qk]=d,g.query[i.zC]=a.toString(10);var S=this.computeCanonicalHeaders(g,s,u);g.query[i.VR]=Object.keys(S).sort().join(";");var w=this.deriveSigningKey(this.credentials,m,p,y),O=this.computePayloadHash(e),P=this.createCanonicalRequest(g,S,O);g.query[i.cG]=this.calculateSignature(d,b,w,P);var k="".concat(g.protocol,"://").concat(g.hostname);return g.path&&(k+=g.path),g.query&&(k+="?".concat(this.serializeQueryParameters(g.query))),v({url:k},g)}},{key:"createCanonicalRequest",value:function(e,t,r){var n=Object.keys(t).sort(),o=n.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),i=n.join(";");return"".concat(e.method,"\n")+"".concat(this.computeCanonicalURI(e),"\n")+"".concat(this.computeCanonicalQuerystring(e),"\n")+"".concat(o,"\n\n")+"".concat(i,"\n")+"".concat(r)}},{key:"createStringToSign",value:function(e,t,r){var n=o().sha256(r,"hex");return"".concat(i.SG,"\n")+"".concat(e,"\n")+"".concat(t,"\n")+"".concat(n)}},{key:"calculateSignature",value:function(e,t,r,n){var i=this.createStringToSign(e,t,n);return o().hmac("sha256",r,i,"hex")}},{key:"deriveSigningKey",value:function(e,t,r,n){var i=e.secretAccessKey,a=o().hmac("sha256","AWS4"+i,n,"binary"),s=o().hmac("sha256",a,r,"binary"),c=o().hmac("sha256",s,t,"binary");return o().hmac("sha256",c,"aws4_request","binary")}},{key:"computeCanonicalURI",value:function(e){var t=e.path;if(this.uriEscapePath){var r,n=[],o=d(t.split("/"));try{for(o.s();!(r=o.n()).done;){var i=r.value;0!==(null==i?void 0:i.length)&&("."!==i&&(".."===i?n.pop():n.push(i)))}}catch(e){o.e(e)}finally{o.f()}var a=null!=t&&t.startsWith("/")?"/":"",s=n.join("/"),c=n.length>0&&null!=t&&t.endsWith("/")?"/":"",u="".concat(a).concat(s).concat(c);return encodeURIComponent(u).replace(/%2F/g,"/")}return t}},{key:"computeCanonicalQuerystring",value:function(e){var t,r=e.query,n=void 0===r?{}:r,o=[],a={},s=function(e){if(e.toLowerCase()===i.U4)return"continue";o.push(e);var t=n[e];"string"==typeof t?a[e]="".concat(P(e),"=").concat(P(t)):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,r){return t.concat(["".concat(P(e),"=").concat(P(r))])}),[]).join("&"))},c=d(Object.keys(n).sort());try{for(c.s();!(t=c.n()).done;)s(t.value)}catch(e){c.e(e)}finally{c.f()}return o.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}},{key:"computeCanonicalHeaders",value:function(e,t,r){var n,o=e.headers,a={},s=d(Object.keys(o).sort());try{for(s.s();!(n=s.n()).done;){var c=n.value;if(null!=o[c]){var u=c.toLowerCase();(u in i.Aq||null!=t&&t.has(u))&&(!r||r&&!r.has(u))||(a[u]=o[c].trim().replace(/\s+/g," "))}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"computePayloadHash",value:function(e){var t=e.headers,r=e.body;return t[i.R$]?t[i.R$]:null==r?i.sH:"string"==typeof r||(0,c.e)(r)?o().sha256(r,"hex").toLowerCase():ArrayBuffer.isView(r)?o().sha256(r.buffer,"hex").toLowerCase():i.n8}},{key:"moveHeadersToQuery",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.parse(JSON.stringify(e)),n=r.headers,o=r.query,i=void 0===o?{}:o,a=0,s=Object.keys(n);a{"use strict";function n(e){return"function"==typeof ArrayBuffer&&(e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e))}function o(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))),t}),[]).join("&")}r.d(t,{C:()=>o,e:()=>n})},41:(e,t,r)=>{"use strict";r.d(t,{SQSClient:()=>j});r(223);var n=r(137),o=r(393),i=r(409),a=r.n(i),s=r(23),c=r(380);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n={Action:"SendMessage",Version:O,QueueUrl:e,MessageBody:t};void 0!==r.messageDeduplicationId&&(n=l(l({},n),{},{MessageDeduplicationId:r.messageDeduplicationId})),void 0!==r.messageGroupId&&(n=l(l({},n),{},{MessageGroupId:r.messageGroupId}));var o=this.signature.sign({method:"POST",protocol:"https",hostname:this.host,path:"/",headers:l({},this.commonHeaders),body:(0,s.C)(n)},{}),i=a().request("POST",o.url,o.body||"",{headers:o.headers});this._handleError("SendMessage",i);var c=i.html("SendMessageResponse > SendMessageResult");return new P(c.find("MessageId").text(),c.find("MD5OfMessageBody").text())}},{key:"listQueues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={Action:"ListQueues",Version:O};void 0!==(null==e?void 0:e.maxResults)&&(t=l(l({},t),{},{MaxResults:e.maxResults})),void 0!==(null==e?void 0:e.nextToken)&&(t=l(l({},t),{},{NextToken:e.nextToken})),void 0!==(null==e?void 0:e.queueNamePrefix)&&(t=l(l({},t),{},{QueueNamePrefix:e.queueNamePrefix}));var r=this.signature.sign({method:"POST",protocol:"https",hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},{Host:this.host}),body:(0,s.C)(t)},{}),n=a().request("POST",r.url,r.body||"",{headers:r.headers});this._handleError("ListQueues",n);var o=n.html();return{urls:o.find("QueueUrl").toArray().map((function(e){return e.text()})),nextToken:o.find("NextToken").text()||void 0}}},{key:"_handleError",value:function(e,t){var r=t.error_code;if(""!=t.error||0!==r){var o=c.t.parseXML(t.body);if("AuthorizationHeaderMalformed"===o.code)throw new n.w(o.message,o.code);throw new _(o.message,o.code||"unknown",e)}}}]),r}(o.k),P=y((function e(t,r){h(this,e),S(this,"id",void 0),S(this,"bodyMD5",void 0),this.id=t,this.bodyMD5=r})),_=function(e){p(r,e);var t=m(r);function r(e,n,o){var i;return h(this,r),S(b(i=t.call(this,e,n)),"operation",void 0),i.name="SQSServiceError",i.operation=o,i}return y(r)}(c.t)},877:(e,t,r)=>{var n=r(570),o=r(171),i=o;i.v1=n,i.v4=o,e.exports=i},327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},570:(e,t,r)=>{var n,o,i=r(217),a=r(327),s=0,c=0;e.exports=function(e,t,r){var u=t&&r||0,f=t||[],l=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==h){var d=i();null==l&&(l=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var y=void 0!==e.msecs?e.msecs:(new Date).getTime(),p=void 0!==e.nsecs?e.nsecs:c+1,v=y-s+(p-c)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||y>s)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=y,c=p,o=h;var m=(1e4*(268435455&(y+=122192928e5))+p)%4294967296;f[u++]=m>>>24&255,f[u++]=m>>>16&255,f[u++]=m>>>8&255,f[u++]=255&m;var b=y/4294967296*1e4&268435455;f[u++]=b>>>8&255,f[u++]=255&b,f[u++]=b>>>24&15|16,f[u++]=b>>>16&255,f[u++]=h>>>8|128,f[u++]=255&h;for(var g=0;g<6;++g)f[u+g]=l[g];return t||a(f)}},171:(e,t,r)=>{var n=r(217),o=r(327);e.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},400:e=>{"use strict";e.exports=require("k6/crypto")},255:e=>{"use strict";e.exports=require("k6/html")},409:e=>{"use strict";e.exports=require("k6/http")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{AMZ_CONTENT_SHA256_HEADER:()=>o.R$,AWSConfig:()=>t.o,InvalidAWSConfigError:()=>t.l,InvalidSignatureError:()=>e.w,KMSClient:()=>O,KMSDataKey:()=>P,KMSServiceError:()=>_,KinesisClient:()=>ze,S3Bucket:()=>z,S3Client:()=>L,S3Object:()=>J,S3ServiceError:()=>U,SQSClient:()=>Ce.SQSClient,Secret:()=>se,SecretsManagerClient:()=>ae,SecretsManagerServiceError:()=>ce,SignatureV4:()=>e.L,SystemsManagerClient:()=>je,SystemsManagerParameter:()=>Pe,SystemsManagerServiceError:()=>_e,UNSIGNED_PAYLOAD:()=>o.n8});var e=r(137),t=r(223),o=r(592),i=r(409),a=r.n(i),s=r(393),c=r(380);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:C.Size256,r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},S({},o.mc,"TrentService.GenerateDataKey")),body:JSON.stringify({KeyId:e,NumberOfBytes:t})},{}),n=a().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(k.GenerateDataKey,n),P.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new _(i,o.__type,t)}if(1500===n)throw new _("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),j=function(){function e(t,r){h(this,e),S(this,"keyArn",void 0),S(this,"keyId",void 0),this.keyArn=t,this.keyId=r}return y(e,null,[{key:"fromJSON",value:function(t){return new e(t.KeyArn,t.KeyId)}}]),e}(),P=function(){function e(t,r,n){h(this,e),S(this,"id",void 0),S(this,"ciphertextBlob",void 0),S(this,"plaintext",void 0),this.ciphertextBlob=t,this.id=r,this.plaintext=n}return y(e,null,[{key:"fromJSON",value:function(t){return new e(t.CiphertextBlob,t.KeyId,t.Plaintext)}}]),e}(),_=function(e){p(r,e);var t=m(r);function r(e,n,o){var i;return h(this,r),S(b(i=t.call(this,e,n)),"operation",void 0),i.name="KMSServiceError",i.operation=o,i}return y(r)}(c.t),k=function(e){return e.GenerateDataKey="GenerateDataKey",e.ListKeys="ListKeys",e}(k||{}),C=function(e){return e[e.Size256=32]="Size256",e[e.Size512=64]="Size512",e}(C||{}),E=r(255);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var r=0;r".concat(e.partNumber,"").concat(e.eTag,"")})).join(""),""),c=this.signature.sign({method:o,protocol:this.scheme,hostname:i,path:"/".concat(t),headers:{},body:s,query:{uploadId:"".concat(r)}},{}),u=a().request(o,c.url,c.body||"",{headers:c.headers});this._handle_error("CompleteMultipartUpload",u)}},{key:"abortMultipartUpload",value:function(e,t,r){var n="DELETE",o="".concat(e,".").concat(this.host),i=this.signature.sign({method:n,protocol:this.scheme,hostname:o,path:"/".concat(t),headers:{},query:{uploadId:"".concat(r)}},{}),s=a().request(n,i.url,i.body||"",{headers:i.headers});this._handle_error("AbortMultipartUpload",s)}},{key:"_handle_error",value:function(t,r){var n=r.status,o=r.error_code,i=r.error;if(!(n>=200&&n<300&&""==i&&0===o)){if(301==n||i&&i.startsWith("301"))throw new U("Resource not found","ResourceNotFound",t);var a=c.t.parseXML(r.body);if("AuthorizationHeaderMalformed"===a.code)throw new e.w(a.message,a.code);throw new U(a.message,a.code||"unknown",t)}}}]),n}(s.k),z=A((function e(t,r){N(this,e),q(this,"name",void 0),q(this,"creationDate",void 0),this.name=t,this.creationDate=r})),J=A((function e(t,r,n,o,i,a){N(this,e),q(this,"key",void 0),q(this,"lastModified",void 0),q(this,"etag",void 0),q(this,"size",void 0),q(this,"storageClass",void 0),q(this,"data",void 0),this.key=t,this.lastModified=r,this.etag=n,this.size=o,this.storageClass=i,this.data=a})),B=A((function e(t,r){N(this,e),q(this,"key",void 0),q(this,"uploadId",void 0),this.key=t,this.uploadId=r})),G=A((function e(t,r){N(this,e),q(this,"partNumber",void 0),q(this,"eTag",void 0),this.partNumber=t,this.eTag=r})),U=function(e){D(r,e);var t=I(r);function r(e,n,o){var i;return N(this,r),q(K(i=t.call(this,e,n)),"operation",void 0),i.name="S3ServiceError",i.operation=o,i}return A(r)}(c.t),V=r(877);function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new ce(i,o.__type,t)}if(1500===n)throw new ce("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),se=function(){function e(t,r,n,o,i,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];F(this,e),oe(this,"name",void 0),oe(this,"arn",void 0),oe(this,"secret",void 0),oe(this,"createdDate",void 0),oe(this,"lastAccessedDate",void 0),oe(this,"lastChangedDate",void 0),oe(this,"tags",void 0),this.name=t,this.arn=r,this.secret=n,this.createdDate=o,this.lastAccessedDate=i,this.lastChangedDate=a,this.tags=s}return Y(e,null,[{key:"fromJSON",value:function(t){return new e(t.Name,t.ARN,t.SecretString,t.CreatedDate,t.LastAccessedDate,t.LastChangedDate,t.Tags)}}]),e}(),ce=function(e){Z(r,e);var t=te(r);function r(e,n,o){var i;return F(this,r),oe(re(i=t.call(this,e,n)),"operation",void 0),i.name="SecretsManagerServiceError",i.operation=o,i}return Y(r)}(c.t),ue=function(e){return e.ListSecrets="ListSecrets",e.GetSecretValue="GetSecretValue",e.CreateSecret="CreateSecret",e.PutSecretValue="PutSecretValue",e.DeleteSecret="DeleteSecret",e}(ue||{});function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function he(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:he(he({},this.commonHeaders),{},we({},o.mc,"AmazonSSM.GetParameter")),body:JSON.stringify({Name:e,WithDecryption:t})},{}),n=a().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(ke.GetParameter,n),Pe.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new _e(i,o.__type,t)}if(1500===n)throw new _e("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),Pe=function(){function e(t,r,n,o,i,a,s,c,u){de(this,e),we(this,"arn",void 0),we(this,"dataType",void 0),we(this,"lastModifiedDate",void 0),we(this,"name",void 0),we(this,"selector",void 0),we(this,"sourceResult",void 0),we(this,"type",void 0),we(this,"value",void 0),we(this,"version",void 0),this.arn=t,this.dataType=r,this.lastModifiedDate=n,this.name=o,this.selector=i,this.sourceResult=a,this.type=s,this.value=c,this.version=u}return pe(e,null,[{key:"fromJSON",value:function(t){var r=t.Parameter;return new e(r.ARN,r.DataType,r.LastModifiedDate,r.Name,r.Selector,r.SourceResult,r.Type,r.Value,r.Version)}}]),e}(),_e=function(e){ve(r,e);var t=be(r);function r(e,n,o){var i;return de(this,r),we(ge(i=t.call(this,e,n)),"operation",void 0),i.name="SystemsManagerServiceError",i.operation=o,i}return pe(r)}(c.t),ke=function(e){return e.GetParameter="GetParameter",e}(ke||{}),Ce=r(41);function Ee(e){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(e)}function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({StreamName:e},t.shardCount&&{ShardCount:t.shardCount}),t.streamModeDetails&&{StreamMode:t.streamModeDetails.streamMode});this._send_request("CreateStream",r)}},{key:"deleteStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({StreamName:e},t.streamARN&&{StreamARN:t.streamARN}),t.enforceConsumerDeletion&&{EnforceConsumerDeletion:t.enforceConsumerDeletion});this._send_request("DeleteStream",r)}},{key:"listStreams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ne(Ne(Ne({},e.exclusiveStartStreamName&&{ExclusiveStartStreamName:e.exclusiveStartStreamName}),e.limit&&{Limit:e.limit}),e.nextToken&&{NextToken:e.nextToken}),r=this._send_request("ListStreams",t);return Be.fromJson(null==r?void 0:r.json())}},{key:"putRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.streamName&&!t.streamARN)throw new Error("Either streamName or streamARN must be provided");var r=Ne(Ne({Records:e},t.streamName&&{StreamName:t.streamName}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("PutRecords",r);return Ue.fromJson(null==n?void 0:n.json())}},{key:"getRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({ShardIterator:e},t.limit&&{Limit:t.limit}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("GetRecords",r);return We.fromJson(null==n?void 0:n.json())}},{key:"listShards",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ne(Ne({StreamName:e},t.nextToken&&{NextToken:t.nextToken}),t.maxResults&&{MaxResults:t.maxResults}),n=this._send_request("ListShards",r);return Xe.fromJson(null==n?void 0:n.json())}},{key:"getShardIterator",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Ne(Ne({StreamName:e,ShardId:t,ShardIteratorType:r},n.startingSequenceNumber&&{StartingSequenceNumber:n.startingSequenceNumber}),n.timestamp&&{Timestamp:n.timestamp}),i=this._send_request("GetShardIterator",o);return $e.fromJson(null==i?void 0:i.json())}},{key:"_send_request",value:function(e,t){var r=this.signature.sign({method:"POST",protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:Ne(Ne({},this.commonHeaders),{},He({},o.mc,"".concat(this.serviceVersion,".").concat(e))),body:JSON.stringify(t)},{}),n=a().request("POST",r.url,r.body,{headers:r.headers});return this._handle_error(e,n),n}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new Je(i,o.__type,t)}if(1500===n)throw new Je("An error occured on the server side","InternalServiceError",t)}}}]),n}(s.k),Je=function(e){xe(r,e);var t=Ke(r);function r(e,n,o){var i;return Re(this,r),He(Me(i=t.call(this,e,n)),"operation",void 0),i.name="KinesisServiceError",i.operation=o,i}return De(r)}(c.t),Be=function(){function e(t,r,n,o){Re(this,e),He(this,"HasMoreStreams",void 0),He(this,"NextToken",void 0),He(this,"StreamNames",void 0),He(this,"StreamSummaries",void 0),this.HasMoreStreams=t,this.NextToken=r,this.StreamNames=n,this.StreamSummaries=o}return De(e,null,[{key:"fromJson",value:function(t){var r=t.HasMoreStreams,n=void 0!==r&&r,o=t.NextToken,i=void 0===o?"":o,a=t.StreamNames,s=void 0===a?[]:a,c=t.StreamSummaries,u=void 0===c?[]:c;return new e(n,i,s.map((function(e){return String(e)})),u.map(Ge.fromJson))}}]),e}(),Ge=function(){function e(t,r,n,o,i){Re(this,e),He(this,"StreamARN",void 0),He(this,"StreamCreationTimestamp",void 0),He(this,"StreamModeDetails",void 0),He(this,"StreamName",void 0),He(this,"StreamStatus",void 0),this.StreamARN=t,this.StreamCreationTimestamp=r,this.StreamModeDetails=n,this.StreamName=o,this.StreamStatus=i}return De(e,null,[{key:"fromJson",value:function(t){var r=t.StreamARN,n=void 0===r?"":r,o=t.StreamCreationTimestamp,i=void 0===o?0:o,a=t.StreamModeDetails,s=void 0===a?{}:a,c=t.StreamName,u=void 0===c?"":c,f=t.StreamStatus;return new e(n,i,s,u,void 0===f?"":f)}}]),e}(),Ue=function(){function e(t,r,n){Re(this,e),He(this,"EncryptionType",void 0),He(this,"FailedRecordCount",void 0),He(this,"Records",void 0),this.EncryptionType=t,this.FailedRecordCount=r,this.Records=n}return De(e,null,[{key:"fromJson",value:function(t){var r=t.EncryptionType,n=void 0===r?"NONE":r,o=t.FailedRecordCount,i=void 0===o?0:o,a=t.Records;return new e(n,i,(void 0===a?[]:a).map((function(e){return Ve.fromJson(e)})))}}]),e}(),Ve=function(){function e(t,r){Re(this,e),He(this,"SequenceNumber",void 0),He(this,"ShardId",void 0),this.SequenceNumber=t,this.ShardId=r}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.SequenceNumber,t.ShardId)}}]),e}(),We=function(){function e(t,r){Re(this,e),He(this,"NextShardIterator",void 0),He(this,"Records",void 0),this.NextShardIterator=t,this.Records=r}return De(e,null,[{key:"fromJson",value:function(t){var r=t.NextShardIterator,n=void 0===r?"":r,o=t.Records;return new e(n,(void 0===o?[]:o).map((function(e){return Qe.fromJson(e)})))}}]),e}(),Qe=function(){function e(t,r,n){Re(this,e),He(this,"Data",void 0),He(this,"PartitionKey",void 0),He(this,"SequenceNumber",void 0),this.Data=t,this.PartitionKey=r,this.SequenceNumber=n}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.Data,t.PartitionKey,t.SequenceNumber)}}]),e}(),Xe=function(){function e(t,r){Re(this,e),He(this,"Shards",void 0),He(this,"NextToken",void 0),this.Shards=t,this.NextToken=r}return De(e,null,[{key:"fromJson",value:function(t){var r=t.Shards,n=void 0===r?[]:r,o=t.NextToken;return new e(n.map((function(e){return Fe.fromJson(e)})),o)}}]),e}(),Fe=function(){function e(t,r,n,o,i){Re(this,e),He(this,"Id",void 0),He(this,"ParentShardId",void 0),He(this,"AdjacentParentShardId",void 0),He(this,"HashKeyRange",void 0),He(this,"SequenceNumberRange",void 0),this.Id=t,this.ParentShardId=o,this.AdjacentParentShardId=i,this.HashKeyRange=r,this.SequenceNumberRange=n}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardId,t.HashKeyRange,t.SequenceNumberRange,t.ParentShardId,t.AdjacentParentShardId)}}]),e}(),$e=function(){function e(t){Re(this,e),He(this,"ShardIterator",void 0),this.ShardIterator=t}return De(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardIterator)}}]),e}()})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); +(()=>{var e={393:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;rs});var s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"awsConfig",void 0),i(this,"serviceName",void 0),i(this,"_host",void 0),i(this,"_scheme",void 0),this.awsConfig=t,this.serviceName=r}var t,r,n;return t=e,(r=[{key:"host",get:function(){return null==this._host&&(this._host="".concat(this.serviceName,".").concat(this.awsConfig.region,".").concat(this.awsConfig.endpoint)),this._host},set:function(e){this._host=e}},{key:"scheme",get:function(){return null==this._scheme&&(this._scheme=this.awsConfig.scheme),this._scheme},set:function(e){this._scheme=e}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},592:(e,t,r)=>{"use strict";r.d(t,{$l:()=>o,Aq:()=>b,B3:()=>v,Dz:()=>p,K0:()=>n,NL:()=>u,Qk:()=>i,R$:()=>f,SG:()=>S,U4:()=>h,VR:()=>c,a_:()=>l,al:()=>g,cG:()=>s,mc:()=>d,md:()=>m,n8:()=>j,sH:()=>O,th:()=>w,w1:()=>y,zC:()=>a});var n="X-Amz-Algorithm",o="X-Amz-Credential",i="X-Amz-Date",a="X-Amz-Expires",s="X-Amz-Signature",c="X-Amz-SignedHeaders",u="X-Amz-Security-Token",f="x-amz-content-sha256",l=i.toLowerCase(),h=s.toLowerCase(),d="X-Amz-Target".toLowerCase(),y=u.toLowerCase(),p="authorization",v=[p,l,"date"],m="host",b={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},g="aws4_request",S="AWS4-HMAC-SHA256",w=604800,O="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",j="UNSIGNED-PAYLOAD"},380:(e,t,r)=>{"use strict";r.d(t,{t:()=>y});var n=r(255);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r{"use strict";function n(e,t){e=e.toLowerCase();for(var r=0,n=Object.keys(t);rn})},137:(e,t,r)=>{"use strict";r.d(t,{L:()=>O,w:()=>j});var n=r(400),o=r.n(n),i=r(592),a=r(380),s=r(491),c=r(23);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=v(v({},{signingDate:new Date,unsignableHeaders:new Set,signableHeaders:new Set}),t),n=_(r.signingDate),o=n.longDate,a=n.shortDate,c=r.signingService||this.service,u=r.signingRegion||this.region,f="".concat(a,"/").concat(u,"/").concat(c,"/").concat(i.al);e.headers[i.md]=e.hostname;for(var l=0,h=Object.keys(e.headers);l-1&&delete e.headers[d]}e.headers[i.a_]=o,this.credentials.sessionToken&&(e.headers[i.w1]=this.credentials.sessionToken),ArrayBuffer.isView(e.body)&&(e.body=e.body.buffer),e.body||(e.body="");var y=this.computePayloadHash(e);!(0,s.L)(i.R$,e.headers)&&this.applyChecksum&&(e.headers[i.R$]=y);var p=this.computeCanonicalHeaders(e,r.unsignableHeaders,r.signableHeaders),m=this.calculateSignature(o,f,this.deriveSigningKey(this.credentials,c,u,a),this.createCanonicalRequest(e,p,y));e.headers[i.Dz]="".concat(i.SG," ")+"Credential=".concat(this.credentials.accessKeyId,"/").concat(f,", ")+"SignedHeaders=".concat(Object.keys(p).sort().join(";"),", ")+"Signature=".concat(m);var b="".concat(e.protocol,"://").concat(e.hostname);return e.path&&(b+=e.path),e.query&&(b+="?".concat(this.serializeQueryParameters(e.query))),v({url:b},e)}},{key:"presign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.signingDate,n=void 0===r?new Date:r,o=t.expiresIn,a=void 0===o?3600:o,s=t.unsignableHeaders,c=t.unhoistableHeaders,u=t.signableHeaders,f=t.signingRegion,l=t.signingService,h=_(n),d=h.longDate,y=h.shortDate,p=f||this.region,m=l||this.service;if(a>i.th)throw new j("Signature version 4 presigned URLs can't be valid for more than 7 days");var b="".concat(y,"/").concat(p,"/").concat(m,"/").concat(i.al),g=this.moveHeadersToQuery(e,{unhoistableHeaders:c});g.headers[i.md]=e.hostname,this.credentials.sessionToken&&(g.query[i.NL]=this.credentials.sessionToken),g.query[i.K0]=i.SG,g.query[i.$l]="".concat(this.credentials.accessKeyId,"/").concat(b),g.query[i.Qk]=d,g.query[i.zC]=a.toString(10);var S=this.computeCanonicalHeaders(g,s,u);g.query[i.VR]=Object.keys(S).sort().join(";");var w=this.deriveSigningKey(this.credentials,m,p,y),O=this.computePayloadHash(e),P=this.createCanonicalRequest(g,S,O);g.query[i.cG]=this.calculateSignature(d,b,w,P);var k="".concat(g.protocol,"://").concat(g.hostname);return g.path&&(k+=g.path),g.query&&(k+="?".concat(this.serializeQueryParameters(g.query))),v({url:k},g)}},{key:"createCanonicalRequest",value:function(e,t,r){var n=Object.keys(t).sort(),o=n.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),i=n.join(";");return"".concat(e.method,"\n")+"".concat(this.computeCanonicalURI(e),"\n")+"".concat(this.computeCanonicalQuerystring(e),"\n")+"".concat(o,"\n\n")+"".concat(i,"\n")+"".concat(r)}},{key:"createStringToSign",value:function(e,t,r){var n=o().sha256(r,"hex");return"".concat(i.SG,"\n")+"".concat(e,"\n")+"".concat(t,"\n")+"".concat(n)}},{key:"calculateSignature",value:function(e,t,r,n){var i=this.createStringToSign(e,t,n);return o().hmac("sha256",r,i,"hex")}},{key:"deriveSigningKey",value:function(e,t,r,n){var i=e.secretAccessKey,a=o().hmac("sha256","AWS4"+i,n,"binary"),s=o().hmac("sha256",a,r,"binary"),c=o().hmac("sha256",s,t,"binary");return o().hmac("sha256",c,"aws4_request","binary")}},{key:"computeCanonicalURI",value:function(e){var t=e.path;if(this.uriEscapePath){var r,n=[],o=d(t.split("/"));try{for(o.s();!(r=o.n()).done;){var i=r.value;0!==(null==i?void 0:i.length)&&("."!==i&&(".."===i?n.pop():n.push(i)))}}catch(e){o.e(e)}finally{o.f()}var a=null!=t&&t.startsWith("/")?"/":"",s=n.join("/"),c=n.length>0&&null!=t&&t.endsWith("/")?"/":"",u="".concat(a).concat(s).concat(c);return encodeURIComponent(u).replace(/%2F/g,"/")}return t}},{key:"computeCanonicalQuerystring",value:function(e){var t,r=e.query,n=void 0===r?{}:r,o=[],a={},s=function(e){if(e.toLowerCase()===i.U4)return"continue";o.push(e);var t=n[e];"string"==typeof t?a[e]="".concat(P(e),"=").concat(P(t)):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,r){return t.concat(["".concat(P(e),"=").concat(P(r))])}),[]).join("&"))},c=d(Object.keys(n).sort());try{for(c.s();!(t=c.n()).done;)s(t.value)}catch(e){c.e(e)}finally{c.f()}return o.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}},{key:"computeCanonicalHeaders",value:function(e,t,r){var n,o=e.headers,a={},s=d(Object.keys(o).sort());try{for(s.s();!(n=s.n()).done;){var c=n.value;if(null!=o[c]){var u=c.toLowerCase();(u in i.Aq||null!=t&&t.has(u))&&(!r||r&&!r.has(u))||(a[u]=o[c].trim().replace(/\s+/g," "))}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"computePayloadHash",value:function(e){var t=e.headers,r=e.body;return t[i.R$]?t[i.R$]:null==r?i.sH:"string"==typeof r||(0,c.e)(r)?o().sha256(r,"hex").toLowerCase():ArrayBuffer.isView(r)?o().sha256(r.buffer,"hex").toLowerCase():i.n8}},{key:"moveHeadersToQuery",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.parse(JSON.stringify(e)),n=r.headers,o=r.query,i=void 0===o?{}:o,a=0,s=Object.keys(n);a{"use strict";function n(e){return"function"==typeof ArrayBuffer&&(e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e))}function o(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))),t}),[]).join("&")}r.d(t,{C:()=>o,e:()=>n})},41:(e,t,r)=>{"use strict";r.d(t,{SQSClient:()=>j});var n=r(137),o=r(393),i=r(409),a=r.n(i),s=r(23),c=r(380);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n={Action:"SendMessage",Version:O,QueueUrl:e,MessageBody:t};void 0!==r.messageDeduplicationId&&(n=l(l({},n),{},{MessageDeduplicationId:r.messageDeduplicationId})),void 0!==r.messageGroupId&&(n=l(l({},n),{},{MessageGroupId:r.messageGroupId}));var o=this.signature.sign({method:"POST",protocol:this.scheme,hostname:this.host,path:"/",headers:l({},this.commonHeaders),body:(0,s.C)(n)},{}),i=a().request("POST",o.url,o.body||"",{headers:o.headers});this._handleError("SendMessage",i);var c=i.html("SendMessageResponse > SendMessageResult");return new P(c.find("MessageId").text(),c.find("MD5OfMessageBody").text())}},{key:"listQueues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={Action:"ListQueues",Version:O};void 0!==(null==e?void 0:e.maxResults)&&(t=l(l({},t),{},{MaxResults:e.maxResults})),void 0!==(null==e?void 0:e.nextToken)&&(t=l(l({},t),{},{NextToken:e.nextToken})),void 0!==(null==e?void 0:e.queueNamePrefix)&&(t=l(l({},t),{},{QueueNamePrefix:e.queueNamePrefix}));var r=this.signature.sign({method:"POST",protocol:this.scheme,hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},{Host:this.host}),body:(0,s.C)(t)},{}),n=a().request("POST",r.url,r.body||"",{headers:r.headers});this._handleError("ListQueues",n);var o=n.html();return{urls:o.find("QueueUrl").toArray().map((function(e){return e.text()})),nextToken:o.find("NextToken").text()||void 0}}},{key:"_handleError",value:function(e,t){var r=t.error_code;if(""!=t.error||0!==r){var o=c.t.parseXML(t.body);if("AuthorizationHeaderMalformed"===o.code)throw new n.w(o.message,o.code);throw new _(o.message,o.code||"unknown",e)}}}]),r}(o.k),P=y((function e(t,r){h(this,e),S(this,"id",void 0),S(this,"bodyMD5",void 0),this.id=t,this.bodyMD5=r})),_=function(e){p(r,e);var t=m(r);function r(e,n,o){var i;return h(this,r),S(b(i=t.call(this,e,n)),"operation",void 0),i.name="SQSServiceError",i.operation=o,i}return y(r)}(c.t)},877:(e,t,r)=>{var n=r(570),o=r(171),i=o;i.v1=n,i.v4=o,e.exports=i},327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},570:(e,t,r)=>{var n,o,i=r(217),a=r(327),s=0,c=0;e.exports=function(e,t,r){var u=t&&r||0,f=t||[],l=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==h){var d=i();null==l&&(l=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=o=16383&(d[6]<<8|d[7]))}var y=void 0!==e.msecs?e.msecs:(new Date).getTime(),p=void 0!==e.nsecs?e.nsecs:c+1,v=y-s+(p-c)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||y>s)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=y,c=p,o=h;var m=(1e4*(268435455&(y+=122192928e5))+p)%4294967296;f[u++]=m>>>24&255,f[u++]=m>>>16&255,f[u++]=m>>>8&255,f[u++]=255&m;var b=y/4294967296*1e4&268435455;f[u++]=b>>>8&255,f[u++]=255&b,f[u++]=b>>>24&15|16,f[u++]=b>>>16&255,f[u++]=h>>>8|128,f[u++]=255&h;for(var g=0;g<6;++g)f[u+g]=l[g];return t||a(f)}},171:(e,t,r)=>{var n=r(217),o=r(327);e.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},400:e=>{"use strict";e.exports=require("k6/crypto")},255:e=>{"use strict";e.exports=require("k6/html")},409:e=>{"use strict";e.exports=require("k6/http")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{AMZ_CONTENT_SHA256_HEADER:()=>m.R$,AWSConfig:()=>p,InvalidAWSConfigError:()=>v,InvalidSignatureError:()=>e.w,KMSClient:()=>I,KMSDataKey:()=>M,KMSServiceError:()=>q,KinesisClient:()=>et,S3Bucket:()=>ee,S3Client:()=>Z,S3Object:()=>te,S3ServiceError:()=>oe,SQSClient:()=>Le.SQSClient,Secret:()=>Se,SecretsManagerClient:()=>ge,SecretsManagerServiceError:()=>we,SignatureV4:()=>e.L,SystemsManagerClient:()=>Ke,SystemsManagerParameter:()=>Me,SystemsManagerServiceError:()=>qe,UNSIGNED_PAYLOAD:()=>m.n8});var e=r(137);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function o(e){var r=s();return function(){var n,o=u(e);if(r){var i=u(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},i(e)}function a(e,t,r){return a=s()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&c(o,r.prototype),o},a.apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;r128)throw new v("invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ".concat(t.accessKeyId.length));if(!t.secretAccessKey||""===t.secretAccessKey)throw new v("invalid AWS secret access key; reason: expected a non empty string, got `".concat(t.secretAccessKey,"`"));if(t.secretAccessKey.length<16||t.secretAccessKey.length>128)throw new v("invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ".concat(t.secretAccessKey.length));this.region=t.region,this.accessKeyId=t.accessKeyId,this.secretAccessKey=t.secretAccessKey,void 0!==t.sessionToken&&(this.sessionToken=t.sessionToken),void 0!==t.scheme&&(this.scheme=t.scheme),void 0!==t.endpoint&&(this.endpoint=t.endpoint)}return h(e,null,[{key:"fromEnvironment",value:function(t){return new e({region:__ENV.AWS_REGION,accessKeyId:__ENV.AWS_ACCESS_KEY_ID,secretAccessKey:__ENV.AWS_SECRET_ACCESS_KEY,sessionToken:__ENV.AWS_SESSION_TOKEN,scheme:null==t?void 0:t.scheme,endpoint:null==t?void 0:t.endpoint})}}]),e}(),v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(r,e);var t=o(r);function r(e){return f(this,r),t.call(this,e)}return h(r)}(i(Error)),m=r(592),b=r(409),g=r.n(b),S=r(393),w=r(380);function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:L.Size256,r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:P(P({},this.commonHeaders),{},D({},m.mc,"TrentService.GenerateDataKey")),body:JSON.stringify({KeyId:e,NumberOfBytes:t})},{}),n=g().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(H.GenerateDataKey,n),M.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new q(i,o.__type,t)}if(1500===n)throw new q("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),K=function(){function e(t,r){_(this,e),D(this,"keyArn",void 0),D(this,"keyId",void 0),this.keyArn=t,this.keyId=r}return C(e,null,[{key:"fromJSON",value:function(t){return new e(t.KeyArn,t.KeyId)}}]),e}(),M=function(){function e(t,r,n){_(this,e),D(this,"id",void 0),D(this,"ciphertextBlob",void 0),D(this,"plaintext",void 0),this.ciphertextBlob=t,this.id=r,this.plaintext=n}return C(e,null,[{key:"fromJSON",value:function(t){return new e(t.CiphertextBlob,t.KeyId,t.Plaintext)}}]),e}(),q=function(e){E(r,e);var t=N(r);function r(e,n,o){var i;return _(this,r),D(R(i=t.call(this,e,n)),"operation",void 0),i.name="KMSServiceError",i.operation=o,i}return C(r)}(w.t),H=function(e){return e.GenerateDataKey="GenerateDataKey",e.ListKeys="ListKeys",e}(H||{}),L=function(e){return e[e.Size256=32]="Size256",e[e.Size512=64]="Size512",e}(L||{}),z=r(255);function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var r=0;r".concat(e.partNumber,"").concat(e.eTag,"")})).join(""),""),s=this.signature.sign({method:o,protocol:this.scheme,hostname:i,path:"/".concat(t),headers:{},body:a,query:{uploadId:"".concat(r)}},{}),c=g().request(o,s.url,s.body||"",{headers:s.headers});this._handle_error("CompleteMultipartUpload",c)}},{key:"abortMultipartUpload",value:function(e,t,r){var n="DELETE",o="".concat(e,".").concat(this.host),i=this.signature.sign({method:n,protocol:this.scheme,hostname:o,path:"/".concat(t),headers:{},query:{uploadId:"".concat(r)}},{}),a=g().request(n,i.url,i.body||"",{headers:i.headers});this._handle_error("AbortMultipartUpload",a)}},{key:"_handle_error",value:function(t,r){var n=r.status,o=r.error_code,i=r.error;if(!(n>=200&&n<300&&""==i&&0===o)){if(301==n||i&&i.startsWith("301"))throw new oe("Resource not found","ResourceNotFound",t);var a=w.t.parseXML(r.body);if("AuthorizationHeaderMalformed"===a.code)throw new e.w(a.message,a.code);throw new oe(a.message,a.code||"unknown",t)}}}]),n}(S.k),ee=U((function e(t,r){B(this,e),$(this,"name",void 0),$(this,"creationDate",void 0),this.name=t,this.creationDate=r})),te=U((function e(t,r,n,o,i,a){B(this,e),$(this,"key",void 0),$(this,"lastModified",void 0),$(this,"etag",void 0),$(this,"size",void 0),$(this,"storageClass",void 0),$(this,"data",void 0),this.key=t,this.lastModified=r,this.etag=n,this.size=o,this.storageClass=i,this.data=a})),re=U((function e(t,r){B(this,e),$(this,"key",void 0),$(this,"uploadId",void 0),this.key=t,this.uploadId=r})),ne=U((function e(t,r){B(this,e),$(this,"partNumber",void 0),$(this,"eTag",void 0),this.partNumber=t,this.eTag=r})),oe=function(e){V(r,e);var t=Q(r);function r(e,n,o){var i;return B(this,r),$(X(i=t.call(this,e,n)),"operation",void 0),i.name="S3ServiceError",i.operation=o,i}return U(r)}(w.t),ie=r(877);function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new we(i,o.__type,t)}if(1500===n)throw new we("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),Se=function(){function e(t,r,n,o,i,a){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];ue(this,e),me(this,"name",void 0),me(this,"arn",void 0),me(this,"secret",void 0),me(this,"createdDate",void 0),me(this,"lastAccessedDate",void 0),me(this,"lastChangedDate",void 0),me(this,"tags",void 0),this.name=t,this.arn=r,this.secret=n,this.createdDate=o,this.lastAccessedDate=i,this.lastChangedDate=a,this.tags=s}return le(e,null,[{key:"fromJSON",value:function(t){return new e(t.Name,t.ARN,t.SecretString,t.CreatedDate,t.LastAccessedDate,t.LastChangedDate,t.Tags)}}]),e}(),we=function(e){he(r,e);var t=ye(r);function r(e,n,o){var i;return ue(this,r),me(pe(i=t.call(this,e,n)),"operation",void 0),i.name="SecretsManagerServiceError",i.operation=o,i}return le(r)}(w.t),Oe=function(e){return e.ListSecrets="ListSecrets",e.GetSecretValue="GetSecretValue",e.CreateSecret="CreateSecret",e.PutSecretValue="PutSecretValue",e.DeleteSecret="DeleteSecret",e}(Oe||{});function je(e){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(e)}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],r=this.signature.sign({method:this.method,protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:_e(_e({},this.commonHeaders),{},xe({},m.mc,"AmazonSSM.GetParameter")),body:JSON.stringify({Name:e,WithDecryption:t})},{}),n=g().request(this.method,r.url,r.body,{headers:r.headers});return this._handle_error(He.GetParameter,n),Me.fromJSON(n.json())}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new qe(i,o.__type,t)}if(1500===n)throw new qe("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),Me=function(){function e(t,r,n,o,i,a,s,c,u){ke(this,e),xe(this,"arn",void 0),xe(this,"dataType",void 0),xe(this,"lastModifiedDate",void 0),xe(this,"name",void 0),xe(this,"selector",void 0),xe(this,"sourceResult",void 0),xe(this,"type",void 0),xe(this,"value",void 0),xe(this,"version",void 0),this.arn=t,this.dataType=r,this.lastModifiedDate=n,this.name=o,this.selector=i,this.sourceResult=a,this.type=s,this.value=c,this.version=u}return Ee(e,null,[{key:"fromJSON",value:function(t){var r=t.Parameter;return new e(r.ARN,r.DataType,r.LastModifiedDate,r.Name,r.Selector,r.SourceResult,r.Type,r.Value,r.Version)}}]),e}(),qe=function(e){Te(r,e);var t=Re(r);function r(e,n,o){var i;return ke(this,r),xe(Ae(i=t.call(this,e,n)),"operation",void 0),i.name="SystemsManagerServiceError",i.operation=o,i}return Ee(r)}(w.t),He=function(e){return e.GetParameter="GetParameter",e}(He||{}),Le=r(41);function ze(e){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(e)}function Je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({StreamName:e},t.shardCount&&{ShardCount:t.shardCount}),t.streamModeDetails&&{StreamMode:t.streamModeDetails.streamMode});this._send_request("CreateStream",r)}},{key:"deleteStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({StreamName:e},t.streamARN&&{StreamARN:t.streamARN}),t.enforceConsumerDeletion&&{EnforceConsumerDeletion:t.enforceConsumerDeletion});this._send_request("DeleteStream",r)}},{key:"listStreams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Be(Be(Be({},e.exclusiveStartStreamName&&{ExclusiveStartStreamName:e.exclusiveStartStreamName}),e.limit&&{Limit:e.limit}),e.nextToken&&{NextToken:e.nextToken}),r=this._send_request("ListStreams",t);return rt.fromJson(null==r?void 0:r.json())}},{key:"putRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.streamName&&!t.streamARN)throw new Error("Either streamName or streamARN must be provided");var r=Be(Be({Records:e},t.streamName&&{StreamName:t.streamName}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("PutRecords",r);return ot.fromJson(null==n?void 0:n.json())}},{key:"getRecords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({ShardIterator:e},t.limit&&{Limit:t.limit}),t.streamARN&&{StreamARN:t.streamARN}),n=this._send_request("GetRecords",r);return at.fromJson(null==n?void 0:n.json())}},{key:"listShards",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Be(Be({StreamName:e},t.nextToken&&{NextToken:t.nextToken}),t.maxResults&&{MaxResults:t.maxResults}),n=this._send_request("ListShards",r);return ct.fromJson(null==n?void 0:n.json())}},{key:"getShardIterator",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Be(Be({StreamName:e,ShardId:t,ShardIteratorType:r},n.startingSequenceNumber&&{StartingSequenceNumber:n.startingSequenceNumber}),n.timestamp&&{Timestamp:n.timestamp}),i=this._send_request("GetShardIterator",o);return ft.fromJson(null==i?void 0:i.json())}},{key:"_send_request",value:function(e,t){var r=this.signature.sign({method:"POST",protocol:this.awsConfig.scheme,hostname:this.host,path:"/",headers:Be(Be({},this.commonHeaders),{},Ye({},m.mc,"".concat(this.serviceVersion,".").concat(e))),body:JSON.stringify(t)},{}),n=g().request("POST",r.url,r.body,{headers:r.headers});return this._handle_error(e,n),n}},{key:"_handle_error",value:function(t,r){var n=r.error_code;if(0!==n){var o=r.json();if(n>=1400&&n<=1499){var i=o.Message||o.message||o.__type;if("InvalidSignatureException"===o.__type)throw new e.w(i,o.__type);throw new tt(i,o.__type,t)}if(1500===n)throw new tt("An error occured on the server side","InternalServiceError",t)}}}]),n}(S.k),tt=function(e){We(r,e);var t=Xe(r);function r(e,n,o){var i;return Ge(this,r),Ye(Fe(i=t.call(this,e,n)),"operation",void 0),i.name="KinesisServiceError",i.operation=o,i}return Ve(r)}(w.t),rt=function(){function e(t,r,n,o){Ge(this,e),Ye(this,"HasMoreStreams",void 0),Ye(this,"NextToken",void 0),Ye(this,"StreamNames",void 0),Ye(this,"StreamSummaries",void 0),this.HasMoreStreams=t,this.NextToken=r,this.StreamNames=n,this.StreamSummaries=o}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.HasMoreStreams,n=void 0!==r&&r,o=t.NextToken,i=void 0===o?"":o,a=t.StreamNames,s=void 0===a?[]:a,c=t.StreamSummaries,u=void 0===c?[]:c;return new e(n,i,s.map((function(e){return String(e)})),u.map(nt.fromJson))}}]),e}(),nt=function(){function e(t,r,n,o,i){Ge(this,e),Ye(this,"StreamARN",void 0),Ye(this,"StreamCreationTimestamp",void 0),Ye(this,"StreamModeDetails",void 0),Ye(this,"StreamName",void 0),Ye(this,"StreamStatus",void 0),this.StreamARN=t,this.StreamCreationTimestamp=r,this.StreamModeDetails=n,this.StreamName=o,this.StreamStatus=i}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.StreamARN,n=void 0===r?"":r,o=t.StreamCreationTimestamp,i=void 0===o?0:o,a=t.StreamModeDetails,s=void 0===a?{}:a,c=t.StreamName,u=void 0===c?"":c,f=t.StreamStatus;return new e(n,i,s,u,void 0===f?"":f)}}]),e}(),ot=function(){function e(t,r,n){Ge(this,e),Ye(this,"EncryptionType",void 0),Ye(this,"FailedRecordCount",void 0),Ye(this,"Records",void 0),this.EncryptionType=t,this.FailedRecordCount=r,this.Records=n}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.EncryptionType,n=void 0===r?"NONE":r,o=t.FailedRecordCount,i=void 0===o?0:o,a=t.Records;return new e(n,i,(void 0===a?[]:a).map((function(e){return it.fromJson(e)})))}}]),e}(),it=function(){function e(t,r){Ge(this,e),Ye(this,"SequenceNumber",void 0),Ye(this,"ShardId",void 0),this.SequenceNumber=t,this.ShardId=r}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.SequenceNumber,t.ShardId)}}]),e}(),at=function(){function e(t,r){Ge(this,e),Ye(this,"NextShardIterator",void 0),Ye(this,"Records",void 0),this.NextShardIterator=t,this.Records=r}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.NextShardIterator,n=void 0===r?"":r,o=t.Records;return new e(n,(void 0===o?[]:o).map((function(e){return st.fromJson(e)})))}}]),e}(),st=function(){function e(t,r,n){Ge(this,e),Ye(this,"Data",void 0),Ye(this,"PartitionKey",void 0),Ye(this,"SequenceNumber",void 0),this.Data=t,this.PartitionKey=r,this.SequenceNumber=n}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.Data,t.PartitionKey,t.SequenceNumber)}}]),e}(),ct=function(){function e(t,r){Ge(this,e),Ye(this,"Shards",void 0),Ye(this,"NextToken",void 0),this.Shards=t,this.NextToken=r}return Ve(e,null,[{key:"fromJson",value:function(t){var r=t.Shards,n=void 0===r?[]:r,o=t.NextToken;return new e(n.map((function(e){return ut.fromJson(e)})),o)}}]),e}(),ut=function(){function e(t,r,n,o,i){Ge(this,e),Ye(this,"Id",void 0),Ye(this,"ParentShardId",void 0),Ye(this,"AdjacentParentShardId",void 0),Ye(this,"HashKeyRange",void 0),Ye(this,"SequenceNumberRange",void 0),this.Id=t,this.ParentShardId=o,this.AdjacentParentShardId=i,this.HashKeyRange=r,this.SequenceNumberRange=n}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardId,t.HashKeyRange,t.SequenceNumberRange,t.ParentShardId,t.AdjacentParentShardId)}}]),e}(),ft=function(){function e(t){Ge(this,e),Ye(this,"ShardIterator",void 0),this.ShardIterator=t}return Ve(e,null,[{key:"fromJson",value:function(t){return new e(t.ShardIterator)}}]),e}()})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map index ea018fa..3051d50 100644 --- a/build/index.js.map +++ b/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":"04BAUO,IAAMA,EAAS,WAWlB,SAAAA,EAAYC,EAAsBC,I,4FAAqBC,CAAA,KAAAH,GAAAI,EAAA,yBAAAA,EAAA,2BAAAA,EAAA,qBAAAA,EAAA,uBACnDC,KAAKJ,UAAYA,EACjBI,KAAKH,YAAcA,CACvB,C,UAiCD,O,EA/BCF,G,EAAA,EAAAM,IAAA,OAAAC,IAIA,WAII,OAHkBC,MAAdH,KAAKI,QACPJ,KAAKI,MAAQ,GAAHC,OAAML,KAAKH,YAAW,KAAAQ,OAAIL,KAAKJ,UAAUU,OAAM,KAAAD,OAAIL,KAAKJ,UAAUW,WAEvEP,KAAKI,KAChB,EAACI,IAED,SAAgBC,GACZT,KAAKI,MAAQK,CACjB,GAEE,CAAAR,IAAA,SAAAC,IAKF,WAKE,OAHoBC,MAAhBH,KAAKU,UACPV,KAAKU,QAAUV,KAAKJ,UAAUe,QAEzBX,KAAKU,OACd,EAEAF,IACA,SAAkBG,GAChBX,KAAKU,QAAUC,CACnB,M,8EAAChB,CAAA,CA/CmB,E,ytFCPf,IAAMiB,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCf,EAAA,KAAAc,GArFvCb,EAAA,sBAOAA,EA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ALnC5d,GAAA,6BAMIC,KAAKgd,cAAgBD,CACzB,CAIC,OAJA5b,GAAAwc,EAAA,OAAA1d,IAAA,WAAAmB,MAED,SAAgBmT,GACZ,OAAO,IAAIoJ,EAAyBpJ,EAAKyI,cAC7C,KAACW,CAAA,CAZyB,E","sources":["webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/./src/internal/sqs.ts","webpack://k6-jslib-aws/./node_modules/uuid/index.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/bytesToUuid.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/rng-browser.js","webpack://k6-jslib-aws/./node_modules/uuid/v1.js","webpack://k6-jslib-aws/./node_modules/uuid/v4.js","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/kms.ts","webpack://k6-jslib-aws/./src/internal/s3.ts","webpack://k6-jslib-aws/./src/internal/secrets-manager.ts","webpack://k6-jslib-aws/./src/internal/ssm.ts","webpack://k6-jslib-aws/./src/internal/kinesis.ts"],"sourcesContent":["import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","import { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { SignatureV4, InvalidSignatureError } from './signature'\nimport { HTTPHeaders, SignedHTTPRequest } from './http'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\nimport { toFormUrlEncoded } from './utils'\nimport { AWSError } from './error'\n\nconst API_VERSION = '2012-11-05'\n\nexport class SQSClient extends AWSClient {\n private readonly signature: SignatureV4\n private readonly commonHeaders: HTTPHeaders\n\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'sqs')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken\n },\n uriEscapePath: true,\n applyChecksum: true\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }\n\n /**\n * Delivers a message to the specified queue.\n *\n * @param {string} queueUrl - The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.\n * @param {string} messageBody - The message to send. The minimum size is one character. The maximum size is 256 KB.\n * @param {Object} options - Options for the request\n * @param {string} [options.messageDeduplicationId] - The message deduplication id.\n * @param {string} [options.messageGroupId] - The message group ID for FIFO queues\n * @returns {Message} - The message that was sent.\n */\n sendMessage(queueUrl: string, messageBody: string, options: { messageDeduplicationId?: string; messageGroupId?: string} = {}): Message {\n const method = 'POST'\n\n let body: any = {\n Action: 'SendMessage',\n Version: API_VERSION,\n QueueUrl: queueUrl,\n MessageBody: messageBody,\n }\n\n if (typeof(options.messageDeduplicationId) !== 'undefined') {\n body = { ...body,\n MessageDeduplicationId: options.messageDeduplicationId\n }\n }\n\n if (typeof(options.messageGroupId) !== 'undefined') {\n body = { ...body,\n MessageGroupId: options.messageGroupId\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: 'https',\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('SendMessage', res)\n\n const parsed = res.html('SendMessageResponse > SendMessageResult')\n return new Message(\n parsed.find('MessageId').text(),\n parsed.find('MD5OfMessageBody').text()\n )\n }\n\n /**\n * Returns a list of your queues in the current region.\n *\n * @param {ListQueuesRequestParameters} [parameters={}] request parameters\n * @param {number} [ListQueuesRequestParameters.maxResults] Maximum number of results to include in the response. Value range is 1 to 1000. You must set maxResults to receive a value for nextToken in the response.\n * @param {string} [ListQueuesRequestParameters.nextToken] Pagination token to request the next set of results.\n * @param {string} [ListQueuesRequestParameters.queueNamePrefix] A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * @returns {Object}\n * @returns {string[]} Object.queueUrls - A list of queue URLs, up to 1000 entries.\n * @returns {string} [Object.nextToken] - In the future, you can use NextToken to request the next set of results.\n */\n listQueues(parameters: ListQueuesRequestParameters = {}): ListQueuesResponse {\n const method = 'POST'\n\n let body: any = {\n Action: 'ListQueues',\n Version: API_VERSION,\n }\n\n if (typeof(parameters?.maxResults) !== 'undefined') {\n body = { ...body,\n MaxResults: parameters.maxResults\n }\n }\n\n if (typeof(parameters?.nextToken) !== 'undefined') {\n body = { ...body,\n NextToken: parameters.nextToken\n }\n }\n\n if (typeof(parameters?.queueNamePrefix) !== 'undefined') {\n body = { ...body,\n QueueNamePrefix: parameters.queueNamePrefix\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: 'https',\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n 'Host': this.host\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('ListQueues', res)\n\n let parsed = res.html()\n return {\n urls: parsed.find('QueueUrl').toArray().map(e => e.text()),\n nextToken: parsed.find('NextToken').text() || undefined\n }\n }\n\n private _handleError(operation: SQSOperation, response: RefinedResponse) {\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n if (errorMessage == '' && errorCode === 0) {\n return\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new SQSServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/**\n * An Amazon SQS message.\n */\nexport class Message {\n /**\n * A unique identifier for the message.\n * A MessageIdis considered unique across all AWS accounts for an extended period of time.\n */\n id: string\n\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n bodyMD5: string\n\n /**\n * Instantiates a new Message object.\n *\n * @param id\n * @param md5Ofbody\n */\n constructor(id: string, bodyMD5: string) {\n this.id = id\n this.bodyMD5 = bodyMD5\n }\n}\n\n/**\n * SQSServiceError indicates an error occurred while interacting with the SQS API.\n */\nexport class SQSServiceError extends AWSError {\n operation: SQSOperation;\n\n constructor(message: string, code: string, operation: SQSOperation) {\n super(message, code)\n this.name = 'SQSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SQSOperation describes possible SQS operations.\n */\ntype SQSOperation = 'ListQueues' | 'SendMessage'\n\nexport interface SendMessageOptions {\n /*\n * The message deduplication ID for FIFO queues\n */\n messageDeduplicationId?: string\n\n /*\n * The message group ID for FIFO queues\n */\n messageGroupId?: string\n}\n\nexport interface ListQueuesRequestParameters {\n /**\n * Maximum number of results to include in the response. Value range is 1 to 1000.\n */\n maxResults?: number\n /**\n * Pagination token to request the next set of results.\n */\n nextToken?: string\n /**\n * A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * Queue URLs and names are case-sensitive.\n */\n queueNamePrefix?: string\n}\n\nexport interface ListQueuesResponse {\n /**\n * A list of queue URLs, up to 1,000 entries, or the value of MaxResults you sent in the request.\n */\n urls: string[]\n /**\n * Pagination token to include in the next request.\n */\n nextToken?: string\n}","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","module.exports = require(\"k6/crypto\");","module.exports = require(\"k6/html\");","module.exports = require(\"k6/http\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's KMS service\n */\nexport class KMSClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a KMSClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kms')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the KMS service\n // are made via the GET or POST method.\n this.method = 'POST'\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Gets a list of all the KMS keys in the caller's AWS\n * account and region.\n *\n * @returns an array of all the available keys\n */\n listKeys(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.ListKeys`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.ListKeys, res)\n\n const json: JSONArray = res.json('Keys') as JSONArray\n return json.map((k) => KMSKey.fromJSON(k as JSONObject))\n }\n\n /**\n * GenerateDataKey returns a unique symmetric data key for use outside of AWS KMS.\n *\n * This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.\n * The bytes in the plaintext key are random; they are not related to the caller or the KMS key.\n * You can use the plaintext key to encrypt your data outside of AWS KMS and store the encrypted data key with the encrypted data.\n *\n * To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key.\n * You cannot use an asymmetric KMS key to encrypt data keys.\n *\n * Used to generate data key with the KMS key defined\n * @param {string} id - Specifies the symmetric encryption KMS key that encrypts the data key. Use its key ID, key ARN, alias name, or alias ARN.\n * @param {KMKeySize} size - Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). Default is 32, and generates a 256-bit data key.\n * @throws {KMSServiceError}\n * @throws {InvalidSignatureError}\n * @returns {KMSDataKey} - The generated data key.\n */\n generateDataKey(id: string, size: KMSKeySize = KMSKeySize.Size256): KMSDataKey | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.GenerateDataKey`,\n },\n body: JSON.stringify({ KeyId: id, NumberOfBytes: size }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.GenerateDataKey, res)\n\n return KMSDataKey.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(operation: KMSOperation, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KMSServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KMSServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a KMS key\n */\nexport class KMSKey {\n /**\n * ARN of the key\n */\n keyArn: string\n\n /**\n * Unique identifier of the key\n */\n keyId: string\n\n constructor(keyArn: string, KeyId: string) {\n this.keyArn = keyArn\n this.keyId = KeyId\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSKey(json.KeyArn as string, json.KeyId as string)\n }\n}\n\n/**\n * Class representing a data key\n */\nexport class KMSDataKey {\n /**\n * The Amazon Resource Name (key ARN) of the KMS key that encrypted the data key.\n */\n id: string\n\n /**\n * The (base64-encoded) encrypted copy of the data key.\n */\n ciphertextBlob: string\n\n /**\n * The plaintext data key.\n * Use this data key to encrypt your data outside of KMS. Then, remove it from memory as soon as possible.\n */\n plaintext: string\n\n constructor(CiphertextBlob: string, KeyId: string, Plaintext: string) {\n this.ciphertextBlob = CiphertextBlob\n this.id = KeyId\n this.plaintext = Plaintext\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSDataKey(\n json.CiphertextBlob as string,\n json.KeyId as string,\n json.Plaintext as string\n )\n }\n}\n\nexport class KMSServiceError extends AWSError {\n operation: KMSOperation\n\n /**\n * Constructs a KMSServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: KMSOperation) {\n super(message, code)\n this.name = 'KMSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * KMSOperation defines all currently implemented KMS Service operations.\n */\nenum KMSOperation {\n GenerateDataKey = 'GenerateDataKey',\n ListKeys = 'ListKeys',\n}\n\n/**\n * KMSKeyLength describes possible key lenght values for KMS API data key operations.\n */\nenum KMSKeySize {\n Size256 = 32,\n Size512 = 64,\n}\n","import { bytes } from 'k6'\nimport { parseHTML } from 'k6/html'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AWSError } from './error'\nimport { SignedHTTPRequest } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n\n/** Class allowing to interact with Amazon AWS's S3 service */\nexport class S3Client extends AWSClient {\n signature: SignatureV4\n\n /**\n * Create a S3Client\n *\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 's3')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n }\n\n /**\n * Returns a list of all buckets owned by the authenticated sender of the request.\n * To use this operation, you must have the s3:ListAllMyBuckets permission.\n *\n * @return {Array.} buckets - An array of objects describing S3 buckets\n * with the following fields: name, and creationDate.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listBuckets(): Array {\n const method = 'GET'\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListBuckets', res)\n\n let buckets: Array = []\n\n const doc = parseHTML(res.body as string)\n\n doc.find('Buckets')\n .children()\n .each((_, bucketDefinition) => {\n let bucket = {}\n\n bucketDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'name':\n Object.assign(bucket, { name: child.textContent() })\n break\n case 'creationdate':\n Object.assign(bucket, {\n creationDate: Date.parse(child.textContent()),\n })\n }\n })\n\n buckets.push(bucket as S3Bucket)\n })\n\n return buckets\n }\n\n /**\n * Returns some or all (up to 1,000) of the objects in a bucket.\n *\n * @param {string} bucketName - Bucket name to list.\n * @param {string?} prefix='' - Limits the response to keys that begin with the specified prefix.\n * @return {Array.} - returns an array of objects describing S3 objects\n * with the following fields: key, lastModified, etag, size and storageClass.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listObjects(bucketName: string, prefix?: string): Array {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/`,\n query: {\n 'list-type': '2',\n prefix: prefix || '',\n },\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListObjectsV2', res)\n\n let objects: Array = []\n\n // Extract the objects definition from\n // the XML response\n parseHTML(res.body as string)\n .find('Contents')\n .each((_, objectDefinition) => {\n let obj = {}\n\n objectDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'key':\n Object.assign(obj, { key: child.textContent() })\n break\n case 'lastmodified':\n Object.assign(obj, { lastModified: Date.parse(child.textContent()) })\n break\n case 'etag':\n Object.assign(obj, { etag: child.textContent() })\n break\n case 'size':\n Object.assign(obj, { size: parseInt(child.textContent()) })\n break\n case 'storageclass':\n Object.assign(obj, { storageClass: child.textContent() })\n }\n })\n\n objects.push(obj as S3Object)\n })\n\n return objects\n }\n /**\n * Retrieves an Object from Amazon S3.\n *\n * To use getObject, you must have `READ` access to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to get.\n * @return {S3Object} - returns the content of the fetched S3 Object.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n getObject(bucketName: string, objectKey: string): S3Object {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('GetObject', res)\n\n return new S3Object(\n objectKey,\n Date.parse(res.headers['Last-Modified']),\n res.headers['ETag'],\n parseInt(res.headers['Content-Length']),\n\n // The X-Amz-Storage-Class header is only set if the storage class is\n // not the default 'STANDARD' one.\n (res.headers['X-Amz-Storage-Class'] ?? 'STANDARD') as StorageClass,\n\n res.body\n )\n }\n /**\n * Adds an object to a bucket.\n *\n * You must have WRITE permissions on a bucket to add an object to it.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to put.\n * @param {string | ArrayBuffer} data - the content of the S3 Object to upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {\n // Prepare request\n const method = 'PUT'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {\n Host: host,\n },\n body: data,\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error('PutObject', res)\n }\n\n /**\n * Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteObject(bucketName: string, objectKey: string): void {\n // Prepare request\n const method = 'DELETE'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('DeleteObject', res)\n }\n\n /**\n * Creates a new multipart upload for a given objectKey.\n * The uploadId returned can be used to upload parts to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @return {S3MultipartUpload} - returns the uploadId of the newly created multipart upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n createMultipartUpload(bucketName: string, objectKey: string): S3MultipartUpload {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: { uploads: '' },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('CreateMultipartUpload', res)\n\n return new S3MultipartUpload(\n objectKey,\n parseHTML(res.body as string)\n .find('UploadId')\n .text()\n )\n }\n\n /**\n * Uploads a part in a multipart upload.\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @param {string} uploadId - The uploadId of the multipart upload.\n * @param {number} partNumber - The part number of the part to upload.\n * @param {string | ArrayBuffer} data - The content of the part to upload.\n * @return {S3Part} - returns the ETag of the uploaded part.\n * @throws {S3ServiceError}\n */\n uploadPart(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n partNumber: number,\n data: string | ArrayBuffer\n ): S3Part {\n // Prepare request\n const method = 'PUT'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: data,\n query: {\n partNumber: `${partNumber}`,\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('UploadPart', res)\n\n return new S3Part(partNumber, res.headers['Etag'])\n }\n\n /**\n * Completes a multipart upload by assembling previously uploaded parts.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to complete.\n * @param {S3Part[]} parts - The parts to assemble.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n completeMultipartUpload(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n parts: S3Part[]\n ) {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n const body = `${parts\n .map(\n (part) =>\n `${part.partNumber}${part.eTag}`\n )\n .join('')}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: body,\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n\n this._handle_error('CompleteMultipartUpload', res)\n }\n\n /**\n * Aborts a multipart upload.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to abort.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string) {\n // Prepare request\n const method = 'DELETE'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('AbortMultipartUpload', res)\n }\n\n _handle_error(operation: S3Operation, response: RefinedResponse) {\n const status: number = response.status\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n // We consider codes 200-299 as success\n if (status >= 200 && status < 300 && errorMessage == '' && errorCode === 0) {\n return\n }\n\n // A 301 response is returned when the bucket is not found.\n // Generally meaning that either the bucket name is wrong or the\n // region is wrong.\n //\n // See: https://github.com/grafana/k6/issues/2474\n // See: https://github.com/golang/go/issues/49281\n if (status == 301 || (errorMessage && errorMessage.startsWith('301'))) {\n throw new S3ServiceError('Resource not found', 'ResourceNotFound', operation)\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new S3ServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/** Class representing a S3 Bucket */\nexport class S3Bucket {\n name: string\n creationDate: Date\n\n /**\n * Create an S3 Bucket\n *\n * @param {string} name - S3 bucket's name\n * @param {Date} creationDate - S3 bucket's creation date\n */\n constructor(name: string, creationDate: Date) {\n this.name = name\n this.creationDate = creationDate\n }\n}\n\n/** Class representing an S3 Object */\nexport class S3Object {\n key: string\n lastModified: number\n etag: string\n size: number\n storageClass: StorageClass\n data?: string | bytes | null\n\n /**\n * Create an S3 Object\n *\n * @param {string} key - S3 object's key\n * @param {Date} lastModified - S3 object last modification date\n * @param {string} etag - S3 object's etag\n * @param {number} size - S3 object's size\n * @param {StorageClass} storageClass - S3 object's storage class\n * @param {string | bytes | null} data=null - S3 Object's data\n */\n constructor(\n key: string,\n lastModified: number,\n etag: string,\n size: number,\n storageClass: StorageClass,\n data?: string | bytes | null\n ) {\n this.key = key\n this.lastModified = lastModified\n this.etag = etag\n this.size = size\n this.storageClass = storageClass\n this.data = data\n }\n}\n\n/** Class representing a S3 Multipart Upload */\nexport class S3MultipartUpload {\n key: string\n uploadId: string\n\n /**\n * Create an S3 Multipart Upload\n * @param {string} key - S3 object's key\n * @param {string} uploadId - S3 multipart upload id\n */\n\n constructor(key: string, uploadId: string) {\n this.key = key\n this.uploadId = uploadId\n }\n}\n\n/** Class representing a S3 Part */\nexport class S3Part {\n partNumber: number\n eTag: string\n\n /**\n * Create an S3 Part\n * @param {number} partNumber - Part number\n * @param {string} eTag - Part's etag\n */\n\n constructor(partNumber: number, eTag: string) {\n this.partNumber = partNumber\n this.eTag = eTag\n }\n}\n\n/**\n * Error indicating a S3 operation failed\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class S3ServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a S3ServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'S3ServiceError'\n this.operation = operation\n }\n}\n\n/**\n * S3Operation describes possible values for S3 API operations,\n * as defined by AWS APIs.\n */\ntype S3Operation =\n | 'ListBuckets'\n | 'ListObjectsV2'\n | 'GetObject'\n | 'PutObject'\n | 'DeleteObject'\n | 'CreateMultipartUpload'\n | 'CompleteMultipartUpload'\n | 'UploadPart'\n | 'AbortMultipartUpload'\n\n/**\n * Describes the class of storage used to store a S3 object.\n */\ntype StorageClass =\n | 'STANDARD'\n | 'REDUCED_REDUNDANCY'\n | 'GLACIER'\n | 'STANDARD_IA'\n | 'INTELLIGENT_TIERING'\n | 'DEEP_ARCHIVE'\n | 'OUTPOSTS'\n | 'GLACIER_IR'\n | undefined\n","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's SecretsManager service\n */\nexport class SecretsManagerClient extends AWSClient {\n /**\n * HTTP Method to use when interacting with the Secrets Manager service.\n */\n method: HTTPMethod\n\n /**\n * HTTP headers to use accross all requests to the Secrets Manager service.\n */\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a SecretsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'secretsmanager')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the Secrets Manager service\n // are made via the GET or POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Returns a list of all secrets owned by the authenticated sender of the request.\n * To use this operation, you must have the secretsmanager:ListSecrets permission.\n *\n * @return {Array.} secrets - An array of objects describing Secret Manager's secrets\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n listSecrets(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.ListSecrets`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.ListSecrets, res)\n const json: JSONArray = res.json('SecretList') as JSONArray\n\n return json.map((s) => Secret.fromJSON(s as JSONObject))\n }\n\n /**\n * Retrieves a secret from Amazon Sercets Manager\n *\n * @param {string} id - The ARN or name of the secret to retrieve.\n * @returns {Secret} - returns the content of the fetched Secret object.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getSecret(id: string): Secret | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.GetSecretValue`,\n },\n body: JSON.stringify({ SecretId: id }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(SecretsManagerOperation.GetSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Creates a new secret\n *\n * Note that this method only supports string-based values at the moment.\n *\n * @param {string} name - The name of the new secret.\n * The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {string} description - The description of the secret.\n * @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * algorithm.\n * @param {Array.} tags=[] - A list of tags to attach to the secret. Each tag is a key and\n * value pair of strings in a JSON text string. Note that tag key names are case sensitive.\n * @returns {Secret} - returns the created secret\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n createSecret(\n name: string,\n secret: string,\n description: string,\n versionID?: string,\n tags?: Array\n ): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.CreateSecret`,\n },\n body: JSON.stringify({\n Name: name,\n Description: description,\n SecretString: secret,\n ClientRequestToken: versionID,\n Tags: tags,\n }),\n },\n {}\n )\n\n // Ensure to include the desired 'Action' in the X-Amz-Target\n // header field, as documented by the AWS API docs.\n // headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.CreateSecret, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n /**\n * Update a secret's value.\n *\n * Note that this method only support string-based values at the moment.\n *\n * @param {string} id - The ARN or name of the secret to update.\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n putSecretValue(id: string, secret: string, versionID?: string): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.PutSecretValue`,\n },\n body: JSON.stringify({\n SecretId: id,\n SecretString: secret,\n ClientRequestToken: versionID,\n }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.PutSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Deletes a secret and all of its versions.\n *\n * You can specify a recovery window during which you can restore the secret.\n * The minimum recovery window is 7 days. The default recovery window is 30 days.\n *\n * @param {string} secretID - The ARN or name of the secret to delete.\n * @param {number} recoveryWindow - The number of days from 7 to 30 that Secrets Manager\n * waits before permanently deleting the secret.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteSecret(\n id: string,\n { recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }\n ) {\n const payload: { [key: string]: string | boolean | number } = {\n SecretId: id,\n }\n\n // noRecovery and recoveryWindow are exclusive parameters\n if (noRecovery === true) {\n payload['ForceDeleteWithoutRecovery'] = true\n } else {\n payload['RecoveryWindowInDays'] = recoveryWindow\n }\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.DeleteSecret`,\n },\n body: JSON.stringify(payload),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.DeleteSecret, res)\n }\n\n _handle_error(\n operation: SecretsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SecretsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SecretsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n// TODO: create a Tags type\n\n/**\n * Class representing a Secret Manager's secret\n */\nexport class Secret {\n name: string\n arn: string\n secret: string\n createdDate: number\n lastAccessedDate: number\n lastChangedDate: number\n tags: Array<{ [key: string]: string }>\n\n /**\n * Constructs a Secret Manager's Secret\n *\n * @param {string} name - The friendly name of the secret.\n * @param {string} arn - The ARN of the secret.\n * @param {number} createdDate - The date and time that this version of the secret was created.\n * @param {number} lastAccessedDate - The last date that this secret was accessed. This value is\n * truncated to midnight of the date and therefore shows only the date, not the time.\n * @param {number} lastChangedDate - The last date and time that this secret was modified in any way.\n * @param {Array.} tags - The list of user-defined tags associated with the secret.\n */\n constructor(\n name: string,\n arn: string,\n secretString: string,\n createdDate: number,\n lastAccessedDate: number,\n lastChangedDate: number,\n tags: Array<{ [key: string]: string }> = []\n ) {\n this.name = name\n this.arn = arn\n this.secret = secretString\n this.createdDate = createdDate\n this.lastAccessedDate = lastAccessedDate\n this.lastChangedDate = lastChangedDate\n this.tags = tags\n }\n\n /**\n * Parses and constructs a Secret Manager's Secret from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {Secret}\n */\n static fromJSON(json: JSONObject) {\n return new Secret(\n json.Name as string,\n json.ARN as string,\n json.SecretString as string,\n json.CreatedDate as number,\n json.LastAccessedDate as number,\n json.LastChangedDate as number,\n json.Tags as Array<{ [key: string]: string }>\n )\n }\n}\n\nexport class SecretsManagerServiceError extends AWSError {\n operation: SecretsManagerOperation\n\n /**\n * Constructs a SecretsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SecretsManagerOperation) {\n super(message, code)\n this.name = 'SecretsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SecretsManagerOperation defines all currently implemented Secrets Manager Service operations.\n */\nenum SecretsManagerOperation {\n ListSecrets = 'ListSecrets',\n GetSecretValue = 'GetSecretValue',\n CreateSecret = 'CreateSecret',\n PutSecretValue = 'PutSecretValue',\n DeleteSecret = 'DeleteSecret',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's Systems Manager service\n */\nexport class SystemsManagerClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n signature: SignatureV4\n\n /**\n * Create a SystemsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'ssm')\n\n // All interactions with the Systems Manager service\n // are made via the POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n }\n\n /**\n * Retrieves a parameter from Amazon Systems Manager\n *\n * @param {string} name - The ARN or name of the parameter to retrieve.\n * @param {boolean} withDecryption - whether returned secure string parameters should be decrypted.\n * @returns {SystemsManagerParameter} - returns the fetched Parameter object.\n * @throws {SystemsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getParameter(\n name: string,\n withDecryption: boolean = false\n ): SystemsManagerParameter | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `AmazonSSM.GetParameter`,\n },\n body: JSON.stringify({ Name: name, WithDecryption: withDecryption }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SystemsManagerOperation.GetParameter, res)\n\n return SystemsManagerParameter.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(\n operation: SystemsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SystemsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SystemsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a Systems Manager's Parameter\n */\nexport class SystemsManagerParameter {\n /**\n * The Amazon Resource Name (ARN) of the parameter.\n */\n arn: string\n\n /**\n * The data type of the parameter, such as text or aws:ec2:image.\n * The default is text.\n */\n dataType: string\n\n /**\n * Date the parameter was last changed or updated and the parameter version was created.\n */\n lastModifiedDate: number\n\n /**\n * The friendly name of the parameter.\n */\n name: string\n\n /**\n * Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n */\n selector: string\n\n /**\n * plies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n */\n sourceResult: string\n\n /**\n * The type of parameter. Valid values include the following: String, StringList, and SecureString.\n */\n type: string\n\n /**\n * The parameter value.\n */\n value: string\n\n /**\n * The parameter version.\n */\n version: number\n\n /**\n * Constructs a Systems Manager's Parameter\n *\n * @param {string} arn - The Amazon Resource Name (ARN) of the parameter.\n * @param {string} dataType - The data type of the parameter, such as text or aws:ec2:image. The default is text.\n * @param {number} lastModifiedDate - Date the parameter was last changed or updated and the parameter version was created.\n * @param {string} name - The friendly name of the parameter.\n * @param {string} selector - Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n * @param {string} sourceResult - Applies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n * @param {string} type - The type of parameter. Valid values include the following: String, StringList, and SecureString.\n * @param {string} value - The parameter value.\n * @param {number} version - The parameter version.\n */\n constructor(\n arn: string,\n dataType: string,\n lastModifiedDate: number,\n name: string,\n selector: string,\n sourceResult: string,\n type: string,\n value: string,\n version: number\n ) {\n this.arn = arn\n this.dataType = dataType\n this.lastModifiedDate = lastModifiedDate\n this.name = name\n this.selector = selector\n this.sourceResult = sourceResult\n this.type = type\n this.value = value\n this.version = version\n }\n\n /**\n * Parses and constructs a Systems Manager's Parameter from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {SystemsManagerParameter}\n */\n static fromJSON(json: JSONObject): SystemsManagerParameter {\n const parameter = json.Parameter as JSONObject\n\n return new SystemsManagerParameter(\n parameter.ARN as string,\n parameter.DataType as string,\n parameter.LastModifiedDate as number,\n parameter.Name as string,\n parameter.Selector as string,\n parameter.SourceResult as string,\n parameter.Type as string,\n parameter.Value as string,\n parameter.Version as number\n )\n }\n}\n\nexport class SystemsManagerServiceError extends AWSError {\n operation: SystemsManagerOperation\n\n /**\n * Constructs a SystemsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {SystemsManagerOperation} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SystemsManagerOperation) {\n super(message, code)\n this.name = 'SystemsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SystemsManagerOperation defines all currently implemented Systems Manager operations.\n */\nenum SystemsManagerOperation {\n GetParameter = 'GetParameter',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\n\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\nThis API is based on\nhttps://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html\n*/\n\n/**\n * Allows interacting with the Kinesis API.\n */\nexport class KinesisClient extends AWSClient {\n /**\n * The SignatureV4 object used to sign requests.\n */\n signature: SignatureV4\n\n /**\n * The common headers that are used for all requests.\n */\n commonHeaders: HTTPHeaders\n\n /**\n * The version of the Kinesis API that is used for all requests.\n */\n serviceVersion: string\n\n /**\n * A constructor function that creates a new instance of the Kinesis class.\n * @param {AWSConfig} awsConfig - AWSConfig - This is the configuration object that is passed to\n * the constructor.\n * @returns A Proxy object.\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kinesis')\n\n this.serviceVersion = 'Kinesis_20131202'\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Creates a new Kinesis stream with the specified name and options.\n *\n * @param {string} streamName - The name of the stream to create.\n * @param {{\n * shardCount?: number;\n * streamModeDetails?: {\n * streamMode: StreamMode;\n * };\n * }} [options={}] - An optional object containing configuration options for the stream.\n * @param {number} [options.shardCount] - The number of shards for the stream. If not provided, the default value will be used.\n * @param {{streamMode: StreamMode}} [options.streamModeDetails] - An optional object containing the stream mode details.\n * @param {StreamMode} [options.streamModeDetails.streamMode] - The mode of the stream. If not provided, the default mode will be used.\n *\n * @throws {Error} Throws an error if the stream creation request fails.\n * @returns {void}\n */\n createStream(\n streamName: string,\n options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(options.shardCount && { ShardCount: options.shardCount }),\n ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }),\n }\n\n this._send_request('CreateStream', body)\n }\n\n /**\n * Deletes a Kinesis stream with the specified parameters.\n *\n * @param {string} streamName - The name of the stream to delete.\n * @param {{\n * streamARN?: string;\n * enforceConsumerDeletion?: boolean;\n * }} [parameters={}] - An optional object containing configuration options for the stream deletion.\n * @param {string} [parameters.streamARN] - The Amazon Resource Name (ARN) of the stream. If not provided, the ARN will be derived from the stream name.\n * @param {boolean} [parameters.enforceConsumerDeletion] - Whether to enforce the deletion of all registered consumers before deleting the stream. Defaults to false.\n *\n * @throws {Error} Throws an error if the stream deletion request fails.\n * @returns {void}\n */\n deleteStream(\n streamName: string,\n parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n ...(parameters.enforceConsumerDeletion && {\n EnforceConsumerDeletion: parameters.enforceConsumerDeletion,\n }),\n }\n\n this._send_request('DeleteStream', body)\n }\n\n /**\n * Returns a list of Kinesis streams with the specified parameters.\n *\n * @param {{\n * exclusiveStartStreamName?: string;\n * limit?: number;\n * nextToken?: string;\n * }} [parameters={}] - An optional object containing configuration options for listing the streams.\n * @param {string} [parameters.exclusiveStartStreamName] - The name of the stream to start listing from. If not provided, the listing starts from the beginning.\n * @param {number} [parameters.limit] - The maximum number of streams to list. If not provided, the default value will be used.\n * @param {string} [parameters.nextToken] - A token to paginate the list of streams. If not provided, the first page will be returned.\n *\n * @throws {Error} Throws an error if the list streams request fails.\n * @returns {Partial} A partial of the ListStreamsResponse class.\n */\n listStreams(\n parameters: {\n exclusiveStartStreamName?: string\n limit?: number\n nextToken?: string\n } = {}\n ): ListStreamsResponse {\n const body: any = {\n ...(parameters.exclusiveStartStreamName && {\n ExclusiveStartStreamName: parameters.exclusiveStartStreamName,\n }),\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n }\n\n const res = this._send_request('ListStreams', body)\n return ListStreamsResponse.fromJson(res?.json())\n }\n\n /**\n * Sends multiple records to a Kinesis stream in a single request.\n *\n * @param {string} streamName - The name of the stream to put records into.\n * @param {PutRecordsRequestEntry[]} records - An array of records to put into the stream.\n *\n * @throws {Error} Throws an error if the put records request fails.\n * @returns {Partial} A partial of the PutRecordsResponse class.\n */\n putRecords(\n records: PutRecordsRequestEntry[],\n parameters: { streamName?: string; streamARN?: string } = {}\n ): PutRecordsResponse {\n if (!parameters.streamName && !parameters.streamARN) {\n throw new Error('Either streamName or streamARN must be provided')\n }\n\n const body: any = {\n Records: records,\n ...(parameters.streamName && { StreamName: parameters.streamName }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('PutRecords', body)\n return PutRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves records from a Kinesis stream.\n *\n * @param {string} shardIterator - The shard iterator to start retrieving records from.\n * @param {number} [limit] - The maximum number of records to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the get records request fails.\n * @returns {Partial} A partial of the GetRecordsResponse class.\n */\n getRecords(\n shardIterator: string,\n parameters: { limit?: number; streamARN?: string } = {}\n ): GetRecordsResponse {\n const body: any = {\n ShardIterator: shardIterator,\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('GetRecords', body)\n return GetRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Lists the shards in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream to list shards from.\n * @param {{\n * nextToken?: string;\n * maxResults?: number;\n * }} [parameters={}] - An optional object containing configuration options for listing shards.\n * @param {string} [parameters.nextToken] - A token to specify where to start paginating the shard list. If not provided, the first page will be returned.\n * @param {number} [parameters.maxResults] - The maximum number of shards to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the list shards request fails.\n * @returns {ListShardsResponse} A ListShardsResponse class instance.\n */\n listShards(\n streamName: string,\n parameters: { nextToken?: string; maxResults?: number } = {}\n ): ListShardsResponse {\n const body: any = {\n StreamName: streamName,\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n ...(parameters.maxResults && {\n MaxResults: parameters.maxResults,\n }),\n }\n\n const res = this._send_request('ListShards', body)\n return ListShardsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves a shard iterator for the specified shard in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream.\n * @param {string} shardId - The shard ID for which to get the iterator.\n * @param {string} shardIteratorType - The shard iterator type. One of 'AT_SEQUENCE_NUMBER', 'AFTER_SEQUENCE_NUMBER', 'TRIM_HORIZON', 'LATEST', or 'AT_TIMESTAMP'.\n * @param {{\n * startingSequenceNumber?: string;\n * timestamp?: number;\n * }} [parameters={}] - An optional object containing configuration options for the shard iterator.\n * @param {string} [parameters.startingSequenceNumber] - The sequence number to start with when using 'AT_SEQUENCE_NUMBER' or 'AFTER_SEQUENCE_NUMBER' iterator types.\n * @param {number} [parameters.timestamp] - The timestamp to start with when using the 'AT_TIMESTAMP' iterator type.\n *\n * @throws {Error} Throws an error if the get shard iterator request fails.\n * @returns {string} The next position in the shard from which to start sequentially reading data records. If set to null, the shard has been closed and the requested iterator does not return any more data.\n */\n getShardIterator(\n streamName: string,\n shardId: string,\n shardIteratorType: ShardIteratorKind,\n parameters: { startingSequenceNumber?: string; timestamp?: number } = {}\n ): GetShardIteratorResponse {\n const body: any = {\n StreamName: streamName,\n ShardId: shardId,\n ShardIteratorType: shardIteratorType,\n ...(parameters.startingSequenceNumber && {\n StartingSequenceNumber: parameters.startingSequenceNumber,\n }),\n ...(parameters.timestamp && { Timestamp: parameters.timestamp }),\n }\n\n const res = this._send_request('GetShardIterator', body)\n return GetShardIteratorResponse.fromJson(res?.json())\n }\n\n private _send_request(action: string, body: any): any {\n const signedRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceVersion}.${action}`,\n },\n body: JSON.stringify(body),\n },\n {}\n )\n\n const res = http.request('POST', signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(action, res)\n return res\n }\n\n /**\n * If the response is an error, throw an error\n *\n * @param {string} operation - The name of the operation that was called.\n * @param response - RefinedResponse\n * @returns The response is being returned.\n */\n _handle_error(operation: string, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KinesisServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KinesisServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/* `KinesisServiceError` is a subclass of `AWSError` that adds an `operation` property */\nexport class KinesisServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a KinesisServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'KinesisServiceError'\n this.operation = operation\n }\n}\n\n/**\n * Describes the options for a Kinesis stream.\n */\ntype StreamMode = 'PROVISIONED' | 'ON_DEMAND'\n\n/**\n * Determines how the shard iterator is used to start reading data records from the shard.\n */\nexport type ShardIteratorKind =\n | 'AT_SEQUENCE_NUMBER'\n | 'AFTER_SEQUENCE_NUMBER'\n | 'TRIM_HORIZON'\n | 'LATEST'\n | 'AT_TIMESTAMP'\n\n/**\n * Describes the status of a Kinesis data stream.\n */\nexport type StreamStatus = 'CREATING' | 'DELETING' | 'ACTIVE' | 'UPDATING'\n\nexport type StreamModeDetails = {\n /**\n * Specifies the capacity mode to which you want to set your data stream.\n */\n SteamMode: 'PROVISIONED' | 'ON_DEMAND'\n}\n\nexport class ListStreamsResponse {\n /**\n * Indicates whether there are more streams available to list.\n */\n HasMoreStreams: boolean\n\n /**\n * The token that identifies which batch of results you can retrieve.\n */\n NextToken?: string\n\n /**\n * The names of the streams that are associated with the AWS account making the ListStreams request.\n */\n StreamNames: string[]\n\n /**\n * A list of StreamSummary objects.\n */\n StreamSummaries: StreamSummary[]\n\n constructor(\n HasMoreStreams: boolean,\n NextToken: string,\n StreamNames: string[],\n StreamSummaries: StreamSummary[]\n ) {\n this.HasMoreStreams = HasMoreStreams\n this.NextToken = NextToken\n this.StreamNames = StreamNames\n this.StreamSummaries = StreamSummaries\n }\n\n static fromJson(result: any): ListStreamsResponse {\n const {\n HasMoreStreams = false,\n NextToken = '',\n StreamNames = [],\n StreamSummaries = [],\n } = result\n\n return new ListStreamsResponse(\n HasMoreStreams,\n NextToken,\n StreamNames.map((s: any) => String(s)),\n StreamSummaries.map(StreamSummary.fromJson)\n )\n }\n}\n\n/**\n * Summarizes a Stream\n */\nexport class StreamSummary {\n /**\n * The Amazon Resource Name (ARN) for the stream.\n */\n StreamARN: string\n\n /**\n * The time at which the stream was created.\n */\n StreamCreationTimestamp: number\n\n /**\n * Specify the capacity mode to which you want to set your data stream.\n */\n StreamModeDetails: StreamModeDetails\n\n /**\n * The name of the stream.\n */\n StreamName: string\n\n /**\n * The current status of the stream being described.\n */\n StreamStatus: StreamStatus\n\n constructor(\n StreamARN: string,\n StreamCreationTimestamp: number,\n StreamMode: StreamModeDetails,\n StreamName: string,\n StreamStatus: StreamStatus\n ) {\n this.StreamARN = StreamARN\n this.StreamCreationTimestamp = StreamCreationTimestamp\n this.StreamModeDetails = StreamMode\n this.StreamName = StreamName\n this.StreamStatus = StreamStatus\n }\n\n static fromJson(summary: any): StreamSummary {\n const {\n StreamARN = '',\n StreamCreationTimestamp = 0,\n StreamModeDetails = {},\n StreamName = '',\n StreamStatus = '',\n } = summary\n\n return new StreamSummary(\n StreamARN,\n StreamCreationTimestamp,\n StreamModeDetails,\n StreamName,\n StreamStatus\n )\n }\n}\n\n/**\n * Represents the output for PutRecords.\n */\nexport interface PutRecordsRequestEntry {\n /**\n * The data blob to put into the record, which is base64-encoded when the blob is serialized.\n */\n Data: string | ArrayBuffer\n\n /**\n * Datemines which share in the stream the data record is assigned to.\n */\n PartitionKey: string\n}\n\n// Response class for PutRecords API\nexport class PutRecordsResponse {\n /**\n * The encryption type used on the records. This parameter can be one of the following values:\n * - NONE: Do not encrypt the records.\n * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key.\n */\n EncryptionType: 'NONE' | 'KMS'\n\n /**\n * The number of unsuccessfully processed records in a PutRecords request.\n */\n FailedRecordCount: number\n\n /**\n * An array of succesffully and unsuccessfully processed record results.\n */\n Records: PutRecordsResultEntry[]\n\n constructor(\n encryptionType: 'NONE' | 'KMS',\n failedRecordCount: number,\n records: PutRecordsResultEntry[]\n ) {\n this.EncryptionType = encryptionType\n this.FailedRecordCount = failedRecordCount\n this.Records = records\n }\n\n static fromJson(json: any): PutRecordsResponse {\n const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json\n const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record))\n\n return new PutRecordsResponse(EncryptionType, FailedRecordCount, records)\n }\n}\n\n/**\n * Represents the result of an individual record from a PutRecords request.\n */\nexport class PutRecordsResultEntry {\n /**\n * The sequence number for an individual record result.\n */\n SequenceNumber: string\n\n /**\n * The shard ID for an individual record result.\n */\n ShardId: string\n\n constructor(sequenceNumber: string, shardId: string) {\n this.SequenceNumber = sequenceNumber\n this.ShardId = shardId\n }\n\n static fromJson(json: any): PutRecordsResultEntry {\n return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId)\n }\n}\n\n/**\n * Represents the response format of the GetRecords operation.\n */\nexport class GetRecordsResponse {\n /**\n * The next position in the shard from which to start sequentially reading data records.\n */\n NextShardIterator: string\n\n /**\n * The data records retrieved from the shard.\n */\n Records: Record[]\n\n constructor(nextShardIterator: string, records: Record[]) {\n this.NextShardIterator = nextShardIterator\n this.Records = records\n }\n\n static fromJson(json: any): GetRecordsResponse {\n const { NextShardIterator = '', Records = [] } = json\n const records = Records.map((record: Record) => Record.fromJson(record))\n\n return new GetRecordsResponse(NextShardIterator, records)\n }\n}\n\n/**\n * The unit of data of the Kinesis data stream, which is composed of a sequence\n * number, a partition key, and a data blob.\n */\nclass Record {\n /**\n * The data blob.\n */\n Data: string | ArrayBuffer\n\n /**\n * Identifies which shard in the stream the data record is assigned to.\n */\n PartitionKey: string\n\n /**\n * The unique identifier of the record in the stream.\n */\n SequenceNumber: string\n\n constructor(data: string | ArrayBuffer, partitionKey: string, sequenceNumber: string) {\n this.Data = data\n this.PartitionKey = partitionKey\n this.SequenceNumber = sequenceNumber\n }\n\n static fromJson(json: any): Record {\n return new Record(json.Data, json.PartitionKey, json.SequenceNumber)\n }\n}\n\n// Response class for ListShards API\nexport class ListShardsResponse {\n /**\n * An array of JSON objects.\n *\n * Each object represents one shard and specifies the IDs of the shard, the\n * shard's parent, and the shard that's adjacent to the shard's parent.\n */\n Shards: Shard[]\n\n /**\n * When the number of shards in the data stream is greater than the\n * default value for the MaxResults parameter, or if you explicitly specify\n * a value for MaxResults that is less than the number of shards in the data\n * stream, the response includes a pagination token named NextToken.\n */\n NextToken?: string\n\n constructor(shards: Shard[], nextToken?: string) {\n this.Shards = shards\n this.NextToken = nextToken\n }\n\n static fromJson(json: any): ListShardsResponse {\n const { Shards = [], NextToken } = json\n const shards = Shards.map((shard: Shard) => Shard.fromJson(shard))\n\n return new ListShardsResponse(shards, NextToken)\n }\n}\n\n/**\n * A uniquely identified group of data records in a Kinesis data stream.\n */\nexport class Shard {\n /**\n * The unique identifier of the shard within the stream.\n */\n Id: string\n\n /**\n * The shard ID of the shard's parent.\n */\n ParentShardId?: string\n\n /**\n * The shard ID of the shard adjacent to the shard's parent.\n */\n AdjacentParentShardId?: string\n\n /**\n * The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.\n */\n HashKeyRange: HashKeyRange\n\n SequenceNumberRange: SequenceNumberRange\n\n constructor(\n id: string,\n hashKeyRange: HashKeyRange,\n sequenceNumberRange: SequenceNumberRange,\n parentShardId?: string,\n adjacentParentShardId?: string\n ) {\n this.Id = id\n this.ParentShardId = parentShardId\n this.AdjacentParentShardId = adjacentParentShardId\n this.HashKeyRange = hashKeyRange\n this.SequenceNumberRange = sequenceNumberRange\n }\n\n static fromJson(json: any): Shard {\n return new Shard(\n json.ShardId,\n json.HashKeyRange,\n json.SequenceNumberRange,\n json.ParentShardId,\n json.AdjacentParentShardId\n )\n }\n}\n\n/**\n * Describes the range of possible hash key values for the shard, which is\n * a set of ordered contiguous positive integers.\n */\nexport interface HashKeyRange {\n /**\n * The starting hash key of the hash key range.\n */\n StartingHashKey: string\n\n /**\n * The ending hash key of the hash key range.\n */\n EndingHashKey: string\n}\n\n/**\n * The range of possible sequence numbers for the shard.\n */\nexport interface SequenceNumberRange {\n /**\n * The ending sequence number for the range.\n *\n * Shards that are in the OPEN state have an ending sequence number of null.\n */\n EndingSequenceNumber?: string\n\n /**\n * The starting sequence number for the range.\n */\n StartingSequenceNumber: string\n}\n\n/**\n * Describes a shard iterator response.\n */\nclass GetShardIteratorResponse {\n /**\n * The position in the shard from which to start reading data records sequentially.\n */\n ShardIterator: string\n\n constructor(shardIterator: string) {\n this.ShardIterator = shardIterator\n }\n\n static fromJson(json: any): GetShardIteratorResponse {\n return new GetShardIteratorResponse(json.ShardIterator)\n }\n}\n"],"names":["AWSClient","awsConfig","serviceName","_classCallCheck","_defineProperty","this","key","get","undefined","_host","concat","region","endpoint","set","host","_scheme","scheme","AWSConfig","options","InvalidAWSConfigError","accessKeyId","length","secretAccessKey","sessionToken","_createClass","value","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","call","_wrapNativeSuper","Error","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","MAX_PRESIGNED_TTL","EMPTY_SHA256","UNSIGNED_PAYLOAD","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","hasHeader","soughtHeader","headers","_i","_Object$keys","Object","keys","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","hostname","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","isArrayBuffer","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","prototype","toFormUrlEncoded","form","params","API_VERSION","SQSClient","_AWSClient","commonHeaders","queueUrl","messageBody","Action","Version","QueueUrl","MessageBody","messageDeduplicationId","MessageDeduplicationId","messageGroupId","MessageGroupId","signedRequest","sign","res","http","_handleError","parsed","html","Message","parameters","maxResults","MaxResults","nextToken","NextToken","queueNamePrefix","QueueNamePrefix","urls","toArray","operation","response","errorCode","error_code","error","awsError","SQSServiceError","id","bodyMD5","_super2","_this2","v1","v4","uuid","module","exports","byteToHex","i","substr","buf","offset","bth","getRandomValues","bind","window","msCrypto","rnds8","Uint8Array","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","b","node","clockseq","seedBytes","msecs","getTime","nsecs","dt","tl","tmh","ii","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","KMSClient","_handle_error","KMSOperation","ListKeys","json","k","KMSKey","fromJSON","size","KMSKeySize","Size256","KeyId","NumberOfBytes","GenerateDataKey","KMSDataKey","errorMessage","__type","KMSServiceError","keyArn","keyId","KeyArn","CiphertextBlob","Plaintext","ciphertextBlob","plaintext","S3Client","buckets","children","each","_","bucketDefinition","bucket","forEach","child","nodeName","assign","textContent","creationDate","bucketName","prefix","objects","objectDefinition","lastModified","etag","parseInt","storageClass","objectKey","_res$headers$XAmzSt","S3Object","data","Host","uploads","S3MultipartUpload","uploadId","partNumber","S3Part","parts","part","eTag","status","S3ServiceError","S3Bucket","SecretsManagerClient","SecretsManagerOperation","ListSecrets","Secret","SecretId","GetSecretValue","secret","description","versionID","tags","uuidv4","Name","Description","SecretString","ClientRequestToken","Tags","CreateSecret","PutSecretValue","_ref$recoveryWindow","recoveryWindow","_ref$noRecovery","noRecovery","payload","DeleteSecret","SecretsManagerServiceError","arn","secretString","createdDate","lastAccessedDate","lastChangedDate","ARN","CreatedDate","LastAccessedDate","LastChangedDate","SystemsManagerClient","withDecryption","WithDecryption","SystemsManagerOperation","GetParameter","SystemsManagerParameter","SystemsManagerServiceError","dataType","lastModifiedDate","selector","sourceResult","type","version","parameter","Parameter","DataType","LastModifiedDate","Selector","SourceResult","Type","Value","KinesisClient","serviceVersion","streamName","StreamName","shardCount","ShardCount","streamModeDetails","StreamMode","streamMode","_send_request","streamARN","StreamARN","enforceConsumerDeletion","EnforceConsumerDeletion","exclusiveStartStreamName","ExclusiveStartStreamName","limit","Limit","ListStreamsResponse","fromJson","records","Records","PutRecordsResponse","shardIterator","ShardIterator","GetRecordsResponse","ListShardsResponse","shardId","shardIteratorType","ShardId","ShardIteratorType","startingSequenceNumber","StartingSequenceNumber","timestamp","Timestamp","GetShardIteratorResponse","action","KinesisServiceError","HasMoreStreams","StreamNames","StreamSummaries","result","_result$HasMoreStream","_result$NextToken","_result$StreamNames","_result$StreamSummari","String","StreamSummary","StreamCreationTimestamp","StreamStatus","StreamModeDetails","summary","_summary$StreamARN","_summary$StreamCreati","_summary$StreamModeDe","_summary$StreamName","_summary$StreamStatus","encryptionType","failedRecordCount","EncryptionType","FailedRecordCount","_json$EncryptionType","_json$FailedRecordCou","_json$Records","record","PutRecordsResultEntry","sequenceNumber","SequenceNumber","nextShardIterator","NextShardIterator","_json$NextShardIterat","_json$Records2","Record","partitionKey","Data","PartitionKey","shards","Shards","_json$Shards","shard","Shard","hashKeyRange","sequenceNumberRange","parentShardId","adjacentParentShardId","Id","ParentShardId","AdjacentParentShardId","HashKeyRange","SequenceNumberRange"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":"04BAUO,IAAMA,EAAS,WAWlB,SAAAA,EAAYC,EAAsBC,I,4FAAqBC,CAAA,KAAAH,GAAAI,EAAA,yBAAAA,EAAA,2BAAAA,EAAA,qBAAAA,EAAA,uBACnDC,KAAKJ,UAAYA,EACjBI,KAAKH,YAAcA,CACvB,C,UAiCD,O,EA/BCF,G,EAAA,EAAAM,IAAA,OAAAC,IAIA,WAII,OAHkBC,MAAdH,KAAKI,QACPJ,KAAKI,MAAQ,GAAHC,OAAML,KAAKH,YAAW,KAAAQ,OAAIL,KAAKJ,UAAUU,OAAM,KAAAD,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4BAAAA,GAAA,mCAcIC,KAAK+gB,GAAK9Q,EACVjQ,KAAKghB,cAAgBH,EACrB7gB,KAAKihB,sBAAwBH,EAC7B9gB,KAAKkhB,aAAeP,EACpB3gB,KAAKmhB,oBAAsBP,CAC/B,CAUC,OAVAhc,GAAA8b,EAAA,OAAAzgB,IAAA,WAAAqD,MAED,SAAgBmR,GACZ,OAAO,IAAIiM,EACPjM,EAAK8I,QACL9I,EAAKyM,aACLzM,EAAK0M,oBACL1M,EAAKuM,cACLvM,EAAKwM,sBAEb,KAACP,CAAA,CA7Ca,GAoFZ7C,GAAwB,WAM1B,SAAAA,EAAYZ,GAAuBnd,GAAA,KAAA+d,GALnC9d,GAAA,6BAMIC,KAAKkd,cAAgBD,CACzB,CAIC,OAJArY,GAAAiZ,EAAA,OAAA5d,IAAA,WAAAqD,MAED,SAAgBmR,GACZ,OAAO,IAAIoJ,EAAyBpJ,EAAKyI,cAC7C,KAACW,CAAA,CAZyB,E","sources":["webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/./src/internal/sqs.ts","webpack://k6-jslib-aws/./node_modules/uuid/index.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/bytesToUuid.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/rng-browser.js","webpack://k6-jslib-aws/./node_modules/uuid/v1.js","webpack://k6-jslib-aws/./node_modules/uuid/v4.js","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/./src/internal/kms.ts","webpack://k6-jslib-aws/./src/internal/s3.ts","webpack://k6-jslib-aws/./src/internal/secrets-manager.ts","webpack://k6-jslib-aws/./src/internal/ssm.ts","webpack://k6-jslib-aws/./src/internal/kinesis.ts"],"sourcesContent":["import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","import { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { SignatureV4, InvalidSignatureError } from './signature'\nimport { HTTPHeaders, SignedHTTPRequest } from './http'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\nimport { toFormUrlEncoded } from './utils'\nimport { AWSError } from './error'\n\nconst API_VERSION = '2012-11-05'\n\nexport class SQSClient extends AWSClient {\n private readonly signature: SignatureV4\n private readonly commonHeaders: HTTPHeaders\n\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'sqs')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken\n },\n uriEscapePath: true,\n applyChecksum: true\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }\n\n /**\n * Delivers a message to the specified queue.\n *\n * @param {string} queueUrl - The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.\n * @param {string} messageBody - The message to send. The minimum size is one character. The maximum size is 256 KB.\n * @param {Object} options - Options for the request\n * @param {string} [options.messageDeduplicationId] - The message deduplication id.\n * @param {string} [options.messageGroupId] - The message group ID for FIFO queues\n * @returns {Message} - The message that was sent.\n */\n sendMessage(queueUrl: string, messageBody: string, options: { messageDeduplicationId?: string; messageGroupId?: string} = {}): Message {\n const method = 'POST'\n\n let body: any = {\n Action: 'SendMessage',\n Version: API_VERSION,\n QueueUrl: queueUrl,\n MessageBody: messageBody,\n }\n\n if (typeof(options.messageDeduplicationId) !== 'undefined') {\n body = { ...body,\n MessageDeduplicationId: options.messageDeduplicationId\n }\n }\n\n if (typeof(options.messageGroupId) !== 'undefined') {\n body = { ...body,\n MessageGroupId: options.messageGroupId\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('SendMessage', res)\n\n const parsed = res.html('SendMessageResponse > SendMessageResult')\n return new Message(\n parsed.find('MessageId').text(),\n parsed.find('MD5OfMessageBody').text()\n )\n }\n\n /**\n * Returns a list of your queues in the current region.\n *\n * @param {ListQueuesRequestParameters} [parameters={}] request parameters\n * @param {number} [ListQueuesRequestParameters.maxResults] Maximum number of results to include in the response. Value range is 1 to 1000. You must set maxResults to receive a value for nextToken in the response.\n * @param {string} [ListQueuesRequestParameters.nextToken] Pagination token to request the next set of results.\n * @param {string} [ListQueuesRequestParameters.queueNamePrefix] A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * @returns {Object}\n * @returns {string[]} Object.queueUrls - A list of queue URLs, up to 1000 entries.\n * @returns {string} [Object.nextToken] - In the future, you can use NextToken to request the next set of results.\n */\n listQueues(parameters: ListQueuesRequestParameters = {}): ListQueuesResponse {\n const method = 'POST'\n\n let body: any = {\n Action: 'ListQueues',\n Version: API_VERSION,\n }\n\n if (typeof(parameters?.maxResults) !== 'undefined') {\n body = { ...body,\n MaxResults: parameters.maxResults\n }\n }\n\n if (typeof(parameters?.nextToken) !== 'undefined') {\n body = { ...body,\n NextToken: parameters.nextToken\n }\n }\n\n if (typeof(parameters?.queueNamePrefix) !== 'undefined') {\n body = { ...body,\n QueueNamePrefix: parameters.queueNamePrefix\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n 'Host': this.host\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('ListQueues', res)\n\n let parsed = res.html()\n return {\n urls: parsed.find('QueueUrl').toArray().map(e => e.text()),\n nextToken: parsed.find('NextToken').text() || undefined\n }\n }\n\n private _handleError(operation: SQSOperation, response: RefinedResponse) {\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n if (errorMessage == '' && errorCode === 0) {\n return\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new SQSServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/**\n * An Amazon SQS message.\n */\nexport class Message {\n /**\n * A unique identifier for the message.\n * A MessageIdis considered unique across all AWS accounts for an extended period of time.\n */\n id: string\n\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n bodyMD5: string\n\n /**\n * Instantiates a new Message object.\n *\n * @param id\n * @param md5Ofbody\n */\n constructor(id: string, bodyMD5: string) {\n this.id = id\n this.bodyMD5 = bodyMD5\n }\n}\n\n/**\n * SQSServiceError indicates an error occurred while interacting with the SQS API.\n */\nexport class SQSServiceError extends AWSError {\n operation: SQSOperation;\n\n constructor(message: string, code: string, operation: SQSOperation) {\n super(message, code)\n this.name = 'SQSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SQSOperation describes possible SQS operations.\n */\ntype SQSOperation = 'ListQueues' | 'SendMessage'\n\nexport interface SendMessageOptions {\n /*\n * The message deduplication ID for FIFO queues\n */\n messageDeduplicationId?: string\n\n /*\n * The message group ID for FIFO queues\n */\n messageGroupId?: string\n}\n\nexport interface ListQueuesRequestParameters {\n /**\n * Maximum number of results to include in the response. Value range is 1 to 1000.\n */\n maxResults?: number\n /**\n * Pagination token to request the next set of results.\n */\n nextToken?: string\n /**\n * A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * Queue URLs and names are case-sensitive.\n */\n queueNamePrefix?: string\n}\n\nexport interface ListQueuesResponse {\n /**\n * A list of queue URLs, up to 1,000 entries, or the value of MaxResults you sent in the request.\n */\n urls: string[]\n /**\n * Pagination token to include in the next request.\n */\n nextToken?: string\n}\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","module.exports = require(\"k6/crypto\");","module.exports = require(\"k6/html\");","module.exports = require(\"k6/http\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's KMS service\n */\nexport class KMSClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a KMSClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kms')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the KMS service\n // are made via the GET or POST method.\n this.method = 'POST'\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Gets a list of all the KMS keys in the caller's AWS\n * account and region.\n *\n * @returns an array of all the available keys\n */\n listKeys(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.ListKeys`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.ListKeys, res)\n\n const json: JSONArray = res.json('Keys') as JSONArray\n return json.map((k) => KMSKey.fromJSON(k as JSONObject))\n }\n\n /**\n * GenerateDataKey returns a unique symmetric data key for use outside of AWS KMS.\n *\n * This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.\n * The bytes in the plaintext key are random; they are not related to the caller or the KMS key.\n * You can use the plaintext key to encrypt your data outside of AWS KMS and store the encrypted data key with the encrypted data.\n *\n * To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key.\n * You cannot use an asymmetric KMS key to encrypt data keys.\n *\n * Used to generate data key with the KMS key defined\n * @param {string} id - Specifies the symmetric encryption KMS key that encrypts the data key. Use its key ID, key ARN, alias name, or alias ARN.\n * @param {KMKeySize} size - Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). Default is 32, and generates a 256-bit data key.\n * @throws {KMSServiceError}\n * @throws {InvalidSignatureError}\n * @returns {KMSDataKey} - The generated data key.\n */\n generateDataKey(id: string, size: KMSKeySize = KMSKeySize.Size256): KMSDataKey | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.GenerateDataKey`,\n },\n body: JSON.stringify({ KeyId: id, NumberOfBytes: size }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.GenerateDataKey, res)\n\n return KMSDataKey.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(operation: KMSOperation, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KMSServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KMSServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a KMS key\n */\nexport class KMSKey {\n /**\n * ARN of the key\n */\n keyArn: string\n\n /**\n * Unique identifier of the key\n */\n keyId: string\n\n constructor(keyArn: string, KeyId: string) {\n this.keyArn = keyArn\n this.keyId = KeyId\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSKey(json.KeyArn as string, json.KeyId as string)\n }\n}\n\n/**\n * Class representing a data key\n */\nexport class KMSDataKey {\n /**\n * The Amazon Resource Name (key ARN) of the KMS key that encrypted the data key.\n */\n id: string\n\n /**\n * The (base64-encoded) encrypted copy of the data key.\n */\n ciphertextBlob: string\n\n /**\n * The plaintext data key.\n * Use this data key to encrypt your data outside of KMS. Then, remove it from memory as soon as possible.\n */\n plaintext: string\n\n constructor(CiphertextBlob: string, KeyId: string, Plaintext: string) {\n this.ciphertextBlob = CiphertextBlob\n this.id = KeyId\n this.plaintext = Plaintext\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSDataKey(\n json.CiphertextBlob as string,\n json.KeyId as string,\n json.Plaintext as string\n )\n }\n}\n\nexport class KMSServiceError extends AWSError {\n operation: KMSOperation\n\n /**\n * Constructs a KMSServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: KMSOperation) {\n super(message, code)\n this.name = 'KMSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * KMSOperation defines all currently implemented KMS Service operations.\n */\nenum KMSOperation {\n GenerateDataKey = 'GenerateDataKey',\n ListKeys = 'ListKeys',\n}\n\n/**\n * KMSKeyLength describes possible key lenght values for KMS API data key operations.\n */\nenum KMSKeySize {\n Size256 = 32,\n Size512 = 64,\n}\n","import { bytes } from 'k6'\nimport { parseHTML } from 'k6/html'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AWSError } from './error'\nimport { SignedHTTPRequest } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n\n/** Class allowing to interact with Amazon AWS's S3 service */\nexport class S3Client extends AWSClient {\n signature: SignatureV4\n\n /**\n * Create a S3Client\n *\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 's3')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n }\n\n /**\n * Returns a list of all buckets owned by the authenticated sender of the request.\n * To use this operation, you must have the s3:ListAllMyBuckets permission.\n *\n * @return {Array.} buckets - An array of objects describing S3 buckets\n * with the following fields: name, and creationDate.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listBuckets(): Array {\n const method = 'GET'\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListBuckets', res)\n\n let buckets: Array = []\n\n const doc = parseHTML(res.body as string)\n\n doc.find('Buckets')\n .children()\n .each((_, bucketDefinition) => {\n let bucket = {}\n\n bucketDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'name':\n Object.assign(bucket, { name: child.textContent() })\n break\n case 'creationdate':\n Object.assign(bucket, {\n creationDate: Date.parse(child.textContent()),\n })\n }\n })\n\n buckets.push(bucket as S3Bucket)\n })\n\n return buckets\n }\n\n /**\n * Returns some or all (up to 1,000) of the objects in a bucket.\n *\n * @param {string} bucketName - Bucket name to list.\n * @param {string?} prefix='' - Limits the response to keys that begin with the specified prefix.\n * @return {Array.} - returns an array of objects describing S3 objects\n * with the following fields: key, lastModified, etag, size and storageClass.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listObjects(bucketName: string, prefix?: string): Array {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/`,\n query: {\n 'list-type': '2',\n prefix: prefix || '',\n },\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListObjectsV2', res)\n\n let objects: Array = []\n\n // Extract the objects definition from\n // the XML response\n parseHTML(res.body as string)\n .find('Contents')\n .each((_, objectDefinition) => {\n let obj = {}\n\n objectDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'key':\n Object.assign(obj, { key: child.textContent() })\n break\n case 'lastmodified':\n Object.assign(obj, { lastModified: Date.parse(child.textContent()) })\n break\n case 'etag':\n Object.assign(obj, { etag: child.textContent() })\n break\n case 'size':\n Object.assign(obj, { size: parseInt(child.textContent()) })\n break\n case 'storageclass':\n Object.assign(obj, { storageClass: child.textContent() })\n }\n })\n\n objects.push(obj as S3Object)\n })\n\n return objects\n }\n /**\n * Retrieves an Object from Amazon S3.\n *\n * To use getObject, you must have `READ` access to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to get.\n * @return {S3Object} - returns the content of the fetched S3 Object.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n getObject(bucketName: string, objectKey: string): S3Object {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('GetObject', res)\n\n return new S3Object(\n objectKey,\n Date.parse(res.headers['Last-Modified']),\n res.headers['ETag'],\n parseInt(res.headers['Content-Length']),\n\n // The X-Amz-Storage-Class header is only set if the storage class is\n // not the default 'STANDARD' one.\n (res.headers['X-Amz-Storage-Class'] ?? 'STANDARD') as StorageClass,\n\n res.body\n )\n }\n /**\n * Adds an object to a bucket.\n *\n * You must have WRITE permissions on a bucket to add an object to it.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to put.\n * @param {string | ArrayBuffer} data - the content of the S3 Object to upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {\n // Prepare request\n const method = 'PUT'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {\n Host: host,\n },\n body: data,\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error('PutObject', res)\n }\n\n /**\n * Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteObject(bucketName: string, objectKey: string): void {\n // Prepare request\n const method = 'DELETE'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('DeleteObject', res)\n }\n\n /**\n * Creates a new multipart upload for a given objectKey.\n * The uploadId returned can be used to upload parts to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @return {S3MultipartUpload} - returns the uploadId of the newly created multipart upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n createMultipartUpload(bucketName: string, objectKey: string): S3MultipartUpload {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: { uploads: '' },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('CreateMultipartUpload', res)\n\n return new S3MultipartUpload(\n objectKey,\n parseHTML(res.body as string)\n .find('UploadId')\n .text()\n )\n }\n\n /**\n * Uploads a part in a multipart upload.\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @param {string} uploadId - The uploadId of the multipart upload.\n * @param {number} partNumber - The part number of the part to upload.\n * @param {string | ArrayBuffer} data - The content of the part to upload.\n * @return {S3Part} - returns the ETag of the uploaded part.\n * @throws {S3ServiceError}\n */\n uploadPart(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n partNumber: number,\n data: string | ArrayBuffer\n ): S3Part {\n // Prepare request\n const method = 'PUT'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: data,\n query: {\n partNumber: `${partNumber}`,\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('UploadPart', res)\n\n return new S3Part(partNumber, res.headers['Etag'])\n }\n\n /**\n * Completes a multipart upload by assembling previously uploaded parts.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to complete.\n * @param {S3Part[]} parts - The parts to assemble.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n completeMultipartUpload(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n parts: S3Part[]\n ) {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n const body = `${parts\n .map(\n (part) =>\n `${part.partNumber}${part.eTag}`\n )\n .join('')}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: body,\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n\n this._handle_error('CompleteMultipartUpload', res)\n }\n\n /**\n * Aborts a multipart upload.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to abort.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string) {\n // Prepare request\n const method = 'DELETE'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('AbortMultipartUpload', res)\n }\n\n _handle_error(operation: S3Operation, response: RefinedResponse) {\n const status: number = response.status\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n // We consider codes 200-299 as success\n if (status >= 200 && status < 300 && errorMessage == '' && errorCode === 0) {\n return\n }\n\n // A 301 response is returned when the bucket is not found.\n // Generally meaning that either the bucket name is wrong or the\n // region is wrong.\n //\n // See: https://github.com/grafana/k6/issues/2474\n // See: https://github.com/golang/go/issues/49281\n if (status == 301 || (errorMessage && errorMessage.startsWith('301'))) {\n throw new S3ServiceError('Resource not found', 'ResourceNotFound', operation)\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new S3ServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/** Class representing a S3 Bucket */\nexport class S3Bucket {\n name: string\n creationDate: Date\n\n /**\n * Create an S3 Bucket\n *\n * @param {string} name - S3 bucket's name\n * @param {Date} creationDate - S3 bucket's creation date\n */\n constructor(name: string, creationDate: Date) {\n this.name = name\n this.creationDate = creationDate\n }\n}\n\n/** Class representing an S3 Object */\nexport class S3Object {\n key: string\n lastModified: number\n etag: string\n size: number\n storageClass: StorageClass\n data?: string | bytes | null\n\n /**\n * Create an S3 Object\n *\n * @param {string} key - S3 object's key\n * @param {Date} lastModified - S3 object last modification date\n * @param {string} etag - S3 object's etag\n * @param {number} size - S3 object's size\n * @param {StorageClass} storageClass - S3 object's storage class\n * @param {string | bytes | null} data=null - S3 Object's data\n */\n constructor(\n key: string,\n lastModified: number,\n etag: string,\n size: number,\n storageClass: StorageClass,\n data?: string | bytes | null\n ) {\n this.key = key\n this.lastModified = lastModified\n this.etag = etag\n this.size = size\n this.storageClass = storageClass\n this.data = data\n }\n}\n\n/** Class representing a S3 Multipart Upload */\nexport class S3MultipartUpload {\n key: string\n uploadId: string\n\n /**\n * Create an S3 Multipart Upload\n * @param {string} key - S3 object's key\n * @param {string} uploadId - S3 multipart upload id\n */\n\n constructor(key: string, uploadId: string) {\n this.key = key\n this.uploadId = uploadId\n }\n}\n\n/** Class representing a S3 Part */\nexport class S3Part {\n partNumber: number\n eTag: string\n\n /**\n * Create an S3 Part\n * @param {number} partNumber - Part number\n * @param {string} eTag - Part's etag\n */\n\n constructor(partNumber: number, eTag: string) {\n this.partNumber = partNumber\n this.eTag = eTag\n }\n}\n\n/**\n * Error indicating a S3 operation failed\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class S3ServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a S3ServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'S3ServiceError'\n this.operation = operation\n }\n}\n\n/**\n * S3Operation describes possible values for S3 API operations,\n * as defined by AWS APIs.\n */\ntype S3Operation =\n | 'ListBuckets'\n | 'ListObjectsV2'\n | 'GetObject'\n | 'PutObject'\n | 'DeleteObject'\n | 'CreateMultipartUpload'\n | 'CompleteMultipartUpload'\n | 'UploadPart'\n | 'AbortMultipartUpload'\n\n/**\n * Describes the class of storage used to store a S3 object.\n */\ntype StorageClass =\n | 'STANDARD'\n | 'REDUCED_REDUNDANCY'\n | 'GLACIER'\n | 'STANDARD_IA'\n | 'INTELLIGENT_TIERING'\n | 'DEEP_ARCHIVE'\n | 'OUTPOSTS'\n | 'GLACIER_IR'\n | undefined\n","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's SecretsManager service\n */\nexport class SecretsManagerClient extends AWSClient {\n /**\n * HTTP Method to use when interacting with the Secrets Manager service.\n */\n method: HTTPMethod\n\n /**\n * HTTP headers to use accross all requests to the Secrets Manager service.\n */\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a SecretsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'secretsmanager')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the Secrets Manager service\n // are made via the GET or POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Returns a list of all secrets owned by the authenticated sender of the request.\n * To use this operation, you must have the secretsmanager:ListSecrets permission.\n *\n * @return {Array.} secrets - An array of objects describing Secret Manager's secrets\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n listSecrets(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.ListSecrets`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.ListSecrets, res)\n const json: JSONArray = res.json('SecretList') as JSONArray\n\n return json.map((s) => Secret.fromJSON(s as JSONObject))\n }\n\n /**\n * Retrieves a secret from Amazon Sercets Manager\n *\n * @param {string} id - The ARN or name of the secret to retrieve.\n * @returns {Secret} - returns the content of the fetched Secret object.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getSecret(id: string): Secret | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.GetSecretValue`,\n },\n body: JSON.stringify({ SecretId: id }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(SecretsManagerOperation.GetSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Creates a new secret\n *\n * Note that this method only supports string-based values at the moment.\n *\n * @param {string} name - The name of the new secret.\n * The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {string} description - The description of the secret.\n * @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * algorithm.\n * @param {Array.} tags=[] - A list of tags to attach to the secret. Each tag is a key and\n * value pair of strings in a JSON text string. Note that tag key names are case sensitive.\n * @returns {Secret} - returns the created secret\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n createSecret(\n name: string,\n secret: string,\n description: string,\n versionID?: string,\n tags?: Array\n ): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.CreateSecret`,\n },\n body: JSON.stringify({\n Name: name,\n Description: description,\n SecretString: secret,\n ClientRequestToken: versionID,\n Tags: tags,\n }),\n },\n {}\n )\n\n // Ensure to include the desired 'Action' in the X-Amz-Target\n // header field, as documented by the AWS API docs.\n // headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.CreateSecret, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n /**\n * Update a secret's value.\n *\n * Note that this method only support string-based values at the moment.\n *\n * @param {string} id - The ARN or name of the secret to update.\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n putSecretValue(id: string, secret: string, versionID?: string): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.PutSecretValue`,\n },\n body: JSON.stringify({\n SecretId: id,\n SecretString: secret,\n ClientRequestToken: versionID,\n }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.PutSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Deletes a secret and all of its versions.\n *\n * You can specify a recovery window during which you can restore the secret.\n * The minimum recovery window is 7 days. The default recovery window is 30 days.\n *\n * @param {string} secretID - The ARN or name of the secret to delete.\n * @param {number} recoveryWindow - The number of days from 7 to 30 that Secrets Manager\n * waits before permanently deleting the secret.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteSecret(\n id: string,\n { recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }\n ) {\n const payload: { [key: string]: string | boolean | number } = {\n SecretId: id,\n }\n\n // noRecovery and recoveryWindow are exclusive parameters\n if (noRecovery === true) {\n payload['ForceDeleteWithoutRecovery'] = true\n } else {\n payload['RecoveryWindowInDays'] = recoveryWindow\n }\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.DeleteSecret`,\n },\n body: JSON.stringify(payload),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.DeleteSecret, res)\n }\n\n _handle_error(\n operation: SecretsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SecretsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SecretsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n// TODO: create a Tags type\n\n/**\n * Class representing a Secret Manager's secret\n */\nexport class Secret {\n name: string\n arn: string\n secret: string\n createdDate: number\n lastAccessedDate: number\n lastChangedDate: number\n tags: Array<{ [key: string]: string }>\n\n /**\n * Constructs a Secret Manager's Secret\n *\n * @param {string} name - The friendly name of the secret.\n * @param {string} arn - The ARN of the secret.\n * @param {number} createdDate - The date and time that this version of the secret was created.\n * @param {number} lastAccessedDate - The last date that this secret was accessed. This value is\n * truncated to midnight of the date and therefore shows only the date, not the time.\n * @param {number} lastChangedDate - The last date and time that this secret was modified in any way.\n * @param {Array.} tags - The list of user-defined tags associated with the secret.\n */\n constructor(\n name: string,\n arn: string,\n secretString: string,\n createdDate: number,\n lastAccessedDate: number,\n lastChangedDate: number,\n tags: Array<{ [key: string]: string }> = []\n ) {\n this.name = name\n this.arn = arn\n this.secret = secretString\n this.createdDate = createdDate\n this.lastAccessedDate = lastAccessedDate\n this.lastChangedDate = lastChangedDate\n this.tags = tags\n }\n\n /**\n * Parses and constructs a Secret Manager's Secret from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {Secret}\n */\n static fromJSON(json: JSONObject) {\n return new Secret(\n json.Name as string,\n json.ARN as string,\n json.SecretString as string,\n json.CreatedDate as number,\n json.LastAccessedDate as number,\n json.LastChangedDate as number,\n json.Tags as Array<{ [key: string]: string }>\n )\n }\n}\n\nexport class SecretsManagerServiceError extends AWSError {\n operation: SecretsManagerOperation\n\n /**\n * Constructs a SecretsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SecretsManagerOperation) {\n super(message, code)\n this.name = 'SecretsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SecretsManagerOperation defines all currently implemented Secrets Manager Service operations.\n */\nenum SecretsManagerOperation {\n ListSecrets = 'ListSecrets',\n GetSecretValue = 'GetSecretValue',\n CreateSecret = 'CreateSecret',\n PutSecretValue = 'PutSecretValue',\n DeleteSecret = 'DeleteSecret',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's Systems Manager service\n */\nexport class SystemsManagerClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n signature: SignatureV4\n\n /**\n * Create a SystemsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'ssm')\n\n // All interactions with the Systems Manager service\n // are made via the POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n }\n\n /**\n * Retrieves a parameter from Amazon Systems Manager\n *\n * @param {string} name - The ARN or name of the parameter to retrieve.\n * @param {boolean} withDecryption - whether returned secure string parameters should be decrypted.\n * @returns {SystemsManagerParameter} - returns the fetched Parameter object.\n * @throws {SystemsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getParameter(\n name: string,\n withDecryption: boolean = false\n ): SystemsManagerParameter | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `AmazonSSM.GetParameter`,\n },\n body: JSON.stringify({ Name: name, WithDecryption: withDecryption }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SystemsManagerOperation.GetParameter, res)\n\n return SystemsManagerParameter.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(\n operation: SystemsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SystemsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SystemsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a Systems Manager's Parameter\n */\nexport class SystemsManagerParameter {\n /**\n * The Amazon Resource Name (ARN) of the parameter.\n */\n arn: string\n\n /**\n * The data type of the parameter, such as text or aws:ec2:image.\n * The default is text.\n */\n dataType: string\n\n /**\n * Date the parameter was last changed or updated and the parameter version was created.\n */\n lastModifiedDate: number\n\n /**\n * The friendly name of the parameter.\n */\n name: string\n\n /**\n * Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n */\n selector: string\n\n /**\n * plies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n */\n sourceResult: string\n\n /**\n * The type of parameter. Valid values include the following: String, StringList, and SecureString.\n */\n type: string\n\n /**\n * The parameter value.\n */\n value: string\n\n /**\n * The parameter version.\n */\n version: number\n\n /**\n * Constructs a Systems Manager's Parameter\n *\n * @param {string} arn - The Amazon Resource Name (ARN) of the parameter.\n * @param {string} dataType - The data type of the parameter, such as text or aws:ec2:image. The default is text.\n * @param {number} lastModifiedDate - Date the parameter was last changed or updated and the parameter version was created.\n * @param {string} name - The friendly name of the parameter.\n * @param {string} selector - Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n * @param {string} sourceResult - Applies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n * @param {string} type - The type of parameter. Valid values include the following: String, StringList, and SecureString.\n * @param {string} value - The parameter value.\n * @param {number} version - The parameter version.\n */\n constructor(\n arn: string,\n dataType: string,\n lastModifiedDate: number,\n name: string,\n selector: string,\n sourceResult: string,\n type: string,\n value: string,\n version: number\n ) {\n this.arn = arn\n this.dataType = dataType\n this.lastModifiedDate = lastModifiedDate\n this.name = name\n this.selector = selector\n this.sourceResult = sourceResult\n this.type = type\n this.value = value\n this.version = version\n }\n\n /**\n * Parses and constructs a Systems Manager's Parameter from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {SystemsManagerParameter}\n */\n static fromJSON(json: JSONObject): SystemsManagerParameter {\n const parameter = json.Parameter as JSONObject\n\n return new SystemsManagerParameter(\n parameter.ARN as string,\n parameter.DataType as string,\n parameter.LastModifiedDate as number,\n parameter.Name as string,\n parameter.Selector as string,\n parameter.SourceResult as string,\n parameter.Type as string,\n parameter.Value as string,\n parameter.Version as number\n )\n }\n}\n\nexport class SystemsManagerServiceError extends AWSError {\n operation: SystemsManagerOperation\n\n /**\n * Constructs a SystemsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {SystemsManagerOperation} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SystemsManagerOperation) {\n super(message, code)\n this.name = 'SystemsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SystemsManagerOperation defines all currently implemented Systems Manager operations.\n */\nenum SystemsManagerOperation {\n GetParameter = 'GetParameter',\n}\n","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\n\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\nThis API is based on\nhttps://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html\n*/\n\n/**\n * Allows interacting with the Kinesis API.\n */\nexport class KinesisClient extends AWSClient {\n /**\n * The SignatureV4 object used to sign requests.\n */\n signature: SignatureV4\n\n /**\n * The common headers that are used for all requests.\n */\n commonHeaders: HTTPHeaders\n\n /**\n * The version of the Kinesis API that is used for all requests.\n */\n serviceVersion: string\n\n /**\n * A constructor function that creates a new instance of the Kinesis class.\n * @param {AWSConfig} awsConfig - AWSConfig - This is the configuration object that is passed to\n * the constructor.\n * @returns A Proxy object.\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kinesis')\n\n this.serviceVersion = 'Kinesis_20131202'\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Creates a new Kinesis stream with the specified name and options.\n *\n * @param {string} streamName - The name of the stream to create.\n * @param {{\n * shardCount?: number;\n * streamModeDetails?: {\n * streamMode: StreamMode;\n * };\n * }} [options={}] - An optional object containing configuration options for the stream.\n * @param {number} [options.shardCount] - The number of shards for the stream. If not provided, the default value will be used.\n * @param {{streamMode: StreamMode}} [options.streamModeDetails] - An optional object containing the stream mode details.\n * @param {StreamMode} [options.streamModeDetails.streamMode] - The mode of the stream. If not provided, the default mode will be used.\n *\n * @throws {Error} Throws an error if the stream creation request fails.\n * @returns {void}\n */\n createStream(\n streamName: string,\n options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(options.shardCount && { ShardCount: options.shardCount }),\n ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }),\n }\n\n this._send_request('CreateStream', body)\n }\n\n /**\n * Deletes a Kinesis stream with the specified parameters.\n *\n * @param {string} streamName - The name of the stream to delete.\n * @param {{\n * streamARN?: string;\n * enforceConsumerDeletion?: boolean;\n * }} [parameters={}] - An optional object containing configuration options for the stream deletion.\n * @param {string} [parameters.streamARN] - The Amazon Resource Name (ARN) of the stream. If not provided, the ARN will be derived from the stream name.\n * @param {boolean} [parameters.enforceConsumerDeletion] - Whether to enforce the deletion of all registered consumers before deleting the stream. Defaults to false.\n *\n * @throws {Error} Throws an error if the stream deletion request fails.\n * @returns {void}\n */\n deleteStream(\n streamName: string,\n parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n ...(parameters.enforceConsumerDeletion && {\n EnforceConsumerDeletion: parameters.enforceConsumerDeletion,\n }),\n }\n\n this._send_request('DeleteStream', body)\n }\n\n /**\n * Returns a list of Kinesis streams with the specified parameters.\n *\n * @param {{\n * exclusiveStartStreamName?: string;\n * limit?: number;\n * nextToken?: string;\n * }} [parameters={}] - An optional object containing configuration options for listing the streams.\n * @param {string} [parameters.exclusiveStartStreamName] - The name of the stream to start listing from. If not provided, the listing starts from the beginning.\n * @param {number} [parameters.limit] - The maximum number of streams to list. If not provided, the default value will be used.\n * @param {string} [parameters.nextToken] - A token to paginate the list of streams. If not provided, the first page will be returned.\n *\n * @throws {Error} Throws an error if the list streams request fails.\n * @returns {Partial} A partial of the ListStreamsResponse class.\n */\n listStreams(\n parameters: {\n exclusiveStartStreamName?: string\n limit?: number\n nextToken?: string\n } = {}\n ): ListStreamsResponse {\n const body: any = {\n ...(parameters.exclusiveStartStreamName && {\n ExclusiveStartStreamName: parameters.exclusiveStartStreamName,\n }),\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n }\n\n const res = this._send_request('ListStreams', body)\n return ListStreamsResponse.fromJson(res?.json())\n }\n\n /**\n * Sends multiple records to a Kinesis stream in a single request.\n *\n * @param {string} streamName - The name of the stream to put records into.\n * @param {PutRecordsRequestEntry[]} records - An array of records to put into the stream.\n *\n * @throws {Error} Throws an error if the put records request fails.\n * @returns {Partial} A partial of the PutRecordsResponse class.\n */\n putRecords(\n records: PutRecordsRequestEntry[],\n parameters: { streamName?: string; streamARN?: string } = {}\n ): PutRecordsResponse {\n if (!parameters.streamName && !parameters.streamARN) {\n throw new Error('Either streamName or streamARN must be provided')\n }\n\n const body: any = {\n Records: records,\n ...(parameters.streamName && { StreamName: parameters.streamName }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('PutRecords', body)\n return PutRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves records from a Kinesis stream.\n *\n * @param {string} shardIterator - The shard iterator to start retrieving records from.\n * @param {number} [limit] - The maximum number of records to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the get records request fails.\n * @returns {Partial} A partial of the GetRecordsResponse class.\n */\n getRecords(\n shardIterator: string,\n parameters: { limit?: number; streamARN?: string } = {}\n ): GetRecordsResponse {\n const body: any = {\n ShardIterator: shardIterator,\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('GetRecords', body)\n return GetRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Lists the shards in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream to list shards from.\n * @param {{\n * nextToken?: string;\n * maxResults?: number;\n * }} [parameters={}] - An optional object containing configuration options for listing shards.\n * @param {string} [parameters.nextToken] - A token to specify where to start paginating the shard list. If not provided, the first page will be returned.\n * @param {number} [parameters.maxResults] - The maximum number of shards to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the list shards request fails.\n * @returns {ListShardsResponse} A ListShardsResponse class instance.\n */\n listShards(\n streamName: string,\n parameters: { nextToken?: string; maxResults?: number } = {}\n ): ListShardsResponse {\n const body: any = {\n StreamName: streamName,\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n ...(parameters.maxResults && {\n MaxResults: parameters.maxResults,\n }),\n }\n\n const res = this._send_request('ListShards', body)\n return ListShardsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves a shard iterator for the specified shard in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream.\n * @param {string} shardId - The shard ID for which to get the iterator.\n * @param {string} shardIteratorType - The shard iterator type. One of 'AT_SEQUENCE_NUMBER', 'AFTER_SEQUENCE_NUMBER', 'TRIM_HORIZON', 'LATEST', or 'AT_TIMESTAMP'.\n * @param {{\n * startingSequenceNumber?: string;\n * timestamp?: number;\n * }} [parameters={}] - An optional object containing configuration options for the shard iterator.\n * @param {string} [parameters.startingSequenceNumber] - The sequence number to start with when using 'AT_SEQUENCE_NUMBER' or 'AFTER_SEQUENCE_NUMBER' iterator types.\n * @param {number} [parameters.timestamp] - The timestamp to start with when using the 'AT_TIMESTAMP' iterator type.\n *\n * @throws {Error} Throws an error if the get shard iterator request fails.\n * @returns {string} The next position in the shard from which to start sequentially reading data records. If set to null, the shard has been closed and the requested iterator does not return any more data.\n */\n getShardIterator(\n streamName: string,\n shardId: string,\n shardIteratorType: ShardIteratorKind,\n parameters: { startingSequenceNumber?: string; timestamp?: number } = {}\n ): GetShardIteratorResponse {\n const body: any = {\n StreamName: streamName,\n ShardId: shardId,\n ShardIteratorType: shardIteratorType,\n ...(parameters.startingSequenceNumber && {\n StartingSequenceNumber: parameters.startingSequenceNumber,\n }),\n ...(parameters.timestamp && { Timestamp: parameters.timestamp }),\n }\n\n const res = this._send_request('GetShardIterator', body)\n return GetShardIteratorResponse.fromJson(res?.json())\n }\n\n private _send_request(action: string, body: any): any {\n const signedRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceVersion}.${action}`,\n },\n body: JSON.stringify(body),\n },\n {}\n )\n\n const res = http.request('POST', signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(action, res)\n return res\n }\n\n /**\n * If the response is an error, throw an error\n *\n * @param {string} operation - The name of the operation that was called.\n * @param response - RefinedResponse\n * @returns The response is being returned.\n */\n _handle_error(operation: string, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KinesisServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KinesisServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/* `KinesisServiceError` is a subclass of `AWSError` that adds an `operation` property */\nexport class KinesisServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a KinesisServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'KinesisServiceError'\n this.operation = operation\n }\n}\n\n/**\n * Describes the options for a Kinesis stream.\n */\ntype StreamMode = 'PROVISIONED' | 'ON_DEMAND'\n\n/**\n * Determines how the shard iterator is used to start reading data records from the shard.\n */\nexport type ShardIteratorKind =\n | 'AT_SEQUENCE_NUMBER'\n | 'AFTER_SEQUENCE_NUMBER'\n | 'TRIM_HORIZON'\n | 'LATEST'\n | 'AT_TIMESTAMP'\n\n/**\n * Describes the status of a Kinesis data stream.\n */\nexport type StreamStatus = 'CREATING' | 'DELETING' | 'ACTIVE' | 'UPDATING'\n\nexport type StreamModeDetails = {\n /**\n * Specifies the capacity mode to which you want to set your data stream.\n */\n SteamMode: 'PROVISIONED' | 'ON_DEMAND'\n}\n\nexport class ListStreamsResponse {\n /**\n * Indicates whether there are more streams available to list.\n */\n HasMoreStreams: boolean\n\n /**\n * The token that identifies which batch of results you can retrieve.\n */\n NextToken?: string\n\n /**\n * The names of the streams that are associated with the AWS account making the ListStreams request.\n */\n StreamNames: string[]\n\n /**\n * A list of StreamSummary objects.\n */\n StreamSummaries: StreamSummary[]\n\n constructor(\n HasMoreStreams: boolean,\n NextToken: string,\n StreamNames: string[],\n StreamSummaries: StreamSummary[]\n ) {\n this.HasMoreStreams = HasMoreStreams\n this.NextToken = NextToken\n this.StreamNames = StreamNames\n this.StreamSummaries = StreamSummaries\n }\n\n static fromJson(result: any): ListStreamsResponse {\n const {\n HasMoreStreams = false,\n NextToken = '',\n StreamNames = [],\n StreamSummaries = [],\n } = result\n\n return new ListStreamsResponse(\n HasMoreStreams,\n NextToken,\n StreamNames.map((s: any) => String(s)),\n StreamSummaries.map(StreamSummary.fromJson)\n )\n }\n}\n\n/**\n * Summarizes a Stream\n */\nexport class StreamSummary {\n /**\n * The Amazon Resource Name (ARN) for the stream.\n */\n StreamARN: string\n\n /**\n * The time at which the stream was created.\n */\n StreamCreationTimestamp: number\n\n /**\n * Specify the capacity mode to which you want to set your data stream.\n */\n StreamModeDetails: StreamModeDetails\n\n /**\n * The name of the stream.\n */\n StreamName: string\n\n /**\n * The current status of the stream being described.\n */\n StreamStatus: StreamStatus\n\n constructor(\n StreamARN: string,\n StreamCreationTimestamp: number,\n StreamMode: StreamModeDetails,\n StreamName: string,\n StreamStatus: StreamStatus\n ) {\n this.StreamARN = StreamARN\n this.StreamCreationTimestamp = StreamCreationTimestamp\n this.StreamModeDetails = StreamMode\n this.StreamName = StreamName\n this.StreamStatus = StreamStatus\n }\n\n static fromJson(summary: any): StreamSummary {\n const {\n StreamARN = '',\n StreamCreationTimestamp = 0,\n StreamModeDetails = {},\n StreamName = '',\n StreamStatus = '',\n } = summary\n\n return new StreamSummary(\n StreamARN,\n StreamCreationTimestamp,\n StreamModeDetails,\n StreamName,\n StreamStatus\n )\n }\n}\n\n/**\n * Represents the output for PutRecords.\n */\nexport interface PutRecordsRequestEntry {\n /**\n * The data blob to put into the record, which is base64-encoded when the blob is serialized.\n */\n Data: string | ArrayBuffer\n\n /**\n * Datemines which share in the stream the data record is assigned to.\n */\n PartitionKey: string\n}\n\n// Response class for PutRecords API\nexport class PutRecordsResponse {\n /**\n * The encryption type used on the records. This parameter can be one of the following values:\n * - NONE: Do not encrypt the records.\n * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key.\n */\n EncryptionType: 'NONE' | 'KMS'\n\n /**\n * The number of unsuccessfully processed records in a PutRecords request.\n */\n FailedRecordCount: number\n\n /**\n * An array of succesffully and unsuccessfully processed record results.\n */\n Records: PutRecordsResultEntry[]\n\n constructor(\n encryptionType: 'NONE' | 'KMS',\n failedRecordCount: number,\n records: PutRecordsResultEntry[]\n ) {\n this.EncryptionType = encryptionType\n this.FailedRecordCount = failedRecordCount\n this.Records = records\n }\n\n static fromJson(json: any): PutRecordsResponse {\n const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json\n const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record))\n\n return new PutRecordsResponse(EncryptionType, FailedRecordCount, records)\n }\n}\n\n/**\n * Represents the result of an individual record from a PutRecords request.\n */\nexport class PutRecordsResultEntry {\n /**\n * The sequence number for an individual record result.\n */\n SequenceNumber: string\n\n /**\n * The shard ID for an individual record result.\n */\n ShardId: string\n\n constructor(sequenceNumber: string, shardId: string) {\n this.SequenceNumber = sequenceNumber\n this.ShardId = shardId\n }\n\n static fromJson(json: any): PutRecordsResultEntry {\n return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId)\n }\n}\n\n/**\n * Represents the response format of the GetRecords operation.\n */\nexport class GetRecordsResponse {\n /**\n * The next position in the shard from which to start sequentially reading data records.\n */\n NextShardIterator: string\n\n /**\n * The data records retrieved from the shard.\n */\n Records: Record[]\n\n constructor(nextShardIterator: string, records: Record[]) {\n this.NextShardIterator = nextShardIterator\n this.Records = records\n }\n\n static fromJson(json: any): GetRecordsResponse {\n const { NextShardIterator = '', Records = [] } = json\n const records = Records.map((record: Record) => Record.fromJson(record))\n\n return new GetRecordsResponse(NextShardIterator, records)\n }\n}\n\n/**\n * The unit of data of the Kinesis data stream, which is composed of a sequence\n * number, a partition key, and a data blob.\n */\nclass Record {\n /**\n * The data blob.\n */\n Data: string | ArrayBuffer\n\n /**\n * Identifies which shard in the stream the data record is assigned to.\n */\n PartitionKey: string\n\n /**\n * The unique identifier of the record in the stream.\n */\n SequenceNumber: string\n\n constructor(data: string | ArrayBuffer, partitionKey: string, sequenceNumber: string) {\n this.Data = data\n this.PartitionKey = partitionKey\n this.SequenceNumber = sequenceNumber\n }\n\n static fromJson(json: any): Record {\n return new Record(json.Data, json.PartitionKey, json.SequenceNumber)\n }\n}\n\n// Response class for ListShards API\nexport class ListShardsResponse {\n /**\n * An array of JSON objects.\n *\n * Each object represents one shard and specifies the IDs of the shard, the\n * shard's parent, and the shard that's adjacent to the shard's parent.\n */\n Shards: Shard[]\n\n /**\n * When the number of shards in the data stream is greater than the\n * default value for the MaxResults parameter, or if you explicitly specify\n * a value for MaxResults that is less than the number of shards in the data\n * stream, the response includes a pagination token named NextToken.\n */\n NextToken?: string\n\n constructor(shards: Shard[], nextToken?: string) {\n this.Shards = shards\n this.NextToken = nextToken\n }\n\n static fromJson(json: any): ListShardsResponse {\n const { Shards = [], NextToken } = json\n const shards = Shards.map((shard: Shard) => Shard.fromJson(shard))\n\n return new ListShardsResponse(shards, NextToken)\n }\n}\n\n/**\n * A uniquely identified group of data records in a Kinesis data stream.\n */\nexport class Shard {\n /**\n * The unique identifier of the shard within the stream.\n */\n Id: string\n\n /**\n * The shard ID of the shard's parent.\n */\n ParentShardId?: string\n\n /**\n * The shard ID of the shard adjacent to the shard's parent.\n */\n AdjacentParentShardId?: string\n\n /**\n * The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.\n */\n HashKeyRange: HashKeyRange\n\n SequenceNumberRange: SequenceNumberRange\n\n constructor(\n id: string,\n hashKeyRange: HashKeyRange,\n sequenceNumberRange: SequenceNumberRange,\n parentShardId?: string,\n adjacentParentShardId?: string\n ) {\n this.Id = id\n this.ParentShardId = parentShardId\n this.AdjacentParentShardId = adjacentParentShardId\n this.HashKeyRange = hashKeyRange\n this.SequenceNumberRange = sequenceNumberRange\n }\n\n static fromJson(json: any): Shard {\n return new Shard(\n json.ShardId,\n json.HashKeyRange,\n json.SequenceNumberRange,\n json.ParentShardId,\n json.AdjacentParentShardId\n )\n }\n}\n\n/**\n * Describes the range of possible hash key values for the shard, which is\n * a set of ordered contiguous positive integers.\n */\nexport interface HashKeyRange {\n /**\n * The starting hash key of the hash key range.\n */\n StartingHashKey: string\n\n /**\n * The ending hash key of the hash key range.\n */\n EndingHashKey: string\n}\n\n/**\n * The range of possible sequence numbers for the shard.\n */\nexport interface SequenceNumberRange {\n /**\n * The ending sequence number for the range.\n *\n * Shards that are in the OPEN state have an ending sequence number of null.\n */\n EndingSequenceNumber?: string\n\n /**\n * The starting sequence number for the range.\n */\n StartingSequenceNumber: string\n}\n\n/**\n * Describes a shard iterator response.\n */\nclass GetShardIteratorResponse {\n /**\n * The position in the shard from which to start reading data records sequentially.\n */\n ShardIterator: string\n\n constructor(shardIterator: string) {\n this.ShardIterator = shardIterator\n }\n\n static fromJson(json: any): GetShardIteratorResponse {\n return new GetShardIteratorResponse(json.ShardIterator)\n }\n}\n"],"names":["AWSClient","awsConfig","serviceName","_classCallCheck","_defineProperty","this","key","get","undefined","_host","concat","region","endpoint","set","host","_scheme","scheme","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","MAX_PRESIGNED_TTL","EMPTY_SHA256","UNSIGNED_PAYLOAD","AWSError","_Error","_inherits","_super","_createSuper","message","code","_this","call","_assertThisInitialized","name","value","xmlDocument","doc","parseHTML","find","text","_wrapNativeSuper","Error","hasHeader","soughtHeader","headers","_i","_Object$keys","Object","keys","length","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","_createClass","request","options","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","hostname","headerName","indexOf","sessionToken","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","accessKeyId","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","secretAccessKey","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","isArrayBuffer","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","prototype","toFormUrlEncoded","form","params","API_VERSION","SQSClient","_AWSClient","commonHeaders","queueUrl","messageBody","Action","Version","QueueUrl","MessageBody","messageDeduplicationId","MessageDeduplicationId","messageGroupId","MessageGroupId","signedRequest","sign","res","http","_handleError","parsed","html","Message","parameters","maxResults","MaxResults","nextToken","NextToken","queueNamePrefix","QueueNamePrefix","urls","toArray","operation","response","errorCode","error_code","error","awsError","parseXML","SQSServiceError","id","bodyMD5","_super2","_this2","v1","v4","uuid","module","exports","byteToHex","i","substr","buf","offset","bth","getRandomValues","bind","window","msCrypto","rnds8","Uint8Array","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","b","node","clockseq","seedBytes","msecs","getTime","nsecs","dt","tl","tmh","ii","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","AWSConfig","InvalidAWSConfigError","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","KMSClient","_handle_error","KMSOperation","ListKeys","json","k","KMSKey","fromJSON","size","KMSKeySize","Size256","KeyId","NumberOfBytes","GenerateDataKey","KMSDataKey","errorMessage","__type","KMSServiceError","keyArn","keyId","KeyArn","CiphertextBlob","Plaintext","ciphertextBlob","plaintext","S3Client","buckets","children","each","_","bucketDefinition","bucket","forEach","child","nodeName","assign","textContent","creationDate","bucketName","prefix","objects","objectDefinition","lastModified","etag","parseInt","storageClass","objectKey","_res$headers$XAmzSt","S3Object","data","Host","uploads","S3MultipartUpload","uploadId","partNumber","S3Part","parts","part","eTag","status","S3ServiceError","S3Bucket","SecretsManagerClient","SecretsManagerOperation","ListSecrets","Secret","SecretId","GetSecretValue","secret","description","versionID","tags","uuidv4","Name","Description","SecretString","ClientRequestToken","Tags","CreateSecret","PutSecretValue","_ref$recoveryWindow","recoveryWindow","_ref$noRecovery","noRecovery","payload","DeleteSecret","SecretsManagerServiceError","arn","secretString","createdDate","lastAccessedDate","lastChangedDate","ARN","CreatedDate","LastAccessedDate","LastChangedDate","SystemsManagerClient","withDecryption","WithDecryption","SystemsManagerOperation","GetParameter","SystemsManagerParameter","SystemsManagerServiceError","dataType","lastModifiedDate","selector","sourceResult","type","version","parameter","Parameter","DataType","LastModifiedDate","Selector","SourceResult","Type","Value","KinesisClient","serviceVersion","streamName","StreamName","shardCount","ShardCount","streamModeDetails","StreamMode","streamMode","_send_request","streamARN","StreamARN","enforceConsumerDeletion","EnforceConsumerDeletion","exclusiveStartStreamName","ExclusiveStartStreamName","limit","Limit","ListStreamsResponse","fromJson","records","Records","PutRecordsResponse","shardIterator","ShardIterator","GetRecordsResponse","ListShardsResponse","shardId","shardIteratorType","ShardId","ShardIteratorType","startingSequenceNumber","StartingSequenceNumber","timestamp","Timestamp","GetShardIteratorResponse","action","KinesisServiceError","HasMoreStreams","StreamNames","StreamSummaries","result","_result$HasMoreStream","_result$NextToken","_result$StreamNames","_result$StreamSummari","String","StreamSummary","StreamCreationTimestamp","StreamStatus","StreamModeDetails","summary","_summary$StreamARN","_summary$StreamCreati","_summary$StreamModeDe","_summary$StreamName","_summary$StreamStatus","encryptionType","failedRecordCount","EncryptionType","FailedRecordCount","_json$EncryptionType","_json$FailedRecordCou","_json$Records","record","PutRecordsResultEntry","sequenceNumber","SequenceNumber","nextShardIterator","NextShardIterator","_json$NextShardIterat","_json$Records2","Record","partitionKey","Data","PartitionKey","shards","Shards","_json$Shards","shard","Shard","hashKeyRange","sequenceNumberRange","parentShardId","adjacentParentShardId","Id","ParentShardId","AdjacentParentShardId","HashKeyRange","SequenceNumberRange"],"sourceRoot":""} \ No newline at end of file diff --git a/build/kinesis.js.map b/build/kinesis.js.map index c0139a1..b422df4 100644 --- a/build/kinesis.js.map +++ b/build/kinesis.js.map @@ -1 +1 @@ -{"version":3,"file":"kinesis.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sxFCFvD,IAAMC,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCC,EAAA,KAAAF,GArFvCG,EAAA,sBAOAA,EAAA,2BAOAA,EAAA,+BAOAA,EAAA,4BAOAA,EAAA,cAKqB,SAIrBA,EAAA,gBAKmB,kBA4CVF,EAAQG,QAA6B,KAAnBH,EAAQG,OAC3B,MAAM,IAAIC,EAAsB,yFAADC,OAC+DL,EAAQG,OAAM,MAIhH,IAAKH,EAAQM,aAAuC,KAAxBN,EAAQM,YAChC,MAAM,IAAIF,EAAsB,wEAADC,OAC8CL,EAAQM,YAAW,MAIpG,GAAIN,EAAQM,YAAYC,OAAS,IAAMP,EAAQM,YAAYC,OAAS,IAChE,MAAM,IAAIH,EAAsB,wFAADC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jQ,IAAA,WAAAa,MAED,SAAgB2O,GACZ,IAAAiF,EAAmCjF,EAA3BgF,OAAAA,OAAM,IAAAC,EAAG,GAAEA,EAAErF,EAAcI,EAAdJ,UAGrB,OAAO,IAAIa,EAFIuE,EAAO5L,KAAI,SAAC8L,GAAY,OAAKC,GAAMpF,SAASmF,EAAM,IAE3BtF,EAC1C,KAACa,CAAA,CA3B0B,GAiClB0E,GAAK,WAuBd,SAAAA,EACIC,EACAC,EACAC,EACAC,EACAC,GACFhU,GAAA,KAAA2T,GA5BF1T,GAAA,kBAKAA,GAAA,6BAKAA,GAAA,qCAKAA,GAAA,4BAAAA,GAAA,mCAcIO,KAAKyT,GAAKL,EACVpT,KAAK0T,cAAgBH,EACrBvT,KAAK2T,sBAAwBH,EAC7BxT,KAAK4T,aAAeP,EACpBrT,KAAK6T,oBAAsBP,CAC/B,CAUC,OAVAjT,GAAA8S,EAAA,OAAA3U,IAAA,WAAAa,MAED,SAAgB2O,GACZ,OAAO,IAAImF,EACPnF,EAAKY,QACLZ,EAAK4F,aACL5F,EAAK6F,oBACL7F,EAAK0F,cACL1F,EAAK2F,sBAEb,KAACR,CAAA,CA7Ca,GAoFZjE,GAAwB,WAM1B,SAAAA,EAAYd,GAAuB5O,GAAA,KAAA0P,GALnCzP,GAAA,6BAMIO,KAAKqO,cAAgBD,CACzB,CAIC,OAJA/N,GAAA6O,EAAA,OAAA1Q,IAAA,WAAAa,MAED,SAAgB2O,GACZ,OAAO,IAAIkB,EAAyBlB,EAAKK,cAC7C,KAACa,CAAA,CAZyB,G","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/kinesis.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\n\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\nThis API is based on\nhttps://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html\n*/\n\n/**\n * Allows interacting with the Kinesis API.\n */\nexport class KinesisClient extends AWSClient {\n /**\n * The SignatureV4 object used to sign requests.\n */\n signature: SignatureV4\n\n /**\n * The common headers that are used for all requests.\n */\n commonHeaders: HTTPHeaders\n\n /**\n * The version of the Kinesis API that is used for all requests.\n */\n serviceVersion: string\n\n /**\n * A constructor function that creates a new instance of the Kinesis class.\n * @param {AWSConfig} awsConfig - AWSConfig - This is the configuration object that is passed to\n * the constructor.\n * @returns A Proxy object.\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kinesis')\n\n this.serviceVersion = 'Kinesis_20131202'\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Creates a new Kinesis stream with the specified name and options.\n *\n * @param {string} streamName - The name of the stream to create.\n * @param {{\n * shardCount?: number;\n * streamModeDetails?: {\n * streamMode: StreamMode;\n * };\n * }} [options={}] - An optional object containing configuration options for the stream.\n * @param {number} [options.shardCount] - The number of shards for the stream. If not provided, the default value will be used.\n * @param {{streamMode: StreamMode}} [options.streamModeDetails] - An optional object containing the stream mode details.\n * @param {StreamMode} [options.streamModeDetails.streamMode] - The mode of the stream. If not provided, the default mode will be used.\n *\n * @throws {Error} Throws an error if the stream creation request fails.\n * @returns {void}\n */\n createStream(\n streamName: string,\n options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(options.shardCount && { ShardCount: options.shardCount }),\n ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }),\n }\n\n this._send_request('CreateStream', body)\n }\n\n /**\n * Deletes a Kinesis stream with the specified parameters.\n *\n * @param {string} streamName - The name of the stream to delete.\n * @param {{\n * streamARN?: string;\n * enforceConsumerDeletion?: boolean;\n * }} [parameters={}] - An optional object containing configuration options for the stream deletion.\n * @param {string} [parameters.streamARN] - The Amazon Resource Name (ARN) of the stream. If not provided, the ARN will be derived from the stream name.\n * @param {boolean} [parameters.enforceConsumerDeletion] - Whether to enforce the deletion of all registered consumers before deleting the stream. Defaults to false.\n *\n * @throws {Error} Throws an error if the stream deletion request fails.\n * @returns {void}\n */\n deleteStream(\n streamName: string,\n parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n ...(parameters.enforceConsumerDeletion && {\n EnforceConsumerDeletion: parameters.enforceConsumerDeletion,\n }),\n }\n\n this._send_request('DeleteStream', body)\n }\n\n /**\n * Returns a list of Kinesis streams with the specified parameters.\n *\n * @param {{\n * exclusiveStartStreamName?: string;\n * limit?: number;\n * nextToken?: string;\n * }} [parameters={}] - An optional object containing configuration options for listing the streams.\n * @param {string} [parameters.exclusiveStartStreamName] - The name of the stream to start listing from. If not provided, the listing starts from the beginning.\n * @param {number} [parameters.limit] - The maximum number of streams to list. If not provided, the default value will be used.\n * @param {string} [parameters.nextToken] - A token to paginate the list of streams. If not provided, the first page will be returned.\n *\n * @throws {Error} Throws an error if the list streams request fails.\n * @returns {Partial} A partial of the ListStreamsResponse class.\n */\n listStreams(\n parameters: {\n exclusiveStartStreamName?: string\n limit?: number\n nextToken?: string\n } = {}\n ): ListStreamsResponse {\n const body: any = {\n ...(parameters.exclusiveStartStreamName && {\n ExclusiveStartStreamName: parameters.exclusiveStartStreamName,\n }),\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n }\n\n const res = this._send_request('ListStreams', body)\n return ListStreamsResponse.fromJson(res?.json())\n }\n\n /**\n * Sends multiple records to a Kinesis stream in a single request.\n *\n * @param {string} streamName - The name of the stream to put records into.\n * @param {PutRecordsRequestEntry[]} records - An array of records to put into the stream.\n *\n * @throws {Error} Throws an error if the put records request fails.\n * @returns {Partial} A partial of the PutRecordsResponse class.\n */\n putRecords(\n records: PutRecordsRequestEntry[],\n parameters: { streamName?: string; streamARN?: string } = {}\n ): PutRecordsResponse {\n if (!parameters.streamName && !parameters.streamARN) {\n throw new Error('Either streamName or streamARN must be provided')\n }\n\n const body: any = {\n Records: records,\n ...(parameters.streamName && { StreamName: parameters.streamName }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('PutRecords', body)\n return PutRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves records from a Kinesis stream.\n *\n * @param {string} shardIterator - The shard iterator to start retrieving records from.\n * @param {number} [limit] - The maximum number of records to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the get records request fails.\n * @returns {Partial} A partial of the GetRecordsResponse class.\n */\n getRecords(\n shardIterator: string,\n parameters: { limit?: number; streamARN?: string } = {}\n ): GetRecordsResponse {\n const body: any = {\n ShardIterator: shardIterator,\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('GetRecords', body)\n return GetRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Lists the shards in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream to list shards from.\n * @param {{\n * nextToken?: string;\n * maxResults?: number;\n * }} [parameters={}] - An optional object containing configuration options for listing shards.\n * @param {string} [parameters.nextToken] - A token to specify where to start paginating the shard list. If not provided, the first page will be returned.\n * @param {number} [parameters.maxResults] - The maximum number of shards to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the list shards request fails.\n * @returns {ListShardsResponse} A ListShardsResponse class instance.\n */\n listShards(\n streamName: string,\n parameters: { nextToken?: string; maxResults?: number } = {}\n ): ListShardsResponse {\n const body: any = {\n StreamName: streamName,\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n ...(parameters.maxResults && {\n MaxResults: parameters.maxResults,\n }),\n }\n\n const res = this._send_request('ListShards', body)\n return ListShardsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves a shard iterator for the specified shard in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream.\n * @param {string} shardId - The shard ID for which to get the iterator.\n * @param {string} shardIteratorType - The shard iterator type. One of 'AT_SEQUENCE_NUMBER', 'AFTER_SEQUENCE_NUMBER', 'TRIM_HORIZON', 'LATEST', or 'AT_TIMESTAMP'.\n * @param {{\n * startingSequenceNumber?: string;\n * timestamp?: number;\n * }} [parameters={}] - An optional object containing configuration options for the shard iterator.\n * @param {string} [parameters.startingSequenceNumber] - The sequence number to start with when using 'AT_SEQUENCE_NUMBER' or 'AFTER_SEQUENCE_NUMBER' iterator types.\n * @param {number} [parameters.timestamp] - The timestamp to start with when using the 'AT_TIMESTAMP' iterator type.\n *\n * @throws {Error} Throws an error if the get shard iterator request fails.\n * @returns {string} The next position in the shard from which to start sequentially reading data records. If set to null, the shard has been closed and the requested iterator does not return any more data.\n */\n getShardIterator(\n streamName: string,\n shardId: string,\n shardIteratorType: ShardIteratorKind,\n parameters: { startingSequenceNumber?: string; timestamp?: number } = {}\n ): GetShardIteratorResponse {\n const body: any = {\n StreamName: streamName,\n ShardId: shardId,\n ShardIteratorType: shardIteratorType,\n ...(parameters.startingSequenceNumber && {\n StartingSequenceNumber: parameters.startingSequenceNumber,\n }),\n ...(parameters.timestamp && { Timestamp: parameters.timestamp }),\n }\n\n const res = this._send_request('GetShardIterator', body)\n return GetShardIteratorResponse.fromJson(res?.json())\n }\n\n private _send_request(action: string, body: any): any {\n const signedRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceVersion}.${action}`,\n },\n body: JSON.stringify(body),\n },\n {}\n )\n\n const res = http.request('POST', signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(action, res)\n return res\n }\n\n /**\n * If the response is an error, throw an error\n *\n * @param {string} operation - The name of the operation that was called.\n * @param response - RefinedResponse\n * @returns The response is being returned.\n */\n _handle_error(operation: string, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KinesisServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KinesisServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/* `KinesisServiceError` is a subclass of `AWSError` that adds an `operation` property */\nexport class KinesisServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a KinesisServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'KinesisServiceError'\n this.operation = operation\n }\n}\n\n/**\n * Describes the options for a Kinesis stream.\n */\ntype StreamMode = 'PROVISIONED' | 'ON_DEMAND'\n\n/**\n * Determines how the shard iterator is used to start reading data records from the shard.\n */\nexport type ShardIteratorKind =\n | 'AT_SEQUENCE_NUMBER'\n | 'AFTER_SEQUENCE_NUMBER'\n | 'TRIM_HORIZON'\n | 'LATEST'\n | 'AT_TIMESTAMP'\n\n/**\n * Describes the status of a Kinesis data stream.\n */\nexport type StreamStatus = 'CREATING' | 'DELETING' | 'ACTIVE' | 'UPDATING'\n\nexport type StreamModeDetails = {\n /**\n * Specifies the capacity mode to which you want to set your data stream.\n */\n SteamMode: 'PROVISIONED' | 'ON_DEMAND'\n}\n\nexport class ListStreamsResponse {\n /**\n * Indicates whether there are more streams available to list.\n */\n HasMoreStreams: boolean\n\n /**\n * The token that identifies which batch of results you can retrieve.\n */\n NextToken?: string\n\n /**\n * The names of the streams that are associated with the AWS account making the ListStreams request.\n */\n StreamNames: string[]\n\n /**\n * A list of StreamSummary objects.\n */\n StreamSummaries: StreamSummary[]\n\n constructor(\n HasMoreStreams: boolean,\n NextToken: string,\n StreamNames: string[],\n StreamSummaries: StreamSummary[]\n ) {\n this.HasMoreStreams = HasMoreStreams\n this.NextToken = NextToken\n this.StreamNames = StreamNames\n this.StreamSummaries = StreamSummaries\n }\n\n static fromJson(result: any): ListStreamsResponse {\n const {\n HasMoreStreams = false,\n NextToken = '',\n StreamNames = [],\n StreamSummaries = [],\n } = result\n\n return new ListStreamsResponse(\n HasMoreStreams,\n NextToken,\n StreamNames.map((s: any) => String(s)),\n StreamSummaries.map(StreamSummary.fromJson)\n )\n }\n}\n\n/**\n * Summarizes a Stream\n */\nexport class StreamSummary {\n /**\n * The Amazon Resource Name (ARN) for the stream.\n */\n StreamARN: string\n\n /**\n * The time at which the stream was created.\n */\n StreamCreationTimestamp: number\n\n /**\n * Specify the capacity mode to which you want to set your data stream.\n */\n StreamModeDetails: StreamModeDetails\n\n /**\n * The name of the stream.\n */\n StreamName: string\n\n /**\n * The current status of the stream being described.\n */\n StreamStatus: StreamStatus\n\n constructor(\n StreamARN: string,\n StreamCreationTimestamp: number,\n StreamMode: StreamModeDetails,\n StreamName: string,\n StreamStatus: StreamStatus\n ) {\n this.StreamARN = StreamARN\n this.StreamCreationTimestamp = StreamCreationTimestamp\n this.StreamModeDetails = StreamMode\n this.StreamName = StreamName\n this.StreamStatus = StreamStatus\n }\n\n static fromJson(summary: any): StreamSummary {\n const {\n StreamARN = '',\n StreamCreationTimestamp = 0,\n StreamModeDetails = {},\n StreamName = '',\n StreamStatus = '',\n } = summary\n\n return new StreamSummary(\n StreamARN,\n StreamCreationTimestamp,\n StreamModeDetails,\n StreamName,\n StreamStatus\n )\n }\n}\n\n/**\n * Represents the output for PutRecords.\n */\nexport interface PutRecordsRequestEntry {\n /**\n * The data blob to put into the record, which is base64-encoded when the blob is serialized.\n */\n Data: string | ArrayBuffer\n\n /**\n * Datemines which share in the stream the data record is assigned to.\n */\n PartitionKey: string\n}\n\n// Response class for PutRecords API\nexport class PutRecordsResponse {\n /**\n * The encryption type used on the records. This parameter can be one of the following values:\n * - NONE: Do not encrypt the records.\n * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key.\n */\n EncryptionType: 'NONE' | 'KMS'\n\n /**\n * The number of unsuccessfully processed records in a PutRecords request.\n */\n FailedRecordCount: number\n\n /**\n * An array of succesffully and unsuccessfully processed record results.\n */\n Records: PutRecordsResultEntry[]\n\n constructor(\n encryptionType: 'NONE' | 'KMS',\n failedRecordCount: number,\n records: PutRecordsResultEntry[]\n ) {\n this.EncryptionType = encryptionType\n this.FailedRecordCount = failedRecordCount\n this.Records = records\n }\n\n static fromJson(json: any): PutRecordsResponse {\n const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json\n const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record))\n\n return new PutRecordsResponse(EncryptionType, FailedRecordCount, records)\n }\n}\n\n/**\n * Represents the result of an individual record from a PutRecords request.\n */\nexport class PutRecordsResultEntry {\n /**\n * The sequence number for an individual record result.\n */\n SequenceNumber: string\n\n /**\n * The shard ID for an individual record result.\n */\n ShardId: string\n\n constructor(sequenceNumber: string, shardId: string) {\n this.SequenceNumber = sequenceNumber\n this.ShardId = shardId\n }\n\n static fromJson(json: any): PutRecordsResultEntry {\n return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId)\n }\n}\n\n/**\n * Represents the response format of the GetRecords operation.\n */\nexport class GetRecordsResponse {\n /**\n * The next position in the shard from which to start sequentially reading data records.\n */\n NextShardIterator: string\n\n /**\n * The data records retrieved from the shard.\n */\n Records: Record[]\n\n constructor(nextShardIterator: string, records: Record[]) {\n this.NextShardIterator = nextShardIterator\n this.Records = records\n }\n\n static fromJson(json: any): GetRecordsResponse {\n const { NextShardIterator = '', Records = [] } = json\n const records = Records.map((record: Record) => Record.fromJson(record))\n\n return new GetRecordsResponse(NextShardIterator, records)\n }\n}\n\n/**\n * The unit of data of the Kinesis data stream, which is composed of a sequence\n * number, a partition key, and a data blob.\n */\nclass Record {\n /**\n * The data blob.\n */\n Data: string | ArrayBuffer\n\n /**\n * Identifies which shard in the stream the data record is assigned to.\n */\n PartitionKey: string\n\n /**\n * The unique identifier of the record in the stream.\n */\n SequenceNumber: string\n\n constructor(data: string | ArrayBuffer, partitionKey: string, sequenceNumber: string) {\n this.Data = data\n this.PartitionKey = partitionKey\n this.SequenceNumber = sequenceNumber\n }\n\n static fromJson(json: any): Record {\n return new Record(json.Data, json.PartitionKey, json.SequenceNumber)\n }\n}\n\n// Response class for ListShards API\nexport class ListShardsResponse {\n /**\n * An array of JSON objects.\n *\n * Each object represents one shard and specifies the IDs of the shard, the\n * shard's parent, and the shard that's adjacent to the shard's parent.\n */\n Shards: Shard[]\n\n /**\n * When the number of shards in the data stream is greater than the\n * default value for the MaxResults parameter, or if you explicitly specify\n * a value for MaxResults that is less than the number of shards in the data\n * stream, the response includes a pagination token named NextToken.\n */\n NextToken?: string\n\n constructor(shards: Shard[], nextToken?: string) {\n this.Shards = shards\n this.NextToken = nextToken\n }\n\n static fromJson(json: any): ListShardsResponse {\n const { Shards = [], NextToken } = json\n const shards = Shards.map((shard: Shard) => Shard.fromJson(shard))\n\n return new ListShardsResponse(shards, NextToken)\n }\n}\n\n/**\n * A uniquely identified group of data records in a Kinesis data stream.\n */\nexport class Shard {\n /**\n * The unique identifier of the shard within the stream.\n */\n Id: string\n\n /**\n * The shard ID of the shard's parent.\n */\n ParentShardId?: string\n\n /**\n * The shard ID of the shard adjacent to the shard's parent.\n */\n AdjacentParentShardId?: string\n\n /**\n * The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.\n */\n HashKeyRange: HashKeyRange\n\n SequenceNumberRange: SequenceNumberRange\n\n constructor(\n id: string,\n hashKeyRange: HashKeyRange,\n sequenceNumberRange: SequenceNumberRange,\n parentShardId?: string,\n adjacentParentShardId?: string\n ) {\n this.Id = id\n this.ParentShardId = parentShardId\n this.AdjacentParentShardId = adjacentParentShardId\n this.HashKeyRange = hashKeyRange\n this.SequenceNumberRange = sequenceNumberRange\n }\n\n static fromJson(json: any): Shard {\n return new Shard(\n json.ShardId,\n json.HashKeyRange,\n json.SequenceNumberRange,\n json.ParentShardId,\n json.AdjacentParentShardId\n )\n }\n}\n\n/**\n * Describes the range of possible hash key values for the shard, which is\n * a set of ordered contiguous positive integers.\n */\nexport interface HashKeyRange {\n /**\n * The starting hash key of the hash key range.\n */\n StartingHashKey: string\n\n /**\n * The ending hash key of the hash key range.\n */\n EndingHashKey: string\n}\n\n/**\n * The range of possible sequence numbers for the shard.\n */\nexport interface SequenceNumberRange {\n /**\n * The ending sequence number for the range.\n *\n * Shards that are in the OPEN state have an ending sequence number of null.\n */\n EndingSequenceNumber?: string\n\n /**\n * The starting sequence number for the range.\n */\n StartingSequenceNumber: string\n}\n\n/**\n * Describes a shard iterator response.\n */\nclass GetShardIteratorResponse {\n /**\n * The position in the shard from which to start reading data records sequentially.\n */\n ShardIterator: string\n\n constructor(shardIterator: string) {\n this.ShardIterator = shardIterator\n }\n\n static fromJson(json: any): GetShardIteratorResponse {\n return new GetShardIteratorResponse(json.ShardIterator)\n }\n}\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","KinesisClient","_AWSClient","awsConfig","serviceVersion","serviceName","commonHeaders","streamName","StreamName","shardCount","ShardCount","streamModeDetails","StreamMode","streamMode","_send_request","parameters","streamARN","StreamARN","enforceConsumerDeletion","EnforceConsumerDeletion","exclusiveStartStreamName","ExclusiveStartStreamName","limit","Limit","nextToken","NextToken","res","ListStreamsResponse","fromJson","json","records","Records","PutRecordsResponse","shardIterator","ShardIterator","GetRecordsResponse","maxResults","MaxResults","ListShardsResponse","shardId","shardIteratorType","ShardId","ShardIteratorType","startingSequenceNumber","StartingSequenceNumber","timestamp","Timestamp","GetShardIteratorResponse","action","signedRequest","sign","host","http","_handle_error","operation","response","errorCode","error_code","error","errorMessage","Message","__type","KinesisServiceError","AWSClient","_host","set","_scheme","_super2","_this2","HasMoreStreams","StreamNames","StreamSummaries","result","_result$HasMoreStream","_result$NextToken","_result$StreamNames","_result$StreamSummari","String","StreamSummary","StreamCreationTimestamp","StreamStatus","StreamModeDetails","summary","_summary$StreamARN","_summary$StreamCreati","_summary$StreamModeDe","_summary$StreamName","_summary$StreamStatus","encryptionType","failedRecordCount","EncryptionType","FailedRecordCount","_json$EncryptionType","_json$FailedRecordCou","_json$Records","record","PutRecordsResultEntry","sequenceNumber","SequenceNumber","nextShardIterator","NextShardIterator","_json$NextShardIterat","_json$Records2","Record","data","partitionKey","Data","PartitionKey","shards","Shards","_json$Shards","shard","Shard","id","hashKeyRange","sequenceNumberRange","parentShardId","adjacentParentShardId","Id","ParentShardId","AdjacentParentShardId","HashKeyRange","SequenceNumberRange"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"kinesis.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sxFCFvD,IAAMC,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCC,EAAA,KAAAF,GArFvCG,EAAA,sBAOAA,EAAA,2BAOAA,EAAA,+BAOAA,EAAA,4BAOAA,EAAA,cAKqB,SA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IAAIkB,EAAyBlB,EAAKK,cAC7C,KAACa,CAAA,CAZyB,G","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/kinesis.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\n\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\nThis API is based on\nhttps://docs.aws.amazon.com/kinesis/latest/APIReference/API_Operations.html\n*/\n\n/**\n * Allows interacting with the Kinesis API.\n */\nexport class KinesisClient extends AWSClient {\n /**\n * The SignatureV4 object used to sign requests.\n */\n signature: SignatureV4\n\n /**\n * The common headers that are used for all requests.\n */\n commonHeaders: HTTPHeaders\n\n /**\n * The version of the Kinesis API that is used for all requests.\n */\n serviceVersion: string\n\n /**\n * A constructor function that creates a new instance of the Kinesis class.\n * @param {AWSConfig} awsConfig - AWSConfig - This is the configuration object that is passed to\n * the constructor.\n * @returns A Proxy object.\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kinesis')\n\n this.serviceVersion = 'Kinesis_20131202'\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Creates a new Kinesis stream with the specified name and options.\n *\n * @param {string} streamName - The name of the stream to create.\n * @param {{\n * shardCount?: number;\n * streamModeDetails?: {\n * streamMode: StreamMode;\n * };\n * }} [options={}] - An optional object containing configuration options for the stream.\n * @param {number} [options.shardCount] - The number of shards for the stream. If not provided, the default value will be used.\n * @param {{streamMode: StreamMode}} [options.streamModeDetails] - An optional object containing the stream mode details.\n * @param {StreamMode} [options.streamModeDetails.streamMode] - The mode of the stream. If not provided, the default mode will be used.\n *\n * @throws {Error} Throws an error if the stream creation request fails.\n * @returns {void}\n */\n createStream(\n streamName: string,\n options: { shardCount?: number; streamModeDetails?: { streamMode: StreamMode } } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(options.shardCount && { ShardCount: options.shardCount }),\n ...(options.streamModeDetails && { StreamMode: options.streamModeDetails.streamMode }),\n }\n\n this._send_request('CreateStream', body)\n }\n\n /**\n * Deletes a Kinesis stream with the specified parameters.\n *\n * @param {string} streamName - The name of the stream to delete.\n * @param {{\n * streamARN?: string;\n * enforceConsumerDeletion?: boolean;\n * }} [parameters={}] - An optional object containing configuration options for the stream deletion.\n * @param {string} [parameters.streamARN] - The Amazon Resource Name (ARN) of the stream. If not provided, the ARN will be derived from the stream name.\n * @param {boolean} [parameters.enforceConsumerDeletion] - Whether to enforce the deletion of all registered consumers before deleting the stream. Defaults to false.\n *\n * @throws {Error} Throws an error if the stream deletion request fails.\n * @returns {void}\n */\n deleteStream(\n streamName: string,\n parameters: { streamARN?: string; enforceConsumerDeletion?: boolean } = {}\n ): void {\n const body: any = {\n StreamName: streamName,\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n ...(parameters.enforceConsumerDeletion && {\n EnforceConsumerDeletion: parameters.enforceConsumerDeletion,\n }),\n }\n\n this._send_request('DeleteStream', body)\n }\n\n /**\n * Returns a list of Kinesis streams with the specified parameters.\n *\n * @param {{\n * exclusiveStartStreamName?: string;\n * limit?: number;\n * nextToken?: string;\n * }} [parameters={}] - An optional object containing configuration options for listing the streams.\n * @param {string} [parameters.exclusiveStartStreamName] - The name of the stream to start listing from. If not provided, the listing starts from the beginning.\n * @param {number} [parameters.limit] - The maximum number of streams to list. If not provided, the default value will be used.\n * @param {string} [parameters.nextToken] - A token to paginate the list of streams. If not provided, the first page will be returned.\n *\n * @throws {Error} Throws an error if the list streams request fails.\n * @returns {Partial} A partial of the ListStreamsResponse class.\n */\n listStreams(\n parameters: {\n exclusiveStartStreamName?: string\n limit?: number\n nextToken?: string\n } = {}\n ): ListStreamsResponse {\n const body: any = {\n ...(parameters.exclusiveStartStreamName && {\n ExclusiveStartStreamName: parameters.exclusiveStartStreamName,\n }),\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n }\n\n const res = this._send_request('ListStreams', body)\n return ListStreamsResponse.fromJson(res?.json())\n }\n\n /**\n * Sends multiple records to a Kinesis stream in a single request.\n *\n * @param {string} streamName - The name of the stream to put records into.\n * @param {PutRecordsRequestEntry[]} records - An array of records to put into the stream.\n *\n * @throws {Error} Throws an error if the put records request fails.\n * @returns {Partial} A partial of the PutRecordsResponse class.\n */\n putRecords(\n records: PutRecordsRequestEntry[],\n parameters: { streamName?: string; streamARN?: string } = {}\n ): PutRecordsResponse {\n if (!parameters.streamName && !parameters.streamARN) {\n throw new Error('Either streamName or streamARN must be provided')\n }\n\n const body: any = {\n Records: records,\n ...(parameters.streamName && { StreamName: parameters.streamName }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('PutRecords', body)\n return PutRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves records from a Kinesis stream.\n *\n * @param {string} shardIterator - The shard iterator to start retrieving records from.\n * @param {number} [limit] - The maximum number of records to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the get records request fails.\n * @returns {Partial} A partial of the GetRecordsResponse class.\n */\n getRecords(\n shardIterator: string,\n parameters: { limit?: number; streamARN?: string } = {}\n ): GetRecordsResponse {\n const body: any = {\n ShardIterator: shardIterator,\n ...(parameters.limit && { Limit: parameters.limit }),\n ...(parameters.streamARN && { StreamARN: parameters.streamARN }),\n }\n\n const res = this._send_request('GetRecords', body)\n return GetRecordsResponse.fromJson(res?.json())\n }\n\n /**\n * Lists the shards in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream to list shards from.\n * @param {{\n * nextToken?: string;\n * maxResults?: number;\n * }} [parameters={}] - An optional object containing configuration options for listing shards.\n * @param {string} [parameters.nextToken] - A token to specify where to start paginating the shard list. If not provided, the first page will be returned.\n * @param {number} [parameters.maxResults] - The maximum number of shards to return. If not provided, the default value will be used.\n *\n * @throws {Error} Throws an error if the list shards request fails.\n * @returns {ListShardsResponse} A ListShardsResponse class instance.\n */\n listShards(\n streamName: string,\n parameters: { nextToken?: string; maxResults?: number } = {}\n ): ListShardsResponse {\n const body: any = {\n StreamName: streamName,\n ...(parameters.nextToken && { NextToken: parameters.nextToken }),\n ...(parameters.maxResults && {\n MaxResults: parameters.maxResults,\n }),\n }\n\n const res = this._send_request('ListShards', body)\n return ListShardsResponse.fromJson(res?.json())\n }\n\n /**\n * Retrieves a shard iterator for the specified shard in a Kinesis stream.\n *\n * @param {string} streamName - The name of the stream.\n * @param {string} shardId - The shard ID for which to get the iterator.\n * @param {string} shardIteratorType - The shard iterator type. One of 'AT_SEQUENCE_NUMBER', 'AFTER_SEQUENCE_NUMBER', 'TRIM_HORIZON', 'LATEST', or 'AT_TIMESTAMP'.\n * @param {{\n * startingSequenceNumber?: string;\n * timestamp?: number;\n * }} [parameters={}] - An optional object containing configuration options for the shard iterator.\n * @param {string} [parameters.startingSequenceNumber] - The sequence number to start with when using 'AT_SEQUENCE_NUMBER' or 'AFTER_SEQUENCE_NUMBER' iterator types.\n * @param {number} [parameters.timestamp] - The timestamp to start with when using the 'AT_TIMESTAMP' iterator type.\n *\n * @throws {Error} Throws an error if the get shard iterator request fails.\n * @returns {string} The next position in the shard from which to start sequentially reading data records. If set to null, the shard has been closed and the requested iterator does not return any more data.\n */\n getShardIterator(\n streamName: string,\n shardId: string,\n shardIteratorType: ShardIteratorKind,\n parameters: { startingSequenceNumber?: string; timestamp?: number } = {}\n ): GetShardIteratorResponse {\n const body: any = {\n StreamName: streamName,\n ShardId: shardId,\n ShardIteratorType: shardIteratorType,\n ...(parameters.startingSequenceNumber && {\n StartingSequenceNumber: parameters.startingSequenceNumber,\n }),\n ...(parameters.timestamp && { Timestamp: parameters.timestamp }),\n }\n\n const res = this._send_request('GetShardIterator', body)\n return GetShardIteratorResponse.fromJson(res?.json())\n }\n\n private _send_request(action: string, body: any): any {\n const signedRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceVersion}.${action}`,\n },\n body: JSON.stringify(body),\n },\n {}\n )\n\n const res = http.request('POST', signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(action, res)\n return res\n }\n\n /**\n * If the response is an error, throw an error\n *\n * @param {string} operation - The name of the operation that was called.\n * @param response - RefinedResponse\n * @returns The response is being returned.\n */\n _handle_error(operation: string, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KinesisServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KinesisServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/* `KinesisServiceError` is a subclass of `AWSError` that adds an `operation` property */\nexport class KinesisServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a KinesisServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'KinesisServiceError'\n this.operation = operation\n }\n}\n\n/**\n * Describes the options for a Kinesis stream.\n */\ntype StreamMode = 'PROVISIONED' | 'ON_DEMAND'\n\n/**\n * Determines how the shard iterator is used to start reading data records from the shard.\n */\nexport type ShardIteratorKind =\n | 'AT_SEQUENCE_NUMBER'\n | 'AFTER_SEQUENCE_NUMBER'\n | 'TRIM_HORIZON'\n | 'LATEST'\n | 'AT_TIMESTAMP'\n\n/**\n * Describes the status of a Kinesis data stream.\n */\nexport type StreamStatus = 'CREATING' | 'DELETING' | 'ACTIVE' | 'UPDATING'\n\nexport type StreamModeDetails = {\n /**\n * Specifies the capacity mode to which you want to set your data stream.\n */\n SteamMode: 'PROVISIONED' | 'ON_DEMAND'\n}\n\nexport class ListStreamsResponse {\n /**\n * Indicates whether there are more streams available to list.\n */\n HasMoreStreams: boolean\n\n /**\n * The token that identifies which batch of results you can retrieve.\n */\n NextToken?: string\n\n /**\n * The names of the streams that are associated with the AWS account making the ListStreams request.\n */\n StreamNames: string[]\n\n /**\n * A list of StreamSummary objects.\n */\n StreamSummaries: StreamSummary[]\n\n constructor(\n HasMoreStreams: boolean,\n NextToken: string,\n StreamNames: string[],\n StreamSummaries: StreamSummary[]\n ) {\n this.HasMoreStreams = HasMoreStreams\n this.NextToken = NextToken\n this.StreamNames = StreamNames\n this.StreamSummaries = StreamSummaries\n }\n\n static fromJson(result: any): ListStreamsResponse {\n const {\n HasMoreStreams = false,\n NextToken = '',\n StreamNames = [],\n StreamSummaries = [],\n } = result\n\n return new ListStreamsResponse(\n HasMoreStreams,\n NextToken,\n StreamNames.map((s: any) => String(s)),\n StreamSummaries.map(StreamSummary.fromJson)\n )\n }\n}\n\n/**\n * Summarizes a Stream\n */\nexport class StreamSummary {\n /**\n * The Amazon Resource Name (ARN) for the stream.\n */\n StreamARN: string\n\n /**\n * The time at which the stream was created.\n */\n StreamCreationTimestamp: number\n\n /**\n * Specify the capacity mode to which you want to set your data stream.\n */\n StreamModeDetails: StreamModeDetails\n\n /**\n * The name of the stream.\n */\n StreamName: string\n\n /**\n * The current status of the stream being described.\n */\n StreamStatus: StreamStatus\n\n constructor(\n StreamARN: string,\n StreamCreationTimestamp: number,\n StreamMode: StreamModeDetails,\n StreamName: string,\n StreamStatus: StreamStatus\n ) {\n this.StreamARN = StreamARN\n this.StreamCreationTimestamp = StreamCreationTimestamp\n this.StreamModeDetails = StreamMode\n this.StreamName = StreamName\n this.StreamStatus = StreamStatus\n }\n\n static fromJson(summary: any): StreamSummary {\n const {\n StreamARN = '',\n StreamCreationTimestamp = 0,\n StreamModeDetails = {},\n StreamName = '',\n StreamStatus = '',\n } = summary\n\n return new StreamSummary(\n StreamARN,\n StreamCreationTimestamp,\n StreamModeDetails,\n StreamName,\n StreamStatus\n )\n }\n}\n\n/**\n * Represents the output for PutRecords.\n */\nexport interface PutRecordsRequestEntry {\n /**\n * The data blob to put into the record, which is base64-encoded when the blob is serialized.\n */\n Data: string | ArrayBuffer\n\n /**\n * Datemines which share in the stream the data record is assigned to.\n */\n PartitionKey: string\n}\n\n// Response class for PutRecords API\nexport class PutRecordsResponse {\n /**\n * The encryption type used on the records. This parameter can be one of the following values:\n * - NONE: Do not encrypt the records.\n * - KMS: Use server-side encryption on the records using a customer-managed AWS KMS key.\n */\n EncryptionType: 'NONE' | 'KMS'\n\n /**\n * The number of unsuccessfully processed records in a PutRecords request.\n */\n FailedRecordCount: number\n\n /**\n * An array of succesffully and unsuccessfully processed record results.\n */\n Records: PutRecordsResultEntry[]\n\n constructor(\n encryptionType: 'NONE' | 'KMS',\n failedRecordCount: number,\n records: PutRecordsResultEntry[]\n ) {\n this.EncryptionType = encryptionType\n this.FailedRecordCount = failedRecordCount\n this.Records = records\n }\n\n static fromJson(json: any): PutRecordsResponse {\n const { EncryptionType = 'NONE', FailedRecordCount = 0, Records = [] } = json\n const records = Records.map((record: any) => PutRecordsResultEntry.fromJson(record))\n\n return new PutRecordsResponse(EncryptionType, FailedRecordCount, records)\n }\n}\n\n/**\n * Represents the result of an individual record from a PutRecords request.\n */\nexport class PutRecordsResultEntry {\n /**\n * The sequence number for an individual record result.\n */\n SequenceNumber: string\n\n /**\n * The shard ID for an individual record result.\n */\n ShardId: string\n\n constructor(sequenceNumber: string, shardId: string) {\n this.SequenceNumber = sequenceNumber\n this.ShardId = shardId\n }\n\n static fromJson(json: any): PutRecordsResultEntry {\n return new PutRecordsResultEntry(json.SequenceNumber, json.ShardId)\n }\n}\n\n/**\n * Represents the response format of the GetRecords operation.\n */\nexport class GetRecordsResponse {\n /**\n * The next position in the shard from which to start sequentially reading data records.\n */\n NextShardIterator: string\n\n /**\n * The data records retrieved from the shard.\n */\n Records: Record[]\n\n constructor(nextShardIterator: string, records: Record[]) {\n this.NextShardIterator = nextShardIterator\n this.Records = records\n }\n\n static fromJson(json: any): GetRecordsResponse {\n const { NextShardIterator = '', Records = [] } = json\n const records = Records.map((record: Record) => Record.fromJson(record))\n\n return new GetRecordsResponse(NextShardIterator, records)\n }\n}\n\n/**\n * The unit of data of the Kinesis data stream, which is composed of a sequence\n * number, a partition key, and a data blob.\n */\nclass Record {\n /**\n * The data blob.\n */\n Data: string | ArrayBuffer\n\n /**\n * Identifies which shard in the stream the data record is assigned to.\n */\n PartitionKey: string\n\n /**\n * The unique identifier of the record in the stream.\n */\n SequenceNumber: string\n\n constructor(data: string | ArrayBuffer, partitionKey: string, sequenceNumber: string) {\n this.Data = data\n this.PartitionKey = partitionKey\n this.SequenceNumber = sequenceNumber\n }\n\n static fromJson(json: any): Record {\n return new Record(json.Data, json.PartitionKey, json.SequenceNumber)\n }\n}\n\n// Response class for ListShards API\nexport class ListShardsResponse {\n /**\n * An array of JSON objects.\n *\n * Each object represents one shard and specifies the IDs of the shard, the\n * shard's parent, and the shard that's adjacent to the shard's parent.\n */\n Shards: Shard[]\n\n /**\n * When the number of shards in the data stream is greater than the\n * default value for the MaxResults parameter, or if you explicitly specify\n * a value for MaxResults that is less than the number of shards in the data\n * stream, the response includes a pagination token named NextToken.\n */\n NextToken?: string\n\n constructor(shards: Shard[], nextToken?: string) {\n this.Shards = shards\n this.NextToken = nextToken\n }\n\n static fromJson(json: any): ListShardsResponse {\n const { Shards = [], NextToken } = json\n const shards = Shards.map((shard: Shard) => Shard.fromJson(shard))\n\n return new ListShardsResponse(shards, NextToken)\n }\n}\n\n/**\n * A uniquely identified group of data records in a Kinesis data stream.\n */\nexport class Shard {\n /**\n * The unique identifier of the shard within the stream.\n */\n Id: string\n\n /**\n * The shard ID of the shard's parent.\n */\n ParentShardId?: string\n\n /**\n * The shard ID of the shard adjacent to the shard's parent.\n */\n AdjacentParentShardId?: string\n\n /**\n * The range of possible hash key values for the shard, which is a set of ordered contiguous positive integers.\n */\n HashKeyRange: HashKeyRange\n\n SequenceNumberRange: SequenceNumberRange\n\n constructor(\n id: string,\n hashKeyRange: HashKeyRange,\n sequenceNumberRange: SequenceNumberRange,\n parentShardId?: string,\n adjacentParentShardId?: string\n ) {\n this.Id = id\n this.ParentShardId = parentShardId\n this.AdjacentParentShardId = adjacentParentShardId\n this.HashKeyRange = hashKeyRange\n this.SequenceNumberRange = sequenceNumberRange\n }\n\n static fromJson(json: any): Shard {\n return new Shard(\n json.ShardId,\n json.HashKeyRange,\n json.SequenceNumberRange,\n json.ParentShardId,\n json.AdjacentParentShardId\n )\n }\n}\n\n/**\n * Describes the range of possible hash key values for the shard, which is\n * a set of ordered contiguous positive integers.\n */\nexport interface HashKeyRange {\n /**\n * The starting hash key of the hash key range.\n */\n StartingHashKey: string\n\n /**\n * The ending hash key of the hash key range.\n */\n EndingHashKey: string\n}\n\n/**\n * The range of possible sequence numbers for the shard.\n */\nexport interface SequenceNumberRange {\n /**\n * The ending sequence number for the range.\n *\n * Shards that are in the OPEN state have an ending sequence number of null.\n */\n EndingSequenceNumber?: string\n\n /**\n * The starting sequence number for the range.\n */\n StartingSequenceNumber: string\n}\n\n/**\n * Describes a shard iterator response.\n */\nclass GetShardIteratorResponse {\n /**\n * The position in the shard from which to start reading data records sequentially.\n */\n ShardIterator: string\n\n constructor(shardIterator: string) {\n this.ShardIterator = shardIterator\n }\n\n static fromJson(json: any): GetShardIteratorResponse {\n return new GetShardIteratorResponse(json.ShardIterator)\n }\n}\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","indexOf","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","KinesisClient","_AWSClient","awsConfig","serviceVersion","serviceName","commonHeaders","streamName","StreamName","shardCount","ShardCount","streamModeDetails","StreamMode","streamMode","_send_request","parameters","streamARN","StreamARN","enforceConsumerDeletion","EnforceConsumerDeletion","exclusiveStartStreamName","ExclusiveStartStreamName","limit","Limit","nextToken","NextToken","res","ListStreamsResponse","fromJson","json","records","Records","PutRecordsResponse","shardIterator","ShardIterator","GetRecordsResponse","maxResults","MaxResults","ListShardsResponse","shardId","shardIteratorType","ShardId","ShardIteratorType","startingSequenceNumber","StartingSequenceNumber","timestamp","Timestamp","GetShardIteratorResponse","action","signedRequest","sign","host","http","_handle_error","operation","response","errorCode","error_code","error","errorMessage","Message","__type","KinesisServiceError","AWSClient","_host","set","_scheme","_super2","_this2","HasMoreStreams","StreamNames","StreamSummaries","result","_result$HasMoreStream","_result$NextToken","_result$StreamNames","_result$StreamSummari","String","StreamSummary","StreamCreationTimestamp","StreamStatus","StreamModeDetails","summary","_summary$StreamARN","_summary$StreamCreati","_summary$StreamModeDe","_summary$StreamName","_summary$StreamStatus","encryptionType","failedRecordCount","EncryptionType","FailedRecordCount","_json$EncryptionType","_json$FailedRecordCou","_json$Records","record","PutRecordsResultEntry","sequenceNumber","SequenceNumber","nextShardIterator","NextShardIterator","_json$NextShardIterat","_json$Records2","Record","data","partitionKey","Data","PartitionKey","shards","Shards","_json$Shards","shard","Shard","id","hashKeyRange","sequenceNumberRange","parentShardId","adjacentParentShardId","Id","ParentShardId","AdjacentParentShardId","HashKeyRange","SequenceNumberRange"],"sourceRoot":""} \ No newline at end of file diff --git a/build/kms.js.map b/build/kms.js.map index 8cd4443..326bbc0 100644 --- a/build/kms.js.map +++ b/build/kms.js.map @@ -1 +1 @@ -{"version":3,"file":"kms.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI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ib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/./src/internal/kms.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's KMS service\n */\nexport class KMSClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a KMSClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kms')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the KMS service\n // are made via the GET or POST method.\n this.method = 'POST'\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Gets a list of all the KMS keys in the caller's AWS\n * account and region.\n *\n * @returns an array of all the available keys\n */\n listKeys(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.ListKeys`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.ListKeys, res)\n\n const json: JSONArray = res.json('Keys') as JSONArray\n return json.map((k) => KMSKey.fromJSON(k as JSONObject))\n }\n\n /**\n * GenerateDataKey returns a unique symmetric data key for use outside of AWS KMS.\n *\n * This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.\n * The bytes in the plaintext key are random; they are not related to the caller or the KMS key.\n * You can use the plaintext key to encrypt your data outside of AWS KMS and store the encrypted data key with the encrypted data.\n *\n * To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key.\n * You cannot use an asymmetric KMS key to encrypt data keys.\n *\n * Used to generate data key with the KMS key defined\n * @param {string} id - Specifies the symmetric encryption KMS key that encrypts the data key. Use its key ID, key ARN, alias name, or alias ARN.\n * @param {KMKeySize} size - Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). Default is 32, and generates a 256-bit data key.\n * @throws {KMSServiceError}\n * @throws {InvalidSignatureError}\n * @returns {KMSDataKey} - The generated data key.\n */\n generateDataKey(id: string, size: KMSKeySize = KMSKeySize.Size256): KMSDataKey | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.GenerateDataKey`,\n },\n body: JSON.stringify({ KeyId: id, NumberOfBytes: size }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.GenerateDataKey, res)\n\n return KMSDataKey.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(operation: KMSOperation, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KMSServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KMSServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a KMS key\n */\nexport class KMSKey {\n /**\n * ARN of the key\n */\n keyArn: string\n\n /**\n * Unique identifier of the key\n */\n keyId: string\n\n constructor(keyArn: string, KeyId: string) {\n this.keyArn = keyArn\n this.keyId = KeyId\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSKey(json.KeyArn as string, json.KeyId as string)\n }\n}\n\n/**\n * Class representing a data key\n */\nexport class KMSDataKey {\n /**\n * The Amazon Resource Name (key ARN) of the KMS key that encrypted the data key.\n */\n id: string\n\n /**\n * The (base64-encoded) encrypted copy of the data key.\n */\n ciphertextBlob: string\n\n /**\n * The plaintext data key.\n * Use this data key to encrypt your data outside of KMS. Then, remove it from memory as soon as possible.\n */\n plaintext: string\n\n constructor(CiphertextBlob: string, KeyId: string, Plaintext: string) {\n this.ciphertextBlob = CiphertextBlob\n this.id = KeyId\n this.plaintext = Plaintext\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSDataKey(\n json.CiphertextBlob as string,\n json.KeyId as string,\n json.Plaintext as string\n )\n }\n}\n\nexport class KMSServiceError extends AWSError {\n operation: KMSOperation\n\n /**\n * Constructs a KMSServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: KMSOperation) {\n super(message, code)\n this.name = 'KMSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * KMSOperation defines all currently implemented KMS Service operations.\n */\nenum KMSOperation {\n GenerateDataKey = 'GenerateDataKey',\n ListKeys = 'ListKeys',\n}\n\n/**\n * KMSKeyLength describes possible key lenght values for KMS API data key operations.\n */\nenum KMSKeySize {\n Size256 = 32,\n Size512 = 64,\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AWSClient","awsConfig","serviceName","_host","set","host","_scheme","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","KMSClient","_AWSClient","commonHeaders","signedRequest","sign","res","http","_handle_error","KMSOperation","ListKeys","json","k","KMSKey","fromJSON","id","size","KMSKeySize","Size256","KeyId","NumberOfBytes","GenerateDataKey","KMSDataKey","operation","response","errorCode","error_code","error","errorMessage","Message","__type","KMSServiceError","keyArn","keyId","KeyArn","CiphertextBlob","Plaintext","ciphertextBlob","plaintext","_super2","_this2"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"kms.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAA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SAAZA,GAAY,OAAZA,EAAY,kCAAZA,EAAY,oBAAZA,CAAY,EAAZA,IAAY,IAQZQ,GAAU,SAAVA,GAAU,OAAVA,EAAAA,EAAU,sBAAVA,EAAAA,EAAU,sBAAVA,CAAU,EAAVA,IAAU,I","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/./src/internal/kms.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's KMS service\n */\nexport class KMSClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a KMSClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'kms')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the KMS service\n // are made via the GET or POST method.\n this.method = 'POST'\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Gets a list of all the KMS keys in the caller's AWS\n * account and region.\n *\n * @returns an array of all the available keys\n */\n listKeys(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.ListKeys`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.ListKeys, res)\n\n const json: JSONArray = res.json('Keys') as JSONArray\n return json.map((k) => KMSKey.fromJSON(k as JSONObject))\n }\n\n /**\n * GenerateDataKey returns a unique symmetric data key for use outside of AWS KMS.\n *\n * This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.\n * The bytes in the plaintext key are random; they are not related to the caller or the KMS key.\n * You can use the plaintext key to encrypt your data outside of AWS KMS and store the encrypted data key with the encrypted data.\n *\n * To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key.\n * You cannot use an asymmetric KMS key to encrypt data keys.\n *\n * Used to generate data key with the KMS key defined\n * @param {string} id - Specifies the symmetric encryption KMS key that encrypts the data key. Use its key ID, key ARN, alias name, or alias ARN.\n * @param {KMKeySize} size - Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). Default is 32, and generates a 256-bit data key.\n * @throws {KMSServiceError}\n * @throws {InvalidSignatureError}\n * @returns {KMSDataKey} - The generated data key.\n */\n generateDataKey(id: string, size: KMSKeySize = KMSKeySize.Size256): KMSDataKey | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n // For some reason, the base target is not kms...\n [AMZ_TARGET_HEADER]: `TrentService.GenerateDataKey`,\n },\n body: JSON.stringify({ KeyId: id, NumberOfBytes: size }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(KMSOperation.GenerateDataKey, res)\n\n return KMSDataKey.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(operation: KMSOperation, response: RefinedResponse) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new KMSServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new KMSServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a KMS key\n */\nexport class KMSKey {\n /**\n * ARN of the key\n */\n keyArn: string\n\n /**\n * Unique identifier of the key\n */\n keyId: string\n\n constructor(keyArn: string, KeyId: string) {\n this.keyArn = keyArn\n this.keyId = KeyId\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSKey(json.KeyArn as string, json.KeyId as string)\n }\n}\n\n/**\n * Class representing a data key\n */\nexport class KMSDataKey {\n /**\n * The Amazon Resource Name (key ARN) of the KMS key that encrypted the data key.\n */\n id: string\n\n /**\n * The (base64-encoded) encrypted copy of the data key.\n */\n ciphertextBlob: string\n\n /**\n * The plaintext data key.\n * Use this data key to encrypt your data outside of KMS. Then, remove it from memory as soon as possible.\n */\n plaintext: string\n\n constructor(CiphertextBlob: string, KeyId: string, Plaintext: string) {\n this.ciphertextBlob = CiphertextBlob\n this.id = KeyId\n this.plaintext = Plaintext\n }\n\n static fromJSON(json: JSONObject) {\n return new KMSDataKey(\n json.CiphertextBlob as string,\n json.KeyId as string,\n json.Plaintext as string\n )\n }\n}\n\nexport class KMSServiceError extends AWSError {\n operation: KMSOperation\n\n /**\n * Constructs a KMSServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: KMSOperation) {\n super(message, code)\n this.name = 'KMSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * KMSOperation defines all currently implemented KMS Service operations.\n */\nenum KMSOperation {\n GenerateDataKey = 'GenerateDataKey',\n ListKeys = 'ListKeys',\n}\n\n/**\n * KMSKeyLength describes possible key lenght values for KMS API data key operations.\n */\nenum KMSKeySize {\n Size256 = 32,\n Size512 = 64,\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AWSClient","awsConfig","serviceName","_host","set","host","_scheme","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","indexOf","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","KMSClient","_AWSClient","commonHeaders","signedRequest","sign","res","http","_handle_error","KMSOperation","ListKeys","json","k","KMSKey","fromJSON","id","size","KMSKeySize","Size256","KeyId","NumberOfBytes","GenerateDataKey","KMSDataKey","operation","response","errorCode","error_code","error","errorMessage","Message","__type","KMSServiceError","keyArn","keyId","KeyArn","CiphertextBlob","Plaintext","ciphertextBlob","plaintext","_super2","_this2"],"sourceRoot":""} \ No newline at end of file diff --git a/build/s3.js.map b/build/s3.js.map index dea1016..f312077 100644 --- a/build/s3.js.map +++ b/build/s3.js.map @@ -1 +1 @@ -{"version":3,"file":"s3.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,82FCFvD,IAAMC,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCC,EAAA,KAAAF,GArFvCG,EAAA,sBAOAA,EAAA,2BAOAA,EAAA,+BAOAA,EAAA,4BAOAA,EAAA,cAKqB,SAIrBA,EAAA,gBAKmB,kBA4CVF,EAAQG,QAA6B,KAAnBH,EAAQG,OAC3B,MAAM,IAAIC,EAAsB,yFAADC,OAC+DL,EAAQG,OAAM,MAIhH,IAAKH,EAAQM,aAAuC,KAAxBN,EAAQM,YAChC,MAAM,IAAIF,EAAsB,wEAADC,OAC8CL,EAAQM,YAAW,MAIpG,GAAIN,EAAQM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AAQxP,IAUjB,SAAAwP,EAAY/M,EAAc0K,GAAoBhO,GAAA,KAAAqQ,GAAApQ,GAAA,oBAAAA,GAAA,4BAC1CO,KAAK8C,KAAOA,EACZ9C,KAAKwN,aAAeA,CACxB,IAISY,GAAQ/N,IAkBjB,SAAA+N,EACI5P,EACAqP,EACAC,EACAC,EACAE,EACAI,GACF7O,GAAA,KAAA4O,GAAA3O,GAAA,mBAAAA,GAAA,4BAAAA,GAAA,oBAAAA,GAAA,oBAAAA,GAAA,4BAAAA,GAAA,oBACEO,KAAKxB,IAAMA,EACXwB,KAAK6N,aAAeA,EACpB7N,KAAK8N,KAAOA,EACZ9N,KAAK+N,KAAOA,EACZ/N,KAAKiO,aAAeA,EACpBjO,KAAKqO,KAAOA,CAChB,IAISG,GAAiBnO,IAU1B,SAAAmO,EAAYhQ,EAAaiQ,GAAkBjP,GAAA,KAAAgP,GAAA/O,GAAA,mBAAAA,GAAA,wBACvCO,KAAKxB,IAAMA,EACXwB,KAAKyO,SAAWA,CACpB,IAISE,GAAMtO,IAUf,SAAAsO,EAAYD,EAAoBI,GAActP,GAAA,KAAAmP,GAAAlP,GAAA,0BAAAA,GAAA,oBAC1CO,KAAK0O,WAAaA,EAClB1O,KAAK8O,KAAOA,CAChB,IAWSQ,GAAc,SAAA5D,GAAA9K,GAAA0O,EAAA5D,GAAA,IAAAoE,EAAAhP,GAAAwO,GAUvB,SAAAA,EAAYvO,EAAiB4B,EAAcoM,GAAmB,IAAAgB,EAGhC,OAHgCvQ,GAAA,KAAA8P,GACtC7P,GAAAoD,GAApBkN,EAAAD,EAAA5Q,KAAA,KAAM6B,EAAS4B,IAAK,oBACpBoN,EAAKjN,KAAO,iBACZiN,EAAKhB,UAAYA,EAASgB,CAC9B,CAAC,OAAA1P,GAAAiP,EAAA,CAdsB,CAAS5M,G","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/s3.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { bytes } from 'k6'\nimport { parseHTML } from 'k6/html'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AWSError } from './error'\nimport { SignedHTTPRequest } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n\n/** Class allowing to interact with Amazon AWS's S3 service */\nexport class S3Client extends AWSClient {\n signature: SignatureV4\n\n /**\n * Create a S3Client\n *\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 's3')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n }\n\n /**\n * Returns a list of all buckets owned by the authenticated sender of the request.\n * To use this operation, you must have the s3:ListAllMyBuckets permission.\n *\n * @return {Array.} buckets - An array of objects describing S3 buckets\n * with the following fields: name, and creationDate.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listBuckets(): Array {\n const method = 'GET'\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListBuckets', res)\n\n let buckets: Array = []\n\n const doc = parseHTML(res.body as string)\n\n doc.find('Buckets')\n .children()\n .each((_, bucketDefinition) => {\n let bucket = {}\n\n bucketDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'name':\n Object.assign(bucket, { name: child.textContent() })\n break\n case 'creationdate':\n Object.assign(bucket, {\n creationDate: Date.parse(child.textContent()),\n })\n }\n })\n\n buckets.push(bucket as S3Bucket)\n })\n\n return buckets\n }\n\n /**\n * Returns some or all (up to 1,000) of the objects in a bucket.\n *\n * @param {string} bucketName - Bucket name to list.\n * @param {string?} prefix='' - Limits the response to keys that begin with the specified prefix.\n * @return {Array.} - returns an array of objects describing S3 objects\n * with the following fields: key, lastModified, etag, size and storageClass.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listObjects(bucketName: string, prefix?: string): Array {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/`,\n query: {\n 'list-type': '2',\n prefix: prefix || '',\n },\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListObjectsV2', res)\n\n let objects: Array = []\n\n // Extract the objects definition from\n // the XML response\n parseHTML(res.body as string)\n .find('Contents')\n .each((_, objectDefinition) => {\n let obj = {}\n\n objectDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'key':\n Object.assign(obj, { key: child.textContent() })\n break\n case 'lastmodified':\n Object.assign(obj, { lastModified: Date.parse(child.textContent()) })\n break\n case 'etag':\n Object.assign(obj, { etag: child.textContent() })\n break\n case 'size':\n Object.assign(obj, { size: parseInt(child.textContent()) })\n break\n case 'storageclass':\n Object.assign(obj, { storageClass: child.textContent() })\n }\n })\n\n objects.push(obj as S3Object)\n })\n\n return objects\n }\n /**\n * Retrieves an Object from Amazon S3.\n *\n * To use getObject, you must have `READ` access to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to get.\n * @return {S3Object} - returns the content of the fetched S3 Object.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n getObject(bucketName: string, objectKey: string): S3Object {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('GetObject', res)\n\n return new S3Object(\n objectKey,\n Date.parse(res.headers['Last-Modified']),\n res.headers['ETag'],\n parseInt(res.headers['Content-Length']),\n\n // The X-Amz-Storage-Class header is only set if the storage class is\n // not the default 'STANDARD' one.\n (res.headers['X-Amz-Storage-Class'] ?? 'STANDARD') as StorageClass,\n\n res.body\n )\n }\n /**\n * Adds an object to a bucket.\n *\n * You must have WRITE permissions on a bucket to add an object to it.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to put.\n * @param {string | ArrayBuffer} data - the content of the S3 Object to upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {\n // Prepare request\n const method = 'PUT'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {\n Host: host,\n },\n body: data,\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error('PutObject', res)\n }\n\n /**\n * Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteObject(bucketName: string, objectKey: string): void {\n // Prepare request\n const method = 'DELETE'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('DeleteObject', res)\n }\n\n /**\n * Creates a new multipart upload for a given objectKey.\n * The uploadId returned can be used to upload parts to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @return {S3MultipartUpload} - returns the uploadId of the newly created multipart upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n createMultipartUpload(bucketName: string, objectKey: string): S3MultipartUpload {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: { uploads: '' },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('CreateMultipartUpload', res)\n\n return new S3MultipartUpload(\n objectKey,\n parseHTML(res.body as string)\n .find('UploadId')\n .text()\n )\n }\n\n /**\n * Uploads a part in a multipart upload.\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @param {string} uploadId - The uploadId of the multipart upload.\n * @param {number} partNumber - The part number of the part to upload.\n * @param {string | ArrayBuffer} data - The content of the part to upload.\n * @return {S3Part} - returns the ETag of the uploaded part.\n * @throws {S3ServiceError}\n */\n uploadPart(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n partNumber: number,\n data: string | ArrayBuffer\n ): S3Part {\n // Prepare request\n const method = 'PUT'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: data,\n query: {\n partNumber: `${partNumber}`,\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('UploadPart', res)\n\n return new S3Part(partNumber, res.headers['Etag'])\n }\n\n /**\n * Completes a multipart upload by assembling previously uploaded parts.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to complete.\n * @param {S3Part[]} parts - The parts to assemble.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n completeMultipartUpload(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n parts: S3Part[]\n ) {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n const body = `${parts\n .map(\n (part) =>\n `${part.partNumber}${part.eTag}`\n )\n .join('')}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: body,\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n\n this._handle_error('CompleteMultipartUpload', res)\n }\n\n /**\n * Aborts a multipart upload.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to abort.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string) {\n // Prepare request\n const method = 'DELETE'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('AbortMultipartUpload', res)\n }\n\n _handle_error(operation: S3Operation, response: RefinedResponse) {\n const status: number = response.status\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n // We consider codes 200-299 as success\n if (status >= 200 && status < 300 && errorMessage == '' && errorCode === 0) {\n return\n }\n\n // A 301 response is returned when the bucket is not found.\n // Generally meaning that either the bucket name is wrong or the\n // region is wrong.\n //\n // See: https://github.com/grafana/k6/issues/2474\n // See: https://github.com/golang/go/issues/49281\n if (status == 301 || (errorMessage && errorMessage.startsWith('301'))) {\n throw new S3ServiceError('Resource not found', 'ResourceNotFound', operation)\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new S3ServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/** Class representing a S3 Bucket */\nexport class S3Bucket {\n name: string\n creationDate: Date\n\n /**\n * Create an S3 Bucket\n *\n * @param {string} name - S3 bucket's name\n * @param {Date} creationDate - S3 bucket's creation date\n */\n constructor(name: string, creationDate: Date) {\n this.name = name\n this.creationDate = creationDate\n }\n}\n\n/** Class representing an S3 Object */\nexport class S3Object {\n key: string\n lastModified: number\n etag: string\n size: number\n storageClass: StorageClass\n data?: string | bytes | null\n\n /**\n * Create an S3 Object\n *\n * @param {string} key - S3 object's key\n * @param {Date} lastModified - S3 object last modification date\n * @param {string} etag - S3 object's etag\n * @param {number} size - S3 object's size\n * @param {StorageClass} storageClass - S3 object's storage class\n * @param {string | bytes | null} data=null - S3 Object's data\n */\n constructor(\n key: string,\n lastModified: number,\n etag: string,\n size: number,\n storageClass: StorageClass,\n data?: string | bytes | null\n ) {\n this.key = key\n this.lastModified = lastModified\n this.etag = etag\n this.size = size\n this.storageClass = storageClass\n this.data = data\n }\n}\n\n/** Class representing a S3 Multipart Upload */\nexport class S3MultipartUpload {\n key: string\n uploadId: string\n\n /**\n * Create an S3 Multipart Upload\n * @param {string} key - S3 object's key\n * @param {string} uploadId - S3 multipart upload id\n */\n\n constructor(key: string, uploadId: string) {\n this.key = key\n this.uploadId = uploadId\n }\n}\n\n/** Class representing a S3 Part */\nexport class S3Part {\n partNumber: number\n eTag: string\n\n /**\n * Create an S3 Part\n * @param {number} partNumber - Part number\n * @param {string} eTag - Part's etag\n */\n\n constructor(partNumber: number, eTag: string) {\n this.partNumber = partNumber\n this.eTag = eTag\n }\n}\n\n/**\n * Error indicating a S3 operation failed\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class S3ServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a S3ServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'S3ServiceError'\n this.operation = operation\n }\n}\n\n/**\n * S3Operation describes possible values for S3 API operations,\n * as defined by AWS APIs.\n */\ntype S3Operation =\n | 'ListBuckets'\n | 'ListObjectsV2'\n | 'GetObject'\n | 'PutObject'\n | 'DeleteObject'\n | 'CreateMultipartUpload'\n | 'CompleteMultipartUpload'\n | 'UploadPart'\n | 'AbortMultipartUpload'\n\n/**\n * Describes the class of storage used to store a S3 object.\n */\ntype StorageClass =\n | 'STANDARD'\n | 'REDUCED_REDUNDANCY'\n | 'GLACIER'\n | 'STANDARD_IA'\n | 'INTELLIGENT_TIERING'\n | 'DEEP_ARCHIVE'\n | 'OUTPOSTS'\n | 'GLACIER_IR'\n | undefined\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","S3Client","_AWSClient","awsConfig","serviceName","signedRequest","sign","host","res","http","_handle_error","buckets","children","each","_","bucketDefinition","bucket","forEach","child","nodeName","assign","textContent","creationDate","bucketName","prefix","objects","objectDefinition","lastModified","etag","size","parseInt","storageClass","objectKey","_res$headers$XAmzSt","S3Object","data","Host","uploads","S3MultipartUpload","uploadId","partNumber","S3Part","parts","part","eTag","operation","response","status","errorCode","error_code","errorMessage","error","S3ServiceError","awsError","parseXML","AWSClient","_host","set","_scheme","S3Bucket","_super2","_this2"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"s3.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IAC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AAA,GAAA,oBAC1CO,KAAK2O,WAAaA,EAClB3O,KAAK+O,KAAOA,CAChB,IAWSQ,GAAc,SAAA5D,GAAA/K,GAAA2O,EAAA5D,GAAA,IAAAoE,EAAAjP,GAAAyO,GAUvB,SAAAA,EAAYxO,EAAiB4B,EAAcqM,GAAmB,IAAAgB,EAGhC,OAHgCxQ,GAAA,KAAA+P,GACtC9P,GAAAoD,GAApBmN,EAAAD,EAAA7Q,KAAA,KAAM6B,EAAS4B,IAAK,oBACpBqN,EAAKlN,KAAO,iBACZkN,EAAKhB,UAAYA,EAASgB,CAC9B,CAAC,OAAA3P,GAAAkP,EAAA,CAdsB,CAAS7M,G","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/s3.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { bytes } from 'k6'\nimport { parseHTML } from 'k6/html'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AWSError } from './error'\nimport { SignedHTTPRequest } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n\n/** Class allowing to interact with Amazon AWS's S3 service */\nexport class S3Client extends AWSClient {\n signature: SignatureV4\n\n /**\n * Create a S3Client\n *\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 's3')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: false,\n applyChecksum: true,\n })\n }\n\n /**\n * Returns a list of all buckets owned by the authenticated sender of the request.\n * To use this operation, you must have the s3:ListAllMyBuckets permission.\n *\n * @return {Array.} buckets - An array of objects describing S3 buckets\n * with the following fields: name, and creationDate.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listBuckets(): Array {\n const method = 'GET'\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListBuckets', res)\n\n let buckets: Array = []\n\n const doc = parseHTML(res.body as string)\n\n doc.find('Buckets')\n .children()\n .each((_, bucketDefinition) => {\n let bucket = {}\n\n bucketDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'name':\n Object.assign(bucket, { name: child.textContent() })\n break\n case 'creationdate':\n Object.assign(bucket, {\n creationDate: Date.parse(child.textContent()),\n })\n }\n })\n\n buckets.push(bucket as S3Bucket)\n })\n\n return buckets\n }\n\n /**\n * Returns some or all (up to 1,000) of the objects in a bucket.\n *\n * @param {string} bucketName - Bucket name to list.\n * @param {string?} prefix='' - Limits the response to keys that begin with the specified prefix.\n * @return {Array.} - returns an array of objects describing S3 objects\n * with the following fields: key, lastModified, etag, size and storageClass.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n listObjects(bucketName: string, prefix?: string): Array {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/`,\n query: {\n 'list-type': '2',\n prefix: prefix || '',\n },\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('ListObjectsV2', res)\n\n let objects: Array = []\n\n // Extract the objects definition from\n // the XML response\n parseHTML(res.body as string)\n .find('Contents')\n .each((_, objectDefinition) => {\n let obj = {}\n\n objectDefinition.children().forEach((child) => {\n switch (child.nodeName()) {\n case 'key':\n Object.assign(obj, { key: child.textContent() })\n break\n case 'lastmodified':\n Object.assign(obj, { lastModified: Date.parse(child.textContent()) })\n break\n case 'etag':\n Object.assign(obj, { etag: child.textContent() })\n break\n case 'size':\n Object.assign(obj, { size: parseInt(child.textContent()) })\n break\n case 'storageclass':\n Object.assign(obj, { storageClass: child.textContent() })\n }\n })\n\n objects.push(obj as S3Object)\n })\n\n return objects\n }\n /**\n * Retrieves an Object from Amazon S3.\n *\n * To use getObject, you must have `READ` access to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to get.\n * @return {S3Object} - returns the content of the fetched S3 Object.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n getObject(bucketName: string, objectKey: string): S3Object {\n // Prepare request\n const method = 'GET'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: 'GET',\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('GetObject', res)\n\n return new S3Object(\n objectKey,\n Date.parse(res.headers['Last-Modified']),\n res.headers['ETag'],\n parseInt(res.headers['Content-Length']),\n\n // The X-Amz-Storage-Class header is only set if the storage class is\n // not the default 'STANDARD' one.\n (res.headers['X-Amz-Storage-Class'] ?? 'STANDARD') as StorageClass,\n\n res.body\n )\n }\n /**\n * Adds an object to a bucket.\n *\n * You must have WRITE permissions on a bucket to add an object to it.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to put.\n * @param {string | ArrayBuffer} data - the content of the S3 Object to upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n putObject(bucketName: string, objectKey: string, data: string | ArrayBuffer) {\n // Prepare request\n const method = 'PUT'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {\n Host: host,\n },\n body: data,\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error('PutObject', res)\n }\n\n /**\n * Removes the null version (if there is one) of an object and inserts a delete marker,\n * which becomes the latest version of the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteObject(bucketName: string, objectKey: string): void {\n // Prepare request\n const method = 'DELETE'\n const host = `${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${bucketName}/${objectKey}`,\n headers: {},\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('DeleteObject', res)\n }\n\n /**\n * Creates a new multipart upload for a given objectKey.\n * The uploadId returned can be used to upload parts to the object.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @return {S3MultipartUpload} - returns the uploadId of the newly created multipart upload.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n createMultipartUpload(bucketName: string, objectKey: string): S3MultipartUpload {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: { uploads: '' },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('CreateMultipartUpload', res)\n\n return new S3MultipartUpload(\n objectKey,\n parseHTML(res.body as string)\n .find('UploadId')\n .text()\n )\n }\n\n /**\n * Uploads a part in a multipart upload.\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to upload.\n * @param {string} uploadId - The uploadId of the multipart upload.\n * @param {number} partNumber - The part number of the part to upload.\n * @param {string | ArrayBuffer} data - The content of the part to upload.\n * @return {S3Part} - returns the ETag of the uploaded part.\n * @throws {S3ServiceError}\n */\n uploadPart(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n partNumber: number,\n data: string | ArrayBuffer\n ): S3Part {\n // Prepare request\n const method = 'PUT'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: data,\n query: {\n partNumber: `${partNumber}`,\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('UploadPart', res)\n\n return new S3Part(partNumber, res.headers['Etag'])\n }\n\n /**\n * Completes a multipart upload by assembling previously uploaded parts.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to complete.\n * @param {S3Part[]} parts - The parts to assemble.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n completeMultipartUpload(\n bucketName: string,\n objectKey: string,\n uploadId: string,\n parts: S3Part[]\n ) {\n // Prepare request\n const method = 'POST'\n const host = `${bucketName}.${this.host}`\n const body = `${parts\n .map(\n (part) =>\n `${part.partNumber}${part.eTag}`\n )\n .join('')}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n body: body,\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n\n this._handle_error('CompleteMultipartUpload', res)\n }\n\n /**\n * Aborts a multipart upload.\n *\n * @param {string} bucketName - The bucket name containing the object.\n * @param {string} objectKey - Key of the object to delete.\n * @param {string} uploadId - The uploadId of the multipart upload to abort.\n * @throws {S3ServiceError}\n * @throws {InvalidSignatureError}\n */\n abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string) {\n // Prepare request\n const method = 'DELETE'\n const host = `${bucketName}.${this.host}`\n const signedRequest = this.signature.sign(\n {\n method: method,\n protocol: this.scheme,\n hostname: host,\n path: `/${objectKey}`,\n headers: {},\n query: {\n uploadId: `${uploadId}`,\n },\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers,\n })\n this._handle_error('AbortMultipartUpload', res)\n }\n\n _handle_error(operation: S3Operation, response: RefinedResponse) {\n const status: number = response.status\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n // We consider codes 200-299 as success\n if (status >= 200 && status < 300 && errorMessage == '' && errorCode === 0) {\n return\n }\n\n // A 301 response is returned when the bucket is not found.\n // Generally meaning that either the bucket name is wrong or the\n // region is wrong.\n //\n // See: https://github.com/grafana/k6/issues/2474\n // See: https://github.com/golang/go/issues/49281\n if (status == 301 || (errorMessage && errorMessage.startsWith('301'))) {\n throw new S3ServiceError('Resource not found', 'ResourceNotFound', operation)\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new S3ServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/** Class representing a S3 Bucket */\nexport class S3Bucket {\n name: string\n creationDate: Date\n\n /**\n * Create an S3 Bucket\n *\n * @param {string} name - S3 bucket's name\n * @param {Date} creationDate - S3 bucket's creation date\n */\n constructor(name: string, creationDate: Date) {\n this.name = name\n this.creationDate = creationDate\n }\n}\n\n/** Class representing an S3 Object */\nexport class S3Object {\n key: string\n lastModified: number\n etag: string\n size: number\n storageClass: StorageClass\n data?: string | bytes | null\n\n /**\n * Create an S3 Object\n *\n * @param {string} key - S3 object's key\n * @param {Date} lastModified - S3 object last modification date\n * @param {string} etag - S3 object's etag\n * @param {number} size - S3 object's size\n * @param {StorageClass} storageClass - S3 object's storage class\n * @param {string | bytes | null} data=null - S3 Object's data\n */\n constructor(\n key: string,\n lastModified: number,\n etag: string,\n size: number,\n storageClass: StorageClass,\n data?: string | bytes | null\n ) {\n this.key = key\n this.lastModified = lastModified\n this.etag = etag\n this.size = size\n this.storageClass = storageClass\n this.data = data\n }\n}\n\n/** Class representing a S3 Multipart Upload */\nexport class S3MultipartUpload {\n key: string\n uploadId: string\n\n /**\n * Create an S3 Multipart Upload\n * @param {string} key - S3 object's key\n * @param {string} uploadId - S3 multipart upload id\n */\n\n constructor(key: string, uploadId: string) {\n this.key = key\n this.uploadId = uploadId\n }\n}\n\n/** Class representing a S3 Part */\nexport class S3Part {\n partNumber: number\n eTag: string\n\n /**\n * Create an S3 Part\n * @param {number} partNumber - Part number\n * @param {string} eTag - Part's etag\n */\n\n constructor(partNumber: number, eTag: string) {\n this.partNumber = partNumber\n this.eTag = eTag\n }\n}\n\n/**\n * Error indicating a S3 operation failed\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class S3ServiceError extends AWSError {\n operation: string\n\n /**\n * Constructs a S3ServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: string) {\n super(message, code)\n this.name = 'S3ServiceError'\n this.operation = operation\n }\n}\n\n/**\n * S3Operation describes possible values for S3 API operations,\n * as defined by AWS APIs.\n */\ntype S3Operation =\n | 'ListBuckets'\n | 'ListObjectsV2'\n | 'GetObject'\n | 'PutObject'\n | 'DeleteObject'\n | 'CreateMultipartUpload'\n | 'CompleteMultipartUpload'\n | 'UploadPart'\n | 'AbortMultipartUpload'\n\n/**\n * Describes the class of storage used to store a S3 object.\n */\ntype StorageClass =\n | 'STANDARD'\n | 'REDUCED_REDUNDANCY'\n | 'GLACIER'\n | 'STANDARD_IA'\n | 'INTELLIGENT_TIERING'\n | 'DEEP_ARCHIVE'\n | 'OUTPOSTS'\n | 'GLACIER_IR'\n | undefined\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","indexOf","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","S3Client","_AWSClient","awsConfig","serviceName","signedRequest","sign","host","res","http","_handle_error","buckets","children","each","_","bucketDefinition","bucket","forEach","child","nodeName","assign","textContent","creationDate","bucketName","prefix","objects","objectDefinition","lastModified","etag","size","parseInt","storageClass","objectKey","_res$headers$XAmzSt","S3Object","data","Host","uploads","S3MultipartUpload","uploadId","partNumber","S3Part","parts","part","eTag","operation","response","status","errorCode","error_code","errorMessage","error","S3ServiceError","awsError","parseXML","AWSClient","_host","set","_scheme","S3Bucket","_super2","_this2"],"sourceRoot":""} \ No newline at end of file diff --git a/build/secrets-manager.js.map b/build/secrets-manager.js.map index 1431aee..2edd058 100644 --- a/build/secrets-manager.js.map +++ b/build/secrets-manager.js.map @@ -1 +1 @@ -{"version":3,"file":"secrets-manager.js","mappings":"2BAAA,IAAIA,EAAK,EAAQ,KACbC,EAAK,EAAQ,KAEbC,EAAOD,EACXC,EAAKF,GAAKA,EACVE,EAAKD,GAAKA,EAEVE,EAAOC,QAAUF,C,UCFjB,IADA,IAAIG,EAAY,GACPC,EAAI,EAAGA,EAAI,MAAOA,EACzBD,EAAUC,IAAMA,EAAI,KAAOC,SAAS,IAAIC,OAAO,GAmBjDL,EAAOC,QAhBP,SAAqBK,EAAKC,GACxB,IAAIJ,EAAII,GAAU,EACdC,EAAMN,EAEV,MAAO,CACLM,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MACvBK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MAAO,IAC9BK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MAAO,IAC9BK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MAAO,IAC9BK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MAAO,IAC9BK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MACvBK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,MACvBK,EAAIF,EAAIH,MAAOK,EAAIF,EAAIH,OACtBM,KAAK,GACV,C,UChBA,IAAIC,EAAqC,oBAAZ,QAA2BC,OAAOD,iBAAmBC,OAAOD,gBAAgBE,KAAKD,SACnE,oBAAd,UAAuE,mBAAnCE,OAAOC,SAASJ,iBAAiCI,SAASJ,gBAAgBE,KAAKE,UAEhJ,GAAIJ,EAAiB,CAEnB,IAAIK,EAAQ,IAAIC,WAAW,IAE3BhB,EAAOC,QAAU,WAEf,OADAS,EAAgBK,GACTA,CACT,CACF,KAAO,CAKL,IAAIE,EAAO,IAAIC,MAAM,IA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.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/rng-browser.js","webpack://k6-jslib-aws/./node_modules/uuid/v1.js","webpack://k6-jslib-aws/./node_modules/uuid/v4.js","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/secrets-manager.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's SecretsManager service\n */\nexport class SecretsManagerClient extends AWSClient {\n /**\n * HTTP Method to use when interacting with the Secrets Manager service.\n */\n method: HTTPMethod\n\n /**\n * HTTP headers to use accross all requests to the Secrets Manager service.\n */\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a SecretsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'secretsmanager')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the Secrets Manager service\n // are made via the GET or POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Returns a list of all secrets owned by the authenticated sender of the request.\n * To use this operation, you must have the secretsmanager:ListSecrets permission.\n *\n * @return {Array.} secrets - An array of objects describing Secret Manager's secrets\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n listSecrets(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.ListSecrets`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.ListSecrets, res)\n const json: JSONArray = res.json('SecretList') as JSONArray\n\n return json.map((s) => Secret.fromJSON(s as JSONObject))\n }\n\n /**\n * Retrieves a secret from Amazon Sercets Manager\n *\n * @param {string} id - The ARN or name of the secret to retrieve.\n * @returns {Secret} - returns the content of the fetched Secret object.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getSecret(id: string): Secret | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.GetSecretValue`,\n },\n body: JSON.stringify({ SecretId: id }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(SecretsManagerOperation.GetSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Creates a new secret\n *\n * Note that this method only supports string-based values at the moment.\n *\n * @param {string} name - The name of the new secret.\n * The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {string} description - The description of the secret.\n * @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * algorithm.\n * @param {Array.} tags=[] - A list of tags to attach to the secret. Each tag is a key and\n * value pair of strings in a JSON text string. Note that tag key names are case sensitive.\n * @returns {Secret} - returns the created secret\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n createSecret(\n name: string,\n secret: string,\n description: string,\n versionID?: string,\n tags?: Array\n ): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.CreateSecret`,\n },\n body: JSON.stringify({\n Name: name,\n Description: description,\n SecretString: secret,\n ClientRequestToken: versionID,\n Tags: tags,\n }),\n },\n {}\n )\n\n // Ensure to include the desired 'Action' in the X-Amz-Target\n // header field, as documented by the AWS API docs.\n // headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.CreateSecret, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n /**\n * Update a secret's value.\n *\n * Note that this method only support string-based values at the moment.\n *\n * @param {string} id - The ARN or name of the secret to update.\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n putSecretValue(id: string, secret: string, versionID?: string): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.PutSecretValue`,\n },\n body: JSON.stringify({\n SecretId: id,\n SecretString: secret,\n ClientRequestToken: versionID,\n }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.PutSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Deletes a secret and all of its versions.\n *\n * You can specify a recovery window during which you can restore the secret.\n * The minimum recovery window is 7 days. The default recovery window is 30 days.\n *\n * @param {string} secretID - The ARN or name of the secret to delete.\n * @param {number} recoveryWindow - The number of days from 7 to 30 that Secrets Manager\n * waits before permanently deleting the secret.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteSecret(\n id: string,\n { recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }\n ) {\n const payload: { [key: string]: string | boolean | number } = {\n SecretId: id,\n }\n\n // noRecovery and recoveryWindow are exclusive parameters\n if (noRecovery === true) {\n payload['ForceDeleteWithoutRecovery'] = true\n } else {\n payload['RecoveryWindowInDays'] = recoveryWindow\n }\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.DeleteSecret`,\n },\n body: JSON.stringify(payload),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.DeleteSecret, res)\n }\n\n _handle_error(\n operation: SecretsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SecretsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SecretsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n// TODO: create a Tags type\n\n/**\n * Class representing a Secret Manager's secret\n */\nexport class Secret {\n name: string\n arn: string\n secret: string\n createdDate: number\n lastAccessedDate: number\n lastChangedDate: number\n tags: Array<{ [key: string]: string }>\n\n /**\n * Constructs a Secret Manager's Secret\n *\n * @param {string} name - The friendly name of the secret.\n * @param {string} arn - The ARN of the secret.\n * @param {number} createdDate - The date and time that this version of the secret was created.\n * @param {number} lastAccessedDate - The last date that this secret was accessed. This value is\n * truncated to midnight of the date and therefore shows only the date, not the time.\n * @param {number} lastChangedDate - The last date and time that this secret was modified in any way.\n * @param {Array.} tags - The list of user-defined tags associated with the secret.\n */\n constructor(\n name: string,\n arn: string,\n secretString: string,\n createdDate: number,\n lastAccessedDate: number,\n lastChangedDate: number,\n tags: Array<{ [key: string]: string }> = []\n ) {\n this.name = name\n this.arn = arn\n this.secret = secretString\n this.createdDate = createdDate\n this.lastAccessedDate = lastAccessedDate\n this.lastChangedDate = lastChangedDate\n this.tags = tags\n }\n\n /**\n * Parses and constructs a Secret Manager's Secret from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {Secret}\n */\n static fromJSON(json: JSONObject) {\n return new Secret(\n json.Name as string,\n json.ARN as string,\n json.SecretString as string,\n json.CreatedDate as number,\n json.LastAccessedDate as number,\n json.LastChangedDate as number,\n json.Tags as Array<{ [key: string]: string }>\n )\n }\n}\n\nexport class SecretsManagerServiceError extends AWSError {\n operation: SecretsManagerOperation\n\n /**\n * Constructs a SecretsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SecretsManagerOperation) {\n super(message, code)\n this.name = 'SecretsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SecretsManagerOperation defines all currently implemented Secrets Manager Service operations.\n */\nenum SecretsManagerOperation {\n ListSecrets = 'ListSecrets',\n GetSecretValue = 'GetSecretValue',\n CreateSecret = 'CreateSecret',\n PutSecretValue = 'PutSecretValue',\n DeleteSecret = 'DeleteSecret',\n}\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["v1","v4","uuid","module","exports","byteToHex","i","toString","substr","buf","offset","bth","join","getRandomValues","crypto","bind","window","msCrypto","rnds8","Uint8Array","rnds","Array","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","options","b","node","clockseq","undefined","seedBytes","msecs","Date","getTime","nsecs","dt","Error","tl","tmh","n","ii","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","SecretsManagerClient","_AWSClient","awsConfig","serviceName","commonHeaders","signedRequest","sign","host","res","http","_handle_error","SecretsManagerOperation","ListSecrets","json","Secret","fromJSON","id","SecretId","GetSecretValue","secret","description","versionID","tags","uuidv4","Name","Description","SecretString","ClientRequestToken","Tags","CreateSecret","PutSecretValue","_ref$recoveryWindow","recoveryWindow","_ref$noRecovery","noRecovery","payload","DeleteSecret","operation","response","errorCode","error_code","error","errorMessage","Message","__type","SecretsManagerServiceError","AWSClient","_host","set","_scheme","arn","secretString","createdDate","lastAccessedDate","lastChangedDate","ARN","CreatedDate","LastAccessedDate","LastChangedDate","_super2","_this2"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"secrets-manager.js","mappings":"2BAAA,IAAIA,EAAK,EAAQ,KACbC,EAAK,EAAQ,KAEbC,EAAOD,EACXC,EAAKF,GAAKA,EACVE,EAAKD,GAAKA,EAEVE,EAAOC,QAAUF,C,UCFjB,IADA,IAAIG,EAAY,GACPC,EAAI,EAAGA,EAAI,MAAOA,EACzBD,EAAUC,IAAMA,EAAI,KAAOC,SAAS,IAAIC,OAAO,GAmBjDL,EAAOC,QAhBP,SAAqBK,EAAKC,GACxB,IAAIJ,EAAII,GAAU,EACdC,EAAMN,EAEV,MAAO,CACLM,EAAIF,EAAIH,MAAOK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,aACLb,EAAK2C,YACL3C,EAAK4C,iBACL5C,EAAK6C,gBACL7C,EAAKe,KAEb,KAACd,CAAA,CAxDc,GA2DN+B,GAA0B,SAAAtD,GAAAzK,GAAA+N,EAAAtD,GAAA,IAAAoE,EAAA3O,GAAA6N,GAUnC,SAAAA,EAAY5N,EAAiB4B,EAAcwL,GAAoC,IAAAuB,EAGjD,OAHiDjQ,GAAA,KAAAkP,GACvDjP,GAAAmD,GAApB6M,EAAAD,EAAArQ,KAAA,KAAM2B,EAAS4B,IAAK,oBACpB+M,EAAK5M,KAAO,6BACZ4M,EAAKvB,UAAYA,EAASuB,CAC9B,CAAC,OAAArP,GAAAsO,EAAA,CAdkC,CAASjM,GAoB3C+J,GAAuB,SAAvBA,GAAuB,OAAvBA,EAAuB,0BAAvBA,EAAuB,gCAAvBA,EAAuB,4BAAvBA,EAAuB,gCAAvBA,EAAuB,4BAAvBA,CAAuB,EAAvBA,IAAuB,G","sources":["webpack://k6-jslib-aws/./node_modules/uuid/index.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/bytesToUuid.js","webpack://k6-jslib-aws/./node_modules/uuid/lib/rng-browser.js","webpack://k6-jslib-aws/./node_modules/uuid/v1.js","webpack://k6-jslib-aws/./node_modules/uuid/v4.js","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/secrets-manager.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { JSONArray, JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { v4 as uuidv4 } from 'uuid'\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's SecretsManager service\n */\nexport class SecretsManagerClient extends AWSClient {\n /**\n * HTTP Method to use when interacting with the Secrets Manager service.\n */\n method: HTTPMethod\n\n /**\n * HTTP headers to use accross all requests to the Secrets Manager service.\n */\n commonHeaders: HTTPHeaders\n\n signature: SignatureV4\n\n /**\n * Create a SecretsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'secretsmanager')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n\n // All interactions with the Secrets Manager service\n // are made via the GET or POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n }\n\n /**\n * Returns a list of all secrets owned by the authenticated sender of the request.\n * To use this operation, you must have the secretsmanager:ListSecrets permission.\n *\n * @return {Array.} secrets - An array of objects describing Secret Manager's secrets\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n listSecrets(): Array {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.ListSecrets`,\n },\n body: JSON.stringify({}),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.ListSecrets, res)\n const json: JSONArray = res.json('SecretList') as JSONArray\n\n return json.map((s) => Secret.fromJSON(s as JSONObject))\n }\n\n /**\n * Retrieves a secret from Amazon Sercets Manager\n *\n * @param {string} id - The ARN or name of the secret to retrieve.\n * @returns {Secret} - returns the content of the fetched Secret object.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getSecret(id: string): Secret | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.GetSecretValue`,\n },\n body: JSON.stringify({ SecretId: id }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n\n this._handle_error(SecretsManagerOperation.GetSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Creates a new secret\n *\n * Note that this method only supports string-based values at the moment.\n *\n * @param {string} name - The name of the new secret.\n * The secret name can contain ASCII letters, numbers, and the following characters: /_+=.@\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {string} description - The description of the secret.\n * @param {string} versionID=null - Version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * algorithm.\n * @param {Array.} tags=[] - A list of tags to attach to the secret. Each tag is a key and\n * value pair of strings in a JSON text string. Note that tag key names are case sensitive.\n * @returns {Secret} - returns the created secret\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n createSecret(\n name: string,\n secret: string,\n description: string,\n versionID?: string,\n tags?: Array\n ): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.CreateSecret`,\n },\n body: JSON.stringify({\n Name: name,\n Description: description,\n SecretString: secret,\n ClientRequestToken: versionID,\n Tags: tags,\n }),\n },\n {}\n )\n\n // Ensure to include the desired 'Action' in the X-Amz-Target\n // header field, as documented by the AWS API docs.\n // headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.CreateSecret, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n /**\n * Update a secret's value.\n *\n * Note that this method only support string-based values at the moment.\n *\n * @param {string} id - The ARN or name of the secret to update.\n * @param {string} secret - The text data to encrypt and store in this new version of the secret.\n * @param {} versionID=null - A unique identifier for the new version of the secret. This value helps ensure idempotency.\n * As a default, if no versionID is provided, one will be created for you using the UUID v4\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n putSecretValue(id: string, secret: string, versionID?: string): Secret {\n versionID = versionID || uuidv4()\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.PutSecretValue`,\n },\n body: JSON.stringify({\n SecretId: id,\n SecretString: secret,\n ClientRequestToken: versionID,\n }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.PutSecretValue, res)\n\n return Secret.fromJSON(res.json() as JSONObject)\n }\n\n /**\n * Deletes a secret and all of its versions.\n *\n * You can specify a recovery window during which you can restore the secret.\n * The minimum recovery window is 7 days. The default recovery window is 30 days.\n *\n * @param {string} secretID - The ARN or name of the secret to delete.\n * @param {number} recoveryWindow - The number of days from 7 to 30 that Secrets Manager\n * waits before permanently deleting the secret.\n * @throws {SecretsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n deleteSecret(\n id: string,\n { recoveryWindow = 30, noRecovery = false }: { recoveryWindow: number; noRecovery: boolean }\n ) {\n const payload: { [key: string]: string | boolean | number } = {\n SecretId: id,\n }\n\n // noRecovery and recoveryWindow are exclusive parameters\n if (noRecovery === true) {\n payload['ForceDeleteWithoutRecovery'] = true\n } else {\n payload['RecoveryWindowInDays'] = recoveryWindow\n }\n\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `${this.serviceName}.DeleteSecret`,\n },\n body: JSON.stringify(payload),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SecretsManagerOperation.DeleteSecret, res)\n }\n\n _handle_error(\n operation: SecretsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SecretsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SecretsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n// TODO: create a Tags type\n\n/**\n * Class representing a Secret Manager's secret\n */\nexport class Secret {\n name: string\n arn: string\n secret: string\n createdDate: number\n lastAccessedDate: number\n lastChangedDate: number\n tags: Array<{ [key: string]: string }>\n\n /**\n * Constructs a Secret Manager's Secret\n *\n * @param {string} name - The friendly name of the secret.\n * @param {string} arn - The ARN of the secret.\n * @param {number} createdDate - The date and time that this version of the secret was created.\n * @param {number} lastAccessedDate - The last date that this secret was accessed. This value is\n * truncated to midnight of the date and therefore shows only the date, not the time.\n * @param {number} lastChangedDate - The last date and time that this secret was modified in any way.\n * @param {Array.} tags - The list of user-defined tags associated with the secret.\n */\n constructor(\n name: string,\n arn: string,\n secretString: string,\n createdDate: number,\n lastAccessedDate: number,\n lastChangedDate: number,\n tags: Array<{ [key: string]: string }> = []\n ) {\n this.name = name\n this.arn = arn\n this.secret = secretString\n this.createdDate = createdDate\n this.lastAccessedDate = lastAccessedDate\n this.lastChangedDate = lastChangedDate\n this.tags = tags\n }\n\n /**\n * Parses and constructs a Secret Manager's Secret from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {Secret}\n */\n static fromJSON(json: JSONObject) {\n return new Secret(\n json.Name as string,\n json.ARN as string,\n json.SecretString as string,\n json.CreatedDate as number,\n json.LastAccessedDate as number,\n json.LastChangedDate as number,\n json.Tags as Array<{ [key: string]: string }>\n )\n }\n}\n\nexport class SecretsManagerServiceError extends AWSError {\n operation: SecretsManagerOperation\n\n /**\n * Constructs a SecretsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {string} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SecretsManagerOperation) {\n super(message, code)\n this.name = 'SecretsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SecretsManagerOperation defines all currently implemented Secrets Manager Service operations.\n */\nenum SecretsManagerOperation {\n ListSecrets = 'ListSecrets',\n GetSecretValue = 'GetSecretValue',\n CreateSecret = 'CreateSecret',\n PutSecretValue = 'PutSecretValue',\n DeleteSecret = 'DeleteSecret',\n}\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["v1","v4","uuid","module","exports","byteToHex","i","toString","substr","buf","offset","bth","join","getRandomValues","crypto","bind","window","msCrypto","rnds8","Uint8Array","rnds","Array","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","options","b","node","clockseq","undefined","seedBytes","msecs","Date","getTime","nsecs","dt","Error","tl","tmh","n","ii","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","indexOf","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","SecretsManagerClient","_AWSClient","awsConfig","serviceName","commonHeaders","signedRequest","sign","host","res","http","_handle_error","SecretsManagerOperation","ListSecrets","json","Secret","fromJSON","id","SecretId","GetSecretValue","secret","description","versionID","tags","uuidv4","Name","Description","SecretString","ClientRequestToken","Tags","CreateSecret","PutSecretValue","_ref$recoveryWindow","recoveryWindow","_ref$noRecovery","noRecovery","payload","DeleteSecret","operation","response","errorCode","error_code","error","errorMessage","Message","__type","SecretsManagerServiceError","AWSClient","_host","set","_scheme","arn","secretString","createdDate","lastAccessedDate","lastChangedDate","ARN","CreatedDate","LastAccessedDate","LastChangedDate","_super2","_this2"],"sourceRoot":""} \ No newline at end of file diff --git a/build/signature.js.map b/build/signature.js.map index ebca1b5..2231415 100644 --- a/build/signature.js.map +++ b/build/signature.js.map @@ -1 +1 @@ -{"version":3,"file":"signature.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+ZCFvD,IAAMC,EAA4B,kBAC5BC,EAA6B,mBAC7BC,EAAuB,aACvBC,EAA0B,gBAC1BC,EAA4B,kBAC5BC,EAAiC,sBAEjCC,EAAwB,uBAKxBC,EAA4B,uBAC5BC,EAAkBN,EAAqBO,cACvCC,EAAuBN,EAA0BK,cAEjDE,GAVyB,eASkBF,cACxBH,EAAsBG,eAKzCG,EAAuB,g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AS+F,MAAM,EAAG,GAErC,C","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","UNSIGNED_PAYLOAD","require","AWSError","_Error","_inherits","_super","_createSuper","message","code","_this","_classCallCheck","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","_wrapNativeSuper","Error","SignatureV4","_ref","service","region","credentials","uriEscapePath","applyChecksum","_defineProperty","this","_createClass","request","options","arguments","length","undefined","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","concat","constants","headers","hostname","_i","_Object$keys","keys","headerName","sessionToken","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","accessKeyId","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","secretAccessKey","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"signature.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IA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E,I,qRAAAlK,CAAAmF,EAAA+E,GAAA,IAAAjK,EAAAC,EAAAiF,GAM9B,SAAAA,EAAYhF,EAAiBC,GAAe,IAAAC,EAEL,OAFKC,EAAA,KAAA6E,IACxC9E,EAAAJ,EAAApC,KAAA,KAAMsC,EAASC,IACVI,KAAO,wBAAuBH,CACvC,CAAC,OAAAoB,EAAA0D,EAAA,CAT6B,CAASrF,GA+I3C,SAASuI,EAAUX,GAKf,OAAOI,mBAAmBJ,GAAKK,QAAQ,YAJrB,SAACoC,GACf,MAAO,IAAPtH,OAAWsH,EAAEC,WAAW,GAAG/E,SAAS,IAAIgF,cAC5C,GAGJ,CASA,SAAS9H,EAAW+H,GAChB,IAeaC,EAfP/H,GAeO+H,EAfYD,EA2B7B,SAAgBC,GACZ,MAAoB,iBAATA,EACA,IAAIrI,KAAY,IAAPqI,GAGA,iBAATA,EACHC,OAAOD,GACA,IAAIrI,KAAoB,IAAfsI,OAAOD,IAGpB,IAAIrI,KAAKqI,GAGbA,CACX,CAzBWE,CAAOF,GACTG,cACA3C,QAAQ,YAAa,MAlBKA,QAAQ,SAAU,IACjD,MAAO,CACHvF,SAAAA,EACAC,UAAWD,EAASgG,MAAM,EAAG,GAErC,C","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","UNSIGNED_PAYLOAD","require","AWSError","_Error","_inherits","_super","_createSuper","message","code","_this","_classCallCheck","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","_wrapNativeSuper","Error","SignatureV4","_ref","service","region","credentials","uriEscapePath","applyChecksum","_defineProperty","this","_createClass","request","options","arguments","length","undefined","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","concat","constants","headers","hostname","_i","_Object$keys","keys","headerName","indexOf","sessionToken","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","accessKeyId","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","secretAccessKey","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString"],"sourceRoot":""} \ No newline at end of file diff --git a/build/sqs.js b/build/sqs.js index a200ca4..0211c87 100644 --- a/build/sqs.js +++ b/build/sqs.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={393:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;ra});var a=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"awsConfig",void 0),i(this,"serviceName",void 0),i(this,"_host",void 0),i(this,"_scheme",void 0),this.awsConfig=t,this.serviceName=r}var t,r,n;return t=e,(r=[{key:"host",get:function(){return null==this._host&&(this._host="".concat(this.serviceName,".").concat(this.awsConfig.region,".").concat(this.awsConfig.endpoint)),this._host},set:function(e){this._host=e}},{key:"scheme",get:function(){return null==this._scheme&&(this._scheme=this.awsConfig.scheme),this._scheme},set:function(e){this._scheme=e}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},223:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=a();return function(){var r,o=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},i(e)}function c(e,t,r){return c=a()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&u(o,r.prototype),o},c.apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;rb,o:()=>h});var h=function(){function e(t){if(f(this,e),p(this,"region",void 0),p(this,"accessKeyId",void 0),p(this,"secretAccessKey",void 0),p(this,"sessionToken",void 0),p(this,"scheme","https"),p(this,"endpoint","amazonaws.com"),!t.region||""===t.region)throw new b('invalid AWS region; reason: expected a valid AWS region name (e.g. "us-east-1"), got `'.concat(t.region,"`"));if(!t.accessKeyId||""===t.accessKeyId)throw new b("invalid AWS access key ID; reason: expected a non empty string, got `".concat(t.accessKeyId,"`"));if(t.accessKeyId.length<16||t.accessKeyId.length>128)throw new b("invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ".concat(t.accessKeyId.length));if(!t.secretAccessKey||""===t.secretAccessKey)throw new b("invalid AWS secret access key; reason: expected a non empty string, got `".concat(t.secretAccessKey,"`"));if(t.secretAccessKey.length<16||t.secretAccessKey.length>128)throw new b("invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ".concat(t.secretAccessKey.length));this.region=t.region,this.accessKeyId=t.accessKeyId,this.secretAccessKey=t.secretAccessKey,void 0!==t.sessionToken&&(this.sessionToken=t.sessionToken),void 0!==t.scheme&&(this.scheme=t.scheme),void 0!==t.endpoint&&(this.endpoint=t.endpoint)}return y(e,null,[{key:"fromEnvironment",value:function(t){return new e({region:__ENV.AWS_REGION,accessKeyId:__ENV.AWS_ACCESS_KEY_ID,secretAccessKey:__ENV.AWS_SECRET_ACCESS_KEY,sessionToken:__ENV.AWS_SESSION_TOKEN,scheme:null==t?void 0:t.scheme,endpoint:null==t?void 0:t.endpoint})}}]),e}(),b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(r,e);var t=o(r);function r(e){return f(this,r),t.call(this,e)}return y(r)}(i(Error))},592:(e,t,r)=>{r.d(t,{$l:()=>o,Aq:()=>v,B3:()=>h,Dz:()=>d,K0:()=>n,NL:()=>s,Qk:()=>i,R$:()=>f,SG:()=>g,U4:()=>y,VR:()=>u,a_:()=>l,al:()=>m,cG:()=>a,md:()=>b,n8:()=>S,sH:()=>O,th:()=>w,w1:()=>p,zC:()=>c});var n="X-Amz-Algorithm",o="X-Amz-Credential",i="X-Amz-Date",c="X-Amz-Expires",a="X-Amz-Signature",u="X-Amz-SignedHeaders",s="X-Amz-Security-Token",f="x-amz-content-sha256",l=i.toLowerCase(),y=a.toLowerCase(),p=("X-Amz-Target".toLowerCase(),s.toLowerCase()),d="authorization",h=[d,l,"date"],b="host",v={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},m="aws4_request",g="AWS4-HMAC-SHA256",w=604800,O="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",S="UNSIGNED-PAYLOAD"},380:(e,t,r)=>{r.d(t,{t:()=>d});var n=r(255);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r{function n(e,t){e=e.toLowerCase();for(var r=0,n=Object.keys(t);rn})},137:(e,t,r)=>{r.d(t,{L:()=>S,w:()=>j});var n=r(400),o=r.n(n),i=r(592),c=r(380),a=r(491),u=r(23);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=y(e);if(t){var o=y(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=b(b({},{signingDate:new Date,unsignableHeaders:new Set,signableHeaders:new Set}),t),n=_(r.signingDate),o=n.longDate,c=n.shortDate,u=r.signingService||this.service,s=r.signingRegion||this.region,f="".concat(c,"/").concat(s,"/").concat(u,"/").concat(i.al);e.headers[i.md]=e.hostname;for(var l=0,y=Object.keys(e.headers);l-1&&delete e.headers[p]}e.headers[i.a_]=o,this.credentials.sessionToken&&(e.headers[i.w1]=this.credentials.sessionToken),ArrayBuffer.isView(e.body)&&(e.body=e.body.buffer),e.body||(e.body="");var d=this.computePayloadHash(e);!(0,a.L)(i.R$,e.headers)&&this.applyChecksum&&(e.headers[i.R$]=d);var h=this.computeCanonicalHeaders(e,r.unsignableHeaders,r.signableHeaders),v=this.calculateSignature(o,f,this.deriveSigningKey(this.credentials,u,s,c),this.createCanonicalRequest(e,h,d));e.headers[i.Dz]="".concat(i.SG," ")+"Credential=".concat(this.credentials.accessKeyId,"/").concat(f,", ")+"SignedHeaders=".concat(Object.keys(h).sort().join(";"),", ")+"Signature=".concat(v);var m="".concat(e.protocol,"://").concat(e.hostname);return e.path&&(m+=e.path),e.query&&(m+="?".concat(this.serializeQueryParameters(e.query))),b({url:m},e)}},{key:"presign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.signingDate,n=void 0===r?new Date:r,o=t.expiresIn,c=void 0===o?3600:o,a=t.unsignableHeaders,u=t.unhoistableHeaders,s=t.signableHeaders,f=t.signingRegion,l=t.signingService,y=_(n),p=y.longDate,d=y.shortDate,h=f||this.region,v=l||this.service;if(c>i.th)throw new j("Signature version 4 presigned URLs can't be valid for more than 7 days");var m="".concat(d,"/").concat(h,"/").concat(v,"/").concat(i.al),g=this.moveHeadersToQuery(e,{unhoistableHeaders:u});g.headers[i.md]=e.hostname,this.credentials.sessionToken&&(g.query[i.NL]=this.credentials.sessionToken),g.query[i.K0]=i.SG,g.query[i.$l]="".concat(this.credentials.accessKeyId,"/").concat(m),g.query[i.Qk]=p,g.query[i.zC]=c.toString(10);var w=this.computeCanonicalHeaders(g,a,s);g.query[i.VR]=Object.keys(w).sort().join(";");var O=this.deriveSigningKey(this.credentials,v,h,d),S=this.computePayloadHash(e),P=this.createCanonicalRequest(g,w,S);g.query[i.cG]=this.calculateSignature(p,m,O,P);var k="".concat(g.protocol,"://").concat(g.hostname);return g.path&&(k+=g.path),g.query&&(k+="?".concat(this.serializeQueryParameters(g.query))),b({url:k},g)}},{key:"createCanonicalRequest",value:function(e,t,r){var n=Object.keys(t).sort(),o=n.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),i=n.join(";");return"".concat(e.method,"\n")+"".concat(this.computeCanonicalURI(e),"\n")+"".concat(this.computeCanonicalQuerystring(e),"\n")+"".concat(o,"\n\n")+"".concat(i,"\n")+"".concat(r)}},{key:"createStringToSign",value:function(e,t,r){var n=o().sha256(r,"hex");return"".concat(i.SG,"\n")+"".concat(e,"\n")+"".concat(t,"\n")+"".concat(n)}},{key:"calculateSignature",value:function(e,t,r,n){var i=this.createStringToSign(e,t,n);return o().hmac("sha256",r,i,"hex")}},{key:"deriveSigningKey",value:function(e,t,r,n){var i=e.secretAccessKey,c=o().hmac("sha256","AWS4"+i,n,"binary"),a=o().hmac("sha256",c,r,"binary"),u=o().hmac("sha256",a,t,"binary");return o().hmac("sha256",u,"aws4_request","binary")}},{key:"computeCanonicalURI",value:function(e){var t=e.path;if(this.uriEscapePath){var r,n=[],o=p(t.split("/"));try{for(o.s();!(r=o.n()).done;){var i=r.value;0!==(null==i?void 0:i.length)&&("."!==i&&(".."===i?n.pop():n.push(i)))}}catch(e){o.e(e)}finally{o.f()}var c=null!=t&&t.startsWith("/")?"/":"",a=n.join("/"),u=n.length>0&&null!=t&&t.endsWith("/")?"/":"",s="".concat(c).concat(a).concat(u);return encodeURIComponent(s).replace(/%2F/g,"/")}return t}},{key:"computeCanonicalQuerystring",value:function(e){var t,r=e.query,n=void 0===r?{}:r,o=[],c={},a=function(e){if(e.toLowerCase()===i.U4)return"continue";o.push(e);var t=n[e];"string"==typeof t?c[e]="".concat(P(e),"=").concat(P(t)):Array.isArray(t)&&(c[e]=t.slice(0).sort().reduce((function(t,r){return t.concat(["".concat(P(e),"=").concat(P(r))])}),[]).join("&"))},u=p(Object.keys(n).sort());try{for(u.s();!(t=u.n()).done;)a(t.value)}catch(e){u.e(e)}finally{u.f()}return o.map((function(e){return c[e]})).filter((function(e){return e})).join("&")}},{key:"computeCanonicalHeaders",value:function(e,t,r){var n,o=e.headers,c={},a=p(Object.keys(o).sort());try{for(a.s();!(n=a.n()).done;){var u=n.value;if(null!=o[u]){var s=u.toLowerCase();(s in i.Aq||null!=t&&t.has(s))&&(!r||r&&!r.has(s))||(c[s]=o[u].trim().replace(/\s+/g," "))}}}catch(e){a.e(e)}finally{a.f()}return c}},{key:"computePayloadHash",value:function(e){var t=e.headers,r=e.body;return t[i.R$]?t[i.R$]:null==r?i.sH:"string"==typeof r||(0,u.e)(r)?o().sha256(r,"hex").toLowerCase():ArrayBuffer.isView(r)?o().sha256(r.buffer,"hex").toLowerCase():i.n8}},{key:"moveHeadersToQuery",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.parse(JSON.stringify(e)),n=r.headers,o=r.query,i=void 0===o?{}:o,c=0,a=Object.keys(n);c{function n(e){return"function"==typeof ArrayBuffer&&(e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e))}function o(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))),t}),[]).join("&")}r.d(t,{C:()=>o,e:()=>n})},400:e=>{e.exports=require("k6/crypto")},255:e=>{e.exports=require("k6/html")},409:e=>{e.exports=require("k6/http")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{AWSConfig:()=>e.o,InvalidAWSConfigError:()=>e.l,InvalidSignatureError:()=>t.w,SQSClient:()=>j});var e=r(223),t=r(137),o=r(393),i=r(409),c=r.n(i),a=r(23),u=r(380);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n={Action:"SendMessage",Version:S,QueueUrl:e,MessageBody:t};void 0!==r.messageDeduplicationId&&(n=l(l({},n),{},{MessageDeduplicationId:r.messageDeduplicationId})),void 0!==r.messageGroupId&&(n=l(l({},n),{},{MessageGroupId:r.messageGroupId}));var o=this.signature.sign({method:"POST",protocol:"https",hostname:this.host,path:"/",headers:l({},this.commonHeaders),body:(0,a.C)(n)},{}),i=c().request("POST",o.url,o.body||"",{headers:o.headers});this._handleError("SendMessage",i);var u=i.html("SendMessageResponse > SendMessageResult");return new P(u.find("MessageId").text(),u.find("MD5OfMessageBody").text())}},{key:"listQueues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={Action:"ListQueues",Version:S};void 0!==(null==e?void 0:e.maxResults)&&(t=l(l({},t),{},{MaxResults:e.maxResults})),void 0!==(null==e?void 0:e.nextToken)&&(t=l(l({},t),{},{NextToken:e.nextToken})),void 0!==(null==e?void 0:e.queueNamePrefix)&&(t=l(l({},t),{},{QueueNamePrefix:e.queueNamePrefix}));var r=this.signature.sign({method:"POST",protocol:"https",hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},{Host:this.host}),body:(0,a.C)(t)},{}),n=c().request("POST",r.url,r.body||"",{headers:r.headers});this._handleError("ListQueues",n);var o=n.html();return{urls:o.find("QueueUrl").toArray().map((function(e){return e.text()})),nextToken:o.find("NextToken").text()||void 0}}},{key:"_handleError",value:function(e,r){var n=r.error_code;if(""!=r.error||0!==n){var o=u.t.parseXML(r.body);if("AuthorizationHeaderMalformed"===o.code)throw new t.w(o.message,o.code);throw new _(o.message,o.code||"unknown",e)}}}]),n}(o.k),P=d((function e(t,r){y(this,e),w(this,"id",void 0),w(this,"bodyMD5",void 0),this.id=t,this.bodyMD5=r})),_=function(e){h(r,e);var t=v(r);function r(e,n,o){var i;return y(this,r),w(m(i=t.call(this,e,n)),"operation",void 0),i.name="SQSServiceError",i.operation=o,i}return d(r)}(u.t)})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); +(()=>{"use strict";var e={393:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;ra});var a=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"awsConfig",void 0),i(this,"serviceName",void 0),i(this,"_host",void 0),i(this,"_scheme",void 0),this.awsConfig=t,this.serviceName=r}var t,r,n;return t=e,(r=[{key:"host",get:function(){return null==this._host&&(this._host="".concat(this.serviceName,".").concat(this.awsConfig.region,".").concat(this.awsConfig.endpoint)),this._host},set:function(e){this._host=e}},{key:"scheme",get:function(){return null==this._scheme&&(this._scheme=this.awsConfig.scheme),this._scheme},set:function(e){this._scheme=e}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},223:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=a();return function(){var r,o=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)},i(e)}function c(e,t,r){return c=a()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&u(o,r.prototype),o},c.apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;rb,o:()=>h});var h=function(){function e(t){if(f(this,e),p(this,"region",void 0),p(this,"accessKeyId",void 0),p(this,"secretAccessKey",void 0),p(this,"sessionToken",void 0),p(this,"scheme","https"),p(this,"endpoint","amazonaws.com"),!t.region||""===t.region)throw new b('invalid AWS region; reason: expected a valid AWS region name (e.g. "us-east-1"), got `'.concat(t.region,"`"));if(!t.accessKeyId||""===t.accessKeyId)throw new b("invalid AWS access key ID; reason: expected a non empty string, got `".concat(t.accessKeyId,"`"));if(t.accessKeyId.length<16||t.accessKeyId.length>128)throw new b("invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ".concat(t.accessKeyId.length));if(!t.secretAccessKey||""===t.secretAccessKey)throw new b("invalid AWS secret access key; reason: expected a non empty string, got `".concat(t.secretAccessKey,"`"));if(t.secretAccessKey.length<16||t.secretAccessKey.length>128)throw new b("invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ".concat(t.secretAccessKey.length));this.region=t.region,this.accessKeyId=t.accessKeyId,this.secretAccessKey=t.secretAccessKey,void 0!==t.sessionToken&&(this.sessionToken=t.sessionToken),void 0!==t.scheme&&(this.scheme=t.scheme),void 0!==t.endpoint&&(this.endpoint=t.endpoint)}return y(e,null,[{key:"fromEnvironment",value:function(t){return new e({region:__ENV.AWS_REGION,accessKeyId:__ENV.AWS_ACCESS_KEY_ID,secretAccessKey:__ENV.AWS_SECRET_ACCESS_KEY,sessionToken:__ENV.AWS_SESSION_TOKEN,scheme:null==t?void 0:t.scheme,endpoint:null==t?void 0:t.endpoint})}}]),e}(),b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(r,e);var t=o(r);function r(e){return f(this,r),t.call(this,e)}return y(r)}(i(Error))},592:(e,t,r)=>{r.d(t,{$l:()=>o,Aq:()=>v,B3:()=>h,Dz:()=>d,K0:()=>n,NL:()=>s,Qk:()=>i,R$:()=>f,SG:()=>g,U4:()=>y,VR:()=>u,a_:()=>l,al:()=>m,cG:()=>a,md:()=>b,n8:()=>S,sH:()=>O,th:()=>w,w1:()=>p,zC:()=>c});var n="X-Amz-Algorithm",o="X-Amz-Credential",i="X-Amz-Date",c="X-Amz-Expires",a="X-Amz-Signature",u="X-Amz-SignedHeaders",s="X-Amz-Security-Token",f="x-amz-content-sha256",l=i.toLowerCase(),y=a.toLowerCase(),p=("X-Amz-Target".toLowerCase(),s.toLowerCase()),d="authorization",h=[d,l,"date"],b="host",v={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},m="aws4_request",g="AWS4-HMAC-SHA256",w=604800,O="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",S="UNSIGNED-PAYLOAD"},380:(e,t,r)=>{r.d(t,{t:()=>d});var n=r(255);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;r{function n(e,t){e=e.toLowerCase();for(var r=0,n=Object.keys(t);rn})},137:(e,t,r)=>{r.d(t,{L:()=>S,w:()=>j});var n=r(400),o=r.n(n),i=r(592),c=r(380),a=r(491),u=r(23);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=y(e);if(t){var o=y(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(a)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=b(b({},{signingDate:new Date,unsignableHeaders:new Set,signableHeaders:new Set}),t),n=_(r.signingDate),o=n.longDate,c=n.shortDate,u=r.signingService||this.service,s=r.signingRegion||this.region,f="".concat(c,"/").concat(s,"/").concat(u,"/").concat(i.al);e.headers[i.md]=e.hostname;for(var l=0,y=Object.keys(e.headers);l-1&&delete e.headers[p]}e.headers[i.a_]=o,this.credentials.sessionToken&&(e.headers[i.w1]=this.credentials.sessionToken),ArrayBuffer.isView(e.body)&&(e.body=e.body.buffer),e.body||(e.body="");var d=this.computePayloadHash(e);!(0,a.L)(i.R$,e.headers)&&this.applyChecksum&&(e.headers[i.R$]=d);var h=this.computeCanonicalHeaders(e,r.unsignableHeaders,r.signableHeaders),v=this.calculateSignature(o,f,this.deriveSigningKey(this.credentials,u,s,c),this.createCanonicalRequest(e,h,d));e.headers[i.Dz]="".concat(i.SG," ")+"Credential=".concat(this.credentials.accessKeyId,"/").concat(f,", ")+"SignedHeaders=".concat(Object.keys(h).sort().join(";"),", ")+"Signature=".concat(v);var m="".concat(e.protocol,"://").concat(e.hostname);return e.path&&(m+=e.path),e.query&&(m+="?".concat(this.serializeQueryParameters(e.query))),b({url:m},e)}},{key:"presign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.signingDate,n=void 0===r?new Date:r,o=t.expiresIn,c=void 0===o?3600:o,a=t.unsignableHeaders,u=t.unhoistableHeaders,s=t.signableHeaders,f=t.signingRegion,l=t.signingService,y=_(n),p=y.longDate,d=y.shortDate,h=f||this.region,v=l||this.service;if(c>i.th)throw new j("Signature version 4 presigned URLs can't be valid for more than 7 days");var m="".concat(d,"/").concat(h,"/").concat(v,"/").concat(i.al),g=this.moveHeadersToQuery(e,{unhoistableHeaders:u});g.headers[i.md]=e.hostname,this.credentials.sessionToken&&(g.query[i.NL]=this.credentials.sessionToken),g.query[i.K0]=i.SG,g.query[i.$l]="".concat(this.credentials.accessKeyId,"/").concat(m),g.query[i.Qk]=p,g.query[i.zC]=c.toString(10);var w=this.computeCanonicalHeaders(g,a,s);g.query[i.VR]=Object.keys(w).sort().join(";");var O=this.deriveSigningKey(this.credentials,v,h,d),S=this.computePayloadHash(e),P=this.createCanonicalRequest(g,w,S);g.query[i.cG]=this.calculateSignature(p,m,O,P);var k="".concat(g.protocol,"://").concat(g.hostname);return g.path&&(k+=g.path),g.query&&(k+="?".concat(this.serializeQueryParameters(g.query))),b({url:k},g)}},{key:"createCanonicalRequest",value:function(e,t,r){var n=Object.keys(t).sort(),o=n.map((function(e){return"".concat(e,":").concat(t[e])})).join("\n"),i=n.join(";");return"".concat(e.method,"\n")+"".concat(this.computeCanonicalURI(e),"\n")+"".concat(this.computeCanonicalQuerystring(e),"\n")+"".concat(o,"\n\n")+"".concat(i,"\n")+"".concat(r)}},{key:"createStringToSign",value:function(e,t,r){var n=o().sha256(r,"hex");return"".concat(i.SG,"\n")+"".concat(e,"\n")+"".concat(t,"\n")+"".concat(n)}},{key:"calculateSignature",value:function(e,t,r,n){var i=this.createStringToSign(e,t,n);return o().hmac("sha256",r,i,"hex")}},{key:"deriveSigningKey",value:function(e,t,r,n){var i=e.secretAccessKey,c=o().hmac("sha256","AWS4"+i,n,"binary"),a=o().hmac("sha256",c,r,"binary"),u=o().hmac("sha256",a,t,"binary");return o().hmac("sha256",u,"aws4_request","binary")}},{key:"computeCanonicalURI",value:function(e){var t=e.path;if(this.uriEscapePath){var r,n=[],o=p(t.split("/"));try{for(o.s();!(r=o.n()).done;){var i=r.value;0!==(null==i?void 0:i.length)&&("."!==i&&(".."===i?n.pop():n.push(i)))}}catch(e){o.e(e)}finally{o.f()}var c=null!=t&&t.startsWith("/")?"/":"",a=n.join("/"),u=n.length>0&&null!=t&&t.endsWith("/")?"/":"",s="".concat(c).concat(a).concat(u);return encodeURIComponent(s).replace(/%2F/g,"/")}return t}},{key:"computeCanonicalQuerystring",value:function(e){var t,r=e.query,n=void 0===r?{}:r,o=[],c={},a=function(e){if(e.toLowerCase()===i.U4)return"continue";o.push(e);var t=n[e];"string"==typeof t?c[e]="".concat(P(e),"=").concat(P(t)):Array.isArray(t)&&(c[e]=t.slice(0).sort().reduce((function(t,r){return t.concat(["".concat(P(e),"=").concat(P(r))])}),[]).join("&"))},u=p(Object.keys(n).sort());try{for(u.s();!(t=u.n()).done;)a(t.value)}catch(e){u.e(e)}finally{u.f()}return o.map((function(e){return c[e]})).filter((function(e){return e})).join("&")}},{key:"computeCanonicalHeaders",value:function(e,t,r){var n,o=e.headers,c={},a=p(Object.keys(o).sort());try{for(a.s();!(n=a.n()).done;){var u=n.value;if(null!=o[u]){var s=u.toLowerCase();(s in i.Aq||null!=t&&t.has(s))&&(!r||r&&!r.has(s))||(c[s]=o[u].trim().replace(/\s+/g," "))}}}catch(e){a.e(e)}finally{a.f()}return c}},{key:"computePayloadHash",value:function(e){var t=e.headers,r=e.body;return t[i.R$]?t[i.R$]:null==r?i.sH:"string"==typeof r||(0,u.e)(r)?o().sha256(r,"hex").toLowerCase():ArrayBuffer.isView(r)?o().sha256(r.buffer,"hex").toLowerCase():i.n8}},{key:"moveHeadersToQuery",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.parse(JSON.stringify(e)),n=r.headers,o=r.query,i=void 0===o?{}:o,c=0,a=Object.keys(n);c{function n(e){return"function"==typeof ArrayBuffer&&(e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e))}function o(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return null!=n&&t.push("".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n))),t}),[]).join("&")}r.d(t,{C:()=>o,e:()=>n})},400:e=>{e.exports=require("k6/crypto")},255:e=>{e.exports=require("k6/html")},409:e=>{e.exports=require("k6/http")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{AWSConfig:()=>e.o,InvalidAWSConfigError:()=>e.l,InvalidSignatureError:()=>t.w,SQSClient:()=>j});var e=r(223),t=r(137),o=r(393),i=r(409),c=r.n(i),a=r(23),u=r(380);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},n={Action:"SendMessage",Version:S,QueueUrl:e,MessageBody:t};void 0!==r.messageDeduplicationId&&(n=l(l({},n),{},{MessageDeduplicationId:r.messageDeduplicationId})),void 0!==r.messageGroupId&&(n=l(l({},n),{},{MessageGroupId:r.messageGroupId}));var o=this.signature.sign({method:"POST",protocol:this.scheme,hostname:this.host,path:"/",headers:l({},this.commonHeaders),body:(0,a.C)(n)},{}),i=c().request("POST",o.url,o.body||"",{headers:o.headers});this._handleError("SendMessage",i);var u=i.html("SendMessageResponse > SendMessageResult");return new P(u.find("MessageId").text(),u.find("MD5OfMessageBody").text())}},{key:"listQueues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={Action:"ListQueues",Version:S};void 0!==(null==e?void 0:e.maxResults)&&(t=l(l({},t),{},{MaxResults:e.maxResults})),void 0!==(null==e?void 0:e.nextToken)&&(t=l(l({},t),{},{NextToken:e.nextToken})),void 0!==(null==e?void 0:e.queueNamePrefix)&&(t=l(l({},t),{},{QueueNamePrefix:e.queueNamePrefix}));var r=this.signature.sign({method:"POST",protocol:this.scheme,hostname:this.host,path:"/",headers:l(l({},this.commonHeaders),{},{Host:this.host}),body:(0,a.C)(t)},{}),n=c().request("POST",r.url,r.body||"",{headers:r.headers});this._handleError("ListQueues",n);var o=n.html();return{urls:o.find("QueueUrl").toArray().map((function(e){return e.text()})),nextToken:o.find("NextToken").text()||void 0}}},{key:"_handleError",value:function(e,r){var n=r.error_code;if(""!=r.error||0!==n){var o=u.t.parseXML(r.body);if("AuthorizationHeaderMalformed"===o.code)throw new t.w(o.message,o.code);throw new _(o.message,o.code||"unknown",e)}}}]),n}(o.k),P=d((function e(t,r){y(this,e),w(this,"id",void 0),w(this,"bodyMD5",void 0),this.id=t,this.bodyMD5=r})),_=function(e){h(r,e);var t=v(r);function r(e,n,o){var i;return y(this,r),w(m(i=t.call(this,e,n)),"operation",void 0),i.name="SQSServiceError",i.operation=o,i}return d(r)}(u.t)})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})(); //# sourceMappingURL=sqs.js.map \ No newline at end of file diff --git a/build/sqs.js.map b/build/sqs.js.map index ac9c574..69f6915 100644 --- a/build/sqs.js.map +++ b/build/sqs.js.map @@ -1 +1 @@ -{"version":3,"file":"sqs.js","mappings":"04BAUO,IAAMA,EAAS,WAWlB,SAAAA,EAAYC,EAAsBC,I,4FAAqBC,CAAA,KAAAH,GAAAI,EAAA,yBAAAA,EAAA,2BAAAA,EAAA,qBAAAA,EAAA,uBACnDC,KAAKJ,UAAYA,EACjBI,KAAKH,YAAcA,CACvB,C,UAiCD,O,EA/BCF,G,EAAA,EAAAM,IAAA,OAAAC,IAIA,WAII,OAHkBC,MAAdH,KAAKI,QACPJ,KAAKI,MAAQ,GAAHC,OAAML,KAAKH,YAAW,KAAAQ,OAAIL,KAAKJ,UAAUU,OAAM,KAAAD,OAAIL,KAAKJ,UAAUW,WAEvEP,KAAKI,KAChB,EAACI,IAED,SAAgBC,GACZT,KAAKI,MAAQK,CACjB,GAEE,CAAAR,IAAA,SAAAC,IAKF,WAKE,OAHoBC,MAAhBH,KAAKU,UACPV,KAAKU,QAAUV,KAAKJ,UAAUe,QAEzBX,KAAKU,OACd,EAEAF,IACA,SAAkBG,GAChBX,KAAKU,QAAUC,CACnB,M,8EAAChB,CAAA,CA/CmB,E,4sFCPf,IAAMiB,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCf,EAAA,KAAAc,GArFvCb,EAAA,sBAOAA,EAAA,2BAOAA,EAAA,+BAOAA,EAAA,4BAOAA,EAAA,c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AAKA,EACV3R,KAAK4R,QAAUA,CACnB,IAMSF,EAAe,SAAAxE,GAAAvL,EAAA+P,EAAAxE,GAAA,IAAA2E,EAAAhQ,EAAA6P,GAGxB,SAAAA,EAAY5P,EAAiBmC,EAAcmN,GAAyB,IAAAU,EAGtC,OAHsChS,EAAA,KAAA4R,GAC5C3R,EAAAoE,EAApB2N,EAAAD,EAAA9P,KAAA,KAAMD,EAASmC,IAAK,oBACpB6N,EAAK1N,KAAO,kBACZ0N,EAAKV,UAAYA,EAASU,CAC9B,CAAC,OAAA3Q,EAAAuQ,EAAA,CAPuB,CAAS1N,EAAAA,E","sources":["webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/sqs.ts"],"sourcesContent":["import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","module.exports = require(\"k6/crypto\");","module.exports = require(\"k6/html\");","module.exports = require(\"k6/http\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { SignatureV4, InvalidSignatureError } from './signature'\nimport { HTTPHeaders, SignedHTTPRequest } from './http'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\nimport { toFormUrlEncoded } from './utils'\nimport { AWSError } from './error'\n\nconst API_VERSION = '2012-11-05'\n\nexport class SQSClient extends AWSClient {\n private readonly signature: SignatureV4\n private readonly commonHeaders: HTTPHeaders\n\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'sqs')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken\n },\n uriEscapePath: true,\n applyChecksum: true\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }\n\n /**\n * Delivers a message to the specified queue.\n *\n * @param {string} queueUrl - The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.\n * @param {string} messageBody - The message to send. The minimum size is one character. The maximum size is 256 KB.\n * @param {Object} options - Options for the request\n * @param {string} [options.messageDeduplicationId] - The message deduplication id.\n * @param {string} [options.messageGroupId] - The message group ID for FIFO queues\n * @returns {Message} - The message that was sent.\n */\n sendMessage(queueUrl: string, messageBody: string, options: { messageDeduplicationId?: string; messageGroupId?: string} = {}): Message {\n const method = 'POST'\n\n let body: any = {\n Action: 'SendMessage',\n Version: API_VERSION,\n QueueUrl: queueUrl,\n MessageBody: messageBody,\n }\n\n if (typeof(options.messageDeduplicationId) !== 'undefined') {\n body = { ...body,\n MessageDeduplicationId: options.messageDeduplicationId\n }\n }\n\n if (typeof(options.messageGroupId) !== 'undefined') {\n body = { ...body,\n MessageGroupId: options.messageGroupId\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: 'https',\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('SendMessage', res)\n\n const parsed = res.html('SendMessageResponse > SendMessageResult')\n return new Message(\n parsed.find('MessageId').text(),\n parsed.find('MD5OfMessageBody').text()\n )\n }\n\n /**\n * Returns a list of your queues in the current region.\n *\n * @param {ListQueuesRequestParameters} [parameters={}] request parameters\n * @param {number} [ListQueuesRequestParameters.maxResults] Maximum number of results to include in the response. Value range is 1 to 1000. You must set maxResults to receive a value for nextToken in the response.\n * @param {string} [ListQueuesRequestParameters.nextToken] Pagination token to request the next set of results.\n * @param {string} [ListQueuesRequestParameters.queueNamePrefix] A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * @returns {Object}\n * @returns {string[]} Object.queueUrls - A list of queue URLs, up to 1000 entries.\n * @returns {string} [Object.nextToken] - In the future, you can use NextToken to request the next set of results.\n */\n listQueues(parameters: ListQueuesRequestParameters = {}): ListQueuesResponse {\n const method = 'POST'\n\n let body: any = {\n Action: 'ListQueues',\n Version: API_VERSION,\n }\n\n if (typeof(parameters?.maxResults) !== 'undefined') {\n body = { ...body,\n MaxResults: parameters.maxResults\n }\n }\n\n if (typeof(parameters?.nextToken) !== 'undefined') {\n body = { ...body,\n NextToken: parameters.nextToken\n }\n }\n\n if (typeof(parameters?.queueNamePrefix) !== 'undefined') {\n body = { ...body,\n QueueNamePrefix: parameters.queueNamePrefix\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: 'https',\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n 'Host': this.host\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('ListQueues', res)\n\n let parsed = res.html()\n return {\n urls: parsed.find('QueueUrl').toArray().map(e => e.text()),\n nextToken: parsed.find('NextToken').text() || undefined\n }\n }\n\n private _handleError(operation: SQSOperation, response: RefinedResponse) {\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n if (errorMessage == '' && errorCode === 0) {\n return\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new SQSServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/**\n * An Amazon SQS message.\n */\nexport class Message {\n /**\n * A unique identifier for the message.\n * A MessageIdis considered unique across all AWS accounts for an extended period of time.\n */\n id: string\n\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n bodyMD5: string\n\n /**\n * Instantiates a new Message object.\n *\n * @param id\n * @param md5Ofbody\n */\n constructor(id: string, bodyMD5: string) {\n this.id = id\n this.bodyMD5 = bodyMD5\n }\n}\n\n/**\n * SQSServiceError indicates an error occurred while interacting with the SQS API.\n */\nexport class SQSServiceError extends AWSError {\n operation: SQSOperation;\n\n constructor(message: string, code: string, operation: SQSOperation) {\n super(message, code)\n this.name = 'SQSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SQSOperation describes possible SQS operations.\n */\ntype SQSOperation = 'ListQueues' | 'SendMessage'\n\nexport interface SendMessageOptions {\n /*\n * The message deduplication ID for FIFO queues\n */\n messageDeduplicationId?: string\n\n /*\n * The message group ID for FIFO queues\n */\n messageGroupId?: string\n}\n\nexport interface ListQueuesRequestParameters {\n /**\n * Maximum number of results to include in the response. Value range is 1 to 1000.\n */\n maxResults?: number\n /**\n * Pagination token to request the next set of results.\n */\n nextToken?: string\n /**\n * A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * Queue URLs and names are case-sensitive.\n */\n queueNamePrefix?: string\n}\n\nexport interface ListQueuesResponse {\n /**\n * A list of queue URLs, up to 1,000 entries, or the value of MaxResults you sent in the request.\n */\n urls: string[]\n /**\n * Pagination token to include in the next request.\n */\n nextToken?: string\n}"],"names":["AWSClient","awsConfig","serviceName","_classCallCheck","_defineProperty","this","key","get","undefined","_host","concat","region","endpoint","set","host","_scheme","scheme","AWSConfig","options","InvalidAWSConfigError","accessKeyId","length","secretAccessKey","sessionToken","_createClass","value","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","call","_wrapNativeSuper","Error","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","MAX_PRESIGNED_TTL","EMPTY_SHA256","UNSIGNED_PAYLOAD","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","hasHeader","soughtHeader","headers","_i","_Object$keys","Object","keys","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","hostname","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","isArrayBuffer","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","prototype","toFormUrlEncoded","form","params","module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","hasOwnProperty","r","Symbol","toStringTag","API_VERSION","SQSClient","_AWSClient","commonHeaders","queueUrl","messageBody","Action","Version","QueueUrl","MessageBody","messageDeduplicationId","MessageDeduplicationId","messageGroupId","MessageGroupId","signedRequest","sign","res","http","_handleError","parsed","html","Message","parameters","maxResults","MaxResults","nextToken","NextToken","queueNamePrefix","QueueNamePrefix","urls","toArray","operation","response","errorCode","error_code","error","awsError","SQSServiceError","id","bodyMD5","_super2","_this2"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"sqs.js","mappings":"04BAUO,IAAMA,EAAS,WAWlB,SAAAA,EAAYC,EAAsBC,I,4FAAqBC,CAAA,KAAAH,GAAAI,EAAA,yBAAAA,EAAA,2BAAAA,EAAA,qBAAAA,EAAA,uBACnDC,KAAKJ,UAAYA,EACjBI,KAAKH,YAAcA,CACvB,C,UAiCD,O,EA/BCF,G,EAAA,EAAAM,IAAA,OAA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ACzDsM,UAAWN,EAAOjM,KAAK,aAAaC,aAAUtE,EAEtD,GAAC,CAAAF,IAAA,eAAAmB,MAED,SAAqBiQ,EAAyBC,GAC1C,IAAMC,EAAoBD,EAASE,WAGnC,GAAoB,IAFSF,EAASG,OAEE,IAAdF,EAA1B,CAIA,IAAMG,EAAW1N,EAAAA,EAAS2N,SAASL,EAASzK,MAC5C,GACS,iCADD6K,EAASzN,KAET,MAAM,IAAImE,EAAAA,EAAsBsJ,EAAS5P,QAAS4P,EAASzN,MAE3D,MAAM,IAAI2N,EAAgBF,EAAS5P,QAAS4P,EAASzN,MAAQ,UAAWoN,EAPhF,CASJ,KAAC9B,CAAA,CAjKiB,CAAS5P,EAAAA,GAuKlBgR,EAAOxP,GAkBhB,SAAAwP,EAAYkB,EAAYC,GAAiBhS,EAAA,KAAA6Q,GAjBzC5Q,EAAA,kBAMAA,EAAA,uBAYIC,KAAK6R,GAAKA,EACV7R,KAAK8R,QAAUA,CACnB,IAMSF,EAAe,SAAAzE,GAAAxL,EAAAiQ,EAAAzE,GAAA,IAAA4E,EAAAlQ,EAAA+P,GAGxB,SAAAA,EAAY9P,EAAiBmC,EAAcoN,GAAyB,IAAAW,EAGtC,OAHsClS,EAAA,KAAA8R,GAC5C7R,EAAAoE,EAApB6N,EAAAD,EAAAhQ,KAAA,KAAMD,EAASmC,IAAK,oBACpB+N,EAAK5N,KAAO,kBACZ4N,EAAKX,UAAYA,EAASW,CAC9B,CAAC,OAAA7Q,EAAAyQ,EAAA,CAPuB,CAAS5N,EAAAA,E","sources":["webpack://k6-jslib-aws/./src/internal/client.ts","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/sqs.ts"],"sourcesContent":["import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","module.exports = require(\"k6/crypto\");","module.exports = require(\"k6/html\");","module.exports = require(\"k6/http\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { SignatureV4, InvalidSignatureError } from './signature'\nimport { HTTPHeaders, SignedHTTPRequest } from './http'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\nimport { toFormUrlEncoded } from './utils'\nimport { AWSError } from './error'\n\nconst API_VERSION = '2012-11-05'\n\nexport class SQSClient extends AWSClient {\n private readonly signature: SignatureV4\n private readonly commonHeaders: HTTPHeaders\n\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'sqs')\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: this.awsConfig.region,\n credentials: {\n accessKeyId: this.awsConfig.accessKeyId,\n secretAccessKey: this.awsConfig.secretAccessKey,\n sessionToken: this.awsConfig.sessionToken\n },\n uriEscapePath: true,\n applyChecksum: true\n })\n\n this.commonHeaders = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }\n\n /**\n * Delivers a message to the specified queue.\n *\n * @param {string} queueUrl - The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.\n * @param {string} messageBody - The message to send. The minimum size is one character. The maximum size is 256 KB.\n * @param {Object} options - Options for the request\n * @param {string} [options.messageDeduplicationId] - The message deduplication id.\n * @param {string} [options.messageGroupId] - The message group ID for FIFO queues\n * @returns {Message} - The message that was sent.\n */\n sendMessage(queueUrl: string, messageBody: string, options: { messageDeduplicationId?: string; messageGroupId?: string} = {}): Message {\n const method = 'POST'\n\n let body: any = {\n Action: 'SendMessage',\n Version: API_VERSION,\n QueueUrl: queueUrl,\n MessageBody: messageBody,\n }\n\n if (typeof(options.messageDeduplicationId) !== 'undefined') {\n body = { ...body,\n MessageDeduplicationId: options.messageDeduplicationId\n }\n }\n\n if (typeof(options.messageGroupId) !== 'undefined') {\n body = { ...body,\n MessageGroupId: options.messageGroupId\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('SendMessage', res)\n\n const parsed = res.html('SendMessageResponse > SendMessageResult')\n return new Message(\n parsed.find('MessageId').text(),\n parsed.find('MD5OfMessageBody').text()\n )\n }\n\n /**\n * Returns a list of your queues in the current region.\n *\n * @param {ListQueuesRequestParameters} [parameters={}] request parameters\n * @param {number} [ListQueuesRequestParameters.maxResults] Maximum number of results to include in the response. Value range is 1 to 1000. You must set maxResults to receive a value for nextToken in the response.\n * @param {string} [ListQueuesRequestParameters.nextToken] Pagination token to request the next set of results.\n * @param {string} [ListQueuesRequestParameters.queueNamePrefix] A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * @returns {Object}\n * @returns {string[]} Object.queueUrls - A list of queue URLs, up to 1000 entries.\n * @returns {string} [Object.nextToken] - In the future, you can use NextToken to request the next set of results.\n */\n listQueues(parameters: ListQueuesRequestParameters = {}): ListQueuesResponse {\n const method = 'POST'\n\n let body: any = {\n Action: 'ListQueues',\n Version: API_VERSION,\n }\n\n if (typeof(parameters?.maxResults) !== 'undefined') {\n body = { ...body,\n MaxResults: parameters.maxResults\n }\n }\n\n if (typeof(parameters?.nextToken) !== 'undefined') {\n body = { ...body,\n NextToken: parameters.nextToken\n }\n }\n\n if (typeof(parameters?.queueNamePrefix) !== 'undefined') {\n body = { ...body,\n QueueNamePrefix: parameters.queueNamePrefix\n }\n }\n\n const signedRequest: SignedHTTPRequest = this.signature.sign(\n {\n method: 'POST',\n protocol: this.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n 'Host': this.host\n },\n body: toFormUrlEncoded(body)\n },\n {}\n )\n\n const res = http.request(method, signedRequest.url, signedRequest.body || '', {\n headers: signedRequest.headers\n })\n this._handleError('ListQueues', res)\n\n let parsed = res.html()\n return {\n urls: parsed.find('QueueUrl').toArray().map(e => e.text()),\n nextToken: parsed.find('NextToken').text() || undefined\n }\n }\n\n private _handleError(operation: SQSOperation, response: RefinedResponse) {\n const errorCode: number = response.error_code\n const errorMessage: string = response.error\n\n if (errorMessage == '' && errorCode === 0) {\n return\n }\n\n const awsError = AWSError.parseXML(response.body as string)\n switch (awsError.code) {\n case 'AuthorizationHeaderMalformed':\n throw new InvalidSignatureError(awsError.message, awsError.code)\n default:\n throw new SQSServiceError(awsError.message, awsError.code || 'unknown', operation)\n }\n }\n}\n\n/**\n * An Amazon SQS message.\n */\nexport class Message {\n /**\n * A unique identifier for the message.\n * A MessageIdis considered unique across all AWS accounts for an extended period of time.\n */\n id: string\n\n /**\n * An MD5 digest of the non-URL-encoded message body string.\n */\n bodyMD5: string\n\n /**\n * Instantiates a new Message object.\n *\n * @param id\n * @param md5Ofbody\n */\n constructor(id: string, bodyMD5: string) {\n this.id = id\n this.bodyMD5 = bodyMD5\n }\n}\n\n/**\n * SQSServiceError indicates an error occurred while interacting with the SQS API.\n */\nexport class SQSServiceError extends AWSError {\n operation: SQSOperation;\n\n constructor(message: string, code: string, operation: SQSOperation) {\n super(message, code)\n this.name = 'SQSServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SQSOperation describes possible SQS operations.\n */\ntype SQSOperation = 'ListQueues' | 'SendMessage'\n\nexport interface SendMessageOptions {\n /*\n * The message deduplication ID for FIFO queues\n */\n messageDeduplicationId?: string\n\n /*\n * The message group ID for FIFO queues\n */\n messageGroupId?: string\n}\n\nexport interface ListQueuesRequestParameters {\n /**\n * Maximum number of results to include in the response. Value range is 1 to 1000.\n */\n maxResults?: number\n /**\n * Pagination token to request the next set of results.\n */\n nextToken?: string\n /**\n * A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.\n * Queue URLs and names are case-sensitive.\n */\n queueNamePrefix?: string\n}\n\nexport interface ListQueuesResponse {\n /**\n * A list of queue URLs, up to 1,000 entries, or the value of MaxResults you sent in the request.\n */\n urls: string[]\n /**\n * Pagination token to include in the next request.\n */\n nextToken?: string\n}\n"],"names":["AWSClient","awsConfig","serviceName","_classCallCheck","_defineProperty","this","key","get","undefined","_host","concat","region","endpoint","set","host","_scheme","scheme","AWSConfig","options","InvalidAWSConfigError","accessKeyId","length","secretAccessKey","sessionToken","_createClass","value","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","call","_wrapNativeSuper","Error","AMZ_ALGORITHM_QUERY_PARAM","AMZ_CREDENTIAL_QUERY_PARAM","AMZ_DATE_QUERY_PARAM","AMZ_EXPIRES_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_SIGNED_HEADERS_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","MAX_PRESIGNED_TTL","EMPTY_SHA256","UNSIGNED_PAYLOAD","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","hasHeader","soughtHeader","headers","_i","_Object$keys","Object","keys","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","hostname","headerName","indexOf","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","isArrayBuffer","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","prototype","toFormUrlEncoded","form","params","module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","hasOwnProperty","r","Symbol","toStringTag","API_VERSION","SQSClient","_AWSClient","commonHeaders","queueUrl","messageBody","Action","Version","QueueUrl","MessageBody","messageDeduplicationId","MessageDeduplicationId","messageGroupId","MessageGroupId","signedRequest","sign","res","http","_handleError","parsed","html","Message","parameters","maxResults","MaxResults","nextToken","NextToken","queueNamePrefix","QueueNamePrefix","urls","toArray","operation","response","errorCode","error_code","error","awsError","parseXML","SQSServiceError","id","bodyMD5","_super2","_this2"],"sourceRoot":""} \ No newline at end of file diff --git a/build/ssm.js.map b/build/ssm.js.map index 12fc9e8..29a0747 100644 --- a/build/ssm.js.map +++ b/build/ssm.js.map @@ -1 +1 @@ -{"version":3,"file":"ssm.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,81FCFvD,IAAMC,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCC,EAAA,KAAAF,GArFvCG,EAAA,sBAOAA,EAAA,2BAOAA,EAAA,+BAOAA,EAAA,4BAOAA,EAAA,cAKqB,SAIrBA,EAAA,gBAKmB,kBA4CVF,EAAQG,Q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AjP,GAAA0N,EAAA,CAdkC,CAASpL,GAoB3CuK,GAAuB,SAAvBA,GAAuB,OAAvBA,EAAuB,4BAAvBA,CAAuB,EAAvBA,IAAuB,I","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/ssm.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's Systems Manager service\n */\nexport class SystemsManagerClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n signature: SignatureV4\n\n /**\n * Create a SystemsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'ssm')\n\n // All interactions with the Systems Manager service\n // are made via the POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n }\n\n /**\n * Retrieves a parameter from Amazon Systems Manager\n *\n * @param {string} name - The ARN or name of the parameter to retrieve.\n * @param {boolean} withDecryption - whether returned secure string parameters should be decrypted.\n * @returns {SystemsManagerParameter} - returns the fetched Parameter object.\n * @throws {SystemsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getParameter(\n name: string,\n withDecryption: boolean = false\n ): SystemsManagerParameter | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `AmazonSSM.GetParameter`,\n },\n body: JSON.stringify({ Name: name, WithDecryption: withDecryption }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SystemsManagerOperation.GetParameter, res)\n\n return SystemsManagerParameter.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(\n operation: SystemsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SystemsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SystemsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a Systems Manager's Parameter\n */\nexport class SystemsManagerParameter {\n /**\n * The Amazon Resource Name (ARN) of the parameter.\n */\n arn: string\n\n /**\n * The data type of the parameter, such as text or aws:ec2:image.\n * The default is text.\n */\n dataType: string\n\n /**\n * Date the parameter was last changed or updated and the parameter version was created.\n */\n lastModifiedDate: number\n\n /**\n * The friendly name of the parameter.\n */\n name: string\n\n /**\n * Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n */\n selector: string\n\n /**\n * plies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n */\n sourceResult: string\n\n /**\n * The type of parameter. Valid values include the following: String, StringList, and SecureString.\n */\n type: string\n\n /**\n * The parameter value.\n */\n value: string\n\n /**\n * The parameter version.\n */\n version: number\n\n /**\n * Constructs a Systems Manager's Parameter\n *\n * @param {string} arn - The Amazon Resource Name (ARN) of the parameter.\n * @param {string} dataType - The data type of the parameter, such as text or aws:ec2:image. The default is text.\n * @param {number} lastModifiedDate - Date the parameter was last changed or updated and the parameter version was created.\n * @param {string} name - The friendly name of the parameter.\n * @param {string} selector - Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n * @param {string} sourceResult - Applies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n * @param {string} type - The type of parameter. Valid values include the following: String, StringList, and SecureString.\n * @param {string} value - The parameter value.\n * @param {number} version - The parameter version.\n */\n constructor(\n arn: string,\n dataType: string,\n lastModifiedDate: number,\n name: string,\n selector: string,\n sourceResult: string,\n type: string,\n value: string,\n version: number\n ) {\n this.arn = arn\n this.dataType = dataType\n this.lastModifiedDate = lastModifiedDate\n this.name = name\n this.selector = selector\n this.sourceResult = sourceResult\n this.type = type\n this.value = value\n this.version = version\n }\n\n /**\n * Parses and constructs a Systems Manager's Parameter from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {SystemsManagerParameter}\n */\n static fromJSON(json: JSONObject): SystemsManagerParameter {\n const parameter = json.Parameter as JSONObject\n\n return new SystemsManagerParameter(\n parameter.ARN as string,\n parameter.DataType as string,\n parameter.LastModifiedDate as number,\n parameter.Name as string,\n parameter.Selector as string,\n parameter.SourceResult as string,\n parameter.Type as string,\n parameter.Value as string,\n parameter.Version as number\n )\n }\n}\n\nexport class SystemsManagerServiceError extends AWSError {\n operation: SystemsManagerOperation\n\n /**\n * Constructs a SystemsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {SystemsManagerOperation} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SystemsManagerOperation) {\n super(message, code)\n this.name = 'SystemsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SystemsManagerOperation defines all currently implemented Systems Manager operations.\n */\nenum SystemsManagerOperation {\n GetParameter = 'GetParameter',\n}\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","SystemsManagerClient","_AWSClient","awsConfig","commonHeaders","serviceName","withDecryption","signedRequest","sign","host","Name","WithDecryption","res","http","_handle_error","SystemsManagerOperation","GetParameter","SystemsManagerParameter","fromJSON","json","operation","response","errorCode","error_code","error","errorMessage","Message","__type","SystemsManagerServiceError","AWSClient","_host","set","_scheme","arn","dataType","lastModifiedDate","selector","sourceResult","type","version","parameter","Parameter","ARN","DataType","LastModifiedDate","Selector","SourceResult","Type","Value","Version","_super2","_this2"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"ssm.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,81FCFvD,IAAMC,EAAS,WAsFlB,SAAAA,EAAYC,GACR,GADmCC,EAAA,KAAAF,GArFvCG,EAAA,sBAOAA,EAAA,2BAOAA,EAAA,+BAOAA,EAAA,4BAOAA,EAAA,cAKqB,SAIrBA,EAAA,gBAKmB,kBA4CVF,EAAQG,QAA6B,KAAnBH,EAAQG,OAC3B,MAAM,IAAIC,EAAsB,yFAADC,OAC+DL,EAAQG,OAAM,MAIhH,IAAKH,EAAQM,aAAuC,KAAxBN,EAAQM,YAChC,MAAM,IAAIF,EAAsB,wEAADC,OAC8CL,EAAQM,YAAW,MAIpG,GAAIN,EAAQM,YAAYC,OAAS,IAAMP,EAAQM,YAAYC,OAAS,IAChE,MAAM,IAAIH,EAAsB,wFAADC,OAC6DL,EAAQM,YAAYC,SAIpH,IAAKP,EAAQQ,iBAA+C,KAA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AAA,wBAMAA,GAAA,gCAKAA,GAAA,oBAKAA,GAAA,wBAOAA,GAAA,4BAKAA,GAAA,oBAKAA,GAAA,qBAKAA,GAAA,uBA+BIO,KAAKqO,IAAMA,EACXrO,KAAKsO,SAAWA,EAChBtO,KAAKuO,iBAAmBA,EACxBvO,KAAK+C,KAAOA,EACZ/C,KAAKwO,SAAWA,EAChBxO,KAAKyO,aAAeA,EACpBzO,KAAK0O,KAAOA,EACZ1O,KAAKX,MAAQA,EACbW,KAAK2O,QAAUA,CACnB,CAwBC,OAtBDtO,GAAAgN,EAAA,OAAA7O,IAAA,WAAAa,MAQA,SAAgBkO,GACZ,IAAMqB,EAAYrB,EAAKsB,UAEvB,OAAO,IAAIxB,EACPuB,EAAUE,IACVF,EAAUG,SACVH,EAAUI,iBACVJ,EAAU9B,KACV8B,EAAUK,SACVL,EAAUM,aACVN,EAAUO,KACVP,EAAUQ,MACVR,EAAUS,QAElB,KAAChC,CAAA,CA5G+B,GA+GvBW,GAA0B,SAAApC,GAAAhL,GAAAoN,EAAApC,GAAA,IAAA0D,EAAAxO,GAAAkN,GAUnC,SAAAA,EAAYjN,EAAiB6B,EAAc4K,GAAoC,IAAA+B,EAGjD,OAHiD/P,GAAA,KAAAwO,GACvDvO,GAAAqD,GAApByM,EAAAD,EAAApQ,KAAA,KAAM6B,EAAS6B,IAAK,oBACpB2M,EAAKxM,KAAO,6BACZwM,EAAK/B,UAAYA,EAAS+B,CAC9B,CAAC,OAAAlP,GAAA2N,EAAA,CAdkC,CAASrL,GAoB3CwK,GAAuB,SAAvBA,GAAuB,OAAvBA,EAAuB,4BAAvBA,CAAuB,EAAvBA,IAAuB,I","sources":["webpack://k6-jslib-aws/webpack/bootstrap","webpack://k6-jslib-aws/webpack/runtime/compat get default export","webpack://k6-jslib-aws/webpack/runtime/define property getters","webpack://k6-jslib-aws/webpack/runtime/hasOwnProperty shorthand","webpack://k6-jslib-aws/webpack/runtime/make namespace object","webpack://k6-jslib-aws/./src/internal/config.ts","webpack://k6-jslib-aws/external commonjs \"k6/crypto\"","webpack://k6-jslib-aws/./src/internal/constants.ts","webpack://k6-jslib-aws/external commonjs \"k6/html\"","webpack://k6-jslib-aws/./src/internal/error.ts","webpack://k6-jslib-aws/./src/internal/signature.ts","webpack://k6-jslib-aws/./src/internal/http.ts","webpack://k6-jslib-aws/./src/internal/utils.ts","webpack://k6-jslib-aws/external commonjs \"k6/http\"","webpack://k6-jslib-aws/./src/internal/ssm.ts","webpack://k6-jslib-aws/./src/internal/client.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { HTTPScheme } from './http'\n\n/** Class holding an AWS connection information */\nexport class AWSConfig {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme} ['https']\n */\n scheme: HTTPScheme = 'https'\n\n // FIXME: Should really be called \"host\" instead. When used\n // with localstack we pass a complete host (hostname:port) here.\n /**\n * The AWS hostname to connect to.\n *\n * @type {string} ['amazonaws.com']\n */\n endpoint: string = 'amazonaws.com'\n\n /**\n * fromEnvironment creates an AWSConfig from the environment variables.\n *\n * It expects to find the following compulsory environment variables:\n * * AWS_REGION\n * * AWS_ACCESS_KEY_ID\n * * AWS_SECRET_ACCESS_KEY\n *\n * If set, the following optional environment variables are also used:\n * * AWS_SESSION_TOKEN\n *\n * Finally, the options parameter allows to explicitly set the scheme and endpoint\n * to use when connecting to AWS.\n *\n * @param options {AWSConnectionOptions}\n * @returns\n */\n static fromEnvironment(options?: AWSConnectionOptions): AWSConfig {\n const region = __ENV.AWS_REGION;\n const accessKeyId = __ENV.AWS_ACCESS_KEY_ID;\n const secretAccessKey = __ENV.AWS_SECRET_ACCESS_KEY;\n const sessionToken: string | undefined = __ENV.AWS_SESSION_TOKEN;\n const scheme: HTTPScheme | undefined = options?.scheme;\n const endpoint: string | undefined = options?.endpoint;\n\n return new AWSConfig({\n region,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n scheme: scheme,\n endpoint: endpoint,\n })\n }\n\n /**\n * Create an AWSConfig.\n *\n * @param {AWSConfigOptions} options - configuration attributes to use when interacting with AWS' APIs\n * @throws {InvalidArgumentException}\n */\n constructor(options: AWSConfigOptions) {\n if (!options.region || options.region === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS region; reason: expected a valid AWS region name (e.g. \"us-east-1\"), got \\`${options.region}\\``\n )\n }\n\n if (!options.accessKeyId || options.accessKeyId === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: expected a non empty string, got \\`${options.accessKeyId}\\``\n )\n }\n\n if (options.accessKeyId.length < 16 || options.accessKeyId.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS access key ID; reason: size should be between 16 and 128 characters, got ${options.accessKeyId.length}`\n )\n }\n\n if (!options.secretAccessKey || options.secretAccessKey === '') {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: expected a non empty string, got \\`${options.secretAccessKey}\\``\n )\n }\n\n if (options.secretAccessKey.length < 16 || options.secretAccessKey.length > 128) {\n throw new InvalidAWSConfigError(\n `invalid AWS secret access key; reason: size should be between 16 and 128 characters, got ${options.secretAccessKey.length}`\n )\n }\n\n this.region = options.region\n this.accessKeyId = options.accessKeyId\n this.secretAccessKey = options.secretAccessKey\n\n if (options.sessionToken !== undefined) {\n this.sessionToken = options.sessionToken\n }\n\n if (options.scheme !== undefined) {\n this.scheme = options.scheme\n }\n\n if (options.endpoint !== undefined) {\n this.endpoint = options.endpoint\n }\n }\n}\n\n/**\n * Interface representing AWSConfig options\n */\nexport interface AWSConfigOptions extends AWSConnectionOptions {\n /**\n * The AWS region to connect to, as listed: https://docs.aws.amazon.com/general/latest/gr/rande.html\n *\n * @type {string}\n */\n region: string\n\n /**\n * Your user's AWS access key id credential.\n *\n * @type {string}\n */\n accessKeyId: string\n\n /**\n * Your user's AWS secret access key credential.\n *\n * @type {string}\n */\n secretAccessKey: string\n\n /**\n * Your user's AWS session token credential.\n *\n * @type {string}\n */\n sessionToken?: string\n}\n\n/**\n * Interface representing AWS connection options\n */\nexport interface AWSConnectionOptions {\n /**\n * The HTTP scheme to use when connecting to AWS.\n *\n * @type {HTTPScheme}\n */\n scheme?: HTTPScheme\n\n /**\n * The AWS hostname to connect to.\n *\n * @type {string}\n */\n endpoint?: string\n}\n\n/** Class representing an invalid AWS configuration */\nexport class InvalidAWSConfigError extends Error {\n constructor(message: string) {\n super(message)\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/crypto\");","/**\n * Standard Amazon AWS query parameter names\n */\nexport const AMZ_ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm'\nexport const AMZ_CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential'\nexport const AMZ_DATE_QUERY_PARAM = 'X-Amz-Date'\nexport const AMZ_EXPIRES_QUERY_PARAM = 'X-Amz-Expires'\nexport const AMZ_SIGNATURE_QUERY_PARAM = 'X-Amz-Signature'\nexport const AMZ_SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders'\nexport const AMZ_TARGET_QUERY_PARAM = 'X-Amz-Target'\nexport const AMZ_TOKEN_QUERY_PARAM = 'X-Amz-Security-Token'\n\n/**\n * Standard Amazon AWS header names\n */\nexport const AMZ_CONTENT_SHA256_HEADER = 'x-amz-content-sha256'\nexport const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase()\nexport const AMZ_SIGNATURE_HEADER = AMZ_SIGNATURE_QUERY_PARAM.toLowerCase()\nexport const AMZ_TARGET_HEADER = AMZ_TARGET_QUERY_PARAM.toLowerCase()\nexport const AMZ_TOKEN_HEADER = AMZ_TOKEN_QUERY_PARAM.toLowerCase()\n\n/**\n * Common HTTP headers we rely on in the signing process\n */\nexport const AUTHORIZATION_HEADER = 'authorization'\nexport const DATE_HEADER = 'date'\n\n/**\n * Lists the headers that are generated as part of the signature process.\n */\nexport const GENERATED_HEADERS = [AUTHORIZATION_HEADER, AMZ_DATE_HEADER, DATE_HEADER]\nexport const HOST_HEADER = 'host'\n\n/**\n * Lists the headers that should never be included in the\n * request signature signature process.\n */\nexport const ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n 'cache-control': true,\n connection: true,\n expect: true,\n from: true,\n 'keep-alive': true,\n 'max-forwards': true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n 'user-agent': true,\n 'x-amzn-trace-id': true,\n}\n\n/**\n * Signature specific constants included in the signing process\n */\nexport const KEY_TYPE_IDENTIFIER = 'aws4_request'\nexport const SIGNING_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256'\n\n/**\n * Maximum time to live of a signed request in seconds: 7 days.\n */\nexport const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7\n\n/**\n * SHA256 hash of an empty string (so we don't waste cycles recomputing it)\n */\nexport const EMPTY_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n\n/**\n * SHA256 hash of the unsigned payload constant (so we don't waste cycles recomputing it)\n */\nexport const UNSIGNED_PAYLOAD_SHA256 =\n '5a41b0751e4537c6ff868564ab44a4d4ecceec2ec5b1c5f74d97422968e04237'\n\nexport const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD'\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/html\");","import { parseHTML } from 'k6/html'\n\n/**\n * Base class to derive errors from\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class AWSError extends Error {\n /**\n * Error code issued by the service (if any)\n */\n code?: string\n\n /**\n * Create an AWSError\n *\n * @param {string} message - A longer human readable error message.\n * @param {string?} code - A unique short code representing the error that was emitted\n */\n constructor(message: string, code?: string) {\n super(message)\n this.name = 'AWSError'\n this.code = code\n }\n\n /**\n * Parse an AWSError from an XML document\n *\n * @param {string} xmlDocument - Serialized XML document to parse the error from\n */\n static parseXML(xmlDocument: string): AWSError {\n const doc = parseHTML(xmlDocument)\n return new AWSError(doc.find('Message').text(), doc.find('Code').text())\n }\n}\n","import crypto from 'k6/crypto'\n\nimport * as constants from './constants'\nimport { AWSError } from './error'\nimport { hasHeader, HTTPHeaderBag, HTTPRequest, QueryParameterBag, SignedHTTPRequest } from './http'\nimport { isArrayBuffer } from './utils'\n\n/**\n * SignatureV4 can be used to sign HTTP requests and presign URLs using the AWS Signature\n * Version 4 signing process.\n *\n * It offers two signing methods:\n * - sign: signs the request headers and payload\n * - presign: returns a presigned (authorization information contained in the query string) URL\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html\n */\nexport class SignatureV4 {\n /**\n * The name of the service to sign for.\n */\n private readonly service: string\n\n /**\n * The name of the region to sign for.\n */\n private readonly region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n private readonly credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n private readonly uriEscapePath: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n private readonly applyChecksum: boolean\n\n // TODO: uriEscapePath and applyChecksum should not be present in the constructor\n constructor({\n service,\n region,\n credentials,\n uriEscapePath,\n applyChecksum,\n }: SignatureV4Options) {\n this.service = service\n this.region = region\n this.credentials = credentials\n this.uriEscapePath = typeof uriEscapePath === 'boolean' ? uriEscapePath : true\n this.applyChecksum = typeof applyChecksum === 'boolean' ? applyChecksum : true\n }\n\n /**\n * Includes AWS v4 signing information to the provided HTTP request.\n *\n * This method adds an Authorization header to the request, containing\n * the signature and other signing information. It also returns a preformatted\n * URL that can be used to make the k6 http request.\n *\n * This method mutates the request object.\n *\n * @param request {HTTPRequest} The request to sign.\n * @param options {Partial} Options for signing the request.\n * @returns {SignedHTTPRequest} The signed request.\n */\n sign(request: HTTPRequest, options: Partial = {}): SignedHTTPRequest {\n // Set default values for options which are not provided by the user.\n const defaultOptions = {\n signingDate: new Date(),\n unsignableHeaders: new Set(),\n signableHeaders: new Set(),\n }\n\n // Merge default options with the ones maybe provided by the user.\n const finalOptions = { ...defaultOptions, ...options }\n\n const { longDate, shortDate }: DateInfo = formatDate(finalOptions.signingDate)\n const service = finalOptions.signingService || this.service\n const region = finalOptions.signingRegion || this.region\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = request.hostname\n\n // Filter out headers that will be generated and managed by the signing process.\n // If the user provide any of those as part of the HTTPRequest's headers, they\n // will be ignored.\n for (const headerName of Object.keys(request.headers)) {\n if (constants.GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName]\n }\n }\n\n request.headers[constants.AMZ_DATE_HEADER] = longDate\n if (this.credentials.sessionToken) {\n request.headers[constants.AMZ_TOKEN_HEADER] = this.credentials.sessionToken\n }\n\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n if (ArrayBuffer.isView(request.body)) {\n request.body = request.body.buffer\n }\n\n // Ensure we avoid passing undefined to the crypto hash function.\n if (!request.body) {\n request.body = ''\n }\n\n let payloadHash = this.computePayloadHash(request)\n if (\n !hasHeader(constants.AMZ_CONTENT_SHA256_HEADER, request.headers) &&\n this.applyChecksum\n ) {\n request.headers[constants.AMZ_CONTENT_SHA256_HEADER] = payloadHash\n }\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n finalOptions.unsignableHeaders,\n finalOptions.signableHeaders\n )\n const signature = this.calculateSignature(\n longDate,\n scope,\n this.deriveSigningKey(this.credentials, service, region, shortDate),\n this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n )\n\n /**\n * Step 4 of the signing process: add the signature to the HTTP request's headers.\n *\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n */\n request.headers[constants.AUTHORIZATION_HEADER] =\n `${constants.SIGNING_ALGORITHM_IDENTIFIER} ` +\n `Credential=${this.credentials.accessKeyId}/${scope}, ` +\n `SignedHeaders=${Object.keys(canonicalHeaders).sort().join(';')}, ` +\n `Signature=${signature}`\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n // We exclude the signature from the query string\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return {\n url: url,\n ...request,\n }\n }\n\n /**\n * Produces a presigned URL with AWS v4 signature information for the provided HTTP request.\n *\n * A presigned URL is a URL that contains the authorization information\n * (signature and other signing information) in the query string. This method\n * returns a preformatted URL that can be used to make the k6 http request.\n *\n * @param originalRequest - The original request to presign.\n * @param options - Options controlling the signing of the request.\n * @returns A signed request, including the presigned URL.\n */\n presign(originalRequest: HTTPRequest, options: PresignOptions = {}): SignedHTTPRequest {\n const {\n signingDate = new Date(),\n expiresIn = 3600,\n unsignableHeaders,\n unhoistableHeaders,\n signableHeaders,\n signingRegion,\n signingService,\n } = options\n const { longDate, shortDate }: DateInfo = formatDate(signingDate)\n const region = signingRegion || this.region\n const service = signingService || this.service\n\n if (expiresIn > constants.MAX_PRESIGNED_TTL) {\n throw new InvalidSignatureError(\n \"Signature version 4 presigned URLs can't be valid for more than 7 days\"\n )\n }\n\n const scope = `${shortDate}/${region}/${service}/${constants.KEY_TYPE_IDENTIFIER}`\n const request = this.moveHeadersToQuery(originalRequest, { unhoistableHeaders })\n\n // Required by the specification:\n // \"For HTTP/1.1 requests, you must include the host header at a minimum.\n // Standard headers like content-type are optional.\n // For HTTP/2 requests, you must include the :authority header instead of\n // the host header. Different services might require other headers.\"\n request.headers[constants.HOST_HEADER] = originalRequest.hostname\n\n // If the user provided a session token, include it in the signed url query string.\n if (this.credentials.sessionToken) {\n request.query[constants.AMZ_TOKEN_QUERY_PARAM] = this.credentials.sessionToken\n }\n\n // Add base signing query parameters to the request, as described in the documentation\n // @see https://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html\n request.query[constants.AMZ_ALGORITHM_QUERY_PARAM] = constants.SIGNING_ALGORITHM_IDENTIFIER\n request.query[\n constants.AMZ_CREDENTIAL_QUERY_PARAM\n ] = `${this.credentials.accessKeyId}/${scope}`\n request.query[constants.AMZ_DATE_QUERY_PARAM] = longDate\n request.query[constants.AMZ_EXPIRES_QUERY_PARAM] = expiresIn.toString(10)\n\n const canonicalHeaders = this.computeCanonicalHeaders(\n request,\n unsignableHeaders,\n signableHeaders\n )\n request.query[constants.AMZ_SIGNED_HEADERS_QUERY_PARAM] = Object.keys(canonicalHeaders)\n .sort()\n .join(';')\n\n const signingKey = this.deriveSigningKey(this.credentials, service, region, shortDate)\n\n // Computing the payload from the original request. This is required\n // in the event the user attempts to produce a presigned URL for s3,\n // which requires the payload hash to be 'UNSIGNED-PAYLOAD'.\n //\n // To that effect, users need to set the 'x-amz-content-sha256' header,\n // and mark it as unhoistable and unsignable. When setup this way,\n // the computePayloadHash method will then return the string 'UNSIGNED-PAYLOAD'.\n const payloadHash = this.computePayloadHash(originalRequest)\n const canonicalRequest = this.createCanonicalRequest(request, canonicalHeaders, payloadHash)\n\n request.query[constants.AMZ_SIGNATURE_QUERY_PARAM] = this.calculateSignature(\n longDate,\n scope,\n signingKey,\n canonicalRequest\n )\n\n // If a request path was provided, add it to the URL\n let url = `${request.protocol}://${request.hostname}`\n if (request.path) {\n url += request.path\n }\n\n // If a request query string was provided, add it to the URL\n if (request.query) {\n url += `?${this.serializeQueryParameters(request.query)}`\n }\n\n return { url: url, ...request }\n }\n\n /**\n * Create a string including information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * Step 1 of the signing process: create the canonical request string.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html\n *\n * @param request {HTTPRequest} The request to sign.\n * @param canonicalHeaders {HTTPHeaderBag} The request's canonical headers.\n * @param payloadHash {string} The hexadecimally encoded request's payload hash .\n * @returns {string} The canonical request string.\n */\n private createCanonicalRequest(\n request: HTTPRequest,\n canonicalHeaders: HTTPHeaderBag,\n payloadHash: string\n ): string {\n const sortedHeaders = Object.keys(canonicalHeaders).sort()\n const sortedCanonicalHeaders = sortedHeaders\n .map((name) => `${name}:${canonicalHeaders[name]}`)\n .join('\\n')\n const signedHeaders = sortedHeaders.join(';')\n\n return (\n `${request.method}\\n` +\n `${this.computeCanonicalURI(request)}\\n` +\n `${this.computeCanonicalQuerystring(request)}\\n` +\n `${sortedCanonicalHeaders}\\n\\n` +\n `${signedHeaders}\\n` +\n `${payloadHash}`\n )\n }\n\n /**\n * Create the \"string to sign\" part of the signature Version 4 protocol.\n *\n * The \"string to sign\" includes meta information about your request and\n * about the canonical request that you created with `createCanonicalRequest`.\n * It is used hand in hand with the signing key to create the request signature.\n * Step 2 of the signing process: create the string to sign.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The \"string to sign\".\n */\n private createStringToSign(\n longDate: string,\n credentialScope: string,\n canonicalRequest: string\n ): string {\n const hashedCanonicalRequest = crypto.sha256(canonicalRequest, 'hex')\n\n return (\n `${constants.SIGNING_ALGORITHM_IDENTIFIER}\\n` +\n `${longDate}\\n` +\n `${credentialScope}\\n` +\n `${hashedCanonicalRequest}`\n )\n }\n\n /**\n * Calculte the signature for AWS signature version 4.\n *\n * Step 3 of the signing process: create the signature.\n * @see https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html\n *\n * @param longDate {string} The request's date in iso 8601 format.\n * @param credentialScope {string} The request's credential scope.\n * @param signingKey {string} the signing key as computed by the deriveSigningKey method.\n * @param canonicalRequest {string} The request's canonical request.\n * @returns {string} The signature.\n */\n private calculateSignature(\n longDate: string,\n credentialScope: string,\n signingKey: Uint8Array,\n canonicalRequest: string\n ): string {\n const stringToSign = this.createStringToSign(longDate, credentialScope, canonicalRequest)\n return crypto.hmac('sha256', signingKey, stringToSign, 'hex')\n }\n\n /**\n * Derives the signing key for authenticating requests signed with\n * the Signature version 4 authentication protocol.\n *\n * deriveSigningKey produces a signing key by creating a series of\n * hash-based message authentication codes (HMACs) represented in\n * a binary format.\n *\n * The derived signing key is specific to the date it's made at, as well as\n * the service and region it targets.\n *\n * @param credentials {AWSCredentials} The credentials to use for signing.\n * @param service {string} The service the request is targeted at.\n * @param region {string} The region the request is targeted at.\n * @param shortDate {string} The request's date in YYYYMMDD format.\n * @returns {Uint8Array} The derived signing key.\n */\n private deriveSigningKey(\n credentials: Credentials,\n service: string,\n region: string,\n shortDate: string\n ): Uint8Array {\n const kSecret: string = credentials.secretAccessKey\n const kDate: any = crypto.hmac('sha256', 'AWS4' + kSecret, shortDate, 'binary')\n const kRegion: any = crypto.hmac('sha256', kDate, region, 'binary')\n const kService: any = crypto.hmac('sha256', kRegion, service, 'binary')\n const kSigning: any = crypto.hmac('sha256', kService, 'aws4_request', 'binary')\n\n return kSigning\n }\n\n /**\n * Create a string that includes information from your request\n * in a AWS signature v4 standardized (canonical) format.\n *\n * @param param0 {HTTPRequest} The request to sign.\n * @returns {string} The canonical URI.\n */\n private computeCanonicalURI({ path }: HTTPRequest): string {\n if (this.uriEscapePath) {\n // Non-S3 services, we normalize the path and then double URI encode it.\n // Ref: \"Remove Dot Segments\" https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4\n const normalizedURISegments = []\n\n for (const URISegment of path.split('/')) {\n if (URISegment?.length === 0) {\n continue\n }\n\n if (URISegment === '.') {\n continue\n }\n\n if (URISegment === '..') {\n normalizedURISegments.pop()\n } else {\n normalizedURISegments.push(URISegment)\n }\n }\n\n // Normalize the URI\n const leading = path?.startsWith('/') ? '/' : ''\n const URI = normalizedURISegments.join('/')\n const trailing = normalizedURISegments.length > 0 && path?.endsWith('/') ? '/' : ''\n const normalizedURI = `${leading}${URI}${trailing}`\n\n const doubleEncoded = encodeURIComponent(normalizedURI)\n\n return doubleEncoded.replace(/%2F/g, '/')\n }\n\n // For S3, we shouldn't normalize the path. For example, object name\n // my-object//example//photo.user should not be normalized to\n // my-object/example/photo.user\n return path\n }\n\n /**\n * Serializes the request's query parameters into their canonical\n * string version. If the request does not include a query parameters,\n * returns an empty string.\n *\n * @param param0 {HTTPRequest} The request containing the query parameters.\n * @returns {string} The canonical query string.\n */\n private computeCanonicalQuerystring({ query = {} }: HTTPRequest): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (key.toLowerCase() === constants.AMZ_SIGNATURE_HEADER) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n\n /**\n * Create the canonical form of the request's headers.\n * Canonical headers consist of all the HTTP headers you\n * are including with the signed request.\n *\n * @param param0 {HTTPRequest} The request to compute the canonical headers of.\n * @param unsignableHeaders {Set} The headers that should not be signed.\n * @param signableHeaders {Set} The headers that should be signed.\n * @returns {string} The canonical headers.\n */\n private computeCanonicalHeaders(\n { headers }: HTTPRequest,\n unsignableHeaders?: Set,\n signableHeaders?: Set\n ): HTTPHeaderBag {\n const canonicalHeaders: HTTPHeaderBag = {}\n\n for (const headerName of Object.keys(headers).sort()) {\n if (headers[headerName] == undefined) {\n continue\n }\n\n const canonicalHeaderName = headerName.toLowerCase()\n if (\n canonicalHeaderName in constants.ALWAYS_UNSIGNABLE_HEADERS ||\n unsignableHeaders?.has(canonicalHeaderName)\n ) {\n if (\n !signableHeaders ||\n (signableHeaders && !signableHeaders.has(canonicalHeaderName))\n ) {\n continue\n }\n }\n\n canonicalHeaders[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, ' ')\n }\n\n return canonicalHeaders\n }\n\n /**\n * Computes the SHA256 cryptographic hash of the request's body.\n *\n * If the headers contain the 'X-Amz-Content-Sha256' header, then\n * the value of that header is returned instead. This proves useful\n * when, for example, presiging a URL for S3, as the payload hash\n * must always be equal to 'UNSIGNED-PAYLOAD'.\n *\n * @param param0 {HTTPRequest} The request to compute the payload hash of.\n * @returns {string} The hex encoded SHA256 payload hash, or the value of the 'X-Amz-Content-Sha256' header.\n */\n private computePayloadHash({ headers, body }: HTTPRequest): string {\n // for (const headerName of Object.keys(headers)) {\n // // If the header is present, return its value.\n // // So that we let the 'UNSIGNED-PAYLOAD' value pass through.\n // if (headerName.toLowerCase() === constants.AMZ_CONTENT_SHA256_HEADER) {\n // return headers[headerName]\n // }\n // }\n\n if (headers[constants.AMZ_CONTENT_SHA256_HEADER]) {\n return headers[constants.AMZ_CONTENT_SHA256_HEADER]\n }\n\n if (body == undefined) {\n return constants.EMPTY_SHA256\n }\n\n if (typeof body === 'string' || isArrayBuffer(body)) {\n return crypto.sha256(body, 'hex').toLowerCase()\n }\n\n if (ArrayBuffer.isView(body)) {\n // If the request body is a typed array, we need to convert it to a buffer\n // so that we can calculate the checksum.\n return crypto.sha256((body as DataView).buffer, 'hex').toLowerCase()\n }\n\n return constants.UNSIGNED_PAYLOAD\n }\n\n /**\n * Moves a request's headers to its query parameters.\n *\n * The operation will ignore any amazon standard headers, prefixed\n * with 'X-Amz-'. It will also ignore any headers specified as unhoistable\n * by the options.\n *\n * The operation will delete the headers from the request.\n *\n * @param request {HTTPRequest} The request to move the headers from.\n * @param options\n * @returns {HTTPRequest} The request with the headers moved to the query parameters.\n */\n private moveHeadersToQuery(\n request: HTTPRequest,\n options: { unhoistableHeaders?: Set } = {}\n ): HTTPRequest & { query: QueryParameterBag } {\n const requestCopy = JSON.parse(JSON.stringify(request))\n const { headers, query = {} as QueryParameterBag } = requestCopy\n\n for (const name of Object.keys(headers)) {\n const lowerCaseName = name.toLowerCase()\n if (\n lowerCaseName.slice(0, 6) === 'x-amz-' &&\n !options.unhoistableHeaders?.has(lowerCaseName)\n ) {\n query[name] = headers[name]\n delete headers[name]\n }\n }\n\n return {\n ...requestCopy,\n headers,\n query,\n }\n }\n\n /**\n * Serializes a HTTPRequest's query parameter bag into a string.\n *\n * @param query {QueryParameterBag} The query parameters to serialize.\n * @param ignoreKeys {Set} The keys to ignore.\n * @returns {string} The serialized, and ready to use in a URL, query parameters.\n */\n private serializeQueryParameters(query: QueryParameterBag, ignoreKeys?: string[]): string {\n const keys: Array = []\n const serialized: Record = {}\n\n for (const key of Object.keys(query).sort()) {\n if (ignoreKeys?.includes(key.toLowerCase())) {\n continue\n }\n\n keys.push(key)\n const value = query[key]\n\n if (typeof value === 'string') {\n serialized[key] = `${escapeURI(key)}=${escapeURI(value)}`\n } else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(\n (encoded: Array, value: string) =>\n encoded.concat([`${escapeURI(key)}=${escapeURI(value)}`]),\n []\n )\n .join('&')\n }\n }\n\n return keys\n .map((key) => serialized[key])\n .filter((serialized) => serialized)\n .join('&')\n }\n}\n\n/**\n * Error indicating an Invalid signature has been sent to AWS services\n *\n * Inspired from AWS official error types, as\n * described in:\n * * https://aws.amazon.com/blogs/developer/service-error-handling-modular-aws-sdk-js/\n * * https://github.com/aws/aws-sdk-js/blob/master/lib/error.d.ts\n */\nexport class InvalidSignatureError extends AWSError {\n /**\n * Constructs an InvalidSignatureError\n *\n * @param {string} message - human readable error message\n */\n constructor(message: string, code?: string) {\n super(message, code)\n this.name = 'InvalidSignatureError'\n }\n}\n\nexport interface SignatureV4Options {\n /**\n * The name of the service to sign for.\n */\n service: string\n\n /**\n * The name of the region to sign for.\n */\n region: string\n\n /**\n * The credentials with which the request should be signed.\n */\n credentials: Credentials\n\n /**\n * Whether to uri-escape the request URI path as part of computing the\n * canonical request string. This is required for every AWS service, except\n * Amazon S3, as of late 2017.\n *\n * @default [true]\n */\n uriEscapePath?: boolean\n\n /**\n * Whether to calculate a checksum of the request body and include it as\n * either a request header (when signing) or as a query string parameter\n * (when presigning). This is required for AWS Glacier and Amazon S3 and optional for\n * every other AWS service as of late 2017.\n *\n * @default [true]\n */\n applyChecksum?: boolean\n}\n\nexport interface SignOptions {\n /**\n * The date and time to be used as signature metadata. This value should be\n * a Date object, a unix (epoch) timestamp, or a string that can be\n * understood by the JavaScript `Date` constructor.If not supplied, the\n * value returned by `new Date()` will be used.\n */\n signingDate?: Date\n\n /**\n * The service signing name. It will override the service name of the signer\n * in current invocation\n */\n signingService?: string\n\n /**\n * The region name to sign the request. It will override the signing region of the\n * signer in current invocation\n */\n signingRegion?: string\n}\n\nexport interface RequestSigningOptions extends SignOptions {\n /**\n * A set of strings whose members represents headers that cannot be signed.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unsignableHeaders set.\n */\n unsignableHeaders?: Set\n\n /**\n * A set of strings whose members represents headers that should be signed.\n * Any values passed here will override those provided via unsignableHeaders,\n * allowing them to be signed.\n *\n * All headers in the provided request will have their names converted to\n * lower case before signing.\n */\n signableHeaders?: Set\n}\n\nexport interface PresignOptions extends RequestSigningOptions {\n /**\n * The number of seconds before the presigned URL expires\n */\n expiresIn?: number\n\n /**\n * A set of strings whose representing headers that should not be hoisted\n * to presigned request's query string. If not supplied, the presigner\n * moves all the AWS-specific headers (starting with `x-amz-`) to the request\n * query string. If supplied, these headers remain in the presigned request's\n * header.\n * All headers in the provided request will have their names converted to\n * lower case and then checked for existence in the unhoistableHeaders set.\n */\n unhoistableHeaders?: Set\n}\n\nexport interface Credentials {\n /**\n * AWS access key ID\n */\n readonly accessKeyId: string\n\n /**\n * AWS secret access key\n */\n readonly secretAccessKey: string\n\n /**\n * A security or session token to use with these credentials. Usually\n * present for temporary credentials.\n */\n readonly sessionToken?: string\n}\n\nexport interface DateInfo {\n /**\n * ISO8601 formatted date string\n */\n longDate: string\n\n /**\n * String in the format YYYYMMDD\n */\n shortDate: string\n}\n\n/**\n * Escapes a URI following the AWS signature v4 escaping rules.\n *\n * @param URI {string} The URI to escape.\n * @returns {string} The escaped URI.\n */\nfunction escapeURI(URI: string): string {\n const hexEncode = (c: string): string => {\n return `%${c.charCodeAt(0).toString(16).toUpperCase()}`\n }\n\n return encodeURIComponent(URI).replace(/[!'()*]/g, hexEncode)\n}\n\n/**\n * formatDate formats a Date object into a ISO8601 formatted date string\n * and a string in the format YYYYMMDD.\n *\n * @param date {Date} The date to format.\n * @returns {DateInfo} The formatted date.\n */\nfunction formatDate(date: Date): DateInfo {\n const longDate = iso8601(date).replace(/[\\-:]/g, '')\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n }\n}\n\n/**\n * Formats a time into an ISO 8601 string.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n *\n * @param time {number | string | Date} The time to format.\n * @returns {string} The ISO 8601 formatted time.\n */\nfunction iso8601(time: number | string | Date): string {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, 'Z')\n}\n\n/**\n * Converts a time value into a Date object.\n *\n * @param time {number | string | Date} The time to convert.\n * @returns {Date} The resulting Date object.\n */\nfunction toDate(time: number | string | Date): Date {\n if (typeof time === 'number') {\n return new Date(time * 1000)\n }\n\n if (typeof time === 'string') {\n if (Number(time)) {\n return new Date(Number(time) * 1000)\n }\n\n return new Date(time)\n }\n\n return time\n}\n","/**\n * Type representing HTTP schemes\n */\nexport type HTTPScheme = 'http' | 'https'\n\n/**\n * Type representing HTTP Methods\n *\n */\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'\n\n/**\n * Type alias representing HTTP Headers\n */\nexport type HTTPHeaders = { [key: string]: string }\n\n/**\n * HTTPHeaderBag is a type alias representing HTTP Headers\n */\nexport type HTTPHeaderBag = Record\n\nexport function hasHeader(soughtHeader: string, headers: HTTPHeaderBag): boolean {\n soughtHeader = soughtHeader.toLowerCase()\n\n for (const headerName of Object.keys(headers)) {\n if (soughtHeader === headerName.toLowerCase()) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * QueryParameterBag is a type alias representing HTTP Query Parameters\n */\nexport type QueryParameterBag = Record>\n\n/**\n * HTTPRequest represents an HTTP request\n */\nexport interface HTTPRequest {\n /**\n * The HTTP method to use\n */\n method: HTTPMethod\n\n /**\n * The protocol to use (http or https)\n */\n protocol: HTTPScheme\n\n /**\n * The hostname (domain name or IP address) the request targets\n */\n hostname: string\n\n /**\n * The port to the request targets\n */\n port?: number\n\n /**\n * The path to the resource\n */\n path: string\n\n /**\n * The query parameters to include in the request\n */\n query?: QueryParameterBag\n\n /**\n * The headers to include in the request\n */\n headers: HTTPHeaderBag\n\n /**\n * The body of the request\n */\n body?: string | ArrayBuffer | null\n}\n\n/**\n * SignedHTTPRequest represents an HTTP request that has been signed\n * with an AWS signature. It is a superset of HTTPRequest adding\n * the following fields:\n * - url: the fully qualified URL of the request that can be used in a k6 http.request.\n */\nexport interface SignedHTTPRequest extends HTTPRequest {\n url: string\n}\n","/**\n *\n * @param value\n * @returns\n */\nexport function isArrayBuffer(value: any): value is ArrayBuffer {\n return (\n typeof ArrayBuffer === 'function' &&\n (value instanceof ArrayBuffer ||\n Object.prototype.toString.call(value) === '[object ArrayBuffer]')\n )\n}\n\nexport function toFormUrlEncoded(form: any): string {\n return Object.keys(form).reduce((params, key) => {\n let value = form[key]\n if (value !== undefined && value !== null) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n return params;\n }, [] as string[]).join('&')\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"k6/http\");","import { JSONObject } from 'k6'\nimport http, { RefinedResponse, ResponseType } from 'k6/http'\n\nimport { AWSClient } from './client'\nimport { AWSConfig } from './config'\nimport { AMZ_TARGET_HEADER } from './constants'\nimport { AWSError } from './error'\nimport { HTTPHeaders, HTTPMethod } from './http'\nimport { InvalidSignatureError, SignatureV4 } from './signature'\n\n/**\n * Class allowing to interact with Amazon AWS's Systems Manager service\n */\nexport class SystemsManagerClient extends AWSClient {\n method: HTTPMethod\n commonHeaders: HTTPHeaders\n signature: SignatureV4\n\n /**\n * Create a SystemsManagerClient\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n */\n constructor(awsConfig: AWSConfig) {\n super(awsConfig, 'ssm')\n\n // All interactions with the Systems Manager service\n // are made via the POST method.\n this.method = 'POST'\n this.commonHeaders = {\n 'Content-Type': 'application/x-amz-json-1.1',\n }\n\n this.signature = new SignatureV4({\n service: this.serviceName,\n region: awsConfig.region,\n credentials: {\n accessKeyId: awsConfig.accessKeyId,\n secretAccessKey: awsConfig.secretAccessKey,\n },\n uriEscapePath: true,\n applyChecksum: false,\n })\n }\n\n /**\n * Retrieves a parameter from Amazon Systems Manager\n *\n * @param {string} name - The ARN or name of the parameter to retrieve.\n * @param {boolean} withDecryption - whether returned secure string parameters should be decrypted.\n * @returns {SystemsManagerParameter} - returns the fetched Parameter object.\n * @throws {SystemsManagerServiceError}\n * @throws {InvalidSignatureError}\n */\n getParameter(\n name: string,\n withDecryption: boolean = false\n ): SystemsManagerParameter | undefined {\n const signedRequest = this.signature.sign(\n {\n method: this.method,\n protocol: this.awsConfig.scheme,\n hostname: this.host,\n path: '/',\n headers: {\n ...this.commonHeaders,\n [AMZ_TARGET_HEADER]: `AmazonSSM.GetParameter`,\n },\n body: JSON.stringify({ Name: name, WithDecryption: withDecryption }),\n },\n {}\n )\n\n const res = http.request(this.method, signedRequest.url, signedRequest.body, {\n headers: signedRequest.headers,\n })\n this._handle_error(SystemsManagerOperation.GetParameter, res)\n\n return SystemsManagerParameter.fromJSON(res.json() as JSONObject)\n }\n\n _handle_error(\n operation: SystemsManagerOperation,\n response: RefinedResponse\n ) {\n const errorCode = response.error_code\n if (errorCode === 0) {\n return\n }\n\n const error = response.json() as JSONObject\n if (errorCode >= 1400 && errorCode <= 1499) {\n // In the event of certain errors, the message is not set.\n // Also, note the inconsistency in casing...\n const errorMessage: string =\n (error.Message as string) || (error.message as string) || (error.__type as string)\n\n // Handle specifically the case of an invalid signature\n if (error.__type === 'InvalidSignatureException') {\n throw new InvalidSignatureError(errorMessage, error.__type)\n }\n\n // Otherwise throw a standard service error\n throw new SystemsManagerServiceError(errorMessage, error.__type as string, operation)\n }\n\n if (errorCode === 1500) {\n throw new SystemsManagerServiceError(\n 'An error occured on the server side',\n 'InternalServiceError',\n operation\n )\n }\n }\n}\n\n/**\n * Class representing a Systems Manager's Parameter\n */\nexport class SystemsManagerParameter {\n /**\n * The Amazon Resource Name (ARN) of the parameter.\n */\n arn: string\n\n /**\n * The data type of the parameter, such as text or aws:ec2:image.\n * The default is text.\n */\n dataType: string\n\n /**\n * Date the parameter was last changed or updated and the parameter version was created.\n */\n lastModifiedDate: number\n\n /**\n * The friendly name of the parameter.\n */\n name: string\n\n /**\n * Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n */\n selector: string\n\n /**\n * plies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n */\n sourceResult: string\n\n /**\n * The type of parameter. Valid values include the following: String, StringList, and SecureString.\n */\n type: string\n\n /**\n * The parameter value.\n */\n value: string\n\n /**\n * The parameter version.\n */\n version: number\n\n /**\n * Constructs a Systems Manager's Parameter\n *\n * @param {string} arn - The Amazon Resource Name (ARN) of the parameter.\n * @param {string} dataType - The data type of the parameter, such as text or aws:ec2:image. The default is text.\n * @param {number} lastModifiedDate - Date the parameter was last changed or updated and the parameter version was created.\n * @param {string} name - The friendly name of the parameter.\n * @param {string} selector - Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:\n * parameter_name:version\n * parameter_name:label\n * @param {string} sourceResult - Applies to parameters that reference information in other AWS services. SourceResult is the raw result or response from the source.\n * @param {string} type - The type of parameter. Valid values include the following: String, StringList, and SecureString.\n * @param {string} value - The parameter value.\n * @param {number} version - The parameter version.\n */\n constructor(\n arn: string,\n dataType: string,\n lastModifiedDate: number,\n name: string,\n selector: string,\n sourceResult: string,\n type: string,\n value: string,\n version: number\n ) {\n this.arn = arn\n this.dataType = dataType\n this.lastModifiedDate = lastModifiedDate\n this.name = name\n this.selector = selector\n this.sourceResult = sourceResult\n this.type = type\n this.value = value\n this.version = version\n }\n\n /**\n * Parses and constructs a Systems Manager's Parameter from the content\n * of a JSON response returned by the AWS service\n *\n * @param {Object} json - JSON object as returned and parsed from\n * the AWS service's API call.\n * @returns {SystemsManagerParameter}\n */\n static fromJSON(json: JSONObject): SystemsManagerParameter {\n const parameter = json.Parameter as JSONObject\n\n return new SystemsManagerParameter(\n parameter.ARN as string,\n parameter.DataType as string,\n parameter.LastModifiedDate as number,\n parameter.Name as string,\n parameter.Selector as string,\n parameter.SourceResult as string,\n parameter.Type as string,\n parameter.Value as string,\n parameter.Version as number\n )\n }\n}\n\nexport class SystemsManagerServiceError extends AWSError {\n operation: SystemsManagerOperation\n\n /**\n * Constructs a SystemsManagerServiceError\n *\n * @param {string} message - human readable error message\n * @param {string} code - A unique short code representing the error that was emitted\n * @param {SystemsManagerOperation} operation - Name of the failed Operation\n */\n constructor(message: string, code: string, operation: SystemsManagerOperation) {\n super(message, code)\n this.name = 'SystemsManagerServiceError'\n this.operation = operation\n }\n}\n\n/**\n * SystemsManagerOperation defines all currently implemented Systems Manager operations.\n */\nenum SystemsManagerOperation {\n GetParameter = 'GetParameter',\n}\n","import { AWSConfig } from './config'\nimport { HTTPHeaders } from './http'\nimport { HTTPScheme } from './http'\n/**\n * Class allowing to build requests targeting AWS APIs\n *\n * This class is meant to be used as a base class for specific\n * services clients. See S3Client or SecretsManagerClient for\n * usage examples.\n */\nexport class AWSClient {\n awsConfig: AWSConfig\n serviceName: string\n\n private _host?: string\n private _scheme?: HTTPScheme\n /**\n * @param {AWSConfig} awsConfig - configuration attributes to use when interacting with AWS' APIs\n * @param {string} serviceName - name of the service to target.\n * @param {URIEncodingConfig} URIencodingConfig - configures how requests URIs should be encoded.\n */\n constructor(awsConfig: AWSConfig, serviceName: string) {\n this.awsConfig = awsConfig\n this.serviceName = serviceName\n }\n\n /**\n * Property computing the URL to send the requests to when interacting with\n * the specific AWS service the child class implements the functionalities of.\n */\n public get host() {\n if (this._host == undefined) {\n this._host = `${this.serviceName}.${this.awsConfig.region}.${this.awsConfig.endpoint}`\n }\n return this._host\n }\n\n public set host(host: string) {\n this._host = host\n }\n\n /**\n * Property computing the scheme to use http or https. Defaults to https as per AWSConfig Defaults\n * the specific AWS service the child class implements the functionalities of.\n */\n \n public get scheme() {\n\n if (this._scheme == undefined) {\n this._scheme = this.awsConfig.scheme;\n }\n return this._scheme\n }\n \n // Validatiuon should be done by the type declaration \n public set scheme(scheme: HTTPScheme) {\n this._scheme = scheme\n }\n\n}\n\n/**\n * Type alias representing the result of an AWSClient.buildRequest call\n */\nexport interface AWSRequest {\n url: string\n headers: HTTPHeaders\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","AWSConfig","options","_classCallCheck","_defineProperty","region","InvalidAWSConfigError","concat","accessKeyId","length","secretAccessKey","this","undefined","sessionToken","scheme","endpoint","_createClass","__ENV","AWS_REGION","AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN","_Error","_inherits","_super","_createSuper","message","_wrapNativeSuper","Error","require","AMZ_DATE_QUERY_PARAM","AMZ_SIGNATURE_QUERY_PARAM","AMZ_TOKEN_QUERY_PARAM","AMZ_CONTENT_SHA256_HEADER","AMZ_DATE_HEADER","toLowerCase","AMZ_SIGNATURE_HEADER","AMZ_TARGET_HEADER","AMZ_TOKEN_HEADER","AUTHORIZATION_HEADER","GENERATED_HEADERS","HOST_HEADER","ALWAYS_UNSIGNABLE_HEADERS","authorization","connection","expect","from","pragma","referer","te","trailer","upgrade","KEY_TYPE_IDENTIFIER","SIGNING_ALGORITHM_IDENTIFIER","AWSError","code","_this","_assertThisInitialized","name","xmlDocument","doc","parseHTML","find","text","SignatureV4","_ref","service","credentials","uriEscapePath","applyChecksum","request","arguments","finalOptions","_objectSpread","signingDate","Date","unsignableHeaders","Set","signableHeaders","_formatDate","formatDate","longDate","shortDate","signingService","signingRegion","scope","constants","headers","hostname","_i","_Object$keys","keys","headerName","indexOf","ArrayBuffer","isView","body","buffer","payloadHash","computePayloadHash","soughtHeader","hasHeader","canonicalHeaders","computeCanonicalHeaders","signature","calculateSignature","deriveSigningKey","createCanonicalRequest","sort","join","url","protocol","path","query","serializeQueryParameters","originalRequest","_options$signingDate","_options$expiresIn","expiresIn","unhoistableHeaders","_formatDate2","InvalidSignatureError","moveHeadersToQuery","toString","signingKey","canonicalRequest","sortedHeaders","sortedCanonicalHeaders","map","signedHeaders","method","computeCanonicalURI","computeCanonicalQuerystring","credentialScope","hashedCanonicalRequest","crypto","stringToSign","createStringToSign","kSecret","kDate","kRegion","kService","_ref2","_step","normalizedURISegments","_iterator","_createForOfIteratorHelper","split","s","n","done","URISegment","pop","push","err","e","f","leading","startsWith","URI","trailing","endsWith","normalizedURI","encodeURIComponent","replace","_ref3","_step2","_ref3$query","serialized","_loop","escapeURI","Array","isArray","slice","reduce","encoded","_iterator2","filter","_ref4","_step3","_iterator3","canonicalHeaderName","has","trim","_ref5","requestCopy","JSON","parse","stringify","_requestCopy$query","_i2","_Object$keys2","_options$unhoistableH","lowerCaseName","ignoreKeys","_step4","_loop2","includes","_iterator4","_AWSError","c","charCodeAt","toUpperCase","date","time","Number","toDate","toISOString","SystemsManagerClient","_AWSClient","awsConfig","commonHeaders","serviceName","withDecryption","signedRequest","sign","host","Name","WithDecryption","res","http","_handle_error","SystemsManagerOperation","GetParameter","SystemsManagerParameter","fromJSON","json","operation","response","errorCode","error_code","error","errorMessage","Message","__type","SystemsManagerServiceError","AWSClient","_host","set","_scheme","arn","dataType","lastModifiedDate","selector","sourceResult","type","version","parameter","Parameter","ARN","DataType","LastModifiedDate","Selector","SourceResult","Type","Value","Version","_super2","_this2"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b3546f5..474f7d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "k6-jslib-aws", - "version": "0.7.2", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "k6-jslib-aws", - "version": "0.7.2", + "version": "0.8.0", "license": "MIT", "devDependencies": { "@babel/core": "^7.4.4", @@ -31,12 +31,12 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { @@ -44,42 +44,42 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.20.10", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.10.tgz", - "integrity": "sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz", + "integrity": "sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.12", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", - "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helpers": "^7.20.7", - "@babel/parser": "^7.20.7", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.12", - "@babel/types": "^7.20.7", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", + "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -95,66 +95,52 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.7.tgz", - "integrity": "sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", + "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "dependencies": { - "@babel/types": "^7.20.7", + "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", - "integrity": "sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz", + "integrity": "sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw==", "dev": true, "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.18.6", - "@babel/types": "^7.18.9" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz", + "integrity": "sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", + "@babel/compat-data": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", "browserslist": "^4.21.3", "lru-cache": "^5.1.1", "semver": "^6.3.0" @@ -167,19 +153,20 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.20.12", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.12.tgz", - "integrity": "sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-member-expression-to-functions": "^7.20.7", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/helper-split-export-declaration": "^7.18.6" + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", + "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -189,13 +176,14 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", - "integrity": "sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.5.tgz", + "integrity": "sha512-1VpEFOIbMRaXyDeUwUfmTIxExLwQ+zkW+Bh5zXpApA3oQedBx9v/updixWxnx/bZpKw7u8VxWjb/qWpIcmPq8A==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.2.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "regexpu-core": "^5.3.1", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -205,9 +193,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz", - "integrity": "sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.0.tgz", + "integrity": "sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg==", "dev": true, "dependencies": { "@babel/helper-compilation-targets": "^7.17.7", @@ -222,125 +210,113 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz", - "integrity": "sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "dependencies": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz", - "integrity": "sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", + "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", "dev": true, "dependencies": { - "@babel/types": "^7.20.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", - "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", + "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.10", - "@babel/types": "^7.20.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", - "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz", + "integrity": "sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-wrap-function": "^7.18.9", - "@babel/types": "^7.18.9" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-wrap-function": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -350,121 +326,121 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz", - "integrity": "sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", + "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.20.7", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", - "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "dependencies": { - "@babel/types": "^7.20.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", + "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", - "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz", + "integrity": "sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5" + "@babel/helper-function-name": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.7.tgz", - "integrity": "sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.5.tgz", + "integrity": "sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -473,9 +449,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.7.tgz", - "integrity": "sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", + "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -485,12 +461,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", - "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz", + "integrity": "sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -500,14 +476,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz", - "integrity": "sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz", + "integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-proposal-optional-chaining": "^7.20.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -516,24 +492,6 @@ "@babel/core": "^7.13.0" } }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", - "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", - "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-class-properties": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", @@ -550,119 +508,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz", - "integrity": "sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.20.7", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0" - } - }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", - "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", - "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", - "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", - "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", - "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-object-rest-spread": { "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", @@ -682,66 +527,11 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", - "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz", - "integrity": "sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", - "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz", - "integrity": "sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==", + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.20.5", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - }, "engines": { "node": ">=6.9.0" }, @@ -829,12 +619,27 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz", - "integrity": "sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", + "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", + "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -843,6 +648,18 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-json-strings": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", @@ -855,6 +672,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", @@ -958,12 +790,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -972,13 +804,47 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz", - "integrity": "sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", + "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.5.tgz", + "integrity": "sha512-gGOEvFzm3fWoyD5uZq7vVTD57pPJ3PczPUD/xCFGjzBpUosnklmXyKnGQbbbGs1NPNPskFex0j93yKbHt0cHyg==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5", + "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { "node": ">=6.9.0" @@ -988,14 +854,14 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz", - "integrity": "sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", + "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9" + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1005,12 +871,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", - "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", + "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1020,12 +886,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.11.tgz", - "integrity": "sha512-tA4N427a7fjf1P0/2I4ScsHGc5jcHPbb30xMbaTke2gxDuWpUfXDuX1FEymJwKk4tuGUvGcejAR6HdZVqmmPyw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz", + "integrity": "sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1034,20 +900,53 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz", - "integrity": "sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ==", + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", + "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz", + "integrity": "sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz", + "integrity": "sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", "globals": "^11.1.0" }, "engines": { @@ -1058,13 +957,13 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz", - "integrity": "sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", + "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/template": "^7.20.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/template": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1074,12 +973,12 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz", - "integrity": "sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz", + "integrity": "sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1089,13 +988,13 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", - "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", + "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1105,12 +1004,28 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", - "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", + "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz", + "integrity": "sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1120,13 +1035,29 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", - "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", + "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz", + "integrity": "sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1136,12 +1067,12 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz", - "integrity": "sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz", + "integrity": "sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1151,14 +1082,30 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", - "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", + "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz", + "integrity": "sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1168,12 +1115,28 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", - "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", + "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz", + "integrity": "sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { "node": ">=6.9.0" @@ -1183,12 +1146,12 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", - "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", + "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1198,13 +1161,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz", - "integrity": "sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", + "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1214,14 +1177,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.11.tgz", - "integrity": "sha512-S8e1f7WQ7cimJQ51JkAaDrEtohVEitXjgCGAS2N8S31Y42E+kWwfSz83LYz57QdBm7q9diARVqanIaH2oVgQnw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", + "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-simple-access": "^7.20.2" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1231,15 +1194,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz", - "integrity": "sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz", + "integrity": "sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-validator-identifier": "^7.19.1" + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1249,13 +1212,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", - "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", + "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1265,13 +1228,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", - "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", + "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.20.5", - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1281,12 +1244,63 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", - "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", + "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz", + "integrity": "sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz", + "integrity": "sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz", + "integrity": "sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1296,13 +1310,46 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", - "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", + "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz", + "integrity": "sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz", + "integrity": "sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1312,12 +1359,46 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz", - "integrity": "sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", + "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", + "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz", + "integrity": "sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { "node": ">=6.9.0" @@ -1327,12 +1408,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", - "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", + "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1342,12 +1423,12 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", - "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", + "integrity": "sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-plugin-utils": "^7.22.5", "regenerator-transform": "^0.15.1" }, "engines": { @@ -1358,12 +1439,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", - "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", + "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1373,12 +1454,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", - "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", + "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1388,13 +1469,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz", - "integrity": "sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", + "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1404,12 +1485,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", - "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", + "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1419,12 +1500,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", - "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", + "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1434,12 +1515,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", - "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", + "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1449,14 +1530,15 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.7.tgz", - "integrity": "sha512-m3wVKEvf6SoszD8pu4NZz3PvfKRCMgk6D6d0Qi9hNnlM5M6CFS92EgF4EiHVLKbU0r/r7ty1hg7NPZwE7WRbYw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.5.tgz", + "integrity": "sha512-SMubA9S7Cb5sGSFFUlqxyClTA9zWJ8qGQrppNUm05LtFuN1ELRFNndkix4zUJrC9F+YivWwa1dHMSyo0e0N9dA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.20.7", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-typescript": "^7.20.0" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-typescript": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1466,12 +1548,28 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz", - "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz", + "integrity": "sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", + "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1481,13 +1579,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", - "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", + "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1496,39 +1594,43 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/preset-env": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.20.2.tgz", - "integrity": "sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg==", + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", + "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.1", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-async-generator-functions": "^7.20.1", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-class-static-block": "^7.18.6", - "@babel/plugin-proposal-dynamic-import": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.9", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-object-rest-spread": "^7.20.2", - "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.18.9", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-private-property-in-object": "^7.18.6", - "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.5.tgz", + "integrity": "sha512-fj06hw89dpiZzGZtxn+QybifF07nNiZjZ7sazs2aVDcysAZVGjW7+7iFYxg6GLNM47R/thYfLdrXc+2f11Vi9A==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.5", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.5", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.20.0", + "@babel/plugin-syntax-import-assertions": "^7.22.5", + "@babel/plugin-syntax-import-attributes": "^7.22.5", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", @@ -1538,44 +1640,61 @@ "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.18.6", - "@babel/plugin-transform-async-to-generator": "^7.18.6", - "@babel/plugin-transform-block-scoped-functions": "^7.18.6", - "@babel/plugin-transform-block-scoping": "^7.20.2", - "@babel/plugin-transform-classes": "^7.20.2", - "@babel/plugin-transform-computed-properties": "^7.18.9", - "@babel/plugin-transform-destructuring": "^7.20.2", - "@babel/plugin-transform-dotall-regex": "^7.18.6", - "@babel/plugin-transform-duplicate-keys": "^7.18.9", - "@babel/plugin-transform-exponentiation-operator": "^7.18.6", - "@babel/plugin-transform-for-of": "^7.18.8", - "@babel/plugin-transform-function-name": "^7.18.9", - "@babel/plugin-transform-literals": "^7.18.9", - "@babel/plugin-transform-member-expression-literals": "^7.18.6", - "@babel/plugin-transform-modules-amd": "^7.19.6", - "@babel/plugin-transform-modules-commonjs": "^7.19.6", - "@babel/plugin-transform-modules-systemjs": "^7.19.6", - "@babel/plugin-transform-modules-umd": "^7.18.6", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.19.1", - "@babel/plugin-transform-new-target": "^7.18.6", - "@babel/plugin-transform-object-super": "^7.18.6", - "@babel/plugin-transform-parameters": "^7.20.1", - "@babel/plugin-transform-property-literals": "^7.18.6", - "@babel/plugin-transform-regenerator": "^7.18.6", - "@babel/plugin-transform-reserved-words": "^7.18.6", - "@babel/plugin-transform-shorthand-properties": "^7.18.6", - "@babel/plugin-transform-spread": "^7.19.0", - "@babel/plugin-transform-sticky-regex": "^7.18.6", - "@babel/plugin-transform-template-literals": "^7.18.9", - "@babel/plugin-transform-typeof-symbol": "^7.18.9", - "@babel/plugin-transform-unicode-escapes": "^7.18.10", - "@babel/plugin-transform-unicode-regex": "^7.18.6", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.22.5", + "@babel/plugin-transform-async-generator-functions": "^7.22.5", + "@babel/plugin-transform-async-to-generator": "^7.22.5", + "@babel/plugin-transform-block-scoped-functions": "^7.22.5", + "@babel/plugin-transform-block-scoping": "^7.22.5", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-class-static-block": "^7.22.5", + "@babel/plugin-transform-classes": "^7.22.5", + "@babel/plugin-transform-computed-properties": "^7.22.5", + "@babel/plugin-transform-destructuring": "^7.22.5", + "@babel/plugin-transform-dotall-regex": "^7.22.5", + "@babel/plugin-transform-duplicate-keys": "^7.22.5", + "@babel/plugin-transform-dynamic-import": "^7.22.5", + "@babel/plugin-transform-exponentiation-operator": "^7.22.5", + "@babel/plugin-transform-export-namespace-from": "^7.22.5", + "@babel/plugin-transform-for-of": "^7.22.5", + "@babel/plugin-transform-function-name": "^7.22.5", + "@babel/plugin-transform-json-strings": "^7.22.5", + "@babel/plugin-transform-literals": "^7.22.5", + "@babel/plugin-transform-logical-assignment-operators": "^7.22.5", + "@babel/plugin-transform-member-expression-literals": "^7.22.5", + "@babel/plugin-transform-modules-amd": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/plugin-transform-modules-systemjs": "^7.22.5", + "@babel/plugin-transform-modules-umd": "^7.22.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.5", + "@babel/plugin-transform-numeric-separator": "^7.22.5", + "@babel/plugin-transform-object-rest-spread": "^7.22.5", + "@babel/plugin-transform-object-super": "^7.22.5", + "@babel/plugin-transform-optional-catch-binding": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.5", + "@babel/plugin-transform-parameters": "^7.22.5", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.5", + "@babel/plugin-transform-property-literals": "^7.22.5", + "@babel/plugin-transform-regenerator": "^7.22.5", + "@babel/plugin-transform-reserved-words": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/plugin-transform-spread": "^7.22.5", + "@babel/plugin-transform-sticky-regex": "^7.22.5", + "@babel/plugin-transform-template-literals": "^7.22.5", + "@babel/plugin-transform-typeof-symbol": "^7.22.5", + "@babel/plugin-transform-unicode-escapes": "^7.22.5", + "@babel/plugin-transform-unicode-property-regex": "^7.22.5", + "@babel/plugin-transform-unicode-regex": "^7.22.5", + "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.20.2", - "babel-plugin-polyfill-corejs2": "^0.3.3", - "babel-plugin-polyfill-corejs3": "^0.6.0", - "babel-plugin-polyfill-regenerator": "^0.4.1", - "core-js-compat": "^3.25.1", + "@babel/types": "^7.22.5", + "babel-plugin-polyfill-corejs2": "^0.4.3", + "babel-plugin-polyfill-corejs3": "^0.8.1", + "babel-plugin-polyfill-regenerator": "^0.5.0", + "core-js-compat": "^3.30.2", "semver": "^6.3.0" }, "engines": { @@ -1602,14 +1721,16 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz", - "integrity": "sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz", + "integrity": "sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-transform-typescript": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/plugin-transform-typescript": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1618,10 +1739,16 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", + "dev": true + }, "node_modules/@babel/runtime": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.7.tgz", - "integrity": "sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", + "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.11" @@ -1631,33 +1758,33 @@ } }, "node_modules/@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.20.12", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.12.tgz", - "integrity": "sha512-MsIbFN0u+raeja38qboyF8TIT7K0BFzz/Yd/77ta4MsUsmP2RAnidIlwq7d5HFQrH/OZJecGV6B71C4zAgpoSQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", + "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1666,13 +1793,13 @@ } }, "node_modules/@babel/types": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz", - "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1689,13 +1816,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" @@ -1720,45 +1848,37 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" } }, - "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "3.1.0", "@jridgewell/sourcemap-codec": "1.4.14" } }, + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1795,9 +1915,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.4.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.10.tgz", - "integrity": "sha512-Sl/HOqN8NKPmhWo2VBEPm0nvHnu2LL3v9vKo8MEq0EtbJ4eVzGPl41VNPvn5E1i5poMk4/XD8UriLHpJvEP/Nw==", + "version": "8.40.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.2.tgz", + "integrity": "sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==", "dev": true, "dependencies": { "@types/estree": "*", @@ -1815,9 +1935,9 @@ } }, "node_modules/@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", "dev": true }, "node_modules/@types/glob": { @@ -1831,9 +1951,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, "node_modules/@types/k6": { @@ -1849,9 +1969,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", + "version": "20.3.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.2.tgz", + "integrity": "sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==", "dev": true }, "node_modules/@types/uuid": { @@ -1861,9 +1981,9 @@ "dev": true }, "node_modules/@types/webpack": { - "version": "5.28.0", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz", - "integrity": "sha512-8cP0CzcxUiFuA9xGJkfeVpqmWTk9nx6CWwamRGCj95ph1SmlRRk9KlCZ6avhCbZd4L68LvYT6l1kpdEnQXrF8w==", + "version": "5.28.1", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.1.tgz", + "integrity": "sha512-qw1MqGZclCoBrpiSe/hokSgQM/su8Ocpl3L/YHE0L6moyaypg4+5F7Uzq7NgaPKPxUxUbQ4fLPLpDWdR27bCZw==", "dev": true, "dependencies": { "@types/node": "*", @@ -1872,148 +1992,148 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", "dev": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", "dev": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.11.6", "@xtuc/long": "4.2.2" } }, @@ -2066,9 +2186,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", + "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2078,9 +2198,9 @@ } }, "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -2212,13 +2332,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz", - "integrity": "sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.3.tgz", + "integrity": "sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw==", "dev": true, "dependencies": { "@babel/compat-data": "^7.17.7", - "@babel/helper-define-polyfill-provider": "^0.3.3", + "@babel/helper-define-polyfill-provider": "^0.4.0", "semver": "^6.1.1" }, "peerDependencies": { @@ -2226,25 +2346,25 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz", - "integrity": "sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.1.tgz", + "integrity": "sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.3", - "core-js-compat": "^3.25.1" + "@babel/helper-define-polyfill-provider": "^0.4.0", + "core-js-compat": "^3.30.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.0.tgz", + "integrity": "sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.3" + "@babel/helper-define-polyfill-provider": "^0.4.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" @@ -2288,9 +2408,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", - "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "dev": true, "funding": [ { @@ -2300,13 +2420,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", + "node-releases": "^2.0.12", + "update-browserslist-db": "^1.0.11" }, "bin": { "browserslist": "cli.js" @@ -2322,9 +2446,9 @@ "dev": true }, "node_modules/caniuse-lite": { - "version": "1.0.30001442", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001442.tgz", - "integrity": "sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow==", + "version": "1.0.30001508", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001508.tgz", + "integrity": "sha512-sdQZOJdmt3GJs1UMNpCCCyeuS2IEGLXnHyAo9yIO5JJDjbjoVRij4M1qep6P6gFpptD1PqIYgzM+gwJbOi92mw==", "dev": true, "funding": [ { @@ -2334,6 +2458,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -2431,9 +2559,9 @@ "dev": true }, "node_modules/colorette": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", - "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, "node_modules/commander": { @@ -2519,15 +2647,15 @@ "dev": true }, "node_modules/copy-webpack-plugin/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -2538,12 +2666,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.27.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.27.1.tgz", - "integrity": "sha512-Dg91JFeCDA17FKnneN7oCMz4BkQ4TcffkgHP4OWwp9yx3pi7ubqMDXXSacfNak1PQqjc95skyt+YBLHQJnkJwA==", + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.31.0.tgz", + "integrity": "sha512-hM7YCu1cU6Opx7MXNu0NuumM0ezNeAeRKadixyiQELWY3vT3De9S4J5ZBMraWV2vZnrE1Cirl0GtFtDtMUXzPw==", "dev": true, "dependencies": { - "browserslist": "^4.21.4" + "browserslist": "^4.21.5" }, "funding": { "type": "opencollective", @@ -2661,9 +2789,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.284", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", - "integrity": "sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==", + "version": "1.4.441", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.441.tgz", + "integrity": "sha512-LlCgQ8zgYZPymf5H4aE9itwiIWH4YlCiv1HFLmmcBeFYi5E+3eaIFnjHzYtcFQbaKfAW+CqZ9pgxo33DZuoqPg==", "dev": true }, "node_modules/emojis-list": { @@ -2676,9 +2804,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", - "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -2689,9 +2817,9 @@ } }, "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", + "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", "dev": true, "bin": { "envinfo": "dist/cli.js" @@ -2701,9 +2829,9 @@ } }, "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz", + "integrity": "sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==", "dev": true }, "node_modules/escalade": { @@ -2983,9 +3111,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/has": { @@ -3063,9 +3191,9 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -3392,9 +3520,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", - "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", + "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", "dev": true }, "node_modules/normalize-path": { @@ -3587,9 +3715,9 @@ } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, "engines": { "node": ">=6" @@ -3670,14 +3798,14 @@ } }, "node_modules/regexpu-core": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.2.2.tgz", - "integrity": "sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", "dev": true, "dependencies": { + "@babel/regjsgen": "^0.8.0", "regenerate": "^1.4.2", "regenerate-unicode-properties": "^10.1.0", - "regjsgen": "^0.7.1", "regjsparser": "^0.9.1", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.1.0" @@ -3686,12 +3814,6 @@ "node": ">=4" } }, - "node_modules/regjsgen": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.7.1.tgz", - "integrity": "sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA==", - "dev": true - }, "node_modules/regjsparser": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", @@ -3723,12 +3845,12 @@ } }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -3853,9 +3975,9 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -3959,13 +4081,13 @@ } }, "node_modules/terser": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", - "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.1.tgz", + "integrity": "sha512-j1n0Ao919h/Ai5r43VAnfV/7azUYW43GPxK7qSATzrsERfW7+y2QW9Cp9ufnRF5CQUWbnLSo7UJokSWCqg4tsQ==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -3977,16 +4099,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz", - "integrity": "sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ==", + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" }, "engines": { "node": ">= 10.13.0" @@ -4011,9 +4133,9 @@ } }, "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", @@ -4059,9 +4181,9 @@ } }, "node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -4112,9 +4234,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "dev": true, "funding": [ { @@ -4124,6 +4246,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -4131,7 +4257,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -4170,22 +4296,22 @@ } }, "node_modules/webpack": { - "version": "5.75.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.75.0.tgz", - "integrity": "sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ==", + "version": "5.88.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.0.tgz", + "integrity": "sha512-O3jDhG5e44qIBSi/P6KpcCcH7HD+nYIHVBhdWFxcLOcIGN8zGo5nqF3BjyNCxIh4p1vFdNnreZv2h2KkoAw3lw==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", + "acorn-import-assertions": "^1.9.0", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.15.0", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", @@ -4194,9 +4320,9 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", + "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, @@ -4298,9 +4424,9 @@ } }, "node_modules/webpack-merge": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", - "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", + "integrity": "sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg==", "dev": true, "dependencies": { "clone-deep": "^4.0.1", @@ -4320,9 +4446,9 @@ } }, "node_modules/webpack/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", @@ -4353,9 +4479,9 @@ } }, "node_modules/wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", "dev": true }, "node_modules/wrappy": { diff --git a/package.json b/package.json index a67a512..624c2ce 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "k6-jslib-aws", "repository": "https://github.com/grafana/k6-jslib-aws", - "version": "0.7.2", + "version": "0.8.0", "description": "Create a distribution file for the aws jslib", "main": "src/index.js", "devDependencies": {