@zuplo/cli 6.72.3 → 6.72.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/@fastify/reply-from/.github/dependabot.yml +42 -2
- package/node_modules/@fastify/reply-from/README.md +3 -3
- package/node_modules/@fastify/reply-from/index.js +6 -1
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.gitattributes +2 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/dependabot.yml +53 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/workflows/ci.yml +33 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/LICENSE +21 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/README.md +188 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/eslint.config.js +6 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/index.js +67 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/lib/getPluginName.js +25 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/lib/toCamelCase.js +10 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/package.json +70 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/bundlers.test.js +110 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/checkVersion.test.js +67 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/composite.test.js +14 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/esm/esm.mjs +11 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/esm/index.test.js +11 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/extractPluginName.test.js +49 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/mu1tip1e.composite.test.js +15 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/test.js +396 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/test/toCamelCase.test.js +24 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/example-async.tst.ts +19 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/example-callback.tst.ts +19 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/index.d.ts +54 -0
- package/node_modules/@fastify/reply-from/node_modules/fastify-plugin/types/index.tst.ts +249 -0
- package/node_modules/@fastify/reply-from/package.json +6 -7
- package/node_modules/@fastify/reply-from/test/incomplete-request.test.js +142 -0
- package/node_modules/@fastify/reply-from/types/index.tst.ts +123 -0
- package/node_modules/@posthog/core/dist/index.d.ts +1 -0
- package/node_modules/@posthog/core/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +35 -2
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.js +68 -56
- package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +68 -56
- package/node_modules/@posthog/core/dist/posthog-core.d.ts +2 -1
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.js +1 -0
- package/node_modules/@posthog/core/dist/posthog-core.mjs +1 -0
- package/node_modules/@posthog/core/dist/types.d.ts +1 -0
- package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/types.js +1 -0
- package/node_modules/@posthog/core/dist/types.mjs +1 -0
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.d.ts +17 -0
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.js +18 -1
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs +9 -1
- package/node_modules/@posthog/core/dist/utils/type-utils.d.ts.map +1 -1
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/index.ts +3 -0
- package/node_modules/@posthog/core/src/posthog-core-stateless.ts +135 -73
- package/node_modules/@posthog/core/src/posthog-core.ts +3 -2
- package/node_modules/@posthog/core/src/types.ts +5 -0
- package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.spec.ts +38 -1
- package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.ts +29 -0
- package/node_modules/@posthog/core/src/utils/type-utils.ts +0 -6
- package/node_modules/@posthog/types/LICENSE +2 -2
- package/node_modules/@posthog/types/dist/index.d.ts +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +32 -11
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/index.ts +1 -0
- package/node_modules/@posthog/types/src/posthog-config.ts +34 -11
- package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
- package/node_modules/@zuplo/core/index.minified.js +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.d.ts.map +1 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.js +85 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.js.map +1 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js +82 -0
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js.map +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/out/esm/chunk-X7TLQJWO.js +26 -0
- package/node_modules/@zuplo/otel/out/esm/chunk-X7TLQJWO.js.map +1 -0
- package/node_modules/@zuplo/otel/out/esm/index.js +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-423FXHUV.js → chunk-HKSZ4V6H.js} +124 -124
- package/node_modules/@zuplo/runtime/out/esm/chunk-HKSZ4V6H.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +417 -141
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +9 -9
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -4
- package/node_modules/hono/dist/adapter/lambda-edge/handler.js +12 -2
- package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -4
- package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +12 -2
- package/node_modules/hono/dist/cjs/client/client.js +10 -1
- package/node_modules/hono/dist/cjs/client/utils.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/compress/index.js +2 -1
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -1
- package/node_modules/hono/dist/cjs/middleware/method-override/index.js +5 -3
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +9 -0
- package/node_modules/hono/dist/client/client.js +10 -1
- package/node_modules/hono/dist/client/utils.js +1 -1
- package/node_modules/hono/dist/middleware/cache/index.js +1 -1
- package/node_modules/hono/dist/middleware/compress/index.js +2 -1
- package/node_modules/hono/dist/middleware/etag/index.js +2 -1
- package/node_modules/hono/dist/middleware/method-override/index.js +5 -3
- package/node_modules/hono/dist/router/trie-router/node.js +9 -0
- package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +1 -1
- package/node_modules/hono/dist/types/helper/websocket/index.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/language/language.d.ts +18 -0
- package/node_modules/hono/dist/types/utils/types.d.ts +1 -1
- package/node_modules/hono/package.json +4 -4
- package/package.json +6 -6
- package/node_modules/@fastify/reply-from/types/index.test-d.ts +0 -194
- package/node_modules/@zuplo/otel/out/esm/chunk-T25G5RDX.js +0 -26
- package/node_modules/@zuplo/otel/out/esm/chunk-T25G5RDX.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-423FXHUV.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-423FXHUV.js.LEGAL.txt → chunk-HKSZ4V6H.js.LEGAL.txt} +0 -0
|
@@ -572,7 +572,7 @@ globstar while`,s,de,o,ae,He),this.matchOne(s.slice(de),o.slice(ae),f))return th
|
|
|
572
572
|
`),stderr:E.join(`
|
|
573
573
|
`),exitCode:P},"Tar process logs")}}t(yZt,"tarFolder");async function vZt({tarFilePath:s,outputDir:o,logger:f}){let d=[],y=[],E;try{await new Promise((P,F)=>{let J=dit("sh",["-c",`tar -xvf ${s} -C ${o};`]);J.stdout.on("data",V=>{let Te=V.toString().trim();Te.length>0&&d.push(Te.trim())}),J.stderr.on("data",V=>{let Te=V.toString().trim();Te.length>0&&y.push(Te.trim())}),J.on("close",V=>{E=V,V===0?P():F(new Error(`tar process exited with code ${V}`))}),J.on("error",V=>{F(V)})})}catch(P){throw new Error("Failed to untar file",{cause:P})}finally{f.info({stdout:d.join(`
|
|
574
574
|
`),stderr:y.join(`
|
|
575
|
-
`),exitCode:E},"Untar process logs")}}t(vZt,"untarFile");async function bZt(s){if(await iAe(s))return await ZN.rm(s,{recursive:!0})}t(bZt,"deleteFolder");var eu=sAe;var blt=tp(jst(),1);var Bst=["ai-gateway-semantic-cache-inbound","ai-gateway-semantic-cache-inbound-v2","ai-gateway-semantic-cache-outbound","akamai-ai-firewall","akamai-ai-firewall-inbound-v2","akamai-firewall-for-ai-inbound","akamai-firewall-for-ai-outbound","comet-opik-tracing-inbound-v2","galileo-tracing-inbound-v2","prompt-injection-outbound","semantic-cache-inbound"];var qV=class{static{t(this,"R")}type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(s,o,f,d,y,E){this.type=s,this.name=o,this.prefix=f,this.value=d,this.suffix=y,this.modifier=E}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},Her=/[$_\p{ID_Start}]/u,Ger=/[$_\u200C\u200D\p{ID_Continue}]/u,BAe=".*";function Yer(s,o){return(o?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(s)}t(Yer,"Re");function $st(s,o=!1){let f=[],d=0;for(;d<s.length;){let y=s[d],E=t(function(P){if(!o)throw new TypeError(P);f.push({type:"INVALID_CHAR",index:d,value:s[d++]})},"c");if(y==="*"){f.push({type:"ASTERISK",index:d,value:s[d++]});continue}if(y==="+"||y==="?"){f.push({type:"OTHER_MODIFIER",index:d,value:s[d++]});continue}if(y==="\\"){f.push({type:"ESCAPED_CHAR",index:d++,value:s[d++]});continue}if(y==="{"){f.push({type:"OPEN",index:d,value:s[d++]});continue}if(y==="}"){f.push({type:"CLOSE",index:d,value:s[d++]});continue}if(y===":"){let P="",F=d+1;for(;F<s.length;){let J=s.substr(F,1);if(F===d+1&&Her.test(J)||F!==d+1&&Ger.test(J)){P+=s[F++];continue}break}if(!P){E(`Missing parameter name at ${d}`);continue}f.push({type:"NAME",index:d,value:P}),d=F;continue}if(y==="("){let P=1,F="",J=d+1,V=!1;if(s[J]==="?"){E(`Pattern cannot start with "?" at ${J}`);continue}for(;J<s.length;){if(!Yer(s[J],!1)){E(`Invalid character '${s[J]}' at ${J}.`),V=!0;break}if(s[J]==="\\"){F+=s[J++]+s[J++];continue}if(s[J]===")"){if(P--,P===0){J++;break}}else if(s[J]==="("&&(P++,s[J+1]!=="?")){E(`Capturing groups are not allowed at ${J}`),V=!0;break}F+=s[J++]}if(V)continue;if(P){E(`Unbalanced pattern at ${d}`);continue}if(!F){E(`Missing pattern at ${d}`);continue}f.push({type:"REGEX",index:d,value:F}),d=J;continue}f.push({type:"CHAR",index:d,value:s[d++]})}return f.push({type:"END",index:d,value:""}),f}t($st,"v");function Jst(s,o={}){let f=$st(s);o.delimiter??="/#?",o.prefixes??="./";let d=`[^${_T(o.delimiter)}]+?`,y=[],E=0,P=0,F="",J=new Set,V=t(wn=>{if(P<f.length&&f[P].type===wn)return f[P++].value},"a"),Te=t(()=>V("OTHER_MODIFIER")??V("ASTERISK"),"f"),de=t(wn=>{let sn=V(wn);if(sn!==void 0)return sn;let{type:Jn,index:wr}=f[P];throw new TypeError(`Unexpected ${Jn} at ${wr}, expected ${wn}`)},"d"),ae=t(()=>{let wn="",sn;for(;sn=V("CHAR")??V("ESCAPED_CHAR");)wn+=sn;return wn},"T"),He=t(wn=>wn,"Se"),Ue=o.encodePart||He,je="",Yt=t(wn=>{je+=wn},"U"),zt=t(()=>{je.length&&(y.push(new qV(3,"","",Ue(je),"",3)),je="")},"$"),Sr=t((wn,sn,Jn,wr,yr)=>{let xs=3;switch(yr){case"?":xs=1;break;case"*":xs=0;break;case"+":xs=2;break}if(!sn&&!Jn&&xs===3){Yt(wn);return}if(zt(),!sn&&!Jn){if(!wn)return;y.push(new qV(3,"","",Ue(wn),"",xs));return}let bi;Jn?Jn==="*"?bi=BAe:bi=Jn:bi=d;let fc=2;bi===d?(fc=1,bi=""):bi===BAe&&(fc=0,bi="");let Ci;if(sn?Ci=sn:Jn&&(Ci=E++),J.has(Ci))throw new TypeError(`Duplicate name '${Ci}'.`);J.add(Ci),y.push(new qV(fc,Ci,Ue(wn),bi,Ue(wr),xs))},"V");for(;P<f.length;){let wn=V("CHAR"),sn=V("NAME"),Jn=V("REGEX");if(!sn&&!Jn&&(Jn=V("ASTERISK")),sn||Jn){let yr=wn??"";o.prefixes.indexOf(yr)===-1&&(Yt(yr),yr=""),zt();let xs=Te();Sr(yr,sn,Jn,"",xs);continue}let wr=wn??V("ESCAPED_CHAR");if(wr){Yt(wr);continue}if(V("OPEN")){let yr=ae(),xs=V("NAME"),bi=V("REGEX");!xs&&!bi&&(bi=V("ASTERISK"));let fc=ae();de("CLOSE");let Ci=Te();Sr(yr,xs,bi,fc,Ci);continue}zt(),de("END")}return y}t(Jst,"D");function _T(s){return s.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}t(_T,"S");function Ust(s){return s&&s.ignoreCase?"ui":"u"}t(Ust,"X");function Ker(s,o,f){return Wst(Jst(s,f),o,f)}t(Ker,"Z");function X9(s){switch(s){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}t(X9,"k");function Wst(s,o,f={}){f.delimiter??="/#?",f.prefixes??="./",f.sensitive??=!1,f.strict??=!1,f.end??=!0,f.start??=!0,f.endsWith="";let d=f.start?"^":"";for(let F of s){if(F.type===3){F.modifier===3?d+=_T(F.value):d+=`(?:${_T(F.value)})${X9(F.modifier)}`;continue}o&&o.push(F.name);let J=`[^${_T(f.delimiter)}]+?`,V=F.value;if(F.type===1?V=J:F.type===0&&(V=BAe),!F.prefix.length&&!F.suffix.length){F.modifier===3||F.modifier===1?d+=`(${V})${X9(F.modifier)}`:d+=`((?:${V})${X9(F.modifier)})`;continue}if(F.modifier===3||F.modifier===1){d+=`(?:${_T(F.prefix)}(${V})${_T(F.suffix)})`,d+=X9(F.modifier);continue}d+=`(?:${_T(F.prefix)}`,d+=`((?:${V})(?:`,d+=_T(F.suffix),d+=_T(F.prefix),d+=`(?:${V}))*)${_T(F.suffix)})`,F.modifier===0&&(d+="?")}let y=`[${_T(f.endsWith)}]|$`,E=`[${_T(f.delimiter)}]`;if(f.end)return f.strict||(d+=`${E}?`),f.endsWith.length?d+=`(?=${y})`:d+="$",new RegExp(d,Ust(f));f.strict||(d+=`(?:${E}(?=${y}))?`);let P=!1;if(s.length){let F=s[s.length-1];F.type===3&&F.modifier===3&&(P=f.delimiter.indexOf(F)>-1)}return P||(d+=`(?=${E}|${y})`),new RegExp(d,Ust(f))}t(Wst,"F");var rI={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Xer={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Zer={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function Qer(s,o){return s.length?s[0]==="/"?!0:!o||s.length<2?!1:(s[0]=="\\"||s[0]=="{")&&s[1]=="/":!1}t(Qer,"J");function qst(s,o){return s.startsWith(o)?s.substring(o.length,s.length):s}t(qst,"Q");function etr(s,o){return s.endsWith(o)?s.substr(0,s.length-o.length):s}t(etr,"Ee");function Vst(s){return!s||s.length<2?!1:s[0]==="["||(s[0]==="\\"||s[0]==="{")&&s[1]==="["}t(Vst,"W");var Hst=["ftp","file","http","https","ws","wss"];function Gst(s){if(!s)return!0;for(let o of Hst)if(s.test(o))return!0;return!1}t(Gst,"N");function ttr(s,o){if(s=qst(s,"#"),o||s==="")return s;let f=new URL("https://example.com");return f.hash=s,f.hash?f.hash.substring(1,f.hash.length):""}t(ttr,"te");function rtr(s,o){if(s=qst(s,"?"),o||s==="")return s;let f=new URL("https://example.com");return f.search=s,f.search?f.search.substring(1,f.search.length):""}t(rtr,"re");function ntr(s,o){return o||s===""?s:Vst(s)?Xst(s):Kst(s)}t(ntr,"ne");function itr(s,o){if(o||s==="")return s;let f=new URL("https://example.com");return f.password=s,f.password}t(itr,"se");function str(s,o){if(o||s==="")return s;let f=new URL("https://example.com");return f.username=s,f.username}t(str,"ie");function atr(s,o,f){if(f||s==="")return s;if(o&&!Hst.includes(o))return new URL(`${o}:${s}`).pathname;let d=s[0]=="/";return s=new URL(d?s:"/-"+s,"https://example.com").pathname,d||(s=s.substring(2,s.length)),s}t(atr,"ae");function otr(s,o,f){return Yst(o)===s&&(s=""),f||s===""?s:Zst(s)}t(otr,"oe");function ctr(s,o){return s=etr(s,":"),o||s===""?s:UAe(s)}t(ctr,"ce");function Yst(s){switch(s){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}t(Yst,"_");function UAe(s){if(s==="")return s;if(/^[-+.A-Za-z0-9]*$/.test(s))return s.toLowerCase();throw new TypeError(`Invalid protocol '${s}'.`)}t(UAe,"y");function ltr(s){if(s==="")return s;let o=new URL("https://example.com");return o.username=s,o.username}t(ltr,"le");function utr(s){if(s==="")return s;let o=new URL("https://example.com");return o.password=s,o.password}t(utr,"fe");function Kst(s){if(s==="")return s;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(s))throw new TypeError(`Invalid hostname '${s}'`);let o=new URL("https://example.com");return o.hostname=s,o.hostname}t(Kst,"z");function Xst(s){if(s==="")return s;if(/[^0-9a-fA-F[\]:]/g.test(s))throw new TypeError(`Invalid IPv6 hostname '${s}'`);return s.toLowerCase()}t(Xst,"j");function Zst(s){if(s===""||/^[0-9]*$/.test(s)&&parseInt(s)<=65535)return s;throw new TypeError(`Invalid port '${s}'.`)}t(Zst,"K");function ftr(s){if(s==="")return s;let o=new URL("https://example.com");return o.pathname=s[0]!=="/"?"/-"+s:s,s[0]!=="/"?o.pathname.substring(2,o.pathname.length):o.pathname}t(ftr,"he");function _tr(s){return s===""?s:new URL(`data:${s}`).pathname}t(_tr,"ue");function ptr(s){if(s==="")return s;let o=new URL("https://example.com");return o.search=s,o.search.substring(1,o.search.length)}t(ptr,"de");function dtr(s){if(s==="")return s;let o=new URL("https://example.com");return o.hash=s,o.hash.substring(1,o.hash.length)}t(dtr,"pe");var mtr=class{static{t(this,"H")}#e;#n=[];#t={};#r=0;#s=1;#m=0;#c=0;#u=0;#f=0;#p=!1;constructor(s){this.#e=s}get result(){return this.#t}parse(){for(this.#n=$st(this.#e,!0);this.#r<this.#n.length;this.#r+=this.#s){if(this.#s=1,this.#n[this.#r].type==="END"){if(this.#c===0){this.#o(),this.#g()?this.#a(9,1):this.#E()?this.#a(8,1):this.#a(7,0);continue}else if(this.#c===2){this.#h(5);continue}this.#a(10,0);break}if(this.#u>0)if(this.#l())this.#u-=1;else continue;if(this.#A()){this.#u+=1;continue}switch(this.#c){case 0:this.#y()&&this.#h(1);break;case 1:if(this.#y()){this.#D();let s=7,o=1;this.#b()?(s=2,o=3):this.#p&&(s=2),this.#a(s,o)}break;case 2:this.#v()?this.#h(3):(this.#S()||this.#E()||this.#g())&&this.#h(5);break;case 3:this.#C()?this.#a(4,1):this.#v()&&this.#a(5,1);break;case 4:this.#v()&&this.#a(5,1);break;case 5:this.#O()?this.#f+=1:this.#N()&&(this.#f-=1),this.#k()&&!this.#f?this.#a(6,1):this.#S()?this.#a(7,0):this.#E()?this.#a(8,1):this.#g()&&this.#a(9,1);break;case 6:this.#S()?this.#a(7,0):this.#E()?this.#a(8,1):this.#g()&&this.#a(9,1);break;case 7:this.#E()?this.#a(8,1):this.#g()&&this.#a(9,1);break;case 8:this.#g()&&this.#a(9,1);break;case 9:break;case 10:break}}this.#t.hostname!==void 0&&this.#t.port===void 0&&(this.#t.port="")}#a(s,o){switch(this.#c){case 0:break;case 1:this.#t.protocol=this.#w();break;case 2:break;case 3:this.#t.username=this.#w();break;case 4:this.#t.password=this.#w();break;case 5:this.#t.hostname=this.#w();break;case 6:this.#t.port=this.#w();break;case 7:this.#t.pathname=this.#w();break;case 8:this.#t.search=this.#w();break;case 9:this.#t.hash=this.#w();break;case 10:break}this.#c!==0&&s!==10&&([1,2,3,4].includes(this.#c)&&[6,7,8,9].includes(s)&&(this.#t.hostname??=""),[1,2,3,4,5,6].includes(this.#c)&&[8,9].includes(s)&&(this.#t.pathname??=this.#p?"/":""),[1,2,3,4,5,6,7].includes(this.#c)&&s===9&&(this.#t.search??="")),this.#i(s,o)}#i(s,o){this.#c=s,this.#m=this.#r+o,this.#r+=o,this.#s=0}#o(){this.#r=this.#m,this.#s=0}#h(s){this.#o(),this.#c=s}#d(s){return s<0&&(s=this.#n.length-s),s<this.#n.length?this.#n[s]:this.#n[this.#n.length-1]}#_(s,o){let f=this.#d(s);return f.value===o&&(f.type==="CHAR"||f.type==="ESCAPED_CHAR"||f.type==="INVALID_CHAR")}#y(){return this.#_(this.#r,":")}#b(){return this.#_(this.#r+1,"/")&&this.#_(this.#r+2,"/")}#v(){return this.#_(this.#r,"@")}#C(){return this.#_(this.#r,":")}#k(){return this.#_(this.#r,":")}#S(){return this.#_(this.#r,"/")}#E(){if(this.#_(this.#r,"?"))return!0;if(this.#n[this.#r].value!=="?")return!1;let s=this.#d(this.#r-1);return s.type!=="NAME"&&s.type!=="REGEX"&&s.type!=="CLOSE"&&s.type!=="ASTERISK"}#g(){return this.#_(this.#r,"#")}#A(){return this.#n[this.#r].type=="OPEN"}#l(){return this.#n[this.#r].type=="CLOSE"}#O(){return this.#_(this.#r,"[")}#N(){return this.#_(this.#r,"]")}#w(){let s=this.#n[this.#r],o=this.#d(this.#m).index;return this.#e.substring(o,s.index)}#D(){let s={};Object.assign(s,rI),s.encodePart=UAe;let o=Ker(this.#w(),void 0,s);this.#p=Gst(o)}},jAe=["protocol","username","password","hostname","port","pathname","search","hash"],tI="*";function zst(s,o){if(typeof s!="string")throw new TypeError("parameter 1 is not of type 'string'.");let f=new URL(s,o);return{protocol:f.protocol.substring(0,f.protocol.length-1),username:f.username,password:f.password,hostname:f.hostname,port:f.port,pathname:f.pathname,search:f.search!==""?f.search.substring(1,f.search.length):void 0,hash:f.hash!==""?f.hash.substring(1,f.hash.length):void 0}}t(zst,"ge");function HP(s,o){return o?WV(s):s}t(HP,"b");function JV(s,o,f){let d;if(typeof o.baseURL=="string")try{d=new URL(o.baseURL),o.protocol===void 0&&(s.protocol=HP(d.protocol.substring(0,d.protocol.length-1),f)),!f&&o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.username===void 0&&(s.username=HP(d.username,f)),!f&&o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.username===void 0&&o.password===void 0&&(s.password=HP(d.password,f)),o.protocol===void 0&&o.hostname===void 0&&(s.hostname=HP(d.hostname,f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&(s.port=HP(d.port,f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.pathname===void 0&&(s.pathname=HP(d.pathname,f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.pathname===void 0&&o.search===void 0&&(s.search=HP(d.search.substring(1,d.search.length),f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.pathname===void 0&&o.search===void 0&&o.hash===void 0&&(s.hash=HP(d.hash.substring(1,d.hash.length),f))}catch{throw new TypeError(`invalid baseURL '${o.baseURL}'.`)}if(typeof o.protocol=="string"&&(s.protocol=ctr(o.protocol,f)),typeof o.username=="string"&&(s.username=str(o.username,f)),typeof o.password=="string"&&(s.password=itr(o.password,f)),typeof o.hostname=="string"&&(s.hostname=ntr(o.hostname,f)),typeof o.port=="string"&&(s.port=otr(o.port,s.protocol,f)),typeof o.pathname=="string"){if(s.pathname=o.pathname,d&&!Qer(s.pathname,f)){let y=d.pathname.lastIndexOf("/");y>=0&&(s.pathname=HP(d.pathname.substring(0,y+1),f)+s.pathname)}s.pathname=atr(s.pathname,s.protocol,f)}return typeof o.search=="string"&&(s.search=rtr(o.search,f)),typeof o.hash=="string"&&(s.hash=ttr(o.hash,f)),s}t(JV,"w");function WV(s){return s.replace(/([+*?:{}()\\])/g,"\\$1")}t(WV,"C");function htr(s){return s.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}t(htr,"Oe");function gtr(s,o){o.delimiter??="/#?",o.prefixes??="./",o.sensitive??=!1,o.strict??=!1,o.end??=!0,o.start??=!0,o.endsWith="";let f=".*",d=`[^${htr(o.delimiter)}]+?`,y=/[$_\u200C\u200D\p{ID_Continue}]/u,E="";for(let P=0;P<s.length;++P){let F=s[P];if(F.type===3){if(F.modifier===3){E+=WV(F.value);continue}E+=`{${WV(F.value)}}${X9(F.modifier)}`;continue}let J=F.hasCustomName(),V=!!F.suffix.length||!!F.prefix.length&&(F.prefix.length!==1||!o.prefixes.includes(F.prefix)),Te=P>0?s[P-1]:null,de=P<s.length-1?s[P+1]:null;if(!V&&J&&F.type===1&&F.modifier===3&&de&&!de.prefix.length&&!de.suffix.length)if(de.type===3){let ae=de.value.length>0?de.value[0]:"";V=y.test(ae)}else V=!de.hasCustomName();if(!V&&!F.prefix.length&&Te&&Te.type===3){let ae=Te.value[Te.value.length-1];V=o.prefixes.includes(ae)}V&&(E+="{"),E+=WV(F.prefix),J&&(E+=`:${F.name}`),F.type===2?E+=`(${F.value})`:F.type===1?J||(E+=`(${d})`):F.type===0&&(!J&&(!Te||Te.type===3||Te.modifier!==3||V||F.prefix!=="")?E+="*":E+=`(${f})`),F.type===1&&J&&F.suffix.length&&y.test(F.suffix[0])&&(E+="\\"),E+=WV(F.suffix),V&&(E+="}"),F.modifier!==3&&(E+=X9(F.modifier))}return E}t(gtr,"ke");var Qst=class{static{t(this,"me")}#e;#n={};#t={};#r={};#s={};#m=!1;constructor(s={},o,f){try{let d;if(typeof o=="string"?d=o:f=o,typeof s=="string"){let F=new mtr(s);if(F.parse(),s=F.result,d===void 0&&typeof s.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");s.baseURL=d}else{if(!s||typeof s!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(d)throw new TypeError("parameter 1 is not of type 'string'.")}typeof f>"u"&&(f={ignoreCase:!1});let y={ignoreCase:f.ignoreCase===!0},E={pathname:tI,protocol:tI,username:tI,password:tI,hostname:tI,port:tI,search:tI,hash:tI};this.#e=JV(E,s,!0),Yst(this.#e.protocol)===this.#e.port&&(this.#e.port="");let P;for(P of jAe){if(!(P in this.#e))continue;let F={},J=this.#e[P];switch(this.#t[P]=[],P){case"protocol":Object.assign(F,rI),F.encodePart=UAe;break;case"username":Object.assign(F,rI),F.encodePart=ltr;break;case"password":Object.assign(F,rI),F.encodePart=utr;break;case"hostname":Object.assign(F,Xer),Vst(J)?F.encodePart=Xst:F.encodePart=Kst;break;case"port":Object.assign(F,rI),F.encodePart=Zst;break;case"pathname":Gst(this.#n.protocol)?(Object.assign(F,Zer,y),F.encodePart=ftr):(Object.assign(F,rI,y),F.encodePart=_tr);break;case"search":Object.assign(F,rI,y),F.encodePart=ptr;break;case"hash":Object.assign(F,rI,y),F.encodePart=dtr;break}try{this.#s[P]=Jst(J,F),this.#n[P]=Wst(this.#s[P],this.#t[P],F),this.#r[P]=gtr(this.#s[P],F),this.#m=this.#m||this.#s[P].some(V=>V.type===2)}catch{throw new TypeError(`invalid ${P} pattern '${this.#e[P]}'.`)}}}catch(d){throw new TypeError(`Failed to construct 'URLPattern': ${d.message}`)}}test(s={},o){let f={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof s!="string"&&o)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof s>"u")return!1;try{typeof s=="object"?f=JV(f,s,!1):f=JV(f,zst(s,o),!1)}catch{return!1}let d;for(d of jAe)if(!this.#n[d].exec(f[d]))return!1;return!0}exec(s={},o){let f={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof s!="string"&&o)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof s>"u")return;try{typeof s=="object"?f=JV(f,s,!1):f=JV(f,zst(s,o),!1)}catch{return null}let d={};o?d.inputs=[s,o]:d.inputs=[s];let y;for(y of jAe){let E=this.#n[y].exec(f[y]);if(!E)return null;let P={};for(let[F,J]of this.#t[y].entries())if(typeof J=="string"||typeof J=="number"){let V=E[F+1];P[J]=V}d[y]={input:f[y]??"",groups:P}}return d}static compareComponent(s,o,f){let d=t((F,J)=>{for(let V of["type","modifier","prefix","value","suffix"]){if(F[V]<J[V])return-1;if(F[V]!==J[V])return 1}return 0},"o"),y=new qV(3,"","","","",3),E=new qV(0,"","","","",3),P=t((F,J)=>{let V=0;for(;V<Math.min(F.length,J.length);++V){let Te=d(F[V],J[V]);if(Te)return Te}return F.length===J.length?0:d(F[V]??y,J[V]??y)},"s");return!o.#r[s]&&!f.#r[s]?0:o.#r[s]&&!f.#r[s]?P(o.#s[s],[E]):!o.#r[s]&&f.#r[s]?P([E],f.#s[s]):P(o.#s[s],f.#s[s])}get protocol(){return this.#r.protocol}get username(){return this.#r.username}get password(){return this.#r.password}get hostname(){return this.#r.hostname}get port(){return this.#r.port}get pathname(){return this.#r.pathname}get search(){return this.#r.search}get hash(){return this.#r.hash}get hasRegExpGroups(){return this.#m}};globalThis.URLPattern||(globalThis.URLPattern=Qst);import{AssertionError as ytr}from"node:assert";function GP(s,o){if(s===!1)throw new ytr({message:o})}t(GP,"assert");var Wo;(function(s){s.Object="Object",s.Property="Property",s.Array="Array",s.Literal="Literal",s.TemplateString="TemplateString",s.Identifier="Identifier",s.FunctionCall="FunctionCall",s.Raw="Raw"})(Wo||(Wo={}));function Z9(s){return s.type===Wo.Object}t(Z9,"isAstObject");function YP(s){return s.type===Wo.Property}t(YP,"isAstProperty");function zAe(s){return s.type===Wo.Array}t(zAe,"isAstArray");function TO(s){return s.type===Wo.Literal}t(TO,"isAstLiteral");function nI(s){if(s===void 0)throw new Error("Node is undefined");if(!Z9(s))throw new Error("Node is not object")}t(nI,"assertAstObject");import{findNodeAtLocation as vtr,getNodeValue as btr,printParseErrorCode as Str,visit as Ttr}from"jsonc-parser";var xtr={DEFAULT:{allowTrailingComma:!1}};function VV(s,o=[],f=xtr.DEFAULT){let d={type:"array",offset:-1,length:-1,line:-1,column:-1,children:[],parent:void 0};function y(J){d.type==="property"&&(d.length=J-d.offset,d=d.parent)}t(y,"ensurePropertyComplete");function E(J){return d.children?.push(J),J}t(E,"onValue"),Ttr(s,{onObjectBegin:t((J,V,Te)=>{d=E({type:"object",offset:J,length:-1,line:V+1,column:Te+1,parent:d,children:[]})},"onObjectBegin"),onObjectProperty:t((J,V,Te,de,ae)=>{d=E({type:"property",offset:V,length:-1,line:de+1,column:ae+1,parent:d,children:[]}),d.children?.push({type:"string",value:J,offset:V,length:Te,line:de,column:ae,parent:d})},"onObjectProperty"),onObjectEnd:t((J,V)=>{y(J+V),d.length=J+V-d.offset,d=d.parent,y(J+V)},"onObjectEnd"),onArrayBegin:t((J,V,Te,de)=>{d=E({type:"array",offset:J,length:-1,line:Te+1,column:de+1,parent:d,children:[]})},"onArrayBegin"),onArrayEnd:t((J,V)=>{d.length=J+V-d.offset,d=d.parent,y(J+V)},"onArrayEnd"),onLiteralValue:t((J,V,Te,de,ae)=>{E({type:Etr(J),offset:V,length:Te,line:de+1,column:ae+1,parent:d,value:J}),y(V+Te)},"onLiteralValue"),onSeparator:t((J,V)=>{d.type==="property"&&(J===":"?d.colonOffset=V:J===","&&y(V))},"onSeparator"),onError:t((J,V,Te,de,ae)=>{o.push({error:J,offset:V,length:Te,line:de+1,column:ae+1})},"onError")},f);let F=d.children?.[0];return F&&delete F.parent,F}t(VV,"parse");function Etr(s){switch(typeof s){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(s){if(Array.isArray(s))return"array"}else return"null";return"object"}default:return"null"}}t(Etr,"getNodeType");function $Ae(s,o){return vtr(s,o)}t($Ae,"findNodeAtLocation");function HV(s){return btr(s)}t(HV,"getNodeValue");function eat(s){return Str(s)}t(eat,"printParseErrorCode");var GV=class{static{t(this,"AstAdapter")}parse(o){let d=VV(o,[]);if(d)return this.parseNode(d,void 0);throw new Error("Failed to parse JSON")}convert(o){return this.parseNode(o,void 0)}parseNode(o,f){switch(o.type){case"object":return this.createObject(o,f);case"array":return this.createArray(o,f);case"property":return this.createProperty(o,f);case"string":return this.createLiteral(o,f);case"number":return this.createLiteral(o,f);case"boolean":return this.createLiteral(o,f);case"null":return this.createLiteral(o,f)}}createLiteral(o,f){return{type:Wo.Literal,location:{line:o.line,column:o.column},parent:f,value:o.type==="null"?null:o.value}}createObject(o,f){let d={type:Wo.Object,children:[],parent:f,location:{line:o.line,column:o.column}};return o.children?.forEach(y=>{d.children.push(this.parseNode(y,d))}),d}createProperty(o,f){GP(o.children?.length===2,"Invalid property node");let d={type:Wo.Property,location:{line:o.line,column:o.column},parent:f,name:null,value:null};return d.name={value:o.children[0].value,location:{line:o.line,column:o.column},type:Wo.Identifier,parent:d},d.value=this.parseNode(o.children[1],d),d}createArray(o,f){let d={type:Wo.Array,location:{line:o.line,column:o.column},parent:f,children:[]};return o.children?.forEach(y=>d.children.push(this.parseNode(y,d))),d}};var DS={createLiteral:t((s,o)=>({type:Wo.Literal,parent:o,value:s}),"createLiteral"),createTemplateString:t((s,o)=>({type:Wo.TemplateString,parent:o,value:s}),"createTemplateString"),createIdentifier:t((s,o)=>({type:Wo.Identifier,value:s,parent:o}),"createIdentifier"),createProperty:t((s,o,f)=>{let d={type:Wo.Property,parent:f,name:null,value:o};return d.name={value:s,type:Wo.Identifier,parent:d},d.value.parent=d,d},"createProperty"),createArrayOfLiterals:t((s,o)=>{let f={type:Wo.Array,parent:o,children:[]};for(let d of s)f.children.push(DS.createLiteral(d,f));return f},"createArrayOfLiterals")};var Ctr=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,YV=class{static{t(this,"SourceGenerator")}generate(o){let f=[];return this.generateSource(f,o),f.join("")}generateSource(o,f){switch(f.type){case Wo.Array:return this.generateArray(o,f);case Wo.Object:return this.generateObject(o,f);case Wo.Property:return this.generateProperty(o,f);case Wo.Literal:return this.generateLiteral(o,f);case Wo.FunctionCall:return this.generateFunctionCall(o,f);case Wo.Identifier:return this.generateIdentifier(o,f);case Wo.Raw:return this.generateRaw(o,f);case Wo.TemplateString:return this.generateTemplateString(o,f)}}generateArray(o,f){o.push("["),f.children.map(d=>{this.generateSource(o,d),o.push(",")}),o.push("]")}generateObject(o,f){o.push("{"),f.children.forEach(d=>{this.generateSource(o,d),o.push(",")}),o.push("}")}generateProperty(o,f){this.generateIdentifier(o,f.name),o.push(":"),this.generateSource(o,f.value)}generateFunctionCall(o,f){o.push(f.name.value),o.push("("),f.children.forEach((d,y,E)=>{this.generateSource(o,d),y<E.length&&o.push(",")}),o.push(")")}generateRaw(o,f){o.push(f.value)}generateTemplateString(o,f){o.push("`"),o.push(f.value.replaceAll("`","\\`")),o.push("`")}generateLiteral(o,f){if(f.value===null)return o.push("null");switch(typeof f.value){case"number":case"boolean":return o.push(`${f.value}`);case"string":{let d=f.value,y=JSON.stringify(d);return o.push(`${y}`)}}}generateIdentifier(o,f){let d=Ctr.test(f.value)?f.value:`'${f.value}'`;o.push(d)}};import ktr from"node:fs/promises";import{parse as wtr}from"@swc/core";var tat=t(async s=>{let o=new Set;try{let f=await ktr.readFile(s,"utf-8");(await wtr(f,{syntax:"typescript"})).body.forEach(y=>{y.type==="ExportDefaultDeclaration"||y.type==="ExportDefaultExpression"?o.add("default"):y.type==="ExportDeclaration"&&y.declaration.type==="FunctionDeclaration"?o.add(y.declaration.identifier.value):y.type==="ExportDeclaration"&&y.declaration.type==="VariableDeclaration"&&y.declaration.declarations[0].id.type==="Identifier"&&o.add(y.declaration.declarations[0].id.value)})}catch{return null}return o},"getJSFileExports");var rat={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/fragments.schema.json",$defs:{corsPolicyConfiguration:{type:"object",required:["name","allowedOrigins"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[0-9a-z-]+$"},allowCredentials:{type:"boolean"},maxAge:{type:"number"},allowedOrigins:{oneOf:[{type:"array",items:{type:"string"}},{type:"string"}]},allowedMethods:{oneOf:[{type:"array",items:{$ref:"fragments.schema.json#/$defs/httpMethod"}},{type:"string"}]},allowedHeaders:{oneOf:[{type:"array",items:{type:"string"}},{type:"string"}]},exposeHeaders:{oneOf:[{type:"array",items:{type:"string"}},{type:"string"}]}}},handlerDefinition:{type:"object",properties:{module:{type:"string",pattern:"^\\$import\\([^ )]*?\\)$"},export:{type:"string"},options:{type:"object",additionalProperties:!0}},additionalProperties:!1,required:["module","export"]},httpMethod:{type:"string",enum:["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]}}};var JAe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/policies.schema.json",title:"Policies Config File",type:"object",additionalProperties:!1,properties:{policies:{type:"array",items:{$ref:"policy-configuration.schema.json"}},corsPolicies:{type:"array",items:{$ref:"fragments.schema.json#/$defs/corsPolicyConfiguration"}}}};var nat={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/policy-configuration.schema.json",title:"Policy Configuration Fragment",type:"object",required:["name","policyType","handler"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[0-9a-z-]+$"},policyType:{type:"string"},handler:{$ref:"fragments.schema.json#/$defs/handlerDefinition"},options:{type:"object",additionalProperties:!0}}};var WAe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/route-configuration.schema.json",title:"Route Configuration Fragment",description:"",type:"object",required:["path","methods","handler"],additionalProperties:!1,$defs:{corsPolicy:{type:"string",pattern:"^[0-9a-z-]+$"}},properties:{operationId:{type:"string"},path:{type:"string",pattern:"^/[^\\s]*$"},methods:{type:"array",items:{$ref:"fragments.schema.json#/$defs/httpMethod"}},label:{type:"string",description:"An internal user-friendly identifier of the route."},enforceOpenApi:{type:"boolean",description:"If true, schema validation found in the OpenAPI spec will be enforced on requests/responses."},key:{type:"string",deprecated:!0},handler:{$ref:"fragments.schema.json#/$defs/handlerDefinition"},corsPolicy:{$ref:"#/$defs/corsPolicy"},custom:{},mcp:{type:"object",additionalProperties:!1,properties:{enabled:{type:"boolean"}}},policies:{type:"object",additionalProperties:!1,properties:{inbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}},outbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}}}},summary:{type:"string"},description:{type:"string"},excludeFromOpenApi:{type:"boolean"},tags:{type:"array",items:{type:"string"}}}};var qAe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/route-configuration-open-api.schema.json",title:"Open API Route Configuration Fragment",description:"These are the properties that can appear under the x-zuplo-route extension in a PathObject in Open API. It's a subset of what can appear in Zuplo's routes.json.",type:"object",required:["handler"],additionalProperties:!1,properties:{label:{type:"string",description:"An internal user-friendly identifier of the route."},key:{type:"string",deprecated:!0},handler:{$ref:"fragments.schema.json#/$defs/handlerDefinition"},corsPolicy:{type:"string",pattern:"^[0-9a-z-]+$"},custom:{},mcp:{oneOf:[{type:"object",additionalProperties:!1,properties:{type:{const:"tool"},name:{type:"string"},description:{type:"string"},enabled:{type:"boolean"},includeOutputSchema:{type:"boolean"},includeStructuredContent:{type:"boolean"},annotations:{type:"object",additionalProperties:!1,properties:{title:{type:"string"},readOnlyHint:{type:"boolean"},destructiveHint:{type:"boolean"},idempotentHint:{type:"boolean"},openWorldHint:{type:"boolean"}}},_meta:{type:"object",additionalProperties:!0}},required:["type"]},{type:"object",additionalProperties:!1,properties:{type:{const:"prompt"},name:{type:"string"},description:{type:"string"},enabled:{type:"boolean"}},required:["type"]},{type:"object",additionalProperties:!1,properties:{type:{const:"resource"},name:{type:"string"},description:{type:"string"},uri:{type:"string"},mimeType:{type:"string"},enabled:{type:"boolean"},_meta:{type:"object",additionalProperties:!0}},required:["type"]},{type:"object",additionalProperties:!1,properties:{type:{const:"graphql"},enabled:{type:"boolean"},introspectionTool:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},description:{type:"string"}}},executeTool:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},description:{type:"string"}}}},required:["type"]}]},policies:{type:"object",additionalProperties:!1,properties:{inbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}},outbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}}}},tags:{type:"array",items:{type:"string"}}}};var llt=tp(Kce(),1),ult=tp(clt(),1);var Qce=class s{static{t(this,"JsonValidator")}static#e=new s;static get instance(){return s.#e}ajv;constructor(){this.ajv=new llt.Ajv2020({allErrors:!0,allowUnionTypes:!0}),this.ajv.addKeyword("faker"),(0,ult.default)(this.ajv,{mode:"fast"})}addSchema(o,f){this.ajv.addSchema(o,f)}compile(o){let f=this.ajv.compile(o);return t(y=>({isValid:f(y),errors:this.toSimpleErrors(f.errors,y),warnings:[]}),"validator")}toSimpleErrors(o,f){let d=[];return o?.forEach(y=>{y.keyword==="enum"&&y.params.allowedValues&&Array.isArray(y.params.allowedValues)&&(y.message+=`; ${y.params.allowedValues.join(", ")}`),y.instancePath&&(y.instancePath=y.instancePath.replaceAll(/(\/)?(~1)(\/)?/gm,"/"));let E={details:{}},P=y.instancePath.split("/");if(P.length>2){let J=P[1],V=P[2]?parseInt(P[2],10):0,Te=P[3],de=Number.isNaN(V)?void 0:f[J][V][Te];E={details:{property:J,index:V,field:Te,fieldValue:de}}}if(y.keyword==="required"&&y.params.missingProperty&&y.instancePath&&(y.message=`A 'path' is missing required property '${y.params.missingProperty}'`),y.keyword==="additionalProperties"&&y.params.additionalProperty&&y.instancePath&&(y.message=`A 'path' should NOT include property '${y.params.additionalProperty}'`),y.keyword==="type"&&y.params.type&&y.instancePath){let J=y.instancePath.split("/"),V=J[J.length-1];y.message=`Value of property '${V}' must be '${y.params.type}'`}let F=Object.assign(y,E);d.push(F)}),d}};var pI=Qce.instance;pI.addSchema(WAe,"route-configuration.schema.json");pI.addSchema(nat,"policy-configuration.schema.json");pI.addSchema(JAe,"policies.schema.json");pI.addSchema(qAe,"open-api-route-configuration.schema.json");pI.addSchema(rat,"fragments.schema.json");var T6r=pI.compile(WAe),flt=pI.compile(qAe),aIe=pI.compile(JAe);var ele=class{static{t(this,"PoliciesConfigurationValidator")}results;validate(o){return this.results=aIe(o),this.results}};var tle=class{static{t(this,"OpenAPILocalizedValidator")}results;validate(o){return this.results=flt(o),this.results}};import Mcr from"node:path";var oIe=/\$import\((.*)\)/,wH=/\$env\((.*?)\)/g;var zk=class extends Error{static{t(this,"CodeGenError")}location;constructor(o,f,d,y){super(o),this.location={file:f,namespace:"",line:d?d.line:0,column:d?d.column:0,length:0,lineText:y??"",suggestion:""}}},Rcr=t(s=>{let o=[],f=s;for(;f.parent;)o.push(f),f=f.parent;return o.reverse()},"invertTree"),eA=t((s,o)=>{if(!s)return!1;let f=Rcr(s);return o.split("/").every((E,P)=>{let F=f[P];return F?E==="*"||YP(F)&&F.name.value===E?!0:E==="{}"?F.type===Wo.Object:E==="[]"?F.type===Wo.Array:!1:!1})},"testPosition");var rle=class{static{t(this,"AstTransformer")}errors=[];transform(o){return this.visitor(o),o}visitor(o){this.visit(o),Z9(o)?o.children.forEach(f=>{this.visitor(f)}):zAe(o)?o.children.forEach(f=>{this.visitor(f)}):YP(o)&&this.visitor(o.value)}},_lt=t(s=>{let o=new RegExp(wH).exec(s);if(o?.length===2&&o[0]===s)return{type:"raw",value:`environment["${o[1]}"]`};{let f=s.replaceAll(new RegExp(wH),(d,y)=>`\${environment["${y}"] ? environment["${y}"] : ""}`);if(f!==s)return{type:"template",value:f}}return null},"replaceEnvInString"),plt=t((s,o,f)=>d=>{if(TO(d)&&typeof d.value=="string"&&d.parent&&zAe(d.parent)){if(!s.some(P=>eA(d.parent,P))){wH.test(d.value)&&o.push(new zk("An $env() statement is not expected at this location.",f,d.location,d.value));return}let E=_lt(d.value);if(E){let P=d.parent,F=P.children.indexOf(d);if(F!==-1)if(E.type==="raw"){let J={type:Wo.Raw,parent:P,value:E.value};P.children[F]=J}else P.children[F]=DS.createTemplateString(E.value,d)}return}if(!YP(d)||!TO(d.value)||typeof d.value.value!="string")return;if(!s.some(E=>eA(d,E))){wH.test(d.value.value)&&o.push(new zk("An $env() statement is not expected at this location.",f,d.location,d.value.value));return}let y=_lt(d.value.value);if(y)if(y.type==="raw"){let E={type:Wo.Raw,parent:null,value:y.value};d.value=E}else d.value=DS.createTemplateString(y.value,d)},"getEnvStatementTransformer");var DH="config/routes.json",jcr=["handler/{}/options/*","handler/{}/options/*/[]","policies/[]/{}/handler/{}/options/*","policies/[]/{}/handler/{}/options/*/[]","corsPolicies/[]/{}/*","corsPolicies/[]/{}/*/[]"],Bcr=["handler/{}/module","handler/{}/options/{}/policies/{}/inbound/[]/{}/module","handler/{}/options/{}/policies/{}/outbound/[]/{}/module","policies/[]/{}/handler/{}/module","policies/[]/{}/handler/{}/options/{}/identifier/{}/module","policies/[]/{}/handler/{}/options/{}/validator"],dlt=["handler/{}/options/*","policies/[]/{}/handler/{}/options/*"],Ucr="handler/{}/options/{}/rewritePattern",zcr="handler/{}/options/{}/baseUrl",nle=class extends rle{static{t(this,"OpenAPIRoutesFragmentAstTransformer")}importCount=0;addedImports=new Map;getImportName(o){this.addedImports.has(o)||this.addedImports.set(o,`__import${this.importCount++}`);let f=this.addedImports.get(o);if(!f)throw new Error("Import name is undefined. This should not happen.");return f}getImports(){let o=[];return this.addedImports.forEach((f,d)=>{o.push({name:f,path:d})}),o}visit(o){this.rewriteHandlerFunction(o),this.rewriteForwardFunction(o),this.replaceImportStatements(o),this.replaceEnvStatements(o)}rewriteHandlerFunction(o){if(!(!YP(o)||!TO(o.value)||typeof o.value.value!="string")&&eA(o,Ucr)){if(!o.parent||!Z9(o.parent)){this.errors.push(new zk("Invalid node, expected object",DH,o.parent?o.parent.location:o.location,void 0));return}let f=o.value.value,d={type:Wo.Raw,parent:null,value:mlt(f)},y=DS.createProperty("__rewriteFunction",d,o);o.parent.children.push(y)}}rewriteForwardFunction(o){if(!(!YP(o)||!TO(o.value)||typeof o.value.value!="string")&&eA(o,zcr)){if(!o.parent||!Z9(o.parent)){this.errors.push(new zk("Invalid node, expected object",DH,o.parent?o.parent.location:o.location,void 0));return}let f=o.value.value,d={type:Wo.Raw,parent:null,value:mlt(f)},y=DS.createProperty("__rewriteFunction",d,o);o.parent.children.push(y)}}replaceImportStatements(o){if(!YP(o)||!TO(o.value))return;let f=o.value.value;if(typeof f!="string")return;if(!Bcr.some(F=>eA(o,F))&&!dlt.some(F=>eA(o,F))){if(oIe.test(f)){if(o.name.value==="$ref")return;this.errors.push(new zk("An $import() statement is not expected at this location.",DH,o.location,f))}return}let d=oIe.exec(f);if(dlt.some(F=>eA(o,F))&&!d)return;if(!d){this.errors.push(new zk("Invalid $import() statement",DH,o.location,f));return}let y=d[1];y=y.replace(/\\/g,"/"),y.startsWith(".")&&(y=Mcr.posix.join("..",y));let E=this.getImportName(y),P={type:Wo.Identifier,parent:o.parent,value:E};o.value=P}replaceEnvStatements=plt(jcr,this.errors,DH)};function mlt(s){return`(request, context) => {
|
|
575
|
+
`),exitCode:E},"Untar process logs")}}t(vZt,"untarFile");async function bZt(s){if(await iAe(s))return await ZN.rm(s,{recursive:!0})}t(bZt,"deleteFolder");var eu=sAe;var blt=tp(jst(),1);var Bst=["ai-gateway-models-inbound","ai-gateway-semantic-cache-inbound","ai-gateway-semantic-cache-inbound-v2","ai-gateway-semantic-cache-outbound","akamai-ai-firewall","akamai-ai-firewall-inbound-v2","akamai-firewall-for-ai-inbound","akamai-firewall-for-ai-outbound","comet-opik-tracing-inbound-v2","galileo-tracing-inbound-v2","prompt-injection-outbound","semantic-cache-inbound"];var qV=class{static{t(this,"R")}type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(s,o,f,d,y,E){this.type=s,this.name=o,this.prefix=f,this.value=d,this.suffix=y,this.modifier=E}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},Her=/[$_\p{ID_Start}]/u,Ger=/[$_\u200C\u200D\p{ID_Continue}]/u,BAe=".*";function Yer(s,o){return(o?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(s)}t(Yer,"Re");function $st(s,o=!1){let f=[],d=0;for(;d<s.length;){let y=s[d],E=t(function(P){if(!o)throw new TypeError(P);f.push({type:"INVALID_CHAR",index:d,value:s[d++]})},"c");if(y==="*"){f.push({type:"ASTERISK",index:d,value:s[d++]});continue}if(y==="+"||y==="?"){f.push({type:"OTHER_MODIFIER",index:d,value:s[d++]});continue}if(y==="\\"){f.push({type:"ESCAPED_CHAR",index:d++,value:s[d++]});continue}if(y==="{"){f.push({type:"OPEN",index:d,value:s[d++]});continue}if(y==="}"){f.push({type:"CLOSE",index:d,value:s[d++]});continue}if(y===":"){let P="",F=d+1;for(;F<s.length;){let J=s.substr(F,1);if(F===d+1&&Her.test(J)||F!==d+1&&Ger.test(J)){P+=s[F++];continue}break}if(!P){E(`Missing parameter name at ${d}`);continue}f.push({type:"NAME",index:d,value:P}),d=F;continue}if(y==="("){let P=1,F="",J=d+1,V=!1;if(s[J]==="?"){E(`Pattern cannot start with "?" at ${J}`);continue}for(;J<s.length;){if(!Yer(s[J],!1)){E(`Invalid character '${s[J]}' at ${J}.`),V=!0;break}if(s[J]==="\\"){F+=s[J++]+s[J++];continue}if(s[J]===")"){if(P--,P===0){J++;break}}else if(s[J]==="("&&(P++,s[J+1]!=="?")){E(`Capturing groups are not allowed at ${J}`),V=!0;break}F+=s[J++]}if(V)continue;if(P){E(`Unbalanced pattern at ${d}`);continue}if(!F){E(`Missing pattern at ${d}`);continue}f.push({type:"REGEX",index:d,value:F}),d=J;continue}f.push({type:"CHAR",index:d,value:s[d++]})}return f.push({type:"END",index:d,value:""}),f}t($st,"v");function Jst(s,o={}){let f=$st(s);o.delimiter??="/#?",o.prefixes??="./";let d=`[^${_T(o.delimiter)}]+?`,y=[],E=0,P=0,F="",J=new Set,V=t(wn=>{if(P<f.length&&f[P].type===wn)return f[P++].value},"a"),Te=t(()=>V("OTHER_MODIFIER")??V("ASTERISK"),"f"),de=t(wn=>{let sn=V(wn);if(sn!==void 0)return sn;let{type:Jn,index:wr}=f[P];throw new TypeError(`Unexpected ${Jn} at ${wr}, expected ${wn}`)},"d"),ae=t(()=>{let wn="",sn;for(;sn=V("CHAR")??V("ESCAPED_CHAR");)wn+=sn;return wn},"T"),He=t(wn=>wn,"Se"),Ue=o.encodePart||He,je="",Yt=t(wn=>{je+=wn},"U"),zt=t(()=>{je.length&&(y.push(new qV(3,"","",Ue(je),"",3)),je="")},"$"),Sr=t((wn,sn,Jn,wr,yr)=>{let xs=3;switch(yr){case"?":xs=1;break;case"*":xs=0;break;case"+":xs=2;break}if(!sn&&!Jn&&xs===3){Yt(wn);return}if(zt(),!sn&&!Jn){if(!wn)return;y.push(new qV(3,"","",Ue(wn),"",xs));return}let bi;Jn?Jn==="*"?bi=BAe:bi=Jn:bi=d;let fc=2;bi===d?(fc=1,bi=""):bi===BAe&&(fc=0,bi="");let Ci;if(sn?Ci=sn:Jn&&(Ci=E++),J.has(Ci))throw new TypeError(`Duplicate name '${Ci}'.`);J.add(Ci),y.push(new qV(fc,Ci,Ue(wn),bi,Ue(wr),xs))},"V");for(;P<f.length;){let wn=V("CHAR"),sn=V("NAME"),Jn=V("REGEX");if(!sn&&!Jn&&(Jn=V("ASTERISK")),sn||Jn){let yr=wn??"";o.prefixes.indexOf(yr)===-1&&(Yt(yr),yr=""),zt();let xs=Te();Sr(yr,sn,Jn,"",xs);continue}let wr=wn??V("ESCAPED_CHAR");if(wr){Yt(wr);continue}if(V("OPEN")){let yr=ae(),xs=V("NAME"),bi=V("REGEX");!xs&&!bi&&(bi=V("ASTERISK"));let fc=ae();de("CLOSE");let Ci=Te();Sr(yr,xs,bi,fc,Ci);continue}zt(),de("END")}return y}t(Jst,"D");function _T(s){return s.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}t(_T,"S");function Ust(s){return s&&s.ignoreCase?"ui":"u"}t(Ust,"X");function Ker(s,o,f){return Wst(Jst(s,f),o,f)}t(Ker,"Z");function X9(s){switch(s){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}t(X9,"k");function Wst(s,o,f={}){f.delimiter??="/#?",f.prefixes??="./",f.sensitive??=!1,f.strict??=!1,f.end??=!0,f.start??=!0,f.endsWith="";let d=f.start?"^":"";for(let F of s){if(F.type===3){F.modifier===3?d+=_T(F.value):d+=`(?:${_T(F.value)})${X9(F.modifier)}`;continue}o&&o.push(F.name);let J=`[^${_T(f.delimiter)}]+?`,V=F.value;if(F.type===1?V=J:F.type===0&&(V=BAe),!F.prefix.length&&!F.suffix.length){F.modifier===3||F.modifier===1?d+=`(${V})${X9(F.modifier)}`:d+=`((?:${V})${X9(F.modifier)})`;continue}if(F.modifier===3||F.modifier===1){d+=`(?:${_T(F.prefix)}(${V})${_T(F.suffix)})`,d+=X9(F.modifier);continue}d+=`(?:${_T(F.prefix)}`,d+=`((?:${V})(?:`,d+=_T(F.suffix),d+=_T(F.prefix),d+=`(?:${V}))*)${_T(F.suffix)})`,F.modifier===0&&(d+="?")}let y=`[${_T(f.endsWith)}]|$`,E=`[${_T(f.delimiter)}]`;if(f.end)return f.strict||(d+=`${E}?`),f.endsWith.length?d+=`(?=${y})`:d+="$",new RegExp(d,Ust(f));f.strict||(d+=`(?:${E}(?=${y}))?`);let P=!1;if(s.length){let F=s[s.length-1];F.type===3&&F.modifier===3&&(P=f.delimiter.indexOf(F)>-1)}return P||(d+=`(?=${E}|${y})`),new RegExp(d,Ust(f))}t(Wst,"F");var rI={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Xer={delimiter:".",prefixes:"",sensitive:!0,strict:!0},Zer={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function Qer(s,o){return s.length?s[0]==="/"?!0:!o||s.length<2?!1:(s[0]=="\\"||s[0]=="{")&&s[1]=="/":!1}t(Qer,"J");function qst(s,o){return s.startsWith(o)?s.substring(o.length,s.length):s}t(qst,"Q");function etr(s,o){return s.endsWith(o)?s.substr(0,s.length-o.length):s}t(etr,"Ee");function Vst(s){return!s||s.length<2?!1:s[0]==="["||(s[0]==="\\"||s[0]==="{")&&s[1]==="["}t(Vst,"W");var Hst=["ftp","file","http","https","ws","wss"];function Gst(s){if(!s)return!0;for(let o of Hst)if(s.test(o))return!0;return!1}t(Gst,"N");function ttr(s,o){if(s=qst(s,"#"),o||s==="")return s;let f=new URL("https://example.com");return f.hash=s,f.hash?f.hash.substring(1,f.hash.length):""}t(ttr,"te");function rtr(s,o){if(s=qst(s,"?"),o||s==="")return s;let f=new URL("https://example.com");return f.search=s,f.search?f.search.substring(1,f.search.length):""}t(rtr,"re");function ntr(s,o){return o||s===""?s:Vst(s)?Xst(s):Kst(s)}t(ntr,"ne");function itr(s,o){if(o||s==="")return s;let f=new URL("https://example.com");return f.password=s,f.password}t(itr,"se");function str(s,o){if(o||s==="")return s;let f=new URL("https://example.com");return f.username=s,f.username}t(str,"ie");function atr(s,o,f){if(f||s==="")return s;if(o&&!Hst.includes(o))return new URL(`${o}:${s}`).pathname;let d=s[0]=="/";return s=new URL(d?s:"/-"+s,"https://example.com").pathname,d||(s=s.substring(2,s.length)),s}t(atr,"ae");function otr(s,o,f){return Yst(o)===s&&(s=""),f||s===""?s:Zst(s)}t(otr,"oe");function ctr(s,o){return s=etr(s,":"),o||s===""?s:UAe(s)}t(ctr,"ce");function Yst(s){switch(s){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}t(Yst,"_");function UAe(s){if(s==="")return s;if(/^[-+.A-Za-z0-9]*$/.test(s))return s.toLowerCase();throw new TypeError(`Invalid protocol '${s}'.`)}t(UAe,"y");function ltr(s){if(s==="")return s;let o=new URL("https://example.com");return o.username=s,o.username}t(ltr,"le");function utr(s){if(s==="")return s;let o=new URL("https://example.com");return o.password=s,o.password}t(utr,"fe");function Kst(s){if(s==="")return s;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(s))throw new TypeError(`Invalid hostname '${s}'`);let o=new URL("https://example.com");return o.hostname=s,o.hostname}t(Kst,"z");function Xst(s){if(s==="")return s;if(/[^0-9a-fA-F[\]:]/g.test(s))throw new TypeError(`Invalid IPv6 hostname '${s}'`);return s.toLowerCase()}t(Xst,"j");function Zst(s){if(s===""||/^[0-9]*$/.test(s)&&parseInt(s)<=65535)return s;throw new TypeError(`Invalid port '${s}'.`)}t(Zst,"K");function ftr(s){if(s==="")return s;let o=new URL("https://example.com");return o.pathname=s[0]!=="/"?"/-"+s:s,s[0]!=="/"?o.pathname.substring(2,o.pathname.length):o.pathname}t(ftr,"he");function _tr(s){return s===""?s:new URL(`data:${s}`).pathname}t(_tr,"ue");function ptr(s){if(s==="")return s;let o=new URL("https://example.com");return o.search=s,o.search.substring(1,o.search.length)}t(ptr,"de");function dtr(s){if(s==="")return s;let o=new URL("https://example.com");return o.hash=s,o.hash.substring(1,o.hash.length)}t(dtr,"pe");var mtr=class{static{t(this,"H")}#e;#n=[];#t={};#r=0;#s=1;#m=0;#c=0;#u=0;#f=0;#p=!1;constructor(s){this.#e=s}get result(){return this.#t}parse(){for(this.#n=$st(this.#e,!0);this.#r<this.#n.length;this.#r+=this.#s){if(this.#s=1,this.#n[this.#r].type==="END"){if(this.#c===0){this.#o(),this.#g()?this.#a(9,1):this.#E()?this.#a(8,1):this.#a(7,0);continue}else if(this.#c===2){this.#h(5);continue}this.#a(10,0);break}if(this.#u>0)if(this.#l())this.#u-=1;else continue;if(this.#A()){this.#u+=1;continue}switch(this.#c){case 0:this.#y()&&this.#h(1);break;case 1:if(this.#y()){this.#D();let s=7,o=1;this.#b()?(s=2,o=3):this.#p&&(s=2),this.#a(s,o)}break;case 2:this.#v()?this.#h(3):(this.#S()||this.#E()||this.#g())&&this.#h(5);break;case 3:this.#C()?this.#a(4,1):this.#v()&&this.#a(5,1);break;case 4:this.#v()&&this.#a(5,1);break;case 5:this.#O()?this.#f+=1:this.#N()&&(this.#f-=1),this.#k()&&!this.#f?this.#a(6,1):this.#S()?this.#a(7,0):this.#E()?this.#a(8,1):this.#g()&&this.#a(9,1);break;case 6:this.#S()?this.#a(7,0):this.#E()?this.#a(8,1):this.#g()&&this.#a(9,1);break;case 7:this.#E()?this.#a(8,1):this.#g()&&this.#a(9,1);break;case 8:this.#g()&&this.#a(9,1);break;case 9:break;case 10:break}}this.#t.hostname!==void 0&&this.#t.port===void 0&&(this.#t.port="")}#a(s,o){switch(this.#c){case 0:break;case 1:this.#t.protocol=this.#w();break;case 2:break;case 3:this.#t.username=this.#w();break;case 4:this.#t.password=this.#w();break;case 5:this.#t.hostname=this.#w();break;case 6:this.#t.port=this.#w();break;case 7:this.#t.pathname=this.#w();break;case 8:this.#t.search=this.#w();break;case 9:this.#t.hash=this.#w();break;case 10:break}this.#c!==0&&s!==10&&([1,2,3,4].includes(this.#c)&&[6,7,8,9].includes(s)&&(this.#t.hostname??=""),[1,2,3,4,5,6].includes(this.#c)&&[8,9].includes(s)&&(this.#t.pathname??=this.#p?"/":""),[1,2,3,4,5,6,7].includes(this.#c)&&s===9&&(this.#t.search??="")),this.#i(s,o)}#i(s,o){this.#c=s,this.#m=this.#r+o,this.#r+=o,this.#s=0}#o(){this.#r=this.#m,this.#s=0}#h(s){this.#o(),this.#c=s}#d(s){return s<0&&(s=this.#n.length-s),s<this.#n.length?this.#n[s]:this.#n[this.#n.length-1]}#_(s,o){let f=this.#d(s);return f.value===o&&(f.type==="CHAR"||f.type==="ESCAPED_CHAR"||f.type==="INVALID_CHAR")}#y(){return this.#_(this.#r,":")}#b(){return this.#_(this.#r+1,"/")&&this.#_(this.#r+2,"/")}#v(){return this.#_(this.#r,"@")}#C(){return this.#_(this.#r,":")}#k(){return this.#_(this.#r,":")}#S(){return this.#_(this.#r,"/")}#E(){if(this.#_(this.#r,"?"))return!0;if(this.#n[this.#r].value!=="?")return!1;let s=this.#d(this.#r-1);return s.type!=="NAME"&&s.type!=="REGEX"&&s.type!=="CLOSE"&&s.type!=="ASTERISK"}#g(){return this.#_(this.#r,"#")}#A(){return this.#n[this.#r].type=="OPEN"}#l(){return this.#n[this.#r].type=="CLOSE"}#O(){return this.#_(this.#r,"[")}#N(){return this.#_(this.#r,"]")}#w(){let s=this.#n[this.#r],o=this.#d(this.#m).index;return this.#e.substring(o,s.index)}#D(){let s={};Object.assign(s,rI),s.encodePart=UAe;let o=Ker(this.#w(),void 0,s);this.#p=Gst(o)}},jAe=["protocol","username","password","hostname","port","pathname","search","hash"],tI="*";function zst(s,o){if(typeof s!="string")throw new TypeError("parameter 1 is not of type 'string'.");let f=new URL(s,o);return{protocol:f.protocol.substring(0,f.protocol.length-1),username:f.username,password:f.password,hostname:f.hostname,port:f.port,pathname:f.pathname,search:f.search!==""?f.search.substring(1,f.search.length):void 0,hash:f.hash!==""?f.hash.substring(1,f.hash.length):void 0}}t(zst,"ge");function HP(s,o){return o?WV(s):s}t(HP,"b");function JV(s,o,f){let d;if(typeof o.baseURL=="string")try{d=new URL(o.baseURL),o.protocol===void 0&&(s.protocol=HP(d.protocol.substring(0,d.protocol.length-1),f)),!f&&o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.username===void 0&&(s.username=HP(d.username,f)),!f&&o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.username===void 0&&o.password===void 0&&(s.password=HP(d.password,f)),o.protocol===void 0&&o.hostname===void 0&&(s.hostname=HP(d.hostname,f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&(s.port=HP(d.port,f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.pathname===void 0&&(s.pathname=HP(d.pathname,f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.pathname===void 0&&o.search===void 0&&(s.search=HP(d.search.substring(1,d.search.length),f)),o.protocol===void 0&&o.hostname===void 0&&o.port===void 0&&o.pathname===void 0&&o.search===void 0&&o.hash===void 0&&(s.hash=HP(d.hash.substring(1,d.hash.length),f))}catch{throw new TypeError(`invalid baseURL '${o.baseURL}'.`)}if(typeof o.protocol=="string"&&(s.protocol=ctr(o.protocol,f)),typeof o.username=="string"&&(s.username=str(o.username,f)),typeof o.password=="string"&&(s.password=itr(o.password,f)),typeof o.hostname=="string"&&(s.hostname=ntr(o.hostname,f)),typeof o.port=="string"&&(s.port=otr(o.port,s.protocol,f)),typeof o.pathname=="string"){if(s.pathname=o.pathname,d&&!Qer(s.pathname,f)){let y=d.pathname.lastIndexOf("/");y>=0&&(s.pathname=HP(d.pathname.substring(0,y+1),f)+s.pathname)}s.pathname=atr(s.pathname,s.protocol,f)}return typeof o.search=="string"&&(s.search=rtr(o.search,f)),typeof o.hash=="string"&&(s.hash=ttr(o.hash,f)),s}t(JV,"w");function WV(s){return s.replace(/([+*?:{}()\\])/g,"\\$1")}t(WV,"C");function htr(s){return s.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}t(htr,"Oe");function gtr(s,o){o.delimiter??="/#?",o.prefixes??="./",o.sensitive??=!1,o.strict??=!1,o.end??=!0,o.start??=!0,o.endsWith="";let f=".*",d=`[^${htr(o.delimiter)}]+?`,y=/[$_\u200C\u200D\p{ID_Continue}]/u,E="";for(let P=0;P<s.length;++P){let F=s[P];if(F.type===3){if(F.modifier===3){E+=WV(F.value);continue}E+=`{${WV(F.value)}}${X9(F.modifier)}`;continue}let J=F.hasCustomName(),V=!!F.suffix.length||!!F.prefix.length&&(F.prefix.length!==1||!o.prefixes.includes(F.prefix)),Te=P>0?s[P-1]:null,de=P<s.length-1?s[P+1]:null;if(!V&&J&&F.type===1&&F.modifier===3&&de&&!de.prefix.length&&!de.suffix.length)if(de.type===3){let ae=de.value.length>0?de.value[0]:"";V=y.test(ae)}else V=!de.hasCustomName();if(!V&&!F.prefix.length&&Te&&Te.type===3){let ae=Te.value[Te.value.length-1];V=o.prefixes.includes(ae)}V&&(E+="{"),E+=WV(F.prefix),J&&(E+=`:${F.name}`),F.type===2?E+=`(${F.value})`:F.type===1?J||(E+=`(${d})`):F.type===0&&(!J&&(!Te||Te.type===3||Te.modifier!==3||V||F.prefix!=="")?E+="*":E+=`(${f})`),F.type===1&&J&&F.suffix.length&&y.test(F.suffix[0])&&(E+="\\"),E+=WV(F.suffix),V&&(E+="}"),F.modifier!==3&&(E+=X9(F.modifier))}return E}t(gtr,"ke");var Qst=class{static{t(this,"me")}#e;#n={};#t={};#r={};#s={};#m=!1;constructor(s={},o,f){try{let d;if(typeof o=="string"?d=o:f=o,typeof s=="string"){let F=new mtr(s);if(F.parse(),s=F.result,d===void 0&&typeof s.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");s.baseURL=d}else{if(!s||typeof s!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(d)throw new TypeError("parameter 1 is not of type 'string'.")}typeof f>"u"&&(f={ignoreCase:!1});let y={ignoreCase:f.ignoreCase===!0},E={pathname:tI,protocol:tI,username:tI,password:tI,hostname:tI,port:tI,search:tI,hash:tI};this.#e=JV(E,s,!0),Yst(this.#e.protocol)===this.#e.port&&(this.#e.port="");let P;for(P of jAe){if(!(P in this.#e))continue;let F={},J=this.#e[P];switch(this.#t[P]=[],P){case"protocol":Object.assign(F,rI),F.encodePart=UAe;break;case"username":Object.assign(F,rI),F.encodePart=ltr;break;case"password":Object.assign(F,rI),F.encodePart=utr;break;case"hostname":Object.assign(F,Xer),Vst(J)?F.encodePart=Xst:F.encodePart=Kst;break;case"port":Object.assign(F,rI),F.encodePart=Zst;break;case"pathname":Gst(this.#n.protocol)?(Object.assign(F,Zer,y),F.encodePart=ftr):(Object.assign(F,rI,y),F.encodePart=_tr);break;case"search":Object.assign(F,rI,y),F.encodePart=ptr;break;case"hash":Object.assign(F,rI,y),F.encodePart=dtr;break}try{this.#s[P]=Jst(J,F),this.#n[P]=Wst(this.#s[P],this.#t[P],F),this.#r[P]=gtr(this.#s[P],F),this.#m=this.#m||this.#s[P].some(V=>V.type===2)}catch{throw new TypeError(`invalid ${P} pattern '${this.#e[P]}'.`)}}}catch(d){throw new TypeError(`Failed to construct 'URLPattern': ${d.message}`)}}test(s={},o){let f={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof s!="string"&&o)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof s>"u")return!1;try{typeof s=="object"?f=JV(f,s,!1):f=JV(f,zst(s,o),!1)}catch{return!1}let d;for(d of jAe)if(!this.#n[d].exec(f[d]))return!1;return!0}exec(s={},o){let f={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof s!="string"&&o)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof s>"u")return;try{typeof s=="object"?f=JV(f,s,!1):f=JV(f,zst(s,o),!1)}catch{return null}let d={};o?d.inputs=[s,o]:d.inputs=[s];let y;for(y of jAe){let E=this.#n[y].exec(f[y]);if(!E)return null;let P={};for(let[F,J]of this.#t[y].entries())if(typeof J=="string"||typeof J=="number"){let V=E[F+1];P[J]=V}d[y]={input:f[y]??"",groups:P}}return d}static compareComponent(s,o,f){let d=t((F,J)=>{for(let V of["type","modifier","prefix","value","suffix"]){if(F[V]<J[V])return-1;if(F[V]!==J[V])return 1}return 0},"o"),y=new qV(3,"","","","",3),E=new qV(0,"","","","",3),P=t((F,J)=>{let V=0;for(;V<Math.min(F.length,J.length);++V){let Te=d(F[V],J[V]);if(Te)return Te}return F.length===J.length?0:d(F[V]??y,J[V]??y)},"s");return!o.#r[s]&&!f.#r[s]?0:o.#r[s]&&!f.#r[s]?P(o.#s[s],[E]):!o.#r[s]&&f.#r[s]?P([E],f.#s[s]):P(o.#s[s],f.#s[s])}get protocol(){return this.#r.protocol}get username(){return this.#r.username}get password(){return this.#r.password}get hostname(){return this.#r.hostname}get port(){return this.#r.port}get pathname(){return this.#r.pathname}get search(){return this.#r.search}get hash(){return this.#r.hash}get hasRegExpGroups(){return this.#m}};globalThis.URLPattern||(globalThis.URLPattern=Qst);import{AssertionError as ytr}from"node:assert";function GP(s,o){if(s===!1)throw new ytr({message:o})}t(GP,"assert");var Wo;(function(s){s.Object="Object",s.Property="Property",s.Array="Array",s.Literal="Literal",s.TemplateString="TemplateString",s.Identifier="Identifier",s.FunctionCall="FunctionCall",s.Raw="Raw"})(Wo||(Wo={}));function Z9(s){return s.type===Wo.Object}t(Z9,"isAstObject");function YP(s){return s.type===Wo.Property}t(YP,"isAstProperty");function zAe(s){return s.type===Wo.Array}t(zAe,"isAstArray");function TO(s){return s.type===Wo.Literal}t(TO,"isAstLiteral");function nI(s){if(s===void 0)throw new Error("Node is undefined");if(!Z9(s))throw new Error("Node is not object")}t(nI,"assertAstObject");import{findNodeAtLocation as vtr,getNodeValue as btr,printParseErrorCode as Str,visit as Ttr}from"jsonc-parser";var xtr={DEFAULT:{allowTrailingComma:!1}};function VV(s,o=[],f=xtr.DEFAULT){let d={type:"array",offset:-1,length:-1,line:-1,column:-1,children:[],parent:void 0};function y(J){d.type==="property"&&(d.length=J-d.offset,d=d.parent)}t(y,"ensurePropertyComplete");function E(J){return d.children?.push(J),J}t(E,"onValue"),Ttr(s,{onObjectBegin:t((J,V,Te)=>{d=E({type:"object",offset:J,length:-1,line:V+1,column:Te+1,parent:d,children:[]})},"onObjectBegin"),onObjectProperty:t((J,V,Te,de,ae)=>{d=E({type:"property",offset:V,length:-1,line:de+1,column:ae+1,parent:d,children:[]}),d.children?.push({type:"string",value:J,offset:V,length:Te,line:de,column:ae,parent:d})},"onObjectProperty"),onObjectEnd:t((J,V)=>{y(J+V),d.length=J+V-d.offset,d=d.parent,y(J+V)},"onObjectEnd"),onArrayBegin:t((J,V,Te,de)=>{d=E({type:"array",offset:J,length:-1,line:Te+1,column:de+1,parent:d,children:[]})},"onArrayBegin"),onArrayEnd:t((J,V)=>{d.length=J+V-d.offset,d=d.parent,y(J+V)},"onArrayEnd"),onLiteralValue:t((J,V,Te,de,ae)=>{E({type:Etr(J),offset:V,length:Te,line:de+1,column:ae+1,parent:d,value:J}),y(V+Te)},"onLiteralValue"),onSeparator:t((J,V)=>{d.type==="property"&&(J===":"?d.colonOffset=V:J===","&&y(V))},"onSeparator"),onError:t((J,V,Te,de,ae)=>{o.push({error:J,offset:V,length:Te,line:de+1,column:ae+1})},"onError")},f);let F=d.children?.[0];return F&&delete F.parent,F}t(VV,"parse");function Etr(s){switch(typeof s){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(s){if(Array.isArray(s))return"array"}else return"null";return"object"}default:return"null"}}t(Etr,"getNodeType");function $Ae(s,o){return vtr(s,o)}t($Ae,"findNodeAtLocation");function HV(s){return btr(s)}t(HV,"getNodeValue");function eat(s){return Str(s)}t(eat,"printParseErrorCode");var GV=class{static{t(this,"AstAdapter")}parse(o){let d=VV(o,[]);if(d)return this.parseNode(d,void 0);throw new Error("Failed to parse JSON")}convert(o){return this.parseNode(o,void 0)}parseNode(o,f){switch(o.type){case"object":return this.createObject(o,f);case"array":return this.createArray(o,f);case"property":return this.createProperty(o,f);case"string":return this.createLiteral(o,f);case"number":return this.createLiteral(o,f);case"boolean":return this.createLiteral(o,f);case"null":return this.createLiteral(o,f)}}createLiteral(o,f){return{type:Wo.Literal,location:{line:o.line,column:o.column},parent:f,value:o.type==="null"?null:o.value}}createObject(o,f){let d={type:Wo.Object,children:[],parent:f,location:{line:o.line,column:o.column}};return o.children?.forEach(y=>{d.children.push(this.parseNode(y,d))}),d}createProperty(o,f){GP(o.children?.length===2,"Invalid property node");let d={type:Wo.Property,location:{line:o.line,column:o.column},parent:f,name:null,value:null};return d.name={value:o.children[0].value,location:{line:o.line,column:o.column},type:Wo.Identifier,parent:d},d.value=this.parseNode(o.children[1],d),d}createArray(o,f){let d={type:Wo.Array,location:{line:o.line,column:o.column},parent:f,children:[]};return o.children?.forEach(y=>d.children.push(this.parseNode(y,d))),d}};var DS={createLiteral:t((s,o)=>({type:Wo.Literal,parent:o,value:s}),"createLiteral"),createTemplateString:t((s,o)=>({type:Wo.TemplateString,parent:o,value:s}),"createTemplateString"),createIdentifier:t((s,o)=>({type:Wo.Identifier,value:s,parent:o}),"createIdentifier"),createProperty:t((s,o,f)=>{let d={type:Wo.Property,parent:f,name:null,value:o};return d.name={value:s,type:Wo.Identifier,parent:d},d.value.parent=d,d},"createProperty"),createArrayOfLiterals:t((s,o)=>{let f={type:Wo.Array,parent:o,children:[]};for(let d of s)f.children.push(DS.createLiteral(d,f));return f},"createArrayOfLiterals")};var Ctr=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,YV=class{static{t(this,"SourceGenerator")}generate(o){let f=[];return this.generateSource(f,o),f.join("")}generateSource(o,f){switch(f.type){case Wo.Array:return this.generateArray(o,f);case Wo.Object:return this.generateObject(o,f);case Wo.Property:return this.generateProperty(o,f);case Wo.Literal:return this.generateLiteral(o,f);case Wo.FunctionCall:return this.generateFunctionCall(o,f);case Wo.Identifier:return this.generateIdentifier(o,f);case Wo.Raw:return this.generateRaw(o,f);case Wo.TemplateString:return this.generateTemplateString(o,f)}}generateArray(o,f){o.push("["),f.children.map(d=>{this.generateSource(o,d),o.push(",")}),o.push("]")}generateObject(o,f){o.push("{"),f.children.forEach(d=>{this.generateSource(o,d),o.push(",")}),o.push("}")}generateProperty(o,f){this.generateIdentifier(o,f.name),o.push(":"),this.generateSource(o,f.value)}generateFunctionCall(o,f){o.push(f.name.value),o.push("("),f.children.forEach((d,y,E)=>{this.generateSource(o,d),y<E.length&&o.push(",")}),o.push(")")}generateRaw(o,f){o.push(f.value)}generateTemplateString(o,f){o.push("`"),o.push(f.value.replaceAll("`","\\`")),o.push("`")}generateLiteral(o,f){if(f.value===null)return o.push("null");switch(typeof f.value){case"number":case"boolean":return o.push(`${f.value}`);case"string":{let d=f.value,y=JSON.stringify(d);return o.push(`${y}`)}}}generateIdentifier(o,f){let d=Ctr.test(f.value)?f.value:`'${f.value}'`;o.push(d)}};import ktr from"node:fs/promises";import{parse as wtr}from"@swc/core";var tat=t(async s=>{let o=new Set;try{let f=await ktr.readFile(s,"utf-8");(await wtr(f,{syntax:"typescript"})).body.forEach(y=>{y.type==="ExportDefaultDeclaration"||y.type==="ExportDefaultExpression"?o.add("default"):y.type==="ExportDeclaration"&&y.declaration.type==="FunctionDeclaration"?o.add(y.declaration.identifier.value):y.type==="ExportDeclaration"&&y.declaration.type==="VariableDeclaration"&&y.declaration.declarations[0].id.type==="Identifier"&&o.add(y.declaration.declarations[0].id.value)})}catch{return null}return o},"getJSFileExports");var rat={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/fragments.schema.json",$defs:{corsPolicyConfiguration:{type:"object",required:["name","allowedOrigins"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[0-9a-z-]+$"},allowCredentials:{type:"boolean"},maxAge:{type:"number"},allowedOrigins:{oneOf:[{type:"array",items:{type:"string"}},{type:"string"}]},allowedMethods:{oneOf:[{type:"array",items:{$ref:"fragments.schema.json#/$defs/httpMethod"}},{type:"string"}]},allowedHeaders:{oneOf:[{type:"array",items:{type:"string"}},{type:"string"}]},exposeHeaders:{oneOf:[{type:"array",items:{type:"string"}},{type:"string"}]}}},handlerDefinition:{type:"object",properties:{module:{type:"string",pattern:"^\\$import\\([^ )]*?\\)$"},export:{type:"string"},options:{type:"object",additionalProperties:!0}},additionalProperties:!1,required:["module","export"]},httpMethod:{type:"string",enum:["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]}}};var JAe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/policies.schema.json",title:"Policies Config File",type:"object",additionalProperties:!1,properties:{policies:{type:"array",items:{$ref:"policy-configuration.schema.json"}},corsPolicies:{type:"array",items:{$ref:"fragments.schema.json#/$defs/corsPolicyConfiguration"}}}};var nat={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/policy-configuration.schema.json",title:"Policy Configuration Fragment",type:"object",required:["name","policyType","handler"],additionalProperties:!1,properties:{name:{type:"string",pattern:"^[0-9a-z-]+$"},policyType:{type:"string"},handler:{$ref:"fragments.schema.json#/$defs/handlerDefinition"},options:{type:"object",additionalProperties:!0}}};var WAe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/route-configuration.schema.json",title:"Route Configuration Fragment",description:"",type:"object",required:["path","methods","handler"],additionalProperties:!1,$defs:{corsPolicy:{type:"string",pattern:"^[0-9a-z-]+$"}},properties:{operationId:{type:"string"},path:{type:"string",pattern:"^/[^\\s]*$"},methods:{type:"array",items:{$ref:"fragments.schema.json#/$defs/httpMethod"}},label:{type:"string",description:"An internal user-friendly identifier of the route."},enforceOpenApi:{type:"boolean",description:"If true, schema validation found in the OpenAPI spec will be enforced on requests/responses."},key:{type:"string",deprecated:!0},handler:{$ref:"fragments.schema.json#/$defs/handlerDefinition"},corsPolicy:{$ref:"#/$defs/corsPolicy"},custom:{},mcp:{type:"object",additionalProperties:!1,properties:{enabled:{type:"boolean"}}},policies:{type:"object",additionalProperties:!1,properties:{inbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}},outbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}}}},summary:{type:"string"},description:{type:"string"},excludeFromOpenApi:{type:"boolean"},tags:{type:"array",items:{type:"string"}}}};var qAe={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/route-configuration-open-api.schema.json",title:"Open API Route Configuration Fragment",description:"These are the properties that can appear under the x-zuplo-route extension in a PathObject in Open API. It's a subset of what can appear in Zuplo's routes.json.",type:"object",required:["handler"],additionalProperties:!1,properties:{label:{type:"string",description:"An internal user-friendly identifier of the route."},key:{type:"string",deprecated:!0},handler:{$ref:"fragments.schema.json#/$defs/handlerDefinition"},corsPolicy:{type:"string",pattern:"^[0-9a-z-]+$"},custom:{},mcp:{oneOf:[{type:"object",additionalProperties:!1,properties:{type:{const:"tool"},name:{type:"string"},description:{type:"string"},enabled:{type:"boolean"},includeOutputSchema:{type:"boolean"},includeStructuredContent:{type:"boolean"},annotations:{type:"object",additionalProperties:!1,properties:{title:{type:"string"},readOnlyHint:{type:"boolean"},destructiveHint:{type:"boolean"},idempotentHint:{type:"boolean"},openWorldHint:{type:"boolean"}}},_meta:{type:"object",additionalProperties:!0}},required:["type"]},{type:"object",additionalProperties:!1,properties:{type:{const:"prompt"},name:{type:"string"},description:{type:"string"},enabled:{type:"boolean"}},required:["type"]},{type:"object",additionalProperties:!1,properties:{type:{const:"resource"},name:{type:"string"},description:{type:"string"},uri:{type:"string"},mimeType:{type:"string"},enabled:{type:"boolean"},_meta:{type:"object",additionalProperties:!0}},required:["type"]},{type:"object",additionalProperties:!1,properties:{type:{const:"graphql"},enabled:{type:"boolean"},introspectionTool:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},description:{type:"string"}}},executeTool:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},description:{type:"string"}}}},required:["type"]}]},policies:{type:"object",additionalProperties:!1,properties:{inbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}},outbound:{type:"array",items:{type:"string",pattern:"^[0-9a-z-]+$"}}}},tags:{type:"array",items:{type:"string"}}}};var llt=tp(Kce(),1),ult=tp(clt(),1);var Qce=class s{static{t(this,"JsonValidator")}static#e=new s;static get instance(){return s.#e}ajv;constructor(){this.ajv=new llt.Ajv2020({allErrors:!0,allowUnionTypes:!0}),this.ajv.addKeyword("faker"),(0,ult.default)(this.ajv,{mode:"fast"})}addSchema(o,f){this.ajv.addSchema(o,f)}compile(o){let f=this.ajv.compile(o);return t(y=>({isValid:f(y),errors:this.toSimpleErrors(f.errors,y),warnings:[]}),"validator")}toSimpleErrors(o,f){let d=[];return o?.forEach(y=>{y.keyword==="enum"&&y.params.allowedValues&&Array.isArray(y.params.allowedValues)&&(y.message+=`; ${y.params.allowedValues.join(", ")}`),y.instancePath&&(y.instancePath=y.instancePath.replaceAll(/(\/)?(~1)(\/)?/gm,"/"));let E={details:{}},P=y.instancePath.split("/");if(P.length>2){let J=P[1],V=P[2]?parseInt(P[2],10):0,Te=P[3],de=Number.isNaN(V)?void 0:f[J][V][Te];E={details:{property:J,index:V,field:Te,fieldValue:de}}}if(y.keyword==="required"&&y.params.missingProperty&&y.instancePath&&(y.message=`A 'path' is missing required property '${y.params.missingProperty}'`),y.keyword==="additionalProperties"&&y.params.additionalProperty&&y.instancePath&&(y.message=`A 'path' should NOT include property '${y.params.additionalProperty}'`),y.keyword==="type"&&y.params.type&&y.instancePath){let J=y.instancePath.split("/"),V=J[J.length-1];y.message=`Value of property '${V}' must be '${y.params.type}'`}let F=Object.assign(y,E);d.push(F)}),d}};var pI=Qce.instance;pI.addSchema(WAe,"route-configuration.schema.json");pI.addSchema(nat,"policy-configuration.schema.json");pI.addSchema(JAe,"policies.schema.json");pI.addSchema(qAe,"open-api-route-configuration.schema.json");pI.addSchema(rat,"fragments.schema.json");var T6r=pI.compile(WAe),flt=pI.compile(qAe),aIe=pI.compile(JAe);var ele=class{static{t(this,"PoliciesConfigurationValidator")}results;validate(o){return this.results=aIe(o),this.results}};var tle=class{static{t(this,"OpenAPILocalizedValidator")}results;validate(o){return this.results=flt(o),this.results}};import Mcr from"node:path";var oIe=/\$import\((.*)\)/,wH=/\$env\((.*?)\)/g;var zk=class extends Error{static{t(this,"CodeGenError")}location;constructor(o,f,d,y){super(o),this.location={file:f,namespace:"",line:d?d.line:0,column:d?d.column:0,length:0,lineText:y??"",suggestion:""}}},Rcr=t(s=>{let o=[],f=s;for(;f.parent;)o.push(f),f=f.parent;return o.reverse()},"invertTree"),eA=t((s,o)=>{if(!s)return!1;let f=Rcr(s);return o.split("/").every((E,P)=>{let F=f[P];return F?E==="*"||YP(F)&&F.name.value===E?!0:E==="{}"?F.type===Wo.Object:E==="[]"?F.type===Wo.Array:!1:!1})},"testPosition");var rle=class{static{t(this,"AstTransformer")}errors=[];transform(o){return this.visitor(o),o}visitor(o){this.visit(o),Z9(o)?o.children.forEach(f=>{this.visitor(f)}):zAe(o)?o.children.forEach(f=>{this.visitor(f)}):YP(o)&&this.visitor(o.value)}},_lt=t(s=>{let o=new RegExp(wH).exec(s);if(o?.length===2&&o[0]===s)return{type:"raw",value:`environment["${o[1]}"]`};{let f=s.replaceAll(new RegExp(wH),(d,y)=>`\${environment["${y}"] ? environment["${y}"] : ""}`);if(f!==s)return{type:"template",value:f}}return null},"replaceEnvInString"),plt=t((s,o,f)=>d=>{if(TO(d)&&typeof d.value=="string"&&d.parent&&zAe(d.parent)){if(!s.some(P=>eA(d.parent,P))){wH.test(d.value)&&o.push(new zk("An $env() statement is not expected at this location.",f,d.location,d.value));return}let E=_lt(d.value);if(E){let P=d.parent,F=P.children.indexOf(d);if(F!==-1)if(E.type==="raw"){let J={type:Wo.Raw,parent:P,value:E.value};P.children[F]=J}else P.children[F]=DS.createTemplateString(E.value,d)}return}if(!YP(d)||!TO(d.value)||typeof d.value.value!="string")return;if(!s.some(E=>eA(d,E))){wH.test(d.value.value)&&o.push(new zk("An $env() statement is not expected at this location.",f,d.location,d.value.value));return}let y=_lt(d.value.value);if(y)if(y.type==="raw"){let E={type:Wo.Raw,parent:null,value:y.value};d.value=E}else d.value=DS.createTemplateString(y.value,d)},"getEnvStatementTransformer");var DH="config/routes.json",jcr=["handler/{}/options/*","handler/{}/options/*/[]","policies/[]/{}/handler/{}/options/*","policies/[]/{}/handler/{}/options/*/[]","corsPolicies/[]/{}/*","corsPolicies/[]/{}/*/[]"],Bcr=["handler/{}/module","handler/{}/options/{}/policies/{}/inbound/[]/{}/module","handler/{}/options/{}/policies/{}/outbound/[]/{}/module","policies/[]/{}/handler/{}/module","policies/[]/{}/handler/{}/options/{}/identifier/{}/module","policies/[]/{}/handler/{}/options/{}/validator"],dlt=["handler/{}/options/*","policies/[]/{}/handler/{}/options/*"],Ucr="handler/{}/options/{}/rewritePattern",zcr="handler/{}/options/{}/baseUrl",nle=class extends rle{static{t(this,"OpenAPIRoutesFragmentAstTransformer")}importCount=0;addedImports=new Map;getImportName(o){this.addedImports.has(o)||this.addedImports.set(o,`__import${this.importCount++}`);let f=this.addedImports.get(o);if(!f)throw new Error("Import name is undefined. This should not happen.");return f}getImports(){let o=[];return this.addedImports.forEach((f,d)=>{o.push({name:f,path:d})}),o}visit(o){this.rewriteHandlerFunction(o),this.rewriteForwardFunction(o),this.replaceImportStatements(o),this.replaceEnvStatements(o)}rewriteHandlerFunction(o){if(!(!YP(o)||!TO(o.value)||typeof o.value.value!="string")&&eA(o,Ucr)){if(!o.parent||!Z9(o.parent)){this.errors.push(new zk("Invalid node, expected object",DH,o.parent?o.parent.location:o.location,void 0));return}let f=o.value.value,d={type:Wo.Raw,parent:null,value:mlt(f)},y=DS.createProperty("__rewriteFunction",d,o);o.parent.children.push(y)}}rewriteForwardFunction(o){if(!(!YP(o)||!TO(o.value)||typeof o.value.value!="string")&&eA(o,zcr)){if(!o.parent||!Z9(o.parent)){this.errors.push(new zk("Invalid node, expected object",DH,o.parent?o.parent.location:o.location,void 0));return}let f=o.value.value,d={type:Wo.Raw,parent:null,value:mlt(f)},y=DS.createProperty("__rewriteFunction",d,o);o.parent.children.push(y)}}replaceImportStatements(o){if(!YP(o)||!TO(o.value))return;let f=o.value.value;if(typeof f!="string")return;if(!Bcr.some(F=>eA(o,F))&&!dlt.some(F=>eA(o,F))){if(oIe.test(f)){if(o.name.value==="$ref")return;this.errors.push(new zk("An $import() statement is not expected at this location.",DH,o.location,f))}return}let d=oIe.exec(f);if(dlt.some(F=>eA(o,F))&&!d)return;if(!d){this.errors.push(new zk("Invalid $import() statement",DH,o.location,f));return}let y=d[1];y=y.replace(/\\/g,"/"),y.startsWith(".")&&(y=Mcr.posix.join("..",y));let E=this.getImportName(y),P={type:Wo.Identifier,parent:o.parent,value:E};o.value=P}replaceEnvStatements=plt(jcr,this.errors,DH)};function mlt(s){return`(request, context) => {
|
|
576
576
|
const { params, url, query, method, headers } = request;
|
|
577
577
|
const { host, hostname, origin, pathname, port, search } = new URL(url);
|
|
578
578
|
const e = encodeURIComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EAGrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAeD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAKtC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CA+DnE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,eAAe,GACzB,OAAO,CAgCT;AAuDD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GACb,IAAI,CAiFN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AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,GACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GACf;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CA6B1D"}
|
|
@@ -243,6 +243,83 @@ export function setValueAtPath(doc, target, value) {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* Determine whether a JSONPath target points at a single, literal location that
|
|
248
|
+
* can be safely materialized with {@link setValueAtPath}.
|
|
249
|
+
*
|
|
250
|
+
* A target is "concrete" when every segment is a literal object key or array
|
|
251
|
+
* index. Targets that use JSONPath wildcards (`.*`, `[*]`), recursive descent
|
|
252
|
+
* (`..`), filter/script expressions (`[?(...)]`, `[(...)]`), array slices
|
|
253
|
+
* (`[1:3]`), or unions (`[0,1]`) resolve to zero-or-many nodes and have no
|
|
254
|
+
* single location that could be created.
|
|
255
|
+
*
|
|
256
|
+
* This matters because the update branch only auto-creates a missing target for
|
|
257
|
+
* concrete paths. Creating a non-concrete target would materialize a bogus
|
|
258
|
+
* literal key — e.g. `$.paths.*.get` against a doc with no matching method used
|
|
259
|
+
* to create a path literally named `*`. Beyond being wrong output, a literal
|
|
260
|
+
* `*` key poisons every later wildcard: jsonpath-plus matches `$.paths.*` to the
|
|
261
|
+
* literal `*` key instead of all children, so subsequent dot-wildcard removes
|
|
262
|
+
* silently match nothing. Treating unmatched non-concrete updates as a no-op
|
|
263
|
+
* avoids both problems (and removes the need for callers to order removes before
|
|
264
|
+
* updates as a workaround).
|
|
265
|
+
*/
|
|
266
|
+
function isConcreteTarget(target) {
|
|
267
|
+
// Strip the leading root token ($). The remaining path is scanned in a single
|
|
268
|
+
// linear pass (no backtracking regex — the target is caller-controlled, so a
|
|
269
|
+
// polynomial regex here would be a ReDoS vector) to classify each segment as
|
|
270
|
+
// a literal key/index (concrete) or a dynamic construct.
|
|
271
|
+
const path = target.startsWith("$") ? target.slice(1) : target;
|
|
272
|
+
let i = 0;
|
|
273
|
+
const len = path.length;
|
|
274
|
+
while (i < len) {
|
|
275
|
+
const ch = path[i];
|
|
276
|
+
if (ch === "[") {
|
|
277
|
+
const quote = path[i + 1];
|
|
278
|
+
if (quote === "'" || quote === '"') {
|
|
279
|
+
// Quoted key — always a concrete literal, even if it contains `:`, `,`,
|
|
280
|
+
// or `.`. Skip past the closing quote and its `]`.
|
|
281
|
+
i += 2;
|
|
282
|
+
while (i < len && path[i] !== quote) {
|
|
283
|
+
i++;
|
|
284
|
+
}
|
|
285
|
+
i++; // closing quote
|
|
286
|
+
if (path[i] === "]") {
|
|
287
|
+
i++;
|
|
288
|
+
}
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
// Unquoted bracket: collect its contents up to the closing `]`.
|
|
292
|
+
i++; // opening `[`
|
|
293
|
+
let inner = "";
|
|
294
|
+
while (i < len && path[i] !== "]") {
|
|
295
|
+
inner += path[i];
|
|
296
|
+
i++;
|
|
297
|
+
}
|
|
298
|
+
i++; // closing `]`
|
|
299
|
+
const trimmed = inner.trim();
|
|
300
|
+
// Wildcard, filter, script, slice, or union are dynamic; a plain key or
|
|
301
|
+
// numeric index is concrete.
|
|
302
|
+
if (trimmed === "*" ||
|
|
303
|
+
trimmed.startsWith("?") ||
|
|
304
|
+
trimmed.startsWith("(") ||
|
|
305
|
+
trimmed.includes(":") ||
|
|
306
|
+
trimmed.includes(",")) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
// Dot-notation wildcard, e.g. `.*` or `paths.*.get`.
|
|
312
|
+
if (ch === "*") {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
// Recursive descent (`..`).
|
|
316
|
+
if (ch === "." && path[i + 1] === ".") {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
i++;
|
|
320
|
+
}
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
246
323
|
/**
|
|
247
324
|
* Apply a single overlay action to the document
|
|
248
325
|
*/
|
|
@@ -278,7 +355,14 @@ export function applyAction(doc, action) {
|
|
|
278
355
|
}
|
|
279
356
|
return { applied: true, count };
|
|
280
357
|
}
|
|
281
|
-
// Path doesn't exist
|
|
358
|
+
// Path doesn't exist. Only auto-create when the target is a single
|
|
359
|
+
// concrete location. A wildcard/filter target that matched nothing has no
|
|
360
|
+
// location to create — materializing it would produce a bogus literal key
|
|
361
|
+
// (e.g. a path named `*`) that also poisons later wildcard matching, so we
|
|
362
|
+
// treat it as a no-op instead.
|
|
363
|
+
if (!isConcreteTarget(action.target)) {
|
|
364
|
+
return { applied: false, count: 0 };
|
|
365
|
+
}
|
|
282
366
|
setValueAtPath(doc, action.target, action.update);
|
|
283
367
|
return { applied: true, count: 1 };
|
|
284
368
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../src/overlay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAIL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAazB;;;GAGG;AACH,SAAS,QAAQ,CAAC,KAAc,EAAE,OAAe;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CACb,sBAAsB,OAAO,aAAa,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAA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C,OAAO,EAAE,CAAC;QAC9C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEvD,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,uCAAuC;IACvC,MAAM,SAAS,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACrD,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEhC,wCAAwC;IACxC,MAAM,SAAS,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAEpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -209,6 +209,52 @@ describe("OpenAPI Overlay Engine", () => {
|
|
|
209
209
|
assert.deepStrictEqual(doc.paths["/users"].get.tags, ["public"]);
|
|
210
210
|
assert.deepStrictEqual(doc.paths["/posts"].get.tags, ["public"]);
|
|
211
211
|
});
|
|
212
|
+
it("should not create a bogus '*' path when a wildcard update matches nothing", () => {
|
|
213
|
+
const doc = {
|
|
214
|
+
paths: {
|
|
215
|
+
"/users": { post: {} },
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
const action = {
|
|
219
|
+
target: "$.paths.*.get",
|
|
220
|
+
update: { tags: ["public"] },
|
|
221
|
+
};
|
|
222
|
+
const result = applyAction(doc, action);
|
|
223
|
+
// No method matched, so there is nothing to update and nothing to create.
|
|
224
|
+
assert.strictEqual(result.applied, false);
|
|
225
|
+
assert.strictEqual(result.count, 0);
|
|
226
|
+
assert.deepStrictEqual(Object.keys(doc.paths), ["/users"]);
|
|
227
|
+
assert.strictEqual("*" in doc.paths, false);
|
|
228
|
+
});
|
|
229
|
+
it("should not create a bogus '*' path for a leaf dot-wildcard update with no matches", () => {
|
|
230
|
+
const doc = {
|
|
231
|
+
paths: {
|
|
232
|
+
"/users": {},
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
const action = {
|
|
236
|
+
target: "$.paths['/users'].*",
|
|
237
|
+
update: { tags: ["public"] },
|
|
238
|
+
};
|
|
239
|
+
const result = applyAction(doc, action);
|
|
240
|
+
assert.strictEqual(result.applied, false);
|
|
241
|
+
assert.strictEqual(result.count, 0);
|
|
242
|
+
assert.deepStrictEqual(doc.paths["/users"], {});
|
|
243
|
+
});
|
|
244
|
+
it("should still create a concrete path that does not yet exist", () => {
|
|
245
|
+
const doc = { paths: {} };
|
|
246
|
+
const action = {
|
|
247
|
+
target: "$.paths['/orders'].get",
|
|
248
|
+
update: { summary: "List orders" },
|
|
249
|
+
};
|
|
250
|
+
const result = applyAction(doc, action);
|
|
251
|
+
assert.strictEqual(result.applied, true);
|
|
252
|
+
assert.strictEqual(result.count, 1);
|
|
253
|
+
const paths = doc.paths;
|
|
254
|
+
assert.deepStrictEqual(paths["/orders"], {
|
|
255
|
+
get: { summary: "List orders" },
|
|
256
|
+
});
|
|
257
|
+
});
|
|
212
258
|
});
|
|
213
259
|
describe("applyAction - remove operations", () => {
|
|
214
260
|
it("should remove a property from object", () => {
|
|
@@ -345,6 +391,42 @@ describe("OpenAPI Overlay Engine", () => {
|
|
|
345
391
|
});
|
|
346
392
|
});
|
|
347
393
|
describe("applyOverlay - full integration", () => {
|
|
394
|
+
it("should apply a dot-wildcard remove regardless of action order", () => {
|
|
395
|
+
// Regression: a wildcard update that matched nothing used to create a
|
|
396
|
+
// bogus '*' path, and jsonpath-plus then resolves `$.paths.*` to that
|
|
397
|
+
// literal '*' key instead of the real paths — so a later dot-wildcard
|
|
398
|
+
// remove silently matched nothing. The remove only worked if emitted
|
|
399
|
+
// before the update. It must now work in either order.
|
|
400
|
+
const openapi = {
|
|
401
|
+
openapi: "3.1.0",
|
|
402
|
+
info: { title: "API", version: "1.0.0" },
|
|
403
|
+
paths: {
|
|
404
|
+
"/users": { delete: {} },
|
|
405
|
+
"/posts": { delete: {} },
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
// Naive (update-first) ordering: the wildcard `get` update matches no
|
|
409
|
+
// method in the source document.
|
|
410
|
+
const overlay = {
|
|
411
|
+
overlay: "1.0.0",
|
|
412
|
+
info: { title: "Overlay", version: "1.0.0" },
|
|
413
|
+
actions: [
|
|
414
|
+
{ target: "$.paths.*.get", update: { tags: ["public"] } },
|
|
415
|
+
{ target: "$.paths.*.delete", remove: true },
|
|
416
|
+
],
|
|
417
|
+
};
|
|
418
|
+
const { result, stats } = applyOverlay(openapi, overlay);
|
|
419
|
+
const paths = result.paths;
|
|
420
|
+
// No bogus '*' path was created by the unmatched wildcard update...
|
|
421
|
+
assert.strictEqual("*" in paths, false);
|
|
422
|
+
assert.deepStrictEqual(Object.keys(paths), ["/users", "/posts"]);
|
|
423
|
+
// ...so the dot-wildcard remove still matched and stripped every delete.
|
|
424
|
+
assert.strictEqual("delete" in paths["/users"], false);
|
|
425
|
+
assert.strictEqual("delete" in paths["/posts"], false);
|
|
426
|
+
// The unmatched update is a no-op (skipped); the remove applied.
|
|
427
|
+
assert.strictEqual(stats.applied, 1);
|
|
428
|
+
assert.strictEqual(stats.skipped, 1);
|
|
429
|
+
});
|
|
348
430
|
it("should apply a complete overlay document", () => {
|
|
349
431
|
const openapi = {
|
|
350
432
|
openapi: "3.1.0",
|