@kyro-cms/core 0.12.4 → 0.12.6

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 (97) hide show
  1. package/dist/{WebhookService-DJ75IwdZ.d.ts → WebhookService-Bpi6w1-6.d.ts} +1 -1
  2. package/dist/{WebhookService-B15DnDeH.d.cts → WebhookService-D_a3FAU4.d.cts} +1 -1
  3. package/dist/api-handler-graphql.cjs +1 -1
  4. package/dist/api-handler-graphql.js +1 -1
  5. package/dist/api-handler-trpc.cjs +1 -1
  6. package/dist/api-handler-trpc.js +1 -1
  7. package/dist/api-handler.cjs +1 -1
  8. package/dist/api-handler.js +1 -1
  9. package/dist/{base-CXZxchcr.d.cts → base-Cpu841KI.d.cts} +1 -1
  10. package/dist/{base-CjuIfzH2.d.ts → base-PZTb6vi6.d.ts} +1 -1
  11. package/dist/bootstrap-4W4342G2.js +1 -0
  12. package/dist/bootstrap-ZGTRVWYE.cjs +1 -0
  13. package/dist/chunk-5YW2WHXR.cjs +133 -0
  14. package/dist/chunk-6SPPR5JZ.js +3 -0
  15. package/dist/{chunk-UJNSOOYZ.cjs → chunk-AMOXD7EJ.cjs} +1 -1
  16. package/dist/chunk-AZNJI6TP.cjs +86 -0
  17. package/dist/chunk-D5P2IPGX.cjs +3 -0
  18. package/dist/chunk-GDOPX6VS.cjs +21 -0
  19. package/dist/chunk-HHH4XNNS.cjs +1 -0
  20. package/dist/{chunk-ET6NN2V2.cjs → chunk-HOP4D5XZ.cjs} +6 -6
  21. package/dist/{chunk-2W4FK6CJ.js → chunk-IKOXCJYO.js} +6 -6
  22. package/dist/chunk-IZCTG4RG.js +1 -0
  23. package/dist/chunk-J5SP3Y2H.js +133 -0
  24. package/dist/chunk-K7HTTXT2.js +3 -0
  25. package/dist/chunk-KSWT2Q5T.js +1 -0
  26. package/dist/chunk-MRBBP5MU.cjs +2 -0
  27. package/dist/{chunk-FO3HLBC7.js → chunk-MSTTFMCM.js} +1 -1
  28. package/dist/chunk-MXTO6XGD.js +21 -0
  29. package/dist/chunk-O7LK4FCW.js +2 -0
  30. package/dist/chunk-RYIEE2TH.cjs +2 -0
  31. package/dist/chunk-U3N4X3K3.js +86 -0
  32. package/dist/chunk-W6P4N3Z7.js +2 -0
  33. package/dist/chunk-YQLXDL4H.cjs +3 -0
  34. package/dist/chunk-Z7HKM3HT.cjs +1 -0
  35. package/dist/cli/index.cjs +1 -1
  36. package/dist/cli/index.js +1 -1
  37. package/dist/client.d.cts +1 -1
  38. package/dist/client.d.ts +1 -1
  39. package/dist/drizzle/index.cjs +1 -1
  40. package/dist/drizzle/index.d.cts +2 -2
  41. package/dist/drizzle/index.d.ts +2 -2
  42. package/dist/drizzle/index.js +1 -1
  43. package/dist/graphql/index.d.cts +2 -2
  44. package/dist/graphql/index.d.ts +2 -2
  45. package/dist/{index-C7FPi-Fj.d.ts → index-B7FXGWrZ.d.ts} +1 -1
  46. package/dist/{index-BCUSHYBf.d.cts → index-DfF-ofSa.d.cts} +1 -1
  47. package/dist/index.cjs +12 -12
  48. package/dist/index.d.cts +12 -11
  49. package/dist/index.d.ts +12 -11
  50. package/dist/index.js +12 -12
  51. package/dist/{mongo-auth-adapter-YPONSOCY.cjs → mongo-auth-adapter-6726C5KF.cjs} +1 -1
  52. package/dist/mongo-auth-adapter-U6SH4OWA.js +1 -0
  53. package/dist/mongodb/index.cjs +1 -1
  54. package/dist/mongodb/index.d.cts +5 -3
  55. package/dist/mongodb/index.d.ts +5 -3
  56. package/dist/mongodb/index.js +1 -1
  57. package/dist/redis-adapter-CQXIPG7W.cjs +1 -0
  58. package/dist/redis-adapter-L7BF3GQ5.js +1 -0
  59. package/dist/rest/index.cjs +1 -1
  60. package/dist/rest/index.d.cts +3 -3
  61. package/dist/rest/index.d.ts +3 -3
  62. package/dist/rest/index.js +1 -1
  63. package/dist/sqlite-adapter-EXYRYZEV.js +1 -0
  64. package/dist/{sqlite-adapter-Z3IBBI4X.cjs → sqlite-adapter-PLD57WOH.cjs} +1 -1
  65. package/dist/templates/index.cjs +1 -1
  66. package/dist/templates/index.d.cts +13 -4
  67. package/dist/templates/index.d.ts +13 -4
  68. package/dist/templates/index.js +1 -1
  69. package/dist/trpc/index.d.cts +2 -2
  70. package/dist/trpc/index.d.ts +2 -2
  71. package/dist/{types-L-qNugRL.d.ts → types-CbofW-fz.d.ts} +1 -0
  72. package/dist/{types-CqqoM3Dy.d.cts → types-DaWvY4Ho.d.cts} +1 -0
  73. package/package.json +12 -11
  74. package/dist/bootstrap-IVQWSJXZ.js +0 -1
  75. package/dist/bootstrap-OHGQGMRV.cjs +0 -1
  76. package/dist/chunk-3YGGZ2VN.js +0 -133
  77. package/dist/chunk-4RSGPSKQ.js +0 -3
  78. package/dist/chunk-ATLSIYRH.cjs +0 -1
  79. package/dist/chunk-AU6IWTBO.js +0 -2
  80. package/dist/chunk-EHLNY6BK.js +0 -21
  81. package/dist/chunk-EQUQJBPP.cjs +0 -2
  82. package/dist/chunk-GZGP4THY.cjs +0 -1
  83. package/dist/chunk-P7CESLDJ.js +0 -1
  84. package/dist/chunk-QRXDCV6K.js +0 -0
  85. package/dist/chunk-RCV2TLOG.cjs +0 -3
  86. package/dist/chunk-UBHFUFD4.cjs +0 -1
  87. package/dist/chunk-UCCFT5OO.cjs +0 -2
  88. package/dist/chunk-UTFLD5DC.cjs +0 -86
  89. package/dist/chunk-W7OSRADF.cjs +0 -21
  90. package/dist/chunk-XSGRGUHP.js +0 -86
  91. package/dist/chunk-YPDRUVWG.js +0 -2
  92. package/dist/chunk-Z7CNY2UV.cjs +0 -133
  93. package/dist/chunk-ZRSXM4BY.js +0 -1
  94. package/dist/mongo-auth-adapter-LG5O4LIH.js +0 -1
  95. package/dist/redis-adapter-KECGVSVX.cjs +0 -1
  96. package/dist/redis-adapter-VAXP43GR.js +0 -1
  97. package/dist/sqlite-adapter-FP45QCYK.js +0 -1
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
- export{a as RedisAuthAdapter}from'./chunk-AU6IWTBO.js';export{N as allSettingsGlobals,c as blogCollections,d as blogGlobals,O as coreSettingsGlobals,S as createTemplateConfig,e as ecommerceCollections,f as ecommerceGlobals,g as kitchenSinkCollections,i as mediaCollections,a as minimalCollections,R as templateCollections}from'./chunk-4RSGPSKQ.js';export{a as kyro}from'./chunk-PTS33SK5.js';export{a as ConfigValidationError,p as Kyro,r as LocalAdapter,l as Registry,h as collectionToCreateZod,i as collectionToUpdateZod,j as collectionToWhereZod,g as collectionToZod,q as createKyro,s as createLocalAdapter,o as createRegistry,f as fieldToZod,m as getRegistry,k as globalToZod,n as resetRegistry,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal}from'./chunk-EHLNY6BK.js';export{d as autoBootstrap,a as bootstrapAdmin,e as bootstrapWithRetry,c as getBootstrapFromEnv}from'./chunk-FO3HLBC7.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-ISCIUG37.js';export{c as buildGraphQLSchema,d as createGraphQLSchema}from'./chunk-PP7W5UKL.js';import {l,n,m,p as p$1,q}from'./chunk-XSGRGUHP.js';export{n as AuditLogger,p as InMemoryAuditLogger,m as InMemoryRateLimiter,r as MediaService,o as createAuditContext,s as createHonoApp,e as createLocalStorage,t as createRESTAPI,i as getAppSecret,j as getEncryptionKey,k as getSessionConfig,h as loadSecrets,d as resolveProvider,g as setDbAdapter}from'./chunk-XSGRGUHP.js';import {b as b$1,c}from'./chunk-7WOX27LK.js';export{a as ConfigService,b as EmailTransport,c as PasswordPolicy}from'./chunk-7WOX27LK.js';import'./chunk-K6WUOU6P.js';import'./chunk-AE6GXUT7.js';import {a as a$1}from'./chunk-2W4FK6CJ.js';export{a as SQLiteAuthAdapter}from'./chunk-2W4FK6CJ.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-I67R6MR5.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-3YGGZ2VN.js';import {a as a$2}from'./chunk-RHCWCG3O.js';export{a as PostgresAuthAdapter}from'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-QRXDCV6K.js';export{a as MongoDBAdapter,b as createMongoDBAdapter}from'./chunk-YPDRUVWG.js';import {a}from'./chunk-P7CESLDJ.js';export{a as MongoDBAuthAdapter}from'./chunk-P7CESLDJ.js';export{a as AbstractBaseAdapter}from'./chunk-TQNM4C7H.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';import q$1,{randomBytes}from'crypto';import {readFileSync}from'fs';import Me,{join,resolve}from'path';export{z}from'zod';import {createStorage}from'unstorage';import $r from'unstorage/drivers/indexedb';import zr from'unstorage/drivers/fs';async function Ie(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 br(s,e){return Ie(s,e)}var b=class{name;version;description;hooks={};collections=[];globals=[];fields=[];extensions={collections:[],globals:[]};adminComponents={};adminStyles=[];serverMiddleware;clientMiddleware;constructor(e){this.name=e;}async init(e){}async beforeInit(e){}async afterInit(e){}getCollections(){return this.collections}getGlobals(){return this.globals}getHooks(){return this.hooks}},$=class{plugins=new Map;hooks=new Map;register(e){if(this.plugins.has(e.name))throw new Error(`Plugin "${e.name}" is already registered`);this.plugins.set(e.name,e);let t=e.getHooks?.()||{};for(let[r,o]of Object.entries(t))if(Array.isArray(o))for(let i of o)this.registerHook(r,i);}unregister(e){let t=this.plugins.get(e);if(!t)return;let r=t.getHooks?.()||{};for(let[o,i]of Object.entries(r))if(Array.isArray(i))for(let n of i)this.unregisterHook(o,n);this.plugins.delete(e);}get(e){return this.plugins.get(e)}getAll(){return Array.from(this.plugins.values())}has(e){return this.plugins.has(e)}registerHook(e,t){this.hooks.has(e)||this.hooks.set(e,[]),this.hooks.get(e).push(t);}unregisterHook(e,t){let r=this.hooks.get(e);if(r){let o=r.indexOf(t);o>-1&&r.splice(o,1);}}async executeHook(e,t){let r=this.hooks.get(e)||[],o=t;for(let i of r)try{let n=await i({...t,data:o});n!==void 0&&(o=n);}catch(n){console.error(`[PluginManager] Error in hook "${e}":`,n);}return o}getAllCollections(){let e=[];for(let t of this.plugins.values()){let r=t.getCollections?.()||[];e.push(...r);}return e}getAllGlobals(){let e=[];for(let t of this.plugins.values()){let r=t.getGlobals?.()||[];e.push(...r);}return e}getAllFields(){let e=[];for(let t of this.plugins.values())e.push(...t.fields);return e}getAdminComponents(){let e={};for(let t of this.plugins.values())Object.assign(e,t.adminComponents);return e}getAdminStyles(){let e=[];for(let t of this.plugins.values())e.push(...t.adminStyles);return e}},L=class extends b{constructor(){super("seo"),this.description="Advanced SEO features including sitemaps, robots.txt, and structured data",this.collections.push({slug:"seo-settings",label:"SEO Settings",fields:[{name:"sitemap",type:"checkbox",label:"Enable Sitemap",defaultValue:true},{name:"robotsTxt",type:"richtext",label:"robots.txt Content"},{name:"canonicalUrl",type:"text",variant:"url",label:"Canonical URL"},{name:"ogImage",type:"text",label:"Default OG Image URL"}]});}},E=class extends b{constructor(){super("analytics"),this.description="Analytics integration for tracking page views and events",this.collections.push({slug:"analytics-events",label:"Analytics Events",fields:[{name:"name",type:"text",required:true},{name:"properties",type:"json",label:"Event Properties"},{name:"timestamp",type:"date",required:true},{name:"userId",type:"text",label:"User ID"},{name:"sessionId",type:"text",label:"Session ID"}]}),this.adminComponents.AnalyticsDashboard={};}},U=class extends b{constructor(){super("comments"),this.description="Commenting system for products and posts",this.collections.push({slug:"comments",label:"Comments",fields:[{name:"content",type:"richtext",required:true},{name:"author",type:"text",required:true},{name:"email",type:"email"},{name:"approved",type:"checkbox",defaultValue:false},{name:"parent",type:"text",label:"Parent Comment ID"},{name:"resourceType",type:"text",required:true},{name:"resourceId",type:"text",required:true}]}),this.adminComponents.CommentModeration={};}},V=class extends b{constructor(){super("reviews"),this.description="Product reviews and ratings",this.collections.push({slug:"reviews",label:"Reviews",fields:[{name:"rating",type:"number",required:true,min:1,max:5},{name:"title",type:"text"},{name:"content",type:"richtext",required:true},{name:"author",type:"relationship",relationTo:"customers"},{name:"product",type:"relationship",relationTo:"products",required:true},{name:"approved",type:"checkbox",defaultValue:false},{name:"verified",type:"checkbox",label:"Verified Purchase"},{name:"helpful",type:"number",label:"Helpful Count",defaultValue:0}]}),this.adminComponents.ReviewModeration={};}},O=class extends b{constructor(){super("wishlist"),this.description="Customer wishlists",this.collections.push({slug:"wishlists",label:"Wishlists",fields:[{name:"customer",type:"relationship",relationTo:"customers",required:true},{name:"name",type:"text",label:"Wishlist Name",defaultValue:"My Wishlist"},{name:"items",type:"blocks",label:"Items",blocks:[{slug:"wishlist-item",label:"Item",fields:[{name:"product",type:"relationship",relationTo:"products"},{name:"quantity",type:"number",defaultValue:1},{name:"addedAt",type:"date"},{name:"priority",type:"select",options:[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"}]}]}]}]});}},Ar={SEO:L,Analytics:E,Comments:U,Reviews:V,Wishlist:O};var wr={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={...wr,...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),i=r.lockedUntil?new Date(parseInt(r.lockedUntil,10)):void 0;return i&&i>new Date?{locked:true,attemptsRemaining:0,lockedUntil:i,totalAttempts:o}:i&&i<=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(),i=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),i>=this.config.maxAttempts){let n=new Date(o+this.config.lockDuration);return await this.redis.hset(t,{lockedAt:o.toString(),lockedUntil:n.getTime().toString()}),await this.redis.expire(t,Math.ceil(this.config.lockDuration/1e3)+3600),{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:i}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-i),totalAttempts:i}}async lockAccount(e,t){let r=this.lockKey(e),o=Date.now(),i=t||this.config.lockDuration,n=new Date(o+i),a=this.redis.pipeline();a.hset(r,{attempts:this.config.maxAttempts.toString(),lockedAt:o.toString(),lockedUntil:n.getTime().toString()}),a.expire(r,Math.ceil(i/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(i=>new Date(parseInt(i,10)))}async getLockoutStats(e){let t=this.historyKey(e),r=await this.redis.lrange(t,0,-1),o=r.filter((n,a)=>(a+1)%this.config.maxAttempts===0).length,i=await this.redis.hget(this.lockKey(e),"lockedAt");return {totalFailedAttempts:r.length,lockoutCount:o,lastLockout:i?new Date(parseInt(i,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 kr={"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}},S=class{redis;prefix;limits;userLimits;constructor(e,t,r,o="kyro:ratelimit:"){this.redis=e,this.prefix=o,this.limits={...kr,...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),i=Date.now(),n=i-r.window,a=this.redis.pipeline();a.zremrangebyscore(o,0,n),a.zcard(o),a.zadd(o,i,`${i}:${Math.random()}`),a.expire(o,Math.ceil(r.window/1e3)+1);let c=(await a.exec())?.[1]?.[1]||0;if(c>=r.max){let g=await this.redis.zrange(o,0,0,"WITHSCORES"),d=g.length>1?parseInt(g[1],10)+r.window:i+r.window;return {allowed:false,remaining:0,resetAt:d,retryAfter:Math.ceil((d-i)/1e3)}}return {allowed:true,remaining:r.max-c-1,resetAt:i+r.window}}async checkUser(e,t,r){let o=this.userLimits[e]||this.userLimits["user:api"],i=this.getKey(`user:${e}:${t}`,r),n=Date.now(),a=n-o.window,l=this.redis.pipeline();l.zremrangebyscore(i,0,a),l.zcard(i),l.zadd(i,n,`${n}:${Math.random()}`),l.expire(i,Math.ceil(o.window/1e3)+1);let g=(await l.exec())?.[1]?.[1]||0;if(g>=o.max){let d=await this.redis.zrange(i,0,0,"WITHSCORES"),u=d.length>1?parseInt(d[1],10)+o.window:n+o.window;return {allowed:false,remaining:0,resetAt:u,retryAfter:Math.ceil((u-n)/1e3)}}return {allowed:true,remaining:o.max-g-1,resetAt:n+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),i=Date.now(),n=i-r.window;await this.redis.zremrangebyscore(o,0,n);let a=await this.redis.zcard(o);return {count:a,limit:r.max,remaining:Math.max(0,r.max-a),resetAt:i+r.window}}setLimit(e,t){this.limits[e]=t;}setUserLimit(e,t){this.userLimits[e]=t;}};var P=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),i={id:t,email:e.email.toLowerCase(),passwordHash:o,role:e.role||"customer",tenantId:e.tenantId,createdAt:r,updatedAt:r};return this.users.set(t,i),this.emailToUserId.set(e.email.toLowerCase(),t),this.passwordHistory.set(t,[]),i}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"),i=randomBytes(32).toString("base64url"),n=new Date,a={id:r,userId:e,token:o,refreshToken:i,expiresAt:new Date(n.getTime()+86400*1e3).toISOString(),createdAt:n.toISOString(),ipAddress:t.ipAddress,userAgent:t.userAgent};return this.sessions.set(r,a),this.refreshTokens.set(i,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),i=(await import('bcryptjs')).default;for(let n of o)if(await i.compare(e,n))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(i=>i.userId===e.userId)),e.action&&(Array.isArray(e.action)?o=o.filter(i=>e.action.includes(String(i.action))):o=o.filter(i=>i.action===e.action)),e.resource&&(o=o.filter(i=>i.resource===e.resource)),e.success!==void 0&&(o=o.filter(i=>i.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 C=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:i}=r;return i!==null&&i>t?{locked:true,attemptsRemaining:0,lockedUntil:new Date(i),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 i=new Date(t+this.config.lockDuration);return r.lockedAt=t,r.lockedUntil=i.getTime(),this.storage.set(e,r),{locked:true,attemptsRemaining:0,lockedUntil:i,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,i=new Date(r+o),n=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};n.attempts=this.config.maxAttempts,n.lockedAt=r,n.lockedUntil=i.getTime(),this.storage.set(e,n);}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),i=null,n=this.storage.get(e);n&&n.lockedAt!==null&&(i=new Date(n.lockedAt));let a=o>0?this.config.maxAttempts:0;return {totalFailedAttempts:r,lockoutCount:o,lastLockout:i,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 p(s,e=0){let t=process.env[s];return t?parseInt(t,10):e}function Le(){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 Pr(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$1({path:h("KYRO_AUTH_DB_PATH",r)});case "postgres":{try{let o=h("DATABASE_URL","");if(o){let{drizzle:i}=await import('drizzle-orm/postgres-js'),a=(await import('postgres')).default(o,{onnotice:()=>{}}),l=i(a);return new a$2({db:l})}}catch{console.warn("[Auth] Could not create PostgresAuthAdapter, falling back to SQLite auth adapter.");}return new a$1({path:h("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{try{let o=h("MONGODB_URI","");if(o){let{MongoClient:i}=await import('mongodb'),n=new i(o);await n.connect();let l=new URL(o).pathname.replace(/^\//,"")||"kyro_cms",c=n.db(l);return new a({db:c})}}catch{console.warn("[Auth] Could not create MongoDBAuthAdapter, falling back to SQLite auth adapter.");}return new a$1({path:h("KYRO_AUTH_DB_PATH",r)})}default:return new P}}async function W(s,e){let t=A("KYRO_DISTRIBUTED",false),r;if(t){let{RedisAuthAdapter:d}=await import('./redis-adapter-VAXP43GR.js'),u=h("REDIS_URL","redis://localhost:6379"),y=A("REDIS_TLS",false),f=new d({url:u,tls:y});await f.connect?.(),r=f;}else {let d=s||Le();r=await Pr(d),r.connect&&await r.connect();}let o=e?await b$1.fromConfig(e).catch(()=>null)||b$1.fromEnv()||void 0:b$1.fromEnv()||void 0,i=new c({minLength:p("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:p("PASSWORD_PREVENT_REUSE",5),maxLength:p("PASSWORD_MAX_LENGTH",128)}),n$1,a,l;if(t){let u=r.redis;n$1=new x(u,{maxAttempts:p("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:p("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new S(u,{"auth:login":{window:p("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:p("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:p("RATE_LIMIT_WINDOW_MS",6e4),max:p("RATE_LIMIT_MAX_REQUESTS",100)}}),l=new n(u,p("AUDIT_LOG_RETENTION_DAYS",30));}else n$1=new C({maxAttempts:p("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:p("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new m({"auth:login":{window:p("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:p("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:p("RATE_LIMIT_WINDOW_MS",6e4),max:p("RATE_LIMIT_MAX_REQUESTS",100)}}),l=A("AUDIT_LOG_ENABLED",true)?new p$1(p("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let c$1=new q({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:i,lockout:n$1,rateLimiter:a,auditLogger:l,baseUrl:h("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:A("EMAIL_VERIFICATION_REQUIRED",true)}),g=t?"distributed":s||Le();return {authAdapter:r,databaseType:g,email:o,passwordPolicy:i,lockout:n$1,rateLimiter:a,auditLogger:l,routes:c$1}}var Ue=W().catch(s=>(console.warn("[AuthConfig] Failed to initialize auth config:",s.message),null));var Cr=12,Tr="24h",vr="7d",H=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??Tr,refreshExpiresIn:t.refreshExpiresIn??vr,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??Cr};}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 Rr(s,e){return new H(s,e)}function _(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var M=class{adapter;config;constructor(e,t){this.adapter=e,this.config={..._(),...t};}async createVersion(e){let r=((await this.adapter.getLatestVersion(e.collection,e.documentId))?.version??0)+1,o={...e,version:r},i=await this.adapter.createVersion(o);return this.config.maxVersionsPerDocument>0&&await this.pruneOldVersions(e.collection,e.documentId),i}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 i=r.slice(this.config.maxVersionsPerDocument);for(let n of i)if(n.status!=="published"){await this.adapter.deleteVersions(e,t);break}}};function Dr(s,e){return new M(s,e)}function Ir(s){return s==="published"}function Lr(s){return s==="draft"}function Er(s){return s==="archived"}function Ur(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Vr(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Ve(s){return {collections:Ur(s.collections),globals:Vr(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 Or=Ve;function Hr(s){let{siteSettings:e,seoSettings:t,title:r,description:o,image:i,url:n}=s;if(!e)return "";let a=e.siteName||"",l=r||t?.defaultTitle||a,c=t?.titleTemplate,g=t?.separator||" | ",d=t?.siteNameInTitle!==false,u=c?c.replace(/\{\{title\}\}/g,l).replace(/\{\{siteName\}\}/g,d?a:"").replace(/\{\{separator\}\}/g,g).replace(/\s+/g," ").trim():l,y=o||t?.defaultDescription||e.siteDescription||"",f=i||e.siteOgImage?.url||"",F=n||e.siteUrl||"",m=`
2
- <title>${u}</title>
1
+ export{a as RedisAuthAdapter}from'./chunk-O7LK4FCW.js';export{T as allSettingsGlobals,c as blogCollections,d as blogGlobals,U as coreSettingsGlobals,Y as createTemplateConfig,e as ecommerceCollections,f as ecommerceGlobals,g as kitchenSinkCollections,i as mediaCollections,a as minimalCollections,X as templateCollections}from'./chunk-K7HTTXT2.js';export{a as kyro}from'./chunk-PTS33SK5.js';export{a as ConfigValidationError,p as Kyro,r as LocalAdapter,l as Registry,h as collectionToCreateZod,i as collectionToUpdateZod,j as collectionToWhereZod,g as collectionToZod,q as createKyro,s as createLocalAdapter,o as createRegistry,f as fieldToZod,m as getRegistry,k as globalToZod,n as resetRegistry,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal}from'./chunk-MXTO6XGD.js';export{d as autoBootstrap,a as bootstrapAdmin,e as bootstrapWithRetry,c as getBootstrapFromEnv}from'./chunk-MSTTFMCM.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-ISCIUG37.js';export{c as buildGraphQLSchema,d as createGraphQLSchema}from'./chunk-PP7W5UKL.js';import {l,n,m,p,q as q$1}from'./chunk-U3N4X3K3.js';export{n as AuditLogger,p as InMemoryAuditLogger,m as InMemoryRateLimiter,r as MediaService,o as createAuditContext,s as createHonoApp,e as createLocalStorage,t as createRESTAPI,i as getAppSecret,j as getEncryptionKey,k as getSessionConfig,h as loadSecrets,d as resolveProvider,g as setDbAdapter}from'./chunk-U3N4X3K3.js';import {b as b$1,c}from'./chunk-7WOX27LK.js';export{a as ConfigService,b as EmailTransport,c as PasswordPolicy}from'./chunk-7WOX27LK.js';import'./chunk-K6WUOU6P.js';import'./chunk-AE6GXUT7.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-I67R6MR5.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-J5SP3Y2H.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-W6P4N3Z7.js';import {a as a$1}from'./chunk-IZCTG4RG.js';export{a as MongoDBAuthAdapter}from'./chunk-IZCTG4RG.js';export{a as AbstractBaseAdapter}from'./chunk-TQNM4C7H.js';import {a}from'./chunk-6SPPR5JZ.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';import Q,{randomBytes}from'crypto';import {readFileSync}from'fs';import Fe,{join,resolve}from'path';export{z}from'zod';import {createStorage}from'unstorage';import zr from'unstorage/drivers/indexedb';import qr from'unstorage/drivers/fs';async function Le(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 Ar(s,e){return Le(s,e)}var b=class{name;version;description;hooks={};collections=[];globals=[];fields=[];extensions={collections:[],globals:[]};adminComponents={};adminStyles=[];serverMiddleware;clientMiddleware;constructor(e){this.name=e;}async init(e){}async beforeInit(e){}async afterInit(e){}getCollections(){return this.collections}getGlobals(){return this.globals}getHooks(){return this.hooks}},z=class{plugins=new Map;hooks=new Map;register(e){if(this.plugins.has(e.name))throw new Error(`Plugin "${e.name}" is already registered`);this.plugins.set(e.name,e);let t=e.getHooks?.()||{};for(let[r,o]of Object.entries(t))if(Array.isArray(o))for(let i of o)this.registerHook(r,i);}unregister(e){let t=this.plugins.get(e);if(!t)return;let r=t.getHooks?.()||{};for(let[o,i]of Object.entries(r))if(Array.isArray(i))for(let n of i)this.unregisterHook(o,n);this.plugins.delete(e);}get(e){return this.plugins.get(e)}getAll(){return Array.from(this.plugins.values())}has(e){return this.plugins.has(e)}registerHook(e,t){this.hooks.has(e)||this.hooks.set(e,[]),this.hooks.get(e).push(t);}unregisterHook(e,t){let r=this.hooks.get(e);if(r){let o=r.indexOf(t);o>-1&&r.splice(o,1);}}async executeHook(e,t){let r=this.hooks.get(e)||[],o=t;for(let i of r)try{let n=await i({...t,data:o});n!==void 0&&(o=n);}catch(n){console.error(`[PluginManager] Error in hook "${e}":`,n);}return o}getAllCollections(){let e=[];for(let t of this.plugins.values()){let r=t.getCollections?.()||[];e.push(...r);}return e}getAllGlobals(){let e=[];for(let t of this.plugins.values()){let r=t.getGlobals?.()||[];e.push(...r);}return e}getAllFields(){let e=[];for(let t of this.plugins.values())e.push(...t.fields);return e}getAdminComponents(){let e={};for(let t of this.plugins.values())Object.assign(e,t.adminComponents);return e}getAdminStyles(){let e=[];for(let t of this.plugins.values())e.push(...t.adminStyles);return e}},L=class extends b{constructor(){super("seo"),this.description="Advanced SEO features including sitemaps, robots.txt, and structured data",this.collections.push({slug:"seo-settings",label:"SEO Settings",fields:[{name:"sitemap",type:"checkbox",label:"Enable Sitemap",defaultValue:true},{name:"robotsTxt",type:"richtext",label:"robots.txt Content"},{name:"canonicalUrl",type:"text",variant:"url",label:"Canonical URL"},{name:"ogImage",type:"text",label:"Default OG Image URL"}]});}},E=class extends b{constructor(){super("analytics"),this.description="Analytics integration for tracking page views and events",this.collections.push({slug:"analytics-events",label:"Analytics Events",fields:[{name:"name",type:"text",required:true},{name:"properties",type:"json",label:"Event Properties"},{name:"timestamp",type:"date",required:true},{name:"userId",type:"text",label:"User ID"},{name:"sessionId",type:"text",label:"Session ID"}]}),this.adminComponents.AnalyticsDashboard={};}},U=class extends b{constructor(){super("comments"),this.description="Commenting system for products and posts",this.collections.push({slug:"comments",label:"Comments",fields:[{name:"content",type:"richtext",required:true},{name:"author",type:"text",required:true},{name:"email",type:"email"},{name:"approved",type:"checkbox",defaultValue:false},{name:"parent",type:"text",label:"Parent Comment ID"},{name:"resourceType",type:"text",required:true},{name:"resourceId",type:"text",required:true}]}),this.adminComponents.CommentModeration={};}},V=class extends b{constructor(){super("reviews"),this.description="Product reviews and ratings",this.collections.push({slug:"reviews",label:"Reviews",fields:[{name:"rating",type:"number",required:true,min:1,max:5},{name:"title",type:"text"},{name:"content",type:"richtext",required:true},{name:"author",type:"relationship",relationTo:"customers"},{name:"product",type:"relationship",relationTo:"products",required:true},{name:"approved",type:"checkbox",defaultValue:false},{name:"verified",type:"checkbox",label:"Verified Purchase"},{name:"helpful",type:"number",label:"Helpful Count",defaultValue:0}]}),this.adminComponents.ReviewModeration={};}},O=class extends b{constructor(){super("wishlist"),this.description="Customer wishlists",this.collections.push({slug:"wishlists",label:"Wishlists",fields:[{name:"customer",type:"relationship",relationTo:"customers",required:true},{name:"name",type:"text",label:"Wishlist Name",defaultValue:"My Wishlist"},{name:"items",type:"blocks",label:"Items",blocks:[{slug:"wishlist-item",label:"Item",fields:[{name:"product",type:"relationship",relationTo:"products"},{name:"quantity",type:"number",defaultValue:1},{name:"addedAt",type:"date"},{name:"priority",type:"select",options:[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"}]}]}]}]});}},wr={SEO:L,Analytics:E,Comments:U,Reviews:V,Wishlist:O};var xr={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3},k=class{redis;prefix;config;constructor(e,t={},r="kyro:lockout:"){this.redis=e,this.prefix=r,this.config={...xr,...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),i=r.lockedUntil?new Date(parseInt(r.lockedUntil,10)):void 0;return i&&i>new Date?{locked:true,attemptsRemaining:0,lockedUntil:i,totalAttempts:o}:i&&i<=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(),i=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),i>=this.config.maxAttempts){let n=new Date(o+this.config.lockDuration);return await this.redis.hset(t,{lockedAt:o.toString(),lockedUntil:n.getTime().toString()}),await this.redis.expire(t,Math.ceil(this.config.lockDuration/1e3)+3600),{locked:true,attemptsRemaining:0,lockedUntil:n,totalAttempts:i}}return {locked:false,attemptsRemaining:Math.max(0,this.config.maxAttempts-i),totalAttempts:i}}async lockAccount(e,t){let r=this.lockKey(e),o=Date.now(),i=t||this.config.lockDuration,n=new Date(o+i),a=this.redis.pipeline();a.hset(r,{attempts:this.config.maxAttempts.toString(),lockedAt:o.toString(),lockedUntil:n.getTime().toString()}),a.expire(r,Math.ceil(i/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(i=>new Date(parseInt(i,10)))}async getLockoutStats(e){let t=this.historyKey(e),r=await this.redis.lrange(t,0,-1),o=r.filter((n,a)=>(a+1)%this.config.maxAttempts===0).length,i=await this.redis.hget(this.lockKey(e),"lockedAt");return {totalFailedAttempts:r.length,lockoutCount:o,lastLockout:i?new Date(parseInt(i,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 kr={"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}},S=class{redis;prefix;limits;userLimits;constructor(e,t,r,o="kyro:ratelimit:"){this.redis=e,this.prefix=o,this.limits={...kr,...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),i=Date.now(),n=i-r.window,a=this.redis.pipeline();a.zremrangebyscore(o,0,n),a.zcard(o),a.zadd(o,i,`${i}:${Math.random()}`),a.expire(o,Math.ceil(r.window/1e3)+1);let c=(await a.exec())?.[1]?.[1]||0;if(c>=r.max){let p=await this.redis.zrange(o,0,0,"WITHSCORES"),u=p.length>1?parseInt(p[1],10)+r.window:i+r.window;return {allowed:false,remaining:0,resetAt:u,retryAfter:Math.ceil((u-i)/1e3)}}return {allowed:true,remaining:r.max-c-1,resetAt:i+r.window}}async checkUser(e,t,r){let o=this.userLimits[e]||this.userLimits["user:api"],i=this.getKey(`user:${e}:${t}`,r),n=Date.now(),a=n-o.window,l=this.redis.pipeline();l.zremrangebyscore(i,0,a),l.zcard(i),l.zadd(i,n,`${n}:${Math.random()}`),l.expire(i,Math.ceil(o.window/1e3)+1);let p=(await l.exec())?.[1]?.[1]||0;if(p>=o.max){let u=await this.redis.zrange(i,0,0,"WITHSCORES"),d=u.length>1?parseInt(u[1],10)+o.window:n+o.window;return {allowed:false,remaining:0,resetAt:d,retryAfter:Math.ceil((d-n)/1e3)}}return {allowed:true,remaining:o.max-p-1,resetAt:n+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),i=Date.now(),n=i-r.window;await this.redis.zremrangebyscore(o,0,n);let a=await this.redis.zcard(o);return {count:a,limit:r.max,remaining:Math.max(0,r.max-a),resetAt:i+r.window}}setLimit(e,t){this.limits[e]=t;}setUserLimit(e,t){this.userLimits[e]=t;}};var P=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),i={id:t,email:e.email.toLowerCase(),passwordHash:o,role:e.role||"customer",tenantId:e.tenantId,createdAt:r,updatedAt:r};return this.users.set(t,i),this.emailToUserId.set(e.email.toLowerCase(),t),this.passwordHistory.set(t,[]),i}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"),i=randomBytes(32).toString("base64url"),n=new Date,a={id:r,userId:e,token:o,refreshToken:i,expiresAt:new Date(n.getTime()+86400*1e3).toISOString(),createdAt:n.toISOString(),ipAddress:t.ipAddress,userAgent:t.userAgent};return this.sessions.set(r,a),this.refreshTokens.set(i,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),i=(await import('bcryptjs')).default;for(let n of o)if(await i.compare(e,n))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(i=>i.userId===e.userId)),e.action&&(Array.isArray(e.action)?o=o.filter(i=>e.action.includes(String(i.action))):o=o.filter(i=>i.action===e.action)),e.resource&&(o=o.filter(i=>i.resource===e.resource)),e.success!==void 0&&(o=o.filter(i=>i.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 C=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:i}=r;return i!==null&&i>t?{locked:true,attemptsRemaining:0,lockedUntil:new Date(i),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 i=new Date(t+this.config.lockDuration);return r.lockedAt=t,r.lockedUntil=i.getTime(),this.storage.set(e,r),{locked:true,attemptsRemaining:0,lockedUntil:i,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,i=new Date(r+o),n=this.storage.get(e)||{attempts:0,lastAttempt:null,lockedAt:null,lockedUntil:null};n.attempts=this.config.maxAttempts,n.lockedAt=r,n.lockedUntil=i.getTime(),this.storage.set(e,n);}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),i=null,n=this.storage.get(e);n&&n.lockedAt!==null&&(i=new Date(n.lockedAt));let a=o>0?this.config.maxAttempts:0;return {totalFailedAttempts:r,lockoutCount:o,lastLockout:i,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 Ee(){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 Cr(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 i,n;try{i=(await import('drizzle-orm/postgres-js')).drizzle,n=await import('postgres');}catch{a(["postgres","drizzle-orm"]),i=(await import('drizzle-orm/postgres-js')).drizzle,n=await import('postgres');}let a$1=n.default(o,{onnotice:()=>{}}),l=i(a$1);return new a$3({db:l})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{let o=h("MONGODB_URI","");if(o){let i;try{i=(await import('mongodb')).MongoClient;}catch{a(["mongodb"]),i=(await import('mongodb')).MongoClient;}let n=new i(o);await n.connect();let l=new URL(o).pathname.replace(/^\//,"")||"kyro_cms",c=n.db(l);return new a$1({db:c})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}default:return new P}}async function W(s,e){let t=A("KYRO_DISTRIBUTED",false),r;if(t){let{RedisAuthAdapter:u}=await import('./redis-adapter-L7BF3GQ5.js'),d=h("REDIS_URL","redis://localhost:6379"),y=A("REDIS_TLS",false),f=new u({url:d,tls:y});await f.connect?.(),r=f;}else {let u=s||Ee();r=await Cr(u),r.connect&&await r.connect();}let o=e?await b$1.fromConfig(e).catch(()=>null)||b$1.fromEnv()||void 0:b$1.fromEnv()||void 0,i=new c({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)}),n$1,a,l;if(t){let d=r.redis;n$1=new k(d,{maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new S(d,{"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)}}),l=new n(d,g("AUDIT_LOG_RETENTION_DAYS",30));}else n$1=new C({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)}}),l=A("AUDIT_LOG_ENABLED",true)?new p(g("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let c$1=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:i,lockout:n$1,rateLimiter:a,auditLogger:l,baseUrl:h("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:A("EMAIL_VERIFICATION_REQUIRED",true)}),p$1=t?"distributed":s||Ee();return {authAdapter:r,databaseType:p$1,email:o,passwordPolicy:i,lockout:n$1,rateLimiter:a,auditLogger:l,routes:c$1}}var Ve=W().catch(s=>(console.warn("[AuthConfig] Failed to initialize auth config:",s.message),null));var Tr=12,vr="24h",Rr="7d",H=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??vr,refreshExpiresIn:t.refreshExpiresIn??Rr,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??Tr};}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 Dr(s,e){return new H(s,e)}function _(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var M=class{adapter;config;constructor(e,t){this.adapter=e,this.config={..._(),...t};}async createVersion(e){let r=((await this.adapter.getLatestVersion(e.collection,e.documentId))?.version??0)+1,o={...e,version:r},i=await this.adapter.createVersion(o);return this.config.maxVersionsPerDocument>0&&await this.pruneOldVersions(e.collection,e.documentId),i}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 i=r.slice(this.config.maxVersionsPerDocument);for(let n of i)if(n.status!=="published"){await this.adapter.deleteVersions(e,t);break}}};function Ir(s,e){return new M(s,e)}function Lr(s){return s==="published"}function Er(s){return s==="draft"}function Ur(s){return s==="archived"}function Vr(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Or(s){return s?Array.isArray(s)?s:Object.values(s):[]}function Oe(s){return {collections:Vr(s.collections),globals:Or(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 Hr=Oe;function _r(s){let{siteSettings:e,seoSettings:t,title:r,description:o,image:i,url:n}=s;if(!e)return "";let a=e.siteName||"",l=r||t?.defaultTitle||a,c=t?.titleTemplate,p=t?.separator||" | ",u=t?.siteNameInTitle!==false,d=c?c.replace(/\{\{title\}\}/g,l).replace(/\{\{siteName\}\}/g,u?a:"").replace(/\{\{separator\}\}/g,p).replace(/\s+/g," ").trim():l,y=o||t?.defaultDescription||e.siteDescription||"",f=i||e.siteOgImage?.url||"",F=n||e.siteUrl||"",m=`
2
+ <title>${d}</title>
3
3
  <meta name="description" content="${y}">
4
4
  `;e.siteFavicon?.url&&(m+=`
5
- <link rel="icon" type="${e.siteFavicon.mimeType||"image/x-icon"}" href="${e.siteFavicon.url}">`);let X=t?.meta?.robots;X&&(m+=`
6
- <meta name="robots" content="${X}">`);let J=t?.meta?.canonicalUrl||F;J&&(m+=`
7
- <link rel="canonical" href="${J}">`);let Be=t?.meta?.ogType||"website";m+=`
8
- <meta property="og:type" content="${Be}">
9
- <meta property="og:title" content="${u}">
5
+ <link rel="icon" type="${e.siteFavicon.mimeType||"image/x-icon"}" href="${e.siteFavicon.url}">`);let J=t?.meta?.robots;J&&(m+=`
6
+ <meta name="robots" content="${J}">`);let Z=t?.meta?.canonicalUrl||F;Z&&(m+=`
7
+ <link rel="canonical" href="${Z}">`);let Ne=t?.meta?.ogType||"website";m+=`
8
+ <meta property="og:type" content="${Ne}">
9
+ <meta property="og:title" content="${d}">
10
10
  <meta property="og:description" content="${y}">
11
11
  <meta property="og:site_name" content="${a}">
12
12
  `,F&&(m+=`
13
13
  <meta property="og:url" content="${F}">`),f&&(m+=`
14
14
  <meta property="og:image" content="${f}">`),t?.social?.fbAppId&&(m+=`
15
- <meta property="fb:app_id" content="${t.social.fbAppId}">`);let Ne=t?.social?.twitterCardType||"summary_large_image";return m+=`
16
- <meta name="twitter:card" content="${Ne}">
17
- <meta name="twitter:title" content="${u}">
15
+ <meta property="fb:app_id" content="${t.social.fbAppId}">`);let Ke=t?.social?.twitterCardType||"summary_large_image";return m+=`
16
+ <meta name="twitter:card" content="${Ke}">
17
+ <meta name="twitter:title" content="${d}">
18
18
  <meta name="twitter:description" content="${y}">
19
19
  `,t?.social?.twitterHandle&&(m+=`
20
20
  <meta name="twitter:site" content="${t.social.twitterHandle}">`),f&&(m+=`
21
21
  <meta name="twitter:image" content="${f}">`),e.enableI18n&&e.i18n?.language&&(m+=`
22
- <meta http-equiv="content-language" content="${e.i18n.language}">`),m}function _r(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}">`),m}function Mr(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,4 +40,4 @@ export{a as RedisAuthAdapter}from'./chunk-AU6IWTBO.js';export{N 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 Mr={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"}},Fr=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function Oe(s){if(!s)return [];let e=s.showAll===true,t=[];for(let r of Fr){let o=s[r];if(!o||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let n=Mr[r];t.push({platform:r,url:o,label:n?.label||r});}return t}async function Br(s,e){try{let t=await s.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return Oe(t)}catch{return []}}function He(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 Nr(s,e){try{let t=await s.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return He(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 Kr(s,e){try{let t=await s.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return _e(t)}catch{return {}}}async function G(s={}){let{namespace:e="kyro",ttl:t}=s,r=createStorage({driver:$r({dbName:"kyro-cms",storeName:e})}),o=e?`${e}:`:"";return {storage:{getItem:async n=>{let a=`${o}${n}`,l=await r.getItem(a);if(l==null)return null;try{let c=JSON.parse(l);return c.expiry&&Date.now()>c.expiry?(await r.removeItem(a),null):c.value}catch{return l}},setItem:async(n,a)=>{let l=`${o}${n}`,c=JSON.stringify(t?{value:a,expiry:Date.now()+t}:{value:a});await r.setItem(l,c);},removeItem:async n=>{await r.removeItem(`${o}${n}`);}},cleanup:async()=>{await r.dispose?.();}}}function z(s){let e=s||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return q$1.createHash("sha256").update(e).digest("hex")}function qr(s,e){let t=q$1.randomBytes(16),r=q$1.createCipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),t),o=r.update(s,"utf8","hex");o+=r.final("hex");let i=r.getAuthTag().toString("hex");return `${t.toString("hex")}:${i}:${o}`}function Qr(s,e){let[t,r,o]=s.split(":"),i=Buffer.from(t,"hex"),n=Buffer.from(r,"hex"),a=q$1.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),i);a.setAuthTag(n);let l=a.update(o,"hex","utf8");return l+=a.final("utf8"),l}async function Q(s={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:o,basePath:i}=s,n=i?Me.join(i,".astro","kyro.json"):Me.join(process.cwd(),".astro","kyro.json"),a=createStorage({driver:zr({base:n})}),l=r?z(o):null,c=e?`${e}:`:"";return {storage:{getItem:async g=>{let d=`${c}${g}`,u=await a.getItem(d);if(u==null)return null;try{let y=l?Qr(u,l):u,f=JSON.parse(y);return f.expiry&&Date.now()>f.expiry?(await a.removeItem(d),null):f.value}catch{return u}},setItem:async(g,d)=>{let u=`${c}${g}`,y=JSON.stringify(t?{value:d,expiry:Date.now()+t}:{value:d});await a.setItem(u,l?qr(y,l):y);},removeItem:async g=>{await a.removeItem(`${c}${g}`);}},cleanup:async()=>{await a.dispose?.();}}}async function Y(s){let{environment:e,adapter:t,connectionString:r,encryption:o}=s,i=process.env.APP_SECRET||process.env.AUTH_SECRET,n={enabled:o?.enabled??true,algorithm:o?.algorithm};return e==="browser"?G({namespace:"kyro"}):Q({namespace:"kyro",encryption:n.enabled,secret:i})}async function Fe(s){let e={...s,encryption:{enabled:true,algorithm:s.encryption?.algorithm}};return Y(e)}l();export{x as AccountLockout,E as AnalyticsPlugin,H as Auth,U as CommentsPlugin,C as InMemoryAccountLockout,P as InMemoryAuthAdapter,b as KyroPlugin,$ as PluginManager,S as RateLimiter,V as ReviewsPlugin,L as SEOPlugin,M as VersionManager,O as WishlistPlugin,Ue as authConfig,Rr as createAuth,W as createAuthConfig,Fe as createAuthStorage,Y as createStorage,Dr as createVersionManager,Ve as defineConfig,Or as defineKyroConfig,_r as generateAnalyticsTags,Hr as generateSeoTags,_ as getDefaultDraftPublishConfig,Kr as getPaymentConfig,_e as getPaymentConfigFromSettings,Br as getSocialLinks,Oe as getSocialLinksFromSettings,Nr as getStoreConfig,He as getStoreConfigFromSettings,Er as isArchived,Lr as isDraft,Ir as isPublished,Ar as presetPlugins,br as runFieldHooks,Ie as runHooks};
43
+ `),o}var Fr={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"}},Br=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function He(s){if(!s)return [];let e=s.showAll===true,t=[];for(let r of Br){let o=s[r];if(!o||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let n=Fr[r];t.push({platform:r,url:o,label:n?.label||r});}return t}async function Nr(s,e){try{let t=await s.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return He(t)}catch{return []}}function _e(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 Kr(s,e){try{let t=await s.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return _e(t)}catch{return {}}}function Me(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 jr(s,e){try{let t=await s.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return Me(t)}catch{return {}}}async function G(s={}){let{namespace:e="kyro",ttl:t}=s,r=createStorage({driver:zr({dbName:"kyro-cms",storeName:e})}),o=e?`${e}:`:"";return {storage:{getItem:async n=>{let a=`${o}${n}`,l=await r.getItem(a);if(l==null)return null;try{let c=JSON.parse(l);return c.expiry&&Date.now()>c.expiry?(await r.removeItem(a),null):c.value}catch{return l}},setItem:async(n,a)=>{let l=`${o}${n}`,c=JSON.stringify(t?{value:a,expiry:Date.now()+t}:{value:a});await r.setItem(l,c);},removeItem:async n=>{await r.removeItem(`${o}${n}`);}},cleanup:async()=>{await r.dispose?.();}}}function q(s){let e=s||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return Q.createHash("sha256").update(e).digest("hex")}function Qr(s,e){let t=Q.randomBytes(16),r=Q.createCipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),t),o=r.update(s,"utf8","hex");o+=r.final("hex");let i=r.getAuthTag().toString("hex");return `${t.toString("hex")}:${i}:${o}`}function Yr(s,e){let[t,r,o]=s.split(":"),i=Buffer.from(t,"hex"),n=Buffer.from(r,"hex"),a=Q.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),i);a.setAuthTag(n);let l=a.update(o,"hex","utf8");return l+=a.final("utf8"),l}async function Y(s={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:o,basePath:i}=s,n=i?Fe.join(i,".astro","kyro.json"):Fe.join(process.cwd(),".astro","kyro.json"),a=createStorage({driver:qr({base:n})}),l=r?q(o):null,c=e?`${e}:`:"";return {storage:{getItem:async p=>{let u=`${c}${p}`,d=await a.getItem(u);if(d==null)return null;try{let y=l?Yr(d,l):d,f=JSON.parse(y);return f.expiry&&Date.now()>f.expiry?(await a.removeItem(u),null):f.value}catch{return d}},setItem:async(p,u)=>{let d=`${c}${p}`,y=JSON.stringify(t?{value:u,expiry:Date.now()+t}:{value:u});await a.setItem(d,l?Qr(y,l):y);},removeItem:async p=>{await a.removeItem(`${c}${p}`);}},cleanup:async()=>{await a.dispose?.();}}}async function X(s){let{environment:e,adapter:t,connectionString:r,encryption:o}=s,i=process.env.APP_SECRET||process.env.AUTH_SECRET,n={enabled:o?.enabled??true,algorithm:o?.algorithm};return e==="browser"?G({namespace:"kyro"}):Y({namespace:"kyro",encryption:n.enabled,secret:i})}async function Be(s){let e={...s,encryption:{enabled:true,algorithm:s.encryption?.algorithm}};return X(e)}l();export{k as AccountLockout,E as AnalyticsPlugin,H as Auth,U as CommentsPlugin,C as InMemoryAccountLockout,P as InMemoryAuthAdapter,b as KyroPlugin,z as PluginManager,S as RateLimiter,V as ReviewsPlugin,L as SEOPlugin,M as VersionManager,O as WishlistPlugin,Ve as authConfig,Dr as createAuth,W as createAuthConfig,Be as createAuthStorage,X as createStorage,Ir as createVersionManager,Oe as defineConfig,Hr as defineKyroConfig,Mr as generateAnalyticsTags,_r as generateSeoTags,_ as getDefaultDraftPublishConfig,jr as getPaymentConfig,Me as getPaymentConfigFromSettings,Nr as getSocialLinks,He as getSocialLinksFromSettings,Kr as getStoreConfig,_e as getStoreConfigFromSettings,Ur as isArchived,Er as isDraft,Lr as isPublished,wr as presetPlugins,Ar as runFieldHooks,Le as runHooks};
@@ -1 +1 @@
1
- 'use strict';var chunkATLSIYRH_cjs=require('./chunk-ATLSIYRH.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkATLSIYRH_cjs.a}});
1
+ 'use strict';var chunkHHH4XNNS_cjs=require('./chunk-HHH4XNNS.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkHHH4XNNS_cjs.a}});
@@ -0,0 +1 @@
1
+ export{a as MongoDBAuthAdapter}from'./chunk-IZCTG4RG.js';import'./chunk-5J6HXUF6.js';
@@ -1 +1 @@
1
- 'use strict';require('../chunk-UBHFUFD4.cjs');var chunkUCCFT5OO_cjs=require('../chunk-UCCFT5OO.cjs'),chunkATLSIYRH_cjs=require('../chunk-ATLSIYRH.cjs');require('../chunk-EJDIR56C.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAdapter",{enumerable:true,get:function(){return chunkUCCFT5OO_cjs.a}});Object.defineProperty(exports,"createMongoDBAdapter",{enumerable:true,get:function(){return chunkUCCFT5OO_cjs.b}});Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkATLSIYRH_cjs.a}});
1
+ 'use strict';var chunkRYIEE2TH_cjs=require('../chunk-RYIEE2TH.cjs'),chunkHHH4XNNS_cjs=require('../chunk-HHH4XNNS.cjs');require('../chunk-EJDIR56C.cjs'),require('../chunk-D5P2IPGX.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"MongoDBAdapter",{enumerable:true,get:function(){return chunkRYIEE2TH_cjs.a}});Object.defineProperty(exports,"createMongoDBAdapter",{enumerable:true,get:function(){return chunkRYIEE2TH_cjs.b}});Object.defineProperty(exports,"MongoDBAuthAdapter",{enumerable:true,get:function(){return chunkHHH4XNNS_cjs.a}});
@@ -1,9 +1,10 @@
1
- import { A as AbstractBaseAdapter } from '../base-CXZxchcr.cjs';
2
- import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from '../types-CqqoM3Dy.cjs';
1
+ import { A as AbstractBaseAdapter } from '../base-Cpu841KI.cjs';
2
+ import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from '../types-DaWvY4Ho.cjs';
3
3
  import { A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, e as AuditLogFilter, d as AuditLog } from '../types-CpjuXbe7.cjs';
4
4
  import '../types-fvldOd92.cjs';
5
5
 
6
6
  declare class MongoDBAdapter extends AbstractBaseAdapter {
7
+ dialect: "mongodb";
7
8
  client: any;
8
9
  db: any;
9
10
  private database;
@@ -60,7 +61,7 @@ declare function createMongoDBAdapter(options: {
60
61
  }): MongoDBAdapter;
61
62
 
62
63
  interface MongoDBAuthAdapterOptions {
63
- db: any;
64
+ db: any | (() => any);
64
65
  collectionPrefix?: string;
65
66
  sessionTTL?: number;
66
67
  refreshTokenTTL?: number;
@@ -72,6 +73,7 @@ declare class MongoDBAuthAdapter implements AuthAdapter {
72
73
  private refreshTokenTTL;
73
74
  private indexesEnsured;
74
75
  constructor(options: MongoDBAuthAdapterOptions);
76
+ private getDatabase;
75
77
  private col;
76
78
  connect(): Promise<void>;
77
79
  disconnect(): Promise<void>;
@@ -1,9 +1,10 @@
1
- import { A as AbstractBaseAdapter } from '../base-CjuIfzH2.js';
2
- import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from '../types-L-qNugRL.js';
1
+ import { A as AbstractBaseAdapter } from '../base-PZTb6vi6.js';
2
+ import { F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from '../types-CbofW-fz.js';
3
3
  import { A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, e as AuditLogFilter, d as AuditLog } from '../types-CpjuXbe7.js';
4
4
  import '../types-fvldOd92.js';
5
5
 
6
6
  declare class MongoDBAdapter extends AbstractBaseAdapter {
7
+ dialect: "mongodb";
7
8
  client: any;
8
9
  db: any;
9
10
  private database;
@@ -60,7 +61,7 @@ declare function createMongoDBAdapter(options: {
60
61
  }): MongoDBAdapter;
61
62
 
62
63
  interface MongoDBAuthAdapterOptions {
63
- db: any;
64
+ db: any | (() => any);
64
65
  collectionPrefix?: string;
65
66
  sessionTTL?: number;
66
67
  refreshTokenTTL?: number;
@@ -72,6 +73,7 @@ declare class MongoDBAuthAdapter implements AuthAdapter {
72
73
  private refreshTokenTTL;
73
74
  private indexesEnsured;
74
75
  constructor(options: MongoDBAuthAdapterOptions);
76
+ private getDatabase;
75
77
  private col;
76
78
  connect(): Promise<void>;
77
79
  disconnect(): Promise<void>;
@@ -1 +1 @@
1
- import'../chunk-QRXDCV6K.js';export{a as MongoDBAdapter,b as createMongoDBAdapter}from'../chunk-YPDRUVWG.js';export{a as MongoDBAuthAdapter}from'../chunk-P7CESLDJ.js';import'../chunk-TQNM4C7H.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
1
+ export{a as MongoDBAdapter,b as createMongoDBAdapter}from'../chunk-W6P4N3Z7.js';export{a as MongoDBAuthAdapter}from'../chunk-IZCTG4RG.js';import'../chunk-TQNM4C7H.js';import'../chunk-6SPPR5JZ.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkMRBBP5MU_cjs=require('./chunk-MRBBP5MU.cjs');require('./chunk-D5P2IPGX.cjs'),require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"RedisAuthAdapter",{enumerable:true,get:function(){return chunkMRBBP5MU_cjs.a}});
@@ -0,0 +1 @@
1
+ export{a as RedisAuthAdapter}from'./chunk-O7LK4FCW.js';import'./chunk-6SPPR5JZ.js';import'./chunk-5J6HXUF6.js';
@@ -1 +1 @@
1
- 'use strict';var chunkUTFLD5DC_cjs=require('../chunk-UTFLD5DC.cjs');require('../chunk-AJAZ7D3W.cjs'),require('../chunk-WIZ6C5QZ.cjs'),require('../chunk-GFU7AOI3.cjs'),require('../chunk-ET6NN2V2.cjs'),require('../chunk-HVXO3OFB.cjs'),require('../chunk-XUONID6O.cjs'),require('../chunk-NY47CFVP.cjs'),require('../chunk-Z7CNY2UV.cjs'),require('../chunk-GYQMNXXW.cjs'),require('../chunk-MIOMMB23.cjs'),require('../chunk-UCCFT5OO.cjs'),require('../chunk-ATLSIYRH.cjs'),require('../chunk-EJDIR56C.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"createHonoApp",{enumerable:true,get:function(){return chunkUTFLD5DC_cjs.s}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkUTFLD5DC_cjs.t}});
1
+ 'use strict';var chunkAZNJI6TP_cjs=require('../chunk-AZNJI6TP.cjs');require('../chunk-AJAZ7D3W.cjs'),require('../chunk-WIZ6C5QZ.cjs'),require('../chunk-GFU7AOI3.cjs'),require('../chunk-HOP4D5XZ.cjs'),require('../chunk-HVXO3OFB.cjs'),require('../chunk-XUONID6O.cjs'),require('../chunk-NY47CFVP.cjs'),require('../chunk-5YW2WHXR.cjs'),require('../chunk-GYQMNXXW.cjs'),require('../chunk-MIOMMB23.cjs'),require('../chunk-HHH4XNNS.cjs'),require('../chunk-EJDIR56C.cjs'),require('../chunk-D5P2IPGX.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"createHonoApp",{enumerable:true,get:function(){return chunkAZNJI6TP_cjs.s}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkAZNJI6TP_cjs.t}});
@@ -1,7 +1,7 @@
1
1
  import { Hono } from 'hono';
2
- import { B as BaseAdapter, i as User } from '../types-CqqoM3Dy.cjs';
3
- import { R as Registry } from '../index-BCUSHYBf.cjs';
4
- import { j as createWebhookService } from '../WebhookService-B15DnDeH.cjs';
2
+ import { B as BaseAdapter, i as User } from '../types-DaWvY4Ho.cjs';
3
+ import { R as Registry } from '../index-DfF-ofSa.cjs';
4
+ import { j as createWebhookService } from '../WebhookService-D_a3FAU4.cjs';
5
5
  import '../types-fvldOd92.cjs';
6
6
  import 'zod';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { Hono } from 'hono';
2
- import { B as BaseAdapter, i as User } from '../types-L-qNugRL.js';
3
- import { R as Registry } from '../index-C7FPi-Fj.js';
4
- import { j as createWebhookService } from '../WebhookService-DJ75IwdZ.js';
2
+ import { B as BaseAdapter, i as User } from '../types-CbofW-fz.js';
3
+ import { R as Registry } from '../index-B7FXGWrZ.js';
4
+ import { j as createWebhookService } from '../WebhookService-Bpi6w1-6.js';
5
5
  import '../types-fvldOd92.js';
6
6
  import 'zod';
7
7
 
@@ -1 +1 @@
1
- export{s as createHonoApp,t as createRESTAPI}from'../chunk-XSGRGUHP.js';import'../chunk-7WOX27LK.js';import'../chunk-K6WUOU6P.js';import'../chunk-AE6GXUT7.js';import'../chunk-2W4FK6CJ.js';import'../chunk-NRLIGDYF.js';import'../chunk-I67R6MR5.js';import'../chunk-HLSB2MCK.js';import'../chunk-3YGGZ2VN.js';import'../chunk-RHCWCG3O.js';import'../chunk-OG7CNQGU.js';import'../chunk-YPDRUVWG.js';import'../chunk-P7CESLDJ.js';import'../chunk-TQNM4C7H.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
1
+ export{s as createHonoApp,t as createRESTAPI}from'../chunk-U3N4X3K3.js';import'../chunk-7WOX27LK.js';import'../chunk-K6WUOU6P.js';import'../chunk-AE6GXUT7.js';import'../chunk-IKOXCJYO.js';import'../chunk-NRLIGDYF.js';import'../chunk-I67R6MR5.js';import'../chunk-HLSB2MCK.js';import'../chunk-J5SP3Y2H.js';import'../chunk-RHCWCG3O.js';import'../chunk-OG7CNQGU.js';import'../chunk-IZCTG4RG.js';import'../chunk-TQNM4C7H.js';import'../chunk-6SPPR5JZ.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
@@ -0,0 +1 @@
1
+ export{a as SQLiteAuthAdapter}from'./chunk-IKOXCJYO.js';import'./chunk-5J6HXUF6.js';
@@ -1 +1 @@
1
- 'use strict';var chunkET6NN2V2_cjs=require('./chunk-ET6NN2V2.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"SQLiteAuthAdapter",{enumerable:true,get:function(){return chunkET6NN2V2_cjs.a}});
1
+ 'use strict';var chunkHOP4D5XZ_cjs=require('./chunk-HOP4D5XZ.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"SQLiteAuthAdapter",{enumerable:true,get:function(){return chunkHOP4D5XZ_cjs.a}});
@@ -1 +1 @@
1
- 'use strict';var chunkRCV2TLOG_cjs=require('../chunk-RCV2TLOG.cjs'),chunk65G73T7Z_cjs=require('../chunk-65G73T7Z.cjs'),chunkGFU7AOI3_cjs=require('../chunk-GFU7AOI3.cjs');require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"accessSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.J}});Object.defineProperty(exports,"allSettingsGlobals",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.N}});Object.defineProperty(exports,"blogCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.c}});Object.defineProperty(exports,"blogGlobals",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.d}});Object.defineProperty(exports,"brandSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.H}});Object.defineProperty(exports,"categoriesCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.p}});Object.defineProperty(exports,"categoriesCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.q}});Object.defineProperty(exports,"coreSettingsGlobals",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.O}});Object.defineProperty(exports,"couponsCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.z}});Object.defineProperty(exports,"couponsCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.A}});Object.defineProperty(exports,"createTemplateConfig",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.S}});Object.defineProperty(exports,"customersCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.v}});Object.defineProperty(exports,"customersCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.w}});Object.defineProperty(exports,"ecommerceCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.e}});Object.defineProperty(exports,"ecommerceGlobals",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.f}});Object.defineProperty(exports,"emailSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.I}});Object.defineProperty(exports,"formEntriesCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.D}});Object.defineProperty(exports,"formEntriesCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.E}});Object.defineProperty(exports,"formsCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.B}});Object.defineProperty(exports,"formsCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.C}});Object.defineProperty(exports,"getSettingsForTemplate",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.Q}});Object.defineProperty(exports,"kitchenSinkCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.g}});Object.defineProperty(exports,"mediaCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.h}});Object.defineProperty(exports,"mediaCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.i}});Object.defineProperty(exports,"menuCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.j}});Object.defineProperty(exports,"menuCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.k}});Object.defineProperty(exports,"minimalCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.a}});Object.defineProperty(exports,"ordersCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.x}});Object.defineProperty(exports,"ordersCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.y}});Object.defineProperty(exports,"pageCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.n}});Object.defineProperty(exports,"pageCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.o}});Object.defineProperty(exports,"paymentSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.L}});Object.defineProperty(exports,"postsCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.l}});Object.defineProperty(exports,"postsCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.m}});Object.defineProperty(exports,"productCategoriesCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.r}});Object.defineProperty(exports,"productCategoriesCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.s}});Object.defineProperty(exports,"productsCollection",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.t}});Object.defineProperty(exports,"productsCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.u}});Object.defineProperty(exports,"seoSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.G}});Object.defineProperty(exports,"settingsBySlug",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.P}});Object.defineProperty(exports,"siteSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.F}});Object.defineProperty(exports,"starterCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.b}});Object.defineProperty(exports,"storeSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.K}});Object.defineProperty(exports,"systemSettingsGlobal",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.M}});Object.defineProperty(exports,"templateCollections",{enumerable:true,get:function(){return chunkRCV2TLOG_cjs.R}});Object.defineProperty(exports,"storageSettingsGlobal",{enumerable:true,get:function(){return chunk65G73T7Z_cjs.a}});Object.defineProperty(exports,"authCollections",{enumerable:true,get:function(){return chunkGFU7AOI3_cjs.b}});
1
+ 'use strict';var chunkYQLXDL4H_cjs=require('../chunk-YQLXDL4H.cjs'),chunk65G73T7Z_cjs=require('../chunk-65G73T7Z.cjs'),chunkGFU7AOI3_cjs=require('../chunk-GFU7AOI3.cjs');require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"accessSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.P}});Object.defineProperty(exports,"allSettingsGlobals",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.T}});Object.defineProperty(exports,"blogCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.c}});Object.defineProperty(exports,"blogGlobals",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.d}});Object.defineProperty(exports,"brandSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.N}});Object.defineProperty(exports,"brandsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.H}});Object.defineProperty(exports,"brandsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.I}});Object.defineProperty(exports,"cartsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.J}});Object.defineProperty(exports,"cartsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.K}});Object.defineProperty(exports,"categoriesCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.p}});Object.defineProperty(exports,"categoriesCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.q}});Object.defineProperty(exports,"coreSettingsGlobals",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.U}});Object.defineProperty(exports,"couponsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.z}});Object.defineProperty(exports,"couponsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.A}});Object.defineProperty(exports,"createTemplateConfig",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.Y}});Object.defineProperty(exports,"customersCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.v}});Object.defineProperty(exports,"customersCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.w}});Object.defineProperty(exports,"ecommerceCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.e}});Object.defineProperty(exports,"ecommerceGlobals",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.f}});Object.defineProperty(exports,"emailSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.O}});Object.defineProperty(exports,"formEntriesCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.D}});Object.defineProperty(exports,"formEntriesCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.E}});Object.defineProperty(exports,"formsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.B}});Object.defineProperty(exports,"formsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.C}});Object.defineProperty(exports,"getSettingsForTemplate",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.W}});Object.defineProperty(exports,"kitchenSinkCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.g}});Object.defineProperty(exports,"mediaCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.h}});Object.defineProperty(exports,"mediaCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.i}});Object.defineProperty(exports,"menuCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.j}});Object.defineProperty(exports,"menuCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.k}});Object.defineProperty(exports,"minimalCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.a}});Object.defineProperty(exports,"ordersCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.x}});Object.defineProperty(exports,"ordersCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.y}});Object.defineProperty(exports,"pageCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.n}});Object.defineProperty(exports,"pageCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.o}});Object.defineProperty(exports,"postsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.l}});Object.defineProperty(exports,"postsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.m}});Object.defineProperty(exports,"productCategoriesCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.r}});Object.defineProperty(exports,"productCategoriesCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.s}});Object.defineProperty(exports,"productsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.t}});Object.defineProperty(exports,"productsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.u}});Object.defineProperty(exports,"reviewsCollection",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.F}});Object.defineProperty(exports,"reviewsCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.G}});Object.defineProperty(exports,"seoSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.M}});Object.defineProperty(exports,"settingsBySlug",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.V}});Object.defineProperty(exports,"shippingSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.R}});Object.defineProperty(exports,"siteSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.L}});Object.defineProperty(exports,"starterCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.b}});Object.defineProperty(exports,"storeSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.Q}});Object.defineProperty(exports,"systemSettingsGlobal",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.S}});Object.defineProperty(exports,"templateCollections",{enumerable:true,get:function(){return chunkYQLXDL4H_cjs.X}});Object.defineProperty(exports,"storageSettingsGlobal",{enumerable:true,get:function(){return chunk65G73T7Z_cjs.a}});Object.defineProperty(exports,"authCollections",{enumerable:true,get:function(){return chunkGFU7AOI3_cjs.b}});
@@ -1,4 +1,4 @@
1
- import { G as GlobalConfig, C as CollectionConfig } from '../types-CqqoM3Dy.cjs';
1
+ import { G as GlobalConfig, C as CollectionConfig } from '../types-DaWvY4Ho.cjs';
2
2
  import '../types-fvldOd92.cjs';
3
3
 
4
4
  declare const minimalCollections: Record<string, any>;
@@ -53,6 +53,15 @@ declare const formsCollections: Record<string, CollectionConfig>;
53
53
  declare const formEntriesCollection: CollectionConfig;
54
54
  declare const formEntriesCollections: Record<string, CollectionConfig>;
55
55
 
56
+ declare const reviewsCollection: CollectionConfig;
57
+ declare const reviewsCollections: Record<string, CollectionConfig>;
58
+
59
+ declare const brandsCollection: CollectionConfig;
60
+ declare const brandsCollections: Record<string, CollectionConfig>;
61
+
62
+ declare const cartsCollection: CollectionConfig;
63
+ declare const cartsCollections: Record<string, CollectionConfig>;
64
+
56
65
  declare const siteSettingsGlobal: GlobalConfig;
57
66
 
58
67
  declare const seoSettingsGlobal: GlobalConfig;
@@ -65,7 +74,7 @@ declare const accessSettingsGlobal: GlobalConfig;
65
74
 
66
75
  declare const storeSettingsGlobal: GlobalConfig;
67
76
 
68
- declare const paymentSettingsGlobal: GlobalConfig;
77
+ declare const shippingSettingsGlobal: GlobalConfig;
69
78
 
70
79
  declare const systemSettingsGlobal: GlobalConfig;
71
80
 
@@ -93,9 +102,9 @@ interface CreateTemplateConfigOptions extends TemplateConfig {
93
102
  collections?: CollectionConfig[];
94
103
  globals?: GlobalConfig[];
95
104
  includeMedia?: boolean;
96
- includeSettings?: "all" | "core" | "site" | "seo" | "social" | "email" | "storage" | "access" | "store" | "payments" | "system" | string[];
105
+ includeSettings?: "all" | "core" | "site" | "seo" | "social" | "email" | "storage" | "access" | "store" | "shipping" | "system" | string[];
97
106
  excludeSettings?: string[];
98
107
  }
99
108
  declare function createTemplateConfig(options: CreateTemplateConfigOptions): TemplateConfig;
100
109
 
101
- export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, 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, paymentSettingsGlobal, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, seoSettingsGlobal, settingsBySlug, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
110
+ export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, brandsCollection, brandsCollections, cartsCollection, cartsCollections, 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,4 +1,4 @@
1
- import { G as GlobalConfig, C as CollectionConfig } from '../types-L-qNugRL.js';
1
+ import { G as GlobalConfig, C as CollectionConfig } from '../types-CbofW-fz.js';
2
2
  import '../types-fvldOd92.js';
3
3
 
4
4
  declare const minimalCollections: Record<string, any>;
@@ -53,6 +53,15 @@ declare const formsCollections: Record<string, CollectionConfig>;
53
53
  declare const formEntriesCollection: CollectionConfig;
54
54
  declare const formEntriesCollections: Record<string, CollectionConfig>;
55
55
 
56
+ declare const reviewsCollection: CollectionConfig;
57
+ declare const reviewsCollections: Record<string, CollectionConfig>;
58
+
59
+ declare const brandsCollection: CollectionConfig;
60
+ declare const brandsCollections: Record<string, CollectionConfig>;
61
+
62
+ declare const cartsCollection: CollectionConfig;
63
+ declare const cartsCollections: Record<string, CollectionConfig>;
64
+
56
65
  declare const siteSettingsGlobal: GlobalConfig;
57
66
 
58
67
  declare const seoSettingsGlobal: GlobalConfig;
@@ -65,7 +74,7 @@ declare const accessSettingsGlobal: GlobalConfig;
65
74
 
66
75
  declare const storeSettingsGlobal: GlobalConfig;
67
76
 
68
- declare const paymentSettingsGlobal: GlobalConfig;
77
+ declare const shippingSettingsGlobal: GlobalConfig;
69
78
 
70
79
  declare const systemSettingsGlobal: GlobalConfig;
71
80
 
@@ -93,9 +102,9 @@ interface CreateTemplateConfigOptions extends TemplateConfig {
93
102
  collections?: CollectionConfig[];
94
103
  globals?: GlobalConfig[];
95
104
  includeMedia?: boolean;
96
- includeSettings?: "all" | "core" | "site" | "seo" | "social" | "email" | "storage" | "access" | "store" | "payments" | "system" | string[];
105
+ includeSettings?: "all" | "core" | "site" | "seo" | "social" | "email" | "storage" | "access" | "store" | "shipping" | "system" | string[];
97
106
  excludeSettings?: string[];
98
107
  }
99
108
  declare function createTemplateConfig(options: CreateTemplateConfigOptions): TemplateConfig;
100
109
 
101
- export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, 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, paymentSettingsGlobal, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, seoSettingsGlobal, settingsBySlug, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
110
+ export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, brandsCollection, brandsCollections, cartsCollection, cartsCollections, 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{J as accessSettingsGlobal,N as allSettingsGlobals,c as blogCollections,d as blogGlobals,H as brandSettingsGlobal,p as categoriesCollection,q as categoriesCollections,O as coreSettingsGlobals,z as couponsCollection,A as couponsCollections,S as createTemplateConfig,v as customersCollection,w as customersCollections,e as ecommerceCollections,f as ecommerceGlobals,I as emailSettingsGlobal,D as formEntriesCollection,E as formEntriesCollections,B as formsCollection,C as formsCollections,Q 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 paymentSettingsGlobal,l as postsCollection,m as postsCollections,r as productCategoriesCollection,s as productCategoriesCollections,t as productsCollection,u as productsCollections,G as seoSettingsGlobal,P as settingsBySlug,F as siteSettingsGlobal,b as starterCollections,K as storeSettingsGlobal,M as systemSettingsGlobal,R as templateCollections}from'../chunk-4RSGPSKQ.js';export{a as storageSettingsGlobal}from'../chunk-NZ35PV5R.js';export{b as authCollections}from'../chunk-AE6GXUT7.js';import'../chunk-5J6HXUF6.js';
1
+ export{P as accessSettingsGlobal,T as allSettingsGlobals,c as blogCollections,d as blogGlobals,N as brandSettingsGlobal,H as brandsCollection,I as brandsCollections,J as cartsCollection,K as cartsCollections,p as categoriesCollection,q as categoriesCollections,U as coreSettingsGlobals,z as couponsCollection,A as couponsCollections,Y as createTemplateConfig,v as customersCollection,w as customersCollections,e as ecommerceCollections,f as ecommerceGlobals,O as emailSettingsGlobal,D as formEntriesCollection,E as formEntriesCollections,B as formsCollection,C as formsCollections,W 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,M as seoSettingsGlobal,V as settingsBySlug,R as shippingSettingsGlobal,L as siteSettingsGlobal,b as starterCollections,Q as storeSettingsGlobal,S as systemSettingsGlobal,X as templateCollections}from'../chunk-K7HTTXT2.js';export{a as storageSettingsGlobal}from'../chunk-NZ35PV5R.js';export{b as authCollections}from'../chunk-AE6GXUT7.js';import'../chunk-5J6HXUF6.js';
@@ -1,5 +1,5 @@
1
- import { B as BaseAdapter, R as Request, i as User, b as FindResult } from '../types-CqqoM3Dy.cjs';
2
- import { j as createWebhookService } from '../WebhookService-B15DnDeH.cjs';
1
+ import { B as BaseAdapter, R as Request, i as User, b as FindResult } from '../types-DaWvY4Ho.cjs';
2
+ import { j as createWebhookService } from '../WebhookService-D_a3FAU4.cjs';
3
3
  import '../types-fvldOd92.cjs';
4
4
 
5
5
  interface ApiKeyContext {
@@ -1,5 +1,5 @@
1
- import { B as BaseAdapter, R as Request, i as User, b as FindResult } from '../types-L-qNugRL.js';
2
- import { j as createWebhookService } from '../WebhookService-DJ75IwdZ.js';
1
+ import { B as BaseAdapter, R as Request, i as User, b as FindResult } from '../types-CbofW-fz.js';
2
+ import { j as createWebhookService } from '../WebhookService-Bpi6w1-6.js';
3
3
  import '../types-fvldOd92.js';
4
4
 
5
5
  interface ApiKeyContext {
@@ -119,6 +119,7 @@ interface AdminConfig {
119
119
  token?: string;
120
120
  }) => string | Promise<string>;
121
121
  disableDuplicate?: boolean;
122
+ disablePreview?: boolean;
122
123
  pagination?: {
123
124
  defaultLimit?: number;
124
125
  limits?: number[];
@@ -119,6 +119,7 @@ interface AdminConfig {
119
119
  token?: string;
120
120
  }) => string | Promise<string>;
121
121
  disableDuplicate?: boolean;
122
+ disablePreview?: boolean;
122
123
  pagination?: {
123
124
  defaultLimit?: number;
124
125
  limits?: number[];