@kyro-cms/core 0.12.22 → 0.12.24

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 (51) hide show
  1. package/README.md +0 -5
  2. package/dist/api-handler-graphql.cjs +1 -1
  3. package/dist/api-handler-graphql.js +1 -1
  4. package/dist/api-handler-trpc.cjs +1 -1
  5. package/dist/api-handler-trpc.js +1 -1
  6. package/dist/api-handler.cjs +1 -1
  7. package/dist/api-handler.js +1 -1
  8. package/dist/chunk-232V7JSV.cjs +3 -0
  9. package/dist/chunk-2XTLTOS4.js +1 -0
  10. package/dist/chunk-4CJ5RLWO.js +251 -0
  11. package/dist/{chunk-DKESD4HI.js → chunk-5KSRMBEO.js} +5 -5
  12. package/dist/{chunk-GXVCCKOL.js → chunk-6ROHVUXF.js} +1 -1
  13. package/dist/{chunk-WG3UQEV7.cjs → chunk-FUWPXR6W.cjs} +5 -5
  14. package/dist/{chunk-O3OYZQN7.cjs → chunk-GZWRTHHL.cjs} +2 -2
  15. package/dist/chunk-H2QK3JIL.js +20 -0
  16. package/dist/{chunk-QJZQOLRN.js → chunk-LZI5BSC3.js} +2 -2
  17. package/dist/{chunk-BVG6VSAJ.cjs → chunk-QCA3AP3M.cjs} +1 -1
  18. package/dist/chunk-REWSTN3A.js +3 -0
  19. package/dist/chunk-RHAP6SPA.cjs +1 -0
  20. package/dist/chunk-RWYVZJ6R.cjs +20 -0
  21. package/dist/chunk-UVM7P4SE.cjs +251 -0
  22. package/dist/cli/index.cjs +1 -1
  23. package/dist/cli/index.js +1 -1
  24. package/dist/drizzle/index.cjs +1 -1
  25. package/dist/drizzle/index.js +1 -1
  26. package/dist/index.cjs +5 -5
  27. package/dist/index.d.cts +7 -4
  28. package/dist/index.d.ts +7 -4
  29. package/dist/index.js +5 -5
  30. package/dist/integration.cjs +1 -1
  31. package/dist/integration.js +1 -1
  32. package/dist/mongo-auth-adapter-5TJO5J5U.js +1 -0
  33. package/dist/{mongo-auth-adapter-C62QYCYV.cjs → mongo-auth-adapter-JVE5M3S4.cjs} +1 -1
  34. package/dist/mongodb/index.cjs +1 -1
  35. package/dist/mongodb/index.js +1 -1
  36. package/dist/rest/index.cjs +1 -1
  37. package/dist/rest/index.js +1 -1
  38. package/dist/templates/index.cjs +1 -1
  39. package/dist/templates/index.d.cts +24 -25
  40. package/dist/templates/index.d.ts +24 -25
  41. package/dist/templates/index.js +1 -1
  42. package/package.json +5 -2
  43. package/dist/chunk-3NC7GXD5.js +0 -3
  44. package/dist/chunk-7GQIEHLN.js +0 -1
  45. package/dist/chunk-G6UTHUHL.cjs +0 -1
  46. package/dist/chunk-P5GIDGMG.cjs +0 -20
  47. package/dist/chunk-PTS33SK5.js +0 -20
  48. package/dist/chunk-SFAD6WPC.cjs +0 -3
  49. package/dist/chunk-XTRY75KC.cjs +0 -210
  50. package/dist/chunk-YVM5BDRD.js +0 -210
  51. package/dist/mongo-auth-adapter-AIMZTNG6.js +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export{a as RedisAuthAdapter}from'./chunk-QOCHBPMK.js';export{R as allSettingsGlobals,c as blogCollections,d as blogGlobals,S as coreSettingsGlobals,W as createTemplateConfig,e as ecommerceCollections,f as ecommerceGlobals,g as kitchenSinkCollections,i as mediaCollections,a as minimalCollections,V as templateCollections}from'./chunk-3NC7GXD5.js';export{a as kyro}from'./chunk-PTS33SK5.js';export{s as AnalyticsPlugin,t as CommentsPlugin,a as ConfigValidationError,y as Kyro,p as KyroPlugin,A as LocalAdapter,q as PluginManager,l as Registry,u as ReviewsPlugin,r as SEOPlugin,v as WishlistPlugin,x as applyCollectionOverrides,h as collectionToCreateZod,i as collectionToUpdateZod,j as collectionToWhereZod,g as collectionToZod,z as createKyro,B as createLocalAdapter,o as createRegistry,f as fieldToZod,m as getRegistry,k as globalToZod,w as presetPlugins,n as resetRegistry,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal}from'./chunk-QJZQOLRN.js';export{d as autoBootstrap,a as bootstrapAdmin,e as bootstrapWithRetry,c as getBootstrapFromEnv}from'./chunk-6MSPBK3W.js';import'./chunk-NZ35PV5R.js';export{a as CSSGenerator,g as createAdminStyling,d as defaultDarkTheme,h as defaultFieldStyling,c as defaultLightTheme,e as ecommerce2026Theme,f as generateCSSVariables,b as generateTailwindConfig}from'./chunk-UHFDH3PG.js';export{q as ALL_FIELD_TYPES,n as COMPLEX_FIELD_TYPES,p as LAYOUT_FIELD_TYPES,m as PRIMITIVE_FIELD_TYPES,o as RELATIONAL_FIELD_TYPES,d as isArrayField,f as isBlocksField,e as isGroupField,h as isImageField,k as isLayoutField,b as isNumberField,c as isRelationshipField,i as isRichTextField,j as isSelectField,a as isTextField,g as isUploadField,t as normalizeRichTextValue,u as renderRichText,s as richTextStyles}from'./chunk-INB4LNA6.js';import'./chunk-5SEHX7ON.js';export{a as createContext,g as createCountProcedure,d as createCreateProcedure,f as createDeleteProcedure,h as createDynamicRouter,c as createFindByIDProcedure,b as createFindProcedure,i as createKyroServer,e as createUpdateProcedure}from'./chunk-LHW4R367.js';export{c as buildGraphQLSchema,d as createGraphQLSchema}from'./chunk-PP7W5UKL.js';import {l,n,m,p,q as q$1}from'./chunk-YVM5BDRD.js';export{n as AuditLogger,p as InMemoryAuditLogger,m as InMemoryRateLimiter,s as MediaService,o as createAuditContext,t as createHonoApp,e as createLocalStorage,u as createRESTAPI,i as getAppSecret,j as getEncryptionKey,k as getSessionConfig,r as isEdgeRuntime,h as loadSecrets,d as resolveProvider,g as setDbAdapter}from'./chunk-YVM5BDRD.js';import {k as k$1,l as l$1}from'./chunk-6J27P5D6.js';export{j as ConfigService,k as EmailTransport,l as PasswordPolicy,i as getEmailTemplates,g as renderAccountLocked,a as renderBaseLayout,f as renderMagicLink,e as renderPasswordChanged,c as renderResetPassword,h as renderUserInvite,b as renderVerifyEmail,d as renderWelcome}from'./chunk-6J27P5D6.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import {a as a$2}from'./chunk-IKOXCJYO.js';export{a as SQLiteAuthAdapter}from'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';export{e as ALL_WEBHOOK_EVENTS,f as WEBHOOK_COLLECTION,g as WEBHOOK_DELIVERY_COLLECTION,d as WEBHOOK_EVENTS,n as WebhookService,l as buildDeliveryRecord,m as createTestPayload,o as createWebhookService,j as deliverWebhook,k as deliverWithRetry,i as generateWebhookSecret,h as signPayload}from'./chunk-FVZ5RFLO.js';export{a as evaluateAccess,c as getWhereClause,b as mergeWhereClauses}from'./chunk-HLSB2MCK.js';export{b as KyroPubSub,c as KyroWSServer,a as PubSub,d as createWSServer}from'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';export{c as DrizzleAdapter,b as collectionToDrizzleSchema,f as createDatabase,d as createDrizzleAdapter,a as fieldToDrizzleType,g as runMigrations,h as seedDefaultRoles}from'./chunk-DKESD4HI.js';import {a as a$3}from'./chunk-RHCWCG3O.js';export{a as PostgresAuthAdapter}from'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';export{a as MongoDBAdapter,b as createMongoDBAdapter}from'./chunk-VGQ4VUG6.js';import {a as a$1}from'./chunk-GXVCCKOL.js';export{a as MongoDBAuthAdapter}from'./chunk-GXVCCKOL.js';import {a as a$4}from'./chunk-5KOQYQEE.js';export{a as AbstractBaseAdapter}from'./chunk-5KOQYQEE.js';import {a}from'./chunk-6SPPR5JZ.js';import'./chunk-4RMFCTWH.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';import W,{randomBytes}from'crypto';import {readFileSync}from'fs';import Me,{join,resolve}from'path';import {z as z$1}from'zod';export{z}from'zod';import {createStorage}from'unstorage';import Xr from'unstorage/drivers/indexedb';import to from'unstorage/drivers/fs';async function Re(s,e){let t=e.data;for(let r of s){let o=await r({...e,data:t});o!==void 0&&(t=o);}return t}async function Rr(s,e){return Re(s,e)}var R=class extends a$4{connectionString;constructor(e){super(),this.connectionString=e.connectionString;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.connectionString)throw new Error("NeonAdapter: Connection string is required.");try{let r=await fetch(`${this.connectionString}/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,params:t})});return r.ok?(await r.json()).rows||[]:[]}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function ve(s){return new R(s)}var v=class extends a$4{url;authToken;constructor(e){super(),this.url=e.url.replace(/^libsql:\/\//,"https://"),this.authToken=e.authToken;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.url)throw new Error("TursoAdapter: Database URL is required.");try{let r={"Content-Type":"application/json"};this.authToken&&(r.Authorization=`Bearer ${this.authToken}`);let o=await fetch(`${this.url}/v2/pipeline`,{method:"POST",headers:r,body:JSON.stringify({requests:[{type:"execute",stmt:{sql:e,args:t.map(c=>({type:"text",value:String(c)}))}},{type:"close"}]})});if(!o.ok)return [];let i=(await o.json())?.results?.[0]?.response?.result;if(!i||!i.rows)return [];let a=i.cols.map(c=>c.name);return i.rows.map(c=>{let l={};return a.forEach((d,u)=>{l[d]=c[u]?.value??null;}),l})}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function De(s){return new v(s)}var vr={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3},x=class{redis;prefix;config;constructor(e,t={},r="kyro:lockout:"){this.redis=e,this.prefix=r,this.config={...vr,...t};}lockKey(e){return `${this.prefix}${e}`}historyKey(e){return `${this.prefix}${e}:history`}async checkLockout(e){let t=this.lockKey(e),r=await this.redis.hgetall(t);if(!r||Object.keys(r).length===0)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let o=parseInt(r.attempts,10),n=r.lockedUntil?new Date(parseInt(r.lockedUntil,10)):void 0;return n&&n>new Date?{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:o}:n&&n<=new Date?(await this.unlockAccount(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0}):{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-o),totalAttempts:o}}async recordFailedAttempt(e){let t=this.lockKey(e),r=this.historyKey(e),o=Date.now(),n=await this.redis.hincrby(t,"attempts",1);if(await this.redis.hset(t,"lastAttempt",o.toString()),await this.redis.lpush(r,o.toString()),await this.redis.ltrim(r,0,99),n>=this.config.maxAttempts){let i=new Date(o+this.config.lockDuration);return await this.redis.hset(t,{lockedAt:o.toString(),lockedUntil:i.getTime().toString()}),await this.redis.expire(t,Math.ceil(this.config.lockDuration/1e3)+3600),{locked:true,attemptsRemaining:0,lockedUntil:i,totalAttempts:n}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-n),totalAttempts:n}}async lockAccount(e,t){let r=this.lockKey(e),o=Date.now(),n=t||this.config.lockDuration,i=new Date(o+n),a=this.redis.pipeline();a.hset(r,{attempts:this.config.maxAttempts.toString(),lockedAt:o.toString(),lockedUntil:i.getTime().toString()}),a.expire(r,Math.ceil(n/1e3)+3600),await a.exec();}async unlockAccount(e){let t=this.lockKey(e);await this.redis.del(t);}async resetAttempts(e){let t=this.lockKey(e);(await this.redis.hgetall(t)).lockedAt?await this.redis.hset(t,{attempts:"0",lockedAt:"",lockedUntil:""}):await this.redis.del(t);}async getLockoutHistory(e,t=10){let r=this.historyKey(e);return (await this.redis.lrange(r,0,t-1)).map(n=>new Date(parseInt(n,10)))}async getLockoutStats(e){let t=this.historyKey(e),r=await this.redis.lrange(t,0,-1),o=r.filter((i,a)=>(a+1)%this.config.maxAttempts===0).length,n=await this.redis.hget(this.lockKey(e),"lockedAt");return {totalFailedAttempts:r.length,lockoutCount:o,lastLockout:n?new Date(parseInt(n,10)):null,averageAttemptsBeforeLockout:o>0?this.config.maxAttempts:0}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};var Dr={"auth:login":{window:9e5,max:5},"auth:register":{window:36e5,max:3},"auth:forgot":{window:36e5,max:3},"auth:reset":{window:36e5,max:5},"auth:verify":{window:36e5,max:5},"api:general":{window:6e4,max:100},"api:authenticated":{window:6e4,max:200}},P=class{redis;prefix;limits;userLimits;constructor(e,t,r,o="kyro:ratelimit:"){this.redis=e,this.prefix=o,this.limits={...Dr,...t},this.userLimits=r||{"user:api":{window:6e4,max:500},"user:write":{window:36e5,max:100}};}getKey(e,t){return `${this.prefix}${e}:${t}`}async check(e,t){let r=this.limits[e]||this.limits["api:general"],o=this.getKey(e,t),n=Date.now(),i=n-r.window,a=this.redis.pipeline();a.zremrangebyscore(o,0,i),a.zcard(o),a.zadd(o,n,`${n}:${Math.random()}`),a.expire(o,Math.ceil(r.window/1e3)+1);let l=(await a.exec())?.[1]?.[1]||0;if(l>=r.max){let d=await this.redis.zrange(o,0,0,"WITHSCORES"),u=d.length>1?parseInt(d[1],10)+r.window:n+r.window;return {allowed:false,remaining:0,resetAt:u,retryAfter:Math.ceil((u-n)/1e3)}}return {allowed:true,remaining:r.max-l-1,resetAt:n+r.window}}async checkUser(e,t,r){let o=this.userLimits[e]||this.userLimits["user:api"],n=this.getKey(`user:${e}:${t}`,r),i=Date.now(),a=i-o.window,c=this.redis.pipeline();c.zremrangebyscore(n,0,a),c.zcard(n),c.zadd(n,i,`${i}:${Math.random()}`),c.expire(n,Math.ceil(o.window/1e3)+1);let d=(await c.exec())?.[1]?.[1]||0;if(d>=o.max){let u=await this.redis.zrange(n,0,0,"WITHSCORES"),p=u.length>1?parseInt(u[1],10)+o.window:i+o.window;return {allowed:false,remaining:0,resetAt:p,retryAfter:Math.ceil((p-i)/1e3)}}return {allowed:true,remaining:o.max-d-1,resetAt:i+o.window}}async reset(e,t){let r=this.getKey(e,t);await this.redis.del(r);}async resetUser(e,t,r){let o=this.getKey(`user:${e}:${t}`,r);await this.redis.del(o);}async getStatus(e,t){let r=this.limits[e]||this.limits["api:general"],o=this.getKey(e,t),n=Date.now(),i=n-r.window;await this.redis.zremrangebyscore(o,0,i);let a=await this.redis.zcard(o);return {count:a,limit:r.max,remaining:Math.max(0,r.max-a),resetAt:n+r.window}}setLimit(e,t){this.limits[e]=t;}setUserLimit(e,t){this.userLimits[e]=t;}};var T=class{users=new Map;sessions=new Map;refreshTokens=new Map;emailToUserId=new Map;passwordHistory=new Map;emailVerificationTokens=new Map;passwordResetTokens=new Map;auditLogs=[];externalDb=false;constructor(){}async connect(){}async disconnect(){this.users.clear(),this.sessions.clear(),this.refreshTokens.clear(),this.emailToUserId.clear(),this.passwordHistory.clear();}async createUser(e){let t=randomBytes(16).toString("hex"),r=new Date().toISOString(),o=await this.hashPassword(e.password),n={id:t,email:e.email.toLowerCase(),passwordHash:o,role:e.role||"customer",tenantId:e.tenantId,createdAt:r,updatedAt:r};return this.users.set(t,n),this.emailToUserId.set(e.email.toLowerCase(),t),this.passwordHistory.set(t,[]),n}async findUserByEmail(e){let t=this.emailToUserId.get(e.toLowerCase());return t?this.findUserById(t):null}async findUserById(e){return this.users.get(e)||null}async updateUser(e,t){let r=await this.findUserById(e);if(!r)return null;let o={...r,...t,id:e,updatedAt:new Date().toISOString()};return t.email&&t.email!==r.email&&(this.emailToUserId.delete(r.email.toLowerCase()),this.emailToUserId.set(t.email.toLowerCase(),e)),this.users.set(e,o),o}async deleteUser(e){let t=await this.findUserById(e);return t?(this.users.delete(e),this.emailToUserId.delete(t.email.toLowerCase()),this.refreshTokens.forEach((r,o)=>{this.sessions.get(r)?.userId===e&&(this.refreshTokens.delete(o),this.sessions.delete(r));}),this.passwordHistory.delete(e),this.sessions.forEach((r,o)=>{r.userId===e&&this.sessions.delete(o);}),true):false}async hashPassword(e){return (await import('bcryptjs')).default.hash(e,12)}async verifyPassword(e,t){let r=await this.findUserByEmail(e);return !r||!r.passwordHash?null:await(await import('bcryptjs')).default.compare(t,r.passwordHash)?r:null}async createSession(e,t={}){let r=randomBytes(32).toString("hex"),o=randomBytes(32).toString("base64url"),n=randomBytes(32).toString("base64url"),i=new Date,a={id:r,userId:e,token:o,refreshToken:n,expiresAt:new Date(i.getTime()+86400*1e3).toISOString(),createdAt:i.toISOString(),ipAddress:t.ipAddress,userAgent:t.userAgent};return this.sessions.set(r,a),this.refreshTokens.set(n,r),a}async findSessionByToken(e){return this.sessions.get(e)||null}async findSessionByRefreshToken(e){let t=this.refreshTokens.get(e);return t&&this.sessions.get(t)||null}async deleteSession(e){let t=this.sessions.get(e);return t?(t.refreshToken&&this.refreshTokens.delete(t.refreshToken),this.sessions.delete(e),true):false}async deleteUserSessions(e){let t=0;return this.sessions.forEach((r,o)=>{r.userId===e&&(r.refreshToken&&this.refreshTokens.delete(r.refreshToken),this.sessions.delete(o),t++);}),t}async addPasswordToHistory(e,t){let r=this.passwordHistory.get(e)||[];r.push(t),r.length>5&&r.splice(0,r.length-5),this.passwordHistory.set(e,r);}async getPasswordHistory(e,t=5){return this.passwordHistory.get(e)||[]}async isPasswordInHistory(e,t,r=5){let o=await this.getPasswordHistory(t,r),n=(await import('bcryptjs')).default;for(let i of o)if(await n.compare(e,i))return true;return false}async createEmailVerificationToken(e){let t=randomBytes(32).toString("hex"),r=new Date(Date.now()+1440*60*1e3);return this.emailVerificationTokens.set(t,{userId:e,expiresAt:r}),{token:t,expiresAt:r}}async verifyEmailToken(e){let t=this.emailVerificationTokens.get(e);return !t||t.expiresAt<new Date?(this.emailVerificationTokens.delete(e),{success:false,error:"Invalid or expired token"}):(this.emailVerificationTokens.delete(e),{success:true,userId:t.userId})}async createPasswordResetToken(e){let t=await this.findUserByEmail(e);if(!t)return {token:"",expiresAt:new Date,error:"User not found"};let r=randomBytes(32).toString("hex"),o=new Date(Date.now()+3600*1e3);return this.passwordResetTokens.set(r,{userId:t.id,expiresAt:o}),{token:r,expiresAt:o}}async resetPasswordWithToken(e,t){let r=this.passwordResetTokens.get(e);if(!r||r.expiresAt<new Date)return this.passwordResetTokens.delete(e),{success:false,error:"Invalid or expired token"};let o=await this.hashPassword(t);return await this.updateUser(r.userId,{passwordHash:o}),this.passwordResetTokens.delete(e),{success:true}}async hasAnyUsers(){return this.users.size>0}async findAuditLogs(e){let{limit:t=50,offset:r=0}=e,o=this.auditLogs.slice().reverse();return e.userId&&(o=o.filter(n=>n.userId===e.userId)),e.action&&(Array.isArray(e.action)?o=o.filter(n=>e.action.includes(String(n.action))):o=o.filter(n=>n.action===e.action)),e.resource&&(o=o.filter(n=>n.resource===e.resource)),e.success!==void 0&&(o=o.filter(n=>n.success===e.success)),{logs:o.slice(r,r+t),total:o.length}}async createAuditLog(e){let t=randomBytes(16).toString("hex"),o={...e,id:t,timestamp:new Date};return this.auditLogs.push(o),o}};var k=class{storage=new Map;history=new Map;config;constructor(e={}){this.config={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3,...e};}async checkLockout(e){let t=Date.now(),r=this.storage.get(e);if(r&&r.lockedUntil!==null&&r.lockedUntil<=t)return await this.resetAttempts(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};if(!r)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let{attempts:o,lockedUntil:n}=r;return n!==null&&n>t?{locked:true,attemptsRemaining:0,lockedUntil:new Date(n),totalAttempts:o}:{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-o),totalAttempts:o}}async recordFailedAttempt(e){let t=Date.now(),r=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};r.attempts+=1,r.lastAttempt=t;let o=this.history.get(e)||[];if(o.push(t),o.length>100&&o.splice(0,o.length-100),this.history.set(e,o),this.storage.set(e,r),r.attempts>=this.config.maxAttempts){let n=new Date(t+this.config.lockDuration);return r.lockedAt=t,r.lockedUntil=n.getTime(),this.storage.set(e,r),{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:r.attempts}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-r.attempts),totalAttempts:r.attempts}}async lockAccount(e,t){let r=Date.now(),o=t||this.config.lockDuration,n=new Date(r+o),i=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};i.attempts=this.config.maxAttempts,i.lockedAt=r,i.lockedUntil=n.getTime(),this.storage.set(e,i);}async unlockAccount(e){await this.resetAttempts(e);}async resetAttempts(e){let t=this.storage.get(e);t&&(t.attempts=0,t.lockedAt=null,t.lockedUntil=null,this.storage.set(e,t)),this.history.delete(e);}async getLockoutHistory(e,t=10){return (this.history.get(e)||[]).slice(-t).reverse().map(o=>new Date(o))}async getLockoutStats(e){let r=(this.history.get(e)||[]).length,o=Math.floor(r/this.config.maxAttempts),n=null,i=this.storage.get(e);i&&i.lockedAt!==null&&(n=new Date(i.lockedAt));let a=o>0?this.config.maxAttempts:0;return {totalFailedAttempts:r,lockoutCount:o,lastLockout:n,averageAttemptsBeforeLockout:a}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};function h(s,e=""){return process.env[s]||e}function A(s,e=false){let t=process.env[s];return t?t.toLowerCase()==="true":e}function g(s,e=0){let t=process.env[s];return t?parseInt(t,10):e}function Ie(){let s=process.env.KYRO_AUTH_DATABASE?.toLowerCase();if(s&&["sqlite","postgres","mongodb","memory"].includes(s))return s;try{let e=join(process.cwd(),"kyro.config.ts"),t=readFileSync(e,"utf8");if(t.includes("createLocalAdapter"))return "sqlite";if(t.includes("createDrizzleAdapter"))return t.includes("postgres")||t.includes("postgresql"),"postgres";if(t.includes("createMongoDBAdapter"))return "mongodb"}catch{}return "memory"}async function Er(s){let e=process.cwd(),t=e.endsWith("admin")?join(e,".."):e,r=resolve(t,"data","auth.db");switch(s){case "sqlite":return new a$2({path:h("KYRO_AUTH_DB_PATH",r)});case "postgres":{let o=h("DATABASE_URL","");if(o){let n,i;try{n=(await import('drizzle-orm/postgres-js')).drizzle,i=await import('postgres');}catch{a(["postgres","drizzle-orm"]),n=(await import('drizzle-orm/postgres-js')).drizzle,i=await import('postgres');}let a$1=i.default(o,{onnotice:()=>{}}),c=n(a$1);return new a$3({db:c})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{let o=h("MONGODB_URI","");if(o){let n;try{n=(await import('mongodb')).MongoClient;}catch{a(["mongodb"]),n=(await import('mongodb')).MongoClient;}let i=new n(o);await i.connect();let c=new URL(o).pathname.replace(/^\//,"")||"kyro_cms",l=i.db(c);return new a$1({db:l})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}default:return new T}}async function $(s,e){let t=A("KYRO_DISTRIBUTED",false),r;if(t){let{RedisAuthAdapter:u}=await import('./redis-adapter-NN3H4GRX.js'),p=h("REDIS_URL","redis://localhost:6379"),y=A("REDIS_TLS",false),m=new u({url:p,tls:y});await m.connect?.(),r=m;}else {let u=s||Ie();r=await Er(u),r.connect&&await r.connect();}let o=e?await k$1.fromConfig(e).catch(()=>null)||k$1.fromEnv()||void 0:k$1.fromEnv()||void 0,n$1=new l$1({minLength:g("PASSWORD_MIN_LENGTH",12),requireUppercase:A("PASSWORD_REQUIRE_UPPERCASE",true),requireLowercase:A("PASSWORD_REQUIRE_LOWERCASE",true),requireNumbers:A("PASSWORD_REQUIRE_NUMBERS",true),requireSpecialChars:A("PASSWORD_REQUIRE_SPECIAL",true),preventReuse:g("PASSWORD_PREVENT_REUSE",5),maxLength:g("PASSWORD_MAX_LENGTH",128)}),i,a,c;if(t){let p=r.redis;i=new x(p,{maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new P(p,{"auth:login":{window:g("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:g("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:g("RATE_LIMIT_WINDOW_MS",6e4),max:g("RATE_LIMIT_MAX_REQUESTS",100)}}),c=new n(p,g("AUDIT_LOG_RETENTION_DAYS",30));}else i=new k({maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new m({"auth:login":{window:g("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:g("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:g("RATE_LIMIT_WINDOW_MS",6e4),max:g("RATE_LIMIT_MAX_REQUESTS",100)}}),c=A("AUDIT_LOG_ENABLED",true)?new p(g("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let l=new q$1({redis:r,email:o,jwtSecret:h("APP_SECRET","change-me"),jwtExpiresIn:h("JWT_EXPIRES_IN","24h"),jwtIssuer:h("JWT_ISSUER","kyro-cms"),jwtAudience:h("JWT_AUDIENCE","kyro-cms-client"),passwordPolicy:n$1,lockout:i,rateLimiter:a,auditLogger:c,baseUrl:h("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:A("EMAIL_VERIFICATION_REQUIRED",true)}),d=t?"distributed":s||Ie();return {authAdapter:r,databaseType:d,email:o,passwordPolicy:n$1,lockout:i,rateLimiter:a,auditLogger:c,routes:l}}var Ee=$().catch(s=>(console.warn("[AuthConfig] Failed to initialize auth config:",s.message),null));var Or=12,Ur="24h",Vr="7d",U=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??Ur,refreshExpiresIn:t.refreshExpiresIn??Vr,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??Or};}async register(e){try{if(await this.adapter.findUserByEmail(e.email))return {success:!1,error:"Email already registered"};let r=await this.adapter.createUser({email:e.email,password:e.password,role:e.role??"customer",tenantId:e.tenantId});return this.createSessionForUser(r)}catch(t){return {success:false,error:String(t)}}}async login(e){try{let t=await this.adapter.verifyPassword(e.email,e.password);return t?this.createSessionForUser(t):{success:!1,error:"Invalid credentials"}}catch(t){return {success:false,error:String(t)}}}async logout(e){await this.adapter.deleteSession(e);}async refreshToken(e){try{let t=await this.adapter.findSessionByToken(e);if(!t||new Date(t.expiresAt)<new Date)return {success:!1,error:"Invalid or expired refresh token"};let r=await this.adapter.findUserById(t.userId);return r?(await this.adapter.deleteSession(e),this.createSessionForUser(r)):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async verifyToken(e){try{let{default:t}=await import('jsonwebtoken');return t.verify(e,this.config.secret,{issuer:this.config.issuer,audience:this.config.audience.length>0?this.config.audience[0]:void 0})}catch{return null}}async getUserFromToken(e){let t=await this.verifyToken(e);return t?this.adapter.findUserById(t.sub):null}async changePassword(e,t,r){try{let o=await this.adapter.findUserById(e);return o?await this.adapter.verifyPassword(o.email,t)?(await this.adapter.updateUser(e,{password:r}),await this.adapter.deleteUserSessions(e),{success:!0,user:o}):{success:!1,error:"Current password is incorrect"}:{success:!1,error:"User not found"}}catch(o){return {success:false,error:String(o)}}}async resetPassword(e,t){try{let r=await this.adapter.findUserByEmail(e);return r?(await this.adapter.updateUser(r.id,{password:t}),await this.adapter.deleteUserSessions(r.id),{success:!0,user:r}):{success:!1,error:"User not found"}}catch(r){return {success:false,error:String(r)}}}async sendEmailVerification(e){try{let{token:t,expiresAt:r}=await this.adapter.createEmailVerificationToken(e);return {success:!0}}catch(t){return {success:false,error:String(t)}}}async verifyEmail(e){try{return await this.adapter.verifyEmailToken(e)}catch(t){return {success:false,error:String(t)}}}async requestPasswordReset(e){try{let t=await this.adapter.createPasswordResetToken(e);return t.error?{success:!1,error:t.error}:{success:!0}}catch(t){return {success:false,error:String(t)}}}async resetPasswordWithToken(e,t){try{return await this.adapter.resetPasswordWithToken(e,t)}catch(r){return {success:false,error:String(r)}}}async deleteAccount(e){try{return await this.adapter.findUserById(e)?(await this.adapter.deleteUserSessions(e),await this.adapter.deleteUser(e),{success:!0}):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async createSessionForUser(e){let t=await this.generateToken(e),r=await this.adapter.createSession(e.id);return {success:true,user:e,session:r,token:t}}async generateToken(e){let{default:t}=await import('jsonwebtoken'),r={sub:e.id,email:e.email,role:e.role,tenantId:e.tenantId},o={expiresIn:this.parseExpiresIn(this.config.expiresIn)/1e3,issuer:this.config.issuer};return this.config.audience.length>0&&(o.audience=this.config.audience[0]),t.sign(r,this.config.secret,o)}async hashPassword(e){let{default:t}=await import('bcryptjs');return t.hash(e,this.config.saltRounds)}parseExpiresIn(e){if(typeof e=="number")return e;let t=e.match(/^(\d+)([smhd])$/);if(!t)return 864e5;let r=parseInt(t[1],10);switch(t[2]){case "s":return r*1e3;case "m":return r*6e4;case "h":return r*36e5;case "d":return r*864e5;default:return 864e5}}};function _r(s,e){return new U(s,e)}function V(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var _=class{adapter;config;constructor(e,t){this.adapter=e,this.config={...V(),...t};}async createVersion(e){let r=((await this.adapter.getLatestVersion(e.collection,e.documentId))?.version??0)+1,o={...e,version:r},n=await this.adapter.createVersion(o);return this.config.maxVersionsPerDocument>0&&await this.pruneOldVersions(e.collection,e.documentId),n}async publishVersion(e){let t=await this.adapter.getVersion(e.collection,e.versionId);if(!t)throw new Error("Version not found");if(t.status==="published")throw new Error("Version is already published");await this.adapter.publishVersion(e);}async unpublishDocument(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:1e3});for(let o of r)if(o.status==="published"){await this.createVersion({collection:e,documentId:t,data:o.data,status:"draft",createdBy:"system",changeDescription:"Unpublished document"});break}}async revertToVersion(e,t,r,o){if(!await this.adapter.getVersion(e,r))throw new Error("Version not found");return await this.adapter.revertToVersion({collection:e,documentId:t,versionId:r,userId:o})}async getVersionHistory(e,t,r=20,o=0){return this.adapter.getVersions({collection:e,documentId:t,limit:r,offset:o})}async compareTwoVersions(e,t,r,o){return this.adapter.compareVersions({collection:e,documentId:t,versionA:r,versionB:o})}async getLatestDraft(e,t){return this.adapter.getLatestVersion(e,t)}async getPublishedVersion(e,t){return this.adapter.getPublishedVersion(e,t)}async getVersion(e,t){return this.adapter.getVersion(e,t)}async schedulePublish(e,t,r,o){if(!this.config.scheduleEnabled)throw new Error("Scheduled publishing is not enabled");if(!await this.adapter.getVersion(e,r))throw new Error("Version not found")}async deleteVersionHistory(e,t){await this.adapter.deleteVersions(e,t);}async pruneOldVersions(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:this.config.maxVersionsPerDocument+100});if(r.length<=this.config.maxVersionsPerDocument)return;r.slice(0,this.config.maxVersionsPerDocument);let n=r.slice(this.config.maxVersionsPerDocument);for(let i of n)if(i.status!=="published"){await this.adapter.deleteVersions(e,t);break}}};function Mr(s,e){return new _(s,e)}function Hr(s){return s==="published"}function Fr(s){return s==="draft"}function Nr(s){return s==="archived"}function Br(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Kr(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Oe(s){return {collections:Br(s.collections),globals:Kr(s.globals),adapter:s.adapter,plugins:s.plugins,auth:s.auth,cors:s.cors,admin:s.admin,upload:s.upload,graphQL:s.graphQL,typescript:s.typescript,localization:s.localization,rateLimit:s.rateLimit,debug:s.debug}}var $r=Oe;function zr(s){let{siteSettings:e,seoSettings:t,title:r,description:o,image:n,url:i}=s;if(!e)return "";let a=e.siteName||"",c=r||t?.defaultTitle||a,l=t?.titleTemplate,d=t?.separator||" | ",u=t?.siteNameInTitle!==false,p=l?l.replace(/\{\{title\}\}/g,c).replace(/\{\{siteName\}\}/g,u?a:"").replace(/\{\{separator\}\}/g,d).replace(/\s+/g," ").trim():c,y=o||t?.defaultDescription||e.siteDescription||"",m=n||e.siteOgImage?.url||"",D=i||e.siteUrl||"",f=`
1
+ export{a as RedisAuthAdapter}from'./chunk-QOCHBPMK.js';export{k as allSettingsGlobals,o as blogCollections,l as coreSettingsGlobals,V as createTemplateConfig,p as ecommerceCollections,q as ecommerceGlobals,r as kitchenSinkCollections,t as mediaCollections,a as minimalCollections,U as templateCollections}from'./chunk-REWSTN3A.js';export{a as kyro}from'./chunk-H2QK3JIL.js';export{s as AnalyticsPlugin,t as CommentsPlugin,a as ConfigValidationError,y as Kyro,p as KyroPlugin,A as LocalAdapter,q as PluginManager,l as Registry,u as ReviewsPlugin,r as SEOPlugin,v as WishlistPlugin,x as applyCollectionOverrides,h as collectionToCreateZod,i as collectionToUpdateZod,j as collectionToWhereZod,g as collectionToZod,z as createKyro,B as createLocalAdapter,o as createRegistry,f as fieldToZod,m as getRegistry,k as globalToZod,w as presetPlugins,n as resetRegistry,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal}from'./chunk-LZI5BSC3.js';export{d as autoBootstrap,a as bootstrapAdmin,e as bootstrapWithRetry,c as getBootstrapFromEnv}from'./chunk-6MSPBK3W.js';import'./chunk-NZ35PV5R.js';export{a as CSSGenerator,g as createAdminStyling,d as defaultDarkTheme,h as defaultFieldStyling,c as defaultLightTheme,e as ecommerce2026Theme,f as generateCSSVariables,b as generateTailwindConfig}from'./chunk-UHFDH3PG.js';export{q as ALL_FIELD_TYPES,n as COMPLEX_FIELD_TYPES,p as LAYOUT_FIELD_TYPES,m as PRIMITIVE_FIELD_TYPES,o as RELATIONAL_FIELD_TYPES,d as isArrayField,f as isBlocksField,e as isGroupField,h as isImageField,k as isLayoutField,b as isNumberField,c as isRelationshipField,i as isRichTextField,j as isSelectField,a as isTextField,g as isUploadField,t as normalizeRichTextValue,u as renderRichText,s as richTextStyles}from'./chunk-INB4LNA6.js';import'./chunk-5SEHX7ON.js';export{a as createContext,g as createCountProcedure,d as createCreateProcedure,f as createDeleteProcedure,h as createDynamicRouter,c as createFindByIDProcedure,b as createFindProcedure,i as createKyroServer,e as createUpdateProcedure}from'./chunk-LHW4R367.js';export{c as buildGraphQLSchema,d as createGraphQLSchema}from'./chunk-PP7W5UKL.js';import {l,n,m,p,q as q$1}from'./chunk-4CJ5RLWO.js';export{n as AuditLogger,p as InMemoryAuditLogger,m as InMemoryRateLimiter,t as MediaService,o as createAuditContext,u as createHonoApp,e as createLocalStorage,v as createRESTAPI,i as getAppSecret,j as getEncryptionKey,k as getSessionConfig,s as isEdgeRuntime,h as loadSecrets,d as resolveProvider,g as setDbAdapter}from'./chunk-4CJ5RLWO.js';import {k as k$1,l as l$1}from'./chunk-6J27P5D6.js';export{j as ConfigService,k as EmailTransport,l as PasswordPolicy,i as getEmailTemplates,g as renderAccountLocked,a as renderBaseLayout,f as renderMagicLink,e as renderPasswordChanged,c as renderResetPassword,h as renderUserInvite,b as renderVerifyEmail,d as renderWelcome}from'./chunk-6J27P5D6.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import {a as a$2}from'./chunk-IKOXCJYO.js';export{a as SQLiteAuthAdapter}from'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';export{e as ALL_WEBHOOK_EVENTS,f as WEBHOOK_COLLECTION,g as WEBHOOK_DELIVERY_COLLECTION,d as WEBHOOK_EVENTS,n as WebhookService,l as buildDeliveryRecord,m as createTestPayload,o as createWebhookService,j as deliverWebhook,k as deliverWithRetry,i as generateWebhookSecret,h as signPayload}from'./chunk-FVZ5RFLO.js';export{a as evaluateAccess,c as getWhereClause,b as mergeWhereClauses}from'./chunk-HLSB2MCK.js';export{b as KyroPubSub,c as KyroWSServer,a as PubSub,d as createWSServer}from'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';export{c as DrizzleAdapter,b as collectionToDrizzleSchema,f as createDatabase,d as createDrizzleAdapter,a as fieldToDrizzleType,g as runMigrations,h as seedDefaultRoles}from'./chunk-5KSRMBEO.js';import {a as a$3}from'./chunk-RHCWCG3O.js';export{a as PostgresAuthAdapter}from'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';export{a as MongoDBAdapter,b as createMongoDBAdapter}from'./chunk-VGQ4VUG6.js';import {a as a$1}from'./chunk-6ROHVUXF.js';export{a as MongoDBAuthAdapter}from'./chunk-6ROHVUXF.js';import {a as a$4}from'./chunk-5KOQYQEE.js';export{a as AbstractBaseAdapter}from'./chunk-5KOQYQEE.js';import {a}from'./chunk-6SPPR5JZ.js';import'./chunk-4RMFCTWH.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';import W,{randomBytes}from'crypto';import {readFileSync}from'fs';import Me,{join,resolve}from'path';import {z as z$1}from'zod';export{z}from'zod';import {createStorage}from'unstorage';import Jr from'unstorage/drivers/indexedb';import eo from'unstorage/drivers/fs';async function Re(s,e){let t=e.data;for(let r of s){let o=await r({...e,data:t});o!==void 0&&(t=o);}return t}async function Cr(s,e){return Re(s,e)}var R=class extends a$4{connectionString;constructor(e){super(),this.connectionString=e.connectionString;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.connectionString)throw new Error("NeonAdapter: Connection string is required.");try{let r=await fetch(`${this.connectionString}/sql`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,params:t})});return r.ok?(await r.json()).rows||[]:[]}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function ve(s){return new R(s)}var v=class extends a$4{url;authToken;constructor(e){super(),this.url=e.url.replace(/^libsql:\/\//,"https://"),this.authToken=e.authToken;}async connect(){this.connected=true;}async disconnect(){this.connected=false;}async query(e,t=[]){if(!this.url)throw new Error("TursoAdapter: Database URL is required.");try{let r={"Content-Type":"application/json"};this.authToken&&(r.Authorization=`Bearer ${this.authToken}`);let o=await fetch(`${this.url}/v2/pipeline`,{method:"POST",headers:r,body:JSON.stringify({requests:[{type:"execute",stmt:{sql:e,args:t.map(c=>({type:"text",value:String(c)}))}},{type:"close"}]})});if(!o.ok)return [];let i=(await o.json())?.results?.[0]?.response?.result;if(!i||!i.rows)return [];let a=i.cols.map(c=>c.name);return i.rows.map(c=>{let l={};return a.forEach((d,u)=>{l[d]=c[u]?.value??null;}),l})}catch{return []}}async find(e){return {docs:[],totalDocs:0,limit:e.limit||10,totalPages:1,page:e.page||1,hasNextPage:false,hasPrevPage:false}}async findByID(e){return null}async create(e){return e.data}async update(e){return e.data}async delete(e){return {success:true,id:e.id}}async count(e){return 0}async findOne(e){return null}async findVersions(e){return {docs:[],totalDocs:0,limit:10,totalPages:1,page:1,hasNextPage:false,hasPrevPage:false}}async findVersionByID(e){return null}async createVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async updateLatestVersion(e){return {id:"v1",parentId:e.documentId,version:e.version||1,snapshot:e.snapshot||{},createdAt:new Date().toISOString()}}async deleteVersions(e){}};function De(s){return new v(s)}var Rr={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3},x=class{redis;prefix;config;constructor(e,t={},r="kyro:lockout:"){this.redis=e,this.prefix=r,this.config={...Rr,...t};}lockKey(e){return `${this.prefix}${e}`}historyKey(e){return `${this.prefix}${e}:history`}async checkLockout(e){let t=this.lockKey(e),r=await this.redis.hgetall(t);if(!r||Object.keys(r).length===0)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let o=parseInt(r.attempts,10),n=r.lockedUntil?new Date(parseInt(r.lockedUntil,10)):void 0;return n&&n>new Date?{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:o}:n&&n<=new Date?(await this.unlockAccount(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0}):{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-o),totalAttempts:o}}async recordFailedAttempt(e){let t=this.lockKey(e),r=this.historyKey(e),o=Date.now(),n=await this.redis.hincrby(t,"attempts",1);if(await this.redis.hset(t,"lastAttempt",o.toString()),await this.redis.lpush(r,o.toString()),await this.redis.ltrim(r,0,99),n>=this.config.maxAttempts){let i=new Date(o+this.config.lockDuration);return await this.redis.hset(t,{lockedAt:o.toString(),lockedUntil:i.getTime().toString()}),await this.redis.expire(t,Math.ceil(this.config.lockDuration/1e3)+3600),{locked:true,attemptsRemaining:0,lockedUntil:i,totalAttempts:n}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-n),totalAttempts:n}}async lockAccount(e,t){let r=this.lockKey(e),o=Date.now(),n=t||this.config.lockDuration,i=new Date(o+n),a=this.redis.pipeline();a.hset(r,{attempts:this.config.maxAttempts.toString(),lockedAt:o.toString(),lockedUntil:i.getTime().toString()}),a.expire(r,Math.ceil(n/1e3)+3600),await a.exec();}async unlockAccount(e){let t=this.lockKey(e);await this.redis.del(t);}async resetAttempts(e){let t=this.lockKey(e);(await this.redis.hgetall(t)).lockedAt?await this.redis.hset(t,{attempts:"0",lockedAt:"",lockedUntil:""}):await this.redis.del(t);}async getLockoutHistory(e,t=10){let r=this.historyKey(e);return (await this.redis.lrange(r,0,t-1)).map(n=>new Date(parseInt(n,10)))}async getLockoutStats(e){let t=this.historyKey(e),r=await this.redis.lrange(t,0,-1),o=r.filter((i,a)=>(a+1)%this.config.maxAttempts===0).length,n=await this.redis.hget(this.lockKey(e),"lockedAt");return {totalFailedAttempts:r.length,lockoutCount:o,lastLockout:n?new Date(parseInt(n,10)):null,averageAttemptsBeforeLockout:o>0?this.config.maxAttempts:0}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};var vr={"auth:login":{window:9e5,max:5},"auth:register":{window:36e5,max:3},"auth:forgot":{window:36e5,max:3},"auth:reset":{window:36e5,max:5},"auth:verify":{window:36e5,max:5},"api:general":{window:6e4,max:100},"api:authenticated":{window:6e4,max:200}},P=class{redis;prefix;limits;userLimits;constructor(e,t,r,o="kyro:ratelimit:"){this.redis=e,this.prefix=o,this.limits={...vr,...t},this.userLimits=r||{"user:api":{window:6e4,max:500},"user:write":{window:36e5,max:100}};}getKey(e,t){return `${this.prefix}${e}:${t}`}async check(e,t){let r=this.limits[e]||this.limits["api:general"],o=this.getKey(e,t),n=Date.now(),i=n-r.window,a=this.redis.pipeline();a.zremrangebyscore(o,0,i),a.zcard(o),a.zadd(o,n,`${n}:${Math.random()}`),a.expire(o,Math.ceil(r.window/1e3)+1);let l=(await a.exec())?.[1]?.[1]||0;if(l>=r.max){let d=await this.redis.zrange(o,0,0,"WITHSCORES"),u=d.length>1?parseInt(d[1],10)+r.window:n+r.window;return {allowed:false,remaining:0,resetAt:u,retryAfter:Math.ceil((u-n)/1e3)}}return {allowed:true,remaining:r.max-l-1,resetAt:n+r.window}}async checkUser(e,t,r){let o=this.userLimits[e]||this.userLimits["user:api"],n=this.getKey(`user:${e}:${t}`,r),i=Date.now(),a=i-o.window,c=this.redis.pipeline();c.zremrangebyscore(n,0,a),c.zcard(n),c.zadd(n,i,`${i}:${Math.random()}`),c.expire(n,Math.ceil(o.window/1e3)+1);let d=(await c.exec())?.[1]?.[1]||0;if(d>=o.max){let u=await this.redis.zrange(n,0,0,"WITHSCORES"),p=u.length>1?parseInt(u[1],10)+o.window:i+o.window;return {allowed:false,remaining:0,resetAt:p,retryAfter:Math.ceil((p-i)/1e3)}}return {allowed:true,remaining:o.max-d-1,resetAt:i+o.window}}async reset(e,t){let r=this.getKey(e,t);await this.redis.del(r);}async resetUser(e,t,r){let o=this.getKey(`user:${e}:${t}`,r);await this.redis.del(o);}async getStatus(e,t){let r=this.limits[e]||this.limits["api:general"],o=this.getKey(e,t),n=Date.now(),i=n-r.window;await this.redis.zremrangebyscore(o,0,i);let a=await this.redis.zcard(o);return {count:a,limit:r.max,remaining:Math.max(0,r.max-a),resetAt:n+r.window}}setLimit(e,t){this.limits[e]=t;}setUserLimit(e,t){this.userLimits[e]=t;}};var T=class{users=new Map;sessions=new Map;refreshTokens=new Map;emailToUserId=new Map;passwordHistory=new Map;emailVerificationTokens=new Map;passwordResetTokens=new Map;auditLogs=[];externalDb=false;constructor(){}async connect(){}async disconnect(){this.users.clear(),this.sessions.clear(),this.refreshTokens.clear(),this.emailToUserId.clear(),this.passwordHistory.clear();}async createUser(e){let t=randomBytes(16).toString("hex"),r=new Date().toISOString(),o=await this.hashPassword(e.password),n={id:t,email:e.email.toLowerCase(),passwordHash:o,role:e.role||"customer",tenantId:e.tenantId,createdAt:r,updatedAt:r};return this.users.set(t,n),this.emailToUserId.set(e.email.toLowerCase(),t),this.passwordHistory.set(t,[]),n}async findUserByEmail(e){let t=this.emailToUserId.get(e.toLowerCase());return t?this.findUserById(t):null}async findUserById(e){return this.users.get(e)||null}async updateUser(e,t){let r=await this.findUserById(e);if(!r)return null;let o={...r,...t,id:e,updatedAt:new Date().toISOString()};return t.email&&t.email!==r.email&&(this.emailToUserId.delete(r.email.toLowerCase()),this.emailToUserId.set(t.email.toLowerCase(),e)),this.users.set(e,o),o}async deleteUser(e){let t=await this.findUserById(e);return t?(this.users.delete(e),this.emailToUserId.delete(t.email.toLowerCase()),this.refreshTokens.forEach((r,o)=>{this.sessions.get(r)?.userId===e&&(this.refreshTokens.delete(o),this.sessions.delete(r));}),this.passwordHistory.delete(e),this.sessions.forEach((r,o)=>{r.userId===e&&this.sessions.delete(o);}),true):false}async hashPassword(e){return (await import('bcryptjs')).default.hash(e,12)}async verifyPassword(e,t){let r=await this.findUserByEmail(e);return !r||!r.passwordHash?null:await(await import('bcryptjs')).default.compare(t,r.passwordHash)?r:null}async createSession(e,t={}){let r=randomBytes(32).toString("hex"),o=randomBytes(32).toString("base64url"),n=randomBytes(32).toString("base64url"),i=new Date,a={id:r,userId:e,token:o,refreshToken:n,expiresAt:new Date(i.getTime()+86400*1e3).toISOString(),createdAt:i.toISOString(),ipAddress:t.ipAddress,userAgent:t.userAgent};return this.sessions.set(r,a),this.refreshTokens.set(n,r),a}async findSessionByToken(e){return this.sessions.get(e)||null}async findSessionByRefreshToken(e){let t=this.refreshTokens.get(e);return t&&this.sessions.get(t)||null}async deleteSession(e){let t=this.sessions.get(e);return t?(t.refreshToken&&this.refreshTokens.delete(t.refreshToken),this.sessions.delete(e),true):false}async deleteUserSessions(e){let t=0;return this.sessions.forEach((r,o)=>{r.userId===e&&(r.refreshToken&&this.refreshTokens.delete(r.refreshToken),this.sessions.delete(o),t++);}),t}async addPasswordToHistory(e,t){let r=this.passwordHistory.get(e)||[];r.push(t),r.length>5&&r.splice(0,r.length-5),this.passwordHistory.set(e,r);}async getPasswordHistory(e,t=5){return this.passwordHistory.get(e)||[]}async isPasswordInHistory(e,t,r=5){let o=await this.getPasswordHistory(t,r),n=(await import('bcryptjs')).default;for(let i of o)if(await n.compare(e,i))return true;return false}async createEmailVerificationToken(e){let t=randomBytes(32).toString("hex"),r=new Date(Date.now()+1440*60*1e3);return this.emailVerificationTokens.set(t,{userId:e,expiresAt:r}),{token:t,expiresAt:r}}async verifyEmailToken(e){let t=this.emailVerificationTokens.get(e);return !t||t.expiresAt<new Date?(this.emailVerificationTokens.delete(e),{success:false,error:"Invalid or expired token"}):(this.emailVerificationTokens.delete(e),{success:true,userId:t.userId})}async createPasswordResetToken(e){let t=await this.findUserByEmail(e);if(!t)return {token:"",expiresAt:new Date,error:"User not found"};let r=randomBytes(32).toString("hex"),o=new Date(Date.now()+3600*1e3);return this.passwordResetTokens.set(r,{userId:t.id,expiresAt:o}),{token:r,expiresAt:o}}async resetPasswordWithToken(e,t){let r=this.passwordResetTokens.get(e);if(!r||r.expiresAt<new Date)return this.passwordResetTokens.delete(e),{success:false,error:"Invalid or expired token"};let o=await this.hashPassword(t);return await this.updateUser(r.userId,{passwordHash:o}),this.passwordResetTokens.delete(e),{success:true}}async hasAnyUsers(){return this.users.size>0}async findAuditLogs(e){let{limit:t=50,offset:r=0}=e,o=this.auditLogs.slice().reverse();return e.userId&&(o=o.filter(n=>n.userId===e.userId)),e.action&&(Array.isArray(e.action)?o=o.filter(n=>e.action.includes(String(n.action))):o=o.filter(n=>n.action===e.action)),e.resource&&(o=o.filter(n=>n.resource===e.resource)),e.success!==void 0&&(o=o.filter(n=>n.success===e.success)),{logs:o.slice(r,r+t),total:o.length}}async createAuditLog(e){let t=randomBytes(16).toString("hex"),o={...e,id:t,timestamp:new Date};return this.auditLogs.push(o),o}};var k=class{storage=new Map;history=new Map;config;constructor(e={}){this.config={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3,...e};}async checkLockout(e){let t=Date.now(),r=this.storage.get(e);if(r&&r.lockedUntil!==null&&r.lockedUntil<=t)return await this.resetAttempts(e),{locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};if(!r)return {locked:false,attemptsRemaining:this.config.maxAttempts,totalAttempts:0};let{attempts:o,lockedUntil:n}=r;return n!==null&&n>t?{locked:true,attemptsRemaining:0,lockedUntil:new Date(n),totalAttempts:o}:{locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-o),totalAttempts:o}}async recordFailedAttempt(e){let t=Date.now(),r=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};r.attempts+=1,r.lastAttempt=t;let o=this.history.get(e)||[];if(o.push(t),o.length>100&&o.splice(0,o.length-100),this.history.set(e,o),this.storage.set(e,r),r.attempts>=this.config.maxAttempts){let n=new Date(t+this.config.lockDuration);return r.lockedAt=t,r.lockedUntil=n.getTime(),this.storage.set(e,r),{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:r.attempts}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-r.attempts),totalAttempts:r.attempts}}async lockAccount(e,t){let r=Date.now(),o=t||this.config.lockDuration,n=new Date(r+o),i=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};i.attempts=this.config.maxAttempts,i.lockedAt=r,i.lockedUntil=n.getTime(),this.storage.set(e,i);}async unlockAccount(e){await this.resetAttempts(e);}async resetAttempts(e){let t=this.storage.get(e);t&&(t.attempts=0,t.lockedAt=null,t.lockedUntil=null,this.storage.set(e,t)),this.history.delete(e);}async getLockoutHistory(e,t=10){return (this.history.get(e)||[]).slice(-t).reverse().map(o=>new Date(o))}async getLockoutStats(e){let r=(this.history.get(e)||[]).length,o=Math.floor(r/this.config.maxAttempts),n=null,i=this.storage.get(e);i&&i.lockedAt!==null&&(n=new Date(i.lockedAt));let a=o>0?this.config.maxAttempts:0;return {totalFailedAttempts:r,lockoutCount:o,lastLockout:n,averageAttemptsBeforeLockout:a}}shouldNotifyAdmin(e){return this.config.notifyAdmin&&e>=this.config.adminNotifyAfter}getConfig(){return {...this.config}}setConfig(e){this.config={...this.config,...e};}};function h(s,e=""){return process.env[s]||e}function A(s,e=false){let t=process.env[s];return t?t.toLowerCase()==="true":e}function g(s,e=0){let t=process.env[s];return t?parseInt(t,10):e}function Ie(){let s=process.env.KYRO_AUTH_DATABASE?.toLowerCase();if(s&&["sqlite","postgres","mongodb","memory"].includes(s))return s;try{let e=join(process.cwd(),"kyro.config.ts"),t=readFileSync(e,"utf8");if(t.includes("createLocalAdapter"))return "sqlite";if(t.includes("createDrizzleAdapter"))return t.includes("postgres")||t.includes("postgresql"),"postgres";if(t.includes("createMongoDBAdapter"))return "mongodb"}catch{}return "memory"}async function Lr(s){let e=process.cwd(),t=e.endsWith("admin")?join(e,".."):e,r=resolve(t,"data","auth.db");switch(s){case "sqlite":return new a$2({path:h("KYRO_AUTH_DB_PATH",r)});case "postgres":{let o=h("DATABASE_URL","");if(o){let n,i;try{n=(await import('drizzle-orm/postgres-js')).drizzle,i=await import('postgres');}catch{a(["postgres","drizzle-orm"]),n=(await import('drizzle-orm/postgres-js')).drizzle,i=await import('postgres');}let a$1=i.default(o,{onnotice:()=>{}}),c=n(a$1);return new a$3({db:c})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{let o=h("MONGODB_URI","");if(o){let n;try{n=(await import('mongodb')).MongoClient;}catch{a(["mongodb"]),n=(await import('mongodb')).MongoClient;}let i=new n(o);await i.connect();let c=new URL(o).pathname.replace(/^\//,"")||"kyro_cms",l=i.db(c);return new a$1({db:l})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}default:return new T}}async function $(s,e){let t=A("KYRO_DISTRIBUTED",false),r;if(t){let{RedisAuthAdapter:u}=await import('./redis-adapter-NN3H4GRX.js'),p=h("REDIS_URL","redis://localhost:6379"),y=A("REDIS_TLS",false),m=new u({url:p,tls:y});await m.connect?.(),r=m;}else {let u=s||Ie();r=await Lr(u),r.connect&&await r.connect();}let o=e?await k$1.fromConfig(e).catch(()=>null)||k$1.fromEnv()||void 0:k$1.fromEnv()||void 0,n$1=new l$1({minLength:g("PASSWORD_MIN_LENGTH",12),requireUppercase:A("PASSWORD_REQUIRE_UPPERCASE",true),requireLowercase:A("PASSWORD_REQUIRE_LOWERCASE",true),requireNumbers:A("PASSWORD_REQUIRE_NUMBERS",true),requireSpecialChars:A("PASSWORD_REQUIRE_SPECIAL",true),preventReuse:g("PASSWORD_PREVENT_REUSE",5),maxLength:g("PASSWORD_MAX_LENGTH",128)}),i,a,c;if(t){let p=r.redis;i=new x(p,{maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new P(p,{"auth:login":{window:g("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:g("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:g("RATE_LIMIT_WINDOW_MS",6e4),max:g("RATE_LIMIT_MAX_REQUESTS",100)}}),c=new n(p,g("AUDIT_LOG_RETENTION_DAYS",30));}else i=new k({maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new m({"auth:login":{window:g("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:g("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:g("RATE_LIMIT_WINDOW_MS",6e4),max:g("RATE_LIMIT_MAX_REQUESTS",100)}}),c=A("AUDIT_LOG_ENABLED",true)?new p(g("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let l=new q$1({redis:r,email:o,jwtSecret:h("APP_SECRET","change-me"),jwtExpiresIn:h("JWT_EXPIRES_IN","24h"),jwtIssuer:h("JWT_ISSUER","kyro-cms"),jwtAudience:h("JWT_AUDIENCE","kyro-cms-client"),passwordPolicy:n$1,lockout:i,rateLimiter:a,auditLogger:c,baseUrl:h("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:A("EMAIL_VERIFICATION_REQUIRED",true)}),d=t?"distributed":s||Ie();return {authAdapter:r,databaseType:d,email:o,passwordPolicy:n$1,lockout:i,rateLimiter:a,auditLogger:c,routes:l}}var Ee=$().catch(s=>(console.warn("[AuthConfig] Failed to initialize auth config:",s.message),null));var Er=12,Or="24h",Ur="7d",U=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??Or,refreshExpiresIn:t.refreshExpiresIn??Ur,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??Er};}async register(e){try{if(await this.adapter.findUserByEmail(e.email))return {success:!1,error:"Email already registered"};let r=await this.adapter.createUser({email:e.email,password:e.password,role:e.role??"customer",tenantId:e.tenantId});return this.createSessionForUser(r)}catch(t){return {success:false,error:String(t)}}}async login(e){try{let t=await this.adapter.verifyPassword(e.email,e.password);return t?this.createSessionForUser(t):{success:!1,error:"Invalid credentials"}}catch(t){return {success:false,error:String(t)}}}async logout(e){await this.adapter.deleteSession(e);}async refreshToken(e){try{let t=await this.adapter.findSessionByToken(e);if(!t||new Date(t.expiresAt)<new Date)return {success:!1,error:"Invalid or expired refresh token"};let r=await this.adapter.findUserById(t.userId);return r?(await this.adapter.deleteSession(e),this.createSessionForUser(r)):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async verifyToken(e){try{let{default:t}=await import('jsonwebtoken');return t.verify(e,this.config.secret,{issuer:this.config.issuer,audience:this.config.audience.length>0?this.config.audience[0]:void 0})}catch{return null}}async getUserFromToken(e){let t=await this.verifyToken(e);return t?this.adapter.findUserById(t.sub):null}async changePassword(e,t,r){try{let o=await this.adapter.findUserById(e);return o?await this.adapter.verifyPassword(o.email,t)?(await this.adapter.updateUser(e,{password:r}),await this.adapter.deleteUserSessions(e),{success:!0,user:o}):{success:!1,error:"Current password is incorrect"}:{success:!1,error:"User not found"}}catch(o){return {success:false,error:String(o)}}}async resetPassword(e,t){try{let r=await this.adapter.findUserByEmail(e);return r?(await this.adapter.updateUser(r.id,{password:t}),await this.adapter.deleteUserSessions(r.id),{success:!0,user:r}):{success:!1,error:"User not found"}}catch(r){return {success:false,error:String(r)}}}async sendEmailVerification(e){try{let{token:t,expiresAt:r}=await this.adapter.createEmailVerificationToken(e);return {success:!0}}catch(t){return {success:false,error:String(t)}}}async verifyEmail(e){try{return await this.adapter.verifyEmailToken(e)}catch(t){return {success:false,error:String(t)}}}async requestPasswordReset(e){try{let t=await this.adapter.createPasswordResetToken(e);return t.error?{success:!1,error:t.error}:{success:!0}}catch(t){return {success:false,error:String(t)}}}async resetPasswordWithToken(e,t){try{return await this.adapter.resetPasswordWithToken(e,t)}catch(r){return {success:false,error:String(r)}}}async deleteAccount(e){try{return await this.adapter.findUserById(e)?(await this.adapter.deleteUserSessions(e),await this.adapter.deleteUser(e),{success:!0}):{success:!1,error:"User not found"}}catch(t){return {success:false,error:String(t)}}}async createSessionForUser(e){let t=await this.generateToken(e),r=await this.adapter.createSession(e.id);return {success:true,user:e,session:r,token:t}}async generateToken(e){let{default:t}=await import('jsonwebtoken'),r={sub:e.id,email:e.email,role:e.role,tenantId:e.tenantId},o={expiresIn:this.parseExpiresIn(this.config.expiresIn)/1e3,issuer:this.config.issuer};return this.config.audience.length>0&&(o.audience=this.config.audience[0]),t.sign(r,this.config.secret,o)}async hashPassword(e){let{default:t}=await import('bcryptjs');return t.hash(e,this.config.saltRounds)}parseExpiresIn(e){if(typeof e=="number")return e;let t=e.match(/^(\d+)([smhd])$/);if(!t)return 864e5;let r=parseInt(t[1],10);switch(t[2]){case "s":return r*1e3;case "m":return r*6e4;case "h":return r*36e5;case "d":return r*864e5;default:return 864e5}}};function Vr(s,e){return new U(s,e)}function V(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var _=class{adapter;config;constructor(e,t){this.adapter=e,this.config={...V(),...t};}async createVersion(e){let r=((await this.adapter.getLatestVersion(e.collection,e.documentId))?.version??0)+1,o={...e,version:r},n=await this.adapter.createVersion(o);return this.config.maxVersionsPerDocument>0&&await this.pruneOldVersions(e.collection,e.documentId),n}async publishVersion(e){let t=await this.adapter.getVersion(e.collection,e.versionId);if(!t)throw new Error("Version not found");if(t.status==="published")throw new Error("Version is already published");await this.adapter.publishVersion(e);}async unpublishDocument(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:1e3});for(let o of r)if(o.status==="published"){await this.createVersion({collection:e,documentId:t,data:o.data,status:"draft",createdBy:"system",changeDescription:"Unpublished document"});break}}async revertToVersion(e,t,r,o){if(!await this.adapter.getVersion(e,r))throw new Error("Version not found");return await this.adapter.revertToVersion({collection:e,documentId:t,versionId:r,userId:o})}async getVersionHistory(e,t,r=20,o=0){return this.adapter.getVersions({collection:e,documentId:t,limit:r,offset:o})}async compareTwoVersions(e,t,r,o){return this.adapter.compareVersions({collection:e,documentId:t,versionA:r,versionB:o})}async getLatestDraft(e,t){return this.adapter.getLatestVersion(e,t)}async getPublishedVersion(e,t){return this.adapter.getPublishedVersion(e,t)}async getVersion(e,t){return this.adapter.getVersion(e,t)}async schedulePublish(e,t,r,o){if(!this.config.scheduleEnabled)throw new Error("Scheduled publishing is not enabled");if(!await this.adapter.getVersion(e,r))throw new Error("Version not found")}async deleteVersionHistory(e,t){await this.adapter.deleteVersions(e,t);}async pruneOldVersions(e,t){let r=await this.adapter.getVersions({collection:e,documentId:t,limit:this.config.maxVersionsPerDocument+100});if(r.length<=this.config.maxVersionsPerDocument)return;r.slice(0,this.config.maxVersionsPerDocument);let n=r.slice(this.config.maxVersionsPerDocument);for(let i of n)if(i.status!=="published"){await this.adapter.deleteVersions(e,t);break}}};function _r(s,e){return new _(s,e)}function Mr(s){return s==="published"}function Hr(s){return s==="draft"}function Fr(s){return s==="archived"}function Nr(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Br(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Oe(s){return {collections:Nr(s.collections),globals:Br(s.globals),adapter:s.adapter,plugins:s.plugins,auth:s.auth,cors:s.cors,admin:s.admin,upload:s.upload,graphQL:s.graphQL,typescript:s.typescript,localization:s.localization,rateLimit:s.rateLimit,debug:s.debug}}var Kr=Oe;function $r(s){let{siteSettings:e,seoSettings:t,title:r,description:o,image:n,url:i}=s;if(!e)return "";let a=e.siteName||"",c=r||t?.defaultTitle||a,l=t?.titleTemplate,d=t?.separator||" | ",u=t?.siteNameInTitle!==false,p=l?l.replace(/\{\{title\}\}/g,c).replace(/\{\{siteName\}\}/g,u?a:"").replace(/\{\{separator\}\}/g,d).replace(/\s+/g," ").trim():c,y=o||t?.defaultDescription||e.siteDescription||"",m=n||e.siteOgImage?.url||"",D=i||e.siteUrl||"",f=`
2
2
  <title>${p}</title>
3
3
  <meta name="description" content="${y}">
4
4
  `;e.siteFavicon?.url&&(f+=`
@@ -19,7 +19,7 @@ export{a as RedisAuthAdapter}from'./chunk-QOCHBPMK.js';export{R as allSettingsGl
19
19
  `,t?.social?.twitterHandle&&(f+=`
20
20
  <meta name="twitter:site" content="${t.social.twitterHandle}">`),m&&(f+=`
21
21
  <meta name="twitter:image" content="${m}">`),e.enableI18n&&e.i18n?.language&&(f+=`
22
- <meta http-equiv="content-language" content="${e.i18n.language}">`),f}function jr(s){if(!s||!s.analyticsEnabled||!s.analytics)return "";let{googleAnalyticsId:e,googleTagManagerId:t,plausibleDomain:r}=s.analytics,o="";return e&&(o+=`
22
+ <meta http-equiv="content-language" content="${e.i18n.language}">`),f}function zr(s){if(!s||!s.analyticsEnabled||!s.analytics)return "";let{googleAnalyticsId:e,googleTagManagerId:t,plausibleDomain:r}=s.analytics,o="";return e&&(o+=`
23
23
  <!-- Google Analytics -->
24
24
  <script async src="https://www.googletagmanager.com/gtag/js?id=${e}"></script>
25
25
  <script>
@@ -40,11 +40,11 @@ export{a as RedisAuthAdapter}from'./chunk-QOCHBPMK.js';export{R as allSettingsGl
40
40
  `),r&&(o+=`
41
41
  <!-- Plausible Analytics -->
42
42
  <script defer data-domain="${r}" src="https://plausible.io/js/script.js"></script>
43
- `),o}var Wr={facebook:{label:"Facebook"},twitter:{label:"Twitter / X"},instagram:{label:"Instagram"},linkedin:{label:"LinkedIn"},youtube:{label:"YouTube"},tiktok:{label:"TikTok"},pinterest:{label:"Pinterest"},discord:{label:"Discord"},twitch:{label:"Twitch"},github:{label:"GitHub"},mastodon:{label:"Mastodon"}},qr=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function Ue(s){if(!s)return [];let e=s.showAll===true,t=[];for(let r of qr){let o=s[r];if(!o||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let i=Wr[r];t.push({platform:r,url:o,label:i?.label||r});}return t}async function Gr(s,e){try{let t=await s.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return Ue(t)}catch{return []}}function Ve(s){return s?{storeName:s.storeName,storeEmail:s.storeEmail,storePhone:s.storePhone,address:s.address,currency:s.currency,tax:s.tax,shipping:s.shipping,orders:s.orders}:{}}async function Qr(s,e){try{let t=await s.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return Ve(t)}catch{return {}}}function _e(s){return s?{testMode:s.testMode,provider:s.provider,stripe:s.stripe,paypal:s.paypal,square:s.square,methods:s.methods,bankTransfer:s.bankTransfer}:{}}async function Yr(s,e){try{let t=await s.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return _e(t)}catch{return {}}}async function z(s={}){let{namespace:e="kyro",ttl:t}=s,r=createStorage({driver:Xr({dbName:"kyro-cms",storeName:e})}),o=e?`${e}:`:"";return {storage:{getItem:async i=>{let a=`${o}${i}`,c=await r.getItem(a);if(c==null)return null;try{let l=JSON.parse(c);return l.expiry&&Date.now()>l.expiry?(await r.removeItem(a),null):l.value}catch{return c}},setItem:async(i,a)=>{let c=`${o}${i}`,l=JSON.stringify(t?{value:a,expiry:Date.now()+t}:{value:a});await r.setItem(c,l);},removeItem:async i=>{await r.removeItem(`${o}${i}`);}},cleanup:async()=>{await r.dispose?.();}}}function j(s){let e=s||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return W.createHash("sha256").update(e).digest("hex")}function ro(s,e){let t=W.randomBytes(16),r=W.createCipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),t),o=r.update(s,"utf8","hex");o+=r.final("hex");let n=r.getAuthTag().toString("hex");return `${t.toString("hex")}:${n}:${o}`}function oo(s,e){let[t,r,o]=s.split(":"),n=Buffer.from(t,"hex"),i=Buffer.from(r,"hex"),a=W.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),n);a.setAuthTag(i);let c=a.update(o,"hex","utf8");return c+=a.final("utf8"),c}async function q(s={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:o,basePath:n}=s,i=n?Me.join(n,".astro","kyro.json"):Me.join(process.cwd(),".astro","kyro.json"),a=createStorage({driver:to({base:i})}),c=r?j(o):null,l=e?`${e}:`:"";return {storage:{getItem:async d=>{let u=`${l}${d}`,p=await a.getItem(u);if(p==null)return null;try{let y=c?oo(p,c):p,m=JSON.parse(y);return m.expiry&&Date.now()>m.expiry?(await a.removeItem(u),null):m.value}catch{return p}},setItem:async(d,u)=>{let p=`${l}${d}`,y=JSON.stringify(t?{value:u,expiry:Date.now()+t}:{value:u});await a.setItem(p,c?ro(y,c):y);},removeItem:async d=>{await a.removeItem(`${l}${d}`);}},cleanup:async()=>{await a.dispose?.();}}}async function G(s){let{environment:e,adapter:t,connectionString:r,encryption:o}=s,n=process.env.APP_SECRET||process.env.AUTH_SECRET,i={enabled:o?.enabled??true,algorithm:o?.algorithm};return e==="browser"?z({namespace:"kyro"}):q({namespace:"kyro",encryption:i.enabled,secret:n})}async function He(s){let e={...s,encryption:{enabled:true,algorithm:s.encryption?.algorithm}};return G(e)}l();function so(s){return {name:"kyro-loader",load:async e=>{let{store:t,logger:r,parseData:o}=e;r.info(`Loading Kyro CMS collection: "${s.collection}"`);try{let n=[];t.clear();for(let i of n){let a=String(i.id||i._id),c=await o({id:a,data:i});t.set({id:a,data:c,digest:JSON.stringify(c)});}r.info(`Successfully synced ${n.length} entries for "${s.collection}" into Astro store.`);}catch(n){r.error(`Failed to load Kyro collection "${s.collection}": ${n.message}`);}},schema:z$1.object({id:z$1.string(),createdAt:z$1.string().optional(),updatedAt:z$1.string().optional()}).passthrough()}}function io(s){return {input:s.schema||z$1.object({}).passthrough(),handler:async(t,r)=>{try{return {success:!0,collection:s.collection,action:s.action,data:t,timestamp:new Date().toISOString()}}catch(o){return {success:false,error:o.message||"CMS Action Execution Failed"}}}}}function ao(s={}){let e=s.protectedRoutes||[],t=s.loginPath||"/admin/login",r=s.cookieName||"kyro_session";return async(o,n)=>{let{request:i,cookies:a,redirect:c,locals:l}=o,d=new URL(i.url),u=a?.get?.(r)?.value||i.headers.get("authorization")?.replace("Bearer ",""),p=null;return u&&(p={id:"user_1",email:"admin@kyro.dev",role:"admin"}),l.kyroUser=p,e.some(m=>new RegExp("^"+m.replace(/\*/g,".*")+"$").test(d.pathname))&&!p?c(`${t}?redirect=${encodeURIComponent(d.pathname)}`):n()}}function co(s){let e=s?.collections||[],t=`// Auto-generated by Kyro CMS
43
+ `),o}var jr={facebook:{label:"Facebook"},twitter:{label:"Twitter / X"},instagram:{label:"Instagram"},linkedin:{label:"LinkedIn"},youtube:{label:"YouTube"},tiktok:{label:"TikTok"},pinterest:{label:"Pinterest"},discord:{label:"Discord"},twitch:{label:"Twitch"},github:{label:"GitHub"},mastodon:{label:"Mastodon"}},Wr=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function Ue(s){if(!s)return [];let e=s.showAll===true,t=[];for(let r of Wr){let o=s[r];if(!o||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let i=jr[r];t.push({platform:r,url:o,label:i?.label||r});}return t}async function qr(s,e){try{let t=await s.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return Ue(t)}catch{return []}}function Ve(s){return s?{storeName:s.storeName,storeEmail:s.storeEmail,storePhone:s.storePhone,address:s.address,currency:s.currency,tax:s.tax,shipping:s.shipping,orders:s.orders}:{}}async function Gr(s,e){try{let t=await s.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return Ve(t)}catch{return {}}}function _e(s){return s?{testMode:s.testMode,provider:s.provider,stripe:s.stripe,paypal:s.paypal,square:s.square,methods:s.methods,bankTransfer:s.bankTransfer}:{}}async function Qr(s,e){try{let t=await s.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return _e(t)}catch{return {}}}async function z(s={}){let{namespace:e="kyro",ttl:t}=s,r=createStorage({driver:Jr({dbName:"kyro-cms",storeName:e})}),o=e?`${e}:`:"";return {storage:{getItem:async i=>{let a=`${o}${i}`,c=await r.getItem(a);if(c==null)return null;try{let l=JSON.parse(c);return l.expiry&&Date.now()>l.expiry?(await r.removeItem(a),null):l.value}catch{return c}},setItem:async(i,a)=>{let c=`${o}${i}`,l=JSON.stringify(t?{value:a,expiry:Date.now()+t}:{value:a});await r.setItem(c,l);},removeItem:async i=>{await r.removeItem(`${o}${i}`);}},cleanup:async()=>{await r.dispose?.();}}}function j(s){let e=s||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return W.createHash("sha256").update(e).digest("hex")}function to(s,e){let t=W.randomBytes(16),r=W.createCipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),t),o=r.update(s,"utf8","hex");o+=r.final("hex");let n=r.getAuthTag().toString("hex");return `${t.toString("hex")}:${n}:${o}`}function ro(s,e){let[t,r,o]=s.split(":"),n=Buffer.from(t,"hex"),i=Buffer.from(r,"hex"),a=W.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),n);a.setAuthTag(i);let c=a.update(o,"hex","utf8");return c+=a.final("utf8"),c}async function q(s={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:o,basePath:n}=s,i=n?Me.join(n,".astro","kyro.json"):Me.join(process.cwd(),".astro","kyro.json"),a=createStorage({driver:eo({base:i})}),c=r?j(o):null,l=e?`${e}:`:"";return {storage:{getItem:async d=>{let u=`${l}${d}`,p=await a.getItem(u);if(p==null)return null;try{let y=c?ro(p,c):p,m=JSON.parse(y);return m.expiry&&Date.now()>m.expiry?(await a.removeItem(u),null):m.value}catch{return p}},setItem:async(d,u)=>{let p=`${l}${d}`,y=JSON.stringify(t?{value:u,expiry:Date.now()+t}:{value:u});await a.setItem(p,c?to(y,c):y);},removeItem:async d=>{await a.removeItem(`${l}${d}`);}},cleanup:async()=>{await a.dispose?.();}}}async function G(s){let{environment:e,adapter:t,connectionString:r,encryption:o}=s,n=process.env.APP_SECRET||process.env.AUTH_SECRET,i={enabled:o?.enabled??true,algorithm:o?.algorithm};return e==="browser"?z({namespace:"kyro"}):q({namespace:"kyro",encryption:i.enabled,secret:n})}async function He(s){let e={...s,encryption:{enabled:true,algorithm:s.encryption?.algorithm}};return G(e)}l();function oo(s){return {name:"kyro-loader",load:async e=>{let{store:t,logger:r,parseData:o}=e;r.info(`Loading Kyro CMS collection: "${s.collection}"`);try{let n=[];t.clear();for(let i of n){let a=String(i.id||i._id),c=await o({id:a,data:i});t.set({id:a,data:c,digest:JSON.stringify(c)});}r.info(`Successfully synced ${n.length} entries for "${s.collection}" into Astro store.`);}catch(n){r.error(`Failed to load Kyro collection "${s.collection}": ${n.message}`);}},schema:z$1.object({id:z$1.string(),createdAt:z$1.string().optional(),updatedAt:z$1.string().optional()}).passthrough()}}function no(s){return {input:s.schema||z$1.object({}).passthrough(),handler:async(t,r)=>{try{return {success:!0,collection:s.collection,action:s.action,data:t,timestamp:new Date().toISOString()}}catch(o){return {success:false,error:o.message||"CMS Action Execution Failed"}}}}}function io(s={}){let e=s.protectedRoutes||[],t=s.loginPath||"/admin/login",r=s.cookieName||"kyro_session";return async(o,n)=>{let{request:i,cookies:a,redirect:c,locals:l}=o,d=new URL(i.url),u=a?.get?.(r)?.value||i.headers.get("authorization")?.replace("Bearer ",""),p=null;return u&&(p={id:"user_1",email:"admin@kyro-cms.com",role:"admin"}),l.kyroUser=p,e.some(m=>new RegExp("^"+m.replace(/\*/g,".*")+"$").test(d.pathname))&&!p?c(`${t}?redirect=${encodeURIComponent(d.pathname)}`):n()}}function ao(s){let e=s?.collections||[],t=`// Auto-generated by Kyro CMS
44
44
  declare module 'kyro:collections' {
45
45
  export interface KyroCollections {
46
46
  `;for(let r of e){let o=r.name||r.slug;t+=` '${o}': Record<string, any>;
47
47
  `;}return t+=` }
48
48
  }
49
- `,t}function lo(s={}){return {APP_SECRET:{context:"server",access:"secret",type:"string",optional:false},DATABASE_URL:{context:"server",access:"secret",type:"string",optional:!s.requireDatabase},PUBLIC_KYRO_URL:{context:"client",access:"public",type:"string",optional:true,default:"http://localhost:4321"}}}function uo(s={}){return {name:"kyro-dev-toolbar-integration",hooks:{"astro:config:setup":({addDevToolbarApp:e})=>{s.enabled!==false&&typeof e=="function"&&e({id:"kyro-cms",name:"Kyro CMS",icon:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>',entrypoint:"@kyro-cms/core/dev-toolbar-app"});}}}}
50
- export{x as AccountLockout,U as Auth,k as InMemoryAccountLockout,T as InMemoryAuthAdapter,R as NeonAdapter,P as RateLimiter,v as TursoAdapter,_ as VersionManager,Ee as authConfig,_r as createAuth,$ as createAuthConfig,He as createAuthStorage,ve as createNeonAdapter,G as createStorage,De as createTursoAdapter,Mr as createVersionManager,Oe as defineConfig,$r as defineKyroConfig,jr as generateAnalyticsTags,co as generateKyroAstroTypes,zr as generateSeoTags,V as getDefaultDraftPublishConfig,Yr as getPaymentConfig,_e as getPaymentConfigFromSettings,Gr as getSocialLinks,Ue as getSocialLinksFromSettings,Qr as getStoreConfig,Ve as getStoreConfigFromSettings,Nr as isArchived,Fr as isDraft,Hr as isPublished,io as kyroAction,ao as kyroAuthMiddleware,uo as kyroDevToolbarIntegration,lo as kyroEnvSchema,so as kyroLoader,Rr as runFieldHooks,Re as runHooks};
49
+ `,t}function co(s={}){return {APP_SECRET:{context:"server",access:"secret",type:"string",optional:false},DATABASE_URL:{context:"server",access:"secret",type:"string",optional:!s.requireDatabase},PUBLIC_KYRO_URL:{context:"client",access:"public",type:"string",optional:true,default:"http://localhost:4321"}}}function lo(s={}){return {name:"kyro-dev-toolbar-integration",hooks:{"astro:config:setup":({addDevToolbarApp:e})=>{s.enabled!==false&&typeof e=="function"&&e({id:"kyro-cms",name:"Kyro CMS",icon:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>',entrypoint:"@kyro-cms/core/dev-toolbar-app"});}}}}
50
+ export{x as AccountLockout,U as Auth,k as InMemoryAccountLockout,T as InMemoryAuthAdapter,R as NeonAdapter,P as RateLimiter,v as TursoAdapter,_ as VersionManager,Ee as authConfig,Vr as createAuth,$ as createAuthConfig,He as createAuthStorage,ve as createNeonAdapter,G as createStorage,De as createTursoAdapter,_r as createVersionManager,Oe as defineConfig,Kr as defineKyroConfig,zr as generateAnalyticsTags,ao as generateKyroAstroTypes,$r as generateSeoTags,V as getDefaultDraftPublishConfig,Qr as getPaymentConfig,_e as getPaymentConfigFromSettings,qr as getSocialLinks,Ue as getSocialLinksFromSettings,Gr as getStoreConfig,Ve as getStoreConfigFromSettings,Fr as isArchived,Hr as isDraft,Mr as isPublished,no as kyroAction,io as kyroAuthMiddleware,lo as kyroDevToolbarIntegration,co as kyroEnvSchema,oo as kyroLoader,Cr as runFieldHooks,Re as runHooks};
@@ -1 +1 @@
1
- 'use strict';var chunkP5GIDGMG_cjs=require('./chunk-P5GIDGMG.cjs');require('./chunk-AHSFSERC.cjs');module.exports=chunkP5GIDGMG_cjs.a;
1
+ 'use strict';var chunkRWYVZJ6R_cjs=require('./chunk-RWYVZJ6R.cjs');require('./chunk-AHSFSERC.cjs');module.exports=chunkRWYVZJ6R_cjs.a;
@@ -1 +1 @@
1
- export{a as default}from'./chunk-PTS33SK5.js';import'./chunk-5J6HXUF6.js';
1
+ export{a as default}from'./chunk-H2QK3JIL.js';import'./chunk-5J6HXUF6.js';
@@ -0,0 +1 @@
1
+ export{a as MongoDBAuthAdapter}from'./chunk-6ROHVUXF.js';import'./chunk-5J6HXUF6.js';
@@ -1 +1 @@
1
- 'use strict';var chunkBVG6VSAJ_cjs=require('./chunk-BVG6VSAJ.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkBVG6VSAJ_cjs.a}});
1
+ 'use strict';var chunkQCA3AP3M_cjs=require('./chunk-QCA3AP3M.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkQCA3AP3M_cjs.a}});
@@ -1 +1 @@
1
- 'use strict';var chunk3Q2WUG63_cjs=require('../chunk-3Q2WUG63.cjs'),chunkBVG6VSAJ_cjs=require('../chunk-BVG6VSAJ.cjs');require('../chunk-FHJJKFAU.cjs'),require('../chunk-D5P2IPGX.cjs'),require('../chunk-G7SSHELM.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAdapter",{enumerable:true,get:function(){return chunk3Q2WUG63_cjs.a}});Object.defineProperty(exports,"createMongoDBAdapter",{enumerable:true,get:function(){return chunk3Q2WUG63_cjs.b}});Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkBVG6VSAJ_cjs.a}});
1
+ 'use strict';var chunk3Q2WUG63_cjs=require('../chunk-3Q2WUG63.cjs'),chunkQCA3AP3M_cjs=require('../chunk-QCA3AP3M.cjs');require('../chunk-FHJJKFAU.cjs'),require('../chunk-D5P2IPGX.cjs'),require('../chunk-G7SSHELM.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAdapter",{enumerable:true,get:function(){return chunk3Q2WUG63_cjs.a}});Object.defineProperty(exports,"createMongoDBAdapter",{enumerable:true,get:function(){return chunk3Q2WUG63_cjs.b}});Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkQCA3AP3M_cjs.a}});
@@ -1 +1 @@
1
- export{a as MongoDBAdapter,b as createMongoDBAdapter}from'../chunk-VGQ4VUG6.js';export{a as MongoDBAuthAdapter}from'../chunk-GXVCCKOL.js';import'../chunk-5KOQYQEE.js';import'../chunk-6SPPR5JZ.js';import'../chunk-4RMFCTWH.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
1
+ export{a as MongoDBAdapter,b as createMongoDBAdapter}from'../chunk-VGQ4VUG6.js';export{a as MongoDBAuthAdapter}from'../chunk-6ROHVUXF.js';import'../chunk-5KOQYQEE.js';import'../chunk-6SPPR5JZ.js';import'../chunk-4RMFCTWH.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
@@ -1 +1 @@
1
- 'use strict';var chunkXTRY75KC_cjs=require('../chunk-XTRY75KC.cjs');require('../chunk-5K4YG5DA.cjs'),require('../chunk-WIZ6C5QZ.cjs'),require('../chunk-GO34AOBZ.cjs'),require('../chunk-HOP4D5XZ.cjs'),require('../chunk-HVXO3OFB.cjs'),require('../chunk-ILEZ3NYX.cjs'),require('../chunk-NY47CFVP.cjs'),require('../chunk-WG3UQEV7.cjs'),require('../chunk-GYQMNXXW.cjs'),require('../chunk-MIOMMB23.cjs'),require('../chunk-BVG6VSAJ.cjs'),require('../chunk-FHJJKFAU.cjs'),require('../chunk-D5P2IPGX.cjs'),require('../chunk-G7SSHELM.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"createHonoApp",{enumerable:true,get:function(){return chunkXTRY75KC_cjs.t}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkXTRY75KC_cjs.u}});
1
+ 'use strict';var chunkUVM7P4SE_cjs=require('../chunk-UVM7P4SE.cjs');require('../chunk-5K4YG5DA.cjs'),require('../chunk-WIZ6C5QZ.cjs'),require('../chunk-GO34AOBZ.cjs'),require('../chunk-HOP4D5XZ.cjs'),require('../chunk-HVXO3OFB.cjs'),require('../chunk-ILEZ3NYX.cjs'),require('../chunk-NY47CFVP.cjs'),require('../chunk-FUWPXR6W.cjs'),require('../chunk-GYQMNXXW.cjs'),require('../chunk-MIOMMB23.cjs'),require('../chunk-QCA3AP3M.cjs'),require('../chunk-FHJJKFAU.cjs'),require('../chunk-D5P2IPGX.cjs'),require('../chunk-G7SSHELM.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"createHonoApp",{enumerable:true,get:function(){return chunkUVM7P4SE_cjs.u}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkUVM7P4SE_cjs.v}});
@@ -1 +1 @@
1
- export{t as createHonoApp,u as createRESTAPI}from'../chunk-YVM5BDRD.js';import'../chunk-6J27P5D6.js';import'../chunk-K6WUOU6P.js';import'../chunk-IETGL7WJ.js';import'../chunk-IKOXCJYO.js';import'../chunk-NRLIGDYF.js';import'../chunk-FVZ5RFLO.js';import'../chunk-HLSB2MCK.js';import'../chunk-DKESD4HI.js';import'../chunk-RHCWCG3O.js';import'../chunk-OG7CNQGU.js';import'../chunk-GXVCCKOL.js';import'../chunk-5KOQYQEE.js';import'../chunk-6SPPR5JZ.js';import'../chunk-4RMFCTWH.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
1
+ export{u as createHonoApp,v as createRESTAPI}from'../chunk-4CJ5RLWO.js';import'../chunk-6J27P5D6.js';import'../chunk-K6WUOU6P.js';import'../chunk-IETGL7WJ.js';import'../chunk-IKOXCJYO.js';import'../chunk-NRLIGDYF.js';import'../chunk-FVZ5RFLO.js';import'../chunk-HLSB2MCK.js';import'../chunk-5KSRMBEO.js';import'../chunk-RHCWCG3O.js';import'../chunk-OG7CNQGU.js';import'../chunk-6ROHVUXF.js';import'../chunk-5KOQYQEE.js';import'../chunk-6SPPR5JZ.js';import'../chunk-4RMFCTWH.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
@@ -1 +1 @@
1
- 'use strict';var chunkSFAD6WPC_cjs=require('../chunk-SFAD6WPC.cjs'),chunk65G73T7Z_cjs=require('../chunk-65G73T7Z.cjs'),chunkGO34AOBZ_cjs=require('../chunk-GO34AOBZ.cjs');require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"accessSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.N}});Object.defineProperty(exports,"allSettingsGlobals",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.R}});Object.defineProperty(exports,"blogCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.c}});Object.defineProperty(exports,"blogGlobals",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.d}});Object.defineProperty(exports,"brandSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.L}});Object.defineProperty(exports,"brandsCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.H}});Object.defineProperty(exports,"brandsCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.I}});Object.defineProperty(exports,"categoriesCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.p}});Object.defineProperty(exports,"categoriesCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.q}});Object.defineProperty(exports,"coreSettingsGlobals",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.S}});Object.defineProperty(exports,"couponsCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.z}});Object.defineProperty(exports,"couponsCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.A}});Object.defineProperty(exports,"createTemplateConfig",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.W}});Object.defineProperty(exports,"customersCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.v}});Object.defineProperty(exports,"customersCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.w}});Object.defineProperty(exports,"ecommerceCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.e}});Object.defineProperty(exports,"ecommerceGlobals",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.f}});Object.defineProperty(exports,"emailSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.M}});Object.defineProperty(exports,"formEntriesCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.D}});Object.defineProperty(exports,"formEntriesCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.E}});Object.defineProperty(exports,"formsCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.B}});Object.defineProperty(exports,"formsCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.C}});Object.defineProperty(exports,"getSettingsForTemplate",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.U}});Object.defineProperty(exports,"kitchenSinkCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.g}});Object.defineProperty(exports,"mediaCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.h}});Object.defineProperty(exports,"mediaCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.i}});Object.defineProperty(exports,"menuCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.j}});Object.defineProperty(exports,"menuCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.k}});Object.defineProperty(exports,"minimalCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.a}});Object.defineProperty(exports,"ordersCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.x}});Object.defineProperty(exports,"ordersCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.y}});Object.defineProperty(exports,"pageCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.n}});Object.defineProperty(exports,"pageCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.o}});Object.defineProperty(exports,"postsCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.l}});Object.defineProperty(exports,"postsCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.m}});Object.defineProperty(exports,"productCategoriesCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.r}});Object.defineProperty(exports,"productCategoriesCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.s}});Object.defineProperty(exports,"productsCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.t}});Object.defineProperty(exports,"productsCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.u}});Object.defineProperty(exports,"reviewsCollection",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.F}});Object.defineProperty(exports,"reviewsCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.G}});Object.defineProperty(exports,"seoSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.K}});Object.defineProperty(exports,"settingsBySlug",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.T}});Object.defineProperty(exports,"shippingSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.P}});Object.defineProperty(exports,"siteSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.J}});Object.defineProperty(exports,"starterCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.b}});Object.defineProperty(exports,"storeSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.O}});Object.defineProperty(exports,"systemSettingsGlobal",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.Q}});Object.defineProperty(exports,"templateCollections",{enumerable:true,get:function(){return chunkSFAD6WPC_cjs.V}});Object.defineProperty(exports,"storageSettingsGlobal",{enumerable:true,get:function(){return chunk65G73T7Z_cjs.a}});Object.defineProperty(exports,"authCollections",{enumerable:true,get:function(){return chunkGO34AOBZ_cjs.b}});
1
+ 'use strict';var chunk232V7JSV_cjs=require('../chunk-232V7JSV.cjs'),chunk65G73T7Z_cjs=require('../chunk-65G73T7Z.cjs'),chunkGO34AOBZ_cjs=require('../chunk-GO34AOBZ.cjs');require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"accessSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.g}});Object.defineProperty(exports,"allSettingsGlobals",{enumerable:true,get:function(){return chunk232V7JSV_cjs.k}});Object.defineProperty(exports,"blogCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.o}});Object.defineProperty(exports,"brandSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.e}});Object.defineProperty(exports,"brandsCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.S}});Object.defineProperty(exports,"brandsCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.T}});Object.defineProperty(exports,"categoriesCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.A}});Object.defineProperty(exports,"categoriesCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.B}});Object.defineProperty(exports,"coreSettingsGlobals",{enumerable:true,get:function(){return chunk232V7JSV_cjs.l}});Object.defineProperty(exports,"couponsCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.K}});Object.defineProperty(exports,"couponsCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.L}});Object.defineProperty(exports,"createTemplateConfig",{enumerable:true,get:function(){return chunk232V7JSV_cjs.V}});Object.defineProperty(exports,"customersCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.G}});Object.defineProperty(exports,"customersCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.H}});Object.defineProperty(exports,"ecommerceCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.p}});Object.defineProperty(exports,"ecommerceGlobals",{enumerable:true,get:function(){return chunk232V7JSV_cjs.q}});Object.defineProperty(exports,"emailSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.f}});Object.defineProperty(exports,"formEntriesCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.O}});Object.defineProperty(exports,"formEntriesCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.P}});Object.defineProperty(exports,"formsCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.M}});Object.defineProperty(exports,"formsCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.N}});Object.defineProperty(exports,"getSettingsForTemplate",{enumerable:true,get:function(){return chunk232V7JSV_cjs.n}});Object.defineProperty(exports,"kitchenSinkCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.r}});Object.defineProperty(exports,"mediaCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.s}});Object.defineProperty(exports,"mediaCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.t}});Object.defineProperty(exports,"menuCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.u}});Object.defineProperty(exports,"menuCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.v}});Object.defineProperty(exports,"minimalCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.a}});Object.defineProperty(exports,"ordersCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.I}});Object.defineProperty(exports,"ordersCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.J}});Object.defineProperty(exports,"pageCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.y}});Object.defineProperty(exports,"pageCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.z}});Object.defineProperty(exports,"postsCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.w}});Object.defineProperty(exports,"postsCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.x}});Object.defineProperty(exports,"productCategoriesCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.C}});Object.defineProperty(exports,"productCategoriesCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.D}});Object.defineProperty(exports,"productsCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.E}});Object.defineProperty(exports,"productsCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.F}});Object.defineProperty(exports,"reviewsCollection",{enumerable:true,get:function(){return chunk232V7JSV_cjs.Q}});Object.defineProperty(exports,"reviewsCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.R}});Object.defineProperty(exports,"seoSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.d}});Object.defineProperty(exports,"settingsBySlug",{enumerable:true,get:function(){return chunk232V7JSV_cjs.m}});Object.defineProperty(exports,"shippingSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.i}});Object.defineProperty(exports,"siteSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.c}});Object.defineProperty(exports,"starterCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.b}});Object.defineProperty(exports,"storeSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.h}});Object.defineProperty(exports,"systemSettingsGlobal",{enumerable:true,get:function(){return chunk232V7JSV_cjs.j}});Object.defineProperty(exports,"templateCollections",{enumerable:true,get:function(){return chunk232V7JSV_cjs.U}});Object.defineProperty(exports,"storageSettingsGlobal",{enumerable:true,get:function(){return chunk65G73T7Z_cjs.a}});Object.defineProperty(exports,"authCollections",{enumerable:true,get:function(){return chunkGO34AOBZ_cjs.b}});
@@ -5,8 +5,30 @@ declare const minimalCollections: Record<string, any>;
5
5
 
6
6
  declare const starterCollections: Record<string, any>;
7
7
 
8
+ declare const siteSettingsGlobal: GlobalConfig;
9
+
10
+ declare const seoSettingsGlobal: GlobalConfig;
11
+
12
+ declare const brandSettingsGlobal: GlobalConfig;
13
+
14
+ declare const emailSettingsGlobal: GlobalConfig;
15
+
16
+ declare const accessSettingsGlobal: GlobalConfig;
17
+
18
+ declare const storeSettingsGlobal: GlobalConfig;
19
+
20
+ declare const shippingSettingsGlobal: GlobalConfig;
21
+
22
+ declare const systemSettingsGlobal: GlobalConfig;
23
+
24
+ declare const storageSettingsGlobal: GlobalConfig;
25
+
26
+ declare const allSettingsGlobals: GlobalConfig[];
27
+ declare const coreSettingsGlobals: GlobalConfig[];
28
+ declare const settingsBySlug: Record<string, GlobalConfig>;
29
+ declare function getSettingsForTemplate(template: "minimal" | "starter" | "blog" | "ecommerce" | "kitchen-sink"): GlobalConfig[];
30
+
8
31
  declare const blogCollections: Record<string, any>;
9
- declare const blogGlobals: GlobalConfig[];
10
32
 
11
33
  declare const ecommerceCollections: Record<string, any>;
12
34
  declare const ecommerceGlobals: GlobalConfig[];
@@ -59,29 +81,6 @@ declare const reviewsCollections: Record<string, CollectionConfig>;
59
81
  declare const brandsCollection: CollectionConfig;
60
82
  declare const brandsCollections: Record<string, CollectionConfig>;
61
83
 
62
- declare const siteSettingsGlobal: GlobalConfig;
63
-
64
- declare const seoSettingsGlobal: GlobalConfig;
65
-
66
- declare const brandSettingsGlobal: GlobalConfig;
67
-
68
- declare const emailSettingsGlobal: GlobalConfig;
69
-
70
- declare const accessSettingsGlobal: GlobalConfig;
71
-
72
- declare const storeSettingsGlobal: GlobalConfig;
73
-
74
- declare const shippingSettingsGlobal: GlobalConfig;
75
-
76
- declare const systemSettingsGlobal: GlobalConfig;
77
-
78
- declare const storageSettingsGlobal: GlobalConfig;
79
-
80
- declare const allSettingsGlobals: GlobalConfig[];
81
- declare const coreSettingsGlobals: GlobalConfig[];
82
- declare const settingsBySlug: Record<string, GlobalConfig>;
83
- declare function getSettingsForTemplate(template: "minimal" | "starter" | "blog" | "ecommerce" | "kitchen-sink"): GlobalConfig[];
84
-
85
84
  declare const templateCollections: {
86
85
  readonly minimal: CollectionConfig[];
87
86
  readonly starter: CollectionConfig[];
@@ -104,4 +103,4 @@ interface CreateTemplateConfigOptions extends TemplateConfig {
104
103
  }
105
104
  declare function createTemplateConfig(options: CreateTemplateConfigOptions): TemplateConfig;
106
105
 
107
- export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, brandsCollection, brandsCollections, categoriesCollection, categoriesCollections, coreSettingsGlobals, couponsCollection, couponsCollections, createTemplateConfig, customersCollection, customersCollections, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, formEntriesCollection, formEntriesCollections, formsCollection, formsCollections, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, menuCollection, menuCollections, minimalCollections, ordersCollection, ordersCollections, pageCollection, pageCollections, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, reviewsCollection, reviewsCollections, seoSettingsGlobal, settingsBySlug, shippingSettingsGlobal, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
106
+ export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, brandSettingsGlobal, brandsCollection, brandsCollections, categoriesCollection, categoriesCollections, coreSettingsGlobals, couponsCollection, couponsCollections, createTemplateConfig, customersCollection, customersCollections, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, formEntriesCollection, formEntriesCollections, formsCollection, formsCollections, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, menuCollection, menuCollections, minimalCollections, ordersCollection, ordersCollections, pageCollection, pageCollections, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, reviewsCollection, reviewsCollections, seoSettingsGlobal, settingsBySlug, shippingSettingsGlobal, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
@@ -5,8 +5,30 @@ declare const minimalCollections: Record<string, any>;
5
5
 
6
6
  declare const starterCollections: Record<string, any>;
7
7
 
8
+ declare const siteSettingsGlobal: GlobalConfig;
9
+
10
+ declare const seoSettingsGlobal: GlobalConfig;
11
+
12
+ declare const brandSettingsGlobal: GlobalConfig;
13
+
14
+ declare const emailSettingsGlobal: GlobalConfig;
15
+
16
+ declare const accessSettingsGlobal: GlobalConfig;
17
+
18
+ declare const storeSettingsGlobal: GlobalConfig;
19
+
20
+ declare const shippingSettingsGlobal: GlobalConfig;
21
+
22
+ declare const systemSettingsGlobal: GlobalConfig;
23
+
24
+ declare const storageSettingsGlobal: GlobalConfig;
25
+
26
+ declare const allSettingsGlobals: GlobalConfig[];
27
+ declare const coreSettingsGlobals: GlobalConfig[];
28
+ declare const settingsBySlug: Record<string, GlobalConfig>;
29
+ declare function getSettingsForTemplate(template: "minimal" | "starter" | "blog" | "ecommerce" | "kitchen-sink"): GlobalConfig[];
30
+
8
31
  declare const blogCollections: Record<string, any>;
9
- declare const blogGlobals: GlobalConfig[];
10
32
 
11
33
  declare const ecommerceCollections: Record<string, any>;
12
34
  declare const ecommerceGlobals: GlobalConfig[];
@@ -59,29 +81,6 @@ declare const reviewsCollections: Record<string, CollectionConfig>;
59
81
  declare const brandsCollection: CollectionConfig;
60
82
  declare const brandsCollections: Record<string, CollectionConfig>;
61
83
 
62
- declare const siteSettingsGlobal: GlobalConfig;
63
-
64
- declare const seoSettingsGlobal: GlobalConfig;
65
-
66
- declare const brandSettingsGlobal: GlobalConfig;
67
-
68
- declare const emailSettingsGlobal: GlobalConfig;
69
-
70
- declare const accessSettingsGlobal: GlobalConfig;
71
-
72
- declare const storeSettingsGlobal: GlobalConfig;
73
-
74
- declare const shippingSettingsGlobal: GlobalConfig;
75
-
76
- declare const systemSettingsGlobal: GlobalConfig;
77
-
78
- declare const storageSettingsGlobal: GlobalConfig;
79
-
80
- declare const allSettingsGlobals: GlobalConfig[];
81
- declare const coreSettingsGlobals: GlobalConfig[];
82
- declare const settingsBySlug: Record<string, GlobalConfig>;
83
- declare function getSettingsForTemplate(template: "minimal" | "starter" | "blog" | "ecommerce" | "kitchen-sink"): GlobalConfig[];
84
-
85
84
  declare const templateCollections: {
86
85
  readonly minimal: CollectionConfig[];
87
86
  readonly starter: CollectionConfig[];
@@ -104,4 +103,4 @@ interface CreateTemplateConfigOptions extends TemplateConfig {
104
103
  }
105
104
  declare function createTemplateConfig(options: CreateTemplateConfigOptions): TemplateConfig;
106
105
 
107
- export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, brandsCollection, brandsCollections, categoriesCollection, categoriesCollections, coreSettingsGlobals, couponsCollection, couponsCollections, createTemplateConfig, customersCollection, customersCollections, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, formEntriesCollection, formEntriesCollections, formsCollection, formsCollections, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, menuCollection, menuCollections, minimalCollections, ordersCollection, ordersCollections, pageCollection, pageCollections, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, reviewsCollection, reviewsCollections, seoSettingsGlobal, settingsBySlug, shippingSettingsGlobal, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
106
+ export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, brandSettingsGlobal, brandsCollection, brandsCollections, categoriesCollection, categoriesCollections, coreSettingsGlobals, couponsCollection, couponsCollections, createTemplateConfig, customersCollection, customersCollections, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, formEntriesCollection, formEntriesCollections, formsCollection, formsCollections, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, menuCollection, menuCollections, minimalCollections, ordersCollection, ordersCollections, pageCollection, pageCollections, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, reviewsCollection, reviewsCollections, seoSettingsGlobal, settingsBySlug, shippingSettingsGlobal, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
@@ -1 +1 @@
1
- export{N as accessSettingsGlobal,R as allSettingsGlobals,c as blogCollections,d as blogGlobals,L as brandSettingsGlobal,H as brandsCollection,I as brandsCollections,p as categoriesCollection,q as categoriesCollections,S as coreSettingsGlobals,z as couponsCollection,A as couponsCollections,W as createTemplateConfig,v as customersCollection,w as customersCollections,e as ecommerceCollections,f as ecommerceGlobals,M as emailSettingsGlobal,D as formEntriesCollection,E as formEntriesCollections,B as formsCollection,C as formsCollections,U as getSettingsForTemplate,g as kitchenSinkCollections,h as mediaCollection,i as mediaCollections,j as menuCollection,k as menuCollections,a as minimalCollections,x as ordersCollection,y as ordersCollections,n as pageCollection,o as pageCollections,l as postsCollection,m as postsCollections,r as productCategoriesCollection,s as productCategoriesCollections,t as productsCollection,u as productsCollections,F as reviewsCollection,G as reviewsCollections,K as seoSettingsGlobal,T as settingsBySlug,P as shippingSettingsGlobal,J as siteSettingsGlobal,b as starterCollections,O as storeSettingsGlobal,Q as systemSettingsGlobal,V as templateCollections}from'../chunk-3NC7GXD5.js';export{a as storageSettingsGlobal}from'../chunk-NZ35PV5R.js';export{b as authCollections}from'../chunk-IETGL7WJ.js';import'../chunk-5J6HXUF6.js';
1
+ export{g as accessSettingsGlobal,k as allSettingsGlobals,o as blogCollections,e as brandSettingsGlobal,S as brandsCollection,T as brandsCollections,A as categoriesCollection,B as categoriesCollections,l as coreSettingsGlobals,K as couponsCollection,L as couponsCollections,V as createTemplateConfig,G as customersCollection,H as customersCollections,p as ecommerceCollections,q as ecommerceGlobals,f as emailSettingsGlobal,O as formEntriesCollection,P as formEntriesCollections,M as formsCollection,N as formsCollections,n as getSettingsForTemplate,r as kitchenSinkCollections,s as mediaCollection,t as mediaCollections,u as menuCollection,v as menuCollections,a as minimalCollections,I as ordersCollection,J as ordersCollections,y as pageCollection,z as pageCollections,w as postsCollection,x as postsCollections,C as productCategoriesCollection,D as productCategoriesCollections,E as productsCollection,F as productsCollections,Q as reviewsCollection,R as reviewsCollections,d as seoSettingsGlobal,m as settingsBySlug,i as shippingSettingsGlobal,c as siteSettingsGlobal,b as starterCollections,h as storeSettingsGlobal,j as systemSettingsGlobal,U as templateCollections}from'../chunk-REWSTN3A.js';export{a as storageSettingsGlobal}from'../chunk-NZ35PV5R.js';export{b as authCollections}from'../chunk-IETGL7WJ.js';import'../chunk-5J6HXUF6.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyro-cms/core",
3
- "version": "0.12.22",
3
+ "version": "0.12.24",
4
4
  "description": "Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -152,7 +152,7 @@
152
152
  "@ai-sdk/openai": "^0.0.14",
153
153
  "@aws-sdk/client-s3": "^3.751.0",
154
154
  "@aws-sdk/s3-request-presigner": "^3.751.0",
155
- "@kyro-cms/ai": "0.12.22",
155
+ "@kyro-cms/ai": "0.12.23",
156
156
  "@smithy/node-http-handler": "^4.7.0",
157
157
  "@tiptap/core": "^3.23.6",
158
158
  "@tiptap/extension-color": "^3.23.6",
@@ -205,6 +205,8 @@
205
205
  "eslint": "^9.20.0",
206
206
  "prettier": "^3.5.0",
207
207
  "react": "^19.2.7",
208
+ "tailwindcss": "^4.0.0",
209
+ "@tailwindcss/vite": "^4.0.0",
208
210
  "tsup": "^8.5.1",
209
211
  "typescript": "^5.7.3",
210
212
  "typescript-eslint": "^8.59.1",
@@ -239,6 +241,7 @@
239
241
  },
240
242
  "scripts": {
241
243
  "build": "tsup",
244
+ "build:pages": "pnpm build && pnpm --filter @kyro-cms/admin build:pages",
242
245
  "dev": "NODE_NO_WARNINGS=1 tsup --watch",
243
246
  "test": "vitest",
244
247
  "test:run": "vitest run",