@kyro-cms/core 0.12.6 → 0.12.8

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 (63) hide show
  1. package/dist/{WebhookService-Bpi6w1-6.d.ts → WebhookService-ByrpAI4d.d.ts} +1 -1
  2. package/dist/{WebhookService-D_a3FAU4.d.cts → WebhookService-i-Kl3dvf.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-Cpu841KI.d.cts → base-iyJTfH-3.d.cts} +2 -2
  10. package/dist/{base-PZTb6vi6.d.ts → base-oUSURe4_.d.ts} +2 -2
  11. package/dist/chunk-3RSMK4DA.cjs +2 -0
  12. package/dist/chunk-4JW6IVU5.js +86 -0
  13. package/dist/{chunk-K7HTTXT2.js → chunk-5B7GPMJI.js} +3 -3
  14. package/dist/{chunk-YQLXDL4H.cjs → chunk-EYUT6MOM.cjs} +3 -3
  15. package/dist/chunk-NTZACLOF.js +1 -0
  16. package/dist/chunk-NUUPBDZC.js +21 -0
  17. package/dist/chunk-OTFVOKH3.cjs +21 -0
  18. package/dist/chunk-PFHIBSOU.cjs +86 -0
  19. package/dist/chunk-QOCHBPMK.js +2 -0
  20. package/dist/{chunk-Z7HKM3HT.cjs → chunk-WHK4LW6V.cjs} +1 -1
  21. package/dist/client.cjs +1 -1
  22. package/dist/client.d.cts +2 -2
  23. package/dist/client.d.ts +2 -2
  24. package/dist/client.js +1 -1
  25. package/dist/drizzle/index.d.cts +3 -3
  26. package/dist/drizzle/index.d.ts +3 -3
  27. package/dist/fields/index.d.cts +2 -2
  28. package/dist/fields/index.d.ts +2 -2
  29. package/dist/graphql/index.d.cts +3 -3
  30. package/dist/graphql/index.d.ts +3 -3
  31. package/dist/{index-B7FXGWrZ.d.ts → index-DNy8jbA2.d.cts} +4 -4
  32. package/dist/{index-DfF-ofSa.d.cts → index-DVDMEql7.d.ts} +4 -4
  33. package/dist/index.cjs +14 -14
  34. package/dist/index.d.cts +12 -119
  35. package/dist/index.d.ts +12 -119
  36. package/dist/index.js +14 -14
  37. package/dist/mongodb/index.d.cts +3 -3
  38. package/dist/mongodb/index.d.ts +3 -3
  39. package/dist/redis-adapter-NN3H4GRX.js +1 -0
  40. package/dist/{redis-adapter-CQXIPG7W.cjs → redis-adapter-OUKQGYCH.cjs} +1 -1
  41. package/dist/rest/index.cjs +1 -1
  42. package/dist/rest/index.d.cts +4 -4
  43. package/dist/rest/index.d.ts +4 -4
  44. package/dist/rest/index.js +1 -1
  45. package/dist/templates/index.cjs +1 -1
  46. package/dist/templates/index.d.cts +3 -6
  47. package/dist/templates/index.d.ts +3 -6
  48. package/dist/templates/index.js +1 -1
  49. package/dist/trpc/index.d.cts +3 -3
  50. package/dist/trpc/index.d.ts +3 -3
  51. package/dist/{types-CbofW-fz.d.ts → types-BcZiluXL.d.cts} +115 -14
  52. package/dist/{types-DaWvY4Ho.d.cts → types-Dc8VAPhF.d.ts} +115 -14
  53. package/dist/{types-fvldOd92.d.cts → types-euTszc-1.d.cts} +1 -1
  54. package/dist/{types-fvldOd92.d.ts → types-euTszc-1.d.ts} +1 -1
  55. package/package.json +7 -2
  56. package/dist/chunk-AZNJI6TP.cjs +0 -86
  57. package/dist/chunk-GDOPX6VS.cjs +0 -21
  58. package/dist/chunk-KSWT2Q5T.js +0 -1
  59. package/dist/chunk-MRBBP5MU.cjs +0 -2
  60. package/dist/chunk-MXTO6XGD.js +0 -21
  61. package/dist/chunk-O7LK4FCW.js +0 -2
  62. package/dist/chunk-U3N4X3K3.js +0 -86
  63. package/dist/redis-adapter-L7BF3GQ5.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  import * as hono from 'hono';
2
2
  import * as hono_types from 'hono/types';
3
- import { S as StorageProvider, R as Registry } from './index-B7FXGWrZ.js';
4
- export { C as ConfigService, E as EmailConfig, a as StorageConfig, c as createRegistry, g as getRegistry, r as resetRegistry, b as resolveProvider } from './index-B7FXGWrZ.js';
5
- import { B as BaseAdapter, K as KyroConfig, i as User, R as Request$1, C as CollectionConfig, G as GlobalConfig, 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, H as Hook } from './types-CbofW-fz.js';
6
- export { j as AccessArgs, k as AccessControl, l as AdapterConfig, A as AdminConfig, a as AuthConfig, m as CollectionAccess, n as CollectionHooks, o as CreateResult, p as FieldAccess, q as FieldHooks, r as GlobalAccess, s as GlobalHooks, t as HookArgs, I as ImageSize, P as PluginConfig, U as UploadConfig, V as VersionConfig, W as WhereClause, u as evaluateAccess, v as getWhereClause, w as mergeWhereClauses, x as runFieldHooks, y as runHooks } from './types-CbofW-fz.js';
3
+ import { S as StorageProvider, R as Registry } from './index-DVDMEql7.js';
4
+ export { C as ConfigService, E as EmailConfig, a as StorageConfig, c as createRegistry, g as getRegistry, r as resetRegistry, b as resolveProvider } from './index-DVDMEql7.js';
5
+ import { B as BaseAdapter, P as PluginManager, K as KyroConfig, j as User, R as Request$1, C as CollectionConfig, G as GlobalConfig, 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-Dc8VAPhF.js';
6
+ export { k as AccessArgs, l as AccessControl, m as AdapterConfig, A as AdminConfig, n as AnalyticsPlugin, a as AuthConfig, o as CollectionAccess, p as CollectionHooks, q as CommentsPlugin, r as CreateResult, s as FieldAccess, t as FieldHooks, u as GlobalAccess, v as GlobalHooks, H as Hook, w as HookArgs, I as ImageSize, i as KyroPlugin, x as PluginAPI, y as PluginHooks, z as ReviewsPlugin, S as SEOPlugin, U as UploadConfig, V as VersionConfig, W as WhereClause, E as WishlistPlugin, J as evaluateAccess, L as getWhereClause, M as mergeWhereClauses, N as presetPlugins, O as runFieldHooks, Q as runHooks } from './types-Dc8VAPhF.js';
7
7
  import { KyroPubSub, KyroWSServer } from './ws/index.js';
8
8
  export { PubSub, createWSServer } from './ws/index.js';
9
- import { W as WebhookPayload, D as DeliveryResult, a as WebhookDelivery, b as WebhookConfig, c as DeliveryOptions, d as WebhookService } from './WebhookService-Bpi6w1-6.js';
10
- export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, e as WEBHOOK_COLLECTION, f as WEBHOOK_DELIVERY_COLLECTION, g as WEBHOOK_EVENTS, h as WebhookEvent, i as WebhookTriggerResult, j as createWebhookService } from './WebhookService-Bpi6w1-6.js';
11
- import { F as Field } from './types-fvldOd92.js';
12
- export { r as ALL_FIELD_TYPES, A as ArrayField, B as BaseField, a as Block, d as BlocksField, u as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, E as EmailField, i as FieldAdmin, j as FieldType, G as GroupField, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, o as SelectField, T as TabsField, p as TextField, q as TextareaField, U as UploadField, V as ValidateOptions, O as isArrayField, Q as isBlocksField, W as isGroupField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from './types-fvldOd92.js';
9
+ import { W as WebhookPayload, D as DeliveryResult, a as WebhookDelivery, b as WebhookConfig, c as DeliveryOptions, d as WebhookService } from './WebhookService-ByrpAI4d.js';
10
+ export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, e as WEBHOOK_COLLECTION, f as WEBHOOK_DELIVERY_COLLECTION, g as WEBHOOK_EVENTS, h as WebhookEvent, i as WebhookTriggerResult, j as createWebhookService } from './WebhookService-ByrpAI4d.js';
11
+ import { F as Field } from './types-euTszc-1.js';
12
+ export { A as ALL_FIELD_TYPES, a as ArrayField, B as BaseField, b as Block, e as BlocksField, v as COMPLEX_FIELD_TYPES, C as CheckboxField, f as CodeField, g as CollapsibleField, h as ColorField, D as DateField, E as EmailField, j as FieldAdmin, k as FieldType, G as GroupField, l as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, m as RelationshipField, n as RichTextBlock, o as RichTextField, p as RowField, q as SelectField, T as TabsField, r as TextField, s as TextareaField, U as UploadField, V as ValidateOptions, O as isArrayField, Q as isBlocksField, W as isGroupField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from './types-euTszc-1.js';
13
13
  import { ZodTypeAny } from 'zod';
14
14
  export { z } from 'zod';
15
15
  export { n as normalizeRichTextValue, r as renderRichText, a as richTextStyles } from './richtext-DrhORshE.js';
16
- import { A as AbstractBaseAdapter } from './base-PZTb6vi6.js';
16
+ import { A as AbstractBaseAdapter } from './base-oUSURe4_.js';
17
17
  import { Dialect } from './drizzle/index.js';
18
18
  export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.js';
19
19
  export { MongoDBAdapter, MongoDBAuthAdapter, createMongoDBAdapter } from './mongodb/index.js';
@@ -76,12 +76,14 @@ declare function createAuditContext(req: Request): {
76
76
  userAgent: string;
77
77
  };
78
78
 
79
+ declare function applyCollectionOverrides(collections: CollectionConfig[], overrides?: Record<string, any>): void;
79
80
  declare class Kyro {
80
81
  registry: Registry;
81
82
  db: BaseAdapter;
82
83
  pubsub: KyroPubSub;
83
84
  webhookService: WebhookService;
84
85
  settings?: Record<string, any>;
86
+ pluginManager: PluginManager;
85
87
  private wsServer?;
86
88
  private config;
87
89
  constructor(config: KyroConfig);
@@ -228,115 +230,6 @@ declare function createLocalAdapter(options?: {
228
230
  path?: string;
229
231
  }): LocalAdapter;
230
232
 
231
- interface PluginHooks {
232
- beforeInit?: Hook[];
233
- afterInit?: Hook[];
234
- beforeRegisterCollections?: Hook[];
235
- afterRegisterCollections?: Hook[];
236
- beforeRegisterGlobals?: Hook[];
237
- afterRegisterGlobals?: Hook[];
238
- beforeServerStart?: Hook[];
239
- afterServerStart?: Hook[];
240
- beforeServerStop?: Hook[];
241
- afterServerStop?: Hook[];
242
- }
243
- interface PluginCollectionExtension {
244
- slug: string;
245
- config: Partial<CollectionConfig>;
246
- }
247
- interface PluginGlobalExtension {
248
- slug: string;
249
- config: Partial<GlobalConfig>;
250
- }
251
- interface PluginFieldExtension {
252
- collectionSlug: string;
253
- field: Field;
254
- }
255
- interface PluginAPI {
256
- registry: {
257
- getCollection: (slug: string) => CollectionConfig | undefined;
258
- getCollections: () => CollectionConfig[];
259
- getGlobal: (slug: string) => GlobalConfig | undefined;
260
- addCollection: (config: CollectionConfig) => void;
261
- addGlobal: (config: GlobalConfig) => void;
262
- extendCollection: (slug: string, extension: Partial<CollectionConfig>) => void;
263
- extendGlobal: (slug: string, extension: Partial<GlobalConfig>) => void;
264
- addField: (collectionSlug: string, field: Field, position?: number) => void;
265
- };
266
- hooks: {
267
- register: (event: string, handler: Hook) => void;
268
- unregister: (event: string, handler: Hook) => void;
269
- };
270
- config: {
271
- get: (key: string) => any;
272
- set: (key: string, value: any) => void;
273
- };
274
- db: any;
275
- }
276
- declare abstract class KyroPlugin {
277
- name: string;
278
- version?: string;
279
- description?: string;
280
- hooks: PluginHooks;
281
- collections: Partial<CollectionConfig>[];
282
- globals: Partial<GlobalConfig>[];
283
- fields: PluginFieldExtension[];
284
- extensions: {
285
- collections: PluginCollectionExtension[];
286
- globals: PluginGlobalExtension[];
287
- };
288
- adminComponents: Record<string, any>;
289
- adminStyles: string[];
290
- serverMiddleware?: (app: any) => void;
291
- clientMiddleware?: (req: any) => any;
292
- constructor(name: string);
293
- init?(api: PluginAPI): Promise<void>;
294
- beforeInit?(api: PluginAPI): Promise<void>;
295
- afterInit?(api: PluginAPI): Promise<void>;
296
- getCollections?(): Partial<CollectionConfig>[];
297
- getGlobals?(): Partial<GlobalConfig>[];
298
- getHooks?(): PluginHooks;
299
- }
300
- declare class PluginManager {
301
- private plugins;
302
- private hooks;
303
- register(plugin: KyroPlugin): void;
304
- unregister(name: string): void;
305
- get(name: string): KyroPlugin | undefined;
306
- getAll(): KyroPlugin[];
307
- has(name: string): boolean;
308
- registerHook(event: string, handler: Hook): void;
309
- unregisterHook(event: string, handler: Hook): void;
310
- executeHook(event: string, args?: any): Promise<any>;
311
- getAllCollections(): Partial<CollectionConfig>[];
312
- getAllGlobals(): Partial<GlobalConfig>[];
313
- getAllFields(): PluginFieldExtension[];
314
- getAdminComponents(): Record<string, any>;
315
- getAdminStyles(): string[];
316
- }
317
- declare class SEOPlugin extends KyroPlugin {
318
- constructor();
319
- }
320
- declare class AnalyticsPlugin extends KyroPlugin {
321
- constructor();
322
- }
323
- declare class CommentsPlugin extends KyroPlugin {
324
- constructor();
325
- }
326
- declare class ReviewsPlugin extends KyroPlugin {
327
- constructor();
328
- }
329
- declare class WishlistPlugin extends KyroPlugin {
330
- constructor();
331
- }
332
- declare const presetPlugins: {
333
- SEO: typeof SEOPlugin;
334
- Analytics: typeof AnalyticsPlugin;
335
- Comments: typeof CommentsPlugin;
336
- Reviews: typeof ReviewsPlugin;
337
- Wishlist: typeof WishlistPlugin;
338
- };
339
-
340
233
  interface RedisAuthAdapterOptions {
341
234
  url?: string;
342
235
  host?: string;
@@ -1350,4 +1243,4 @@ declare function getSessionConfig(): {
1350
1243
  maxSessionsPerUser: number;
1351
1244
  };
1352
1245
 
1353
- export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, DeliveryOptions, DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PaymentConfig, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPlugin, SQLiteAuthAdapter, type SeoTagsOptions, Session, type SocialLink, type StorageAdapter, type StorageOptions, type StoreConfig, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createStorage, createTestPayload, createVersionManager, defineConfig, defineKyroConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getPaymentConfig, getPaymentConfigFromSettings, getSessionConfig, getSocialLinks, getSocialLinksFromSettings, getStoreConfig, getStoreConfigFromSettings, globalToZod, isArchived, isDraft, isPublished, loadSecrets, presetPlugins, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
1246
+ export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, AuditLog, AuditLogFilter, AuditLogger, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, type CompareVersionsOptions, ConfigValidationError, CreateArgs, type CreateStorageResult, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, DeliveryOptions, DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, EmailTransport, type EncryptionConfig, type Environment, Field, FindArgs, FindByIDArgs, FindResult, GlobalConfig, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PaymentConfig, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, SQLiteAuthAdapter, type SeoTagsOptions, Session, type SocialLink, type StorageAdapter, type StorageOptions, type StoreConfig, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WebhookService, applyCollectionOverrides, authConfig, autoBootstrap, bootstrapAdmin, bootstrapWithRetry, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuditContext, createAuth, createAuthConfig, createAuthStorage, createKyro, createLocalAdapter, createLocalStorage, createStorage, createTestPayload, createVersionManager, defineConfig, defineKyroConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateAnalyticsTags, generateSeoTags, generateWebhookSecret, getAppSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, getEncryptionKey, getPaymentConfig, getPaymentConfigFromSettings, getSessionConfig, getSocialLinks, getSocialLinksFromSettings, getStoreConfig, getStoreConfigFromSettings, globalToZod, isArchived, isDraft, isPublished, loadSecrets, setDbAdapter, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
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>
1
+ export{a as RedisAuthAdapter}from'./chunk-QOCHBPMK.js';export{R as allSettingsGlobals,c as blogCollections,d as blogGlobals,S as coreSettingsGlobals,W as createTemplateConfig,e as ecommerceCollections,f as ecommerceGlobals,g as kitchenSinkCollections,i as mediaCollections,a as minimalCollections,V as templateCollections}from'./chunk-5B7GPMJI.js';export{a as kyro}from'./chunk-PTS33SK5.js';export{s as AnalyticsPlugin,t as CommentsPlugin,a as ConfigValidationError,y as Kyro,p as KyroPlugin,A as LocalAdapter,q as PluginManager,l as Registry,u as ReviewsPlugin,r as SEOPlugin,v as WishlistPlugin,x as applyCollectionOverrides,h as collectionToCreateZod,i as collectionToUpdateZod,j as collectionToWhereZod,g as collectionToZod,z as createKyro,B as createLocalAdapter,o as createRegistry,f as fieldToZod,m as getRegistry,k as globalToZod,w as presetPlugins,n as resetRegistry,b as validateCollection,e as validateConfig,d as validateFields,c as validateGlobal}from'./chunk-NUUPBDZC.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}from'./chunk-4JW6IVU5.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-4JW6IVU5.js';import {b,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 K,{randomBytes}from'crypto';import {readFileSync}from'fs';import Ee,{join,resolve}from'path';export{z}from'zod';import {createStorage}from'unstorage';import jr from'unstorage/drivers/indexedb';import Qr from'unstorage/drivers/fs';async function Te(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 Sr(s,e){return Te(s,e)}var kr={maxAttempts:5,lockDuration:9e5,notifyUser:true,notifyAdmin:true,adminNotifyAfter:3},S=class{redis;prefix;config;constructor(e,t={},r="kyro:lockout:"){this.redis=e,this.prefix=r,this.config={...kr,...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 xr={"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}},k=class{redis;prefix;limits;userLimits;constructor(e,t,r,o="kyro:ratelimit:"){this.redis=e,this.prefix=o,this.limits={...xr,...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 l=(await a.exec())?.[1]?.[1]||0;if(l>=r.max){let p=await this.redis.zrange(o,0,0,"WITHSCORES"),d=p.length>1?parseInt(p[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-l-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,c=this.redis.pipeline();c.zremrangebyscore(i,0,a),c.zcard(i),c.zadd(i,n,`${n}:${Math.random()}`),c.expire(i,Math.ceil(o.window/1e3)+1);let p=(await c.exec())?.[1]?.[1]||0;if(p>=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-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 x=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 T=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 Pe(){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:()=>{}}),c=i(a$1);return new a$3({db:c})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}case "mongodb":{let o=h("MONGODB_URI","");if(o){let i;try{i=(await import('mongodb')).MongoClient;}catch{a(["mongodb"]),i=(await import('mongodb')).MongoClient;}let n=new i(o);await n.connect();let c=new URL(o).pathname.replace(/^\//,"")||"kyro_cms",l=n.db(c);return new a$1({db:l})}return new a$2({path:h("KYRO_AUTH_DB_PATH",r)})}default:return new x}}async function F(s,e){let t=A("KYRO_DISTRIBUTED",false),r;if(t){let{RedisAuthAdapter:d}=await import('./redis-adapter-NN3H4GRX.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||Pe();r=await Cr(d),r.connect&&await r.connect();}let o=e?await b.fromConfig(e).catch(()=>null)||b.fromEnv()||void 0:b.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,c$1;if(t){let u=r.redis;n$1=new S(u,{maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new k(u,{"auth:login":{window:g("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:g("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:g("RATE_LIMIT_WINDOW_MS",6e4),max:g("RATE_LIMIT_MAX_REQUESTS",100)}}),c$1=new n(u,g("AUDIT_LOG_RETENTION_DAYS",30));}else n$1=new T({maxAttempts:g("LOCKOUT_MAX_ATTEMPTS",5),lockDuration:g("LOCKOUT_DURATION_MINUTES",15)*60*1e3}),a=new m({"auth:login":{window:g("RATE_LIMIT_AUTH_WINDOW_MS",9e5),max:g("RATE_LIMIT_AUTH_MAX_REQUESTS",10)},"api:general":{window:g("RATE_LIMIT_WINDOW_MS",6e4),max:g("RATE_LIMIT_MAX_REQUESTS",100)}}),c$1=A("AUDIT_LOG_ENABLED",true)?new p(g("AUDIT_LOG_RETENTION_DAYS",30)):void 0;let l=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:c$1,baseUrl:h("EMAIL_BASE_URL","http://localhost:4321"),emailVerificationRequired:A("EMAIL_VERIFICATION_REQUIRED",true)}),p$1=t?"distributed":s||Pe();return {authAdapter:r,databaseType:p$1,email:o,passwordPolicy:i,lockout:n$1,rateLimiter:a,auditLogger:c$1,routes:l}}var Re=F().catch(s=>(console.warn("[AuthConfig] Failed to initialize auth config:",s.message),null));var Rr=12,Dr="24h",vr="7d",L=class{adapter;config;constructor(e,t){this.adapter=e,this.config={secret:t.secret,expiresIn:t.expiresIn??Dr,refreshExpiresIn:t.refreshExpiresIn??vr,issuer:t.issuer??"kyro-cms",audience:t.audience??[],saltRounds:t.saltRounds??Rr};}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 Lr(s,e){return new L(s,e)}function I(){return {enabled:true,draftsEnabled:true,publishEnabled:true,scheduleEnabled:false,versioningEnabled:true,maxVersionsPerDocument:50,autoPublish:false,requirePublishPermission:true}}var E=class{adapter;config;constructor(e,t){this.adapter=e,this.config={...I(),...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 E(s,e)}function Er(s){return s==="published"}function Ur(s){return s==="draft"}function Vr(s){return s==="archived"}function Or(s){return s?Array.isArray(s)?s:Object.values(s):[]}function _r(s){return s?Array.isArray(s)?s:Object.values(s):[]}function De(s){return {collections:Or(s.collections),globals:_r(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 Mr=De;function Hr(s){let{siteSettings:e,seoSettings:t,title:r,description:o,image:i,url:n}=s;if(!e)return "";let a=e.siteName||"",c=r||t?.defaultTitle||a,l=t?.titleTemplate,p=t?.separator||" | ",d=t?.siteNameInTitle!==false,u=l?l.replace(/\{\{title\}\}/g,c).replace(/\{\{siteName\}\}/g,d?a:"").replace(/\{\{separator\}\}/g,p).replace(/\s+/g," ").trim():c,y=o||t?.defaultDescription||e.siteDescription||"",f=i||e.siteOgImage?.url||"",U=n||e.siteUrl||"",m=`
2
+ <title>${u}</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 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}">
5
+ <link rel="icon" type="${e.siteFavicon.mimeType||"image/x-icon"}" href="${e.siteFavicon.url}">`);let W=t?.meta?.robots;W&&(m+=`
6
+ <meta name="robots" content="${W}">`);let j=t?.meta?.canonicalUrl||U;j&&(m+=`
7
+ <link rel="canonical" href="${j}">`);let Ve=t?.meta?.ogType||"website";m+=`
8
+ <meta property="og:type" content="${Ve}">
9
+ <meta property="og:title" content="${u}">
10
10
  <meta property="og:description" content="${y}">
11
11
  <meta property="og:site_name" content="${a}">
12
- `,F&&(m+=`
13
- <meta property="og:url" content="${F}">`),f&&(m+=`
12
+ `,U&&(m+=`
13
+ <meta property="og:url" content="${U}">`),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 Ke=t?.social?.twitterCardType||"summary_large_image";return m+=`
16
- <meta name="twitter:card" content="${Ke}">
17
- <meta name="twitter:title" content="${d}">
15
+ <meta property="fb:app_id" content="${t.social.fbAppId}">`);let Oe=t?.social?.twitterCardType||"summary_large_image";return m+=`
16
+ <meta name="twitter:card" content="${Oe}">
17
+ <meta name="twitter:title" content="${u}">
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 Mr(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 Fr(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-O7LK4FCW.js';export{T 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 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};
43
+ `),o}var Br={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"}},Nr=["facebook","twitter","instagram","linkedin","youtube","tiktok","pinterest","discord","twitch","github","mastodon"];function ve(s){if(!s)return [];let e=s.showAll===true,t=[];for(let r of Nr){let o=s[r];if(!o||["tiktok","pinterest","discord","twitch","github","mastodon"].includes(r)&&!e)continue;let n=Br[r];t.push({platform:r,url:o,label:n?.label||r});}return t}async function Kr(s,e){try{let t=await s.findOne({collection:"_globals_social-settings",where:{},draft:e?.draft??!1});return ve(t)}catch{return []}}function Le(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 zr(s,e){try{let t=await s.findOne({collection:"_globals_store-settings",where:{},draft:e?.draft??!1});return Le(t)}catch{return {}}}function Ie(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 $r(s,e){try{let t=await s.findOne({collection:"_globals_payment-settings",where:{},draft:e?.draft??!1});return Ie(t)}catch{return {}}}async function B(s={}){let{namespace:e="kyro",ttl:t}=s,r=createStorage({driver:jr({dbName:"kyro-cms",storeName:e})}),o=e?`${e}:`:"";return {storage:{getItem:async n=>{let a=`${o}${n}`,c=await r.getItem(a);if(c==null)return null;try{let l=JSON.parse(c);return l.expiry&&Date.now()>l.expiry?(await r.removeItem(a),null):l.value}catch{return c}},setItem:async(n,a)=>{let c=`${o}${n}`,l=JSON.stringify(t?{value:a,expiry:Date.now()+t}:{value:a});await r.setItem(c,l);},removeItem:async n=>{await r.removeItem(`${o}${n}`);}},cleanup:async()=>{await r.dispose?.();}}}function N(s){let e=s||process.env.APP_SECRET||process.env.AUTH_SECRET||"development-secret-key";return K.createHash("sha256").update(e).digest("hex")}function Yr(s,e){let t=K.randomBytes(16),r=K.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 Xr(s,e){let[t,r,o]=s.split(":"),i=Buffer.from(t,"hex"),n=Buffer.from(r,"hex"),a=K.createDecipheriv("aes-256-gcm",Buffer.from(e,"hex").subarray(0,32),i);a.setAuthTag(n);let c=a.update(o,"hex","utf8");return c+=a.final("utf8"),c}async function z(s={}){let{namespace:e="kyro",ttl:t,encryption:r=true,secret:o,basePath:i}=s,n=i?Ee.join(i,".astro","kyro.json"):Ee.join(process.cwd(),".astro","kyro.json"),a=createStorage({driver:Qr({base:n})}),c=r?N(o):null,l=e?`${e}:`:"";return {storage:{getItem:async p=>{let d=`${l}${p}`,u=await a.getItem(d);if(u==null)return null;try{let y=c?Xr(u,c):u,f=JSON.parse(y);return f.expiry&&Date.now()>f.expiry?(await a.removeItem(d),null):f.value}catch{return u}},setItem:async(p,d)=>{let u=`${l}${p}`,y=JSON.stringify(t?{value:d,expiry:Date.now()+t}:{value:d});await a.setItem(u,c?Yr(y,c):y);},removeItem:async p=>{await a.removeItem(`${l}${p}`);}},cleanup:async()=>{await a.dispose?.();}}}async function $(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"?B({namespace:"kyro"}):z({namespace:"kyro",encryption:n.enabled,secret:i})}async function Ue(s){let e={...s,encryption:{enabled:true,algorithm:s.encryption?.algorithm}};return $(e)}l();export{S as AccountLockout,L as Auth,T as InMemoryAccountLockout,x as InMemoryAuthAdapter,k as RateLimiter,E as VersionManager,Re as authConfig,Lr as createAuth,F as createAuthConfig,Ue as createAuthStorage,$ as createStorage,Ir as createVersionManager,De as defineConfig,Mr as defineKyroConfig,Fr as generateAnalyticsTags,Hr as generateSeoTags,I as getDefaultDraftPublishConfig,$r as getPaymentConfig,Ie as getPaymentConfigFromSettings,Kr as getSocialLinks,ve as getSocialLinksFromSettings,zr as getStoreConfig,Le as getStoreConfigFromSettings,Vr as isArchived,Ur as isDraft,Er as isPublished,Sr as runFieldHooks,Te as runHooks};
@@ -1,7 +1,7 @@
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';
1
+ import { A as AbstractBaseAdapter } from '../base-iyJTfH-3.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-BcZiluXL.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
- import '../types-fvldOd92.cjs';
4
+ import '../types-euTszc-1.cjs';
5
5
 
6
6
  declare class MongoDBAdapter extends AbstractBaseAdapter {
7
7
  dialect: "mongodb";
@@ -1,7 +1,7 @@
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';
1
+ import { A as AbstractBaseAdapter } from '../base-oUSURe4_.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-Dc8VAPhF.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
- import '../types-fvldOd92.js';
4
+ import '../types-euTszc-1.js';
5
5
 
6
6
  declare class MongoDBAdapter extends AbstractBaseAdapter {
7
7
  dialect: "mongodb";
@@ -0,0 +1 @@
1
+ export{a as RedisAuthAdapter}from'./chunk-QOCHBPMK.js';import'./chunk-6SPPR5JZ.js';import'./chunk-5J6HXUF6.js';
@@ -1 +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}});
1
+ 'use strict';var chunk3RSMK4DA_cjs=require('./chunk-3RSMK4DA.cjs');require('./chunk-D5P2IPGX.cjs'),require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"RedisAuthAdapter",{enumerable:true,get:function(){return chunk3RSMK4DA_cjs.a}});
@@ -1 +1 @@
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
+ 'use strict';var chunkPFHIBSOU_cjs=require('../chunk-PFHIBSOU.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 chunkPFHIBSOU_cjs.s}});Object.defineProperty(exports,"createRESTAPI",{enumerable:true,get:function(){return chunkPFHIBSOU_cjs.t}});
@@ -1,8 +1,8 @@
1
1
  import { Hono } from 'hono';
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
- import '../types-fvldOd92.cjs';
2
+ import { B as BaseAdapter, j as User } from '../types-BcZiluXL.cjs';
3
+ import { R as Registry } from '../index-DNy8jbA2.cjs';
4
+ import { j as createWebhookService } from '../WebhookService-i-Kl3dvf.cjs';
5
+ import '../types-euTszc-1.cjs';
6
6
  import 'zod';
7
7
 
8
8
  interface HonoAppOptions {
@@ -1,8 +1,8 @@
1
1
  import { Hono } from 'hono';
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
- import '../types-fvldOd92.js';
2
+ import { B as BaseAdapter, j as User } from '../types-Dc8VAPhF.js';
3
+ import { R as Registry } from '../index-DVDMEql7.js';
4
+ import { j as createWebhookService } from '../WebhookService-ByrpAI4d.js';
5
+ import '../types-euTszc-1.js';
6
6
  import 'zod';
7
7
 
8
8
  interface HonoAppOptions {
@@ -1 +1 @@
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';
1
+ export{s as createHonoApp,t as createRESTAPI}from'../chunk-4JW6IVU5.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';
@@ -1 +1 @@
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
+ 'use strict';var chunkEYUT6MOM_cjs=require('../chunk-EYUT6MOM.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 chunkEYUT6MOM_cjs.N}});Object.defineProperty(exports,"allSettingsGlobals",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.R}});Object.defineProperty(exports,"blogCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.c}});Object.defineProperty(exports,"blogGlobals",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.d}});Object.defineProperty(exports,"brandSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.L}});Object.defineProperty(exports,"brandsCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.H}});Object.defineProperty(exports,"brandsCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.I}});Object.defineProperty(exports,"categoriesCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.p}});Object.defineProperty(exports,"categoriesCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.q}});Object.defineProperty(exports,"coreSettingsGlobals",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.S}});Object.defineProperty(exports,"couponsCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.z}});Object.defineProperty(exports,"couponsCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.A}});Object.defineProperty(exports,"createTemplateConfig",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.W}});Object.defineProperty(exports,"customersCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.v}});Object.defineProperty(exports,"customersCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.w}});Object.defineProperty(exports,"ecommerceCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.e}});Object.defineProperty(exports,"ecommerceGlobals",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.f}});Object.defineProperty(exports,"emailSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.M}});Object.defineProperty(exports,"formEntriesCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.D}});Object.defineProperty(exports,"formEntriesCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.E}});Object.defineProperty(exports,"formsCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.B}});Object.defineProperty(exports,"formsCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.C}});Object.defineProperty(exports,"getSettingsForTemplate",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.U}});Object.defineProperty(exports,"kitchenSinkCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.g}});Object.defineProperty(exports,"mediaCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.h}});Object.defineProperty(exports,"mediaCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.i}});Object.defineProperty(exports,"menuCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.j}});Object.defineProperty(exports,"menuCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.k}});Object.defineProperty(exports,"minimalCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.a}});Object.defineProperty(exports,"ordersCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.x}});Object.defineProperty(exports,"ordersCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.y}});Object.defineProperty(exports,"pageCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.n}});Object.defineProperty(exports,"pageCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.o}});Object.defineProperty(exports,"postsCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.l}});Object.defineProperty(exports,"postsCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.m}});Object.defineProperty(exports,"productCategoriesCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.r}});Object.defineProperty(exports,"productCategoriesCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.s}});Object.defineProperty(exports,"productsCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.t}});Object.defineProperty(exports,"productsCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.u}});Object.defineProperty(exports,"reviewsCollection",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.F}});Object.defineProperty(exports,"reviewsCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.G}});Object.defineProperty(exports,"seoSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.K}});Object.defineProperty(exports,"settingsBySlug",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.T}});Object.defineProperty(exports,"shippingSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.P}});Object.defineProperty(exports,"siteSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.J}});Object.defineProperty(exports,"starterCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.b}});Object.defineProperty(exports,"storeSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.O}});Object.defineProperty(exports,"systemSettingsGlobal",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.Q}});Object.defineProperty(exports,"templateCollections",{enumerable:true,get:function(){return chunkEYUT6MOM_cjs.V}});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,5 +1,5 @@
1
- import { G as GlobalConfig, C as CollectionConfig } from '../types-DaWvY4Ho.cjs';
2
- import '../types-fvldOd92.cjs';
1
+ import { G as GlobalConfig, C as CollectionConfig } from '../types-BcZiluXL.cjs';
2
+ import '../types-euTszc-1.cjs';
3
3
 
4
4
  declare const minimalCollections: Record<string, any>;
5
5
 
@@ -59,9 +59,6 @@ declare const reviewsCollections: Record<string, CollectionConfig>;
59
59
  declare const brandsCollection: CollectionConfig;
60
60
  declare const brandsCollections: Record<string, CollectionConfig>;
61
61
 
62
- declare const cartsCollection: CollectionConfig;
63
- declare const cartsCollections: Record<string, CollectionConfig>;
64
-
65
62
  declare const siteSettingsGlobal: GlobalConfig;
66
63
 
67
64
  declare const seoSettingsGlobal: GlobalConfig;
@@ -107,4 +104,4 @@ interface CreateTemplateConfigOptions extends TemplateConfig {
107
104
  }
108
105
  declare function createTemplateConfig(options: CreateTemplateConfigOptions): TemplateConfig;
109
106
 
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 };
107
+ export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, brandsCollection, brandsCollections, categoriesCollection, categoriesCollections, coreSettingsGlobals, couponsCollection, couponsCollections, createTemplateConfig, customersCollection, customersCollections, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, formEntriesCollection, formEntriesCollections, formsCollection, formsCollections, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, menuCollection, menuCollections, minimalCollections, ordersCollection, ordersCollections, pageCollection, pageCollections, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, reviewsCollection, reviewsCollections, seoSettingsGlobal, settingsBySlug, shippingSettingsGlobal, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
@@ -1,5 +1,5 @@
1
- import { G as GlobalConfig, C as CollectionConfig } from '../types-CbofW-fz.js';
2
- import '../types-fvldOd92.js';
1
+ import { G as GlobalConfig, C as CollectionConfig } from '../types-Dc8VAPhF.js';
2
+ import '../types-euTszc-1.js';
3
3
 
4
4
  declare const minimalCollections: Record<string, any>;
5
5
 
@@ -59,9 +59,6 @@ declare const reviewsCollections: Record<string, CollectionConfig>;
59
59
  declare const brandsCollection: CollectionConfig;
60
60
  declare const brandsCollections: Record<string, CollectionConfig>;
61
61
 
62
- declare const cartsCollection: CollectionConfig;
63
- declare const cartsCollections: Record<string, CollectionConfig>;
64
-
65
62
  declare const siteSettingsGlobal: GlobalConfig;
66
63
 
67
64
  declare const seoSettingsGlobal: GlobalConfig;
@@ -107,4 +104,4 @@ interface CreateTemplateConfigOptions extends TemplateConfig {
107
104
  }
108
105
  declare function createTemplateConfig(options: CreateTemplateConfigOptions): TemplateConfig;
109
106
 
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 };
107
+ export { type CreateTemplateConfigOptions, type TemplateConfig, type TemplateType, accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, brandSettingsGlobal, brandsCollection, brandsCollections, categoriesCollection, categoriesCollections, coreSettingsGlobals, couponsCollection, couponsCollections, createTemplateConfig, customersCollection, customersCollections, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, formEntriesCollection, formEntriesCollections, formsCollection, formsCollections, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, menuCollection, menuCollections, minimalCollections, ordersCollection, ordersCollections, pageCollection, pageCollections, postsCollection, postsCollections, productCategoriesCollection, productCategoriesCollections, productsCollection, productsCollections, reviewsCollection, reviewsCollections, seoSettingsGlobal, settingsBySlug, shippingSettingsGlobal, siteSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal, templateCollections };
@@ -1 +1 @@
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
+ export{N as accessSettingsGlobal,R as allSettingsGlobals,c as blogCollections,d as blogGlobals,L as brandSettingsGlobal,H as brandsCollection,I as brandsCollections,p as categoriesCollection,q as categoriesCollections,S as coreSettingsGlobals,z as couponsCollection,A as couponsCollections,W as createTemplateConfig,v as customersCollection,w as customersCollections,e as ecommerceCollections,f as ecommerceGlobals,M as emailSettingsGlobal,D as formEntriesCollection,E as formEntriesCollections,B as formsCollection,C as formsCollections,U as getSettingsForTemplate,g as kitchenSinkCollections,h as mediaCollection,i as mediaCollections,j as menuCollection,k as menuCollections,a as minimalCollections,x as ordersCollection,y as ordersCollections,n as pageCollection,o as pageCollections,l as postsCollection,m as postsCollections,r as productCategoriesCollection,s as productCategoriesCollections,t as productsCollection,u as productsCollections,F as reviewsCollection,G as reviewsCollections,K as seoSettingsGlobal,T as settingsBySlug,P as shippingSettingsGlobal,J as siteSettingsGlobal,b as starterCollections,O as storeSettingsGlobal,Q as systemSettingsGlobal,V as templateCollections}from'../chunk-5B7GPMJI.js';export{a as storageSettingsGlobal}from'../chunk-NZ35PV5R.js';export{b as authCollections}from'../chunk-AE6GXUT7.js';import'../chunk-5J6HXUF6.js';
@@ -1,6 +1,6 @@
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
- import '../types-fvldOd92.cjs';
1
+ import { B as BaseAdapter, R as Request, j as User, b as FindResult } from '../types-BcZiluXL.cjs';
2
+ import { j as createWebhookService } from '../WebhookService-i-Kl3dvf.cjs';
3
+ import '../types-euTszc-1.cjs';
4
4
 
5
5
  interface ApiKeyContext {
6
6
  userId: string;
@@ -1,6 +1,6 @@
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
- import '../types-fvldOd92.js';
1
+ import { B as BaseAdapter, R as Request, j as User, b as FindResult } from '../types-Dc8VAPhF.js';
2
+ import { j as createWebhookService } from '../WebhookService-ByrpAI4d.js';
3
+ import '../types-euTszc-1.js';
4
4
 
5
5
  interface ApiKeyContext {
6
6
  userId: string;