@zuplo/runtime 5.2367.0 → 5.2369.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- "use strict";var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var r=(e,t)=>u(e,"name",{value:t,configurable:!0});var h=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})},U=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of E(t))!P.call(e,s)&&s!==n&&u(e,s,{get:()=>t[s],enumerable:!(i=f(t,s))||i.enumerable});return e};var R=e=>U(u({},"__esModule",{value:!0}),e);var T={};h(T,{getIdForParameterSchema:()=>p,getIdForRefSchema:()=>O,getIdForRequestBodySchema:()=>L,getRawOperationDataIdentifierName:()=>m,isRestrictedEnvVariableName:()=>l,isZuploReadableEnvVariableName:()=>g,sanitizedIdentifierName:()=>a});module.exports=R(T);var _="2024-03-14",d=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function c(){return new o({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:_,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:d[_]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}r(c,"getMockEnvironment");var o=class e{static{r(this,"Environment")}config;static#e;static#t=!1;static initialize(t){this.#e||(this.#e=new e(t),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=c()),this.#e}constructor({build:t,runtime:n}){let i;try{if(n.__ZUPLO_CONFIG){let s=atob(n.__ZUPLO_CONFIG);i=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=i??{},this.build=t,this.runtime=n,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get zuploClientAuthBucketId(){return this.config.zuplo_auth_client_bucket_id??"auth_o8PUdhKxSTOiB794GWPwLQCD"}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get developerApiUrl(){return this.config.developer_api_url??"https://dev.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get authClientId(){return this.runtime.__ZUPLO_AUTH_CLIENT_ID}get authClientSecret(){return this.runtime.__ZUPLO_AUTH_CLIENT_SECRET}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.IS_LOCAL_DEVELOPMENT}get isTestMode(){return!!this.runtime.__ZUPLO_TEST_MODE}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};var I=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function l(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!I.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}r(l,"isRestrictedEnvVariableName");function g(e){return!!e.startsWith("ZUPLO_")}r(g,"isZuploReadableEnvVariableName");var x=new Proxy({},{get(e,t){let n=String(t);switch(n){case"ZUPLO_ENVIRONMENT_TYPE":return o.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return o.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return o.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return o.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return o.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return o.instance.build.BUILD_ID}if(!(l(n)&&!g(n)))return o.instance.runtime[n]}});function m(e,t,n){return`_${a(e+"_"+t+"_"+n)}`}r(m,"getRawOperationDataIdentifierName");function p(e,t,n,i){return`_${a(e.toLowerCase())}_`+t.toLowerCase()+"_"+n.toLowerCase()+`_${i.toLowerCase()}`}r(p,"getIdForParameterSchema");function L(e,t,n){return`_${a(e.toLowerCase())}_`+t.toLowerCase()+`_rb_${a(n.toLowerCase())}`}r(L,"getIdForRequestBodySchema");function O(e,t){return`_${a(e)}__${a(t)}`}r(O,"getIdForRefSchema");function a(e){let t=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i>="0".charCodeAt(0)&&i<="9".charCodeAt(0)||i>="A".charCodeAt(0)&&i<="Z".charCodeAt(0)||i>="a".charCodeAt(0)&&i<="z".charCodeAt(0)?t.push(e.charAt(n)):t.push("_")}return t.join("")}r(a,"sanitizedIdentifierName");
25
+ "use strict";var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var r=(e,t)=>u(e,"name",{value:t,configurable:!0});var h=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})},U=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of E(t))!P.call(e,s)&&s!==n&&u(e,s,{get:()=>t[s],enumerable:!(i=f(t,s))||i.enumerable});return e};var R=e=>U(u({},"__esModule",{value:!0}),e);var T={};h(T,{getIdForParameterSchema:()=>p,getIdForRefSchema:()=>O,getIdForRequestBodySchema:()=>L,getRawOperationDataIdentifierName:()=>m,isRestrictedEnvVariableName:()=>l,isZuploReadableEnvVariableName:()=>g,sanitizedIdentifierName:()=>a});module.exports=R(T);var _="2024-03-14",d=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function c(){return new o({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:_,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:d[_]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}r(c,"getMockEnvironment");var o=class e{static{r(this,"Environment")}config;static#e;static#t=!1;static initialize(t){this.#e||(this.#e=new e(t),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=c()),this.#e}constructor({build:t,runtime:n}){let i;try{if(n.__ZUPLO_CONFIG){let s=atob(n.__ZUPLO_CONFIG);i=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=i??{},this.build=t,this.runtime=n,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get zuploClientAuthBucketId(){return this.config.zuplo_auth_client_bucket_id??"auth_o8PUdhKxSTOiB794GWPwLQCD"}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get developerApiUrl(){return this.config.developer_api_url??"https://dev.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get authClientId(){return this.runtime.__ZUPLO_AUTH_CLIENT_ID}get authClientSecret(){return this.runtime.__ZUPLO_AUTH_CLIENT_SECRET}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.IS_LOCAL_DEVELOPMENT}get isTestMode(){return!!this.runtime.__ZUPLO_TEST_MODE}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};var I=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function l(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!I.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}r(l,"isRestrictedEnvVariableName");function g(e){return!!e.startsWith("ZUPLO_")}r(g,"isZuploReadableEnvVariableName");var x=new Proxy({},{get(e,t){let n=String(t);switch(n){case"ZUPLO_ENVIRONMENT_TYPE":return o.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return o.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return o.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return o.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return o.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return o.instance.build.BUILD_ID}if(!(l(n)&&!g(n)))return o.instance.runtime[n]}});function m(e,t,n){return`_${a(e+"_"+t+"_"+n)}`}r(m,"getRawOperationDataIdentifierName");function p(e,t,n,i){return`_${a(e.toLowerCase())}_`+t.toLowerCase()+"_"+n.toLowerCase()+`_${i.toLowerCase()}`}r(p,"getIdForParameterSchema");function L(e,t,n){return`_${a(e.toLowerCase())}_`+t.toLowerCase()+`_rb_${a(n.toLowerCase())}`}r(L,"getIdForRequestBodySchema");function O(e,t){return`_${a(e)}__${a(t)}`}r(O,"getIdForRefSchema");function a(e){let t=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?t.push(e.charAt(n)):t.push("_")}return t.join("")}r(a,"sanitizedIdentifierName");
26
26
  /*! For license information please see index.js.LEGAL.txt */
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- "use strict";var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var r=(n,e)=>u(n,"name",{value:e,configurable:!0});var c=(n,e)=>{for(var o in e)u(n,o,{get:e[o],enumerable:!0})},g=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!m.call(n,t)&&t!==o&&u(n,t,{get:()=>e[t],enumerable:!(i=l(e,t))||i.enumerable});return n};var v=n=>g(u({},"__esModule",{value:!0}),n);var E={};c(E,{MockZuploContext:()=>d,createMockContext:()=>R});module.exports=v(E);function R(n={request:new Request("https://api.example.com")}){let e=[];function o(s){e.push(Promise.resolve(s))}return r(o,"waitUntil"),{context:new d({event:{waitUntil:o},route:n.route}),invokeResponse:r(async()=>{await Promise.all(e)},"invokeResponse")}}r(R,"createMockContext");var f={path:"/",methods:["GET"],handler:{module:{},export:"default"},version:"none",raw:()=>({})},d=class extends EventTarget{static{r(this,"MockZuploContext")}#e;requestId;log;route;custom;incomingRequestProperties;constructor({event:e,route:o=f}){super(),this.requestId=crypto.randomUUID(),this.log={info:console.info,log:console.log,debug:console.debug,warn:console.warn,error:console.error},this.custom={},this.route=o,this.incomingRequestProperties={asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0},this.#e=e}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,i){let t=r(s=>{try{typeof o=="function"?o(s):o.handleEvent(s)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,t,i)}};
25
+ "use strict";var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var r=(n,e)=>u(n,"name",{value:e,configurable:!0});var c=(n,e)=>{for(var o in e)u(n,o,{get:e[o],enumerable:!0})},g=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!m.call(n,t)&&t!==o&&u(n,t,{get:()=>e[t],enumerable:!(i=l(e,t))||i.enumerable});return n};var v=n=>g(u({},"__esModule",{value:!0}),n);var E={};c(E,{MockZuploContext:()=>d,createMockContext:()=>R});module.exports=v(E);function R(n={request:new Request("https://api.example.com")}){let e=[];function o(s){e.push(Promise.resolve(s))}return r(o,"waitUntil"),{context:new d({event:{waitUntil:o},route:n.route}),invokeResponse:r(async()=>{await Promise.all(e)},"invokeResponse")}}r(R,"createMockContext");var f={path:"/",methods:["GET"],handler:{module:{},export:"default"},version:"none",raw:r(()=>({}),"raw")},d=class extends EventTarget{static{r(this,"MockZuploContext")}#e;requestId;log;route;custom;incomingRequestProperties;constructor({event:e,route:o=f}){super(),this.requestId=crypto.randomUUID(),this.log={info:console.info,log:console.log,debug:console.debug,warn:console.warn,error:console.error},this.custom={},this.route=o,this.incomingRequestProperties={asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0},this.#e=e}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,o){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addEventListener(e,o,i){let t=r(s=>{try{typeof o=="function"?o(s):o.handleEvent(s)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,t,i)}};
26
26
  /*! For license information please see index.js.LEGAL.txt */
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{a as e}from"./chunk-4DUPDUSC.js";var r="2024-03-14",u=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function _(){return new t({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:r,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:u[r]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}e(_,"getMockEnvironment");var t=class l{static{e(this,"Environment")}config;static#e;static#t=!1;static initialize(n){this.#e||(this.#e=new l(n),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=_()),this.#e}constructor({build:n,runtime:i}){let o;try{if(i.__ZUPLO_CONFIG){let s=atob(i.__ZUPLO_CONFIG);o=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=o??{},this.build=n,this.runtime=i,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get zuploClientAuthBucketId(){return this.config.zuplo_auth_client_bucket_id??"auth_o8PUdhKxSTOiB794GWPwLQCD"}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get developerApiUrl(){return this.config.developer_api_url??"https://dev.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get authClientId(){return this.runtime.__ZUPLO_AUTH_CLIENT_ID}get authClientSecret(){return this.runtime.__ZUPLO_AUTH_CLIENT_SECRET}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.IS_LOCAL_DEVELOPMENT}get isTestMode(){return!!this.runtime.__ZUPLO_TEST_MODE}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};export{t as a};
26
- /*! For license information please see chunk-UTQUSNMK.js.LEGAL.txt */
25
+ import{a as e}from"./chunk-PPV7V43C.js";var r="2024-03-14",u=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0}});function _(){return new t({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:!1,BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:r,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:u[r]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:"cloudflare",__ZUPLO_AUTH_API_JWT:""}})}e(_,"getMockEnvironment");var t=class l{static{e(this,"Environment")}config;static#e;static#t=!1;static initialize(n){this.#e||(this.#e=new l(n),this.#t=!0)}static get instance(){return this.#t||(console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=_()),this.#e}constructor({build:n,runtime:i}){let o;try{if(i.__ZUPLO_CONFIG){let s=atob(i.__ZUPLO_CONFIG);o=JSON.parse(s)}}catch{console.warn("Failed to parse runtime configuration")}this.config=o??{},this.build=n,this.runtime=i,this.instanceId=crypto.randomUUID()}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get zuploClientAuthBucketId(){return this.config.zuplo_auth_client_bucket_id??"auth_o8PUdhKxSTOiB794GWPwLQCD"}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get developerApiUrl(){return this.config.developer_api_url??"https://dev.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuplo.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuplo.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuplo.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuplo.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get authClientId(){return this.runtime.__ZUPLO_AUTH_CLIENT_ID}get authClientSecret(){return this.runtime.__ZUPLO_AUTH_CLIENT_SECRET}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isDeno(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="deno":this.config.runtime_type?this.config.runtime_type==="deno":typeof WebSocketPair!="function"}get isLocalDevelopment(){return this.build.IS_LOCAL_DEVELOPMENT}get isTestMode(){return!!this.runtime.__ZUPLO_TEST_MODE}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}};export{t as a};
26
+ /*! For license information please see chunk-7HJ5MMZB.js.LEGAL.txt */
@@ -22,7 +22,7 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{a as E}from"./chunk-UTQUSNMK.js";import{a as r,b as R,c as he}from"./chunk-4DUPDUSC.js";var V=R(n=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.generateColor=n.colorFunctions=n.stripColor=n.bgRgb24=n.rgb24=n.bgRgb8=n.rgb8=n.bgBrightWhite=n.bgBrightCyan=n.bgBrightMagenta=n.bgBrightBlue=n.bgBrightYellow=n.bgBrightGreen=n.bgBrightRed=n.bgBrightBlack=n.bgWhite=n.bgCyan=n.bgMagenta=n.bgBlue=n.bgYellow=n.bgGreen=n.bgRed=n.bgBlack=n.brightWhite=n.brightCyan=n.brightMagenta=n.brightBlue=n.brightYellow=n.brightGreen=n.brightRed=n.brightBlack=n.gray=n.white=n.cyan=n.magenta=n.blue=n.yellow=n.green=n.red=n.black=n.strikethrough=n.hidden=n.inverse=n.underline=n.italic=n.dim=n.bold=n.reset=n.getColorEnabled=n.setColorEnabled=void 0;var F=!0,$=!F;function pe(e){F||($=e)}r(pe,"setColorEnabled");n.setColorEnabled=pe;function de(){return $}r(de,"getColorEnabled");n.getColorEnabled=de;function s(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}r(s,"code");function c(e,t){return $?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}r(c,"run");function be(e){return c(e,s([0],0))}r(be,"reset");n.reset=be;function me(e){return c(e,s([1],22))}r(me,"bold");n.bold=me;function ye(e){return c(e,s([2],22))}r(ye,"dim");n.dim=ye;function we(e){return c(e,s([3],23))}r(we,"italic");n.italic=we;function Re(e){return c(e,s([4],24))}r(Re,"underline");n.underline=Re;function Ce(e){return c(e,s([7],27))}r(Ce,"inverse");n.inverse=Ce;function Ee(e){return c(e,s([8],28))}r(Ee,"hidden");n.hidden=Ee;function Se(e){return c(e,s([9],29))}r(Se,"strikethrough");n.strikethrough=Se;function Oe(e){return c(e,s([30],39))}r(Oe,"black");n.black=Oe;function L(e){return c(e,s([31],39))}r(L,"red");n.red=L;function Y(e){return c(e,s([32],39))}r(Y,"green");n.green=Y;function D(e){return c(e,s([33],39))}r(D,"yellow");n.yellow=D;function G(e){return c(e,s([34],39))}r(G,"blue");n.blue=G;function J(e){return c(e,s([35],39))}r(J,"magenta");n.magenta=J;function W(e){return c(e,s([36],39))}r(W,"cyan");n.cyan=W;function Be(e){return c(e,s([37],39))}r(Be,"white");n.white=Be;function ze(e){return Z(e)}r(ze,"gray");n.gray=ze;function Z(e){return c(e,s([90],39))}r(Z,"brightBlack");n.brightBlack=Z;function Ae(e){return c(e,s([91],39))}r(Ae,"brightRed");n.brightRed=Ae;function Ne(e){return c(e,s([92],39))}r(Ne,"brightGreen");n.brightGreen=Ne;function Me(e){return c(e,s([93],39))}r(Me,"brightYellow");n.brightYellow=Me;function $e(e){return c(e,s([94],39))}r($e,"brightBlue");n.brightBlue=$e;function ve(e){return c(e,s([95],39))}r(ve,"brightMagenta");n.brightMagenta=ve;function xe(e){return c(e,s([96],39))}r(xe,"brightCyan");n.brightCyan=xe;function Te(e){return c(e,s([97],39))}r(Te,"brightWhite");n.brightWhite=Te;function _e(e){return c(e,s([40],49))}r(_e,"bgBlack");n.bgBlack=_e;function je(e){return c(e,s([41],49))}r(je,"bgRed");n.bgRed=je;function Ie(e){return c(e,s([42],49))}r(Ie,"bgGreen");n.bgGreen=Ie;function Pe(e){return c(e,s([43],49))}r(Pe,"bgYellow");n.bgYellow=Pe;function Ue(e){return c(e,s([44],49))}r(Ue,"bgBlue");n.bgBlue=Ue;function He(e){return c(e,s([45],49))}r(He,"bgMagenta");n.bgMagenta=He;function qe(e){return c(e,s([46],49))}r(qe,"bgCyan");n.bgCyan=qe;function ke(e){return c(e,s([47],49))}r(ke,"bgWhite");n.bgWhite=ke;function Fe(e){return c(e,s([100],49))}r(Fe,"bgBrightBlack");n.bgBrightBlack=Fe;function Le(e){return c(e,s([101],49))}r(Le,"bgBrightRed");n.bgBrightRed=Le;function Ye(e){return c(e,s([102],49))}r(Ye,"bgBrightGreen");n.bgBrightGreen=Ye;function De(e){return c(e,s([103],49))}r(De,"bgBrightYellow");n.bgBrightYellow=De;function Ge(e){return c(e,s([104],49))}r(Ge,"bgBrightBlue");n.bgBrightBlue=Ge;function Je(e){return c(e,s([105],49))}r(Je,"bgBrightMagenta");n.bgBrightMagenta=Je;function We(e){return c(e,s([106],49))}r(We,"bgBrightCyan");n.bgBrightCyan=We;function Ze(e){return c(e,s([107],49))}r(Ze,"bgBrightWhite");n.bgBrightWhite=Ze;function b(e,t=255,i=0){return Math.trunc(Math.max(Math.min(e,t),i))}r(b,"clampAndTruncate");function Ve(e,t){return c(e,s([38,5,b(t)],39))}r(Ve,"rgb8");n.rgb8=Ve;function Xe(e,t){return c(e,s([48,5,b(t)],49))}r(Xe,"bgRgb8");n.bgRgb8=Xe;function Ke(e,t){return typeof t=="number"?c(e,s([38,2,t>>16&255,t>>8&255,t&255],39)):c(e,s([38,2,b(t.r),b(t.g),b(t.b)],39))}r(Ke,"rgb24");n.rgb24=Ke;function Qe(e,t){return typeof t=="number"?c(e,s([48,2,t>>16&255,t>>8&255,t&255],49)):c(e,s([48,2,b(t.r),b(t.g),b(t.b)],49))}r(Qe,"bgRgb24");n.bgRgb24=Qe;var et=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"),"g");function tt(e){return e.replace(et,"")}r(tt,"stripColor");n.stripColor=tt;n.colorFunctions=[L,Y,D,G,J,W];function nt(e){let t=0,i=e.length,u=0;if(i>0)for(;u<i;)t=(t<<5)-t+e.charCodeAt(u++)|0;return t}r(nt,"hashCode");function rt(e){let t=Math.abs(nt(e));return n.colorFunctions[t%n.colorFunctions.length]}r(rt,"generateColor");n.generateColor=rt});var X=R(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.format=void 0;function it(e,t,...i){let u=0,a=i.length,g=String(t).replace(/%[sdjoO%]/g,o=>{if(o==="%%")return"%";if(u>=a)return o;switch(o){case"%s":return String(i[u++]);case"%d":return Number(i[u++]).toString();case"%o":return e(i[u++]).split(`
25
+ import{a as E}from"./chunk-7HJ5MMZB.js";import{a as r,b as R,c as he}from"./chunk-PPV7V43C.js";var V=R(n=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.generateColor=n.colorFunctions=n.stripColor=n.bgRgb24=n.rgb24=n.bgRgb8=n.rgb8=n.bgBrightWhite=n.bgBrightCyan=n.bgBrightMagenta=n.bgBrightBlue=n.bgBrightYellow=n.bgBrightGreen=n.bgBrightRed=n.bgBrightBlack=n.bgWhite=n.bgCyan=n.bgMagenta=n.bgBlue=n.bgYellow=n.bgGreen=n.bgRed=n.bgBlack=n.brightWhite=n.brightCyan=n.brightMagenta=n.brightBlue=n.brightYellow=n.brightGreen=n.brightRed=n.brightBlack=n.gray=n.white=n.cyan=n.magenta=n.blue=n.yellow=n.green=n.red=n.black=n.strikethrough=n.hidden=n.inverse=n.underline=n.italic=n.dim=n.bold=n.reset=n.getColorEnabled=n.setColorEnabled=void 0;var F=!0,$=!F;function pe(e){F||($=e)}r(pe,"setColorEnabled");n.setColorEnabled=pe;function de(){return $}r(de,"getColorEnabled");n.getColorEnabled=de;function s(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}r(s,"code");function c(e,t){return $?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}r(c,"run");function be(e){return c(e,s([0],0))}r(be,"reset");n.reset=be;function me(e){return c(e,s([1],22))}r(me,"bold");n.bold=me;function ye(e){return c(e,s([2],22))}r(ye,"dim");n.dim=ye;function we(e){return c(e,s([3],23))}r(we,"italic");n.italic=we;function Re(e){return c(e,s([4],24))}r(Re,"underline");n.underline=Re;function Ce(e){return c(e,s([7],27))}r(Ce,"inverse");n.inverse=Ce;function Ee(e){return c(e,s([8],28))}r(Ee,"hidden");n.hidden=Ee;function Se(e){return c(e,s([9],29))}r(Se,"strikethrough");n.strikethrough=Se;function Oe(e){return c(e,s([30],39))}r(Oe,"black");n.black=Oe;function L(e){return c(e,s([31],39))}r(L,"red");n.red=L;function Y(e){return c(e,s([32],39))}r(Y,"green");n.green=Y;function D(e){return c(e,s([33],39))}r(D,"yellow");n.yellow=D;function G(e){return c(e,s([34],39))}r(G,"blue");n.blue=G;function J(e){return c(e,s([35],39))}r(J,"magenta");n.magenta=J;function W(e){return c(e,s([36],39))}r(W,"cyan");n.cyan=W;function Be(e){return c(e,s([37],39))}r(Be,"white");n.white=Be;function ze(e){return Z(e)}r(ze,"gray");n.gray=ze;function Z(e){return c(e,s([90],39))}r(Z,"brightBlack");n.brightBlack=Z;function Ae(e){return c(e,s([91],39))}r(Ae,"brightRed");n.brightRed=Ae;function Ne(e){return c(e,s([92],39))}r(Ne,"brightGreen");n.brightGreen=Ne;function Me(e){return c(e,s([93],39))}r(Me,"brightYellow");n.brightYellow=Me;function $e(e){return c(e,s([94],39))}r($e,"brightBlue");n.brightBlue=$e;function ve(e){return c(e,s([95],39))}r(ve,"brightMagenta");n.brightMagenta=ve;function xe(e){return c(e,s([96],39))}r(xe,"brightCyan");n.brightCyan=xe;function Te(e){return c(e,s([97],39))}r(Te,"brightWhite");n.brightWhite=Te;function _e(e){return c(e,s([40],49))}r(_e,"bgBlack");n.bgBlack=_e;function je(e){return c(e,s([41],49))}r(je,"bgRed");n.bgRed=je;function Ie(e){return c(e,s([42],49))}r(Ie,"bgGreen");n.bgGreen=Ie;function Pe(e){return c(e,s([43],49))}r(Pe,"bgYellow");n.bgYellow=Pe;function Ue(e){return c(e,s([44],49))}r(Ue,"bgBlue");n.bgBlue=Ue;function He(e){return c(e,s([45],49))}r(He,"bgMagenta");n.bgMagenta=He;function qe(e){return c(e,s([46],49))}r(qe,"bgCyan");n.bgCyan=qe;function ke(e){return c(e,s([47],49))}r(ke,"bgWhite");n.bgWhite=ke;function Fe(e){return c(e,s([100],49))}r(Fe,"bgBrightBlack");n.bgBrightBlack=Fe;function Le(e){return c(e,s([101],49))}r(Le,"bgBrightRed");n.bgBrightRed=Le;function Ye(e){return c(e,s([102],49))}r(Ye,"bgBrightGreen");n.bgBrightGreen=Ye;function De(e){return c(e,s([103],49))}r(De,"bgBrightYellow");n.bgBrightYellow=De;function Ge(e){return c(e,s([104],49))}r(Ge,"bgBrightBlue");n.bgBrightBlue=Ge;function Je(e){return c(e,s([105],49))}r(Je,"bgBrightMagenta");n.bgBrightMagenta=Je;function We(e){return c(e,s([106],49))}r(We,"bgBrightCyan");n.bgBrightCyan=We;function Ze(e){return c(e,s([107],49))}r(Ze,"bgBrightWhite");n.bgBrightWhite=Ze;function b(e,t=255,i=0){return Math.trunc(Math.max(Math.min(e,t),i))}r(b,"clampAndTruncate");function Ve(e,t){return c(e,s([38,5,b(t)],39))}r(Ve,"rgb8");n.rgb8=Ve;function Xe(e,t){return c(e,s([48,5,b(t)],49))}r(Xe,"bgRgb8");n.bgRgb8=Xe;function Ke(e,t){return typeof t=="number"?c(e,s([38,2,t>>16&255,t>>8&255,t&255],39)):c(e,s([38,2,b(t.r),b(t.g),b(t.b)],39))}r(Ke,"rgb24");n.rgb24=Ke;function Qe(e,t){return typeof t=="number"?c(e,s([48,2,t>>16&255,t>>8&255,t&255],49)):c(e,s([48,2,b(t.r),b(t.g),b(t.b)],49))}r(Qe,"bgRgb24");n.bgRgb24=Qe;var et=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"),"g");function tt(e){return e.replace(et,"")}r(tt,"stripColor");n.stripColor=tt;n.colorFunctions=[L,Y,D,G,J,W];function nt(e){let t=0,i=e.length,u=0;if(i>0)for(;u<i;)t=(t<<5)-t+e.charCodeAt(u++)|0;return t}r(nt,"hashCode");function rt(e){let t=Math.abs(nt(e));return n.colorFunctions[t%n.colorFunctions.length]}r(rt,"generateColor");n.generateColor=rt});var X=R(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.format=void 0;function it(e,t,...i){let u=0,a=i.length,g=String(t).replace(/%[sdjoO%]/g,o=>{if(o==="%%")return"%";if(u>=a)return o;switch(o){case"%s":return String(i[u++]);case"%d":return Number(i[u++]).toString();case"%o":return e(i[u++]).split(`
26
26
  `).map(l=>l.trim()).join(" ");case"%O":return e(i[u++]);case"%j":try{return JSON.stringify(i[u++])}catch{return"[Circular]"}default:return o}});for(let o of i.splice(u))o===null||!(typeof o=="object"&&o!==null)?g+=" "+o:g+=" "+e(o);return g}r(it,"format");S.format=it});var re=R(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.inspect=void 0;function y(e,t,i,u){let a={seen:[],stylize:ot,showHidden:t??!1,depth:i??2,colors:u??!1,customInspect:!0};return a.colors&&(a.stylize=ct),O(a,e,a.depth)}r(y,"inspect");B.inspect=y;y.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};y.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function ot(e,t){return e}r(ot,"stylizeNoColor");function st(e){return typeof e=="boolean"}r(st,"isBoolean");function Q(e){return e===void 0}r(Q,"isUndefined");function ct(e,t){let i=y.styles[t];return i?"\x1B["+y.colors[i][0]+"m"+e+"\x1B["+y.colors[i][1]+"m":e}r(ct,"stylizeWithColor");function v(e){return typeof e=="function"}r(v,"isFunction");function ee(e){return typeof e=="string"}r(ee,"isString");function ut(e){return typeof e=="number"}r(ut,"isNumber");function te(e){return e===null}r(te,"isNull");function ne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(ne,"hasOwn");function x(e){return I(e)&&P(e)==="[object RegExp]"}r(x,"isRegExp");function I(e){return typeof e=="object"&&e!==null}r(I,"isObject");function T(e){return I(e)&&(P(e)==="[object Error]"||e instanceof Error)}r(T,"isError");function K(e){return I(e)&&P(e)==="[object Date]"}r(K,"isDate");function P(e){return Object.prototype.toString.call(e)}r(P,"objectToString");function at(e){let t={};return e.forEach(function(i,u){t[i]=!0}),t}r(at,"arrayToHash");function lt(e,t,i,u,a){let g=[];for(let o=0,l=t.length;o<l;++o)ne(t,String(o))?g.push(j(e,t,i,u,String(o),!0)):g.push("");return a.forEach(function(o){o.match(/^\d+$/)||g.push(j(e,t,i,u,o,!0))}),g}r(lt,"formatArray");function _(e){return"["+Error.prototype.toString.call(e)+"]"}r(_,"formatError");function O(e,t,i){if(e.customInspect&&t&&v(t.inspect)&&t.inspect!==y&&!(t.constructor&&t.constructor.prototype===t)){let h=t.inspect(i,e);return ee(h)||(h=O(e,h,i)),h}let u=gt(e,t);if(u)return u;let a=Object.keys(t),g=at(a);try{e.showHidden&&Object.getOwnPropertyNames&&(a=Object.getOwnPropertyNames(t))}catch{}if(T(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return _(t);if(a.length===0){if(v(t)){let h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(K(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return _(t)}let o="",l=!1,f=["{","}"];if(Array.isArray(t)&&(l=!0,f=["[","]"]),v(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),x(t)&&(o=" "+RegExp.prototype.toString.call(t)),K(t)&&(o=" "+Date.prototype.toUTCString.call(t)),T(t)&&(o=" "+_(t)),a.length===0&&(!l||t.length==0))return f[0]+o+f[1];if(i<0)return x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);let p;return l?p=lt(e,t,i,g,a):p=a.map(function(h){return j(e,t,i,g,h,l)}),e.seen.pop(),ft(p,o,f)}r(O,"formatValue");function j(e,t,i,u,a,g){let o,l,f;f={value:void 0};try{f.value=t[a]}catch{}try{Object.getOwnPropertyDescriptor&&(f=Object.getOwnPropertyDescriptor(t,a)||f)}catch{}if(f.get?f.set?l=e.stylize("[Getter/Setter]","special"):l=e.stylize("[Getter]","special"):f.set&&(l=e.stylize("[Setter]","special")),ne(u,a)||(o="["+a+"]"),l||(e.seen.indexOf(f.value)<0?(te(i)?l=O(e,f.value,null):l=O(e,f.value,i-1),l.indexOf(`
27
27
  `)>-1&&(g?l=l.split(`
28
28
  `).map(function(p){return" "+p}).join(`
@@ -33,4 +33,4 @@ import{a as E}from"./chunk-UTQUSNMK.js";import{a as r,b as R,c as he}from"./chun
33
33
  `)>=0&&u++,g+o.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(t===""?"":t+`
34
34
  `)+" "+e.join(`,
35
35
  `)+" "+i[1]:i[0]+t+" "+e.join(", ")+" "+i[1]}r(ft,"reduceToSingleString")});var ie=R(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.format=void 0;var ht=X(),pt=re(),dt=r((e,...t)=>(0,ht.format)(pt.inspect,e,t),"format");z.format=dt});var se=R(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});m.debug=m.withoutEnv=m.Debugger=void 0;var bt=V(),mt=ie(),A=class{static{r(this,"Debugger")}manager;ns;color;last;enabled;constructor(t,i){this.manager=t,this.ns=i,this.color=(0,bt.generateColor)(i),this.last=0,this.enabled=t.enabled.some(u=>u.test(i))}log(...t){if(!this.enabled)return;let i,u=t[0];typeof u=="function"?i=u():i=String(u);let a=Date.now()-(this.last||Date.now());i=(0,mt.format)(i,...t);let g=`${this.color(this.ns)} ${i} ${this.color(`+${a}ms`)}`;console.log(g),this.last=Date.now()}};m.Debugger=A;var N=class{static{r(this,"DebugManager")}debuggers;enabled;constructor(t){this.debuggers=new Map,this.enabled=t??[]}};function oe(e){return!e||e.length===0?[]:(e=e.replace(/\s/g,"").replace(/\*/g,".+"),e.split(",").map(t=>new RegExp(`^${t}$`)))}r(oe,"extract");var C;function yt(e){e||(e=[]),typeof e=="string"&&(e=oe(e)),C=new N(e)}r(yt,"withoutEnv");m.withoutEnv=yt;function wt(e){let t=globalThis.DEBUG;C||(C=new N(oe(t)));let i=new A(C,e);return C.debuggers.set(e,i),Object.assign(i.log.bind(i),{self:i})}r(wt,"debug");m.debug=wt});var H=class extends Error{static{r(this,"SystemError")}constructor(t,i){super(t,i),this.name="InternalError"}},d=class extends Error{static{r(this,"RuntimeError")}extensionMembers;constructor(t,i){typeof t=="string"?super(t,i):(super(t.message,i),this.extensionMembers=t.extensionMembers),this.name="RuntimeError"}},q=class extends d{static{r(this,"ConfigurationError")}constructor(t,i){super(t,i),this.name="ConfigurationError"}},k=class extends d{static{r(this,"FeatureNotEnabledError")}constructor(t,i){super(t,i),this.name="FeatureNotEnabledError"}};var ue=he(se());var w=(0,ue.debug)("zuplo:runtime:external-service");function Rt(){let e,{__ZUPLO_EXTERNAL_SERVICE_TOKEN:t}=E.instance.runtime;if(t&&t!=="undefined")try{let i=atob(t);e=JSON.parse(i)}catch{}return e}r(Rt,"getServiceAuth");async function ae(e,t){let i=Rt();if(i)if(w(`Using external service auth. ClientId: ${i.clientId})`),typeof e=="string"){let u=new URL(e),a=u.hostname,g=t??{},o=new Headers(g.headers||{});o.set("CF-Access-Client-Id",i.clientId),o.set("CF-Access-Client-Secret",i.clientSecret),g.headers=o;let l;if(i.customServiceMapping&&i.customServiceMapping[a])l=`https://${i.customServiceMapping[a]}`;else if(E.instance.useLegacyServiceRouting)l=`https://${a}.zuptunnel.com`;else{w("Using sha256 service routing");let h=E.instance.build;if(h.ACCOUNT_NAME&&h.PROJECT_NAME&&h.ENVIRONMENT_TYPE)l=`https://${await Ct(a,h.ACCOUNT_NAME,h.PROJECT_NAME,h.ENVIRONMENT_TYPE)}.zuptunnel.com`;else throw w("Cannot use sha256 service routing, missing build variables"),new d("Failed to generate fully qualified tunnel url.")}let f=new URL(`${l}${u.pathname}${u.search}`);w(`Calling external service: ${f.toString()}`);let p=await M.fetch(f.toString(),g);if(p.status===403&&p.headers.get("cf-access-domain")!==null)throw console.error("403 Forbidden when calling external service.",{clientId:i.clientId,tunnelHost:l}),new d("Could not connect to secure tunnel.");return p}else throw w("Cannot call external service with Request object"),new d("Currently, we only support fetch(<some_string>, ...).");else throw w("There is no external service auth configured for this zup."),new d("There are no external services configured for this zup.")}r(ae,"externalServiceHandler");async function Ct(e,t,i,u){let a=e.toLowerCase(),g=t.toLowerCase(),o=i.toLowerCase(),l=Et(u);w(`Hashing service name: ${g}-${a}.${g}-${o}-${l}`);let f=await ce(`${g}-${a}`),p=await ce(`${g}-${o}-${l}`);return`${f}.${p}`}r(Ct,"hashServiceName");async function ce(e){let t=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(g=>g.toString(16).padStart(2,"0")).join("").slice(0,-1)}r(ce,"hashSegment");function Et(e){let t=e.toLowerCase();switch(t){case"production":case"preview":return t;default:return"working-copy"}}r(Et,"sanitizeEnvironmentType");var ge=new Map;ge.set("service:",ae);var le=globalThis.fetch;function U(e,t){let i=St(t);if(typeof e=="string"){let u=new URL(e),a=ge.get(u.protocol);return a?a(e,i):le(e,i)}else return le(e,i)}r(U,"internalFetch");globalThis.fetch=U;var St=r(e=>{if(!e||e instanceof Request)return e;let t=e;if(!t.zuplo)return e;let i=e;return i.cf={cacheEverything:t.zuplo?.cacheEverything,cacheTtl:t.zuplo?.cacheTtlSeconds},delete e.zuplo,e},"transformInit");var Ot={fetch:U},M=Ot;var fe=class{constructor(t){this.options=t;this.authHeader=`Basic ${btoa(t.pdpUsername+":"+t.pdpPassword)}`,this.authorizationUrl=new URL("/authorize",t.pdpUrl).toString()}static{r(this,"PdpService")}authHeader;authorizationUrl;async makePdpRequest(t){let i=await M.fetch(this.authorizationUrl,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/xacml+json; charset=UTF-8",[this.options.tokenHeaderName??"Authorization"]:this.authHeader}});if(!i.ok)throw new Error(`Request to PDP service failed with response status ${i.status}.`);return await i.json()}};export{se as a,H as b,d as c,q as d,k as e,M as f,fe as g};
36
- /*! For license information please see chunk-23DATJ57.js.LEGAL.txt */
36
+ /*! For license information please see chunk-OBIMLM2A.js.LEGAL.txt */
@@ -23,4 +23,4 @@
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
25
  var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>e(b,"name",{value:a,configurable:!0});var n=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var o=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c};
26
- /*! For license information please see chunk-4DUPDUSC.js.LEGAL.txt */
26
+ /*! For license information please see chunk-PPV7V43C.js.LEGAL.txt */
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{a}from"./chunk-UTQUSNMK.js";import{a as n}from"./chunk-4DUPDUSC.js";var c=(o=>(o.Build="build-data",o.CorsPreflight="cors-preflight",o.DeveloperPortal="developer-portal",o.DeveloperPortalLegacy="developer-portal-legacy",o.StripePlugin="stripe-plugin",o.EmptyGatewayCatchall="empty-gateway-catchall",o.Ping="ping",o.UnmatchedPath="unmatched-path",o))(c||{});var p=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function _(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!p.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}n(_,"isRestrictedEnvVariableName");function g(e){return!!e.startsWith("ZUPLO_")}n(g,"isZuploReadableEnvVariableName");var f=new Proxy({},{get(e,r){let t=String(r);switch(t){case"ZUPLO_ENVIRONMENT_TYPE":return a.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return a.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return a.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return a.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return a.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return a.instance.build.BUILD_ID}if(!(_(t)&&!g(t)))return a.instance.runtime[t]}});function C(e,r,t){return`_${s(e+"_"+r+"_"+t)}`}n(C,"getRawOperationDataIdentifierName");function h(e,r,t,i){return`_${s(e.toLowerCase())}_`+r.toLowerCase()+"_"+t.toLowerCase()+`_${i.toLowerCase()}`}n(h,"getIdForParameterSchema");function A(e,r,t){return`_${s(e.toLowerCase())}_`+r.toLowerCase()+`_rb_${s(t.toLowerCase())}`}n(A,"getIdForRequestBodySchema");function m(e,r){return`_${s(e)}__${s(r)}`}n(m,"getIdForRefSchema");function s(e){let r=[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i>="0".charCodeAt(0)&&i<="9".charCodeAt(0)||i>="A".charCodeAt(0)&&i<="Z".charCodeAt(0)||i>="a".charCodeAt(0)&&i<="z".charCodeAt(0)?r.push(e.charAt(t)):r.push("_")}return r.join("")}n(s,"sanitizedIdentifierName");export{c as a,_ as b,g as c,f as d,C as e,h as f,A as g,m as h,s as i};
26
- /*! For license information please see chunk-IOKNFUPG.js.LEGAL.txt */
25
+ import{a}from"./chunk-7HJ5MMZB.js";import{a as n}from"./chunk-PPV7V43C.js";var c=(o=>(o.Build="build-data",o.CorsPreflight="cors-preflight",o.DeveloperPortal="developer-portal",o.DeveloperPortalLegacy="developer-portal-legacy",o.StripePlugin="stripe-plugin",o.EmptyGatewayCatchall="empty-gateway-catchall",o.Ping="ping",o.UnmatchedPath="unmatched-path",o))(c||{});var p=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function _(e){return e.startsWith("__ZUPLO")||e.startsWith("ZUPLO_")?!p.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}n(_,"isRestrictedEnvVariableName");function g(e){return!!e.startsWith("ZUPLO_")}n(g,"isZuploReadableEnvVariableName");var f=new Proxy({},{get(e,r){let t=String(r);switch(t){case"ZUPLO_ENVIRONMENT_TYPE":return a.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return a.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return a.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return a.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return a.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return a.instance.build.BUILD_ID}if(!(_(t)&&!g(t)))return a.instance.runtime[t]}});function C(e,r,t){return`_${s(e+"_"+r+"_"+t)}`}n(C,"getRawOperationDataIdentifierName");function h(e,r,t,i){return`_${s(e.toLowerCase())}_`+r.toLowerCase()+"_"+t.toLowerCase()+`_${i.toLowerCase()}`}n(h,"getIdForParameterSchema");function A(e,r,t){return`_${s(e.toLowerCase())}_`+r.toLowerCase()+`_rb_${s(t.toLowerCase())}`}n(A,"getIdForRequestBodySchema");function m(e,r){return`_${s(e)}__${s(r)}`}n(m,"getIdForRefSchema");function s(e){let r=[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?r.push(e.charAt(t)):r.push("_")}return r.join("")}n(s,"sanitizedIdentifierName");export{c as a,_ as b,g as c,f as d,C as e,h as f,A as g,m as h,s as i};
26
+ /*! For license information please see chunk-SLESBKUA.js.LEGAL.txt */