@zuplo/runtime 6.52.1 → 6.52.3

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.
@@ -0,0 +1,36 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ var fe=Object.create;var P=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty;var r=(e,t)=>P(e,"name",{value:t,configurable:!0});var De=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),He=(e,t)=>{for(var n in t)P(e,n,{get:t[n],enumerable:!0})},me=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pe(t))!he.call(e,i)&&i!==n&&P(e,i,{get:()=>t[i],enumerable:!(s=ge(t,i))||s.enumerable});return e};var ke=(e,t,n)=>(n=e!=null?fe(de(e)):{},me(t||!e||!e.__esModule?P(n,"default",{value:e,enumerable:!0}):n,e));var V=class extends Error{static{r(this,"SystemError")}constructor(t,n){super(t,n),this.name="InternalError"}},E=class extends Error{static{r(this,"RuntimeError")}extensionMembers;constructor(t,n){typeof t=="string"?super(t,n):(super(t.message,n),this.extensionMembers=t.extensionMembers),this.name="RuntimeError"}},Y=class extends E{static{r(this,"ConfigurationError")}constructor(t,n){super(t,n),this.name="ConfigurationError"}};var _e=!1;function A(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}r(A,"code");function x(e,t){return _e?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}r(x,"run");function be(e){return x(e,A([31],39))}r(be,"red");function ye(e){return x(e,A([32],39))}r(ye,"green");function Ee(e){return x(e,A([33],39))}r(Ee,"yellow");function Oe(e){return x(e,A([34],39))}r(Oe,"blue");function Le(e){return x(e,A([35],39))}r(Le,"magenta");function we(e){return x(e,A([36],39))}r(we,"cyan");var Ve=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");var J=[be,ye,Ee,Oe,Le,we];function Re(e){let t=0,n=e.length,s=0;if(n>0)for(;s<n;)t=(t<<5)-t+e.charCodeAt(s++)|0;return t}r(Re,"hashCode");function W(e){let t=Math.abs(Re(e));return J[t%J.length]}r(W,"generateColor");function q(e,t,...n){let s=0,i=n.length,c=String(t).replace(/%[sdjoO%]/g,o=>{if(o==="%%")return"%";if(s>=i)return o;switch(o){case"%s":return String(n[s++]);case"%d":return Number(n[s++]).toString();case"%o":return e(n[s++]).split(`
26
+ `).map(u=>u.trim()).join(" ");case"%O":return e(n[s++]);case"%j":try{return JSON.stringify(n[s++])}catch{return"[Circular]"}default:return o}});for(let o of n.splice(s))o===null||!(typeof o=="object"&&o!==null)?c+=" "+o:c+=" "+e(o);return c}r(q,"format");function O(e,t,n,s){let i={seen:[],stylize:Ae,showHidden:t??!1,depth:n??2,colors:s??!1,customInspect:!0};return i.colors&&(i.stylize=Ue),I(i,e,i.depth)}r(O,"inspect");O.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]};O.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ae(e,t){return e}r(Ae,"stylizeNoColor");function xe(e){return typeof e=="boolean"}r(xe,"isBoolean");function Q(e){return e===void 0}r(Q,"isUndefined");function Ue(e,t){let n=O.styles[t];return n?"\x1B["+O.colors[n][0]+"m"+e+"\x1B["+O.colors[n][1]+"m":e}r(Ue,"stylizeWithColor");function N(e){return typeof e=="function"}r(N,"isFunction");function X(e){return typeof e=="string"}r(X,"isString");function Se(e){return typeof e=="number"}r(Se,"isNumber");function ee(e){return e===null}r(ee,"isNull");function te(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(te,"hasOwn");function v(e){return Z(e)&&$(e)==="[object RegExp]"}r(v,"isRegExp");function Z(e){return typeof e=="object"&&e!==null}r(Z,"isObject");function M(e){return Z(e)&&($(e)==="[object Error]"||e instanceof Error)}r(M,"isError");function K(e){return Z(e)&&$(e)==="[object Date]"}r(K,"isDate");function $(e){return Object.prototype.toString.call(e)}r($,"objectToString");function Te(e){let t={};return e.forEach(function(n,s){t[n]=!0}),t}r(Te,"arrayToHash");function Pe(e,t,n,s,i){let c=[];for(let o=0,u=t.length;o<u;++o)te(t,String(o))?c.push(F(e,t,n,s,String(o),!0)):c.push("");return i.forEach(function(o){o.match(/^\d+$/)||c.push(F(e,t,n,s,o,!0))}),c}r(Pe,"formatArray");function z(e){return"["+Error.prototype.toString.call(e)+"]"}r(z,"formatError");function I(e,t,n){if(e.customInspect&&t&&N(t.inspect)&&t.inspect!==O&&!(t.constructor&&t.constructor.prototype===t)){let a=t.inspect(n,e);return X(a)||(a=I(e,a,n)),a}let s=Ie(e,t);if(s)return s;let i=Object.keys(t),c=Te(i);try{e.showHidden&&Object.getOwnPropertyNames&&(i=Object.getOwnPropertyNames(t))}catch{}if(M(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return z(t);if(i.length===0){if(N(t)){let a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(K(t))return e.stylize(Date.prototype.toString.call(t),"date");if(M(t))return z(t)}let o="",u=!1,f=["{","}"];if(Array.isArray(t)&&(u=!0,f=["[","]"]),N(t)&&(o=" [Function"+(t.name?": "+t.name:"")+"]"),v(t)&&(o=" "+RegExp.prototype.toString.call(t)),K(t)&&(o=" "+Date.prototype.toUTCString.call(t)),M(t)&&(o=" "+z(t)),i.length===0&&(!u||t.length==0))return f[0]+o+f[1];if(n<0)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);let l;return u?l=Pe(e,t,n,c,i):l=i.map(function(a){return F(e,t,n,c,a,u)}),e.seen.pop(),Ce(l,o,f)}r(I,"formatValue");function F(e,t,n,s,i,c){let o,u,f;f={value:void 0};try{f.value=t[i]}catch{}try{Object.getOwnPropertyDescriptor&&(f=Object.getOwnPropertyDescriptor(t,i)||f)}catch{}if(f.get?f.set?u=e.stylize("[Getter/Setter]","special"):u=e.stylize("[Getter]","special"):f.set&&(u=e.stylize("[Setter]","special")),te(s,i)||(o="["+i+"]"),u||(e.seen.indexOf(f.value)<0?(ee(n)?u=I(e,f.value,null):u=I(e,f.value,n-1),u.indexOf(`
27
+ `)>-1&&(c?u=u.split(`
28
+ `).map(function(l){return" "+l}).join(`
29
+ `).substr(2):u=`
30
+ `+u.split(`
31
+ `).map(function(l){return" "+l}).join(`
32
+ `))):u=e.stylize("[Circular]","special")),Q(o)){if(c&&i.match(/^\d+$/))return u;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+u}r(F,"formatProperty");function Ie(e,t){if(Q(t))return e.stylize("undefined","undefined");if(X(t)){let n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(Se(t))return e.stylize(""+t,"number");if(xe(t))return e.stylize(""+t,"boolean");if(ee(t))return e.stylize("null","null")}r(Ie,"formatPrimitive");function Ce(e,t,n){let s=0;return e.reduce(function(c,o){return s++,o.indexOf(`
33
+ `)>=0&&s++,c+o.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(t===""?"":t+`
34
+ `)+" "+e.join(`,
35
+ `)+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}r(Ce,"reduceToSingleString");var ne=r((e,...t)=>q(O,e,t),"format");var D=class{static{r(this,"Debugger")}manager;ns;color;last;enabled;constructor(t,n){this.manager=t,this.ns=n,this.color=W(n),this.last=0,this.enabled=t.enabled.some(s=>s.test(n))}log(...t){if(!this.enabled)return;let n,s=t[0];typeof s=="function"?n=s():n=String(s);let i=Date.now()-(this.last||Date.now());n=ne(n,...t);let c=`${this.color(this.ns)} ${n} ${this.color(`+${i}ms`)}`;console.log(c),this.last=Date.now()}},H=class{static{r(this,"DebugManager")}debuggers;enabled;constructor(t){this.debuggers=new Map,this.enabled=t??[]}};function Ne(e){return!e||e.length===0?[]:(e=e.replace(/\s/g,"").replace(/\*/g,".+"),e.split(",").map(t=>new RegExp(`^${t}$`)))}r(Ne,"extract");var C;function re(e){let t=globalThis.DEBUG;C||(C=new H(Ne(t)));let n=new D(C,e);return C.debuggers.set(e,n),Object.assign(n.log.bind(n),{self:n})}r(re,"debug");function ve(e){if(e.length>=255)throw new TypeError("Alphabet too long");let t=new Uint8Array(256);for(let l=0;l<t.length;l++)t[l]=255;for(let l=0;l<e.length;l++){let a=e.charAt(l),p=a.charCodeAt(0);if(t[p]!==255)throw new TypeError(a+" is ambiguous");t[p]=l}let n=e.length,s=e.charAt(0),i=Math.log(n)/Math.log(256),c=Math.log(256)/Math.log(n);function o(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let a=0,p=0,d=0,h=l.length;for(;d!==h&&l[d]===0;)d++,a++;let _=(h-d)*c+1>>>0,m=new Uint8Array(_);for(;d!==h;){let g=l[d],w=0;for(let y=_-1;(g!==0||w<p)&&y!==-1;y--,w++)g+=256*m[y]>>>0,m[y]=g%n>>>0,g=g/n>>>0;if(g!==0)throw new Error("Non-zero carry");p=w,d++}let b=_-p;for(;b!==_&&m[b]===0;)b++;let T=s.repeat(a);for(;b<_;++b)T+=e.charAt(m[b]);return T}r(o,"encode");function u(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let a=0,p=0,d=0;for(;l[a]===s;)p++,a++;let h=(l.length-a)*i+1>>>0,_=new Uint8Array(h);for(;l[a];){let g=t[l.charCodeAt(a)];if(g===255)return;let w=0;for(let y=h-1;(g!==0||w<d)&&y!==-1;y--,w++)g+=n*_[y]>>>0,_[y]=g%256>>>0,g=g/256>>>0;if(g!==0)throw new Error("Non-zero carry");d=w,a++}let m=h-d;for(;m!==h&&_[m]===0;)m++;let b=new Uint8Array(p+(h-m)),T=p;for(;m!==h;)b[T++]=_[m++];return b}r(u,"decodeUnsafe");function f(l){let a=u(l);if(a)return a;throw new Error("Non-base"+n+" character")}return r(f,"decode"),{encode:o,decodeUnsafe:u,decode:f}}r(ve,"base");var oe=ve;var Me="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",ie=oe(Me);var R=re("zuplo:runtime:external-service");function ze(){let e,{__ZUPLO_EXTERNAL_SERVICE_TOKEN:t}=L.instance.runtime;if(t&&t!=="undefined")try{let n=atob(t);e=JSON.parse(n)}catch{}return e}r(ze,"getServiceAuth");async function se(e,t){let n=ze();if(n)if(R(`Using external service auth. ClientId: ${n.clientId})`),typeof e=="string"){let s=new URL(e),i=s.hostname,c=t??{},o=new Headers(c.headers||{});o.set("CF-Access-Client-Id",n.clientId),o.set("CF-Access-Client-Secret",n.clientSecret),c.headers=o;let u;if(n.customServiceMapping&&n.customServiceMapping[i])u=`https://${n.customServiceMapping[i]}`;else if(L.instance.useLegacyServiceRouting)u=`https://${i}.zuptunnel.com`;else{R("Using sha256 service routing");let a=L.instance.build;if(a.ACCOUNT_NAME&&a.PROJECT_NAME&&a.ENVIRONMENT_TYPE){let p=await Fe(i,a.ACCOUNT_NAME,a.PROJECT_NAME,a.ENVIRONMENT_TYPE),d=ce(a.ENVIRONMENT_TYPE),h=await k(`${a.ACCOUNT_NAME}-${a.PROJECT_NAME}-${d}`);h==="40d7ad502f5d743997999594c177184a00161a77865423511f3a1ea21eb5a5e"||h==="d05bffe8fa91a300187d2cf43e8aa4a56bd809c442ae10d1ee49af7d29a5a11"?u=`https://${p}.zuptunnel.com`:u=`https://${p}.t.zuplo.app`}else throw R("Cannot use sha256 service routing, missing build variables"),new E("Failed to generate fully qualified tunnel url.")}let f=new URL(`${u}${s.pathname}${s.search}`);R(`Calling external service: ${f.toString()}`);let l=await U(f.toString(),c);if(l.status===403&&l.headers.get("cf-access-domain")!==null)throw S.console.error("403 Forbidden when calling external service.",{clientId:n.clientId,tunnelHost:u}),new E("Could not connect to secure tunnel.");return l}else throw R("Cannot call external service with Request object"),new E("Currently, we only support fetch(<some_string>, ...).");else throw R("There is no external service auth configured for this zup."),new E("There are no external services configured for this zup.")}r(se,"externalServiceHandler");async function le(e,t){if(typeof e=="string"){let n=new URL(e),i=`http://${n.hostname}.zuplo.svc.cluster.local:9000`,c=new URL(`${i}${n.pathname}${n.search}`);return await U(c.toString(),t)}else throw new E("Currently, we only support fetch(<some_string>, ...).")}r(le,"clusterServiceHandler");async function Fe(e,t,n,s){let i=e.toLowerCase(),c=t.toLowerCase(),o=n.toLowerCase(),u=ce(s);R(`Hashing service name: ${c}-${i}.${c}-${o}-${u}`);let f=await k(`${c}-${i}`),l=await k(`${c}-${o}-${u}`);return`${f}.${l}`}r(Fe,"hashServiceName");async function k(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(c=>c.toString(16).padStart(2,"0")).join("").slice(0,-1)}r(k,"hashSegment");function ce(e){let t=e.toLowerCase();switch(t){case"production":case"preview":return t;default:return"working-copy"}}r(ce,"sanitizeEnvironmentType");var B=new Map;B.set("service:",se);B.set("local:",le);var U=globalThis.fetch;function j(e,t){let n=Ze(t);if(typeof e=="string"){let s=new URL(e),i=B.get(s.protocol);return i?i(e,n):U(e,n)}else return U(e,n)}r(j,"internalFetch");globalThis.fetch=j;var Ze=r(e=>{if(!e||e instanceof Request)return e;let t=e;if(!t.zuplo)return e;let n=e;return n.cf={cacheEverything:t.zuplo?.cacheEverything,cacheTtl:t.zuplo?.cacheTtlSeconds},delete e.zuplo,e},"transformInit");var $e={console:{log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console),assert:console.assert.bind(console),clear:console.clear.bind(console),count:console.count.bind(console),countReset:console.countReset.bind(console),dir:console.dir.bind(console),dirxml:console.dirxml.bind(console),group:console.group.bind(console),groupCollapsed:console.groupCollapsed.bind(console),groupEnd:console.groupEnd.bind(console),table:console.table.bind(console),time:console.time.bind(console),timeEnd:console.timeEnd.bind(console),timeLog:console.timeLog.bind(console),timeStamp:console.timeStamp.bind(console),trace:console.trace.bind(console),profile:console.profile.bind(console),profileEnd:console.profileEnd.bind(console)},fetch:j},S=$e;var G="2025-02-06",ue=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1},"2024-09-02":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1},"2025-02-06":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0,removeLegacyLogInitialization:!0,useForwardRedirectsPropOnUrlForwardHandler:!0}});function ae(){return new L({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:G,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:ue[G]},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(ae,"getMockEnvironment");var L=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||(S.console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),this.#e=ae()),this.#e}constructor({build:t,runtime:n}){let s;try{if(n.ZUPLO_SYSTEM_CONFIGURATIONS){let i=new TextDecoder().decode(ie.decode(n.ZUPLO_SYSTEM_CONFIGURATIONS)),c=JSON.parse(i);for(let o of Object.keys(c))n[o]||(n[o]=c[o])}if(n.__ZUPLO_CONFIG){let i=atob(n.__ZUPLO_CONFIG);s=JSON.parse(i)}}catch(i){S.console.error("Failed to parse runtime configuration",i)}this.config=s??{},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 zuploEdgeApiUrl(){return this.config.zuplo_edge_api_url??"https://api.zuploedge.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.zuploedge.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.zuploedge.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuploedge.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuploedge.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{r as a,De as b,He as c,ke as d,re as e,V as f,E as g,Y as h,L as i,S as j};
36
+ /*! For license information please see chunk-6NB5NCX6.js.LEGAL.txt */
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Echos the value of a value. Trys to print the value out
3
+ * in the best way possible given the different types.
4
+ *
5
+ * @param {Object} obj The object to print out.
6
+ * @param {boolean} showHidden
7
+ * @param {number} depth
8
+ * @param {boolean} colors
9
+ * @license MIT (© Joyent)
10
+ */
@@ -0,0 +1,25 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ import{a as i,i as o}from"./chunk-6NB5NCX6.js";var p=(n=>(n.Build="build-data",n.CorsPreflight="cors-preflight",n.DeveloperPortal="developer-portal",n.ZudokuPortal="zudoku-portal",n.DeveloperPortalLegacy="developer-portal-legacy",n.StripePlugin="stripe-plugin",n.EmptyGatewayCatchall="empty-gateway-catchall",n.Ping="ping",n.UnmatchedPath="unmatched-path",n))(p||{});var g=["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_")?!g.includes(e)&&!e.startsWith("ZUPLO_PUBLIC_"):!1}i(l,"isRestrictedEnvVariableName");function c(e){return!!e.startsWith("ZUPLO_")}i(c,"isZuploReadableEnvVariableName");var u=new Proxy({},{get(e,t){let r=String(t);switch(r){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;case"ZUPLO_COMPATIBILITY_DATE":return o.instance.build.COMPATIBILITY_DATE}if(!(l(r)&&!c(r)))return o.instance.runtime[r]}});function f(e,t,r){return`_${a(`${e}_${t}_${r}`)}`}i(f,"getRawOperationDataIdentifierName");function L(e,t,r,s){return`_${a(e.toLowerCase())}_${t.toLowerCase()}_${r.toLowerCase()}_${s.toLowerCase()}`}i(L,"getIdForParameterSchema");function E(e,t,r){return`_${a(e.toLowerCase())}_${t.toLowerCase()}_rb_${a(r.toLowerCase())}`}i(E,"getIdForRequestBodySchema");function C(e,t){return`_${a(e)}_${a(t)}`}i(C,"getIdForRefSchema");function a(e){let t=e.replace(/\[/g,"_LBRACKET_").replace(/\]/g,"_RBRACKET_").replace(/\{/g,"_LCURLY_").replace(/\}/g,"_RCURLY_").replace(/\//g,"_SLASH_").replace(/-/g,"_DASH_").replace(/\./g,"_DOT_").replace(/\+/g,"_PLUS_").replace(/:/g,"_COLON_").replace(/@/g,"_AT_").replace(/\$/g,"_DOLLAR_").replace(/[^a-zA-Z0-9_]/g,"_");return/^[a-zA-Z_]/.test(t)||(t="_"+t),t}i(a,"sanitizedIdentifierName");export{p as a,l as b,c,u as d,f as e,L as f,E as g,C as h,a as i};