@zuplo/runtime 5.2152.0 → 5.2154.0

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.
Files changed (32) hide show
  1. package/{index.min.cjs → out/cjs/index.js} +1 -1
  2. package/{internal.min.cjs → out/cjs/internal/index.js} +1 -1
  3. package/{mocks.min.cjs → out/cjs/mocks/index.js} +1 -1
  4. package/out/cjs/policies/axiomatics-authz-inbound/exports.js +36 -0
  5. package/out/cjs/policies/axiomatics-authz-inbound/exports.js.LEGAL.txt +10 -0
  6. package/out/esm/chunk-4DUPDUSC.js +26 -0
  7. package/out/esm/chunk-CI735RIK.js +36 -0
  8. package/out/esm/chunk-CI735RIK.js.LEGAL.txt +10 -0
  9. package/out/esm/chunk-HPMPWPKQ.js +26 -0
  10. package/out/esm/chunk-HPMPWPKQ.js.LEGAL.txt +0 -0
  11. package/out/esm/chunk-QSL25HFO.js +26 -0
  12. package/out/esm/chunk-QSL25HFO.js.LEGAL.txt +0 -0
  13. package/out/esm/index.js +65 -0
  14. package/{index.min.js.LEGAL.txt → out/esm/index.js.LEGAL.txt} +0 -10
  15. package/out/esm/internal/index.js +26 -0
  16. package/out/esm/internal/index.js.LEGAL.txt +0 -0
  17. package/out/esm/mocks/index.js +26 -0
  18. package/out/esm/mocks/index.js.LEGAL.txt +0 -0
  19. package/out/esm/policies/axiomatics-authz-inbound/exports.js +26 -0
  20. package/out/esm/policies/axiomatics-authz-inbound/exports.js.LEGAL.txt +0 -0
  21. package/out/types/policies/axiomatics-authz-inbound/exports.d.ts +106 -0
  22. package/package.json +16 -24
  23. package/index.min.js +0 -75
  24. package/mocks.min.js +0 -26
  25. package/types-public.d.ts +0 -3796
  26. /package/{index.min.cjs.LEGAL.txt → out/cjs/index.js.LEGAL.txt} +0 -0
  27. /package/{internal.min.cjs.LEGAL.txt → out/cjs/internal/index.js.LEGAL.txt} +0 -0
  28. /package/{mocks.min.cjs.LEGAL.txt → out/cjs/mocks/index.js.LEGAL.txt} +0 -0
  29. /package/{mocks.min.js.LEGAL.txt → out/esm/chunk-4DUPDUSC.js.LEGAL.txt} +0 -0
  30. /package/{types-beta.d.ts → out/types/index.d.ts} +0 -0
  31. /package/{internal.d.ts → out/types/internal/index.d.ts} +0 -0
  32. /package/{mocks.d.ts → out/types/mocks/index.d.ts} +0 -0
@@ -72,4 +72,4 @@ Signature verification is impossible without access to the original signed mater
72
72
  `);let E=new k("!xml"),C=E,z="",L="";for(let N=0;N<w.length;N++)if(w[N]==="<")if(w[N+1]==="/"){let $=y(w,">",N,"Closing Tag is not closed."),D=w.substring(N+2,$).trim();if(this.options.removeNSPrefix){let Ce=D.indexOf(":");Ce!==-1&&(D=D.substr(Ce+1))}this.options.transformTagName&&(D=this.options.transformTagName(D)),C&&(z=this.saveTextToParentTag(z,C,L));let se=L.substring(L.lastIndexOf(".")+1);if(D&&this.options.unpairedTags.indexOf(D)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`);let re=0;se&&this.options.unpairedTags.indexOf(se)!==-1?(re=L.lastIndexOf(".",L.lastIndexOf(".")-1),this.tagsNodeStack.pop()):re=L.lastIndexOf("."),L=L.substring(0,re),C=this.tagsNodeStack.pop(),z="",N=$}else if(w[N+1]==="?"){let $=S(w,N,!1,"?>");if(!$)throw new Error("Pi Tag is not closed.");if(z=this.saveTextToParentTag(z,C,L),!(this.options.ignoreDeclaration&&$.tagName==="?xml"||this.options.ignorePiTags)){let D=new k($.tagName);D.add(this.options.textNodeName,""),$.tagName!==$.tagExp&&$.attrExpPresent&&(D[":@"]=this.buildAttributesMap($.tagExp,L,$.tagName)),this.addChild(C,D,L)}N=$.closeIndex+1}else if(w.substr(N+1,3)==="!--"){let $=y(w,"-->",N+4,"Comment is not closed.");if(this.options.commentPropName){let D=w.substring(N+4,$-2);z=this.saveTextToParentTag(z,C,L),C.add(this.options.commentPropName,[{[this.options.textNodeName]:D}])}N=$}else if(w.substr(N+1,2)==="!D"){let $=F(w,N);this.docTypeEntities=$.entities,N=$.i}else if(w.substr(N+1,2)==="!["){let $=y(w,"]]>",N,"CDATA is not closed.")-2,D=w.substring(N+9,$);z=this.saveTextToParentTag(z,C,L);let se=this.parseTextData(D,C.tagname,L,!0,!1,!0,!0);se==null&&(se=""),this.options.cdataPropName?C.add(this.options.cdataPropName,[{[this.options.textNodeName]:D}]):C.add(this.options.textNodeName,se),N=$+2}else{let $=S(w,N,this.options.removeNSPrefix),D=$.tagName,se=$.rawTagName,re=$.tagExp,Ce=$.attrExpPresent,vi=$.closeIndex;this.options.transformTagName&&(D=this.options.transformTagName(D)),C&&z&&C.tagname!=="!xml"&&(z=this.saveTextToParentTag(z,C,L,!1));let Si=C;if(Si&&this.options.unpairedTags.indexOf(Si.tagname)!==-1&&(C=this.tagsNodeStack.pop(),L=L.substring(0,L.lastIndexOf("."))),D!==E.tagname&&(L+=L?"."+D:D),this.isItStopNode(this.options.stopNodes,L,D)){let Se="";if(re.length>0&&re.lastIndexOf("/")===re.length-1)N=$.closeIndex;else if(this.options.unpairedTags.indexOf(D)!==-1)N=$.closeIndex;else{let _r=this.readStopNodeData(w,se,vi+1);if(!_r)throw new Error(`Unexpected end of ${se}`);N=_r.i,Se=_r.tagContent}let Ar=new k(D);D!==re&&Ce&&(Ar[":@"]=this.buildAttributesMap(re,L,D)),Se&&(Se=this.parseTextData(Se,D,L,!0,Ce,!0,!0)),L=L.substr(0,L.lastIndexOf(".")),Ar.add(this.options.textNodeName,Se),this.addChild(C,Ar,L)}else{if(re.length>0&&re.lastIndexOf("/")===re.length-1){D[D.length-1]==="/"?(D=D.substr(0,D.length-1),L=L.substr(0,L.length-1),re=D):re=re.substr(0,re.length-1),this.options.transformTagName&&(D=this.options.transformTagName(D));let Se=new k(D);D!==re&&Ce&&(Se[":@"]=this.buildAttributesMap(re,L,D)),this.addChild(C,Se,L),L=L.substr(0,L.lastIndexOf("."))}else{let Se=new k(D);this.tagsNodeStack.push(C),D!==re&&Ce&&(Se[":@"]=this.buildAttributesMap(re,L,D)),this.addChild(C,Se,L),C=Se}z="",N=vi}}else z+=w[N];return E.child},"parseXml");function U(w,E,C){let z=this.options.updateTag(E.tagname,C,E[":@"]);z===!1||(typeof z=="string"&&(E.tagname=z),w.addChild(E))}i(U,"addChild"),r(U,"addChild");var ue=r(function(w){if(this.options.processEntities){for(let E in this.docTypeEntities){let C=this.docTypeEntities[E];w=w.replace(C.regx,C.val)}for(let E in this.lastEntities){let C=this.lastEntities[E];w=w.replace(C.regex,C.val)}if(this.options.htmlEntities)for(let E in this.htmlEntities){let C=this.htmlEntities[E];w=w.replace(C.regex,C.val)}w=w.replace(this.ampEntity.regex,this.ampEntity.val)}return w},"replaceEntitiesValue");function K(w,E,C,z){return w&&(z===void 0&&(z=Object.keys(E.child).length===0),w=this.parseTextData(w,E.tagname,C,!1,E[":@"]?Object.keys(E[":@"]).length!==0:!1,z),w!==void 0&&w!==""&&E.add(this.options.textNodeName,w),w=""),w}i(K,"saveTextToParentTag"),r(K,"saveTextToParentTag");function Q(w,E,C){let z="*."+C;for(let L in w){let N=w[L];if(z===N||E===N)return!0}return!1}i(Q,"isItStopNode"),r(Q,"isItStopNode");function ve(w,E,C=">"){let z,L="";for(let N=E;N<w.length;N++){let ee=w[N];if(z)ee===z&&(z="");else if(ee==='"'||ee==="'")z=ee;else if(ee===C[0])if(C[1]){if(w[N+1]===C[1])return{data:L,index:N}}else return{data:L,index:N};else ee===" "&&(ee=" ");L+=ee}}i(ve,"tagExpWithClosingIndex"),r(ve,"tagExpWithClosingIndex");function y(w,E,C,z){let L=w.indexOf(E,C);if(L===-1)throw new Error(z);return L+E.length-1}i(y,"findClosingIndex"),r(y,"findClosingIndex");function S(w,E,C,z=">"){let L=ve(w,E+1,z);if(!L)return;let N=L.data,ee=L.index,$=N.search(/\s/),D=N,se=!0;$!==-1&&(D=N.substring(0,$),N=N.substring($+1).trimStart());let re=D;if(C){let Ce=D.indexOf(":");Ce!==-1&&(D=D.substr(Ce+1),se=D!==L.data.substr(Ce+1))}return{tagName:D,tagExp:N,closeIndex:ee,attrExpPresent:se,rawTagName:re}}i(S,"readTagExp"),r(S,"readTagExp");function V(w,E,C){let z=C,L=1;for(;C<w.length;C++)if(w[C]==="<")if(w[C+1]==="/"){let N=y(w,">",C,`${E} is not closed`);if(w.substring(C+2,N).trim()===E&&(L--,L===0))return{tagContent:w.substring(z,C),i:N};C=N}else if(w[C+1]==="?")C=y(w,"?>",C+1,"StopNode is not closed.");else if(w.substr(C+1,3)==="!--")C=y(w,"-->",C+3,"StopNode is not closed.");else if(w.substr(C+1,2)==="![")C=y(w,"]]>",C,"StopNode is not closed.")-2;else{let N=S(w,C,">");N&&((N&&N.tagName)===E&&N.tagExp[N.tagExp.length-1]!=="/"&&L++,C=N.closeIndex)}}i(V,"readStopNodeData"),r(V,"readStopNodeData");function ce(w,E,C){if(E&&typeof w=="string"){let z=w.trim();return z==="true"?!0:z==="false"?!1:Z(w,C)}else return H.isExist(w)?w:""}i(ce,"parseValue"),r(ce,"parseValue"),O.exports=j}}),p=o({"node_modules/fast-xml-parser/src/xmlparser/node2json.js"(P){"use strict";function O(j,R){return H(j,R)}i(O,"prettify"),r(O,"prettify");function H(j,R,M){let B,G={};for(let v=0;v<j.length;v++){let I=j[v],U=k(I),ue="";if(M===void 0?ue=U:ue=M+"."+U,U===R.textNodeName)B===void 0?B=I[U]:B+=""+I[U];else{if(U===void 0)continue;if(I[U]){let K=H(I[U],R,ue),Q=Z(K,R);I[":@"]?F(K,I[":@"],ue,R):Object.keys(K).length===1&&K[R.textNodeName]!==void 0&&!R.alwaysCreateTextNode?K=K[R.textNodeName]:Object.keys(K).length===0&&(R.alwaysCreateTextNode?K[R.textNodeName]="":K=""),G[U]!==void 0&&G.hasOwnProperty(U)?(Array.isArray(G[U])||(G[U]=[G[U]]),G[U].push(K)):R.isArray(U,ue,Q)?G[U]=[K]:G[U]=K}}}return typeof B=="string"?B.length>0&&(G[R.textNodeName]=B):B!==void 0&&(G[R.textNodeName]=B),G}i(H,"compress"),r(H,"compress");function k(j){let R=Object.keys(j);for(let M=0;M<R.length;M++){let B=R[M];if(B!==":@")return B}}i(k,"propName"),r(k,"propName");function F(j,R,M,B){if(R){let G=Object.keys(R),v=G.length;for(let I=0;I<v;I++){let U=G[I];B.isArray(U,M+"."+U,!0,!0)?j[U]=[R[U]]:j[U]=R[U]}}}i(F,"assignAttributes"),r(F,"assignAttributes");function Z(j,R){let{textNodeName:M}=R,B=Object.keys(j).length;return!!(B===0||B===1&&(j[M]||typeof j[M]=="boolean"||j[M]===0))}i(Z,"isLeafTag"),r(Z,"isLeafTag"),P.prettify=O}}),f=o({"node_modules/fast-xml-parser/src/validator.js"(P){"use strict";var O=a(),H={allowBooleanAttributes:!1,unpairedTags:[]};P.validate=function(y,S){S=Object.assign({},H,S);let V=[],ce=!1,w=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let E=0;E<y.length;E++)if(y[E]==="<"&&y[E+1]==="?"){if(E+=2,E=F(y,E),E.err)return E}else if(y[E]==="<"){let C=E;if(E++,y[E]==="!"){E=Z(y,E);continue}else{let z=!1;y[E]==="/"&&(z=!0,E++);let L="";for(;E<y.length&&y[E]!==">"&&y[E]!==" "&&y[E]!==" "&&y[E]!==`
73
73
  `&&y[E]!=="\r";E++)L+=y[E];if(L=L.trim(),L[L.length-1]==="/"&&(L=L.substring(0,L.length-1),E--),!K(L)){let $;return L.trim().length===0?$="Invalid space after '<'.":$="Tag '"+L+"' is an invalid name.",U("InvalidTag",$,Q(y,E))}let N=M(y,E);if(N===!1)return U("InvalidAttr","Attributes for '"+L+"' have open quote.",Q(y,E));let ee=N.value;if(E=N.index,ee[ee.length-1]==="/"){let $=E-ee.length;ee=ee.substring(0,ee.length-1);let D=G(ee,S);if(D===!0)ce=!0;else return U(D.err.code,D.err.msg,Q(y,$+D.err.line))}else if(z)if(N.tagClosed){if(ee.trim().length>0)return U("InvalidTag","Closing tag '"+L+"' can't have attributes or invalid starting.",Q(y,C));{let $=V.pop();if(L!==$.tagName){let D=Q(y,$.tagStartPos);return U("InvalidTag","Expected closing tag '"+$.tagName+"' (opened in line "+D.line+", col "+D.col+") instead of closing tag '"+L+"'.",Q(y,C))}V.length==0&&(w=!0)}}else return U("InvalidTag","Closing tag '"+L+"' doesn't have proper closing.",Q(y,E));else{let $=G(ee,S);if($!==!0)return U($.err.code,$.err.msg,Q(y,E-ee.length+$.err.line));if(w===!0)return U("InvalidXml","Multiple possible root nodes found.",Q(y,E));S.unpairedTags.indexOf(L)!==-1||V.push({tagName:L,tagStartPos:C}),ce=!0}for(E++;E<y.length;E++)if(y[E]==="<")if(y[E+1]==="!"){E++,E=Z(y,E);continue}else if(y[E+1]==="?"){if(E=F(y,++E),E.err)return E}else break;else if(y[E]==="&"){let $=I(y,E);if($==-1)return U("InvalidChar","char '&' is not expected.",Q(y,E));E=$}else if(w===!0&&!k(y[E]))return U("InvalidXml","Extra text at the end",Q(y,E));y[E]==="<"&&E--}}else{if(k(y[E]))continue;return U("InvalidChar","char '"+y[E]+"' is not expected.",Q(y,E))}if(ce){if(V.length==1)return U("InvalidTag","Unclosed tag '"+V[0].tagName+"'.",Q(y,V[0].tagStartPos));if(V.length>0)return U("InvalidXml","Invalid '"+JSON.stringify(V.map(E=>E.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return U("InvalidXml","Start tag expected.",1);return!0};function k(y){return y===" "||y===" "||y===`
74
74
  `||y==="\r"}i(k,"isWhiteSpace"),r(k,"isWhiteSpace");function F(y,S){let V=S;for(;S<y.length;S++)if(y[S]=="?"||y[S]==" "){let ce=y.substr(V,S-V);if(S>5&&ce==="xml")return U("InvalidXml","XML declaration allowed only at the start of the document.",Q(y,S));if(y[S]=="?"&&y[S+1]==">"){S++;break}else continue}return S}i(F,"readPI"),r(F,"readPI");function Z(y,S){if(y.length>S+5&&y[S+1]==="-"&&y[S+2]==="-"){for(S+=3;S<y.length;S++)if(y[S]==="-"&&y[S+1]==="-"&&y[S+2]===">"){S+=2;break}}else if(y.length>S+8&&y[S+1]==="D"&&y[S+2]==="O"&&y[S+3]==="C"&&y[S+4]==="T"&&y[S+5]==="Y"&&y[S+6]==="P"&&y[S+7]==="E"){let V=1;for(S+=8;S<y.length;S++)if(y[S]==="<")V++;else if(y[S]===">"&&(V--,V===0))break}else if(y.length>S+9&&y[S+1]==="["&&y[S+2]==="C"&&y[S+3]==="D"&&y[S+4]==="A"&&y[S+5]==="T"&&y[S+6]==="A"&&y[S+7]==="["){for(S+=8;S<y.length;S++)if(y[S]==="]"&&y[S+1]==="]"&&y[S+2]===">"){S+=2;break}}return S}i(Z,"readCommentAndCDATA"),r(Z,"readCommentAndCDATA");var j='"',R="'";function M(y,S){let V="",ce="",w=!1;for(;S<y.length;S++){if(y[S]===j||y[S]===R)ce===""?ce=y[S]:ce!==y[S]||(ce="");else if(y[S]===">"&&ce===""){w=!0;break}V+=y[S]}return ce!==""?!1:{value:V,index:S,tagClosed:w}}i(M,"readAttributeStr"),r(M,"readAttributeStr");var B=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function G(y,S){let V=O.getAllMatches(y,B),ce={};for(let w=0;w<V.length;w++){if(V[w][1].length===0)return U("InvalidAttr","Attribute '"+V[w][2]+"' has no space in starting.",ve(V[w]));if(V[w][3]!==void 0&&V[w][4]===void 0)return U("InvalidAttr","Attribute '"+V[w][2]+"' is without value.",ve(V[w]));if(V[w][3]===void 0&&!S.allowBooleanAttributes)return U("InvalidAttr","boolean attribute '"+V[w][2]+"' is not allowed.",ve(V[w]));let E=V[w][2];if(!ue(E))return U("InvalidAttr","Attribute '"+E+"' is an invalid name.",ve(V[w]));if(!ce.hasOwnProperty(E))ce[E]=1;else return U("InvalidAttr","Attribute '"+E+"' is repeated.",ve(V[w]))}return!0}i(G,"validateAttributeString"),r(G,"validateAttributeString");function v(y,S){let V=/\d/;for(y[S]==="x"&&(S++,V=/[\da-fA-F]/);S<y.length;S++){if(y[S]===";")return S;if(!y[S].match(V))break}return-1}i(v,"validateNumberAmpersand"),r(v,"validateNumberAmpersand");function I(y,S){if(S++,y[S]===";")return-1;if(y[S]==="#")return S++,v(y,S);let V=0;for(;S<y.length;S++,V++)if(!(y[S].match(/\w/)&&V<20)){if(y[S]===";")break;return-1}return S}i(I,"validateAmpersand"),r(I,"validateAmpersand");function U(y,S,V){return{err:{code:y,msg:S,line:V.line||V,col:V.col}}}i(U,"getErrorObject"),r(U,"getErrorObject");function ue(y){return O.isName(y)}i(ue,"validateAttrName"),r(ue,"validateAttrName");function K(y){return O.isName(y)}i(K,"validateTagName"),r(K,"validateTagName");function Q(y,S){let V=y.substring(0,S).split(/\r?\n/);return{line:V.length,col:V[V.length-1].length+1}}i(Q,"getLineNumberForPosition"),r(Q,"getLineNumberForPosition");function ve(y){return y.startIndex+y[1].length}i(ve,"getPositionFromMatch"),r(ve,"getPositionFromMatch")}}),h=o({"node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(P,O){var{buildOptions:H}=s(),k=d(),{prettify:F}=p(),Z=f(),j=class{static{i(this,"XMLParser")}static{r(this,"XMLParser")}constructor(R){this.externalEntities={},this.options=H(R)}parse(R,M){if(typeof R!="string")if(R.toString)R=R.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(M){M===!0&&(M={});let v=Z.validate(R,M);if(v!==!0)throw Error(`${v.err.msg}:${v.err.line}:${v.err.col}`)}let B=new k(this.options);B.addExternalEntities(this.externalEntities);let G=B.parseXml(R);return this.options.preserveOrder||G===void 0?G:F(G,this.options)}addEntity(R,M){if(M.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(R.indexOf("&")!==-1||R.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(M==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[R]=M}};O.exports=j}});let A=h();return new A(n)},"getXmlParser");var Er=class extends qe{static{i(this,"XmlToJsonOutboundPolicy")}parser;parseOnStatusCodes;constructor(e,t){super(e,t),oe(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?yt(e.parseOnStatusCodes):void 0,this.parser=Qu({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,t,r){if(this.parseOnStatusCodes&&!this.parseOnStatusCodes.includes(e.status))return e;let o;try{let u=await e.text();o=this.parser.parse(u)}catch(u){let c=`XmlToJsonOutboundPolicy - Error parsing XML contents in policy '${this.policyName}'.`;throw r.log.error(c,u),new _(c)}let s=new Headers(e.headers);return s.set("content-type","application/json"),new Response(JSON.stringify(o),{status:e.status,statusText:e.statusText,headers:s})}};var Ir=class{static{i(this,"ServiceProviderImpl")}services=new Map;addService(e,t){if(this.services.get(e))throw new X(`A service with the name ${e} already exists -- you cannot have duplicate services`);this.services.set(e,t)}getService(e){return this.services.get(e)}};var xr=class{static{i(this,"BackgroundDispatcher")}#e;constructor(e,t){if(!t||t.msDelay===void 0)throw new Error("BackgroundDispatcher: options.msDelay is required");this.#e=new Y(t.name??"",t.msDelay,e)}enqueue=e=>{this.#e.enqueue(e),Dn().waitUntil(this.#e.waitUntilFlushed())}};var ec=10,tc=3e4,Tr=class{static{i(this,"BackgroundLoader")}#e=new Map;#t;#n;#r;#o;#i={};constructor(e,t){if(typeof t=="number"){let r=t;this.#n=r*1e3,this.#o=tc,this.#r=ec}else{let r=t;this.#n=r.ttlSeconds*1e3,this.#o=r.loaderTimeoutSeconds?r.loaderTimeoutSeconds*1e3:tc,this.#r=ec}this.#t=e}#s(e){return e.expiry<=new Date}#a(e){let t=this.#i[e];return!(t===void 0||t===0)}#u(e){let t=this.#e.get(e);if(t&&!this.#s(t))return t.data}async get(e){let t=this.#u(e);if(t)return this.#l(e),t;if(this.#a(e))try{await Pp(()=>this.#u(e)!==void 0||!this.#a,this.#o+this.#r+1,this.#r);let r=this.#u(e);if(r)return r}catch{}return this.#c(e)}#l(e){if(!this.#a(e)){let t=this.#c(e);Dn().waitUntil(t)}}async#c(e){try{this.#i[e]===void 0&&(this.#i[e]=0),this.#i[e]++;let t=await Promise.race([this.#t(e),scheduler.wait(this.#o)]);if(t===void 0)throw new Error(`BackgroundLoader: Loader timed out after ${this.#o} ms.`);return this.#e.set(e,{data:t,expiry:new Date(Date.now()+this.#n)}),t}finally{this.#i[e]--}}};async function Pp(n,e,t){let r=Date.now();for(;!n();){let o=Date.now()-r;if(o>e)throw new Error(`BackgroundLoader: Timeout waiting for an on-going loader after ${o} ms.`);await scheduler.wait(t)}}i(Pp,"waitUntilTrue");var Ti=["sha-1","sha-256","sha-384","sha-512"],vr=class{static{i(this,"BaseCryptoBeta")}};var Sr=class extends vr{static{i(this,"WorkerCryptoBeta")}async digest(e,t){if(!Ti.includes(e.toLowerCase()))throw new _(`Algorithm ${e} is not supported. Try using ${Ti.join(", ")}`);let r=new TextEncoder().encode(t),o=await crypto.subtle.digest(e,r);return Array.from(new Uint8Array(o)).map(u=>u.toString(16).padStart(2,"0")).join("")}};var Or=class{constructor(e){this.context=e}static{i(this,"BaseKeyValueStore")}};var Cr=class extends Or{static{i(this,"WorkerKeyValueStore")}#e;constructor(e){super(e);let t=g.instance.runtime.ZUPLO_KV;if(!t)throw new an("The Key Value Store feature is not enabled for this project.");this.#e=t}put(e,t,r){if(typeof e!="string")throw new m("value must be of type string");return this.#e.put(e,t,r?{expirationTtl:r.expirationSecondsTtl}:void 0)}get(e,t){return this.#e.get(e,{type:"text",cacheTtl:t?.cacheSecondsTtl})}delete(e){return this.#e.delete(e)}};
75
- /*! For license information please see index.min.cjs.LEGAL.txt */
75
+ /*! For license information please see index.js.LEGAL.txt */
@@ -23,4 +23,4 @@
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
25
  "use strict";var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var r=(e,t)=>u(e,"name",{value:t,configurable:!0});var h=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})},R=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of E(t))!P.call(e,s)&&s!==n&&u(e,s,{get:()=>t[s],enumerable:!(i=f(t,s))||i.enumerable});return e};var I=e=>R(u({},"__esModule",{value:!0}),e);var T={};h(T,{getIdForParameterSchema:()=>p,getIdForRefSchema:()=>O,getIdForRequestBodySchema:()=>L,getRawOperationDataIdentifierName:()=>m,isRestrictedEnvVariableName:()=>l,isZuploReadableEnvVariableName:()=>g,sanitizedIdentifierName:()=>a});module.exports=I(T);var _="2024-03-14",d=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function c(){return new o({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:_,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,COMPATIBILITY_FLAGS:d[_]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}r(c,"getMockEnvironment");var o=class e{static{r(this,"Environment")}config;static#e;static#t=!1;static initialize(t){this.#e||(this.#e=new e(t),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=c()),this.#e}constructor({build:t,runtime:n}){let i;try{if(n.__ZUPLO_CONFIG){let s=atob(n.__ZUPLO_CONFIG);i=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=i??{},this.build=t,this.runtime=n,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.ENVIRONMENT_TYPE?this.build.ENVIRONMENT_TYPE==="LOCAL_DEVELOPMENT":!1}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};var U=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function l(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!U.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}r(l,"isRestrictedEnvVariableName");function g(e){return!!e.startsWith("ZUPLO_")}r(g,"isZuploReadableEnvVariableName");var x=new Proxy({},{get(e,t){let n=String(t);switch(n){case"ZUPLO_ENVIRONMENT_TYPE":return o.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return o.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return o.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return o.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return o.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return o.instance.build.BUILD_ID}if(!(l(n)&&!g(n)))return o.instance.runtime[n]}});function m(e,t,n){return`_${a(e+"_"+t+"_"+n)}`}r(m,"getRawOperationDataIdentifierName");function p(e,t,n,i){return`_${a(e.toLowerCase())}_`+t.toLowerCase()+"_"+n.toLowerCase()+`_${i.toLowerCase()}`}r(p,"getIdForParameterSchema");function L(e,t,n){return`_${a(e.toLowerCase())}_`+t.toLowerCase()+`_rb_${a(n.toLowerCase())}`}r(L,"getIdForRequestBodySchema");function O(e,t){return`_${a(e)}__${a(t)}`}r(O,"getIdForRefSchema");function a(e){let t=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i>="0".charCodeAt(0)&&i<="9".charCodeAt(0)||i>="A".charCodeAt(0)&&i<="Z".charCodeAt(0)||i>="a".charCodeAt(0)&&i<="z".charCodeAt(0)?t.push(e.charAt(n)):t.push("_")}return t.join("")}r(a,"sanitizedIdentifierName");
26
- /*! For license information please see internal.min.cjs.LEGAL.txt */
26
+ /*! For license information please see index.js.LEGAL.txt */
@@ -23,4 +23,4 @@
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
25
  "use strict";var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var r=(n,e)=>u(n,"name",{value:e,configurable:!0});var c=(n,e)=>{for(var o in e)u(n,o,{get:e[o],enumerable:!0})},g=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!m.call(n,t)&&t!==o&&u(n,t,{get:()=>e[t],enumerable:!(i=l(e,t))||i.enumerable});return n};var v=n=>g(u({},"__esModule",{value:!0}),n);var E={};c(E,{MockZuploContext:()=>d,createMockContext:()=>R});module.exports=v(E);function R(n={request:new Request("https://api.example.com")}){let e=[];function o(s){e.push(Promise.resolve(s))}return r(o,"waitUntil"),{context:new d({event:{waitUntil:o},route:n.route}),invokeResponse:r(async()=>{await Promise.all(e)},"invokeResponse")}}r(R,"createMockContext");var f={path:"/",methods:["GET"],handler:{module:{},export:"default"},version:"none",raw:()=>({})},d=class extends EventTarget{static{r(this,"MockZuploContext")}#e;requestId;log;route;custom;incomingRequestProperties;constructor({event:e,route:o=f}){super(),this.requestId=crypto.randomUUID(),this.log={info:console.info,log:console.log,debug:console.debug,warn:console.warn,error:console.error},this.custom={},this.route=o,this.incomingRequestProperties={asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0},this.#e=e}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,i){let t=r(s=>{try{typeof o=="function"?o(s):o.handleEvent(s)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,t,i)}};
26
- /*! For license information please see mocks.min.cjs.LEGAL.txt */
26
+ /*! For license information please see index.js.LEGAL.txt */
@@ -0,0 +1,36 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ "use strict";var pe=Object.create;var O=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var n=(e,t)=>O(e,"name",{value:t,configurable:!0});var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ye=(e,t)=>{for(var i in t)O(e,i,{get:t[i],enumerable:!0})},H=(e,t,i,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of be(t))!Ee.call(e,s)&&s!==i&&O(e,s,{get:()=>t[s],enumerable:!(u=me(t,s))||u.enumerable});return e};var Oe=(e,t,i)=>(i=e!=null?pe(_e(e)):{},H(t||!e||!e.__esModule?O(i,"default",{value:e,enumerable:!0}):i,e)),Re=e=>H(O({},"__esModule",{value:!0}),e);var X=R(r=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.generateColor=r.colorFunctions=r.stripColor=r.bgRgb24=r.rgb24=r.bgRgb8=r.rgb8=r.bgBrightWhite=r.bgBrightCyan=r.bgBrightMagenta=r.bgBrightBlue=r.bgBrightYellow=r.bgBrightGreen=r.bgBrightRed=r.bgBrightBlack=r.bgWhite=r.bgCyan=r.bgMagenta=r.bgBlue=r.bgYellow=r.bgGreen=r.bgRed=r.bgBlack=r.brightWhite=r.brightCyan=r.brightMagenta=r.brightBlue=r.brightYellow=r.brightGreen=r.brightRed=r.brightBlack=r.gray=r.white=r.cyan=r.magenta=r.blue=r.yellow=r.green=r.red=r.black=r.strikethrough=r.hidden=r.inverse=r.underline=r.italic=r.dim=r.bold=r.reset=r.getColorEnabled=r.setColorEnabled=void 0;var j=!0,I=!j;function Le(e){j||(I=e)}n(Le,"setColorEnabled");r.setColorEnabled=Le;function Te(){return I}n(Te,"getColorEnabled");r.getColorEnabled=Te;function c(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}n(c,"code");function l(e,t){return I?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}n(l,"run");function Pe(e){return l(e,c([0],0))}n(Pe,"reset");r.reset=Pe;function we(e){return l(e,c([1],22))}n(we,"bold");r.bold=we;function Ce(e){return l(e,c([2],22))}n(Ce,"dim");r.dim=Ce;function Ne(e){return l(e,c([3],23))}n(Ne,"italic");r.italic=Ne;function Se(e){return l(e,c([4],24))}n(Se,"underline");r.underline=Se;function Ae(e){return l(e,c([7],27))}n(Ae,"inverse");r.inverse=Ae;function Ie(e){return l(e,c([8],28))}n(Ie,"hidden");r.hidden=Ie;function Ue(e){return l(e,c([9],29))}n(Ue,"strikethrough");r.strikethrough=Ue;function ve(e){return l(e,c([30],39))}n(ve,"black");r.black=ve;function F(e){return l(e,c([31],39))}n(F,"red");r.red=F;function G(e){return l(e,c([32],39))}n(G,"green");r.green=G;function Y(e){return l(e,c([33],39))}n(Y,"yellow");r.yellow=Y;function V(e){return l(e,c([34],39))}n(V,"blue");r.blue=V;function q(e){return l(e,c([35],39))}n(q,"magenta");r.magenta=q;function W(e){return l(e,c([36],39))}n(W,"cyan");r.cyan=W;function Me(e){return l(e,c([37],39))}n(Me,"white");r.white=Me;function Be(e){return J(e)}n(Be,"gray");r.gray=Be;function J(e){return l(e,c([90],39))}n(J,"brightBlack");r.brightBlack=J;function ze(e){return l(e,c([91],39))}n(ze,"brightRed");r.brightRed=ze;function xe(e){return l(e,c([92],39))}n(xe,"brightGreen");r.brightGreen=xe;function ke(e){return l(e,c([93],39))}n(ke,"brightYellow");r.brightYellow=ke;function Ze(e){return l(e,c([94],39))}n(Ze,"brightBlue");r.brightBlue=Ze;function $e(e){return l(e,c([95],39))}n($e,"brightMagenta");r.brightMagenta=$e;function De(e){return l(e,c([96],39))}n(De,"brightCyan");r.brightCyan=De;function He(e){return l(e,c([97],39))}n(He,"brightWhite");r.brightWhite=He;function je(e){return l(e,c([40],49))}n(je,"bgBlack");r.bgBlack=je;function Fe(e){return l(e,c([41],49))}n(Fe,"bgRed");r.bgRed=Fe;function Ge(e){return l(e,c([42],49))}n(Ge,"bgGreen");r.bgGreen=Ge;function Ye(e){return l(e,c([43],49))}n(Ye,"bgYellow");r.bgYellow=Ye;function Ve(e){return l(e,c([44],49))}n(Ve,"bgBlue");r.bgBlue=Ve;function qe(e){return l(e,c([45],49))}n(qe,"bgMagenta");r.bgMagenta=qe;function We(e){return l(e,c([46],49))}n(We,"bgCyan");r.bgCyan=We;function Je(e){return l(e,c([47],49))}n(Je,"bgWhite");r.bgWhite=Je;function Xe(e){return l(e,c([100],49))}n(Xe,"bgBrightBlack");r.bgBrightBlack=Xe;function Ke(e){return l(e,c([101],49))}n(Ke,"bgBrightRed");r.bgBrightRed=Ke;function Qe(e){return l(e,c([102],49))}n(Qe,"bgBrightGreen");r.bgBrightGreen=Qe;function et(e){return l(e,c([103],49))}n(et,"bgBrightYellow");r.bgBrightYellow=et;function tt(e){return l(e,c([104],49))}n(tt,"bgBrightBlue");r.bgBrightBlue=tt;function nt(e){return l(e,c([105],49))}n(nt,"bgBrightMagenta");r.bgBrightMagenta=nt;function rt(e){return l(e,c([106],49))}n(rt,"bgBrightCyan");r.bgBrightCyan=rt;function it(e){return l(e,c([107],49))}n(it,"bgBrightWhite");r.bgBrightWhite=it;function p(e,t=255,i=0){return Math.trunc(Math.max(Math.min(e,t),i))}n(p,"clampAndTruncate");function ot(e,t){return l(e,c([38,5,p(t)],39))}n(ot,"rgb8");r.rgb8=ot;function st(e,t){return l(e,c([48,5,p(t)],49))}n(st,"bgRgb8");r.bgRgb8=st;function ut(e,t){return typeof t=="number"?l(e,c([38,2,t>>16&255,t>>8&255,t&255],39)):l(e,c([38,2,p(t.r),p(t.g),p(t.b)],39))}n(ut,"rgb24");r.rgb24=ut;function ct(e,t){return typeof t=="number"?l(e,c([48,2,t>>16&255,t>>8&255,t&255],49)):l(e,c([48,2,p(t.r),p(t.g),p(t.b)],49))}n(ct,"bgRgb24");r.bgRgb24=ct;var lt=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"),"g");function at(e){return e.replace(lt,"")}n(at,"stripColor");r.stripColor=at;r.colorFunctions=[F,G,Y,V,q,W];function gt(e){let t=0,i=e.length,u=0;if(i>0)for(;u<i;)t=(t<<5)-t+e.charCodeAt(u++)|0;return t}n(gt,"hashCode");function ft(e){let t=Math.abs(gt(e));return r.colorFunctions[t%r.colorFunctions.length]}n(ft,"generateColor");r.generateColor=ft});var K=R(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.format=void 0;function dt(e,t,...i){let u=0,s=i.length,g=String(t).replace(/%[sdjoO%]/g,o=>{if(o==="%%")return"%";if(u>=s)return o;switch(o){case"%s":return String(i[u++]);case"%d":return Number(i[u++]).toString();case"%o":return e(i[u++]).split(`
26
+ `).map(a=>a.trim()).join(" ");case"%O":return e(i[u++]);case"%j":try{return JSON.stringify(i[u++])}catch{return"[Circular]"}default:return o}});for(let o of i.splice(u))o===null||!(typeof o=="object"&&o!==null)?g+=" "+o:g+=" "+e(o);return g}n(dt,"format");T.format=dt});var ie=R(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.inspect=void 0;function _(e,t,i,u){let s={seen:[],stylize:ht,showHidden:t??!1,depth:i??2,colors:u??!1,customInspect:!0};return s.colors&&(s.stylize=mt),P(s,e,s.depth)}n(_,"inspect");w.inspect=_;_.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};_.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function ht(e,t){return e}n(ht,"stylizeNoColor");function pt(e){return typeof e=="boolean"}n(pt,"isBoolean");function ee(e){return e===void 0}n(ee,"isUndefined");function mt(e,t){let i=_.styles[t];return i?"\x1B["+_.colors[i][0]+"m"+e+"\x1B["+_.colors[i][1]+"m":e}n(mt,"stylizeWithColor");function U(e){return typeof e=="function"}n(U,"isFunction");function te(e){return typeof e=="string"}n(te,"isString");function bt(e){return typeof e=="number"}n(bt,"isNumber");function ne(e){return e===null}n(ne,"isNull");function re(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n(re,"hasOwn");function v(e){return x(e)&&k(e)==="[object RegExp]"}n(v,"isRegExp");function x(e){return typeof e=="object"&&e!==null}n(x,"isObject");function M(e){return x(e)&&(k(e)==="[object Error]"||e instanceof Error)}n(M,"isError");function Q(e){return x(e)&&k(e)==="[object Date]"}n(Q,"isDate");function k(e){return Object.prototype.toString.call(e)}n(k,"objectToString");function _t(e){let t={};return e.forEach(function(i,u){t[i]=!0}),t}n(_t,"arrayToHash");function Et(e,t,i,u,s){let g=[];for(let o=0,a=t.length;o<a;++o)re(t,String(o))?g.push(z(e,t,i,u,String(o),!0)):g.push("");return s.forEach(function(o){o.match(/^\d+$/)||g.push(z(e,t,i,u,o,!0))}),g}n(Et,"formatArray");function B(e){return"["+Error.prototype.toString.call(e)+"]"}n(B,"formatError");function P(e,t,i){if(e.customInspect&&t&&U(t.inspect)&&t.inspect!==_&&!(t.constructor&&t.constructor.prototype===t)){let d=t.inspect(i,e);return te(d)||(d=P(e,d,i)),d}let u=yt(e,t);if(u)return u;let s=Object.keys(t),g=_t(s);try{e.showHidden&&Object.getOwnPropertyNames&&(s=Object.getOwnPropertyNames(t))}catch{}if(M(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return B(t);if(s.length===0){if(U(t)){let d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Q(t))return e.stylize(Date.prototype.toString.call(t),"date");if(M(t))return B(t)}let o="",a=!1,f=["{","}"];if(Array.isArray(t)&&(a=!0,f=["[","]"]),U(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),v(t)&&(o=" "+RegExp.prototype.toString.call(t)),Q(t)&&(o=" "+Date.prototype.toUTCString.call(t)),M(t)&&(o=" "+B(t)),s.length===0&&(!a||t.length==0))return f[0]+o+f[1];if(i<0)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);let h;return a?h=Et(e,t,i,g,s):h=s.map(function(d){return z(e,t,i,g,d,a)}),e.seen.pop(),Ot(h,o,f)}n(P,"formatValue");function z(e,t,i,u,s,g){let o,a,f;f={value:void 0};try{f.value=t[s]}catch{}try{Object.getOwnPropertyDescriptor&&(f=Object.getOwnPropertyDescriptor(t,s)||f)}catch{}if(f.get?f.set?a=e.stylize("[Getter/Setter]","special"):a=e.stylize("[Getter]","special"):f.set&&(a=e.stylize("[Setter]","special")),re(u,s)||(o="["+s+"]"),a||(e.seen.indexOf(f.value)<0?(ne(i)?a=P(e,f.value,null):a=P(e,f.value,i-1),a.indexOf(`
27
+ `)>-1&&(g?a=a.split(`
28
+ `).map(function(h){return" "+h}).join(`
29
+ `).substr(2):a=`
30
+ `+a.split(`
31
+ `).map(function(h){return" "+h}).join(`
32
+ `))):a=e.stylize("[Circular]","special")),ee(o)){if(g&&s.match(/^\d+$/))return a;o=JSON.stringify(""+s),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}n(z,"formatProperty");function yt(e,t){if(ee(t))return e.stylize("undefined","undefined");if(te(t)){let i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string")}if(bt(t))return e.stylize(""+t,"number");if(pt(t))return e.stylize(""+t,"boolean");if(ne(t))return e.stylize("null","null")}n(yt,"formatPrimitive");function Ot(e,t,i){let u=0;return e.reduce(function(g,o){return u++,o.indexOf(`
33
+ `)>=0&&u++,g+o.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(t===""?"":t+`
34
+ `)+" "+e.join(`,
35
+ `)+" "+i[1]:i[0]+t+" "+e.join(", ")+" "+i[1]}n(Ot,"reduceToSingleString")});var oe=R(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.format=void 0;var Rt=K(),Lt=ie(),Tt=n((e,...t)=>(0,Rt.format)(Lt.inspect,e,t),"format");C.format=Tt});var ue=R(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.debug=m.withoutEnv=m.Debugger=void 0;var Pt=X(),wt=oe(),N=class{static{n(this,"Debugger")}manager;ns;color;last;enabled;constructor(t,i){this.manager=t,this.ns=i,this.color=(0,Pt.generateColor)(i),this.last=0,this.enabled=t.enabled.some(u=>u.test(i))}log(...t){if(!this.enabled)return;let i,u=t[0];typeof u=="function"?i=u():i=String(u);let s=Date.now()-(this.last||Date.now());i=(0,wt.format)(i,...t);let g=`${this.color(this.ns)} ${i} ${this.color(`+${s}ms`)}`;console.log(g),this.last=Date.now()}};m.Debugger=N;var S=class{static{n(this,"DebugManager")}debuggers;enabled;constructor(t){this.debuggers=new Map,this.enabled=t??[]}};function se(e){return!e||e.length===0?[]:(e=e.replace(/\s/g,"").replace(/\*/g,".+"),e.split(",").map(t=>new RegExp(`^${t}$`)))}n(se,"extract");var L;function Ct(e){e||(e=[]),typeof e=="string"&&(e=se(e)),L=new S(e)}n(Ct,"withoutEnv");m.withoutEnv=Ct;function Nt(e){let t=globalThis.DEBUG;L||(L=new S(se(t)));let i=new N(L,e);return L.debuggers.set(e,i),Object.assign(i.log.bind(i),{self:i})}n(Nt,"debug");m.debug=Nt});var Mt={};ye(Mt,{PdpService:()=>D});module.exports=Re(Mt);var ge=Oe(ue());var E=class extends Error{static{n(this,"RuntimeError")}extensionMembers;constructor(t,i){typeof t=="string"?super(t,i):(super(t.message,i),this.extensionMembers=t.extensionMembers),this.name="RuntimeError"}};var Z="2024-03-14",ce=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function le(){return new b({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:Z,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,COMPATIBILITY_FLAGS:ce[Z]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}n(le,"getMockEnvironment");var b=class e{static{n(this,"Environment")}config;static#e;static#t=!1;static initialize(t){this.#e||(this.#e=new e(t),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=le()),this.#e}constructor({build:t,runtime:i}){let u;try{if(i.__ZUPLO_CONFIG){let s=atob(i.__ZUPLO_CONFIG);u=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=u??{},this.build=t,this.runtime=i,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.ENVIRONMENT_TYPE?this.build.ENVIRONMENT_TYPE==="LOCAL_DEVELOPMENT":!1}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};var y=(0,ge.debug)("zuplo:runtime:external-service");function St(){let e,{__ZUPLO_EXTERNAL_SERVICE_TOKEN:t}=b.instance.runtime;if(t&&t!=="undefined")try{let i=atob(t);e=JSON.parse(i)}catch{}return e}n(St,"getServiceAuth");async function fe(e,t){let i=St();if(i)if(y(`Using external service auth. ClientId: ${i.clientId})`),typeof e=="string"){let u=new URL(e),s=u.hostname,g=t??{},o=new Headers(g.headers||{});o.set("CF-Access-Client-Id",i.clientId),o.set("CF-Access-Client-Secret",i.clientSecret),g.headers=o;let a;if(i.customServiceMapping&&i.customServiceMapping[s])a=`https://${i.customServiceMapping[s]}`;else if(b.instance.useLegacyServiceRouting)a=`https://${s}.zuptunnel.com`;else{y("Using sha256 service routing");let d=b.instance.build;if(d.ACCOUNT_NAME&&d.PROJECT_NAME&&d.ENVIRONMENT_TYPE)a=`https://${await At(s,d.ACCOUNT_NAME,d.PROJECT_NAME,d.ENVIRONMENT_TYPE)}.zuptunnel.com`;else throw y("Cannot use sha256 service routing, missing build variables"),new E("Failed to generate fully qualified tunnel url.")}let f=new URL(`${a}${u.pathname}${u.search}`);y(`Calling external service: ${f.toString()}`);let h=await A.fetch(f.toString(),g);if(h.status===403&&h.headers.get("cf-access-domain")!==null)throw console.error("403 Forbidden when calling external service.",{clientId:i.clientId,tunnelHost:a}),new E("Could not connect to secure tunnel.");return h}else throw y("Cannot call external service with Request object"),new E("Currently, we only support fetch(<some_string>, ...).");else throw y("There is no external service auth configured for this zup."),new E("There are no external services configured for this zup.")}n(fe,"externalServiceHandler");async function At(e,t,i,u){let s=e.toLowerCase(),g=t.toLowerCase(),o=i.toLowerCase(),a=It(u);y(`Hashing service name: ${g}-${s}.${g}-${o}-${a}`);let f=await ae(`${g}-${s}`),h=await ae(`${g}-${o}-${a}`);return`${f}.${h}`}n(At,"hashServiceName");async function ae(e){let t=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(g=>g.toString(16).padStart(2,"0")).join("").slice(0,-1)}n(ae,"hashSegment");function It(e){let t=e.toLowerCase();switch(t){case"production":case"preview":return t;default:return"working-copy"}}n(It,"sanitizeEnvironmentType");var he=new Map;he.set("service:",fe);var de=globalThis.fetch;function $(e,t){let i=Ut(t);if(typeof e=="string"){let u=new URL(e),s=he.get(u.protocol);return s?s(e,i):de(e,i)}else return de(e,i)}n($,"internalFetch");globalThis.fetch=$;var Ut=n(e=>{if(!e||e instanceof Request)return e;let t=e;if(!t.zuplo)return e;let i=e;return i.cf={cacheEverything:t.zuplo?.cacheEverything,cacheTtl:t.zuplo?.cacheTtlSeconds},delete e.zuplo,e},"transformInit");var vt={fetch:$},A=vt;var D=class{constructor(t){this.options=t;this.authHeader=`Bearer ${btoa(t.pdpUsername+":"+t.pdpPassword)}`,this.authorizationUrl=new URL("/authorize",t.pdpUrl).toString()}static{n(this,"PdpService")}authHeader;authorizationUrl;async makePdpRequest(t){let i=await A.fetch(this.authorizationUrl,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/xacml+json; charset=UTF-8",[this.options.tokenHeaderName??"Authorization"]:this.authHeader}});if(!i.ok)throw new Error(`Request to PDP service failed with response status ${i.status}.`);return await i.json()}};
36
+ /*! For license information please see exports.js.LEGAL.txt */
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Echos the value of a value. Trys to print the value out
3
+ * in the best way possible given the different types.
4
+ *
5
+ * @param {Object} obj The object to print out.
6
+ * @param {boolean} showHidden
7
+ * @param {number} depth
8
+ * @param {boolean} colors
9
+ * @license MIT (© Joyent)
10
+ */
@@ -0,0 +1,26 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>e(b,"name",{value:a,configurable:!0});var n=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var o=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c};
26
+ /*! For license information please see chunk-4DUPDUSC.js.LEGAL.txt */
@@ -0,0 +1,36 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ import{a as E}from"./chunk-HPMPWPKQ.js";import{a as r,b as R,c as he}from"./chunk-4DUPDUSC.js";var V=R(n=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.generateColor=n.colorFunctions=n.stripColor=n.bgRgb24=n.rgb24=n.bgRgb8=n.rgb8=n.bgBrightWhite=n.bgBrightCyan=n.bgBrightMagenta=n.bgBrightBlue=n.bgBrightYellow=n.bgBrightGreen=n.bgBrightRed=n.bgBrightBlack=n.bgWhite=n.bgCyan=n.bgMagenta=n.bgBlue=n.bgYellow=n.bgGreen=n.bgRed=n.bgBlack=n.brightWhite=n.brightCyan=n.brightMagenta=n.brightBlue=n.brightYellow=n.brightGreen=n.brightRed=n.brightBlack=n.gray=n.white=n.cyan=n.magenta=n.blue=n.yellow=n.green=n.red=n.black=n.strikethrough=n.hidden=n.inverse=n.underline=n.italic=n.dim=n.bold=n.reset=n.getColorEnabled=n.setColorEnabled=void 0;var F=!0,$=!F;function pe(e){F||($=e)}r(pe,"setColorEnabled");n.setColorEnabled=pe;function de(){return $}r(de,"getColorEnabled");n.getColorEnabled=de;function s(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}r(s,"code");function c(e,t){return $?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}r(c,"run");function be(e){return c(e,s([0],0))}r(be,"reset");n.reset=be;function me(e){return c(e,s([1],22))}r(me,"bold");n.bold=me;function ye(e){return c(e,s([2],22))}r(ye,"dim");n.dim=ye;function we(e){return c(e,s([3],23))}r(we,"italic");n.italic=we;function Re(e){return c(e,s([4],24))}r(Re,"underline");n.underline=Re;function Ce(e){return c(e,s([7],27))}r(Ce,"inverse");n.inverse=Ce;function Ee(e){return c(e,s([8],28))}r(Ee,"hidden");n.hidden=Ee;function Se(e){return c(e,s([9],29))}r(Se,"strikethrough");n.strikethrough=Se;function Oe(e){return c(e,s([30],39))}r(Oe,"black");n.black=Oe;function L(e){return c(e,s([31],39))}r(L,"red");n.red=L;function Y(e){return c(e,s([32],39))}r(Y,"green");n.green=Y;function D(e){return c(e,s([33],39))}r(D,"yellow");n.yellow=D;function G(e){return c(e,s([34],39))}r(G,"blue");n.blue=G;function J(e){return c(e,s([35],39))}r(J,"magenta");n.magenta=J;function W(e){return c(e,s([36],39))}r(W,"cyan");n.cyan=W;function Be(e){return c(e,s([37],39))}r(Be,"white");n.white=Be;function ze(e){return Z(e)}r(ze,"gray");n.gray=ze;function Z(e){return c(e,s([90],39))}r(Z,"brightBlack");n.brightBlack=Z;function Ae(e){return c(e,s([91],39))}r(Ae,"brightRed");n.brightRed=Ae;function Ne(e){return c(e,s([92],39))}r(Ne,"brightGreen");n.brightGreen=Ne;function Me(e){return c(e,s([93],39))}r(Me,"brightYellow");n.brightYellow=Me;function $e(e){return c(e,s([94],39))}r($e,"brightBlue");n.brightBlue=$e;function ve(e){return c(e,s([95],39))}r(ve,"brightMagenta");n.brightMagenta=ve;function xe(e){return c(e,s([96],39))}r(xe,"brightCyan");n.brightCyan=xe;function Te(e){return c(e,s([97],39))}r(Te,"brightWhite");n.brightWhite=Te;function _e(e){return c(e,s([40],49))}r(_e,"bgBlack");n.bgBlack=_e;function je(e){return c(e,s([41],49))}r(je,"bgRed");n.bgRed=je;function Ie(e){return c(e,s([42],49))}r(Ie,"bgGreen");n.bgGreen=Ie;function Pe(e){return c(e,s([43],49))}r(Pe,"bgYellow");n.bgYellow=Pe;function Ue(e){return c(e,s([44],49))}r(Ue,"bgBlue");n.bgBlue=Ue;function He(e){return c(e,s([45],49))}r(He,"bgMagenta");n.bgMagenta=He;function qe(e){return c(e,s([46],49))}r(qe,"bgCyan");n.bgCyan=qe;function ke(e){return c(e,s([47],49))}r(ke,"bgWhite");n.bgWhite=ke;function Fe(e){return c(e,s([100],49))}r(Fe,"bgBrightBlack");n.bgBrightBlack=Fe;function Le(e){return c(e,s([101],49))}r(Le,"bgBrightRed");n.bgBrightRed=Le;function Ye(e){return c(e,s([102],49))}r(Ye,"bgBrightGreen");n.bgBrightGreen=Ye;function De(e){return c(e,s([103],49))}r(De,"bgBrightYellow");n.bgBrightYellow=De;function Ge(e){return c(e,s([104],49))}r(Ge,"bgBrightBlue");n.bgBrightBlue=Ge;function Je(e){return c(e,s([105],49))}r(Je,"bgBrightMagenta");n.bgBrightMagenta=Je;function We(e){return c(e,s([106],49))}r(We,"bgBrightCyan");n.bgBrightCyan=We;function Ze(e){return c(e,s([107],49))}r(Ze,"bgBrightWhite");n.bgBrightWhite=Ze;function b(e,t=255,i=0){return Math.trunc(Math.max(Math.min(e,t),i))}r(b,"clampAndTruncate");function Ve(e,t){return c(e,s([38,5,b(t)],39))}r(Ve,"rgb8");n.rgb8=Ve;function Xe(e,t){return c(e,s([48,5,b(t)],49))}r(Xe,"bgRgb8");n.bgRgb8=Xe;function Ke(e,t){return typeof t=="number"?c(e,s([38,2,t>>16&255,t>>8&255,t&255],39)):c(e,s([38,2,b(t.r),b(t.g),b(t.b)],39))}r(Ke,"rgb24");n.rgb24=Ke;function Qe(e,t){return typeof t=="number"?c(e,s([48,2,t>>16&255,t>>8&255,t&255],49)):c(e,s([48,2,b(t.r),b(t.g),b(t.b)],49))}r(Qe,"bgRgb24");n.bgRgb24=Qe;var et=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"),"g");function tt(e){return e.replace(et,"")}r(tt,"stripColor");n.stripColor=tt;n.colorFunctions=[L,Y,D,G,J,W];function nt(e){let t=0,i=e.length,u=0;if(i>0)for(;u<i;)t=(t<<5)-t+e.charCodeAt(u++)|0;return t}r(nt,"hashCode");function rt(e){let t=Math.abs(nt(e));return n.colorFunctions[t%n.colorFunctions.length]}r(rt,"generateColor");n.generateColor=rt});var X=R(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.format=void 0;function it(e,t,...i){let u=0,a=i.length,g=String(t).replace(/%[sdjoO%]/g,o=>{if(o==="%%")return"%";if(u>=a)return o;switch(o){case"%s":return String(i[u++]);case"%d":return Number(i[u++]).toString();case"%o":return e(i[u++]).split(`
26
+ `).map(l=>l.trim()).join(" ");case"%O":return e(i[u++]);case"%j":try{return JSON.stringify(i[u++])}catch{return"[Circular]"}default:return o}});for(let o of i.splice(u))o===null||!(typeof o=="object"&&o!==null)?g+=" "+o:g+=" "+e(o);return g}r(it,"format");S.format=it});var re=R(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.inspect=void 0;function y(e,t,i,u){let a={seen:[],stylize:ot,showHidden:t??!1,depth:i??2,colors:u??!1,customInspect:!0};return a.colors&&(a.stylize=ct),O(a,e,a.depth)}r(y,"inspect");B.inspect=y;y.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};y.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function ot(e,t){return e}r(ot,"stylizeNoColor");function st(e){return typeof e=="boolean"}r(st,"isBoolean");function Q(e){return e===void 0}r(Q,"isUndefined");function ct(e,t){let i=y.styles[t];return i?"\x1B["+y.colors[i][0]+"m"+e+"\x1B["+y.colors[i][1]+"m":e}r(ct,"stylizeWithColor");function v(e){return typeof e=="function"}r(v,"isFunction");function ee(e){return typeof e=="string"}r(ee,"isString");function ut(e){return typeof e=="number"}r(ut,"isNumber");function te(e){return e===null}r(te,"isNull");function ne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(ne,"hasOwn");function x(e){return I(e)&&P(e)==="[object RegExp]"}r(x,"isRegExp");function I(e){return typeof e=="object"&&e!==null}r(I,"isObject");function T(e){return I(e)&&(P(e)==="[object Error]"||e instanceof Error)}r(T,"isError");function K(e){return I(e)&&P(e)==="[object Date]"}r(K,"isDate");function P(e){return Object.prototype.toString.call(e)}r(P,"objectToString");function at(e){let t={};return e.forEach(function(i,u){t[i]=!0}),t}r(at,"arrayToHash");function lt(e,t,i,u,a){let g=[];for(let o=0,l=t.length;o<l;++o)ne(t,String(o))?g.push(j(e,t,i,u,String(o),!0)):g.push("");return a.forEach(function(o){o.match(/^\d+$/)||g.push(j(e,t,i,u,o,!0))}),g}r(lt,"formatArray");function _(e){return"["+Error.prototype.toString.call(e)+"]"}r(_,"formatError");function O(e,t,i){if(e.customInspect&&t&&v(t.inspect)&&t.inspect!==y&&!(t.constructor&&t.constructor.prototype===t)){let h=t.inspect(i,e);return ee(h)||(h=O(e,h,i)),h}let u=gt(e,t);if(u)return u;let a=Object.keys(t),g=at(a);try{e.showHidden&&Object.getOwnPropertyNames&&(a=Object.getOwnPropertyNames(t))}catch{}if(T(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return _(t);if(a.length===0){if(v(t)){let h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(K(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return _(t)}let o="",l=!1,f=["{","}"];if(Array.isArray(t)&&(l=!0,f=["[","]"]),v(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),x(t)&&(o=" "+RegExp.prototype.toString.call(t)),K(t)&&(o=" "+Date.prototype.toUTCString.call(t)),T(t)&&(o=" "+_(t)),a.length===0&&(!l||t.length==0))return f[0]+o+f[1];if(i<0)return x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);let p;return l?p=lt(e,t,i,g,a):p=a.map(function(h){return j(e,t,i,g,h,l)}),e.seen.pop(),ft(p,o,f)}r(O,"formatValue");function j(e,t,i,u,a,g){let o,l,f;f={value:void 0};try{f.value=t[a]}catch{}try{Object.getOwnPropertyDescriptor&&(f=Object.getOwnPropertyDescriptor(t,a)||f)}catch{}if(f.get?f.set?l=e.stylize("[Getter/Setter]","special"):l=e.stylize("[Getter]","special"):f.set&&(l=e.stylize("[Setter]","special")),ne(u,a)||(o="["+a+"]"),l||(e.seen.indexOf(f.value)<0?(te(i)?l=O(e,f.value,null):l=O(e,f.value,i-1),l.indexOf(`
27
+ `)>-1&&(g?l=l.split(`
28
+ `).map(function(p){return" "+p}).join(`
29
+ `).substr(2):l=`
30
+ `+l.split(`
31
+ `).map(function(p){return" "+p}).join(`
32
+ `))):l=e.stylize("[Circular]","special")),Q(o)){if(g&&a.match(/^\d+$/))return l;o=JSON.stringify(""+a),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+l}r(j,"formatProperty");function gt(e,t){if(Q(t))return e.stylize("undefined","undefined");if(ee(t)){let i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string")}if(ut(t))return e.stylize(""+t,"number");if(st(t))return e.stylize(""+t,"boolean");if(te(t))return e.stylize("null","null")}r(gt,"formatPrimitive");function ft(e,t,i){let u=0;return e.reduce(function(g,o){return u++,o.indexOf(`
33
+ `)>=0&&u++,g+o.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(t===""?"":t+`
34
+ `)+" "+e.join(`,
35
+ `)+" "+i[1]:i[0]+t+" "+e.join(", ")+" "+i[1]}r(ft,"reduceToSingleString")});var ie=R(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.format=void 0;var ht=X(),pt=re(),dt=r((e,...t)=>(0,ht.format)(pt.inspect,e,t),"format");z.format=dt});var se=R(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.debug=m.withoutEnv=m.Debugger=void 0;var bt=V(),mt=ie(),A=class{static{r(this,"Debugger")}manager;ns;color;last;enabled;constructor(t,i){this.manager=t,this.ns=i,this.color=(0,bt.generateColor)(i),this.last=0,this.enabled=t.enabled.some(u=>u.test(i))}log(...t){if(!this.enabled)return;let i,u=t[0];typeof u=="function"?i=u():i=String(u);let a=Date.now()-(this.last||Date.now());i=(0,mt.format)(i,...t);let g=`${this.color(this.ns)} ${i} ${this.color(`+${a}ms`)}`;console.log(g),this.last=Date.now()}};m.Debugger=A;var N=class{static{r(this,"DebugManager")}debuggers;enabled;constructor(t){this.debuggers=new Map,this.enabled=t??[]}};function oe(e){return!e||e.length===0?[]:(e=e.replace(/\s/g,"").replace(/\*/g,".+"),e.split(",").map(t=>new RegExp(`^${t}$`)))}r(oe,"extract");var C;function yt(e){e||(e=[]),typeof e=="string"&&(e=oe(e)),C=new N(e)}r(yt,"withoutEnv");m.withoutEnv=yt;function wt(e){let t=globalThis.DEBUG;C||(C=new N(oe(t)));let i=new A(C,e);return C.debuggers.set(e,i),Object.assign(i.log.bind(i),{self:i})}r(wt,"debug");m.debug=wt});var H=class extends Error{static{r(this,"SystemError")}constructor(t,i){super(t,i),this.name="InternalError"}},d=class extends Error{static{r(this,"RuntimeError")}extensionMembers;constructor(t,i){typeof t=="string"?super(t,i):(super(t.message,i),this.extensionMembers=t.extensionMembers),this.name="RuntimeError"}},q=class extends d{static{r(this,"ConfigurationError")}constructor(t,i){super(t,i),this.name="ConfigurationError"}},k=class extends d{static{r(this,"FeatureNotEnabledError")}constructor(t,i){super(t,i),this.name="FeatureNotEnabledError"}};var ue=he(se());var w=(0,ue.debug)("zuplo:runtime:external-service");function Rt(){let e,{__ZUPLO_EXTERNAL_SERVICE_TOKEN:t}=E.instance.runtime;if(t&&t!=="undefined")try{let i=atob(t);e=JSON.parse(i)}catch{}return e}r(Rt,"getServiceAuth");async function ae(e,t){let i=Rt();if(i)if(w(`Using external service auth. ClientId: ${i.clientId})`),typeof e=="string"){let u=new URL(e),a=u.hostname,g=t??{},o=new Headers(g.headers||{});o.set("CF-Access-Client-Id",i.clientId),o.set("CF-Access-Client-Secret",i.clientSecret),g.headers=o;let l;if(i.customServiceMapping&&i.customServiceMapping[a])l=`https://${i.customServiceMapping[a]}`;else if(E.instance.useLegacyServiceRouting)l=`https://${a}.zuptunnel.com`;else{w("Using sha256 service routing");let h=E.instance.build;if(h.ACCOUNT_NAME&&h.PROJECT_NAME&&h.ENVIRONMENT_TYPE)l=`https://${await Ct(a,h.ACCOUNT_NAME,h.PROJECT_NAME,h.ENVIRONMENT_TYPE)}.zuptunnel.com`;else throw w("Cannot use sha256 service routing, missing build variables"),new d("Failed to generate fully qualified tunnel url.")}let f=new URL(`${l}${u.pathname}${u.search}`);w(`Calling external service: ${f.toString()}`);let p=await M.fetch(f.toString(),g);if(p.status===403&&p.headers.get("cf-access-domain")!==null)throw console.error("403 Forbidden when calling external service.",{clientId:i.clientId,tunnelHost:l}),new d("Could not connect to secure tunnel.");return p}else throw w("Cannot call external service with Request object"),new d("Currently, we only support fetch(<some_string>, ...).");else throw w("There is no external service auth configured for this zup."),new d("There are no external services configured for this zup.")}r(ae,"externalServiceHandler");async function Ct(e,t,i,u){let a=e.toLowerCase(),g=t.toLowerCase(),o=i.toLowerCase(),l=Et(u);w(`Hashing service name: ${g}-${a}.${g}-${o}-${l}`);let f=await ce(`${g}-${a}`),p=await ce(`${g}-${o}-${l}`);return`${f}.${p}`}r(Ct,"hashServiceName");async function ce(e){let t=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(g=>g.toString(16).padStart(2,"0")).join("").slice(0,-1)}r(ce,"hashSegment");function Et(e){let t=e.toLowerCase();switch(t){case"production":case"preview":return t;default:return"working-copy"}}r(Et,"sanitizeEnvironmentType");var ge=new Map;ge.set("service:",ae);var le=globalThis.fetch;function U(e,t){let i=St(t);if(typeof e=="string"){let u=new URL(e),a=ge.get(u.protocol);return a?a(e,i):le(e,i)}else return le(e,i)}r(U,"internalFetch");globalThis.fetch=U;var St=r(e=>{if(!e||e instanceof Request)return e;let t=e;if(!t.zuplo)return e;let i=e;return i.cf={cacheEverything:t.zuplo?.cacheEverything,cacheTtl:t.zuplo?.cacheTtlSeconds},delete e.zuplo,e},"transformInit");var Ot={fetch:U},M=Ot;var fe=class{constructor(t){this.options=t;this.authHeader=`Bearer ${btoa(t.pdpUsername+":"+t.pdpPassword)}`,this.authorizationUrl=new URL("/authorize",t.pdpUrl).toString()}static{r(this,"PdpService")}authHeader;authorizationUrl;async makePdpRequest(t){let i=await M.fetch(this.authorizationUrl,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/xacml+json; charset=UTF-8",[this.options.tokenHeaderName??"Authorization"]:this.authHeader}});if(!i.ok)throw new Error(`Request to PDP service failed with response status ${i.status}.`);return await i.json()}};export{se as a,H as b,d as c,q as d,k as e,M as f,fe as g};
36
+ /*! For license information please see chunk-CI735RIK.js.LEGAL.txt */
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Echos the value of a value. Trys to print the value out
3
+ * in the best way possible given the different types.
4
+ *
5
+ * @param {Object} obj The object to print out.
6
+ * @param {boolean} showHidden
7
+ * @param {number} depth
8
+ * @param {boolean} colors
9
+ * @license MIT (© Joyent)
10
+ */
@@ -0,0 +1,26 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ import{a as e}from"./chunk-4DUPDUSC.js";var o="2024-03-14",u=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function _(){return new t({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:o,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,COMPATIBILITY_FLAGS:u[o]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}e(_,"getMockEnvironment");var t=class l{static{e(this,"Environment")}config;static#e;static#t=!1;static initialize(n){this.#e||(this.#e=new l(n),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=_()),this.#e}constructor({build:n,runtime:i}){let r;try{if(i.__ZUPLO_CONFIG){let s=atob(i.__ZUPLO_CONFIG);r=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=r??{},this.build=n,this.runtime=i,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.ENVIRONMENT_TYPE?this.build.ENVIRONMENT_TYPE==="LOCAL_DEVELOPMENT":!1}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};export{t as a};
26
+ /*! For license information please see chunk-HPMPWPKQ.js.LEGAL.txt */
File without changes
@@ -0,0 +1,26 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ import{a}from"./chunk-HPMPWPKQ.js";import{a as n}from"./chunk-4DUPDUSC.js";var c=(o=>(o.Build="build-data",o.CorsPreflight="cors-preflight",o.DeveloperPortal="developer-portal",o.DeveloperPortalLegacy="developer-portal-legacy",o.StripePlugin="stripe-plugin",o.EmptyGatewayCatchall="empty-gateway-catchall",o.Ping="ping",o.UnmatchedPath="unmatched-path",o))(c||{});var p=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function _(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!p.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}n(_,"isRestrictedEnvVariableName");function g(e){return!!e.startsWith("ZUPLO_")}n(g,"isZuploReadableEnvVariableName");var f=new Proxy({},{get(e,r){let t=String(r);switch(t){case"ZUPLO_ENVIRONMENT_TYPE":return a.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return a.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return a.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return a.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return a.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return a.instance.build.BUILD_ID}if(!(_(t)&&!g(t)))return a.instance.runtime[t]}});function C(e,r,t){return`_${s(e+"_"+r+"_"+t)}`}n(C,"getRawOperationDataIdentifierName");function h(e,r,t,i){return`_${s(e.toLowerCase())}_`+r.toLowerCase()+"_"+t.toLowerCase()+`_${i.toLowerCase()}`}n(h,"getIdForParameterSchema");function A(e,r,t){return`_${s(e.toLowerCase())}_`+r.toLowerCase()+`_rb_${s(t.toLowerCase())}`}n(A,"getIdForRequestBodySchema");function m(e,r){return`_${s(e)}__${s(r)}`}n(m,"getIdForRefSchema");function s(e){let r=[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i>="0".charCodeAt(0)&&i<="9".charCodeAt(0)||i>="A".charCodeAt(0)&&i<="Z".charCodeAt(0)||i>="a".charCodeAt(0)&&i<="z".charCodeAt(0)?r.push(e.charAt(t)):r.push("_")}return r.join("")}n(s,"sanitizedIdentifierName");export{c as a,_ as b,g as c,f as d,C as e,h as f,A as g,m as h,s as i};
26
+ /*! For license information please see chunk-QSL25HFO.js.LEGAL.txt */
File without changes