@zuplo/runtime 6.45.0 → 6.46.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,4 +22,4 @@
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-GPCONSBV.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-WXV4LG5G.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};
@@ -1275,6 +1275,19 @@ declare interface CompatibilityFlags {
1275
1275
  * @compatibilityDate 2024-09-02
1276
1276
  */
1277
1277
  allowCustomPorts: boolean;
1278
+ /**
1279
+ * Whether or not to use the new logging system
1280
+ *
1281
+ * @compatibilityDate 2025-02-06
1282
+ */
1283
+ removeLegacyLogInitialization: boolean;
1284
+ /**
1285
+ * Whether or not to enable the followRedirects option on the URL Forward handler
1286
+ * NOTE: This flag was documented, but never implimented so its a breaking
1287
+ * change to enable it.
1288
+ * @compatibilityDate 2025-02-06
1289
+ */
1290
+ useForwardRedirectsPropOnUrlForwardHandler: boolean;
1278
1291
  }
1279
1292
 
1280
1293
  /**
@@ -66,6 +66,19 @@ declare interface CompatibilityFlags {
66
66
  * @compatibilityDate 2024-09-02
67
67
  */
68
68
  allowCustomPorts: boolean;
69
+ /**
70
+ * Whether or not to use the new logging system
71
+ *
72
+ * @compatibilityDate 2025-02-06
73
+ */
74
+ removeLegacyLogInitialization: boolean;
75
+ /**
76
+ * Whether or not to enable the followRedirects option on the URL Forward handler
77
+ * NOTE: This flag was documented, but never implimented so its a breaking
78
+ * change to enable it.
79
+ * @compatibilityDate 2025-02-06
80
+ */
81
+ useForwardRedirectsPropOnUrlForwardHandler: boolean;
69
82
  }
70
83
 
71
84
  declare type CorsPolicy = string | "anything-goes" | "none";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.45.0",
4
+ "version": "6.46.0",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,25 +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 N=(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))(N||{});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 L(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(L,"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 C(e){let o=A(e);if(o)return o;throw new Error("Non-base"+n+" character")}return i(C,"decode"),{encode:L,decodeUnsafe:A,decode:C}}i(b,"base");var T=b;var v="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",I=T(v);var U="2024-09-02",R=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},"2025-02-06":{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:R[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_SYSTEM_CONFIGURATIONS){let m=new TextDecoder().decode(I.decode(n.ZUPLO_SYSTEM_CONFIGURATIONS)),h=JSON.parse(m);for(let L of Object.keys(h))n[L]||(n[L]=h[L])}if(n.__ZUPLO_CONFIG){let m=atob(n.__ZUPLO_CONFIG);f=JSON.parse(m)}}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 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;case"ZUPLO_COMPATIBILITY_DATE":return l.instance.build.COMPATIBILITY_DATE}if(!(M(n)&&!S(n)))return l.instance.runtime[n]}});function ne(t,r,n){return`_${E(`${t}_${r}_${n}`)}`}i(ne,"getRawOperationDataIdentifierName");function re(t,r,n,f){return`_${E(t.toLowerCase())}_${r.toLowerCase()}_${n.toLowerCase()}_${f.toLowerCase()}`}i(re,"getIdForParameterSchema");function ie(t,r,n){return`_${E(t.toLowerCase())}_${r.toLowerCase()}_rb_${E(n.toLowerCase())}`}i(ie,"getIdForRequestBodySchema");function oe(t,r){return`_${E(t)}_${E(r)}`}i(oe,"getIdForRefSchema");function E(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}i(E,"sanitizedIdentifierName");export{l as a,N as b,M as c,S as d,X as e,ne as f,re as g,ie as h,oe as i,E as j};