@kya-os/mcp-i 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/149.js +1 -1
- package/dist/261.js +1 -1
- package/dist/742.js +1 -1
- package/dist/904.js +1 -1
- package/dist/cli-adapter/index.d.ts +54 -0
- package/dist/cli-adapter/index.js +84 -0
- package/dist/cli-adapter/kta-registration.d.ts +39 -0
- package/dist/cli-adapter/kta-registration.js +92 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +14 -0
- package/package.json +2 -2
package/dist/742.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=742,exports.ids=[742],exports.modules={10602:(e,t,n)=>{n.d(t,{$:()=>r});const r="***SensitiveInformation***"},31305:(e,t,n)=>{n.d(t,{m:()=>r});class r{async sign(e,t,n){return e}}},37579:(e,t,n)=>{function r(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}n.d(t,{$:()=>r})},64548:e=>{e.exports={rE:"3.901.0"}},86742:(e,t,n)=>{n.d(t,{getDefaultRoleAssumer:()=>Wr,getDefaultRoleAssumerWithWebIdentity:()=>Lr});var r=n(64172),s=n(66403),i=n(53340),o=n(3594);const a={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(10602),c=n(92309);class u extends c.T{constructor(e){super(e),Object.setPrototypeOf(this,u.prototype)}}const d=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:l.$}}),p=e=>({...e,...e.Credentials&&{Credentials:d(e.Credentials)}});class h extends u{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,h.prototype)}}class g extends u{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,g.prototype)}}class f extends u{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,f.prototype)}}class m extends u{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,m.prototype)}}class x extends u{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,x.prototype)}}class b extends u{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,b.prototype)}}const y=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:l.$}}),E=e=>({...e,...e.Credentials&&{Credentials:d(e.Credentials)}});class v extends u{name="IDPCommunicationErrorException";$fault="client";constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,v.prototype)}}const w={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},S=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",I=new RegExp("^["+S+"]["+S+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function P(e,t){const n=[];let r=t.exec(e);for(;r;){const s=[];s.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)s.push(r[e]);n.push(s),r=t.exec(e)}return n}const A=function(e){return!(null==I.exec(e))};let T;T="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class N{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),void 0!==t&&(this.child[this.child.length-1][T]={startIndex:t})}static getMetaDataSymbol(){return T}}function C(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,s=!1,i=!1,o="";for(;t<e.length;t++)if("<"!==e[t]||i)if(">"===e[t]){if(i?"-"===e[t-1]&&"-"===e[t-2]&&(i=!1,r--):r--,0===r)break}else"["===e[t]?s=!0:o+=e[t];else{if(s&&M(e,"!ENTITY",t)){let r,s;t+=7,[r,s,t]=k(e,t+1),-1===s.indexOf("&")&&(n[r]={regx:RegExp(`&${r};`,"g"),val:s})}else if(s&&M(e,"!ELEMENT",t)){t+=8;const{index:n}=R(e,t+1);t=n}else if(s&&M(e,"!ATTLIST",t))t+=8;else if(s&&M(e,"!NOTATION",t)){t+=9;const{index:n}=D(e,t+1);t=n}else{if(!M(e,"!--",t))throw new Error("Invalid DOCTYPE");i=!0}r++,o=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}const O=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function k(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t])&&'"'!==e[t]&&"'"!==e[t];)n+=e[t],t++;if(j(n),t=O(e,t),"SYSTEM"===e.substring(t,t+6).toUpperCase())throw new Error("External entities are not supported");if("%"===e[t])throw new Error("Parameter entities are not supported");let r="";return[t,r]=$(e,t,"entity"),[n,r,--t]}function D(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;j(n),t=O(e,t);const r=e.substring(t,t+6).toUpperCase();if("SYSTEM"!==r&&"PUBLIC"!==r)throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=O(e,t);let s=null,i=null;if("PUBLIC"===r)[t,s]=$(e,t,"publicIdentifier"),'"'!==e[t=O(e,t)]&&"'"!==e[t]||([t,i]=$(e,t,"systemIdentifier"));else if("SYSTEM"===r&&([t,i]=$(e,t,"systemIdentifier"),!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:i,index:--t}}function $(e,t,n){let r="";const s=e[t];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(t++;t<e.length&&e[t]!==s;)r+=e[t],t++;if(e[t]!==s)throw new Error(`Unterminated ${n} value`);return[++t,r]}function R(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!j(n))throw new Error(`Invalid element name: "${n}"`);let r="";if("E"===e[t=O(e,t)]&&M(e,"MPTY",t))t+=4;else if("A"===e[t]&&M(e,"NY",t))t+=2;else{if("("!==e[t])throw new Error(`Invalid Element Expression, found "${e[t]}"`);for(t++;t<e.length&&")"!==e[t];)r+=e[t],t++;if(")"!==e[t])throw new Error("Unterminated content model")}return{elementName:n,contentModel:r.trim(),index:t}}function M(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function j(e){if(A(e))return e;throw new Error(`Invalid entity name ${e}`)}const F=/^[-+]?0x[a-fA-F0-9]+$/,K=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,_={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const U=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class V{constructor(e){var t;this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=W,this.parseXml=Y,this.parseTextData=L,this.resolveNameSpace=z,this.buildAttributesMap=B,this.isItStopNode=X,this.replaceEntitiesValue=G,this.readStopNodeData=ee,this.saveTextToParentTag=Z,this.addChild=H,this.ignoreAttributesFn="function"==typeof(t=this.options.ignoreAttributes)?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}}function W(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function L(e,t,n,r,s,i,o){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,s,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?te(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function z(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const q=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function B(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=P(e,q),r=n.length,s={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let i=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==i){this.options.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i);const e=this.options.attributeValueProcessor(r,i,t);s[o]=null==e?i:typeof e!=typeof i||e!==i?e:te(i,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[o]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=s,e}return s}}const Y=function(e){e=e.replace(/\r\n?/g,"\n");const t=new N("!xml");let n=t,r="",s="";for(let i=0;i<e.length;i++)if("<"===e[i])if("/"===e[i+1]){const t=J(e,">",i,"Closing Tag is not closed.");let o=e.substring(i+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),r="",i=t}else if("?"===e[i+1]){let t=Q(e,i,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new N(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,s,t.tagName)),this.addChild(n,e,s,i)}i=t.closeIndex+1}else if("!--"===e.substr(i+1,3)){const t=J(e,"--\x3e",i+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(i+4,t-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}i=t}else if("!D"===e.substr(i+1,2)){const t=C(e,i);this.docTypeEntities=t.entities,i=t.i}else if("!["===e.substr(i+1,2)){const t=J(e,"]]>",i,"CDATA is not closed.")-2,o=e.substring(i+9,t);r=this.saveTextToParentTag(r,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),i=t+2}else{let o=Q(e,i,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let c=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,s,!1));const p=n;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a);const h=i;if(this.isItStopNode(this.options.stopNodes,s,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),c=a):c=c.substr(0,c.length-1),i=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))i=o.closeIndex;else{const n=this.readStopNodeData(e,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);i=n.i,t=n.tagContent}const r=new N(a);a!==c&&u&&(r[":@"]=this.buildAttributesMap(c,s,a)),t&&(t=this.parseTextData(t,a,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,s,h)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new N(a);a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(n,e,s,h),s=s.substr(0,s.lastIndexOf("."))}else{const e=new N(a);this.tagsNodeStack.push(n),a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(n,e,s,h),n=e}r="",i=d}}else r+=e[i];return t.child};function H(e,t,n,r){this.options.captureMetaData||(r=void 0);const s=this.options.updateTag(t.tagname,n,t[":@"]);!1===s||("string"==typeof s?(t.tagname=s,e.addChild(t,r)):e.addChild(t,r))}const G=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Z(e,t,n,r){return e&&(void 0===r&&(r=0===t.child.length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function X(e,t,n){const r="*."+n;for(const n in e){const s=e[n];if(r===s||t===s)return!0}return!1}function J(e,t,n,r){const s=e.indexOf(t,n);if(-1===s)throw new Error(r);return s+t.length-1}function Q(e,t,n,r=">"){const s=function(e,t,n=">"){let r,s="";for(let i=t;i<e.length;i++){let t=e[i];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:s,index:i};if(e[i+1]===n[1])return{data:s,index:i}}else"\t"===t&&(t=" ");s+=t}}(e,t+1,r);if(!s)return;let i=s.data;const o=s.index,a=i.search(/\s/);let l=i,c=!0;-1!==a&&(l=i.substring(0,a),i=i.substring(a+1).trimStart());const u=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==s.data.substr(e+1))}return{tagName:l,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:u}}function ee(e,t,n){const r=n;let s=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const i=J(e,">",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(s--,0===s))return{tagContent:e.substring(r,n),i};n=i}else if("?"===e[n+1])n=J(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=J(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=J(e,"]]>",n,"StopNode is not closed.")-2;else{const r=Q(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&s++,n=r.closeIndex)}}function te(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&function(e,t={}){if(t=Object.assign({},_,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if("0"===e)return 0;if(t.hex&&F.test(n))return function(e){if(parseInt)return parseInt(e,16);if(Number.parseInt)return Number.parseInt(e,16);if(window&&window.parseInt)return window.parseInt(e,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(e,t,n){if(!n.eNotation)return e;const r=t.match(U);if(r){let s=r[1]||"";const i=-1===r[3].indexOf("e")?"E":"e",o=r[2],a=s?e[o.length+1]===i:e[o.length]===i;return o.length>1&&a?e:1!==o.length||!r[3].startsWith(`.${i}`)&&r[3][0]!==i?n.leadingZeros&&!a?(t=(r[1]||"")+r[3],Number(t)):e:Number(t)}return e}(e,n,t);{const s=K.exec(n);if(s){const i=s[1]||"",o=s[2];let a=(r=s[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substring(0,r.length-1)),r):r;const l=i?"."===e[o.length+1]:"."===e[o.length];if(!t.leadingZeros&&(o.length>1||1===o.length&&!l))return e;{const r=Number(n),s=String(r);if(0===r)return r;if(-1!==s.search(/[eE]/))return t.eNotation?r:e;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${i}${a}`?r:e;let l=o?a:n;return o?l===s||i+l===s?r:e:l===s||l===i+s?r:e}}return e}var r}(e,n)}return function(e){return void 0!==e}(e)?e:""}const ne=N.getMetaDataSymbol();function re(e,t){return se(e,t)}function se(e,t,n){let r;const s={};for(let i=0;i<e.length;i++){const o=e[i],a=ie(o);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=o[a]:r+=""+o[a];else{if(void 0===a)continue;if(o[a]){let e=se(o[a],t,l);const n=ae(e,t);void 0!==o[ne]&&(e[ne]=o[ne]),o[":@"]?oe(e,o[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(e)):t.isArray(a,l,n)?s[a]=[e]:s[a]=e}}}return"string"==typeof r?r.length>0&&(s[t.textNodeName]=r):void 0!==r&&(s[t.textNodeName]=r),s}function ie(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function oe(e,t,n,r){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const i=s[o];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function ae(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}const le={allowBooleanAttributes:!1,unpairedTags:[]};function ce(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function ue(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return me("InvalidXml","XML declaration allowed only at the start of the document.",ye(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function de(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}function pe(e,t){let n="",r="",s=!1;for(;t<e.length;t++){if('"'===e[t]||"'"===e[t])""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){s=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:s}}const he=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function ge(e,t){const n=P(e,he),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return me("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Ee(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return me("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Ee(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return me("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Ee(n[e]));const s=n[e][2];if(!xe(s))return me("InvalidAttr","Attribute '"+s+"' is an invalid name.",Ee(n[e]));if(r.hasOwnProperty(s))return me("InvalidAttr","Attribute '"+s+"' is repeated.",Ee(n[e]));r[s]=1}return!0}function fe(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function me(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xe(e){return A(e)}function be(e){return A(e)}function ye(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ee(e){return e.startIndex+e[1].length}const ve=new class{constructor(e){this.externalEntities={},this.options=function(e){return Object.assign({},w,e)}(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=function(e,t){t=Object.assign({},le,t);const n=[];let r=!1,s=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i<e.length;i++)if("<"===e[i]&&"?"===e[i+1]){if(i+=2,i=ue(e,i),i.err)return i}else{if("<"!==e[i]){if(ce(e[i]))continue;return me("InvalidChar","char '"+e[i]+"' is not expected.",ye(e,i))}{let o=i;if(i++,"!"===e[i]){i=de(e,i);continue}{let a=!1;"/"===e[i]&&(a=!0,i++);let l="";for(;i<e.length&&">"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)l+=e[i];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),i--),!be(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",me("InvalidTag",t,ye(e,i))}const c=pe(e,i);if(!1===c)return me("InvalidAttr","Attributes for '"+l+"' have open quote.",ye(e,i));let u=c.value;if(i=c.index,"/"===u[u.length-1]){const n=i-u.length;u=u.substring(0,u.length-1);const s=ge(u,t);if(!0!==s)return me(s.err.code,s.err.msg,ye(e,n+s.err.line));r=!0}else if(a){if(!c.tagClosed)return me("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",ye(e,i));if(u.trim().length>0)return me("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",ye(e,o));if(0===n.length)return me("InvalidTag","Closing tag '"+l+"' has not been opened.",ye(e,o));{const t=n.pop();if(l!==t.tagName){let n=ye(e,t.tagStartPos);return me("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",ye(e,o))}0==n.length&&(s=!0)}}else{const a=ge(u,t);if(!0!==a)return me(a.err.code,a.err.msg,ye(e,i-u.length+a.err.line));if(!0===s)return me("InvalidXml","Multiple possible root nodes found.",ye(e,i));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:o}),r=!0}for(i++;i<e.length;i++)if("<"===e[i]){if("!"===e[i+1]){i++,i=de(e,i);continue}if("?"!==e[i+1])break;if(i=ue(e,++i),i.err)return i}else if("&"===e[i]){const t=fe(e,i);if(-1==t)return me("InvalidChar","char '&' is not expected.",ye(e,i));i=t}else if(!0===s&&!ce(e[i]))return me("InvalidXml","Extra text at the end",ye(e,i));"<"===e[i]&&i--}}}return r?1==n.length?me("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",ye(e,n[0].tagStartPos)):!(n.length>0)||me("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):me("InvalidXml","Start tag expected.",1)}(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new V(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:re(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return N.getMetaDataSymbol()}}({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});ve.addEntity("#xD","\r"),ve.addEntity("#10","\n");const we=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=we(e[n]));return e};var Se=n(64754);const Ie=(e,t)=>(0,Se.w)(e,t).then(e=>{if(e.length){let n;try{t=e,n=ve.parse(t,!0)}catch(t){throw t&&"object"==typeof t&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}const r="#text",s=Object.keys(n)[0],i=n[s];return i[r]&&(i[s]=i[r],delete i[r]),we(i)}var t;return{}}),Pe=async(e,t)=>{const n=await Ie(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n};var Ae=n(32141),Te=n(86343),Ne=n(72358),Ce=n(63976),Oe=n(37579);const ke=async(e,t)=>{const n=pt;let r;return r=Zt({...Le(e,t),[gt]:mt,[qt]:ht}),dt(t,n,"/",void 0,r)},De=async(e,t)=>{const n=pt;let r;return r=Zt({...ze(e,t),[gt]:yt,[qt]:ht}),dt(t,n,"/",void 0,r)},$e=async(e,t)=>{if(e.statusCode>=300)return Me(e,t);const n=await Ie(e.body,t);let r={};return r=Qe(n.AssumeRoleResult,t),{$metadata:ct(e),...r}},Re=async(e,t)=>{if(e.statusCode>=300)return Me(e,t);const n=await Ie(e.body,t);let r={};return r=et(n.AssumeRoleWithWebIdentityResult,t),{$metadata:ct(e),...r}},Me=async(e,t)=>{const n={...e,body:await Pe(e.body,t)},r=Xt(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await je(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Ue(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Ve(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await We(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Fe(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Ke(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await _e(n,t);default:const s=n.body;return ut({output:e,parsedBody:s.Error,errorCode:r})}},je=async(e,t)=>{const n=e.body,r=nt(n.Error,t),s=new h({$metadata:ct(e),...r});return(0,c.M)(s,n)},Fe=async(e,t)=>{const n=e.body,r=rt(n.Error,t),s=new v({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ke=async(e,t)=>{const n=e.body,r=st(n.Error,t),s=new x({$metadata:ct(e),...r});return(0,c.M)(s,n)},_e=async(e,t)=>{const n=e.body,r=it(n.Error,t),s=new b({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ue=async(e,t)=>{const n=e.body,r=ot(n.Error,t),s=new g({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ve=async(e,t)=>{const n=e.body,r=at(n.Error,t),s=new f({$metadata:ct(e),...r});return(0,c.M)(s,n)},We=async(e,t)=>{const n=e.body,r=lt(n.Error,t),s=new m({$metadata:ct(e),...r});return(0,c.M)(s,n)},Le=(e,t)=>{const n={};if(null!=e[Mt]&&(n[Mt]=e[Mt]),null!=e[jt]&&(n[jt]=e[jt]),null!=e[Ct]){const r=qe(e[Ct],t);0===e[Ct]?.length&&(n.PolicyArns=[]),Object.entries(r).forEach(([e,t])=>{n[`PolicyArns.${e}`]=t})}if(null!=e[Nt]&&(n[Nt]=e[Nt]),null!=e[It]&&(n[It]=e[It]),null!=e[Wt]){const r=Xe(e[Wt],t);0===e[Wt]?.length&&(n.Tags=[]),Object.entries(r).forEach(([e,t])=>{n[`Tags.${e}`]=t})}if(null!=e[zt]){const r=Ze(e[zt],t);0===e[zt]?.length&&(n.TransitiveTagKeys=[]),Object.entries(r).forEach(([e,t])=>{n[`TransitiveTagKeys.${e}`]=t})}if(null!=e[At]&&(n[At]=e[At]),null!=e[Ut]&&(n[Ut]=e[Ut]),null!=e[Lt]&&(n[Lt]=e[Lt]),null!=e[_t]&&(n[_t]=e[_t]),null!=e[kt]){const r=He(e[kt],t);0===e[kt]?.length&&(n.ProvidedContexts=[]),Object.entries(r).forEach(([e,t])=>{n[`ProvidedContexts.${e}`]=t})}return n},ze=(e,t)=>{const n={};if(null!=e[Mt]&&(n[Mt]=e[Mt]),null!=e[jt]&&(n[jt]=e[jt]),null!=e[Yt]&&(n[Yt]=e[Yt]),null!=e[Dt]&&(n[Dt]=e[Dt]),null!=e[Ct]){const r=qe(e[Ct],t);0===e[Ct]?.length&&(n.PolicyArns=[]),Object.entries(r).forEach(([e,t])=>{n[`PolicyArns.${e}`]=t})}return null!=e[Nt]&&(n[Nt]=e[Nt]),null!=e[It]&&(n[It]=e[It]),n},qe=(e,t)=>{const n={};let r=1;for(const s of e){if(null===s)continue;const e=Be(s,t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Be=(e,t)=>{const n={};return null!=e[Ht]&&(n[Ht]=e[Ht]),n},Ye=(e,t)=>{const n={};return null!=e[Ot]&&(n[Ot]=e[Ot]),null!=e[St]&&(n[St]=e[St]),n},He=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=Ye(t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Ge=(e,t)=>{const n={};return null!=e[Tt]&&(n[Tt]=e[Tt]),null!=e[Bt]&&(n[Bt]=e[Bt]),n},Ze=(e,t)=>{const n={};let r=1;for(const t of e)null!==t&&(n[`member.${r}`]=t,r++);return n},Xe=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=Ge(t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Je=(e,t)=>{const n={};return null!=e[xt]&&(n[xt]=(0,Te.lK)(e[xt])),null!=e[Et]&&(n[Et]=(0,Te.lK)(e[Et])),n},Qe=(e,t)=>{const n={};return null!=e[wt]&&(n[wt]=tt(e[wt],t)),null!=e[bt]&&(n[bt]=Je(e[bt])),null!=e[$t]&&(n[$t]=(0,Te.xW)(e[$t])),null!=e[_t]&&(n[_t]=(0,Te.lK)(e[_t])),n},et=(e,t)=>{const n={};return null!=e[wt]&&(n[wt]=tt(e[wt],t)),null!=e[Kt]&&(n[Kt]=(0,Te.lK)(e[Kt])),null!=e[bt]&&(n[bt]=Je(e[bt])),null!=e[$t]&&(n[$t]=(0,Te.xW)(e[$t])),null!=e[Rt]&&(n[Rt]=(0,Te.lK)(e[Rt])),null!=e[vt]&&(n[vt]=(0,Te.lK)(e[vt])),null!=e[_t]&&(n[_t]=(0,Te.lK)(e[_t])),n},tt=(e,t)=>{const n={};return null!=e[ft]&&(n[ft]=(0,Te.lK)(e[ft])),null!=e[Ft]&&(n[Ft]=(0,Te.lK)(e[Ft])),null!=e[Vt]&&(n[Vt]=(0,Te.lK)(e[Vt])),null!=e[Pt]&&(n[Pt]=(0,Te.Y0)((0,Ne.t_)(e[Pt]))),n},nt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},rt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},st=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},it=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},ot=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},at=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},lt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},ct=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ut=(0,Ce.j)(u),dt=async(e,t,n,r,s)=>{const{hostname:i,protocol:o="https",port:a,path:l}=await e.endpoint(),c={protocol:o,hostname:i,port:a,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+n:l+n,headers:t};return void 0!==r&&(c.hostname=r),void 0!==s&&(c.body=s),new Ae.K(c)},pt={"content-type":"application/x-www-form-urlencoded"},ht="2011-06-15",gt="Action",ft="AccessKeyId",mt="AssumeRole",xt="AssumedRoleId",bt="AssumedRoleUser",yt="AssumeRoleWithWebIdentity",Et="Arn",vt="Audience",wt="Credentials",St="ContextAssertion",It="DurationSeconds",Pt="Expiration",At="ExternalId",Tt="Key",Nt="Policy",Ct="PolicyArns",Ot="ProviderArn",kt="ProvidedContexts",Dt="ProviderId",$t="PackedPolicySize",Rt="Provider",Mt="RoleArn",jt="RoleSessionName",Ft="SecretAccessKey",Kt="SubjectFromWebIdentityToken",_t="SourceIdentity",Ut="SerialNumber",Vt="SessionToken",Wt="Tags",Lt="TokenCode",zt="TransitiveTagKeys",qt="Version",Bt="Value",Yt="WebIdentityToken",Ht="arn",Gt="message",Zt=e=>Object.entries(e).map(([e,t])=>(0,Oe.$)(e)+"="+(0,Oe.$)(t)).join("&"),Xt=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class Jt extends(o.u.classBuilder().ep(a).m(function(e,t,n,r){return[(0,i.TM)(n,this.serialize,this.deserialize),(0,s.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,p).ser(ke).de($e).build()){}class Qt extends(o.u.classBuilder().ep(a).m(function(e,t,n,r){return[(0,i.TM)(n,this.serialize,this.deserialize),(0,s.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(y,E).ser(De).de(Re).build()){}const en="us-east-1",tn=e=>{if("string"==typeof e?.Arn){const t=e.Arn.split(":");if(t.length>4&&""!==t[4])return t[4]}},nn=async(e,t,n)=>{const r="function"==typeof e?await e():e,s="function"==typeof t?await t():t;return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${r} (provider)`,`${s} (parent client)`,`${en} (STS default)`),r??s??en},rn=e=>"h2"===e?.metadata?.handlerProtocol;var sn=n(67317),on=n(27847),an=n(33182),ln=n(67868),cn=n(4518),un=n(20459),dn=n(23369),pn=n(83007),hn=n(58001),gn=n(88244),fn=n(79244),mn=n(74499),xn=n(29163),bn=n(8928),yn=n(27792),En=n(80835),vn=n(6670);const wn=async(e,t,n)=>({operation:(0,En.u)(t).operation,region:await(0,vn.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Sn=e=>{const t=[];return"AssumeRoleWithWebIdentity"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t};var In=n(64548),Pn=n(21674),An=n(61008),Tn=n(57180),Nn=n(4425),Cn=n(34767),On=n(91968),kn=n(28164),Dn=n(41942),$n=n(31305),Rn=n(13820),Mn=n(43316),jn=n(41911),Fn=n(46553),Kn=n(31680),_n=n(88468),Un=n(96527),Vn=n(72804),Wn=n(69367),Ln=n(19506),zn=n(40935),qn=n(2914),Bn=n(56771),Yn=n(2257),Hn=n(63305),Gn=n(60248);const Zn="required",Xn="type",Jn="fn",Qn="argv",er="ref",tr=!1,nr=!0,rr="booleanEquals",sr="stringEquals",ir="sigv4",or="us-east-1",ar="endpoint",lr="https://sts.{Region}.{PartitionResult#dnsSuffix}",cr="tree",ur="error",dr="getAttr",pr={[Zn]:!1,[Xn]:"String"},hr={[Zn]:!0,default:!1,[Xn]:"Boolean"},gr={[er]:"Endpoint"},fr={[Jn]:"isSet",[Qn]:[{[er]:"Region"}]},mr={[er]:"Region"},xr={[Jn]:"aws.partition",[Qn]:[mr],assign:"PartitionResult"},br={[er]:"UseFIPS"},yr={[er]:"UseDualStack"},Er={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:ir,signingName:"sts",signingRegion:or}]},headers:{}},vr={},wr={conditions:[{[Jn]:sr,[Qn]:[mr,"aws-global"]}],[ar]:Er,[Xn]:ar},Sr={[Jn]:rr,[Qn]:[br,!0]},Ir={[Jn]:rr,[Qn]:[yr,!0]},Pr={[Jn]:dr,[Qn]:[{[er]:"PartitionResult"},"supportsFIPS"]},Ar={[er]:"PartitionResult"},Tr={[Jn]:rr,[Qn]:[!0,{[Jn]:dr,[Qn]:[Ar,"supportsDualStack"]}]},Nr=[{[Jn]:"isSet",[Qn]:[gr]}],Cr=[Sr],Or=[Ir],kr={version:"1.0",parameters:{Region:pr,UseDualStack:hr,UseFIPS:hr,Endpoint:pr,UseGlobalEndpoint:hr},rules:[{conditions:[{[Jn]:rr,[Qn]:[{[er]:"UseGlobalEndpoint"},nr]},{[Jn]:"not",[Qn]:Nr},fr,xr,{[Jn]:rr,[Qn]:[br,tr]},{[Jn]:rr,[Qn]:[yr,tr]}],rules:[{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-northeast-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-south-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-southeast-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-southeast-2"]}],endpoint:Er,[Xn]:ar},wr,{conditions:[{[Jn]:sr,[Qn]:[mr,"ca-central-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-central-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-north-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-2"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-3"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"sa-east-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,or]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-east-2"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-west-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-west-2"]}],endpoint:Er,[Xn]:ar},{endpoint:{url:lr,properties:{authSchemes:[{name:ir,signingName:"sts",signingRegion:"{Region}"}]},headers:vr},[Xn]:ar}],[Xn]:cr},{conditions:Nr,rules:[{conditions:Cr,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Xn]:ur},{conditions:Or,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Xn]:ur},{endpoint:{url:gr,properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{conditions:[fr],rules:[{conditions:[xr],rules:[{conditions:[Sr,Ir],rules:[{conditions:[{[Jn]:rr,[Qn]:[nr,Pr]},Tr],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Xn]:ur}],[Xn]:cr},{conditions:Cr,rules:[{conditions:[{[Jn]:rr,[Qn]:[Pr,nr]}],rules:[{conditions:[{[Jn]:sr,[Qn]:[{[Jn]:dr,[Qn]:[Ar,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:vr,headers:vr},[Xn]:ar},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"FIPS is enabled but this partition does not support FIPS",[Xn]:ur}],[Xn]:cr},{conditions:Or,rules:[{conditions:[Tr],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"DualStack is enabled but this partition does not support DualStack",[Xn]:ur}],[Xn]:cr},wr,{endpoint:{url:lr,properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr}],[Xn]:cr},{error:"Invalid Configuration: Missing Region",[Xn]:ur}]},Dr=new Yn.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),$r=(e,t={})=>Dr.get(e,()=>(0,Hn.s)(kr,{endpointParams:e,logger:t.logger}));Gn.m.aws=Bn.UF;var Rr=n(72617),Mr=n(70758),jr=n(97252);var Fr=n(96374),Kr=n(59326),_r=n(61701);class Ur extends bn.K{config;constructor(...[e]){const t=(e=>{(0,jr.I)(process.version);const t=(0,Mr.I)(e),n=()=>t().then(Rr.l),r=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Wn.E,base64Encoder:e?.base64Encoder??Ln.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??$r,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Sn,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Tn.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new $n.m}],logger:e?.logger??new Un.N,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??Vn.D,utf8Decoder:e?.utf8Decoder??zn.a,utf8Encoder:e?.utf8Encoder??qn.P}))(e);(0,Pn.I)(process.version);const s={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,Mn.Z)(An.$,s),bodyLengthChecker:e?.bodyLengthChecker??Kn.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Nn.pf)({serviceId:r.serviceId,clientVersion:In.rE}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4")||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new Tn.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new $n.m}],maxAttempts:e?.maxAttempts??(0,Mn.Z)(mn.qs,e),region:e?.region??(0,Mn.Z)(On.GG,{...On.zH,...s}),requestHandler:jn.$.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,Mn.Z)({...mn.kN,default:async()=>(await n()).retryMode||_n.L0},e),sha256:e?.sha256??Rn.V.bind(null,"sha256"),streamCollector:e?.streamCollector??Fn.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,Mn.Z)(kn.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,Mn.Z)(Dn.Ko,s),userAgentAppId:e?.userAgentAppId??(0,Mn.Z)(Cn.hV,s)}})(e||{});super(t),this.initConfig=t;const n=(r=t,Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var r;const s=(0,ln.D)(n),i=(0,mn.$z)(s),o=(0,un.T)(i),a=(0,sn.OV)(o),l=((e,t)=>{const n=Object.assign((0,Fr.R)(e),(0,_r.xA)(e),(0,Kr.e)(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,Fr.$)(n),(0,_r.uv)(n),(0,Kr.j)(n),{httpAuthSchemes:(r=n).httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var r})((e=>{const t=(n=e,Object.assign(n,{stsClientCtor:Ur}));var n;const r=(0,yn.h)(t);return Object.assign(r,{authSchemePreference:(0,vn.t)(e.authSchemePreference??[])})})((0,fn.C)(a)),e?.extensions||[]);this.config=l,this.middlewareStack.use((0,cn.sM)(this.config)),this.middlewareStack.use((0,xn.ey)(this.config)),this.middlewareStack.use((0,gn.vK)(this.config)),this.middlewareStack.use((0,sn.TC)(this.config)),this.middlewareStack.use((0,on.Y7)(this.config)),this.middlewareStack.use((0,an.n)(this.config)),this.middlewareStack.use((0,dn.w)(this.config,{httpAuthSchemeParametersProvider:wn,identityProviderConfigProvider:async e=>new pn.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,hn.l)(this.config))}destroy(){super.destroy()}}const Vr=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,Wr=(e={},t)=>((e,t)=>{let n,s;return async(i,o)=>{if(s=i,!n){const{logger:r=e?.parentClientConfig?.logger,region:i,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:a}=e,l=await nn(i,e?.parentClientConfig?.region,a),c=!rn(o);n=new t({profile:e?.parentClientConfig?.profile,credentialDefaultProvider:()=>async()=>s,region:l,requestHandler:c?o:void 0,logger:r})}const{Credentials:a,AssumedRoleUser:l}=await n.send(new Jt(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const c=tn(l),u={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...c&&{accountId:c}};return(0,r.g)(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}})(e,Vr(Ur,t)),Lr=(e={},t)=>((e,t)=>{let n;return async s=>{if(!n){const{logger:r=e?.parentClientConfig?.logger,region:s,requestHandler:i=e?.parentClientConfig?.requestHandler,credentialProviderLogger:o}=e,a=await nn(s,e?.parentClientConfig?.region,o),l=!rn(i);n=new t({profile:e?.parentClientConfig?.profile,region:a,requestHandler:l?i:void 0,logger:r})}const{Credentials:i,AssumedRoleUser:o}=await n.send(new Qt(s));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);const a=tn(o),l={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...a&&{accountId:a}};return a&&(0,r.g)(l,"RESOLVED_ACCOUNT_ID","T"),(0,r.g)(l,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),l}})(e,Vr(Ur,t))}};
|
|
1
|
+
"use strict";exports.id=742,exports.ids=[742],exports.modules={10602:(e,t,n)=>{n.d(t,{$:()=>r});const r="***SensitiveInformation***"},31305:(e,t,n)=>{n.d(t,{m:()=>r});class r{async sign(e,t,n){return e}}},37579:(e,t,n)=>{function r(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}n.d(t,{$:()=>r})},64548:e=>{e.exports={rE:"3.901.0"}},86742:(e,t,n)=>{n.d(t,{getDefaultRoleAssumer:()=>Wr,getDefaultRoleAssumerWithWebIdentity:()=>Lr});var r=n(64172),s=n(66403),i=n(53340),o=n(3594);const a={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(10602),c=n(92309);class u extends c.T{constructor(e){super(e),Object.setPrototypeOf(this,u.prototype)}}const d=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:l.$}}),p=e=>({...e,...e.Credentials&&{Credentials:d(e.Credentials)}});class h extends u{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,h.prototype)}}class g extends u{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,g.prototype)}}class f extends u{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,f.prototype)}}class m extends u{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,m.prototype)}}class x extends u{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,x.prototype)}}class b extends u{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,b.prototype)}}const y=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:l.$}}),E=e=>({...e,...e.Credentials&&{Credentials:d(e.Credentials)}});class v extends u{name="IDPCommunicationErrorException";$fault="client";constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,v.prototype)}}const w={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},S=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",I=new RegExp("^["+S+"]["+S+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function P(e,t){const n=[];let r=t.exec(e);for(;r;){const s=[];s.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)s.push(r[e]);n.push(s),r=t.exec(e)}return n}const A=function(e){return!(null==I.exec(e))};let T;T="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class N{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),void 0!==t&&(this.child[this.child.length-1][T]={startIndex:t})}static getMetaDataSymbol(){return T}}function C(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,s=!1,i=!1,o="";for(;t<e.length;t++)if("<"!==e[t]||i)if(">"===e[t]){if(i?"-"===e[t-1]&&"-"===e[t-2]&&(i=!1,r--):r--,0===r)break}else"["===e[t]?s=!0:o+=e[t];else{if(s&&M(e,"!ENTITY",t)){let r,s;t+=7,[r,s,t]=k(e,t+1),-1===s.indexOf("&")&&(n[r]={regx:RegExp(`&${r};`,"g"),val:s})}else if(s&&M(e,"!ELEMENT",t)){t+=8;const{index:n}=R(e,t+1);t=n}else if(s&&M(e,"!ATTLIST",t))t+=8;else if(s&&M(e,"!NOTATION",t)){t+=9;const{index:n}=D(e,t+1);t=n}else{if(!M(e,"!--",t))throw new Error("Invalid DOCTYPE");i=!0}r++,o=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}const O=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function k(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t])&&'"'!==e[t]&&"'"!==e[t];)n+=e[t],t++;if(j(n),t=O(e,t),"SYSTEM"===e.substring(t,t+6).toUpperCase())throw new Error("External entities are not supported");if("%"===e[t])throw new Error("Parameter entities are not supported");let r="";return[t,r]=$(e,t,"entity"),[n,r,--t]}function D(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;j(n),t=O(e,t);const r=e.substring(t,t+6).toUpperCase();if("SYSTEM"!==r&&"PUBLIC"!==r)throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=O(e,t);let s=null,i=null;if("PUBLIC"===r)[t,s]=$(e,t,"publicIdentifier"),'"'!==e[t=O(e,t)]&&"'"!==e[t]||([t,i]=$(e,t,"systemIdentifier"));else if("SYSTEM"===r&&([t,i]=$(e,t,"systemIdentifier"),!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:i,index:--t}}function $(e,t,n){let r="";const s=e[t];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(t++;t<e.length&&e[t]!==s;)r+=e[t],t++;if(e[t]!==s)throw new Error(`Unterminated ${n} value`);return[++t,r]}function R(e,t){t=O(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!j(n))throw new Error(`Invalid element name: "${n}"`);let r="";if("E"===e[t=O(e,t)]&&M(e,"MPTY",t))t+=4;else if("A"===e[t]&&M(e,"NY",t))t+=2;else{if("("!==e[t])throw new Error(`Invalid Element Expression, found "${e[t]}"`);for(t++;t<e.length&&")"!==e[t];)r+=e[t],t++;if(")"!==e[t])throw new Error("Unterminated content model")}return{elementName:n,contentModel:r.trim(),index:t}}function M(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function j(e){if(A(e))return e;throw new Error(`Invalid entity name ${e}`)}const F=/^[-+]?0x[a-fA-F0-9]+$/,K=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,_={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const U=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;class V{constructor(e){var t;this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=W,this.parseXml=Y,this.parseTextData=L,this.resolveNameSpace=z,this.buildAttributesMap=B,this.isItStopNode=X,this.replaceEntitiesValue=G,this.readStopNodeData=ee,this.saveTextToParentTag=Z,this.addChild=H,this.ignoreAttributesFn="function"==typeof(t=this.options.ignoreAttributes)?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}}function W(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function L(e,t,n,r,s,i,o){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,s,i);return null==r?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?te(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function z(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const q=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function B(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=P(e,q),r=n.length,s={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let i=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==i){this.options.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i);const e=this.options.attributeValueProcessor(r,i,t);s[o]=null==e?i:typeof e!=typeof i||e!==i?e:te(i,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[o]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=s,e}return s}}const Y=function(e){e=e.replace(/\r\n?/g,"\n");const t=new N("!xml");let n=t,r="",s="";for(let i=0;i<e.length;i++)if("<"===e[i])if("/"===e[i+1]){const t=J(e,">",i,"Closing Tag is not closed.");let o=e.substring(i+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),r="",i=t}else if("?"===e[i+1]){let t=Q(e,i,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new N(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,s,t.tagName)),this.addChild(n,e,s,i)}i=t.closeIndex+1}else if("!--"===e.substr(i+1,3)){const t=J(e,"--\x3e",i+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(i+4,t-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}i=t}else if("!D"===e.substr(i+1,2)){const t=C(e,i);this.docTypeEntities=t.entities,i=t.i}else if("!["===e.substr(i+1,2)){const t=J(e,"]]>",i,"CDATA is not closed.")-2,o=e.substring(i+9,t);r=this.saveTextToParentTag(r,n,s);let a=this.parseTextData(o,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,a),i=t+2}else{let o=Q(e,i,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let c=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,s,!1));const p=n;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a);const h=i;if(this.isItStopNode(this.options.stopNodes,s,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),c=a):c=c.substr(0,c.length-1),i=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))i=o.closeIndex;else{const n=this.readStopNodeData(e,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);i=n.i,t=n.tagContent}const r=new N(a);a!==c&&u&&(r[":@"]=this.buildAttributesMap(c,s,a)),t&&(t=this.parseTextData(t,a,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,s,h)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new N(a);a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(n,e,s,h),s=s.substr(0,s.lastIndexOf("."))}else{const e=new N(a);this.tagsNodeStack.push(n),a!==c&&u&&(e[":@"]=this.buildAttributesMap(c,s,a)),this.addChild(n,e,s,h),n=e}r="",i=d}}else r+=e[i];return t.child};function H(e,t,n,r){this.options.captureMetaData||(r=void 0);const s=this.options.updateTag(t.tagname,n,t[":@"]);!1===s||("string"==typeof s?(t.tagname=s,e.addChild(t,r)):e.addChild(t,r))}const G=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Z(e,t,n,r){return e&&(void 0===r&&(r=0===t.child.length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function X(e,t,n){const r="*."+n;for(const n in e){const s=e[n];if(r===s||t===s)return!0}return!1}function J(e,t,n,r){const s=e.indexOf(t,n);if(-1===s)throw new Error(r);return s+t.length-1}function Q(e,t,n,r=">"){const s=function(e,t,n=">"){let r,s="";for(let i=t;i<e.length;i++){let t=e[i];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:s,index:i};if(e[i+1]===n[1])return{data:s,index:i}}else"\t"===t&&(t=" ");s+=t}}(e,t+1,r);if(!s)return;let i=s.data;const o=s.index,a=i.search(/\s/);let l=i,c=!0;-1!==a&&(l=i.substring(0,a),i=i.substring(a+1).trimStart());const u=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==s.data.substr(e+1))}return{tagName:l,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:u}}function ee(e,t,n){const r=n;let s=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const i=J(e,">",n,`${t} is not closed`);if(e.substring(n+2,i).trim()===t&&(s--,0===s))return{tagContent:e.substring(r,n),i};n=i}else if("?"===e[n+1])n=J(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=J(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=J(e,"]]>",n,"StopNode is not closed.")-2;else{const r=Q(e,n,">");r&&((r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&s++,n=r.closeIndex)}}function te(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&function(e,t={}){if(t=Object.assign({},_,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if("0"===e)return 0;if(t.hex&&F.test(n))return function(e){if(parseInt)return parseInt(e,16);if(Number.parseInt)return Number.parseInt(e,16);if(window&&window.parseInt)return window.parseInt(e,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(e,t,n){if(!n.eNotation)return e;const r=t.match(U);if(r){let s=r[1]||"";const i=-1===r[3].indexOf("e")?"E":"e",o=r[2],a=s?e[o.length+1]===i:e[o.length]===i;return o.length>1&&a?e:1!==o.length||!r[3].startsWith(`.${i}`)&&r[3][0]!==i?n.leadingZeros&&!a?(t=(r[1]||"")+r[3],Number(t)):e:Number(t)}return e}(e,n,t);{const s=K.exec(n);if(s){const i=s[1]||"",o=s[2];let a=(r=s[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substring(0,r.length-1)),r):r;const l=i?"."===e[o.length+1]:"."===e[o.length];if(!t.leadingZeros&&(o.length>1||1===o.length&&!l))return e;{const r=Number(n),s=String(r);if(0===r)return r;if(-1!==s.search(/[eE]/))return t.eNotation?r:e;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${i}${a}`?r:e;let l=o?a:n;return o?l===s||i+l===s?r:e:l===s||l===i+s?r:e}}return e}var r}(e,n)}return function(e){return void 0!==e}(e)?e:""}const ne=N.getMetaDataSymbol();function re(e,t){return se(e,t)}function se(e,t,n){let r;const s={};for(let i=0;i<e.length;i++){const o=e[i],a=ie(o);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=o[a]:r+=""+o[a];else{if(void 0===a)continue;if(o[a]){let e=se(o[a],t,l);const n=ae(e,t);void 0!==o[ne]&&(e[ne]=o[ne]),o[":@"]?oe(e,o[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(e)):t.isArray(a,l,n)?s[a]=[e]:s[a]=e}}}return"string"==typeof r?r.length>0&&(s[t.textNodeName]=r):void 0!==r&&(s[t.textNodeName]=r),s}function ie(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function oe(e,t,n,r){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const i=s[o];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function ae(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}const le={allowBooleanAttributes:!1,unpairedTags:[]};function ce(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function ue(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return me("InvalidXml","XML declaration allowed only at the start of the document.",ye(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function de(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}function pe(e,t){let n="",r="",s=!1;for(;t<e.length;t++){if('"'===e[t]||"'"===e[t])""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){s=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:s}}const he=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function ge(e,t){const n=P(e,he),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return me("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Ee(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return me("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Ee(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return me("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Ee(n[e]));const s=n[e][2];if(!xe(s))return me("InvalidAttr","Attribute '"+s+"' is an invalid name.",Ee(n[e]));if(r.hasOwnProperty(s))return me("InvalidAttr","Attribute '"+s+"' is repeated.",Ee(n[e]));r[s]=1}return!0}function fe(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function me(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function xe(e){return A(e)}function be(e){return A(e)}function ye(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ee(e){return e.startIndex+e[1].length}const ve=new class{constructor(e){this.externalEntities={},this.options=function(e){return Object.assign({},w,e)}(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=function(e,t){t=Object.assign({},le,t);const n=[];let r=!1,s=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i<e.length;i++)if("<"===e[i]&&"?"===e[i+1]){if(i+=2,i=ue(e,i),i.err)return i}else{if("<"!==e[i]){if(ce(e[i]))continue;return me("InvalidChar","char '"+e[i]+"' is not expected.",ye(e,i))}{let o=i;if(i++,"!"===e[i]){i=de(e,i);continue}{let a=!1;"/"===e[i]&&(a=!0,i++);let l="";for(;i<e.length&&">"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)l+=e[i];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),i--),!be(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",me("InvalidTag",t,ye(e,i))}const c=pe(e,i);if(!1===c)return me("InvalidAttr","Attributes for '"+l+"' have open quote.",ye(e,i));let u=c.value;if(i=c.index,"/"===u[u.length-1]){const n=i-u.length;u=u.substring(0,u.length-1);const s=ge(u,t);if(!0!==s)return me(s.err.code,s.err.msg,ye(e,n+s.err.line));r=!0}else if(a){if(!c.tagClosed)return me("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",ye(e,i));if(u.trim().length>0)return me("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",ye(e,o));if(0===n.length)return me("InvalidTag","Closing tag '"+l+"' has not been opened.",ye(e,o));{const t=n.pop();if(l!==t.tagName){let n=ye(e,t.tagStartPos);return me("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",ye(e,o))}0==n.length&&(s=!0)}}else{const a=ge(u,t);if(!0!==a)return me(a.err.code,a.err.msg,ye(e,i-u.length+a.err.line));if(!0===s)return me("InvalidXml","Multiple possible root nodes found.",ye(e,i));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:o}),r=!0}for(i++;i<e.length;i++)if("<"===e[i]){if("!"===e[i+1]){i++,i=de(e,i);continue}if("?"!==e[i+1])break;if(i=ue(e,++i),i.err)return i}else if("&"===e[i]){const t=fe(e,i);if(-1==t)return me("InvalidChar","char '&' is not expected.",ye(e,i));i=t}else if(!0===s&&!ce(e[i]))return me("InvalidXml","Extra text at the end",ye(e,i));"<"===e[i]&&i--}}}return r?1==n.length?me("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",ye(e,n[0].tagStartPos)):!(n.length>0)||me("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):me("InvalidXml","Start tag expected.",1)}(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new V(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:re(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return N.getMetaDataSymbol()}}({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>""===t.trim()&&t.includes("\n")?"":void 0});ve.addEntity("#xD","\r"),ve.addEntity("#10","\n");const we=e=>{const t="#text";for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n][t]?e[n]=e[n][t]:"object"==typeof e[n]&&null!==e[n]&&(e[n]=we(e[n]));return e};var Se=n(64754);const Ie=(e,t)=>(0,Se.w)(e,t).then(e=>{if(e.length){let n;try{t=e,n=ve.parse(t,!0)}catch(t){throw t&&"object"==typeof t&&Object.defineProperty(t,"$responseBodyText",{value:e}),t}const r="#text",s=Object.keys(n)[0],i=n[s];return i[r]&&(i[s]=i[r],delete i[r]),we(i)}var t;return{}}),Pe=async(e,t)=>{const n=await Ie(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n};var Ae=n(32141),Te=n(86343),Ne=n(72358),Ce=n(63976),Oe=n(37579);const ke=async(e,t)=>{const n=pt;let r;return r=Zt({...Le(e,t),[gt]:mt,[qt]:ht}),dt(t,n,"/",void 0,r)},De=async(e,t)=>{const n=pt;let r;return r=Zt({...ze(e,t),[gt]:yt,[qt]:ht}),dt(t,n,"/",void 0,r)},$e=async(e,t)=>{if(e.statusCode>=300)return Me(e,t);const n=await Ie(e.body,t);let r={};return r=Qe(n.AssumeRoleResult,t),{$metadata:ct(e),...r}},Re=async(e,t)=>{if(e.statusCode>=300)return Me(e,t);const n=await Ie(e.body,t);let r={};return r=et(n.AssumeRoleWithWebIdentityResult,t),{$metadata:ct(e),...r}},Me=async(e,t)=>{const n={...e,body:await Pe(e.body,t)},r=Xt(e,n.body);switch(r){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await je(n,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Ue(n,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Ve(n,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await We(n,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Fe(n,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Ke(n,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await _e(n,t);default:const s=n.body;return ut({output:e,parsedBody:s.Error,errorCode:r})}},je=async(e,t)=>{const n=e.body,r=nt(n.Error,t),s=new h({$metadata:ct(e),...r});return(0,c.M)(s,n)},Fe=async(e,t)=>{const n=e.body,r=rt(n.Error,t),s=new v({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ke=async(e,t)=>{const n=e.body,r=st(n.Error,t),s=new x({$metadata:ct(e),...r});return(0,c.M)(s,n)},_e=async(e,t)=>{const n=e.body,r=it(n.Error,t),s=new b({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ue=async(e,t)=>{const n=e.body,r=ot(n.Error,t),s=new g({$metadata:ct(e),...r});return(0,c.M)(s,n)},Ve=async(e,t)=>{const n=e.body,r=at(n.Error,t),s=new f({$metadata:ct(e),...r});return(0,c.M)(s,n)},We=async(e,t)=>{const n=e.body,r=lt(n.Error,t),s=new m({$metadata:ct(e),...r});return(0,c.M)(s,n)},Le=(e,t)=>{const n={};if(null!=e[Mt]&&(n[Mt]=e[Mt]),null!=e[jt]&&(n[jt]=e[jt]),null!=e[Ct]){const r=qe(e[Ct],t);0===e[Ct]?.length&&(n.PolicyArns=[]),Object.entries(r).forEach(([e,t])=>{n[`PolicyArns.${e}`]=t})}if(null!=e[Nt]&&(n[Nt]=e[Nt]),null!=e[It]&&(n[It]=e[It]),null!=e[Wt]){const r=Xe(e[Wt],t);0===e[Wt]?.length&&(n.Tags=[]),Object.entries(r).forEach(([e,t])=>{n[`Tags.${e}`]=t})}if(null!=e[zt]){const r=Ze(e[zt],t);0===e[zt]?.length&&(n.TransitiveTagKeys=[]),Object.entries(r).forEach(([e,t])=>{n[`TransitiveTagKeys.${e}`]=t})}if(null!=e[At]&&(n[At]=e[At]),null!=e[Ut]&&(n[Ut]=e[Ut]),null!=e[Lt]&&(n[Lt]=e[Lt]),null!=e[_t]&&(n[_t]=e[_t]),null!=e[kt]){const r=He(e[kt],t);0===e[kt]?.length&&(n.ProvidedContexts=[]),Object.entries(r).forEach(([e,t])=>{n[`ProvidedContexts.${e}`]=t})}return n},ze=(e,t)=>{const n={};if(null!=e[Mt]&&(n[Mt]=e[Mt]),null!=e[jt]&&(n[jt]=e[jt]),null!=e[Yt]&&(n[Yt]=e[Yt]),null!=e[Dt]&&(n[Dt]=e[Dt]),null!=e[Ct]){const r=qe(e[Ct],t);0===e[Ct]?.length&&(n.PolicyArns=[]),Object.entries(r).forEach(([e,t])=>{n[`PolicyArns.${e}`]=t})}return null!=e[Nt]&&(n[Nt]=e[Nt]),null!=e[It]&&(n[It]=e[It]),n},qe=(e,t)=>{const n={};let r=1;for(const s of e){if(null===s)continue;const e=Be(s,t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Be=(e,t)=>{const n={};return null!=e[Ht]&&(n[Ht]=e[Ht]),n},Ye=(e,t)=>{const n={};return null!=e[Ot]&&(n[Ot]=e[Ot]),null!=e[St]&&(n[St]=e[St]),n},He=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=Ye(t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Ge=(e,t)=>{const n={};return null!=e[Tt]&&(n[Tt]=e[Tt]),null!=e[Bt]&&(n[Bt]=e[Bt]),n},Ze=(e,t)=>{const n={};let r=1;for(const t of e)null!==t&&(n[`member.${r}`]=t,r++);return n},Xe=(e,t)=>{const n={};let r=1;for(const t of e){if(null===t)continue;const e=Ge(t);Object.entries(e).forEach(([e,t])=>{n[`member.${r}.${e}`]=t}),r++}return n},Je=(e,t)=>{const n={};return null!=e[xt]&&(n[xt]=(0,Te.lK)(e[xt])),null!=e[Et]&&(n[Et]=(0,Te.lK)(e[Et])),n},Qe=(e,t)=>{const n={};return null!=e[wt]&&(n[wt]=tt(e[wt],t)),null!=e[bt]&&(n[bt]=Je(e[bt])),null!=e[$t]&&(n[$t]=(0,Te.xW)(e[$t])),null!=e[_t]&&(n[_t]=(0,Te.lK)(e[_t])),n},et=(e,t)=>{const n={};return null!=e[wt]&&(n[wt]=tt(e[wt],t)),null!=e[Kt]&&(n[Kt]=(0,Te.lK)(e[Kt])),null!=e[bt]&&(n[bt]=Je(e[bt])),null!=e[$t]&&(n[$t]=(0,Te.xW)(e[$t])),null!=e[Rt]&&(n[Rt]=(0,Te.lK)(e[Rt])),null!=e[vt]&&(n[vt]=(0,Te.lK)(e[vt])),null!=e[_t]&&(n[_t]=(0,Te.lK)(e[_t])),n},tt=(e,t)=>{const n={};return null!=e[ft]&&(n[ft]=(0,Te.lK)(e[ft])),null!=e[Ft]&&(n[Ft]=(0,Te.lK)(e[Ft])),null!=e[Vt]&&(n[Vt]=(0,Te.lK)(e[Vt])),null!=e[Pt]&&(n[Pt]=(0,Te.Y0)((0,Ne.t_)(e[Pt]))),n},nt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},rt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},st=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},it=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},ot=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},at=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},lt=(e,t)=>{const n={};return null!=e[Gt]&&(n[Gt]=(0,Te.lK)(e[Gt])),n},ct=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ut=(0,Ce.j)(u),dt=async(e,t,n,r,s)=>{const{hostname:i,protocol:o="https",port:a,path:l}=await e.endpoint(),c={protocol:o,hostname:i,port:a,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+n:l+n,headers:t};return void 0!==r&&(c.hostname=r),void 0!==s&&(c.body=s),new Ae.K(c)},pt={"content-type":"application/x-www-form-urlencoded"},ht="2011-06-15",gt="Action",ft="AccessKeyId",mt="AssumeRole",xt="AssumedRoleId",bt="AssumedRoleUser",yt="AssumeRoleWithWebIdentity",Et="Arn",vt="Audience",wt="Credentials",St="ContextAssertion",It="DurationSeconds",Pt="Expiration",At="ExternalId",Tt="Key",Nt="Policy",Ct="PolicyArns",Ot="ProviderArn",kt="ProvidedContexts",Dt="ProviderId",$t="PackedPolicySize",Rt="Provider",Mt="RoleArn",jt="RoleSessionName",Ft="SecretAccessKey",Kt="SubjectFromWebIdentityToken",_t="SourceIdentity",Ut="SerialNumber",Vt="SessionToken",Wt="Tags",Lt="TokenCode",zt="TransitiveTagKeys",qt="Version",Bt="Value",Yt="WebIdentityToken",Ht="arn",Gt="message",Zt=e=>Object.entries(e).map(([e,t])=>(0,Oe.$)(e)+"="+(0,Oe.$)(t)).join("&"),Xt=(e,t)=>void 0!==t.Error?.Code?t.Error.Code:404==e.statusCode?"NotFound":void 0;class Jt extends(o.u.classBuilder().ep(a).m(function(e,t,n,r){return[(0,i.TM)(n,this.serialize,this.deserialize),(0,s.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,p).ser(ke).de($e).build()){}class Qt extends(o.u.classBuilder().ep(a).m(function(e,t,n,r){return[(0,i.TM)(n,this.serialize,this.deserialize),(0,s.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(y,E).ser(De).de(Re).build()){}const en="us-east-1",tn=e=>{if("string"==typeof e?.Arn){const t=e.Arn.split(":");if(t.length>4&&""!==t[4])return t[4]}},nn=async(e,t,n)=>{const r="function"==typeof e?await e():e,s="function"==typeof t?await t():t;return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${r} (provider)`,`${s} (parent client)`,`${en} (STS default)`),r??s??en},rn=e=>"h2"===e?.metadata?.handlerProtocol;var sn=n(67317),on=n(27847),an=n(33182),ln=n(67868),cn=n(4518),un=n(20459),dn=n(23369),pn=n(83007),hn=n(58001),gn=n(88244),fn=n(79244),mn=n(74499),xn=n(29163),bn=n(8928),yn=n(27792),En=n(80835),vn=n(6670);const wn=async(e,t,n)=>({operation:(0,En.u)(t).operation,region:await(0,vn.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Sn=e=>{const t=[];return"AssumeRoleWithWebIdentity"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t};var In=n(64548),Pn=n(21674),An=n(61008),Tn=n(57180),Nn=n(4425),Cn=n(34767),On=n(91968),kn=n(28164),Dn=n(41942),$n=n(31305),Rn=n(13820),Mn=n(43316),jn=n(41911),Fn=n(46553),Kn=n(31680),_n=n(88468),Un=n(96527),Vn=n(72804),Wn=n(69367),Ln=n(19506),zn=n(40935),qn=n(2914),Bn=n(56771),Yn=n(2257),Hn=n(63305),Gn=n(37867);const Zn="required",Xn="type",Jn="fn",Qn="argv",er="ref",tr=!1,nr=!0,rr="booleanEquals",sr="stringEquals",ir="sigv4",or="us-east-1",ar="endpoint",lr="https://sts.{Region}.{PartitionResult#dnsSuffix}",cr="tree",ur="error",dr="getAttr",pr={[Zn]:!1,[Xn]:"String"},hr={[Zn]:!0,default:!1,[Xn]:"Boolean"},gr={[er]:"Endpoint"},fr={[Jn]:"isSet",[Qn]:[{[er]:"Region"}]},mr={[er]:"Region"},xr={[Jn]:"aws.partition",[Qn]:[mr],assign:"PartitionResult"},br={[er]:"UseFIPS"},yr={[er]:"UseDualStack"},Er={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:ir,signingName:"sts",signingRegion:or}]},headers:{}},vr={},wr={conditions:[{[Jn]:sr,[Qn]:[mr,"aws-global"]}],[ar]:Er,[Xn]:ar},Sr={[Jn]:rr,[Qn]:[br,!0]},Ir={[Jn]:rr,[Qn]:[yr,!0]},Pr={[Jn]:dr,[Qn]:[{[er]:"PartitionResult"},"supportsFIPS"]},Ar={[er]:"PartitionResult"},Tr={[Jn]:rr,[Qn]:[!0,{[Jn]:dr,[Qn]:[Ar,"supportsDualStack"]}]},Nr=[{[Jn]:"isSet",[Qn]:[gr]}],Cr=[Sr],Or=[Ir],kr={version:"1.0",parameters:{Region:pr,UseDualStack:hr,UseFIPS:hr,Endpoint:pr,UseGlobalEndpoint:hr},rules:[{conditions:[{[Jn]:rr,[Qn]:[{[er]:"UseGlobalEndpoint"},nr]},{[Jn]:"not",[Qn]:Nr},fr,xr,{[Jn]:rr,[Qn]:[br,tr]},{[Jn]:rr,[Qn]:[yr,tr]}],rules:[{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-northeast-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-south-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-southeast-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"ap-southeast-2"]}],endpoint:Er,[Xn]:ar},wr,{conditions:[{[Jn]:sr,[Qn]:[mr,"ca-central-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-central-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-north-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-2"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"eu-west-3"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"sa-east-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,or]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-east-2"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-west-1"]}],endpoint:Er,[Xn]:ar},{conditions:[{[Jn]:sr,[Qn]:[mr,"us-west-2"]}],endpoint:Er,[Xn]:ar},{endpoint:{url:lr,properties:{authSchemes:[{name:ir,signingName:"sts",signingRegion:"{Region}"}]},headers:vr},[Xn]:ar}],[Xn]:cr},{conditions:Nr,rules:[{conditions:Cr,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Xn]:ur},{conditions:Or,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Xn]:ur},{endpoint:{url:gr,properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{conditions:[fr],rules:[{conditions:[xr],rules:[{conditions:[Sr,Ir],rules:[{conditions:[{[Jn]:rr,[Qn]:[nr,Pr]},Tr],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Xn]:ur}],[Xn]:cr},{conditions:Cr,rules:[{conditions:[{[Jn]:rr,[Qn]:[Pr,nr]}],rules:[{conditions:[{[Jn]:sr,[Qn]:[{[Jn]:dr,[Qn]:[Ar,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:vr,headers:vr},[Xn]:ar},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"FIPS is enabled but this partition does not support FIPS",[Xn]:ur}],[Xn]:cr},{conditions:Or,rules:[{conditions:[Tr],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr},{error:"DualStack is enabled but this partition does not support DualStack",[Xn]:ur}],[Xn]:cr},wr,{endpoint:{url:lr,properties:vr,headers:vr},[Xn]:ar}],[Xn]:cr}],[Xn]:cr},{error:"Invalid Configuration: Missing Region",[Xn]:ur}]},Dr=new Yn.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),$r=(e,t={})=>Dr.get(e,()=>(0,Hn.s)(kr,{endpointParams:e,logger:t.logger}));Gn.m.aws=Bn.UF;var Rr=n(72617),Mr=n(70758),jr=n(97252);var Fr=n(96374),Kr=n(59326),_r=n(61701);class Ur extends bn.K{config;constructor(...[e]){const t=(e=>{(0,jr.I)(process.version);const t=(0,Mr.I)(e),n=()=>t().then(Rr.l),r=(e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Wn.E,base64Encoder:e?.base64Encoder??Ln.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??$r,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Sn,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Tn.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new $n.m}],logger:e?.logger??new Un.N,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??Vn.D,utf8Decoder:e?.utf8Decoder??zn.a,utf8Encoder:e?.utf8Encoder??qn.P}))(e);(0,Pn.I)(process.version);const s={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,Mn.Z)(An.$,s),bodyLengthChecker:e?.bodyLengthChecker??Kn.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Nn.pf)({serviceId:r.serviceId,clientVersion:In.rE}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4")||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new Tn.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new $n.m}],maxAttempts:e?.maxAttempts??(0,Mn.Z)(mn.qs,e),region:e?.region??(0,Mn.Z)(On.GG,{...On.zH,...s}),requestHandler:jn.$.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,Mn.Z)({...mn.kN,default:async()=>(await n()).retryMode||_n.L0},e),sha256:e?.sha256??Rn.V.bind(null,"sha256"),streamCollector:e?.streamCollector??Fn.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,Mn.Z)(kn.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,Mn.Z)(Dn.Ko,s),userAgentAppId:e?.userAgentAppId??(0,Mn.Z)(Cn.hV,s)}})(e||{});super(t),this.initConfig=t;const n=(r=t,Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var r;const s=(0,ln.D)(n),i=(0,mn.$z)(s),o=(0,un.T)(i),a=(0,sn.OV)(o),l=((e,t)=>{const n=Object.assign((0,Fr.R)(e),(0,_r.xA)(e),(0,Kr.e)(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,Fr.$)(n),(0,_r.uv)(n),(0,Kr.j)(n),{httpAuthSchemes:(r=n).httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var r})((e=>{const t=(n=e,Object.assign(n,{stsClientCtor:Ur}));var n;const r=(0,yn.h)(t);return Object.assign(r,{authSchemePreference:(0,vn.t)(e.authSchemePreference??[])})})((0,fn.C)(a)),e?.extensions||[]);this.config=l,this.middlewareStack.use((0,cn.sM)(this.config)),this.middlewareStack.use((0,xn.ey)(this.config)),this.middlewareStack.use((0,gn.vK)(this.config)),this.middlewareStack.use((0,sn.TC)(this.config)),this.middlewareStack.use((0,on.Y7)(this.config)),this.middlewareStack.use((0,an.n)(this.config)),this.middlewareStack.use((0,dn.w)(this.config,{httpAuthSchemeParametersProvider:wn,identityProviderConfigProvider:async e=>new pn.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,hn.l)(this.config))}destroy(){super.destroy()}}const Vr=(e,t)=>t?class extends e{constructor(e){super(e);for(const e of t)this.middlewareStack.use(e)}}:e,Wr=(e={},t)=>((e,t)=>{let n,s;return async(i,o)=>{if(s=i,!n){const{logger:r=e?.parentClientConfig?.logger,region:i,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:a}=e,l=await nn(i,e?.parentClientConfig?.region,a),c=!rn(o);n=new t({profile:e?.parentClientConfig?.profile,credentialDefaultProvider:()=>async()=>s,region:l,requestHandler:c?o:void 0,logger:r})}const{Credentials:a,AssumedRoleUser:l}=await n.send(new Jt(o));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);const c=tn(l),u={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...c&&{accountId:c}};return(0,r.g)(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}})(e,Vr(Ur,t)),Lr=(e={},t)=>((e,t)=>{let n;return async s=>{if(!n){const{logger:r=e?.parentClientConfig?.logger,region:s,requestHandler:i=e?.parentClientConfig?.requestHandler,credentialProviderLogger:o}=e,a=await nn(s,e?.parentClientConfig?.region,o),l=!rn(i);n=new t({profile:e?.parentClientConfig?.profile,region:a,requestHandler:l?i:void 0,logger:r})}const{Credentials:i,AssumedRoleUser:o}=await n.send(new Qt(s));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);const a=tn(o),l={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...a&&{accountId:a}};return a&&(0,r.g)(l,"RESOLVED_ACCOUNT_ID","T"),(0,r.g)(l,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),l}})(e,Vr(Ur,t))}};
|
package/dist/904.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=904,exports.ids=[904],exports.modules={10602:(e,t,r)=>{r.d(t,{$:()=>o});const o="***SensitiveInformation***"},31305:(e,t,r)=>{r.d(t,{m:()=>o});class o{async sign(e,t,r){return e}}},37579:(e,t,r)=>{function o(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>o})},64548:e=>{e.exports={rE:"3.901.0"}},65875:(e,t,r)=>{r.d(t,{l:()=>n});var o=r(32141),s=r(37579);function n(e,t){return new i(e,t)}class i{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){const{hostname:e,protocol:t="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(const e of this.resolvePathStack)e(this.path);return new o.K({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,o){return this.resolvePathStack.push(n=>{this.path=((e,t,r,o,n,i)=>{if(null==t||void 0===t[r])throw new Error("No value provided for input HTTP label: "+r+".");{const t=o();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(n,i?t.split("/").map(e=>(0,s.$)(e)).join("/"):(0,s.$)(t))}return e})(n,this.input,e,t,r,o)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}},98904:(e,t,r)=>{r.d(t,{CreateTokenCommand:()=>ft,SSOOIDCClient:()=>$e});var o=r(67317),s=r(27847),n=r(33182),i=r(67868),a=r(4518),c=r(20459),d=r(23369),p=r(83007),u=r(58001),h=r(88244),l=r(79244),m=r(74499),y=r(29163),f=r(8928),g=r(27792),x=r(80835),b=r(6670);const w=async(e,t,r)=>({operation:(0,x.u)(t).operation,region:await(0,b.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),S=e=>{const t=[];return"CreateToken"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},v={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var E=r(64548),P=r(21674),I=r(61008),k=r(4425),O=r(34767),$=r(91968),T=r(28164),j=r(41942),_=r(13820),C=r(43316),A=r(41911),D=r(46553),K=r(31680),z=r(88468),R=r(57180),U=r(31305),q=r(96527),M=r(72804),F=r(69367),G=r(19506),H=r(40935),V=r(2914),Z=r(56771),N=r(2257),B=r(63305),L=r(60248);const Y="required",J="fn",W="argv",X="ref",Q=!0,ee="isSet",te="booleanEquals",re="error",oe="endpoint",se="tree",ne="PartitionResult",ie="getAttr",ae={[Y]:!1,type:"String"},ce={[Y]:!0,default:!1,type:"Boolean"},de={[X]:"Endpoint"},pe={[J]:te,[W]:[{[X]:"UseFIPS"},!0]},ue={[J]:te,[W]:[{[X]:"UseDualStack"},!0]},he={},le={[J]:ie,[W]:[{[X]:ne},"supportsFIPS"]},me={[X]:ne},ye={[J]:te,[W]:[!0,{[J]:ie,[W]:[me,"supportsDualStack"]}]},fe=[pe],ge=[ue],xe=[{[X]:"Region"}],be={version:"1.0",parameters:{Region:ae,UseDualStack:ce,UseFIPS:ce,Endpoint:ae},rules:[{conditions:[{[J]:ee,[W]:[de]}],rules:[{conditions:fe,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:re},{conditions:ge,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:re},{endpoint:{url:de,properties:he,headers:he},type:oe}],type:se},{conditions:[{[J]:ee,[W]:xe}],rules:[{conditions:[{[J]:"aws.partition",[W]:xe,assign:ne}],rules:[{conditions:[pe,ue],rules:[{conditions:[{[J]:te,[W]:[Q,le]},ye],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:re}],type:se},{conditions:fe,rules:[{conditions:[{[J]:te,[W]:[le,Q]}],rules:[{conditions:[{[J]:"stringEquals",[W]:[{[J]:ie,[W]:[me,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:he,headers:he},type:oe},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"FIPS is enabled but this partition does not support FIPS",type:re}],type:se},{conditions:ge,rules:[{conditions:[ye],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"DualStack is enabled but this partition does not support DualStack",type:re}],type:se},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:he,headers:he},type:oe}],type:se}],type:se},{error:"Invalid Configuration: Missing Region",type:re}]},we=new N.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Se=(e,t={})=>we.get(e,()=>(0,B.s)(be,{endpointParams:e,logger:t.logger}));L.m.aws=Z.UF;var ve=r(72617),Ee=r(70758),Pe=r(97252);var Ie=r(96374),ke=r(59326),Oe=r(61701);class $e extends f.K{config;constructor(...[e]){const t=(e=>{(0,Pe.I)(process.version);const t=(0,Ee.I)(e),r=()=>t().then(ve.l),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??F.E,base64Encoder:e?.base64Encoder??G.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Se,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??S,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new R.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new U.m}],logger:e?.logger??new q.N,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??M.D,utf8Decoder:e?.utf8Decoder??H.a,utf8Encoder:e?.utf8Encoder??V.P}))(e);(0,P.I)(process.version);const s={profile:e?.profile,logger:o.logger};return{...o,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,C.Z)(I.$,s),bodyLengthChecker:e?.bodyLengthChecker??K.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,k.pf)({serviceId:o.serviceId,clientVersion:E.rE}),maxAttempts:e?.maxAttempts??(0,C.Z)(m.qs,e),region:e?.region??(0,C.Z)($.GG,{...$.zH,...s}),requestHandler:A.$.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,C.Z)({...m.kN,default:async()=>(await r()).retryMode||z.L0},e),sha256:e?.sha256??_.V.bind(null,"sha256"),streamCollector:e?.streamCollector??D.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,C.Z)(T.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,C.Z)(j.Ko,s),userAgentAppId:e?.userAgentAppId??(0,C.Z)(O.hV,s)}})(e||{});super(t),this.initConfig=t;const r=(f=t,Object.assign(f,{useDualstackEndpoint:f.useDualstackEndpoint??!1,useFipsEndpoint:f.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}));var f;const x=(0,i.D)(r),v=(0,m.$z)(x),Z=(0,c.T)(v),N=(0,o.OV)(Z),B=((e,t)=>{const r=Object.assign((0,Ie.R)(e),(0,Oe.xA)(e),(0,ke.e)(e),(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const r=t.findIndex(t=>t.schemeId===e.schemeId);-1===r?t.push(e):t.splice(r,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){r=e},httpAuthSchemeProvider:()=>r,setCredentials(e){o=e},credentials:()=>o}})(e));return t.forEach(e=>e.configure(r)),Object.assign(e,(0,Ie.$)(r),(0,Oe.uv)(r),(0,ke.j)(r),{httpAuthSchemes:(o=r).httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()});var o})((e=>{const t=(0,g.h)(e);return Object.assign(t,{authSchemePreference:(0,b.t)(e.authSchemePreference??[])})})((0,l.C)(N)),e?.extensions||[]);this.config=B,this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,y.ey)(this.config)),this.middlewareStack.use((0,h.vK)(this.config)),this.middlewareStack.use((0,o.TC)(this.config)),this.middlewareStack.use((0,s.Y7)(this.config)),this.middlewareStack.use((0,n.n)(this.config)),this.middlewareStack.use((0,d.w)(this.config,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:async e=>new p.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,u.l)(this.config))}destroy(){super.destroy()}}var Te=r(66403),je=r(53340),_e=r(3594),Ce=r(10602),Ae=r(92309);class De extends Ae.T{constructor(e){super(e),Object.setPrototypeOf(this,De.prototype)}}class Ke extends De{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Ke.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class ze extends De{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,ze.prototype),this.error=e.error,this.error_description=e.error_description}}const Re=e=>({...e,...e.clientSecret&&{clientSecret:Ce.$},...e.refreshToken&&{refreshToken:Ce.$},...e.codeVerifier&&{codeVerifier:Ce.$}}),Ue=e=>({...e,...e.accessToken&&{accessToken:Ce.$},...e.refreshToken&&{refreshToken:Ce.$},...e.idToken&&{idToken:Ce.$}});class qe extends De{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,qe.prototype),this.error=e.error,this.error_description=e.error_description}}class Me extends De{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,Me.prototype),this.error=e.error,this.error_description=e.error_description}}class Fe extends De{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Fe.prototype),this.error=e.error,this.error_description=e.error_description}}class Ge extends De{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,Ge.prototype),this.error=e.error,this.error_description=e.error_description}}class He extends De{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,He.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Ve extends De{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ve.prototype),this.error=e.error,this.error_description=e.error_description}}class Ze extends De{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,Ze.prototype),this.error=e.error,this.error_description=e.error_description}}class Ne extends De{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Ne.prototype),this.error=e.error,this.error_description=e.error_description}}class Be extends De{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Be.prototype),this.error=e.error,this.error_description=e.error_description}}var Le=r(46071),Ye=r(65875),Je=r(93907),We=r(10001),Xe=r(86343),Qe=r(63976);const et=async(e,t)=>{const r=(0,Ye.l)(e,t);let o;return r.bp("/token"),o=JSON.stringify((0,Je.s)(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,We.S)(e)})),r.m("POST").h({"content-type":"application/json"}).b(o),r.build()},tt=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return rt(e,t);const r=(0,Je.Tj)({$metadata:yt(e)}),o=(0,Xe.Y0)((0,Xe.Xk)(await(0,Le.Y2)(e.body,t)),"body"),s=(0,Je.s)(o,{accessToken:Xe.lK,expiresIn:Xe.ET,idToken:Xe.lK,refreshToken:Xe.lK,tokenType:Xe.lK});return Object.assign(r,s),r},rt=async(e,t)=>{const r={...e,body:await(0,Le.CG)(e.body,t)},o=(0,Le.cJ)(e,r.body);switch(o){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await st(r,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await nt(r,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await it(r,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await at(r,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await ct(r,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await dt(r,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await pt(r,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ut(r,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await ht(r,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await lt(r,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await mt(r,t);default:const s=r.body;return ot({output:e,parsedBody:s,errorCode:o})}},ot=(0,Qe.j)(De),st=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK,reason:Xe.lK});Object.assign(r,s);const n=new Ke({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},nt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new ze({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},it=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new qe({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},at=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Me({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ct=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Fe({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},dt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ge({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},pt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK,reason:Xe.lK});Object.assign(r,s);const n=new He({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ut=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ve({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ht=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ze({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},lt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ne({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},mt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Be({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},yt=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});class ft extends(_e.u.classBuilder().ep(v).m(function(e,t,r,o){return[(0,je.TM)(r,this.serialize,this.deserialize),(0,Te.r)(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Re,Ue).ser(et).de(tt).build()){}}};
|
|
1
|
+
"use strict";exports.id=904,exports.ids=[904],exports.modules={10602:(e,t,r)=>{r.d(t,{$:()=>o});const o="***SensitiveInformation***"},31305:(e,t,r)=>{r.d(t,{m:()=>o});class o{async sign(e,t,r){return e}}},37579:(e,t,r)=>{function o(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>o})},64548:e=>{e.exports={rE:"3.901.0"}},65875:(e,t,r)=>{r.d(t,{l:()=>n});var o=r(32141),s=r(37579);function n(e,t){return new i(e,t)}class i{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){const{hostname:e,protocol:t="https",port:r,path:s}=await this.context.endpoint();this.path=s;for(const e of this.resolvePathStack)e(this.path);return new o.K({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push(t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,o){return this.resolvePathStack.push(n=>{this.path=((e,t,r,o,n,i)=>{if(null==t||void 0===t[r])throw new Error("No value provided for input HTTP label: "+r+".");{const t=o();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(n,i?t.split("/").map(e=>(0,s.$)(e)).join("/"):(0,s.$)(t))}return e})(n,this.input,e,t,r,o)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}},98904:(e,t,r)=>{r.d(t,{CreateTokenCommand:()=>ft,SSOOIDCClient:()=>$e});var o=r(67317),s=r(27847),n=r(33182),i=r(67868),a=r(4518),c=r(20459),d=r(23369),p=r(83007),u=r(58001),h=r(88244),l=r(79244),m=r(74499),y=r(29163),f=r(8928),g=r(27792),x=r(80835),b=r(6670);const w=async(e,t,r)=>({operation:(0,x.u)(t).operation,region:await(0,b.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),S=e=>{const t=[];return"CreateToken"===e.operation?t.push({schemeId:"smithy.api#noAuth"}):t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e)),t},v={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var E=r(64548),P=r(21674),I=r(61008),k=r(4425),O=r(34767),$=r(91968),T=r(28164),j=r(41942),_=r(13820),C=r(43316),A=r(41911),D=r(46553),K=r(31680),z=r(88468),R=r(57180),U=r(31305),q=r(96527),M=r(72804),F=r(69367),G=r(19506),H=r(40935),V=r(2914),Z=r(56771),N=r(2257),B=r(63305),L=r(37867);const Y="required",J="fn",W="argv",X="ref",Q=!0,ee="isSet",te="booleanEquals",re="error",oe="endpoint",se="tree",ne="PartitionResult",ie="getAttr",ae={[Y]:!1,type:"String"},ce={[Y]:!0,default:!1,type:"Boolean"},de={[X]:"Endpoint"},pe={[J]:te,[W]:[{[X]:"UseFIPS"},!0]},ue={[J]:te,[W]:[{[X]:"UseDualStack"},!0]},he={},le={[J]:ie,[W]:[{[X]:ne},"supportsFIPS"]},me={[X]:ne},ye={[J]:te,[W]:[!0,{[J]:ie,[W]:[me,"supportsDualStack"]}]},fe=[pe],ge=[ue],xe=[{[X]:"Region"}],be={version:"1.0",parameters:{Region:ae,UseDualStack:ce,UseFIPS:ce,Endpoint:ae},rules:[{conditions:[{[J]:ee,[W]:[de]}],rules:[{conditions:fe,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:re},{conditions:ge,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:re},{endpoint:{url:de,properties:he,headers:he},type:oe}],type:se},{conditions:[{[J]:ee,[W]:xe}],rules:[{conditions:[{[J]:"aws.partition",[W]:xe,assign:ne}],rules:[{conditions:[pe,ue],rules:[{conditions:[{[J]:te,[W]:[Q,le]},ye],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:re}],type:se},{conditions:fe,rules:[{conditions:[{[J]:te,[W]:[le,Q]}],rules:[{conditions:[{[J]:"stringEquals",[W]:[{[J]:ie,[W]:[me,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:he,headers:he},type:oe},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"FIPS is enabled but this partition does not support FIPS",type:re}],type:se},{conditions:ge,rules:[{conditions:[ye],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:he,headers:he},type:oe}],type:se},{error:"DualStack is enabled but this partition does not support DualStack",type:re}],type:se},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:he,headers:he},type:oe}],type:se}],type:se},{error:"Invalid Configuration: Missing Region",type:re}]},we=new N.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Se=(e,t={})=>we.get(e,()=>(0,B.s)(be,{endpointParams:e,logger:t.logger}));L.m.aws=Z.UF;var ve=r(72617),Ee=r(70758),Pe=r(97252);var Ie=r(96374),ke=r(59326),Oe=r(61701);class $e extends f.K{config;constructor(...[e]){const t=(e=>{(0,Pe.I)(process.version);const t=(0,Ee.I)(e),r=()=>t().then(ve.l),o=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??F.E,base64Encoder:e?.base64Encoder??G.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Se,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??S,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new R.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new U.m}],logger:e?.logger??new q.N,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??M.D,utf8Decoder:e?.utf8Decoder??H.a,utf8Encoder:e?.utf8Encoder??V.P}))(e);(0,P.I)(process.version);const s={profile:e?.profile,logger:o.logger};return{...o,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,C.Z)(I.$,s),bodyLengthChecker:e?.bodyLengthChecker??K.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,k.pf)({serviceId:o.serviceId,clientVersion:E.rE}),maxAttempts:e?.maxAttempts??(0,C.Z)(m.qs,e),region:e?.region??(0,C.Z)($.GG,{...$.zH,...s}),requestHandler:A.$.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,C.Z)({...m.kN,default:async()=>(await r()).retryMode||z.L0},e),sha256:e?.sha256??_.V.bind(null,"sha256"),streamCollector:e?.streamCollector??D.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,C.Z)(T.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,C.Z)(j.Ko,s),userAgentAppId:e?.userAgentAppId??(0,C.Z)(O.hV,s)}})(e||{});super(t),this.initConfig=t;const r=(f=t,Object.assign(f,{useDualstackEndpoint:f.useDualstackEndpoint??!1,useFipsEndpoint:f.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}));var f;const x=(0,i.D)(r),v=(0,m.$z)(x),Z=(0,c.T)(v),N=(0,o.OV)(Z),B=((e,t)=>{const r=Object.assign((0,Ie.R)(e),(0,Oe.xA)(e),(0,ke.e)(e),(e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,o=e.credentials;return{setHttpAuthScheme(e){const r=t.findIndex(t=>t.schemeId===e.schemeId);-1===r?t.push(e):t.splice(r,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){r=e},httpAuthSchemeProvider:()=>r,setCredentials(e){o=e},credentials:()=>o}})(e));return t.forEach(e=>e.configure(r)),Object.assign(e,(0,Ie.$)(r),(0,Oe.uv)(r),(0,ke.j)(r),{httpAuthSchemes:(o=r).httpAuthSchemes(),httpAuthSchemeProvider:o.httpAuthSchemeProvider(),credentials:o.credentials()});var o})((e=>{const t=(0,g.h)(e);return Object.assign(t,{authSchemePreference:(0,b.t)(e.authSchemePreference??[])})})((0,l.C)(N)),e?.extensions||[]);this.config=B,this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,y.ey)(this.config)),this.middlewareStack.use((0,h.vK)(this.config)),this.middlewareStack.use((0,o.TC)(this.config)),this.middlewareStack.use((0,s.Y7)(this.config)),this.middlewareStack.use((0,n.n)(this.config)),this.middlewareStack.use((0,d.w)(this.config,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:async e=>new p.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,u.l)(this.config))}destroy(){super.destroy()}}var Te=r(66403),je=r(53340),_e=r(3594),Ce=r(10602),Ae=r(92309);class De extends Ae.T{constructor(e){super(e),Object.setPrototypeOf(this,De.prototype)}}class Ke extends De{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Ke.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class ze extends De{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,ze.prototype),this.error=e.error,this.error_description=e.error_description}}const Re=e=>({...e,...e.clientSecret&&{clientSecret:Ce.$},...e.refreshToken&&{refreshToken:Ce.$},...e.codeVerifier&&{codeVerifier:Ce.$}}),Ue=e=>({...e,...e.accessToken&&{accessToken:Ce.$},...e.refreshToken&&{refreshToken:Ce.$},...e.idToken&&{idToken:Ce.$}});class qe extends De{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,qe.prototype),this.error=e.error,this.error_description=e.error_description}}class Me extends De{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,Me.prototype),this.error=e.error,this.error_description=e.error_description}}class Fe extends De{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Fe.prototype),this.error=e.error,this.error_description=e.error_description}}class Ge extends De{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,Ge.prototype),this.error=e.error,this.error_description=e.error_description}}class He extends De{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,He.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Ve extends De{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ve.prototype),this.error=e.error,this.error_description=e.error_description}}class Ze extends De{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,Ze.prototype),this.error=e.error,this.error_description=e.error_description}}class Ne extends De{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Ne.prototype),this.error=e.error,this.error_description=e.error_description}}class Be extends De{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Be.prototype),this.error=e.error,this.error_description=e.error_description}}var Le=r(46071),Ye=r(65875),Je=r(93907),We=r(10001),Xe=r(86343),Qe=r(63976);const et=async(e,t)=>{const r=(0,Ye.l)(e,t);let o;return r.bp("/token"),o=JSON.stringify((0,Je.s)(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,We.S)(e)})),r.m("POST").h({"content-type":"application/json"}).b(o),r.build()},tt=async(e,t)=>{if(200!==e.statusCode&&e.statusCode>=300)return rt(e,t);const r=(0,Je.Tj)({$metadata:yt(e)}),o=(0,Xe.Y0)((0,Xe.Xk)(await(0,Le.Y2)(e.body,t)),"body"),s=(0,Je.s)(o,{accessToken:Xe.lK,expiresIn:Xe.ET,idToken:Xe.lK,refreshToken:Xe.lK,tokenType:Xe.lK});return Object.assign(r,s),r},rt=async(e,t)=>{const r={...e,body:await(0,Le.CG)(e.body,t)},o=(0,Le.cJ)(e,r.body);switch(o){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await st(r,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await nt(r,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await it(r,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await at(r,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await ct(r,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await dt(r,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await pt(r,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ut(r,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await ht(r,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await lt(r,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await mt(r,t);default:const s=r.body;return ot({output:e,parsedBody:s,errorCode:o})}},ot=(0,Qe.j)(De),st=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK,reason:Xe.lK});Object.assign(r,s);const n=new Ke({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},nt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new ze({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},it=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new qe({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},at=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Me({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ct=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Fe({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},dt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ge({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},pt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK,reason:Xe.lK});Object.assign(r,s);const n=new He({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ut=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ve({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},ht=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ze({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},lt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Ne({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},mt=async(e,t)=>{const r=(0,Je.Tj)({}),o=e.body,s=(0,Je.s)(o,{error:Xe.lK,error_description:Xe.lK});Object.assign(r,s);const n=new Be({$metadata:yt(e),...r});return(0,Ae.M)(n,e.body)},yt=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});class ft extends(_e.u.classBuilder().ep(v).m(function(e,t,r,o){return[(0,je.TM)(r,this.serialize,this.deserialize),(0,Te.r)(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Re,Ue).ser(et).de(tt).build()){}}};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Adapter for XMCP-I
|
|
3
|
+
*
|
|
4
|
+
* Provides a bridge between CLI commands and the runtime identity system.
|
|
5
|
+
* This adapter recreates the functionality from alpha @kya-os/mcp-i@0.1.0-alpha.3.9
|
|
6
|
+
* using the new runtime architecture.
|
|
7
|
+
*/
|
|
8
|
+
import { AgentIdentity } from "../runtime/identity";
|
|
9
|
+
/**
|
|
10
|
+
* Progress event stages matching alpha implementation
|
|
11
|
+
*/
|
|
12
|
+
export type ProgressStage = "checking_existing" | "generating_keys" | "registering" | "saving" | "complete";
|
|
13
|
+
/**
|
|
14
|
+
* Progress event structure
|
|
15
|
+
*/
|
|
16
|
+
export interface ProgressEvent {
|
|
17
|
+
stage: ProgressStage;
|
|
18
|
+
message?: string;
|
|
19
|
+
data?: {
|
|
20
|
+
claimUrl?: string;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* CLI options matching alpha implementation
|
|
26
|
+
*/
|
|
27
|
+
export interface CLIIdentityOptions {
|
|
28
|
+
name?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
repository?: string;
|
|
31
|
+
endpoint?: string;
|
|
32
|
+
logLevel?: "silent" | "info" | "debug";
|
|
33
|
+
onProgress?: (event: ProgressEvent) => void | Promise<void>;
|
|
34
|
+
skipRegistration?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* CLI identity result matching alpha implementation
|
|
38
|
+
*/
|
|
39
|
+
export interface CLIIdentityResult {
|
|
40
|
+
identity: AgentIdentity;
|
|
41
|
+
metadata: {
|
|
42
|
+
isNewIdentity: boolean;
|
|
43
|
+
did: string;
|
|
44
|
+
claimUrl?: string;
|
|
45
|
+
registryUrl: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Enable MCP Identity for CLI
|
|
50
|
+
*
|
|
51
|
+
* This is the main entry point that CLI commands use to initialize identity.
|
|
52
|
+
* It recreates the alpha `enableMCPIdentityCLI` function.
|
|
53
|
+
*/
|
|
54
|
+
export declare function enableMCPIdentityCLI(options?: CLIIdentityOptions): Promise<CLIIdentityResult>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI Adapter for XMCP-I
|
|
4
|
+
*
|
|
5
|
+
* Provides a bridge between CLI commands and the runtime identity system.
|
|
6
|
+
* This adapter recreates the functionality from alpha @kya-os/mcp-i@0.1.0-alpha.3.9
|
|
7
|
+
* using the new runtime architecture.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.enableMCPIdentityCLI = enableMCPIdentityCLI;
|
|
11
|
+
const identity_1 = require("../runtime/identity");
|
|
12
|
+
const kta_registration_1 = require("./kta-registration");
|
|
13
|
+
/**
|
|
14
|
+
* Enable MCP Identity for CLI
|
|
15
|
+
*
|
|
16
|
+
* This is the main entry point that CLI commands use to initialize identity.
|
|
17
|
+
* It recreates the alpha `enableMCPIdentityCLI` function.
|
|
18
|
+
*/
|
|
19
|
+
async function enableMCPIdentityCLI(options = {}) {
|
|
20
|
+
const { name, description, repository, endpoint = "https://knowthat.ai", onProgress, skipRegistration = false, } = options;
|
|
21
|
+
let isNewIdentity = false;
|
|
22
|
+
let capturedClaimUrl;
|
|
23
|
+
// Helper to emit progress events
|
|
24
|
+
const emitProgress = async (stage, message, data) => {
|
|
25
|
+
if (onProgress) {
|
|
26
|
+
await onProgress({ stage, message, data });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
// Step 1: Check for existing identity
|
|
30
|
+
await emitProgress("checking_existing", "Checking for existing identity...");
|
|
31
|
+
const identityManager = new identity_1.IdentityManager({
|
|
32
|
+
environment: "development",
|
|
33
|
+
devIdentityPath: ".mcpi/identity.json",
|
|
34
|
+
});
|
|
35
|
+
// Check if identity file exists
|
|
36
|
+
const fs = await import("fs");
|
|
37
|
+
const identityExists = fs.existsSync(".mcpi/identity.json");
|
|
38
|
+
isNewIdentity = !identityExists;
|
|
39
|
+
// Step 2: Load or generate identity
|
|
40
|
+
if (isNewIdentity) {
|
|
41
|
+
await emitProgress("generating_keys", "Generating cryptographic keys...");
|
|
42
|
+
}
|
|
43
|
+
const identity = await identityManager.ensureIdentity();
|
|
44
|
+
// Step 3: Register with KTA (if not skipped and is new identity)
|
|
45
|
+
let registrationResult = null;
|
|
46
|
+
if (!skipRegistration && isNewIdentity) {
|
|
47
|
+
await emitProgress("registering", "Registering with Know-That-AI...");
|
|
48
|
+
try {
|
|
49
|
+
registrationResult = await (0, kta_registration_1.registerWithKTA)({
|
|
50
|
+
did: identity.did,
|
|
51
|
+
publicKey: identity.publicKey,
|
|
52
|
+
keyId: identity.keyId,
|
|
53
|
+
name: name || "My Agent",
|
|
54
|
+
description: description || "XMCP-I agent with identity features",
|
|
55
|
+
repository,
|
|
56
|
+
endpoint,
|
|
57
|
+
});
|
|
58
|
+
capturedClaimUrl = registrationResult.claimURL;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.warn("Warning: KTA registration failed:", error.message);
|
|
62
|
+
console.warn("Continuing with local identity only");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Step 4: Save (already done by IdentityManager, but emit event for CLI)
|
|
66
|
+
await emitProgress("saving", "Saving identity...");
|
|
67
|
+
// Step 5: Complete
|
|
68
|
+
await emitProgress("complete", "Identity setup complete!", {
|
|
69
|
+
claimUrl: capturedClaimUrl,
|
|
70
|
+
});
|
|
71
|
+
// Generate registry URL
|
|
72
|
+
const didParts = identity.did.split(":");
|
|
73
|
+
const agentId = didParts[didParts.length - 1];
|
|
74
|
+
const registryUrl = `https://knowthat.ai/agents/${agentId}`;
|
|
75
|
+
return {
|
|
76
|
+
identity,
|
|
77
|
+
metadata: {
|
|
78
|
+
isNewIdentity,
|
|
79
|
+
did: identity.did,
|
|
80
|
+
claimUrl: capturedClaimUrl,
|
|
81
|
+
registryUrl,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KTA (Know-That-AI) Registration Module
|
|
3
|
+
*
|
|
4
|
+
* Handles agent registration with the KTA registry.
|
|
5
|
+
* Based on alpha implementation from @kya-os/mcp-i@0.1.0-alpha.3.9
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Registration options
|
|
9
|
+
*/
|
|
10
|
+
export interface KTARegistrationOptions {
|
|
11
|
+
did: string;
|
|
12
|
+
publicKey: string;
|
|
13
|
+
keyId: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
repository?: string;
|
|
17
|
+
endpoint?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* KTA Registration Result
|
|
21
|
+
* Matches the structure from alpha implementation
|
|
22
|
+
*/
|
|
23
|
+
export interface KTARegistrationResult {
|
|
24
|
+
agentDID: string;
|
|
25
|
+
agentURL: string;
|
|
26
|
+
agentId: string;
|
|
27
|
+
claimURL: string;
|
|
28
|
+
verificationEndpoint: string;
|
|
29
|
+
conformanceCapabilities: readonly string[];
|
|
30
|
+
mirrorStatus: "pending" | "success" | "error";
|
|
31
|
+
mirrorLink: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Register agent with Know-That-AI
|
|
35
|
+
*
|
|
36
|
+
* Makes an API call to the KTA registry to register the agent.
|
|
37
|
+
* Returns registration details including claim URL.
|
|
38
|
+
*/
|
|
39
|
+
export declare function registerWithKTA(options: KTARegistrationOptions): Promise<KTARegistrationResult>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KTA (Know-That-AI) Registration Module
|
|
4
|
+
*
|
|
5
|
+
* Handles agent registration with the KTA registry.
|
|
6
|
+
* Based on alpha implementation from @kya-os/mcp-i@0.1.0-alpha.3.9
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.registerWithKTA = registerWithKTA;
|
|
13
|
+
const axios_1 = __importDefault(require("axios"));
|
|
14
|
+
/**
|
|
15
|
+
* MCP-I Capabilities (from contracts)
|
|
16
|
+
*/
|
|
17
|
+
const MCP_I_CAPABILITIES = [
|
|
18
|
+
"identity",
|
|
19
|
+
"signatures",
|
|
20
|
+
"well-known-endpoints",
|
|
21
|
+
"did-resolution",
|
|
22
|
+
"key-rotation",
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* Register agent with Know-That-AI
|
|
26
|
+
*
|
|
27
|
+
* Makes an API call to the KTA registry to register the agent.
|
|
28
|
+
* Returns registration details including claim URL.
|
|
29
|
+
*/
|
|
30
|
+
async function registerWithKTA(options) {
|
|
31
|
+
const { did, publicKey, keyId, name, description, repository, endpoint = "https://knowthat.ai", } = options;
|
|
32
|
+
try {
|
|
33
|
+
// Construct verification endpoint from DID
|
|
34
|
+
const verificationEndpoint = did.includes("localhost")
|
|
35
|
+
? `http://localhost:3000/.well-known/did.json`
|
|
36
|
+
: `${did.replace("did:web:", "https://").replace(":", "/")}/.well-known/did.json`;
|
|
37
|
+
// Prepare registration payload
|
|
38
|
+
const payload = {
|
|
39
|
+
did,
|
|
40
|
+
publicKey,
|
|
41
|
+
keyId,
|
|
42
|
+
name,
|
|
43
|
+
description,
|
|
44
|
+
repository: repository || undefined,
|
|
45
|
+
verificationEndpoint,
|
|
46
|
+
capabilities: MCP_I_CAPABILITIES,
|
|
47
|
+
};
|
|
48
|
+
// Make registration request
|
|
49
|
+
const response = await axios_1.default.post(`${endpoint}/api/agents/auto-register`, payload, {
|
|
50
|
+
headers: {
|
|
51
|
+
"Content-Type": "application/json",
|
|
52
|
+
"User-Agent": "@kya-os/mcp-i-cli",
|
|
53
|
+
},
|
|
54
|
+
timeout: 30000, // 30 second timeout
|
|
55
|
+
});
|
|
56
|
+
const data = response.data;
|
|
57
|
+
// Extract agent ID from DID
|
|
58
|
+
const agentId = did.split(":").pop() || `agent-${Date.now()}`;
|
|
59
|
+
// Build result structure
|
|
60
|
+
const result = {
|
|
61
|
+
agentDID: did,
|
|
62
|
+
agentURL: data.agentURL || `${endpoint}/agents/by-did/${encodeURIComponent(did)}`,
|
|
63
|
+
agentId: data.agentId || agentId,
|
|
64
|
+
claimURL: data.claimURL || `${endpoint}/claim/${agentId}`,
|
|
65
|
+
verificationEndpoint,
|
|
66
|
+
conformanceCapabilities: MCP_I_CAPABILITIES,
|
|
67
|
+
mirrorStatus: data.mirrorStatus || "pending",
|
|
68
|
+
mirrorLink: data.mirrorLink || `${endpoint}/agents/pending`,
|
|
69
|
+
};
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
// Handle different error types
|
|
74
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
75
|
+
if (error.code === "ECONNREFUSED") {
|
|
76
|
+
throw new Error(`Could not connect to KTA registry at ${endpoint}. ` +
|
|
77
|
+
"Please check your internet connection or try again later.");
|
|
78
|
+
}
|
|
79
|
+
if (error.response?.status === 503) {
|
|
80
|
+
throw new Error("KTA registry is temporarily unavailable (maintenance mode). " +
|
|
81
|
+
"Please try again in a few minutes.");
|
|
82
|
+
}
|
|
83
|
+
if (error.response?.status === 429) {
|
|
84
|
+
throw new Error("Rate limit exceeded. Please wait a moment and try again.");
|
|
85
|
+
}
|
|
86
|
+
if (error.response?.data?.message) {
|
|
87
|
+
throw new Error(`KTA registration failed: ${error.response.data.message}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
throw new Error(`Failed to register with KTA: ${error.message}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -36,3 +36,5 @@ __exportStar(require("./runtime/index"), exports);
|
|
|
36
36
|
// Compiler for CLI usage
|
|
37
37
|
var index_1 = require("./compiler/index");
|
|
38
38
|
Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return index_1.compile; } });
|
|
39
|
+
// CLI adapter for identity setup (matches alpha behavior)
|
|
40
|
+
__exportStar(require("./cli-adapter"), exports);
|
|
@@ -32,6 +32,20 @@ object-assign
|
|
|
32
32
|
* Released under the MIT License.
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
+
/*!
|
|
36
|
+
* mime-db
|
|
37
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
38
|
+
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
39
|
+
* MIT Licensed
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/*!
|
|
43
|
+
* mime-types
|
|
44
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
45
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
46
|
+
* MIT Licensed
|
|
47
|
+
*/
|
|
48
|
+
|
|
35
49
|
/*!
|
|
36
50
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
37
51
|
*
|