@zuplo/runtime 6.21.6 → 6.21.12

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,26 @@
1
+
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Zuplo, Inc. All rights reserved.
4
+ *
5
+ * This software and associated documentation files (the "Software") is intended to be used
6
+ * only by Zuplo customers solely to develop and test applications that will be deployed
7
+ * to Zuplo hosted services. You and others in your organization may use these files on your
8
+ * Development Devices solely for the above stated purpose.
9
+ *
10
+ * Outside of uses stated above, no license is granted for any other purpose including
11
+ * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
+ * sublicense, host, and/or sell copies of the Software.
13
+ *
14
+ * The software may include third party components with separate legal notices or governed by
15
+ * other agreements, as described in licenses either embedded in or accompanying the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
+ * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ * DEALINGS IN THE SOFTWARE.
23
+ *--------------------------------------------------------------------------------------------*/
24
+
25
+ import{a as i}from"./chunk-PPV7V43C.js";var C=(e=>(e.Build="build-data",e.CorsPreflight="cors-preflight",e.DeveloperPortal="developer-portal",e.ZudokuPortal="zudoku-portal",e.DeveloperPortalLegacy="developer-portal-legacy",e.StripePlugin="stripe-plugin",e.EmptyGatewayCatchall="empty-gateway-catchall",e.Ping="ping",e.UnmatchedPath="unmatched-path",e))(C||{});function b(t){if(t.length>=255)throw new TypeError("Alphabet too long");let r=new Uint8Array(256);for(let e=0;e<r.length;e++)r[e]=255;for(let e=0;e<t.length;e++){let o=t.charAt(e),_=o.charCodeAt(0);if(r[_]!==255)throw new TypeError(o+" is ambiguous");r[_]=e}let n=t.length,f=t.charAt(0),m=Math.log(n)/Math.log(256),h=Math.log(256)/Math.log(n);function E(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length===0)return"";let o=0,_=0,a=0,g=e.length;for(;a!==g&&e[a]===0;)a++,o++;let d=(g-a)*h+1>>>0,u=new Uint8Array(d);for(;a!==g;){let s=e[a],O=0;for(let p=d-1;(s!==0||O<_)&&p!==-1;p--,O++)s+=256*u[p]>>>0,u[p]=s%n>>>0,s=s/n>>>0;if(s!==0)throw new Error("Non-zero carry");_=O,a++}let c=d-_;for(;c!==d&&u[c]===0;)c++;let P=f.repeat(o);for(;c<d;++c)P+=t.charAt(u[c]);return P}i(E,"encode");function A(e){if(typeof e!="string")throw new TypeError("Expected String");if(e.length===0)return new Uint8Array;let o=0,_=0,a=0;for(;e[o]===f;)_++,o++;let g=(e.length-o)*m+1>>>0,d=new Uint8Array(g);for(;e[o];){let s=r[e.charCodeAt(o)];if(s===255)return;let O=0;for(let p=g-1;(s!==0||O<a)&&p!==-1;p--,O++)s+=n*d[p]>>>0,d[p]=s%256>>>0,s=s/256>>>0;if(s!==0)throw new Error("Non-zero carry");a=O,o++}let u=g-a;for(;u!==g&&d[u]===0;)u++;let c=new Uint8Array(_+(g-u)),P=_;for(;u!==g;)c[P++]=d[u++];return c}i(A,"decodeUnsafe");function N(e){let o=A(e);if(o)return o;throw new Error("Non-base"+n+" character")}return i(N,"decode"),{encode:E,decodeUnsafe:A,decode:N}}i(b,"base");var T=b;var v="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",R=T(v);var U="2024-09-02",I=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1},"2024-09-02":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0}});function y(){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:U,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:I[U]},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:""}})}i(y,"getMockEnvironment");var l=class t{static{i(this,"Environment")}config;static#e;static#t=!1;static initialize(r){this.#e||(this.#e=new t(r),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=y()),this.#e}constructor({build:r,runtime:n}){let f;try{if(n.__ZUPLO_CONFIG){let m=atob(n.__ZUPLO_CONFIG);f=JSON.parse(m)}if(n.ZUPLO_SYSTEM_CONFIGURATIONS){let m=new TextDecoder().decode(R.decode(n.ZUPLO_SYSTEM_CONFIGURATIONS)),h=JSON.parse(m);for(let E of Object.keys(h))n[E]||(n[E]=h[E])}}catch(m){console.error("Failed to parse runtime configuration",m)}this.config=f??{},this.build=r,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 zudokuHostUrl(){return this.runtime.__ZUPLO_ZUDOKU_HOST_URL??this.config.zudoku_host_url??"https://zudoku.zuploedge.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"}};var w=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function M(t){return t.startsWith("__ZUPLO")||t.startsWith("ZUPLO_")?!w.includes(t)&&!t.startsWith("ZUPLO_PUBLIC_"):!1}i(M,"isRestrictedEnvVariableName");function S(t){return!!t.startsWith("ZUPLO_")}i(S,"isZuploReadableEnvVariableName");var X=new Proxy({},{get(t,r){let n=String(r);switch(n){case"ZUPLO_ENVIRONMENT_TYPE":return l.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return l.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return l.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return l.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return l.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return l.instance.build.BUILD_ID}if(!(M(n)&&!S(n)))return l.instance.runtime[n]}});function ne(t,r,n){return`_${L(`${t}_${r}_${n}`)}`}i(ne,"getRawOperationDataIdentifierName");function re(t,r,n,f){return`_${L(t.toLowerCase())}_${r.toLowerCase()}_${n.toLowerCase()}_${f.toLowerCase()}`}i(re,"getIdForParameterSchema");function ie(t,r,n){return`_${L(t.toLowerCase())}_${r.toLowerCase()}_rb_${L(n.toLowerCase())}`}i(ie,"getIdForRequestBodySchema");function oe(t,r){return`_${L(t)}_${L(r)}`}i(oe,"getIdForRefSchema");function L(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}i(L,"sanitizedIdentifierName");export{l as a,C as b,M as c,S as d,X as e,ne as f,re as g,ie as h,oe as i,L as j};
26
+ /*! For license information please see chunk-AVPEK25G.js.LEGAL.txt */
package/out/esm/index.js CHANGED
@@ -22,7 +22,7 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{a as f,b as Me,e as Re,f as iu,g as jn,h as zn,i as su,j as au}from"./chunk-42633C6L.js";import{a as i,b as ou,c as ru}from"./chunk-PPV7V43C.js";var Ss=ou(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.parse=Ju;hn.serialize=Ku;var ju=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,zu=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Bu=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Gu=/^[\u0020-\u003A\u003D-\u007E]*$/,Vu=Object.prototype.toString,Wu=(()=>{let n=i(function(){},"C");return n.prototype=Object.create(null),n})();function Ju(n,e){let t=new Wu,o=n.length;if(o<2)return t;let r=e?.decode||Qu,s=0;do{let a=n.indexOf("=",s);if(a===-1)break;let u=n.indexOf(";",s),c=u===-1?o:u;if(a>c){s=n.lastIndexOf(";",a-1)+1;continue}let l=Cs(n,s,a),d=Os(n,a,l),p=n.slice(l,d);if(t[p]===void 0){let h=Cs(n,a+1,c),y=Os(n,c,h),C=r(n.slice(h,y));t[p]=C}s=c+1}while(s<o);return t}i(Ju,"parse");function Cs(n,e,t){do{let o=n.charCodeAt(e);if(o!==32&&o!==9)return e}while(++e<t);return t}i(Cs,"startIndex");function Os(n,e,t){for(;e>t;){let o=n.charCodeAt(--e);if(o!==32&&o!==9)return e+1}return t}i(Os,"endIndex");function Ku(n,e,t){let o=t?.encode||encodeURIComponent;if(!ju.test(n))throw new TypeError(`argument name is invalid: ${n}`);let r=o(e);if(!zu.test(r))throw new TypeError(`argument val is invalid: ${e}`);let s=n+"="+r;if(!t)return s;if(t.maxAge!==void 0){if(!Number.isInteger(t.maxAge))throw new TypeError(`option maxAge is invalid: ${t.maxAge}`);s+="; Max-Age="+t.maxAge}if(t.domain){if(!Bu.test(t.domain))throw new TypeError(`option domain is invalid: ${t.domain}`);s+="; Domain="+t.domain}if(t.path){if(!Gu.test(t.path))throw new TypeError(`option path is invalid: ${t.path}`);s+="; Path="+t.path}if(t.expires){if(!Yu(t.expires)||!Number.isFinite(t.expires.valueOf()))throw new TypeError(`option expires is invalid: ${t.expires}`);s+="; Expires="+t.expires.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority)switch(typeof t.priority=="string"?t.priority.toLowerCase():t.sameSite){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${t.priority}`)}if(t.sameSite)switch(typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite){case!0:case"strict":s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"none":s+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${t.sameSite}`)}return s}i(Ku,"serialize");function Qu(n){if(n.indexOf("%")===-1)return n;try{return decodeURIComponent(n)}catch{return n}}i(Qu,"decode");function Yu(n){return Vu.call(n)==="[object Date]"}i(Yu,"isDate")});var uu=!1;function ut(n,e){return{open:`\x1B[${n.join(";")}m`,close:`\x1B[${e}m`,regexp:new RegExp(`\\x1b\\[${e}m`,"g")}}i(ut,"code");function ct(n,e){return uu?`${e.open}${n.replace(e.regexp,e.open)}${e.close}`:n}i(ct,"run");function cu(n){return ct(n,ut([31],39))}i(cu,"red");function lu(n){return ct(n,ut([32],39))}i(lu,"green");function du(n){return ct(n,ut([33],39))}i(du,"yellow");function pu(n){return ct(n,ut([34],39))}i(pu,"blue");function mu(n){return ct(n,ut([35],39))}i(mu,"magenta");function gu(n){return ct(n,ut([36],39))}i(gu,"cyan");var Kd=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 Ti=[cu,lu,du,pu,mu,gu];function fu(n){let e=0,t=n.length,o=0;if(t>0)for(;o<t;)e=(e<<5)-e+n.charCodeAt(o++)|0;return e}i(fu,"hashCode");function vi(n){let e=Math.abs(fu(n));return Ti[e%Ti.length]}i(vi,"generateColor");function Ci(n,e,...t){let o=0,r=t.length,s=String(e).replace(/%[sdjoO%]/g,a=>{if(a==="%%")return"%";if(o>=r)return a;switch(a){case"%s":return String(t[o++]);case"%d":return Number(t[o++]).toString();case"%o":return n(t[o++]).split(`
25
+ import{a as f,b as Me,e as Re,f as iu,g as jn,h as zn,i as su,j as au}from"./chunk-AVPEK25G.js";import{a as i,b as ou,c as ru}from"./chunk-PPV7V43C.js";var Ss=ou(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.parse=Ju;hn.serialize=Ku;var ju=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,zu=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Bu=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Gu=/^[\u0020-\u003A\u003D-\u007E]*$/,Vu=Object.prototype.toString,Wu=(()=>{let n=i(function(){},"C");return n.prototype=Object.create(null),n})();function Ju(n,e){let t=new Wu,o=n.length;if(o<2)return t;let r=e?.decode||Qu,s=0;do{let a=n.indexOf("=",s);if(a===-1)break;let u=n.indexOf(";",s),c=u===-1?o:u;if(a>c){s=n.lastIndexOf(";",a-1)+1;continue}let l=Cs(n,s,a),d=Os(n,a,l),p=n.slice(l,d);if(t[p]===void 0){let h=Cs(n,a+1,c),y=Os(n,c,h),C=r(n.slice(h,y));t[p]=C}s=c+1}while(s<o);return t}i(Ju,"parse");function Cs(n,e,t){do{let o=n.charCodeAt(e);if(o!==32&&o!==9)return e}while(++e<t);return t}i(Cs,"startIndex");function Os(n,e,t){for(;e>t;){let o=n.charCodeAt(--e);if(o!==32&&o!==9)return e+1}return t}i(Os,"endIndex");function Ku(n,e,t){let o=t?.encode||encodeURIComponent;if(!ju.test(n))throw new TypeError(`argument name is invalid: ${n}`);let r=o(e);if(!zu.test(r))throw new TypeError(`argument val is invalid: ${e}`);let s=n+"="+r;if(!t)return s;if(t.maxAge!==void 0){if(!Number.isInteger(t.maxAge))throw new TypeError(`option maxAge is invalid: ${t.maxAge}`);s+="; Max-Age="+t.maxAge}if(t.domain){if(!Bu.test(t.domain))throw new TypeError(`option domain is invalid: ${t.domain}`);s+="; Domain="+t.domain}if(t.path){if(!Gu.test(t.path))throw new TypeError(`option path is invalid: ${t.path}`);s+="; Path="+t.path}if(t.expires){if(!Yu(t.expires)||!Number.isFinite(t.expires.valueOf()))throw new TypeError(`option expires is invalid: ${t.expires}`);s+="; Expires="+t.expires.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority)switch(typeof t.priority=="string"?t.priority.toLowerCase():t.sameSite){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${t.priority}`)}if(t.sameSite)switch(typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite){case!0:case"strict":s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"none":s+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${t.sameSite}`)}return s}i(Ku,"serialize");function Qu(n){if(n.indexOf("%")===-1)return n;try{return decodeURIComponent(n)}catch{return n}}i(Qu,"decode");function Yu(n){return Vu.call(n)==="[object Date]"}i(Yu,"isDate")});var uu=!1;function ut(n,e){return{open:`\x1B[${n.join(";")}m`,close:`\x1B[${e}m`,regexp:new RegExp(`\\x1b\\[${e}m`,"g")}}i(ut,"code");function ct(n,e){return uu?`${e.open}${n.replace(e.regexp,e.open)}${e.close}`:n}i(ct,"run");function cu(n){return ct(n,ut([31],39))}i(cu,"red");function lu(n){return ct(n,ut([32],39))}i(lu,"green");function du(n){return ct(n,ut([33],39))}i(du,"yellow");function pu(n){return ct(n,ut([34],39))}i(pu,"blue");function mu(n){return ct(n,ut([35],39))}i(mu,"magenta");function gu(n){return ct(n,ut([36],39))}i(gu,"cyan");var Kd=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 Ti=[cu,lu,du,pu,mu,gu];function fu(n){let e=0,t=n.length,o=0;if(t>0)for(;o<t;)e=(e<<5)-e+n.charCodeAt(o++)|0;return e}i(fu,"hashCode");function vi(n){let e=Math.abs(fu(n));return Ti[e%Ti.length]}i(vi,"generateColor");function Ci(n,e,...t){let o=0,r=t.length,s=String(e).replace(/%[sdjoO%]/g,a=>{if(a==="%%")return"%";if(o>=r)return a;switch(a){case"%s":return String(t[o++]);case"%d":return Number(t[o++]).toString();case"%o":return n(t[o++]).split(`
26
26
  `).map(u=>u.trim()).join(" ");case"%O":return n(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch{return"[Circular]"}default:return a}});for(let a of t.splice(o))a===null||!(typeof a=="object"&&a!==null)?s+=" "+a:s+=" "+n(a);return s}i(Ci,"format");function $e(n,e,t,o){let r={seen:[],stylize:hu,showHidden:e??!1,depth:t??2,colors:o??!1,customInspect:!0};return r.colors&&(r.stylize=bu),tn(r,n,r.depth)}i($e,"inspect");$e.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]};$e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function hu(n,e){return n}i(hu,"stylizeNoColor");function yu(n){return typeof n=="boolean"}i(yu,"isBoolean");function Si(n){return n===void 0}i(Si,"isUndefined");function bu(n,e){let t=$e.styles[e];return t?"\x1B["+$e.colors[t][0]+"m"+n+"\x1B["+$e.colors[t][1]+"m":n}i(bu,"stylizeWithColor");function Bn(n){return typeof n=="function"}i(Bn,"isFunction");function Ai(n){return typeof n=="string"}i(Ai,"isString");function wu(n){return typeof n=="number"}i(wu,"isNumber");function ki(n){return n===null}i(ki,"isNull");function Li(n,e){return Object.prototype.hasOwnProperty.call(n,e)}i(Li,"hasOwn");function Gn(n){return Kn(n)&&Qn(n)==="[object RegExp]"}i(Gn,"isRegExp");function Kn(n){return typeof n=="object"&&n!==null}i(Kn,"isObject");function Vn(n){return Kn(n)&&(Qn(n)==="[object Error]"||n instanceof Error)}i(Vn,"isError");function Oi(n){return Kn(n)&&Qn(n)==="[object Date]"}i(Oi,"isDate");function Qn(n){return Object.prototype.toString.call(n)}i(Qn,"objectToString");function Ru(n){let e={};return n.forEach(function(t,o){e[t]=!0}),e}i(Ru,"arrayToHash");function Pu(n,e,t,o,r){let s=[];for(let a=0,u=e.length;a<u;++a)Li(e,String(a))?s.push(Jn(n,e,t,o,String(a),!0)):s.push("");return r.forEach(function(a){a.match(/^\d+$/)||s.push(Jn(n,e,t,o,a,!0))}),s}i(Pu,"formatArray");function Wn(n){return"["+Error.prototype.toString.call(n)+"]"}i(Wn,"formatError");function tn(n,e,t){if(n.customInspect&&e&&Bn(e.inspect)&&e.inspect!==$e&&!(e.constructor&&e.constructor.prototype===e)){let d=e.inspect(t,n);return Ai(d)||(d=tn(n,d,t)),d}let o=Iu(n,e);if(o)return o;let r=Object.keys(e),s=Ru(r);try{n.showHidden&&Object.getOwnPropertyNames&&(r=Object.getOwnPropertyNames(e))}catch{}if(Vn(e)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return Wn(e);if(r.length===0){if(Bn(e)){let d=e.name?": "+e.name:"";return n.stylize("[Function"+d+"]","special")}if(Gn(e))return n.stylize(RegExp.prototype.toString.call(e),"regexp");if(Oi(e))return n.stylize(Date.prototype.toString.call(e),"date");if(Vn(e))return Wn(e)}let a="",u=!1,c=["{","}"];if(Array.isArray(e)&&(u=!0,c=["[","]"]),Bn(e)&&(a=" [Function"+(e.name?": "+e.name:"")+"]"),Gn(e)&&(a=" "+RegExp.prototype.toString.call(e)),Oi(e)&&(a=" "+Date.prototype.toUTCString.call(e)),Vn(e)&&(a=" "+Wn(e)),r.length===0&&(!u||e.length==0))return c[0]+a+c[1];if(t<0)return Gn(e)?n.stylize(RegExp.prototype.toString.call(e),"regexp"):n.stylize("[Object]","special");n.seen.push(e);let l;return u?l=Pu(n,e,t,s,r):l=r.map(function(d){return Jn(n,e,t,s,d,u)}),n.seen.pop(),Eu(l,a,c)}i(tn,"formatValue");function Jn(n,e,t,o,r,s){let a,u,c;c={value:void 0};try{c.value=e[r]}catch{}try{Object.getOwnPropertyDescriptor&&(c=Object.getOwnPropertyDescriptor(e,r)||c)}catch{}if(c.get?c.set?u=n.stylize("[Getter/Setter]","special"):u=n.stylize("[Getter]","special"):c.set&&(u=n.stylize("[Setter]","special")),Li(o,r)||(a="["+r+"]"),u||(n.seen.indexOf(c.value)<0?(ki(t)?u=tn(n,c.value,null):u=tn(n,c.value,t-1),u.indexOf(`
27
27
  `)>-1&&(s?u=u.split(`
28
28
  `).map(function(l){return" "+l}).join(`
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{c as e,d as t,f as a,g as o,h as r,i,j as n}from"../chunk-42633C6L.js";import"../chunk-PPV7V43C.js";export{o as getIdForParameterSchema,i as getIdForRefSchema,r as getIdForRequestBodySchema,a as getRawOperationDataIdentifierName,e as isRestrictedEnvVariableName,t as isZuploReadableEnvVariableName,n as sanitizedIdentifierName};
25
+ import{c as e,d as t,f as a,g as o,h as r,i,j as n}from"../chunk-AVPEK25G.js";import"../chunk-PPV7V43C.js";export{o as getIdForParameterSchema,i as getIdForRefSchema,r as getIdForRequestBodySchema,a as getRawOperationDataIdentifierName,e as isRestrictedEnvVariableName,t as isZuploReadableEnvVariableName,n as sanitizedIdentifierName};
26
26
  /*! For license information please see index.js.LEGAL.txt */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.21.6",
4
+ "version": "6.21.12",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,26 +0,0 @@
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}from"./chunk-PPV7V43C.js";var C=(e=>(e.Build="build-data",e.CorsPreflight="cors-preflight",e.DeveloperPortal="developer-portal",e.ZudokuPortal="zudoku-portal",e.DeveloperPortalLegacy="developer-portal-legacy",e.StripePlugin="stripe-plugin",e.EmptyGatewayCatchall="empty-gateway-catchall",e.Ping="ping",e.UnmatchedPath="unmatched-path",e))(C||{});function b(t){if(t.length>=255)throw new TypeError("Alphabet too long");let r=new Uint8Array(256);for(let e=0;e<r.length;e++)r[e]=255;for(let e=0;e<t.length;e++){let o=t.charAt(e),_=o.charCodeAt(0);if(r[_]!==255)throw new TypeError(o+" is ambiguous");r[_]=e}let n=t.length,f=t.charAt(0),m=Math.log(n)/Math.log(256),E=Math.log(256)/Math.log(n);function h(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length===0)return"";let o=0,_=0,a=0,g=e.length;for(;a!==g&&e[a]===0;)a++,o++;let d=(g-a)*E+1>>>0,u=new Uint8Array(d);for(;a!==g;){let s=e[a],O=0;for(let p=d-1;(s!==0||O<_)&&p!==-1;p--,O++)s+=256*u[p]>>>0,u[p]=s%n>>>0,s=s/n>>>0;if(s!==0)throw new Error("Non-zero carry");_=O,a++}let c=d-_;for(;c!==d&&u[c]===0;)c++;let P=f.repeat(o);for(;c<d;++c)P+=t.charAt(u[c]);return P}i(h,"encode");function A(e){if(typeof e!="string")throw new TypeError("Expected String");if(e.length===0)return new Uint8Array;let o=0,_=0,a=0;for(;e[o]===f;)_++,o++;let g=(e.length-o)*m+1>>>0,d=new Uint8Array(g);for(;e[o];){let s=r[e.charCodeAt(o)];if(s===255)return;let O=0;for(let p=g-1;(s!==0||O<a)&&p!==-1;p--,O++)s+=n*d[p]>>>0,d[p]=s%256>>>0,s=s/256>>>0;if(s!==0)throw new Error("Non-zero carry");a=O,o++}let u=g-a;for(;u!==g&&d[u]===0;)u++;let c=new Uint8Array(_+(g-u)),P=_;for(;u!==g;)c[P++]=d[u++];return c}i(A,"decodeUnsafe");function N(e){let o=A(e);if(o)return o;throw new Error("Non-base"+n+" character")}return i(N,"decode"),{encode:h,decodeUnsafe:A,decode:N}}i(b,"base");var T=b;var v="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",R=T(v);var U="2024-09-02",I=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1},"2024-09-02":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0}});function y(){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:U,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:I[U]},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:""}})}i(y,"getMockEnvironment");var l=class t{static{i(this,"Environment")}config;static#e;static#t=!1;static initialize(r){this.#e||(this.#e=new t(r),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=y()),this.#e}constructor({build:r,runtime:n}){let f;try{if(n.__ZUPLO_CONFIG){let m=atob(n.__ZUPLO_CONFIG);f=JSON.parse(m)}if(n.ZUPLO_SYSTEM_CONFIGURATIONS){let m=new TextDecoder().decode(R.decode(n.ZUPLO_SYSTEM_CONFIGURATIONS)),E=JSON.parse(m);for(let h of Object.keys(E))n[h]=E[h]}}catch(m){console.error("Failed to parse runtime configuration",m)}this.config=f??{},this.build=r,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 zudokuHostUrl(){return this.runtime.__ZUPLO_ZUDOKU_HOST_URL??this.config.zudoku_host_url??"https://zudoku.zuploedge.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"}};var w=["ZUPLO_USER_LOGGER_DATA_DOG_API_KEY","ZUPLO_USER_LOGGER_DATA_DOG_URL","ZUPLO_LOG_LEVEL","ZUPLO_HANDLER_WRITE_LOG_LEVEL"];function M(t){return t.startsWith("__ZUPLO")||t.startsWith("ZUPLO_")?!w.includes(t)&&!t.startsWith("ZUPLO_PUBLIC_"):!1}i(M,"isRestrictedEnvVariableName");function S(t){return!!t.startsWith("ZUPLO_")}i(S,"isZuploReadableEnvVariableName");var X=new Proxy({},{get(t,r){let n=String(r);switch(n){case"ZUPLO_ENVIRONMENT_TYPE":return l.instance.loggingEnvironmentType;case"ZUPLO_ENVIRONMENT_STAGE":return l.instance.loggingEnvironmentStage;case"ZUPLO_ENVIRONMENT_NAME":return l.instance.runtime.__ZUPLO_DEPLOYMENT_NAME;case"ZUPLO_ACCOUNT_NAME":return l.instance.build.ACCOUNT_NAME;case"ZUPLO_PROJECT_NAME":return l.instance.build.PROJECT_NAME;case"ZUPLO_BUILD_ID":return l.instance.build.BUILD_ID}if(!(M(n)&&!S(n)))return l.instance.runtime[n]}});function ne(t,r,n){return`_${L(`${t}_${r}_${n}`)}`}i(ne,"getRawOperationDataIdentifierName");function re(t,r,n,f){return`_${L(t.toLowerCase())}_${r.toLowerCase()}_${n.toLowerCase()}_${f.toLowerCase()}`}i(re,"getIdForParameterSchema");function ie(t,r,n){return`_${L(t.toLowerCase())}_${r.toLowerCase()}_rb_${L(n.toLowerCase())}`}i(ie,"getIdForRequestBodySchema");function oe(t,r){return`_${L(t)}_${L(r)}`}i(oe,"getIdForRefSchema");function L(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}i(L,"sanitizedIdentifierName");export{l as a,C as b,M as c,S as d,X as e,ne as f,re as g,ie as h,oe as i,L as j};
26
- /*! For license information please see chunk-42633C6L.js.LEGAL.txt */