@kyro-cms/core 0.1.7 → 0.1.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 (42) hide show
  1. package/README.md +25 -2
  2. package/dist/{WebhookService-BPVJUgTl.d.ts → WebhookService-CXJ5oz6L.d.ts} +1 -1
  3. package/dist/{WebhookService-BCgL1bLF.d.cts → WebhookService-Dqx9Is7m.d.cts} +1 -1
  4. package/dist/{base-DaP-5PPG.d.ts → base-CciYzoDF.d.ts} +1 -1
  5. package/dist/{base-B0Y6isUJ.d.cts → base-Cfek4fp3.d.cts} +1 -1
  6. package/dist/chunk-EWP5AT6A.cjs +268 -0
  7. package/dist/chunk-EWP5AT6A.cjs.map +1 -0
  8. package/dist/chunk-QKOFKITP.js +258 -0
  9. package/dist/chunk-QKOFKITP.js.map +1 -0
  10. package/dist/client.cjs +45 -0
  11. package/dist/client.cjs.map +1 -0
  12. package/dist/client.d.cts +11 -0
  13. package/dist/client.d.ts +11 -0
  14. package/dist/client.js +4 -0
  15. package/dist/client.js.map +1 -0
  16. package/dist/drizzle/index.d.cts +114 -4
  17. package/dist/drizzle/index.d.ts +114 -4
  18. package/dist/graphql/index.d.cts +2 -2
  19. package/dist/graphql/index.d.ts +2 -2
  20. package/dist/{index-DupWTmW6.d.ts → index-BvZ1iWm2.d.ts} +1 -1
  21. package/dist/{index-BwE4NueJ.d.cts → index-CTLPjpMH.d.cts} +1 -1
  22. package/dist/index.cjs +45 -268
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +15 -230
  25. package/dist/index.d.ts +15 -230
  26. package/dist/index.js +13 -260
  27. package/dist/index.js.map +1 -1
  28. package/dist/mongodb/index.d.cts +2 -2
  29. package/dist/mongodb/index.d.ts +2 -2
  30. package/dist/rate-limit-BvUAVCzw.d.cts +223 -0
  31. package/dist/rate-limit-CJnqG1mG.d.ts +223 -0
  32. package/dist/rest/index.d.cts +3 -3
  33. package/dist/rest/index.d.ts +3 -3
  34. package/dist/templates/index.d.cts +1 -1
  35. package/dist/templates/index.d.ts +1 -1
  36. package/dist/trpc/index.d.cts +2 -2
  37. package/dist/trpc/index.d.ts +2 -2
  38. package/dist/{index-DtBi3zP0.d.ts → types-BSR91JFN.d.cts} +1 -112
  39. package/dist/{index-DUKmDSeC.d.cts → types-BSR91JFN.d.ts} +1 -112
  40. package/dist/{types-BM0s_YOy.d.cts → types-Bt1OEk0S.d.cts} +12 -4
  41. package/dist/{types-BM0s_YOy.d.ts → types-Bt1OEk0S.d.ts} +12 -4
  42. package/package.json +9 -2
package/dist/index.d.cts CHANGED
@@ -3,27 +3,31 @@ export { createContext, createCountProcedure, createCreateProcedure, createDelet
3
3
  import * as graphql from 'graphql';
4
4
  import * as hono from 'hono';
5
5
  import * as hono_types from 'hono/types';
6
- import { R as Registry } from './index-BwE4NueJ.cjs';
7
- export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-BwE4NueJ.cjs';
8
- import { B as BaseAdapter, K as KyroConfig, f as User, g as Request$1, C as CollectionConfig, G as GlobalConfig, F as Field, a as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, H as Hook } from './types-BM0s_YOy.cjs';
9
- export { A as ALL_FIELD_TYPES, h as AccessArgs, i as AccessControl, j as AdapterConfig, k as AdminConfig, l as ArrayField, m as AuthConfig, n as BaseField, o as Block, p as BlocksField, q as COMPLEX_FIELD_TYPES, r as CheckboxField, s as CodeField, t as CollapsibleField, u as CollectionAccess, v as CollectionHooks, w as ColorField, x as CreateResult, y as DateField, E as EmailField, z as FieldAccess, I as FieldAdmin, J as FieldHooks, L as FieldType, M as GlobalAccess, N as GlobalHooks, O as GroupField, Q as HookArgs, S as ImageSize, T as JSONField, V as LAYOUT_FIELD_TYPES, W as MarkdownField, X as NumberField, Y as PRIMITIVE_FIELD_TYPES, Z as PasswordField, P as PluginConfig, _ as RELATIONAL_FIELD_TYPES, $ as RadioField, R as RelationshipField, a0 as RichTextBlock, a1 as RichTextField, a2 as RowField, a3 as SelectField, a4 as TabsField, a5 as TextField, a6 as TextareaField, a7 as UploadConfig, e as UploadField, a8 as ValidateOptions, a9 as VersionConfig, aa as WhereClause, ab as evaluateAccess, ac as getWhereClause, ad as isArrayField, ae as isBlocksField, af as isGroupField, ag as isLayoutField, ah as isNumberField, ai as isRelationshipField, aj as isRichTextField, ak as isSelectField, al as isTextField, am as isUploadField, an as mergeWhereClauses, ao as runFieldHooks, ap as runHooks } from './types-BM0s_YOy.cjs';
6
+ import { R as Registry } from './index-CTLPjpMH.cjs';
7
+ export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-CTLPjpMH.cjs';
8
+ import { w as BaseAdapter, K as KyroConfig, Q as User, W as Request$1, i as CollectionConfig, G as GlobalConfig, F as Field, x as FindArgs, y as FindResult, z as FindByIDArgs, H as CreateArgs, L as UpdateArgs, O as DeleteArgs, X as Hook } from './types-Bt1OEk0S.cjs';
9
+ export { Y as ALL_FIELD_TYPES, Z as AccessArgs, _ as AccessControl, $ as AdapterConfig, A as AdminConfig, a as ArrayField, b as AuthConfig, B as BaseField, c as Block, f as BlocksField, a0 as COMPLEX_FIELD_TYPES, C as CheckboxField, g as CodeField, h as CollapsibleField, a1 as CollectionAccess, a2 as CollectionHooks, j as ColorField, a3 as CreateResult, D as DateField, E as EmailField, a4 as FieldAccess, k as FieldAdmin, a5 as FieldHooks, l as FieldType, a6 as GlobalAccess, a7 as GlobalHooks, m as GroupField, a8 as HookArgs, I as ImageField, n as ImageSize, J as JSONField, a9 as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, aa as PRIMITIVE_FIELD_TYPES, P as PasswordField, v as PluginConfig, ab as RELATIONAL_FIELD_TYPES, R as RadioField, o as RelationshipField, p as RichTextBlock, q as RichTextField, r as RowField, S as SelectField, T as TabsField, s as TextField, t as TextareaField, U as UploadConfig, u as UploadField, ac as ValidateOptions, V as VersionConfig, ad as WhereClause, ae as evaluateAccess, af as getWhereClause, ag as isArrayField, ah as isBlocksField, ai as isGroupField, aj as isImageField, ak as isLayoutField, al as isNumberField, am as isRelationshipField, an as isRichTextField, ao as isSelectField, ap as isTextField, aq as isUploadField, ar as mergeWhereClauses, as as runFieldHooks, at as runHooks } from './types-Bt1OEk0S.cjs';
10
10
  import { KyroPubSub, KyroWSServer } from './ws/index.cjs';
11
11
  export { PubSub, createWSServer } from './ws/index.cjs';
12
12
  import { ZodTypeAny } from 'zod';
13
13
  export { z } from 'zod';
14
- import { A as AbstractBaseAdapter } from './base-B0Y6isUJ.cjs';
15
- import { A as AuthAdapter, U as UserRole, a as AuthUser, S as Session, b as AuditLog, c as AuditLogFilter, d as AuthTokenConfig, R as RegisterData, e as AuthResult, L as LoginCredentials, J as JWTPayload, D as Dialect } from './index-DUKmDSeC.cjs';
16
- export { f as AuditAction, g as AuditLogger, h as DrizzleAdapter, P as PostgresAuthAdapter, i as collectionToDrizzleSchema, j as createAuditContext, k as createDatabase, l as createDrizzleAdapter, m as fieldToDrizzleType, r as runMigrations, s as seedDefaultRoles } from './index-DUKmDSeC.cjs';
14
+ import { A as AbstractBaseAdapter } from './base-Cfek4fp3.cjs';
15
+ import { Dialect } from './drizzle/index.cjs';
16
+ export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.cjs';
17
17
  export { MongoDBAdapter, createMongoDBAdapter } from './mongodb/index.cjs';
18
18
  export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.cjs';
19
19
  export { createHonoApp, createRESTAPI } from './rest/index.cjs';
20
+ import { R as RateLimitConfig, b as RateLimitResult, L as LockoutConfig, a as LockoutStatus } from './rate-limit-BvUAVCzw.cjs';
21
+ export { q as AccountLockout, A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, r as RateLimiter, s as RedisAuthAdapter, S as StylingConfig, d as StylingMode, T as ThemeBorderRadius, e as ThemeColors, f as ThemeConfig, g as ThemeFonts, h as ThemeShadows, i as ThemeSpacing, j as createAdminStyling, k as defaultDarkTheme, l as defaultFieldStyling, m as defaultLightTheme, n as ecommerce2026Theme, o as generateCSSVariables, p as generateTailwindConfig } from './rate-limit-BvUAVCzw.cjs';
22
+ import { f as AuthUser, c as AuthAdapter, a as AuditLog, b as AuditLogFilter, U as UserRole, S as Session, e as AuthTokenConfig, R as RegisterData, d as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-BSR91JFN.cjs';
23
+ export { A as AuditAction, g as AuditLogger, h as createAuditContext } from './types-BSR91JFN.cjs';
20
24
  import Database from 'better-sqlite3';
21
- import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-BCgL1bLF.cjs';
22
- export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, c as WEBHOOK_COLLECTION, d as WEBHOOK_DELIVERY_COLLECTION, e as WEBHOOK_EVENTS, f as WebhookEvent, g as WebhookService, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-BCgL1bLF.cjs';
25
+ import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-Dqx9Is7m.cjs';
26
+ export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, c as WEBHOOK_COLLECTION, d as WEBHOOK_DELIVERY_COLLECTION, e as WEBHOOK_EVENTS, f as WebhookEvent, g as WebhookService, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-Dqx9Is7m.cjs';
23
27
  export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.cjs';
24
- import Redis from 'ioredis';
25
28
  import 'ws';
26
29
  import 'drizzle-orm/postgres-js';
30
+ import 'ioredis';
27
31
 
28
32
  interface DeliveryResult {
29
33
  success: boolean;
@@ -302,157 +306,6 @@ declare const presetPlugins: {
302
306
  Wishlist: typeof WishlistPlugin;
303
307
  };
304
308
 
305
- type StylingMode = 'css' | 'tailwind' | 'css-in-js' | 'styled-components' | 'vanilla-extract';
306
- interface StylingConfig {
307
- mode: StylingMode;
308
- theme?: ThemeConfig;
309
- customProperties?: Record<string, string>;
310
- }
311
- interface ThemeConfig {
312
- colors?: ThemeColors;
313
- fonts?: ThemeFonts;
314
- spacing?: ThemeSpacing;
315
- borderRadius?: ThemeBorderRadius;
316
- shadows?: ThemeShadows;
317
- breakpoints?: Record<string, string>;
318
- }
319
- interface ThemeColors {
320
- primary?: string;
321
- secondary?: string;
322
- accent?: string;
323
- background?: string;
324
- surface?: string;
325
- text?: string;
326
- textMuted?: string;
327
- border?: string;
328
- error?: string;
329
- warning?: string;
330
- success?: string;
331
- info?: string;
332
- }
333
- interface ThemeFonts {
334
- sans?: string;
335
- serif?: string;
336
- mono?: string;
337
- }
338
- interface ThemeSpacing {
339
- xs?: string;
340
- sm?: string;
341
- md?: string;
342
- lg?: string;
343
- xl?: string;
344
- '2xl'?: string;
345
- '3xl'?: string;
346
- '4xl'?: string;
347
- }
348
- interface ThemeBorderRadius {
349
- sm?: string;
350
- md?: string;
351
- lg?: string;
352
- xl?: string;
353
- full?: string;
354
- }
355
- interface ThemeShadows {
356
- sm?: string;
357
- md?: string;
358
- lg?: string;
359
- xl?: string;
360
- }
361
- declare class CSSGenerator {
362
- private config;
363
- private css;
364
- constructor(config: StylingConfig);
365
- addRule(selector: string, properties: Record<string, string>): this;
366
- addMediaQuery(breakpoint: string, rules: string[]): this;
367
- generate(): string;
368
- }
369
- declare function generateTailwindConfig(theme: ThemeConfig): Record<string, any>;
370
- declare const defaultLightTheme: ThemeConfig;
371
- declare const defaultDarkTheme: ThemeConfig;
372
- declare const ecommerce2026Theme: ThemeConfig;
373
- declare function generateCSSVariables(theme: ThemeConfig): string;
374
- interface AdminStylingConfig {
375
- mode: StylingMode;
376
- theme?: ThemeConfig;
377
- customStyles?: string;
378
- componentOverrides?: Record<string, Record<string, string>>;
379
- }
380
- declare function createAdminStyling(config: AdminStylingConfig): string;
381
- interface FieldStyling {
382
- wrapper?: Record<string, string>;
383
- label?: Record<string, string>;
384
- input?: Record<string, string>;
385
- error?: Record<string, string>;
386
- description?: Record<string, string>;
387
- }
388
- declare const defaultFieldStyling: Record<string, FieldStyling>;
389
-
390
- interface RedisAuthAdapterOptions {
391
- url?: string;
392
- host?: string;
393
- port?: number;
394
- password?: string;
395
- db?: number;
396
- keyPrefix?: string;
397
- tokenExpiration?: number;
398
- refreshTokenExpiration?: number;
399
- tls?: boolean;
400
- }
401
- declare class RedisAuthAdapter implements AuthAdapter {
402
- private redis;
403
- private prefix;
404
- private tokenExpiration;
405
- private refreshExpiration;
406
- constructor(options?: RedisAuthAdapterOptions);
407
- connect(): Promise<void>;
408
- disconnect(): Promise<void>;
409
- private userKey;
410
- private sessionKey;
411
- private refreshKey;
412
- private userByEmailKey;
413
- private passwordHistoryKey;
414
- createUser(data: {
415
- email: string;
416
- password: string;
417
- role?: UserRole;
418
- tenantId?: string;
419
- }): Promise<AuthUser>;
420
- findUserByEmail(email: string): Promise<AuthUser | null>;
421
- findUserById(userId: string): Promise<AuthUser | null>;
422
- updateUser(userId: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
423
- deleteUser(userId: string): Promise<boolean>;
424
- hashPassword(password: string): Promise<string>;
425
- verifyPassword(email: string, password: string): Promise<AuthUser | null>;
426
- createSession(userId: string, data?: {
427
- ipAddress?: string;
428
- userAgent?: string;
429
- }): Promise<Session>;
430
- findSessionByToken(token: string): Promise<Session | null>;
431
- deleteSession(sessionId: string): Promise<boolean>;
432
- deleteUserSessions(userId: string): Promise<number>;
433
- addPasswordToHistory(userId: string, passwordHash: string): Promise<void>;
434
- getPasswordHistory(userId: string, count?: number): Promise<string[]>;
435
- isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
436
- private userToHash;
437
- private hashToUser;
438
- private sessionToHash;
439
- private hashToSession;
440
- private auditLogKey;
441
- private auditLogIndexKey;
442
- findAuditLogs(filter: {
443
- userId?: string;
444
- action?: string | string[];
445
- resource?: string;
446
- success?: boolean;
447
- limit?: number;
448
- offset?: number;
449
- }): Promise<{
450
- logs: any[];
451
- total: number;
452
- }>;
453
- createAuditLog(data: any): Promise<any>;
454
- }
455
-
456
309
  interface EmailConfig$1 {
457
310
  provider: "smtp" | "resend" | "sendgrid" | "mailgun" | "ses";
458
311
  from: string;
@@ -586,74 +439,6 @@ declare class PasswordPolicy {
586
439
  getConfig(): PasswordPolicyConfig;
587
440
  }
588
441
 
589
- interface LockoutConfig {
590
- maxAttempts: number;
591
- lockDuration: number;
592
- notifyUser: boolean;
593
- notifyAdmin: boolean;
594
- adminNotifyAfter: number;
595
- }
596
- interface LockoutStatus {
597
- locked: boolean;
598
- attemptsRemaining: number;
599
- lockedUntil?: Date;
600
- totalAttempts: number;
601
- }
602
- declare class AccountLockout {
603
- private redis;
604
- private prefix;
605
- private config;
606
- constructor(redis: Redis, config?: Partial<LockoutConfig>, prefix?: string);
607
- private lockKey;
608
- private historyKey;
609
- checkLockout(userId: string): Promise<LockoutStatus>;
610
- recordFailedAttempt(userId: string): Promise<LockoutStatus>;
611
- lockAccount(userId: string, duration?: number): Promise<void>;
612
- unlockAccount(userId: string): Promise<void>;
613
- resetAttempts(userId: string): Promise<void>;
614
- getLockoutHistory(userId: string, limit?: number): Promise<Date[]>;
615
- getLockoutStats(userId: string): Promise<{
616
- totalFailedAttempts: number;
617
- lockoutCount: number;
618
- lastLockout: Date | null;
619
- averageAttemptsBeforeLockout: number;
620
- }>;
621
- shouldNotifyAdmin(currentAttempts: number): boolean;
622
- getConfig(): LockoutConfig;
623
- setConfig(config: Partial<LockoutConfig>): void;
624
- }
625
-
626
- interface RateLimitConfig {
627
- window: number;
628
- max: number;
629
- }
630
- interface RateLimitResult {
631
- allowed: boolean;
632
- remaining: number;
633
- resetAt: number;
634
- retryAfter?: number;
635
- }
636
- declare class RateLimiter {
637
- private redis;
638
- private prefix;
639
- private limits;
640
- private userLimits;
641
- constructor(redis: Redis, limits?: Record<string, RateLimitConfig>, userLimits?: Record<string, RateLimitConfig>, prefix?: string);
642
- private getKey;
643
- check(type: string, identifier: string): Promise<RateLimitResult>;
644
- checkUser(type: string, userId: string, identifier: string): Promise<RateLimitResult>;
645
- reset(type: string, identifier: string): Promise<void>;
646
- resetUser(type: string, userId: string, identifier: string): Promise<void>;
647
- getStatus(type: string, identifier: string): Promise<{
648
- count: number;
649
- limit: number;
650
- remaining: number;
651
- resetAt: number;
652
- }>;
653
- setLimit(type: string, config: RateLimitConfig): void;
654
- setUserLimit(type: string, config: RateLimitConfig): void;
655
- }
656
-
657
442
  declare class InMemoryRateLimiter {
658
443
  private storage;
659
444
  private userStorage;
@@ -1319,4 +1104,4 @@ declare function defineConfig(config: {
1319
1104
  debug?: KyroConfig["debug"];
1320
1105
  }): KyroConfig;
1321
1106
 
1322
- export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, type AdminStylingConfig, AnalyticsPlugin, AuditLog, AuditLogFilter, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CSSGenerator, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, Field, type FieldStyling, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, Session, type StorageConfig, type StylingConfig, type StylingMode, type ThemeBorderRadius, type ThemeColors, type ThemeConfig, type ThemeFonts, type ThemeShadows, type ThemeSpacing, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAdminStyling, createAuth, createAuthConfig, createColumnsNode, createKyro, createLocalAdapter, createLocalStorage, createTestPayload, createVersionManager, defaultDarkTheme, defaultFieldStyling, defaultLightTheme, defineConfig, deliverWebhook, deliverWithRetry, ecommerce2026Theme, fieldToZod, generateCSSVariables, generateTailwindConfig, generateWebhookSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, globalToZod, isArchived, isDraft, isPublished, normalizeRichTextDocument, normalizeRichTextValue, presetPlugins, renderRichText, resolveProvider, richTextStyles, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
1107
+ export { AbstractBaseAdapter, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, 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 PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, Session, type StorageConfig, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuth, createAuthConfig, createColumnsNode, createKyro, createLocalAdapter, createLocalStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateWebhookSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, globalToZod, isArchived, isDraft, isPublished, normalizeRichTextDocument, normalizeRichTextValue, presetPlugins, renderRichText, resolveProvider, richTextStyles, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
package/dist/index.d.ts CHANGED
@@ -3,27 +3,31 @@ export { createContext, createCountProcedure, createCreateProcedure, createDelet
3
3
  import * as graphql from 'graphql';
4
4
  import * as hono from 'hono';
5
5
  import * as hono_types from 'hono/types';
6
- import { R as Registry } from './index-DupWTmW6.js';
7
- export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-DupWTmW6.js';
8
- import { B as BaseAdapter, K as KyroConfig, f as User, g as Request$1, C as CollectionConfig, G as GlobalConfig, F as Field, a as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, H as Hook } from './types-BM0s_YOy.js';
9
- export { A as ALL_FIELD_TYPES, h as AccessArgs, i as AccessControl, j as AdapterConfig, k as AdminConfig, l as ArrayField, m as AuthConfig, n as BaseField, o as Block, p as BlocksField, q as COMPLEX_FIELD_TYPES, r as CheckboxField, s as CodeField, t as CollapsibleField, u as CollectionAccess, v as CollectionHooks, w as ColorField, x as CreateResult, y as DateField, E as EmailField, z as FieldAccess, I as FieldAdmin, J as FieldHooks, L as FieldType, M as GlobalAccess, N as GlobalHooks, O as GroupField, Q as HookArgs, S as ImageSize, T as JSONField, V as LAYOUT_FIELD_TYPES, W as MarkdownField, X as NumberField, Y as PRIMITIVE_FIELD_TYPES, Z as PasswordField, P as PluginConfig, _ as RELATIONAL_FIELD_TYPES, $ as RadioField, R as RelationshipField, a0 as RichTextBlock, a1 as RichTextField, a2 as RowField, a3 as SelectField, a4 as TabsField, a5 as TextField, a6 as TextareaField, a7 as UploadConfig, e as UploadField, a8 as ValidateOptions, a9 as VersionConfig, aa as WhereClause, ab as evaluateAccess, ac as getWhereClause, ad as isArrayField, ae as isBlocksField, af as isGroupField, ag as isLayoutField, ah as isNumberField, ai as isRelationshipField, aj as isRichTextField, ak as isSelectField, al as isTextField, am as isUploadField, an as mergeWhereClauses, ao as runFieldHooks, ap as runHooks } from './types-BM0s_YOy.js';
6
+ import { R as Registry } from './index-BvZ1iWm2.js';
7
+ export { c as createRegistry, g as getRegistry, r as resetRegistry } from './index-BvZ1iWm2.js';
8
+ import { w as BaseAdapter, K as KyroConfig, Q as User, W as Request$1, i as CollectionConfig, G as GlobalConfig, F as Field, x as FindArgs, y as FindResult, z as FindByIDArgs, H as CreateArgs, L as UpdateArgs, O as DeleteArgs, X as Hook } from './types-Bt1OEk0S.js';
9
+ export { Y as ALL_FIELD_TYPES, Z as AccessArgs, _ as AccessControl, $ as AdapterConfig, A as AdminConfig, a as ArrayField, b as AuthConfig, B as BaseField, c as Block, f as BlocksField, a0 as COMPLEX_FIELD_TYPES, C as CheckboxField, g as CodeField, h as CollapsibleField, a1 as CollectionAccess, a2 as CollectionHooks, j as ColorField, a3 as CreateResult, D as DateField, E as EmailField, a4 as FieldAccess, k as FieldAdmin, a5 as FieldHooks, l as FieldType, a6 as GlobalAccess, a7 as GlobalHooks, m as GroupField, a8 as HookArgs, I as ImageField, n as ImageSize, J as JSONField, a9 as LAYOUT_FIELD_TYPES, M as MarkdownField, N as NumberField, aa as PRIMITIVE_FIELD_TYPES, P as PasswordField, v as PluginConfig, ab as RELATIONAL_FIELD_TYPES, R as RadioField, o as RelationshipField, p as RichTextBlock, q as RichTextField, r as RowField, S as SelectField, T as TabsField, s as TextField, t as TextareaField, U as UploadConfig, u as UploadField, ac as ValidateOptions, V as VersionConfig, ad as WhereClause, ae as evaluateAccess, af as getWhereClause, ag as isArrayField, ah as isBlocksField, ai as isGroupField, aj as isImageField, ak as isLayoutField, al as isNumberField, am as isRelationshipField, an as isRichTextField, ao as isSelectField, ap as isTextField, aq as isUploadField, ar as mergeWhereClauses, as as runFieldHooks, at as runHooks } from './types-Bt1OEk0S.js';
10
10
  import { KyroPubSub, KyroWSServer } from './ws/index.js';
11
11
  export { PubSub, createWSServer } from './ws/index.js';
12
12
  import { ZodTypeAny } from 'zod';
13
13
  export { z } from 'zod';
14
- import { A as AbstractBaseAdapter } from './base-DaP-5PPG.js';
15
- import { A as AuthAdapter, U as UserRole, a as AuthUser, S as Session, b as AuditLog, c as AuditLogFilter, d as AuthTokenConfig, R as RegisterData, e as AuthResult, L as LoginCredentials, J as JWTPayload, D as Dialect } from './index-DtBi3zP0.js';
16
- export { f as AuditAction, g as AuditLogger, h as DrizzleAdapter, P as PostgresAuthAdapter, i as collectionToDrizzleSchema, j as createAuditContext, k as createDatabase, l as createDrizzleAdapter, m as fieldToDrizzleType, r as runMigrations, s as seedDefaultRoles } from './index-DtBi3zP0.js';
14
+ import { A as AbstractBaseAdapter } from './base-CciYzoDF.js';
15
+ import { Dialect } from './drizzle/index.js';
16
+ export { DrizzleAdapter, PostgresAuthAdapter, collectionToDrizzleSchema, createDatabase, createDrizzleAdapter, fieldToDrizzleType, runMigrations, seedDefaultRoles } from './drizzle/index.js';
17
17
  export { MongoDBAdapter, createMongoDBAdapter } from './mongodb/index.js';
18
18
  export { buildGraphQLSchema, createGraphQLSchema } from './graphql/index.js';
19
19
  export { createHonoApp, createRESTAPI } from './rest/index.js';
20
+ import { R as RateLimitConfig, b as RateLimitResult, L as LockoutConfig, a as LockoutStatus } from './rate-limit-CJnqG1mG.js';
21
+ export { q as AccountLockout, A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, r as RateLimiter, s as RedisAuthAdapter, S as StylingConfig, d as StylingMode, T as ThemeBorderRadius, e as ThemeColors, f as ThemeConfig, g as ThemeFonts, h as ThemeShadows, i as ThemeSpacing, j as createAdminStyling, k as defaultDarkTheme, l as defaultFieldStyling, m as defaultLightTheme, n as ecommerce2026Theme, o as generateCSSVariables, p as generateTailwindConfig } from './rate-limit-CJnqG1mG.js';
22
+ import { f as AuthUser, c as AuthAdapter, a as AuditLog, b as AuditLogFilter, U as UserRole, S as Session, e as AuthTokenConfig, R as RegisterData, d as AuthResult, L as LoginCredentials, J as JWTPayload } from './types-BSR91JFN.js';
23
+ export { A as AuditAction, g as AuditLogger, h as createAuditContext } from './types-BSR91JFN.js';
20
24
  import Database from 'better-sqlite3';
21
- import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-BPVJUgTl.js';
22
- export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, c as WEBHOOK_COLLECTION, d as WEBHOOK_DELIVERY_COLLECTION, e as WEBHOOK_EVENTS, f as WebhookEvent, g as WebhookService, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-BPVJUgTl.js';
25
+ import { W as WebhookPayload, a as WebhookDelivery, b as WebhookConfig } from './WebhookService-CXJ5oz6L.js';
26
+ export { A as ALL_WEBHOOK_EVENTS, C as CreateWebhookData, U as UpdateWebhookData, c as WEBHOOK_COLLECTION, d as WEBHOOK_DELIVERY_COLLECTION, e as WEBHOOK_EVENTS, f as WebhookEvent, g as WebhookService, h as WebhookTriggerResult, i as createWebhookService } from './WebhookService-CXJ5oz6L.js';
23
27
  export { TemplateConfig, allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './templates/index.js';
24
- import Redis from 'ioredis';
25
28
  import 'ws';
26
29
  import 'drizzle-orm/postgres-js';
30
+ import 'ioredis';
27
31
 
28
32
  interface DeliveryResult {
29
33
  success: boolean;
@@ -302,157 +306,6 @@ declare const presetPlugins: {
302
306
  Wishlist: typeof WishlistPlugin;
303
307
  };
304
308
 
305
- type StylingMode = 'css' | 'tailwind' | 'css-in-js' | 'styled-components' | 'vanilla-extract';
306
- interface StylingConfig {
307
- mode: StylingMode;
308
- theme?: ThemeConfig;
309
- customProperties?: Record<string, string>;
310
- }
311
- interface ThemeConfig {
312
- colors?: ThemeColors;
313
- fonts?: ThemeFonts;
314
- spacing?: ThemeSpacing;
315
- borderRadius?: ThemeBorderRadius;
316
- shadows?: ThemeShadows;
317
- breakpoints?: Record<string, string>;
318
- }
319
- interface ThemeColors {
320
- primary?: string;
321
- secondary?: string;
322
- accent?: string;
323
- background?: string;
324
- surface?: string;
325
- text?: string;
326
- textMuted?: string;
327
- border?: string;
328
- error?: string;
329
- warning?: string;
330
- success?: string;
331
- info?: string;
332
- }
333
- interface ThemeFonts {
334
- sans?: string;
335
- serif?: string;
336
- mono?: string;
337
- }
338
- interface ThemeSpacing {
339
- xs?: string;
340
- sm?: string;
341
- md?: string;
342
- lg?: string;
343
- xl?: string;
344
- '2xl'?: string;
345
- '3xl'?: string;
346
- '4xl'?: string;
347
- }
348
- interface ThemeBorderRadius {
349
- sm?: string;
350
- md?: string;
351
- lg?: string;
352
- xl?: string;
353
- full?: string;
354
- }
355
- interface ThemeShadows {
356
- sm?: string;
357
- md?: string;
358
- lg?: string;
359
- xl?: string;
360
- }
361
- declare class CSSGenerator {
362
- private config;
363
- private css;
364
- constructor(config: StylingConfig);
365
- addRule(selector: string, properties: Record<string, string>): this;
366
- addMediaQuery(breakpoint: string, rules: string[]): this;
367
- generate(): string;
368
- }
369
- declare function generateTailwindConfig(theme: ThemeConfig): Record<string, any>;
370
- declare const defaultLightTheme: ThemeConfig;
371
- declare const defaultDarkTheme: ThemeConfig;
372
- declare const ecommerce2026Theme: ThemeConfig;
373
- declare function generateCSSVariables(theme: ThemeConfig): string;
374
- interface AdminStylingConfig {
375
- mode: StylingMode;
376
- theme?: ThemeConfig;
377
- customStyles?: string;
378
- componentOverrides?: Record<string, Record<string, string>>;
379
- }
380
- declare function createAdminStyling(config: AdminStylingConfig): string;
381
- interface FieldStyling {
382
- wrapper?: Record<string, string>;
383
- label?: Record<string, string>;
384
- input?: Record<string, string>;
385
- error?: Record<string, string>;
386
- description?: Record<string, string>;
387
- }
388
- declare const defaultFieldStyling: Record<string, FieldStyling>;
389
-
390
- interface RedisAuthAdapterOptions {
391
- url?: string;
392
- host?: string;
393
- port?: number;
394
- password?: string;
395
- db?: number;
396
- keyPrefix?: string;
397
- tokenExpiration?: number;
398
- refreshTokenExpiration?: number;
399
- tls?: boolean;
400
- }
401
- declare class RedisAuthAdapter implements AuthAdapter {
402
- private redis;
403
- private prefix;
404
- private tokenExpiration;
405
- private refreshExpiration;
406
- constructor(options?: RedisAuthAdapterOptions);
407
- connect(): Promise<void>;
408
- disconnect(): Promise<void>;
409
- private userKey;
410
- private sessionKey;
411
- private refreshKey;
412
- private userByEmailKey;
413
- private passwordHistoryKey;
414
- createUser(data: {
415
- email: string;
416
- password: string;
417
- role?: UserRole;
418
- tenantId?: string;
419
- }): Promise<AuthUser>;
420
- findUserByEmail(email: string): Promise<AuthUser | null>;
421
- findUserById(userId: string): Promise<AuthUser | null>;
422
- updateUser(userId: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
423
- deleteUser(userId: string): Promise<boolean>;
424
- hashPassword(password: string): Promise<string>;
425
- verifyPassword(email: string, password: string): Promise<AuthUser | null>;
426
- createSession(userId: string, data?: {
427
- ipAddress?: string;
428
- userAgent?: string;
429
- }): Promise<Session>;
430
- findSessionByToken(token: string): Promise<Session | null>;
431
- deleteSession(sessionId: string): Promise<boolean>;
432
- deleteUserSessions(userId: string): Promise<number>;
433
- addPasswordToHistory(userId: string, passwordHash: string): Promise<void>;
434
- getPasswordHistory(userId: string, count?: number): Promise<string[]>;
435
- isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
436
- private userToHash;
437
- private hashToUser;
438
- private sessionToHash;
439
- private hashToSession;
440
- private auditLogKey;
441
- private auditLogIndexKey;
442
- findAuditLogs(filter: {
443
- userId?: string;
444
- action?: string | string[];
445
- resource?: string;
446
- success?: boolean;
447
- limit?: number;
448
- offset?: number;
449
- }): Promise<{
450
- logs: any[];
451
- total: number;
452
- }>;
453
- createAuditLog(data: any): Promise<any>;
454
- }
455
-
456
309
  interface EmailConfig$1 {
457
310
  provider: "smtp" | "resend" | "sendgrid" | "mailgun" | "ses";
458
311
  from: string;
@@ -586,74 +439,6 @@ declare class PasswordPolicy {
586
439
  getConfig(): PasswordPolicyConfig;
587
440
  }
588
441
 
589
- interface LockoutConfig {
590
- maxAttempts: number;
591
- lockDuration: number;
592
- notifyUser: boolean;
593
- notifyAdmin: boolean;
594
- adminNotifyAfter: number;
595
- }
596
- interface LockoutStatus {
597
- locked: boolean;
598
- attemptsRemaining: number;
599
- lockedUntil?: Date;
600
- totalAttempts: number;
601
- }
602
- declare class AccountLockout {
603
- private redis;
604
- private prefix;
605
- private config;
606
- constructor(redis: Redis, config?: Partial<LockoutConfig>, prefix?: string);
607
- private lockKey;
608
- private historyKey;
609
- checkLockout(userId: string): Promise<LockoutStatus>;
610
- recordFailedAttempt(userId: string): Promise<LockoutStatus>;
611
- lockAccount(userId: string, duration?: number): Promise<void>;
612
- unlockAccount(userId: string): Promise<void>;
613
- resetAttempts(userId: string): Promise<void>;
614
- getLockoutHistory(userId: string, limit?: number): Promise<Date[]>;
615
- getLockoutStats(userId: string): Promise<{
616
- totalFailedAttempts: number;
617
- lockoutCount: number;
618
- lastLockout: Date | null;
619
- averageAttemptsBeforeLockout: number;
620
- }>;
621
- shouldNotifyAdmin(currentAttempts: number): boolean;
622
- getConfig(): LockoutConfig;
623
- setConfig(config: Partial<LockoutConfig>): void;
624
- }
625
-
626
- interface RateLimitConfig {
627
- window: number;
628
- max: number;
629
- }
630
- interface RateLimitResult {
631
- allowed: boolean;
632
- remaining: number;
633
- resetAt: number;
634
- retryAfter?: number;
635
- }
636
- declare class RateLimiter {
637
- private redis;
638
- private prefix;
639
- private limits;
640
- private userLimits;
641
- constructor(redis: Redis, limits?: Record<string, RateLimitConfig>, userLimits?: Record<string, RateLimitConfig>, prefix?: string);
642
- private getKey;
643
- check(type: string, identifier: string): Promise<RateLimitResult>;
644
- checkUser(type: string, userId: string, identifier: string): Promise<RateLimitResult>;
645
- reset(type: string, identifier: string): Promise<void>;
646
- resetUser(type: string, userId: string, identifier: string): Promise<void>;
647
- getStatus(type: string, identifier: string): Promise<{
648
- count: number;
649
- limit: number;
650
- remaining: number;
651
- resetAt: number;
652
- }>;
653
- setLimit(type: string, config: RateLimitConfig): void;
654
- setUserLimit(type: string, config: RateLimitConfig): void;
655
- }
656
-
657
442
  declare class InMemoryRateLimiter {
658
443
  private storage;
659
444
  private userStorage;
@@ -1319,4 +1104,4 @@ declare function defineConfig(config: {
1319
1104
  debug?: KyroConfig["debug"];
1320
1105
  }): KyroConfig;
1321
1106
 
1322
- export { AbstractBaseAdapter, AccountLockout, type AdapterOptions, type AdminStylingConfig, AnalyticsPlugin, AuditLog, AuditLogFilter, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CSSGenerator, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, Field, type FieldStyling, FindArgs, FindByIDArgs, FindResult, GlobalConfig, Hook, InMemoryAccountLockout, InMemoryAuditLogger, InMemoryAuthAdapter, InMemoryRateLimiter, JWTPayload, Kyro, type KyroAuthConfig, KyroConfig, KyroPlugin, KyroPubSub, KyroWSServer, LocalAdapter, LoginCredentials, MediaService, type MongoDBAdapterOptions, PasswordPolicy, type PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RateLimiter, RedisAuthAdapter, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, Session, type StorageConfig, type StylingConfig, type StylingMode, type ThemeBorderRadius, type ThemeColors, type ThemeConfig, type ThemeFonts, type ThemeShadows, type ThemeSpacing, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAdminStyling, createAuth, createAuthConfig, createColumnsNode, createKyro, createLocalAdapter, createLocalStorage, createTestPayload, createVersionManager, defaultDarkTheme, defaultFieldStyling, defaultLightTheme, defineConfig, deliverWebhook, deliverWithRetry, ecommerce2026Theme, fieldToZod, generateCSSVariables, generateTailwindConfig, generateWebhookSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, globalToZod, isArchived, isDraft, isPublished, normalizeRichTextDocument, normalizeRichTextValue, presetPlugins, renderRichText, resolveProvider, richTextStyles, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };
1107
+ export { AbstractBaseAdapter, type AdapterOptions, AnalyticsPlugin, AuditLog, AuditLogFilter, Auth, AuthAdapter, AuthResult, Session as AuthSession, AuthTokenConfig, AuthUser, BaseAdapter, CollectionConfig, CommentsPlugin, type CompareVersionsOptions, ConfigService, ConfigValidationError, CreateArgs, type CreateVersionOptions, type DatabaseConnectionOptions, type DatabaseType, type DatabaseType$1 as DbAdapterType, DeleteArgs, type DeliveryOptions, type DeliveryResult, Dialect, type DraftPublishConfig, type DrizzleAdapterOptions, type EmailConfig, EmailTransport, 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 PluginAPI, type PluginHooks, PluginManager, type PublishVersionOptions, RegisterData, Registry, Request$1 as Request, ReviewsPlugin, SEOPLugin, SQLiteAuthAdapter, Session, type StorageConfig, UpdateArgs, User, UserRole, type Version, type VersionAdapter, type VersionDiff, type VersionHistoryOptions, VersionManager, type VersionPublishSchedule, type VersionStatus, WebhookConfig, WebhookDelivery, WebhookPayload, WishlistPlugin, authConfig, autoBootstrap, bootstrapAdmin, buildDeliveryRecord, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createAuth, createAuthConfig, createColumnsNode, createKyro, createLocalAdapter, createLocalStorage, createTestPayload, createVersionManager, defineConfig, deliverWebhook, deliverWithRetry, fieldToZod, generateWebhookSecret, getBootstrapFromEnv, getDefaultDraftPublishConfig, globalToZod, isArchived, isDraft, isPublished, normalizeRichTextDocument, normalizeRichTextValue, presetPlugins, renderRichText, resolveProvider, richTextStyles, signPayload, validateCollection, validateConfig, validateFields, validateGlobal };