@kyro-cms/core 0.12.61 → 0.12.63
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.
- package/README.md +5 -4
- package/dist/{WebhookService-DgIx21X-.d.cts → WebhookService-B-jb55_P.d.cts} +1 -1
- package/dist/{WebhookService-CZf_na-J.d.ts → WebhookService-Bue85CZq.d.ts} +1 -1
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-7vJMzr4V.d.ts → base-CTeNj4rw.d.ts} +1 -1
- package/dist/{base-DDEmdRqV.d.cts → base-CU2tjpsX.d.cts} +1 -1
- package/dist/chunk-3WSFG6DS.js +2 -0
- package/dist/chunk-4OMQURN7.js +3 -0
- package/dist/chunk-6424BWOB.cjs +120 -0
- package/dist/{chunk-JU3UAZRY.cjs → chunk-DFDL5JIO.cjs} +13 -13
- package/dist/{chunk-4FHWIGHO.cjs → chunk-ILSBJI77.cjs} +3 -3
- package/dist/chunk-QE7LORN4.js +121 -0
- package/dist/{chunk-26MOA3HJ.js → chunk-VZQWWZLY.js} +3 -3
- package/dist/chunk-W2XYBPEJ.js +133 -0
- package/dist/{chunk-LOP464VR.cjs → chunk-YJZTUT7I.cjs} +1 -1
- package/dist/chunk-ZQETJ4T4.cjs +2 -0
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +2 -2
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +1 -1
- package/dist/graphql/index.d.cts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/index-DowyndWK.d.ts +105 -0
- package/dist/index-HNBjfQpn.d.cts +105 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +2 -2
- package/dist/mongodb/index.d.cts +2 -2
- package/dist/mongodb/index.d.ts +2 -2
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +3 -3
- package/dist/rest/index.d.ts +3 -3
- package/dist/rest/index.js +1 -1
- package/dist/templates/index.d.cts +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/trpc/index.d.cts +2 -2
- package/dist/trpc/index.d.ts +2 -2
- package/dist/{types-CYGXsNcJ.d.ts → types-COokblgr.d.ts} +181 -1
- package/dist/{types-DOKMyC3y.d.cts → types-ComJeXGL.d.cts} +181 -1
- package/package.json +2 -2
- package/dist/chunk-6QWX3DEB.cjs +0 -120
- package/dist/chunk-AMGJ5AFH.cjs +0 -1
- package/dist/chunk-QDBGBDCT.js +0 -2
- package/dist/chunk-RDFGJHEG.js +0 -2
- package/dist/chunk-RILJCH6H.js +0 -121
- package/dist/chunk-VJODUKKM.js +0 -133
- package/dist/index-BJ1rwHxk.d.cts +0 -284
- package/dist/index-BTjlptCL.d.ts +0 -284
package/dist/chunk-AMGJ5AFH.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();
|
package/dist/chunk-QDBGBDCT.js
DELETED
package/dist/chunk-RDFGJHEG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {D,A}from'./chunk-26MOA3HJ.js';import {e}from'./chunk-TBTQXIHP.js';import {hb}from'./chunk-RILJCH6H.js';import {a as a$1}from'./chunk-N6MNQIQU.js';import {g as g$1}from'./chunk-VJODUKKM.js';import {a}from'./chunk-ZWDBPEXL.js';import {a as a$2}from'./chunk-5ZEYOFAK.js';import {g}from'./chunk-Y2YAKDEQ.js';import w from'kyro:config';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
g();var r=null,l=null;async function b(){if(!r){if(globalThis.__KYRO_INSTANCE__)try{await globalThis.__KYRO_INSTANCE__.shutdown();}catch{}try{let e$1=w.default||w,t=e$1.adapter,o=t&&!t.dialect&&typeof t.connect=="function";if(globalThis.DB&&(!t||o)){let s=globalThis.DB;e$1.adapter=new g$1({type:"sqlite",client:s}),D.info("Hot-swapped to D1 DrizzleAdapter");}r=A(e$1),await r.init();let a$3=e$1.adapter,p=a$3&&a$3.dialect&&(a$3.dialect==="postgres"||a$3.dialect==="sqlite"),c=a$3&&a$3.dialect==="mongodb",n;if(p)a$3.dialect==="postgres"?n=new a({db:a$3.client}):a$3.dialect==="sqlite"&&(n=new hb({db:a$3.rawClient||a$3.client}));else if(o&&!globalThis.DB){let s=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";n=new a$1({path:s});}else c&&(n=new a$2({adapter:a$3}));if(n?.connect)try{await n.connect();}catch(s){D.warn("Auth connect warning:",s);}try{await r.loadSettings();}catch(s){D.warn("loadSettings warning:",s);}try{await e(n);}catch(s){D.warn("autoBootstrap warning:",s);}globalThis.__KYRO_INSTANCE__=r;}catch(e){throw r=null,l=null,D.error("Init failed, will retry:",e),e}}}async function E(e){let t=globalThis.DB?globalThis:null;try{let{env:o}=await import('cloudflare:workers');o&&(t=o);}catch{}if(e)try{t=e.locals?.cfContext?.env||e?.env||t;}catch{}if(!t)try{t=process.env;}catch{}t?.DB&&(globalThis.DB=t.DB),t?.STORAGE_BUCKET&&(globalThis.STORAGE_BUCKET=t.STORAGE_BUCKET),l||(l=b()),await l;}var _={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function T(e){return r?r.settings?.access?.apiAccess?.[e]??_[e]??true:_[e]??true}var R=async e=>{if(!r)try{await Promise.race([E(e),new Promise((t,o)=>setTimeout(()=>o(new Error("Initialization timeout")),3e4))]);}catch(t){return console.error("[Kyro API] Warm error:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Service Unavailable",message:"Kyro CMS is still starting up. Please try again in a moment."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":"5"}})}try{let o=new URL(e.request.url).pathname,a=__KYRO_API_PATH__;if(o===`${a}/graphql`&&typeof r.getGraphQL=="function"){if(!T("graphqlEnabled"))return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await r.getGraphQL().fetch(e.request,e.locals);return new Response(n.body,n)}if(o.startsWith(`${a}/trpc/`)&&typeof r.getTRPC=="function"){if(!T("trpcEnabled"))return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await r.getTRPC().fetch(e.request,e.locals);return new Response(n.body,n)}return await(await r.getREST()).fetch(e.request,e.locals)}catch(t){return console.error("[Kyro API Execution Error]:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Internal Server Error",message:t?.message||String(t),stack:t?.stack}),{status:500,headers:{"Content-Type":"application/json"}})}},N=R;export{r as a,E as b,R as c,N as d};
|