@kyro-cms/core 0.2.10 → 0.3.1

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.
@@ -1,223 +0,0 @@
1
- import { c as AuthAdapter, U as UserRole, f as AuthUser, S as Session } from './types-BSR91JFN.js';
2
- import Redis from 'ioredis';
3
-
4
- type StylingMode = 'css' | 'tailwind' | 'css-in-js' | 'styled-components' | 'vanilla-extract';
5
- interface StylingConfig {
6
- mode: StylingMode;
7
- theme?: ThemeConfig;
8
- customProperties?: Record<string, string>;
9
- }
10
- interface ThemeConfig {
11
- colors?: ThemeColors;
12
- fonts?: ThemeFonts;
13
- spacing?: ThemeSpacing;
14
- borderRadius?: ThemeBorderRadius;
15
- shadows?: ThemeShadows;
16
- breakpoints?: Record<string, string>;
17
- }
18
- interface ThemeColors {
19
- primary?: string;
20
- secondary?: string;
21
- accent?: string;
22
- background?: string;
23
- surface?: string;
24
- text?: string;
25
- textMuted?: string;
26
- border?: string;
27
- error?: string;
28
- warning?: string;
29
- success?: string;
30
- info?: string;
31
- }
32
- interface ThemeFonts {
33
- sans?: string;
34
- serif?: string;
35
- mono?: string;
36
- }
37
- interface ThemeSpacing {
38
- xs?: string;
39
- sm?: string;
40
- md?: string;
41
- lg?: string;
42
- xl?: string;
43
- '2xl'?: string;
44
- '3xl'?: string;
45
- '4xl'?: string;
46
- }
47
- interface ThemeBorderRadius {
48
- sm?: string;
49
- md?: string;
50
- lg?: string;
51
- xl?: string;
52
- full?: string;
53
- }
54
- interface ThemeShadows {
55
- sm?: string;
56
- md?: string;
57
- lg?: string;
58
- xl?: string;
59
- }
60
- declare class CSSGenerator {
61
- private config;
62
- private css;
63
- constructor(config: StylingConfig);
64
- addRule(selector: string, properties: Record<string, string>): this;
65
- addMediaQuery(breakpoint: string, rules: string[]): this;
66
- generate(): string;
67
- }
68
- declare function generateTailwindConfig(theme: ThemeConfig): Record<string, any>;
69
- declare const defaultLightTheme: ThemeConfig;
70
- declare const defaultDarkTheme: ThemeConfig;
71
- declare const ecommerce2026Theme: ThemeConfig;
72
- declare function generateCSSVariables(theme: ThemeConfig): string;
73
- interface AdminStylingConfig {
74
- mode: StylingMode;
75
- theme?: ThemeConfig;
76
- customStyles?: string;
77
- componentOverrides?: Record<string, Record<string, string>>;
78
- }
79
- declare function createAdminStyling(config: AdminStylingConfig): string;
80
- interface FieldStyling {
81
- wrapper?: Record<string, string>;
82
- label?: Record<string, string>;
83
- input?: Record<string, string>;
84
- error?: Record<string, string>;
85
- description?: Record<string, string>;
86
- }
87
- declare const defaultFieldStyling: Record<string, FieldStyling>;
88
-
89
- interface RedisAuthAdapterOptions {
90
- url?: string;
91
- host?: string;
92
- port?: number;
93
- password?: string;
94
- db?: number;
95
- keyPrefix?: string;
96
- tokenExpiration?: number;
97
- refreshTokenExpiration?: number;
98
- tls?: boolean;
99
- }
100
- declare class RedisAuthAdapter implements AuthAdapter {
101
- private redis;
102
- private prefix;
103
- private tokenExpiration;
104
- private refreshExpiration;
105
- constructor(options?: RedisAuthAdapterOptions);
106
- connect(): Promise<void>;
107
- disconnect(): Promise<void>;
108
- private userKey;
109
- private sessionKey;
110
- private refreshKey;
111
- private userByEmailKey;
112
- private passwordHistoryKey;
113
- createUser(data: {
114
- email: string;
115
- password: string;
116
- role?: UserRole;
117
- tenantId?: string;
118
- }): Promise<AuthUser>;
119
- findUserByEmail(email: string): Promise<AuthUser | null>;
120
- findUserById(userId: string): Promise<AuthUser | null>;
121
- updateUser(userId: string, data: Partial<AuthUser>): Promise<AuthUser | null>;
122
- deleteUser(userId: string): Promise<boolean>;
123
- hashPassword(password: string): Promise<string>;
124
- verifyPassword(email: string, password: string): Promise<AuthUser | null>;
125
- createSession(userId: string, data?: {
126
- ipAddress?: string;
127
- userAgent?: string;
128
- }): Promise<Session>;
129
- findSessionByToken(token: string): Promise<Session | null>;
130
- deleteSession(sessionId: string): Promise<boolean>;
131
- deleteUserSessions(userId: string): Promise<number>;
132
- addPasswordToHistory(userId: string, passwordHash: string): Promise<void>;
133
- getPasswordHistory(userId: string, count?: number): Promise<string[]>;
134
- isPasswordInHistory(password: string, userId: string, historyCount?: number): Promise<boolean>;
135
- private userToHash;
136
- private hashToUser;
137
- private sessionToHash;
138
- private hashToSession;
139
- private auditLogKey;
140
- private auditLogIndexKey;
141
- findAuditLogs(filter: {
142
- userId?: string;
143
- action?: string | string[];
144
- resource?: string;
145
- success?: boolean;
146
- limit?: number;
147
- offset?: number;
148
- }): Promise<{
149
- logs: any[];
150
- total: number;
151
- }>;
152
- createAuditLog(data: any): Promise<any>;
153
- }
154
-
155
- interface LockoutConfig {
156
- maxAttempts: number;
157
- lockDuration: number;
158
- notifyUser: boolean;
159
- notifyAdmin: boolean;
160
- adminNotifyAfter: number;
161
- }
162
- interface LockoutStatus {
163
- locked: boolean;
164
- attemptsRemaining: number;
165
- lockedUntil?: Date;
166
- totalAttempts: number;
167
- }
168
- declare class AccountLockout {
169
- private redis;
170
- private prefix;
171
- private config;
172
- constructor(redis: Redis, config?: Partial<LockoutConfig>, prefix?: string);
173
- private lockKey;
174
- private historyKey;
175
- checkLockout(userId: string): Promise<LockoutStatus>;
176
- recordFailedAttempt(userId: string): Promise<LockoutStatus>;
177
- lockAccount(userId: string, duration?: number): Promise<void>;
178
- unlockAccount(userId: string): Promise<void>;
179
- resetAttempts(userId: string): Promise<void>;
180
- getLockoutHistory(userId: string, limit?: number): Promise<Date[]>;
181
- getLockoutStats(userId: string): Promise<{
182
- totalFailedAttempts: number;
183
- lockoutCount: number;
184
- lastLockout: Date | null;
185
- averageAttemptsBeforeLockout: number;
186
- }>;
187
- shouldNotifyAdmin(currentAttempts: number): boolean;
188
- getConfig(): LockoutConfig;
189
- setConfig(config: Partial<LockoutConfig>): void;
190
- }
191
-
192
- interface RateLimitConfig {
193
- window: number;
194
- max: number;
195
- }
196
- interface RateLimitResult {
197
- allowed: boolean;
198
- remaining: number;
199
- resetAt: number;
200
- retryAfter?: number;
201
- }
202
- declare class RateLimiter {
203
- private redis;
204
- private prefix;
205
- private limits;
206
- private userLimits;
207
- constructor(redis: Redis, limits?: Record<string, RateLimitConfig>, userLimits?: Record<string, RateLimitConfig>, prefix?: string);
208
- private getKey;
209
- check(type: string, identifier: string): Promise<RateLimitResult>;
210
- checkUser(type: string, userId: string, identifier: string): Promise<RateLimitResult>;
211
- reset(type: string, identifier: string): Promise<void>;
212
- resetUser(type: string, userId: string, identifier: string): Promise<void>;
213
- getStatus(type: string, identifier: string): Promise<{
214
- count: number;
215
- limit: number;
216
- remaining: number;
217
- resetAt: number;
218
- }>;
219
- setLimit(type: string, config: RateLimitConfig): void;
220
- setUserLimit(type: string, config: RateLimitConfig): void;
221
- }
222
-
223
- export { type AdminStylingConfig as A, CSSGenerator as C, type FieldStyling as F, type LockoutConfig as L, type RateLimitConfig as R, type StylingConfig as S, type ThemeBorderRadius as T, type LockoutStatus as a, type RateLimitResult as b, type RedisAuthAdapterOptions as c, type StylingMode as d, type ThemeColors as e, type ThemeConfig as f, type ThemeFonts as g, type ThemeShadows as h, type ThemeSpacing as i, createAdminStyling as j, defaultDarkTheme as k, defaultFieldStyling as l, defaultLightTheme as m, ecommerce2026Theme as n, generateCSSVariables as o, generateTailwindConfig as p, AccountLockout as q, RateLimiter as r, RedisAuthAdapter as s };
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkBLMFBDBG_cjs = require('./chunk-BLMFBDBG.cjs');
4
- require('./chunk-G7VZBCD6.cjs');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "RedisAuthAdapter", {
9
- enumerable: true,
10
- get: function () { return chunkBLMFBDBG_cjs.RedisAuthAdapter; }
11
- });
12
- //# sourceMappingURL=redis-adapter-2N6VA7BI.cjs.map
13
- //# sourceMappingURL=redis-adapter-2N6VA7BI.cjs.map
@@ -1,4 +0,0 @@
1
- export { RedisAuthAdapter } from './chunk-GLCPGZPM.js';
2
- import './chunk-Z6ZWNWWR.js';
3
- //# sourceMappingURL=redis-adapter-RA24FNCX.js.map
4
- //# sourceMappingURL=redis-adapter-RA24FNCX.js.map