@zuplo/runtime 6.22.6 → 6.22.7

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.
Files changed (2) hide show
  1. package/out/esm/index.js +4 -4
  2. package/package.json +1 -1
package/out/esm/index.js CHANGED
@@ -55,7 +55,7 @@ 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"./chu
55
55
  </div>
56
56
  </body>
57
57
  </html>
58
- `,_s=i((n,e)=>{let{sitePathname:t}=e.runtimeSettings.developerPortal,o=f.instance.deploymentName,r=f.instance.devPortalBaseUrl,s=i(async(c,l)=>{if(f.instance.isLocalDevelopment)return new Response(rc,{headers:{"content-type":"text/html"}});if(!o)return E.internalServerError(c,l,{detail:"Unable to retrieve deployment name. Please contact support for assistance."});let d=new URL(c.url),p=ks(r,c.headers),h=new URL(`${d.pathname}${d.search}`,p),{headers:y,method:C,body:P}=c;return f.instance.build.ACCOUNT_NAME&&y.set(tc,f.instance.build.ACCOUNT_NAME),f.instance.build.PROJECT_NAME&&y.set(nc,f.instance.build.PROJECT_NAME),y.set(Xu,o),y.set(ec,d.host),y.set(oc,f.instance.build.BUILD_ID),await H.fetch(h.toString(),{headers:y,method:C,body:P,redirect:"manual"})},"devPortalRoute"),a=new pe({processors:[he,mt],handler:s,gateway:e}),u=new ce({label:"SYSTEM_API_DOCS_V3_ROUTE",methods:["GET","PUT","POST","DELETE","PATCH","HEAD"],path:`(${t}|/_next)(.*)`,systemRouteName:"developer-portal"});n.addRoute(u,a.execute)},"registerDevPortalV3Route"),Ns=i((n,e)=>{let{sitePathname:t}=e.runtimeSettings.developerPortal,o=i(async a=>{let u=new URL(a.url);return u.pathname=`${t}${u.pathname.substring(Ls.length)}`,Response.redirect(u.toString(),302)},"devPortalRedirectRoute"),r=new pe({processors:[he],handler:o,gateway:e}),s=new ce({label:"SYSTEM_API_DOCS_REDIRECT_ROUTE",methods:["GET"],path:`${Ls}(.*)`,systemRouteName:"developer-portal-legacy"});n.addRoute(s,r.execute)},"registerDevPortalLegacyRedirectRoute");var Ds=i(n=>`
58
+ `,_s=i((n,e)=>{let{sitePathname:t}=e.runtimeSettings.developerPortal,o=f.instance.deploymentName,r=f.instance.devPortalBaseUrl,s=i(async(c,l)=>{if(f.instance.isLocalDevelopment)return new Response(rc,{headers:{"content-type":"text/html"}});if(!o)return E.internalServerError(c,l,{detail:"Unable to retrieve deployment name. Please contact support for assistance."});let d=new URL(c.url),p=ks(r,c.headers),h=new URL(`${d.pathname}${d.search}`,p),{headers:y,method:C,body:P}=c;return f.instance.build.ACCOUNT_NAME&&y.set(tc,f.instance.build.ACCOUNT_NAME),f.instance.build.PROJECT_NAME&&y.set(nc,f.instance.build.PROJECT_NAME),y.set(Xu,o),y.set(ec,d.host),y.set(oc,f.instance.build.BUILD_ID),await H.fetch(h.toString(),{headers:y,method:C,body:P,redirect:"manual"})},"devPortalRoute"),a=new pe({processors:[he,mt],handler:s,gateway:e}),u=new ce({label:"SYSTEM_API_DOCS_V3_ROUTE",methods:["GET","PUT","POST","DELETE","PATCH","HEAD"],path:`(${t}|/_next)(.*)`,systemRouteName:"developer-portal"});n.addRoute(u,a.execute)},"registerDevPortalV3Route"),Ns=i((n,e)=>{let{sitePathname:t}=e.runtimeSettings.developerPortal,o=i(async a=>{let u=new URL(a.url);return u.pathname=`${t}${u.pathname.substring(Ls.length)}`,Response.redirect(u.toString(),302)},"devPortalRedirectRoute"),r=new pe({processors:[he],handler:o,gateway:e}),s=new ce({label:"SYSTEM_API_DOCS_REDIRECT_ROUTE",methods:["GET"],path:`${Ls}(.*)`,systemRouteName:"developer-portal-legacy"});n.addRoute(s,r.execute)},"registerDevPortalLegacyRedirectRoute");var Ds=i(n=>{let e,t;if(n==="not-supported")e="Not Supported",t='Previewing your Developer Portal is not supported in when running locally. For instructions on how to develop your dev portal locally see <a class="underline" href="https://zudoku.dev/docs">the Zudoku docs</a>.';else if(n==="not-built")e="Not Published",t="The developer portal has not been published yet. If this is a new deployment, please wait a few minutes and try again.";else throw new Error(`Invalid status: ${n}`);return`
59
59
  <!DOCTYPE html>
60
60
  <html lang="en">
61
61
  <head>
@@ -71,14 +71,14 @@ 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"./chu
71
71
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M12 2a10 10 0 100 20 10 10 0 000-20z"></path>
72
72
  </svg>
73
73
  </div>
74
- <h1 class="mt-6 text-3xl font-extrabold text-gray-900">Not Supported</h1>
74
+ <h1 class="mt-6 text-3xl font-extrabold text-gray-900">${e}</h1>
75
75
  <p class="mt-2 text-sm text-gray-600">
76
- Previewing your Developer Portal is not supported in ${n}. For instructions on how to develop your dev portal locally see <a class="underline" href="https://zudoku.dev/docs">the Zudoku docs</a>.
76
+ ${t}
77
77
  </p>
78
78
  </div>
79
79
  </body>
80
80
  </html>
81
- `,"notAvailablePage"),Ms=i((n,e)=>{let{sitePathname:t}=e.runtimeSettings.developerPortal,{deploymentName:o,zudokuHostUrl:r}=f.instance,s=i(async(c,l)=>{if(f.instance.isLocalDevelopment)return new Response(Ds("local development"),{headers:{"content-type":"text/html"}});if(f.instance.isWorkingCopy)return new Response(Ds("working copy"),{headers:{"content-type":"text/html"}});if(!o)return E.internalServerError(c,l,{detail:"Unable to retrieve deployment name. Please contact support for assistance."});let p=new URL(c.url).pathname;p===t&&(p+="/");let h=new URL(`deployments/${o}${p}`,r);return await H.fetch(h.toString(),{headers:c.headers,method:c.method,body:c.body,redirect:"manual"})},"devPortalRoute"),a=new pe({processors:[he,mt],handler:s,gateway:e}),u=new ce({label:"SYSTEM_API_DOCS_ZUDOKU_ROUTE",methods:["GET","HEAD"],path:`${t}(.*)`,systemRouteName:"zudoku-portal"});n.addRoute(u,a.execute)},"registerZudokuRoute");var Fo=0,Ft=class{static{i(this,"CoreLogger")}constructor(e,t,o,r,s){this.#n=t,this.#o=o??"local",this.#r=r,this.#i=s,this.#e(e)}#e=i(e=>{let t=["error","warn","info","debug"],o=!1,r=i(()=>{},"emptyFunction"),s=i((a,u)=>{this.#i.forEach(c=>{c.log(a,u)})},"pushFunction");t.forEach(a=>{this.#t[a]=o?r:s,a==e&&(o=!0)})},"#setupMethods");#t={};#n;#o;#r;#i;log(e,t,o,r,s,a){Fo>=Number.MAX_SAFE_INTEGER&&(Fo=0);let u={logId:crypto.randomUUID(),requestId:o,rayId:r,level:e,logSource:t,messages:s,timestamp:new Date,logOwner:this.#n,loggingId:this.#o,buildId:this.#r,vectorClock:Fo++};this.#t[e](u,a)}};var fe=class extends je{static{i(this,"LogPlugin")}};var yn=class{static{i(this,"LoggingContext")}constructor(e,t,o,r){this.#e=e,this.custom=t,this.originalRequest=o,this.route=r}#e;custom;originalRequest;route;waitUntil=i(e=>{this.#e.waitUntil(e)},"waitUntil")};var jt=class{static{i(this,"RequestLogger")}constructor(e,t,o,r){this.#t=e,this.#n=t,this.#o=o,this.#r=r}#e="request";#t;#n;#o;#r;debug=i((...e)=>{this.#o.log("debug",this.#e,this.#t,this.#n,e,this.#r)},"debug");info=i((...e)=>{this.#o.log("info",this.#e,this.#t,this.#n,e,this.#r)},"info");log=i((...e)=>{this.#o.log("info",this.#e,this.#t,this.#n,e,this.#r)},"log");warn=i((...e)=>{this.#o.log("warn",this.#e,this.#t,this.#n,e,this.#r)},"warn");error=i((...e)=>{this.#o.log("error",this.#e,this.#t,this.#n,e,this.#r)},"error")};var ic=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError].filter(Boolean).map(n=>[n.name,n]),sc=new Map(ic);var ac=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],jo=Symbol(".toJSON was called"),uc=i(n=>{n[jo]=!0;let e=n.toJSON();return delete n[jo],e},"toJSON"),cc=i(n=>sc.get(n)??Error,"getErrorConstructor"),Us=i(({from:n,seen:e,to:t,forceEnumerable:o,maxDepth:r,depth:s,useToJSON:a,serialize:u})=>{if(!t)if(Array.isArray(n))t=[];else if(!u&&Zt(n)){let l=cc(n.name);t=new l}else t={};if(e.push(n),s>=r)return t;if(a&&typeof n.toJSON=="function"&&n[jo]!==!0)return uc(n);let c=i(l=>Us({from:l,seen:[...e],forceEnumerable:o,maxDepth:r,depth:s,useToJSON:a,serialize:u}),"continueDestroyCircular");for(let[l,d]of Object.entries(n)){if(typeof Buffer=="function"&&Buffer.isBuffer(d)){t[l]="[object Buffer]";continue}if(d!==null&&typeof d=="object"&&typeof d.pipe=="function"){t[l]="[object Stream]";continue}if(typeof d!="function"){if(!d||typeof d!="object"){t[l]=d;continue}if(!e.includes(n[l])){s++,t[l]=c(n[l]);continue}t[l]="[Circular]"}}for(let{property:l,enumerable:d}of ac)typeof n[l]<"u"&&n[l]!==null&&Object.defineProperty(t,l,{value:Zt(n[l])?c(n[l]):n[l],enumerable:o?!0:d,configurable:!0,writable:!0});return t},"destroyCircular");function rt(n,e){let t=e?.maxDepth??Number.POSITIVE_INFINITY,o=e?.useToJSON??!0;return typeof n=="object"&&n!==null?Us({from:n,seen:[],forceEnumerable:!0,maxDepth:t,depth:0,useToJSON:o,serialize:!0}):typeof n=="function"?`[Function: ${n.name??"anonymous"}]`:n}i(rt,"serializeError");var lc=/file:\/\/\/(.*?)\/dist\//g,dc="at async Event.respondWith";function zo(n){return typeof n!="string"?n:n.split(`
81
+ `},"notAvailablePage"),Ms=i((n,e)=>{let{sitePathname:t}=e.runtimeSettings.developerPortal,{deploymentName:o,zudokuHostUrl:r}=f.instance,s=i(async(c,l)=>{if(f.instance.isLocalDevelopment)return new Response(Ds("not-supported"),{headers:{"content-type":"text/html"}});if(!o)return E.internalServerError(c,l,{detail:"Unable to retrieve deployment name. Please contact support for assistance."});let d=new URL(c.url),p=d.pathname;p===t&&(p+="/");let h=new URL(`deployments/${o}${p}`,r),y=await H.fetch(h.toString(),{headers:c.headers,method:c.method,body:c.body,redirect:"manual"});return f.instance.isWorkingCopy&&y.status===404&&d.pathname===t?new Response(Ds("not-built"),{headers:{"content-type":"text/html"}}):y},"devPortalRoute"),a=new pe({processors:[he,mt],handler:s,gateway:e}),u=new ce({label:"SYSTEM_API_DOCS_ZUDOKU_ROUTE",methods:["GET","HEAD"],path:`${t}(.*)`,systemRouteName:"zudoku-portal"});n.addRoute(u,a.execute)},"registerZudokuRoute");var Fo=0,Ft=class{static{i(this,"CoreLogger")}constructor(e,t,o,r,s){this.#n=t,this.#o=o??"local",this.#r=r,this.#i=s,this.#e(e)}#e=i(e=>{let t=["error","warn","info","debug"],o=!1,r=i(()=>{},"emptyFunction"),s=i((a,u)=>{this.#i.forEach(c=>{c.log(a,u)})},"pushFunction");t.forEach(a=>{this.#t[a]=o?r:s,a==e&&(o=!0)})},"#setupMethods");#t={};#n;#o;#r;#i;log(e,t,o,r,s,a){Fo>=Number.MAX_SAFE_INTEGER&&(Fo=0);let u={logId:crypto.randomUUID(),requestId:o,rayId:r,level:e,logSource:t,messages:s,timestamp:new Date,logOwner:this.#n,loggingId:this.#o,buildId:this.#r,vectorClock:Fo++};this.#t[e](u,a)}};var fe=class extends je{static{i(this,"LogPlugin")}};var yn=class{static{i(this,"LoggingContext")}constructor(e,t,o,r){this.#e=e,this.custom=t,this.originalRequest=o,this.route=r}#e;custom;originalRequest;route;waitUntil=i(e=>{this.#e.waitUntil(e)},"waitUntil")};var jt=class{static{i(this,"RequestLogger")}constructor(e,t,o,r){this.#t=e,this.#n=t,this.#o=o,this.#r=r}#e="request";#t;#n;#o;#r;debug=i((...e)=>{this.#o.log("debug",this.#e,this.#t,this.#n,e,this.#r)},"debug");info=i((...e)=>{this.#o.log("info",this.#e,this.#t,this.#n,e,this.#r)},"info");log=i((...e)=>{this.#o.log("info",this.#e,this.#t,this.#n,e,this.#r)},"log");warn=i((...e)=>{this.#o.log("warn",this.#e,this.#t,this.#n,e,this.#r)},"warn");error=i((...e)=>{this.#o.log("error",this.#e,this.#t,this.#n,e,this.#r)},"error")};var ic=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError].filter(Boolean).map(n=>[n.name,n]),sc=new Map(ic);var ac=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],jo=Symbol(".toJSON was called"),uc=i(n=>{n[jo]=!0;let e=n.toJSON();return delete n[jo],e},"toJSON"),cc=i(n=>sc.get(n)??Error,"getErrorConstructor"),Us=i(({from:n,seen:e,to:t,forceEnumerable:o,maxDepth:r,depth:s,useToJSON:a,serialize:u})=>{if(!t)if(Array.isArray(n))t=[];else if(!u&&Zt(n)){let l=cc(n.name);t=new l}else t={};if(e.push(n),s>=r)return t;if(a&&typeof n.toJSON=="function"&&n[jo]!==!0)return uc(n);let c=i(l=>Us({from:l,seen:[...e],forceEnumerable:o,maxDepth:r,depth:s,useToJSON:a,serialize:u}),"continueDestroyCircular");for(let[l,d]of Object.entries(n)){if(typeof Buffer=="function"&&Buffer.isBuffer(d)){t[l]="[object Buffer]";continue}if(d!==null&&typeof d=="object"&&typeof d.pipe=="function"){t[l]="[object Stream]";continue}if(typeof d!="function"){if(!d||typeof d!="object"){t[l]=d;continue}if(!e.includes(n[l])){s++,t[l]=c(n[l]);continue}t[l]="[Circular]"}}for(let{property:l,enumerable:d}of ac)typeof n[l]<"u"&&n[l]!==null&&Object.defineProperty(t,l,{value:Zt(n[l])?c(n[l]):n[l],enumerable:o?!0:d,configurable:!0,writable:!0});return t},"destroyCircular");function rt(n,e){let t=e?.maxDepth??Number.POSITIVE_INFINITY,o=e?.useToJSON??!0;return typeof n=="object"&&n!==null?Us({from:n,seen:[],forceEnumerable:!0,maxDepth:t,depth:0,useToJSON:o,serialize:!0}):typeof n=="function"?`[Function: ${n.name??"anonymous"}]`:n}i(rt,"serializeError");var lc=/file:\/\/\/(.*?)\/dist\//g,dc="at async Event.respondWith";function zo(n){return typeof n!="string"?n:n.split(`
82
82
  `).filter(e=>!e.trim().startsWith("at async file")).map((e,t)=>{let o=e.replaceAll(lc,"").replaceAll(dc,"").trim();return t===0||o.length===0?o:` ${o}`}).filter(e=>e.length>0).join(`
83
83
  `)}i(zo,"cleanStack");function bn(n,e,t=""){let o=[],r=e?.maxDepth??3;return i(function s(a,u={},c,l){let d=u.indent||" ",p;u.inlineCharacterLimit===void 0?p={newline:`
84
84
  `,newlineOrSpace:`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.22.6",
4
+ "version": "6.22.7",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {