@zuplo/cli 6.74.7 → 6.74.8
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/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-ELNSPW6X.js → chunk-3E6DNHTO.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/{chunk-ELNSPW6X.js.map → chunk-3E6DNHTO.js.map} +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +6 -4
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/package.json +6 -6
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-ELNSPW6X.js.LEGAL.txt → chunk-3E6DNHTO.js.LEGAL.txt} +0 -0
|
@@ -366,5 +366,5 @@ Signature verification is impossible without access to the original signed mater
|
|
|
366
366
|
`);let C=new f("!xml"),k=C,x="",M="";this.entityExpansionCount=0,this.currentExpandedLength=0;let L=new R(this.options.processEntities);for(let B=0;B<b.length;B++)if(b[B]==="<")if(b[B+1]==="/"){let Y=pt(b,">",B,"Closing Tag is not closed."),J=b.substring(B+2,Y).trim();if(this.options.removeNSPrefix){let Rt=J.indexOf(":");Rt!==-1&&(J=J.substr(Rt+1))}this.options.transformTagName&&(J=this.options.transformTagName(J)),k&&(x=this.saveTextToParentTag(x,k,M));let Fe=M.substring(M.lastIndexOf(".")+1);if(J&&this.options.unpairedTags.indexOf(J)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${J}>`);let Te=0;Fe&&this.options.unpairedTags.indexOf(Fe)!==-1?(Te=M.lastIndexOf(".",M.lastIndexOf(".")-1),this.tagsNodeStack.pop()):Te=M.lastIndexOf("."),M=M.substring(0,Te),k=this.tagsNodeStack.pop(),x="",B=Y}else if(b[B+1]==="?"){let Y=it(b,B,!1,"?>");if(!Y)throw new Error("Pi Tag is not closed.");if(x=this.saveTextToParentTag(x,k,M),!(this.options.ignoreDeclaration&&Y.tagName==="?xml"||this.options.ignorePiTags)){let J=new f(Y.tagName);J.add(this.options.textNodeName,""),Y.tagName!==Y.tagExp&&Y.attrExpPresent&&(J[":@"]=this.buildAttributesMap(Y.tagExp,M,Y.tagName)),this.addChild(k,J,M,B)}B=Y.closeIndex+1}else if(b.substr(B+1,3)==="!--"){let Y=pt(b,"-->",B+4,"Comment is not closed.");if(this.options.commentPropName){let J=b.substring(B+4,Y-2);x=this.saveTextToParentTag(x,k,M),k.add(this.options.commentPropName,[{[this.options.textNodeName]:J}])}B=Y}else if(b.substr(B+1,2)==="!D"){let Y=L.readDocType(b,B);this.docTypeEntities=Y.entities,B=Y.i}else if(b.substr(B+1,2)==="!["){let Y=pt(b,"]]>",B,"CDATA is not closed.")-2,J=b.substring(B+9,Y);x=this.saveTextToParentTag(x,k,M);let Fe=this.parseTextData(J,k.tagname,M,!0,!1,!0,!0);Fe==null&&(Fe=""),this.options.cdataPropName?k.add(this.options.cdataPropName,[{[this.options.textNodeName]:J}]):k.add(this.options.textNodeName,Fe),B=Y+2}else{let Y=it(b,B,this.options.removeNSPrefix),J=Y.tagName,Fe=Y.rawTagName,Te=Y.tagExp,Rt=Y.attrExpPresent,go=Y.closeIndex;if(this.options.transformTagName){let Et=this.options.transformTagName(J);Te===J&&(Te=Et),J=Et}k&&x&&k.tagname!=="!xml"&&(x=this.saveTextToParentTag(x,k,M,!1));let Lt=k;Lt&&this.options.unpairedTags.indexOf(Lt.tagname)!==-1&&(k=this.tagsNodeStack.pop(),M=M.substring(0,M.lastIndexOf("."))),J!==C.tagname&&(M+=M?"."+J:J);let yo=B;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,M,J)){let Et="";if(Te.length>0&&Te.lastIndexOf("/")===Te.length-1)J[J.length-1]==="/"?(J=J.substr(0,J.length-1),M=M.substr(0,M.length-1),Te=J):Te=Te.substr(0,Te.length-1),B=Y.closeIndex;else if(this.options.unpairedTags.indexOf(J)!==-1)B=Y.closeIndex;else{let bo=this.readStopNodeData(b,Fe,go+1);if(!bo)throw new Error(`Unexpected end of ${Fe}`);B=bo.i,Et=bo.tagContent}let pn=new f(J);J!==Te&&Rt&&(pn[":@"]=this.buildAttributesMap(Te,M,J)),Et&&(Et=this.parseTextData(Et,J,M,!0,Rt,!0,!0)),M=M.substr(0,M.lastIndexOf(".")),pn.add(this.options.textNodeName,Et),this.addChild(k,pn,M,yo)}else{if(Te.length>0&&Te.lastIndexOf("/")===Te.length-1){if(J[J.length-1]==="/"?(J=J.substr(0,J.length-1),M=M.substr(0,M.length-1),Te=J):Te=Te.substr(0,Te.length-1),this.options.transformTagName){let pn=this.options.transformTagName(J);Te===J&&(Te=pn),J=pn}let Et=new f(J);J!==Te&&Rt&&(Et[":@"]=this.buildAttributesMap(Te,M,J)),this.addChild(k,Et,M,yo),M=M.substr(0,M.lastIndexOf("."))}else{let Et=new f(J);this.tagsNodeStack.push(k),J!==Te&&Rt&&(Et[":@"]=this.buildAttributesMap(Te,M,J)),this.addChild(k,Et,M,yo),k=Et}x="",B=go}}else x+=b[B];return C.child},"parseXml");function Oe(b,C,k,x){this.options.captureMetaData||(x=void 0);let M=this.options.updateTag(C.tagname,k,C[":@"]);M===!1||(typeof M=="string"&&(C.tagname=M),b.addChild(C,x))}i(Oe,"addChild"),n(Oe,"addChild");var Me=n(function(b,C,k){if(b.indexOf("&")===-1)return b;let x=this.options.processEntities;if(!x.enabled||x.allowedTags&&!x.allowedTags.includes(C)||x.tagFilter&&!x.tagFilter(C,k))return b;for(let M in this.docTypeEntities){let L=this.docTypeEntities[M],B=b.match(L.regx);if(B){if(this.entityExpansionCount+=B.length,x.maxTotalExpansions&&this.entityExpansionCount>x.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${x.maxTotalExpansions}`);let de=b.length;if(b=b.replace(L.regx,L.val),x.maxExpandedLength&&(this.currentExpandedLength+=b.length-de,this.currentExpandedLength>x.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${x.maxExpandedLength}`)}}if(b.indexOf("&")===-1)return b;for(let M in this.lastEntities){let L=this.lastEntities[M];b=b.replace(L.regex,L.val)}if(b.indexOf("&")===-1)return b;if(this.options.htmlEntities)for(let M in this.htmlEntities){let L=this.htmlEntities[M];b=b.replace(L.regex,L.val)}return b=b.replace(this.ampEntity.regex,this.ampEntity.val),b},"replaceEntitiesValue");function ve(b,C,k,x){return b&&(x===void 0&&(x=C.child.length===0),b=this.parseTextData(b,C.tagname,k,!1,C[":@"]?Object.keys(C[":@"]).length!==0:!1,x),b!==void 0&&b!==""&&C.add(this.options.textNodeName,b),b=""),b}i(ve,"saveTextToParentTag"),n(ve,"saveTextToParentTag");function ot(b,C,k,x){return!!(C&&C.has(x)||b&&b.has(k))}i(ot,"isItStopNode"),n(ot,"isItStopNode");function Pt(b,C,k=">"){let x,M="";for(let L=C;L<b.length;L++){let B=b[L];if(x)B===x&&(x="");else if(B==='"'||B==="'")x=B;else if(B===k[0])if(k[1]){if(b[L+1]===k[1])return{data:M,index:L}}else return{data:M,index:L};else B===" "&&(B=" ");M+=B}}i(Pt,"tagExpWithClosingIndex"),n(Pt,"tagExpWithClosingIndex");function pt(b,C,k,x){let M=b.indexOf(C,k);if(M===-1)throw new Error(x);return M+C.length-1}i(pt,"findClosingIndex"),n(pt,"findClosingIndex");function it(b,C,k,x=">"){let M=Pt(b,C+1,x);if(!M)return;let L=M.data,B=M.index,de=L.search(/\s/),Y=L,J=!0;de!==-1&&(Y=L.substring(0,de),L=L.substring(de+1).trimStart());let Fe=Y;if(k){let Te=Y.indexOf(":");Te!==-1&&(Y=Y.substr(Te+1),J=Y!==M.data.substr(Te+1))}return{tagName:Y,tagExp:L,closeIndex:B,attrExpPresent:J,rawTagName:Fe}}i(it,"readTagExp"),n(it,"readTagExp");function St(b,C,k){let x=k,M=1;for(;k<b.length;k++)if(b[k]==="<")if(b[k+1]==="/"){let L=pt(b,">",k,`${C} is not closed`);if(b.substring(k+2,L).trim()===C&&(M--,M===0))return{tagContent:b.substring(x,k),i:L};k=L}else if(b[k+1]==="?")k=pt(b,"?>",k+1,"StopNode is not closed.");else if(b.substr(k+1,3)==="!--")k=pt(b,"-->",k+3,"StopNode is not closed.");else if(b.substr(k+1,2)==="![")k=pt(b,"]]>",k,"StopNode is not closed.")-2;else{let L=it(b,k,">");L&&((L&&L.tagName)===C&&L.tagExp[L.tagExp.length-1]!=="/"&&M++,k=L.closeIndex)}}i(St,"readStopNodeData"),n(St,"readStopNodeData");function At(b,C,k){if(C&&typeof b=="string"){let x=b.trim();return x==="true"?!0:x==="false"?!1:_(b,k)}else return h(b)?b:""}i(At,"parseValue"),n(At,"parseValue");function Wt(b,C,k){let x=Number.parseInt(b,C);return x>=0&&x<=1114111?String.fromCodePoint(x):k+b+";"}i(Wt,"fromCodePoint"),n(Wt,"fromCodePoint");var Dn=f.getMetaDataSymbol();function Zt(b,C){return Dt(b,C)}i(Zt,"prettify"),n(Zt,"prettify");function Dt(b,C,k){let x,M={};for(let L=0;L<b.length;L++){let B=b[L],de=Ut(B),Y="";if(k===void 0?Y=de:Y=k+"."+de,de===C.textNodeName)x===void 0?x=B[de]:x+=""+B[de];else{if(de===void 0)continue;if(B[de]){let J=Dt(B[de],C,Y),Fe=Qt(J,C);B[Dn]!==void 0&&(J[Dn]=B[Dn]),B[":@"]?Yt(J,B[":@"],Y,C):Object.keys(J).length===1&&J[C.textNodeName]!==void 0&&!C.alwaysCreateTextNode?J=J[C.textNodeName]:Object.keys(J).length===0&&(C.alwaysCreateTextNode?J[C.textNodeName]="":J=""),M[de]!==void 0&&M.hasOwnProperty(de)?(Array.isArray(M[de])||(M[de]=[M[de]]),M[de].push(J)):C.isArray(de,Y,Fe)?M[de]=[J]:M[de]=J}}}return typeof x=="string"?x.length>0&&(M[C.textNodeName]=x):x!==void 0&&(M[C.textNodeName]=x),M}i(Dt,"compress"),n(Dt,"compress");function Ut(b){let C=Object.keys(b);for(let k=0;k<C.length;k++){let x=C[k];if(x!==":@")return x}}i(Ut,"propName"),n(Ut,"propName");function Yt(b,C,k,x){if(C){let M=Object.keys(C),L=M.length;for(let B=0;B<L;B++){let de=M[B];x.isArray(de,k+"."+de,!0,!0)?b[de]=[C[de]]:b[de]=C[de]}}}i(Yt,"assignAttributes"),n(Yt,"assignAttributes");function Qt(b,C){let{textNodeName:k}=C,x=Object.keys(b).length;return!!(x===0||x===1&&(b[k]||typeof b[k]=="boolean"||b[k]===0))}i(Qt,"isLeafTag"),n(Qt,"isLeafTag");var An={allowBooleanAttributes:!1,unpairedTags:[]};function dn(b,C){C=Object.assign({},An,C);let k=[],x=!1,M=!1;b[0]==="\uFEFF"&&(b=b.substr(1));for(let L=0;L<b.length;L++)if(b[L]==="<"&&b[L+1]==="?"){if(L+=2,L=tn(b,L),L.err)return L}else if(b[L]==="<"){let B=L;if(L++,b[L]==="!"){L=Un(b,L);continue}else{let de=!1;b[L]==="/"&&(de=!0,L++);let Y="";for(;L<b.length&&b[L]!==">"&&b[L]!==" "&&b[L]!==" "&&b[L]!==`
|
|
367
367
|
`&&b[L]!=="\r";L++)Y+=b[L];if(Y=Y.trim(),Y[Y.length-1]==="/"&&(Y=Y.substring(0,Y.length-1),L--),!q(Y)){let Te;return Y.trim().length===0?Te="Invalid space after '<'.":Te="Tag '"+Y+"' is an invalid name.",ae("InvalidTag",Te,ut(b,L))}let J=Ie(b,L);if(J===!1)return ae("InvalidAttr","Attributes for '"+Y+"' have open quote.",ut(b,L));let Fe=J.value;if(L=J.index,Fe[Fe.length-1]==="/"){let Te=L-Fe.length;Fe=Fe.substring(0,Fe.length-1);let Rt=_e(Fe,C);if(Rt===!0)x=!0;else return ae(Rt.err.code,Rt.err.msg,ut(b,Te+Rt.err.line))}else if(de)if(J.tagClosed){if(Fe.trim().length>0)return ae("InvalidTag","Closing tag '"+Y+"' can't have attributes or invalid starting.",ut(b,B));if(k.length===0)return ae("InvalidTag","Closing tag '"+Y+"' has not been opened.",ut(b,B));{let Te=k.pop();if(Y!==Te.tagName){let Rt=ut(b,Te.tagStartPos);return ae("InvalidTag","Expected closing tag '"+Te.tagName+"' (opened in line "+Rt.line+", col "+Rt.col+") instead of closing tag '"+Y+"'.",ut(b,B))}k.length==0&&(M=!0)}}else return ae("InvalidTag","Closing tag '"+Y+"' doesn't have proper closing.",ut(b,L));else{let Te=_e(Fe,C);if(Te!==!0)return ae(Te.err.code,Te.err.msg,ut(b,L-Fe.length+Te.err.line));if(M===!0)return ae("InvalidXml","Multiple possible root nodes found.",ut(b,L));C.unpairedTags.indexOf(Y)!==-1||k.push({tagName:Y,tagStartPos:B}),x=!0}for(L++;L<b.length;L++)if(b[L]==="<")if(b[L+1]==="!"){L++,L=Un(b,L);continue}else if(b[L+1]==="?"){if(L=tn(b,++L),L.err)return L}else break;else if(b[L]==="&"){let Te=re(b,L);if(Te==-1)return ae("InvalidChar","char '&' is not expected.",ut(b,L));L=Te}else if(M===!0&&!En(b[L]))return ae("InvalidXml","Extra text at the end",ut(b,L));b[L]==="<"&&L--}}else{if(En(b[L]))continue;return ae("InvalidChar","char '"+b[L]+"' is not expected.",ut(b,L))}if(x){if(k.length==1)return ae("InvalidTag","Unclosed tag '"+k[0].tagName+"'.",ut(b,k[0].tagStartPos));if(k.length>0)return ae("InvalidXml","Invalid '"+JSON.stringify(k.map(L=>L.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return ae("InvalidXml","Start tag expected.",1);return!0}i(dn,"validate"),n(dn,"validate");function En(b){return b===" "||b===" "||b===`
|
|
368
368
|
`||b==="\r"}i(En,"isWhiteSpace"),n(En,"isWhiteSpace");function tn(b,C){let k=C;for(;C<b.length;C++)if(b[C]=="?"||b[C]==" "){let x=b.substr(k,C-k);if(C>5&&x==="xml")return ae("InvalidXml","XML declaration allowed only at the start of the document.",ut(b,C));if(b[C]=="?"&&b[C+1]==">"){C++;break}else continue}return C}i(tn,"readPI"),n(tn,"readPI");function Un(b,C){if(b.length>C+5&&b[C+1]==="-"&&b[C+2]==="-"){for(C+=3;C<b.length;C++)if(b[C]==="-"&&b[C+1]==="-"&&b[C+2]===">"){C+=2;break}}else if(b.length>C+8&&b[C+1]==="D"&&b[C+2]==="O"&&b[C+3]==="C"&&b[C+4]==="T"&&b[C+5]==="Y"&&b[C+6]==="P"&&b[C+7]==="E"){let k=1;for(C+=8;C<b.length;C++)if(b[C]==="<")k++;else if(b[C]===">"&&(k--,k===0))break}else if(b.length>C+9&&b[C+1]==="["&&b[C+2]==="C"&&b[C+3]==="D"&&b[C+4]==="A"&&b[C+5]==="T"&&b[C+6]==="A"&&b[C+7]==="["){for(C+=8;C<b.length;C++)if(b[C]==="]"&&b[C+1]==="]"&&b[C+2]===">"){C+=2;break}}return C}i(Un,"readCommentAndCDATA"),n(Un,"readCommentAndCDATA");var se='"',kn="'";function Ie(b,C){let k="",x="",M=!1;for(;C<b.length;C++){if(b[C]===se||b[C]===kn)x===""?x=b[C]:x!==b[C]||(x="");else if(b[C]===">"&&x===""){M=!0;break}k+=b[C]}return x!==""?!1:{value:k,index:C,tagClosed:M}}i(Ie,"readAttributeStr"),n(Ie,"readAttributeStr");var be=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function _e(b,C){let k=d(b,be),x={};for(let M=0;M<k.length;M++){if(k[M][1].length===0)return ae("InvalidAttr","Attribute '"+k[M][2]+"' has no space in starting.",jt(k[M]));if(k[M][3]!==void 0&&k[M][4]===void 0)return ae("InvalidAttr","Attribute '"+k[M][2]+"' is without value.",jt(k[M]));if(k[M][3]===void 0&&!C.allowBooleanAttributes)return ae("InvalidAttr","boolean attribute '"+k[M][2]+"' is not allowed.",jt(k[M]));let L=k[M][2];if(!Ae(L))return ae("InvalidAttr","Attribute '"+L+"' is an invalid name.",jt(k[M]));if(!x.hasOwnProperty(L))x[L]=1;else return ae("InvalidAttr","Attribute '"+L+"' is repeated.",jt(k[M]))}return!0}i(_e,"validateAttributeString"),n(_e,"validateAttributeString");function ue(b,C){let k=/\d/;for(b[C]==="x"&&(C++,k=/[\da-fA-F]/);C<b.length;C++){if(b[C]===";")return C;if(!b[C].match(k))break}return-1}i(ue,"validateNumberAmpersand"),n(ue,"validateNumberAmpersand");function re(b,C){if(C++,b[C]===";")return-1;if(b[C]==="#")return C++,ue(b,C);let k=0;for(;C<b.length;C++,k++)if(!(b[C].match(/\w/)&&k<20)){if(b[C]===";")break;return-1}return C}i(re,"validateAmpersand"),n(re,"validateAmpersand");function ae(b,C,k){return{err:{code:b,msg:C,line:k.line||k,col:k.col}}}i(ae,"getErrorObject"),n(ae,"getErrorObject");function Ae(b){return m(b)}i(Ae,"validateAttrName"),n(Ae,"validateAttrName");function q(b){return m(b)}i(q,"validateTagName"),n(q,"validateTagName");function ut(b,C){let k=b.substring(0,C).split(/\r?\n/);return{line:k.length,col:k[k.length-1].length+1}}i(ut,"getLineNumberForPosition"),n(ut,"getLineNumberForPosition");function jt(b){return b.startIndex+b[1].length}i(jt,"getPositionFromMatch"),n(jt,"getPositionFromMatch");var fo=class{static{i(this,"XMLParser")}static{n(this,"XMLParser")}constructor(b){this.externalEntities={},this.options=s(b)}parse(b,C){if(typeof b!="string"&&b.toString)b=b.toString();else if(typeof b!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(C){C===!0&&(C={});let M=dn(b,C);if(M!==!0)throw Error(`${M.err.msg}:${M.err.line}:${M.err.col}`)}let k=new $e(this.options);k.addExternalEntities(this.externalEntities);let x=k.parseXml(b);return this.options.preserveOrder||x===void 0?x:Zt(x,this.options)}addEntity(b,C){if(C.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(b.indexOf("&")!==-1||b.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(C==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[b]=C}static getMetaDataSymbol(){return f.getMetaDataSymbol()}};return new fo(t)},"getXmlParser");var WS=class extends So{static{i(this,"XmlToJsonOutboundPolicy")}static policyType="xml-to-json";parser;parseOnStatusCodes;constructor(e,n){super(e,n),ze(this.options,this.policyName).optional("removeNSPrefix","boolean").optional("ignoreProcessingInstructions","boolean").optional("ignoreDeclarations","boolean").optional("ignoreAttributes","boolean").optional("stopNodes","array").optional("attributeNamePrefix","string").optional("textNodeName","string").optional("trimValues","boolean"),this.parseOnStatusCodes=e.parseOnStatusCodes?eo(e.parseOnStatusCodes):void 0,this.parser=H_({removeNSPrefix:e?.removeNSPrefix??!0,ignorePiTags:e?.ignoreProcessingInstructions??!0,ignoreDeclaration:e?.ignoreDeclarations??!0,ignoreAttributes:e?.ignoreAttributes??!0,stopNodes:e?.stopNodes??[],attributeNamePrefix:e?.attributeNamePrefix??"@_",textNodeName:e?.textNodeName??"#text",trimValues:e?.trimValues??!0})}async handler(e,n,o){if(this.parseOnStatusCodes&&!this.parseOnStatusCodes.includes(e.status))return e;let r;try{let c=await e.text();r=this.parser.parse(c)}catch(c){let u=`XmlToJsonOutboundPolicy - Error parsing XML contents in policy '${this.policyName}'.`;throw o.log.error(u,c),new j(u)}let s=new Headers(e.headers);return s.set("content-type","application/json"),new Response(JSON.stringify(r),{status:e.status,statusText:e.statusText,headers:s})}};var YS=class{static{i(this,"ServiceProviderImpl")}services=new Map;addService(e,n){if(this.services.get(e))throw new De(`A service with the name ${e} already exists -- you cannot have duplicate services`);this.services.set(e,n)}getService(e){return this.services.get(e)}};var QS=class{static{i(this,"ApiKeyConsumerClient")}bucketId;cacheDurationSeconds;cacheNamePromise;constructor(e){this.bucketId=e?.bucketId,this.cacheDurationSeconds=e?.cacheDurationSeconds??60}getCacheName(e){return this.cacheNamePromise||(this.cacheNamePromise=Ze("zuplo-get-consumer",{bucketId:e})),this.cacheNamePromise}async get(e){Q("utility.get-consumer");let n=Mr(),o=this.bucketId??Je.ZUPLO_SERVICE_BUCKET_ID;if(!o)throw new I("ApiKeyConsumerClient - no bucketId provided and no default bucket is configured for this environment. Pass `bucketId` explicitly (find it in the Zuplo portal under Settings > API Key Buckets).");if(!o.startsWith("bckt_"))throw new I(`ApiKeyConsumerClient - bucketId "${o}" is not a valid bucket id. Bucket ids start with "bckt_" (e.g. "bckt_2HaK3odRyJle6NJSu8mzNKBC30BYxllxL"); a bucket name (e.g. "zprj-...-working-copy") is not accepted here. Find the bucket id in the Zuplo portal under Settings > API Key Buckets.`);if(!e||e.trim()==="")throw new I("ApiKeyConsumerClient.get - consumerId is required and cannot be empty");let r=await this.getCacheName(o),s=new Ve(r,n);if(this.cacheDurationSeconds>0){let l=await s.get(e);if(l)return l}let a=`/v2/key-auth/${encodeURIComponent(o)}/consumers/${encodeURIComponent(e)}`,c=await rh(a),u={id:c.id,name:c.name,createdOn:c.createdOn,updatedOn:c.updatedOn};return c.description!==void 0&&(u.description=c.description),c.metadata!==void 0&&(u.metadata=c.metadata),this.cacheDurationSeconds>0&&s.put(e,u,this.cacheDurationSeconds),u}};var F_=10,G_=3e4,Qu=class{static{i(this,"BackgroundLoader")}#e=new Map;#t;#o;#n;#r;#i={};constructor(e,n){if(typeof n=="number"){let o=n;this.#o=o*1e3,this.#r=G_,this.#n=F_}else{let o=n;this.#o=o.ttlSeconds*1e3,this.#r=o.loaderTimeoutSeconds?o.loaderTimeoutSeconds*1e3:G_,this.#n=F_}this.#t=e}#s(e){return e.expiry<=new Date}#a(e){let n=this.#i[e];return!(n===void 0||n===0)}#u(e){let n=this.#e.get(e);if(n&&!this.#s(n))return n.data}async get(e){let n=this.#u(e);if(n)return this.#l(e),n;if(this.#a(e))try{await DG(()=>this.#u(e)!==void 0||!this.#a(e),this.#r+this.#n+1,this.#n);let o=this.#u(e);if(o)return o}catch{}return this.#c(e)}#l(e){if(!this.#a(e)){let n=this.#c(e);er().waitUntil(n)}}async#c(e){try{this.#i[e]===void 0&&(this.#i[e]=0),this.#i[e]++;let n=await Promise.race([this.#t(e),scheduler.wait(this.#r)]);if(n===void 0)throw new I(`BackgroundLoader: Loader timed out after ${this.#r} ms.`);return this.#e.set(e,{data:n,expiry:new Date(Date.now()+this.#o)}),n}finally{this.#i[e]--}}};async function DG(t,e,n){let o=Date.now();for(;!t();){let r=Date.now()-o;if(r>e)throw new I(`BackgroundLoader: Timeout waiting for an on-going loader after ${r} ms.`);await scheduler.wait(n)}}i(DG,"waitUntilTrue");import{SpanStatusCode as B_,trace as UG}from"@opentelemetry/api";var Z_,V_=i(()=>(Z_??=UG.getTracer("pipeline"),Z_),"tracer"),J_=i(async(t,e,n)=>{let o=Xe.instance.routeData.policies,r=Oi([t],o);if(r.length===0)throw new j(`Invalid 'invokeInboundPolicy call' - no policy '${t}' found.`);let s=r[0];return await V_().startActiveSpan(`policy:${s.policyName}`,async c=>{try{ki(c,s);let u=await s.handler(e,n);if(u instanceof Request||u instanceof Le||u instanceof Response)return u instanceof Response||u instanceof Le?u:new Le(u);{let l=new I(`Invalid state - invalid handler on policy '${s.policyName}' invoked via 'invokeInboundPolicy' on route '${n.route.path}'. The result of an inbound policy must be a Response or Request.`);throw c.setStatus({code:B_.ERROR}),c.recordException(l),l}}finally{c.end()}})},"invokeInboundPolicy"),K_=i(async(t,e,n,o)=>{let r=Xe.instance.routeData.policies,s=qa([t],r);if(s.length===0)throw new j(`Invalid 'invokeOutboundPolicy call' - no policy '${t}' found.`);let a=s[0];return await V_().startActiveSpan(`policy:${a.policyName}`,async u=>{try{ki(u,a);let l=await a.handler(e,n,o);if(l instanceof Response)return l;{let d=new I(`Invalid state - invalid handler on policy '${a.policyName}' invoked via 'invokeOutboundPolicy' on route '${o.route.path}. The result of an outbound policy must be a Response.`);throw u.setStatus({code:B_.ERROR}),u.recordException(d),d}}finally{u.end()}})},"invokeOutboundPolicy");var jG="127.0.0.1";function W_(t){let e=E.instance,n=t.get(e.trustedIpHeader)?.trim();return n||(e.isLocalDevelopment?jG:void 0)}i(W_,"resolveClientIp");function HG(t){let e={};if(!t)return e;try{let n=t.split(","),o={};return n.forEach(r=>{let[s,a]=r.split("=");s&&a&&(o[s.trim()]=a.trim())}),o.asnum&&(e[Zl]=o.asnum),o.zip&&(e[Bl]=o.zip.split("+")[0]),o.dma&&(e[Vl]=o.dma),o.region_code&&(e[Jl]=o.region_code),o.timezone&&(e[Kl]=o.timezone),o.city&&(e[Ul]=o.city),o.continent&&(e[jl]=o.continent),o.country_code&&(e[Hl]=o.country_code),o.long&&(e[Fl]=o.long),o.lat&&(e[Gl]=o.lat),e}catch{return{}}}i(HG,"parseEdgeScapeHeader");function Y_(t,e){let n=HG(e);for(let[o,r]of Object.entries(n))t.has(o)||t.set(o,r)}i(Y_,"setZpHeadersFromAkamaiEdgeScapeHeader");var Dd=class{static{i(this,"HeaderIncomingRequestProperties")}#e;constructor(e){this.#e=e;let n=e.get(kR);if(n){let o=new Headers(e);Y_(o,n),this.#e=o}}get ip(){return W_(this.#e)}get asn(){try{let e=this.#e.get(Zl);if(typeof e=="string")return parseInt(e,10)}catch{}}get asOrganization(){return this.#e.get(vR)??void 0}get city(){return this.#e.get(iR)??this.#e.get(Ul)??void 0}get continent(){return this.#e.get(sR)??this.#e.get(jl)??void 0}get country(){return this.#e.get(aR)??this.#e.get(Hl)??void 0}get latitude(){return this.#e.get(uR)??this.#e.get(Gl)??void 0}get longitude(){return this.#e.get(cR)??this.#e.get(Fl)??void 0}get colo(){return this.#e.get(TR)??void 0}get postalCode(){return this.#e.get(mR)??this.#e.get(Bl)??void 0}get metroCode(){return this.#e.get(pR)??this.#e.get(Vl)??void 0}get region(){return this.#e.get(lR)??this.#e.get(PR)??void 0}get regionCode(){return this.#e.get(dR)??this.#e.get(Jl)??void 0}get timezone(){return this.#e.get(hR)??this.#e.get(Kl)??void 0}get httpProtocol(){return this.#e.get(AR)??void 0}get clientCert(){return this.#e.get(gR)??void 0}get clientMtlsVerificationStatus(){return this.#e.get(yR)??void 0}get clientMtlsVerificationReason(){return this.#e.get(bR)??void 0}get clientCertFingerprintSha256(){return this.#e.get(SR)??void 0}get clientCertNotBefore(){return this.#e.get(RR)??void 0}get clientCertNotAfter(){return this.#e.get(wR)??void 0}get clientCertIssuerDn(){return this.#e.get(CR)??void 0}get clientCertSubjectDn(){return this.#e.get(IR)??void 0}toJSON(){return{ip:this.ip,asn:this.asn,asOrganization:this.asOrganization,city:this.city,continent:this.continent,country:this.country,latitude:this.latitude,longitude:this.longitude,colo:this.colo,postalCode:this.postalCode,metroCode:this.metroCode,region:this.region,regionCode:this.regionCode,timezone:this.timezone,httpProtocol:this.httpProtocol,clientCert:this.clientCert,clientMtlsVerificationStatus:this.clientMtlsVerificationStatus,clientMtlsVerificationReason:this.clientMtlsVerificationReason,clientCertFingerprintSha256:this.clientCertFingerprintSha256,clientCertNotBefore:this.clientCertNotBefore,clientCertNotAfter:this.clientCertNotAfter,clientCertIssuerDn:this.clientCertIssuerDn,clientCertSubjectDn:this.clientCertSubjectDn}}};function Os(t){return{contextId:t.contextId,incomingRequestProperties:t.incomingRequestProperties,requestId:t.requestId,route:t.route,custom:t.custom,parentContext:t.parentContext,analyticsContext:t.analyticsContext}}i(Os,"createRewriteContext");var Ma=class extends Event{static{i(this,"ResponseSendingEvent")}constructor(e,n){super("responseSending"),this.request=e,this.mutableResponse=n}request;mutableResponse},La=class extends Event{static{i(this,"ResponseSentEvent")}constructor(e,n){super("responseSent"),this.request=e,this.response=n}request;response},lt=class t{static{i(this,"ZuploContextExtensions")}static#e=new WeakMap;static initialize(e,n){if(!t.#e.has(e)){let o=new t(n);return t.#e.set(e,o),o}throw new Error(`ZuploContextExtensions already initialized for context with requestId '${e.requestId}'`)}static getContextExtensions(e){let n=t.#e.get(e);if(!n)throw new j(`Invalid state, could not get ZuploContext extensions for context with requestId '${e.requestId}'`);return n}latestRequest;auditLogEventId="";#t;#o;#n;constructor(e){this.latestRequest=e,this.#t=[],this.#o=[],this.#n=[]}addResponseSendingHook(e){this.#o.push(e)}addResponseSendingFinalHook(e){this.#t.push(e)}addHandlerResponseHook(e){this.#n.push(e)}onResponseSendingFinal=i(async(e,n,o)=>{for(let r of this.#t)await r(e,n,o)},"onResponseSendingFinal");onResponseSending=i(async(e,n,o)=>{let r=e,s=E.instance.build.COMPATIBILITY_FLAGS.chainResponseSendingHooks;for(let a of this.#o)r=await a(s?r:e,n,o);return r},"onResponseSending");onHandlerResponse=i(async(e,n,o)=>{for(let r of this.#n)await r(e,n,o)},"onHandlerResponse")},Ud=class extends EventTarget{static{i(this,"SystemZuploContext")}constructor({logger:e,route:n,requestId:o,event:r,custom:s,incomingRequestProperties:a,parentContext:c}){super(),this.log=Object.freeze(e),this.route=n,this.requestId=o,this.custom=s,this.incomingRequestProperties=a,this.parentContext=c,this.#e=r,this.invokeInboundPolicy=(u,l)=>J_(u,l,this),this.contextId=crypto.randomUUID(),this.invokeOutboundPolicy=(u,l,d)=>K_(u,l,d,this),this.invokeRoute=async(u,l)=>{let d=u;typeof u=="string"&&u.startsWith("/")&&(d=new URL(u,"http://localhost"));let m=new Le(d,l);return Xe.instance.handleRequest(m,this,{parentContext:this})},this.waitUntil=u=>{this.#e.waitUntil(u)},this.addResponseSendingHook=u=>{lt.getContextExtensions(this).addResponseSendingHook(u)},this.addResponseSendingFinalHook=u=>{lt.getContextExtensions(this).addResponseSendingFinalHook(u)},this.analyticsContext=new LR(o),Object.freeze(this)}#e;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;invokeInboundPolicy;invokeOutboundPolicy;invokeRoute;waitUntil;addResponseSendingHook;addResponseSendingFinalHook;addEventListener(e,n,o){Q("context.addEventListener");let r=i(s=>{try{typeof n=="function"?n(s):n.handleEvent(s)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,r,o)}removeEventListener(e,n,o){Q("context.removeEventListener"),super.removeEventListener(e,n,o)}};export{Ri as a,Yn as b,kt as c,lx as d,dx as e,nh as f,mt as g,Ir as h,px as i,vr as j,Q as k,rh as l,sh as m,gn as n,Jo as o,Aa as p,Tr as q,$ as r,wt as s,Pr as t,ch as u,uh as v,nd as w,Ne as x,sn as y,pe as z,So as A,gh as B,wh as C,zx as D,vi as E,Ma as F,La as G,Qh as H,at as I,lI as J,dI as K,lL as L,yI as M,mf as N,SL as O,qr as P,Wa as Q,zr as R,Bi as S,ko as T,Oo as U,rr as V,$r as W,Eo as X,ft as Y,up as Z,Vi as _,Ji as $,Qa as aa,Xa as ba,Ki as ca,$t as da,ir as ea,gt as fa,Vt as ga,Ft as ha,Wi as ia,yt as ja,_o as ka,Yi as la,Qi as ma,Dr as na,Ur as oa,jr as pa,lp as qa,Xi as ra,ec as sa,es as ta,tc as ua,xo as va,ro as wa,Gn as xa,dp as ya,pp as za,nc as Aa,oc as Ba,ts as Ca,ns as Da,rc as Ea,ic as Fa,sc as Ga,ac as Ha,os as Ia,cc as Ja,uc as Ka,rs as La,lc as Ma,Mo as Na,Lo as Oa,is as Pa,ss as Qa,as as Ra,No as Sa,io as Ta,cs as Ua,dc as Va,pc as Wa,mc as Xa,hc as Ya,fc as Za,Hr as _a,gc as $a,yc as ab,bc as bb,Sc as cb,Rc as db,wc as eb,Cc as fb,Ic as gb,us as hb,vc as ib,Tc as jb,Pc as kb,Ac as lb,Ec as mb,kc as nb,Oc as ob,_c as pb,xc as qb,Mc as rb,Lc as sb,Nc as tb,qc as ub,zc as vb,Fr as wb,Gr as xb,Zr as yb,$c as zb,Dc as Ab,Uc as Bb,Br as Cb,jc as Db,Hc as Eb,Fc as Fb,Gc as Gb,Zc as Hb,ls as Ib,Bc as Jb,Vc as Kb,ds as Lb,mp as Mb,Jc as Nb,Kc as Ob,Wc as Pb,gf as Qb,qo as Rb,Yc as Sb,Qc as Tb,Xc as Ub,eu as Vb,tu as Wb,nu as Xb,ou as Yb,ru as Zb,iu as _b,or as $b,su as ac,au as bc,cu as cc,uu as dc,lu as ec,ps as fc,Vr as gc,Jr as hc,ms as ic,hs as jc,fs as kc,du as lc,gs as mc,ys as nc,pu as oc,mu as pc,bs as qc,Kr as rc,hu as sc,fu as tc,gu as uc,yu as vc,bu as wc,Su as xc,Ru as yc,wu as zc,Cu as Ac,Iu as Bc,vu as Cc,Tu as Dc,Pu as Ec,Au as Fc,Eu as Gc,hp as Hc,ku as Ic,zo as Jc,fp as Kc,Ou as Lc,gp as Mc,yp as Nc,bp as Oc,Sp as Pc,Rp as Qc,wp as Rc,Cp as Sc,Ip as Tc,vp as Uc,Tp as Vc,Pp as Wc,Ap as Xc,Ep as Yc,kp as Zc,Op as _c,_p as $c,_u as ad,xu as bd,xp as cd,Mp as dd,Lp as ed,Np as fd,Mu as gd,Lu as hd,qp as id,zp as jd,$p as kd,rT as ld,iT as md,sT as nd,aT as od,cT as pd,uT as qd,tg as rd,$z as sd,ng as td,rg as ud,sg as vd,ug as wd,dg as xd,mg as yd,fg as zd,yg as Ad,Rg as Bd,Ig as Cd,Pg as Dd,kg as Ed,_g as Fd,xg as Gd,Ju as Hd,Ku as Id,Wu as Jd,zg as Kd,Xu as Ld,Ug as Md,jg as Nd,S$ as Od,Hg as Pd,Fg as Qd,PT as Rd,AT as Sd,kT as Td,Kg as Ud,Qg as Vd,oy as Wd,iy as Xd,YT as Yd,tP as Zd,nP as _d,dP as $d,pP as ae,mP as be,hP as ce,SP as de,RP as ee,Ry as fe,IP as ge,gm as he,MD as ie,wy as je,Jt as ke,_P as le,Py as me,Ay as ne,LP as oe,Oy as pe,qP as qe,zP as re,$P as se,DP as te,UP as ue,jP as ve,VP as we,WP as xe,$y as ye,XP as ze,eA as Ae,tA as Be,pA as Ce,mA as De,hA as Ee,fA as Fe,RA as Ge,vA as He,TA as Ie,Tm as Je,FU as Ke,kA as Le,_A as Me,xA as Ne,mr as Oe,Gs as Pe,et as Qe,dt as Re,uo as Se,afe as Te,pl as Ue,dfe as Ve,pfe as We,Tn as Xe,ffe as Ye,gfe as Ze,yfe as _e,bfe as $e,ml as af,Sfe as bf,si as cf,vfe as df,km as ef,ai as ff,Bs as gf,yb as hf,qfe as if,bb as jf,Sb as kf,Rb as lf,wb as mf,Cb as nf,Ib as of,vb as pf,Tb as qf,Pb as rf,Ab as sf,Eb as tf,qye as uf,zn as vf,Pn as wf,It as xf,vE as yf,Xj as zf,e1 as Af,kb as Bf,tbe as Cf,nbe as Df,obe as Ef,$E as Ff,DE as Gf,Tbe as Hf,Pbe as If,Ob as Jf,fl as Kf,Nm as Lf,Abe as Mf,HE as Nf,_be as Of,gl as Pf,R1 as Qf,w1 as Rf,xb as Sf,Ube as Tf,BE as Uf,VE as Vf,Gbe as Wf,Zbe as Xf,Bbe as Yf,Vbe as Zf,JE as _f,KE as $f,YE as ag,lo as bg,Fo as cg,v1 as dg,T1 as eg,tSe as fg,nSe as gg,oSe as hg,rSe as ig,po as jg,k1 as kg,gSe as lg,ek as mg,PSe as ng,qb as og,_1 as pg,D1 as qg,j1 as rg,ok as sg,jSe as tg,HSe as ug,FSe as vg,ak as wg,VSe as xg,JSe as yg,KSe as zg,Hb as Ag,Dm as Bg,Fb as Cg,lk as Dg,rRe as Eg,iRe as Fg,sRe as Gg,aRe as Hg,sO as Ig,$n as Jg,iS as Kg,DRe as Lg,aO as Mg,URe as Ng,uS as Og,lS as Pg,pO as Qg,TF as Rg,yO as Sg,gS as Tg,AO as Ug,bS as Vg,qO as Wg,SS as Xg,wS as Yg,$O as Zg,DO as _g,UO as $g,vS as ah,PS as bh,VO as ch,JO as dh,KO as eh,WO as fh,YO as gh,XO as hh,kS as ih,BF as jh,r_ as kh,MS as lh,l_ as mh,d_ as nh,p_ as oh,iG as ph,m_ as qh,h_ as rh,f_ as sh,g_ as th,y_ as uh,zS as vh,S_ as wh,R_ as xh,$S as yh,DS as zh,I_ as Ah,T_ as Bh,P_ as Ch,HS as Dh,E_ as Eh,L_ as Fh,VS as Gh,JS as Hh,N_ as Ih,j_ as Jh,WS as Kh,YS as Lh,QS as Mh,Qu as Nh};
|
|
369
|
-
/*! For license information please see chunk-
|
|
370
|
-
//# sourceMappingURL=chunk-
|
|
369
|
+
/*! For license information please see chunk-3E6DNHTO.js.LEGAL.txt */
|
|
370
|
+
//# sourceMappingURL=chunk-3E6DNHTO.js.map
|